diff --git "a/.next/server/app/page.js" "b/.next/server/app/page.js" --- "a/.next/server/app/page.js" +++ "b/.next/server/app/page.js" @@ -1,4 +1,4 @@ -(()=>{var e={};e.id=974,e.ids=[974],e.modules={3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},5699:(e,t,r)=>{Promise.resolve().then(r.bind(r,90597))},6741:(e,t,r)=>{"use strict";let n,a;r.r(t),r.d(t,{default:()=>ua});var o={};r.r(o),r.d(o,{boolean:()=>i1,booleanish:()=>i2,commaOrSpaceSeparated:()=>i8,commaSeparated:()=>i6,number:()=>i4,overloadedBoolean:()=>i3,spaceSeparated:()=>i5});var i={};r.r(i),r.d(i,{attentionMarkers:()=>l2,contentInitial:()=>lJ,disable:()=>l3,document:()=>lY,flow:()=>lZ,flowInitial:()=>lX,insideSpan:()=>l1,string:()=>lQ,text:()=>l0});var s=r(60687),l=r(43210),c=r.t(l,2),u=r.n(l),d=r(16189),p=r(28602),h=r(96241),m=r(24934),f=r(68988);let g=l.forwardRef(({className:e,...t},r)=>(0,s.jsx)("textarea",{className:(0,h.cn)("flex min-h-[84px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...t}));g.displayName="Textarea";var v=r(62688);let x=(0,v.A)("file-code",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]),y=(0,v.A)("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),b=(0,v.A)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var w=r(13964),k=r(11860);let j=(0,v.A)("pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]),N=(0,v.A)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),C=(0,v.A)("hard-drive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]),S=(0,v.A)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]),E=(0,v.A)("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);var D=r(13861);let P=(0,v.A)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),M=(0,v.A)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),I=(0,v.A)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),T=(0,v.A)("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),A=Symbol.for("constructDateFrom");function R(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&A in e?e[A](t):e instanceof Date?new e.constructor(t):new Date(t)}let L={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function z(e){return (t={})=>{let r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}let O={date:z({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:z({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:z({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},F={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function q(e){return(t,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,a=r?.width?String(r.width):t;n=e.formattingValues[a]||e.formattingValues[t]}else{let t=e.defaultWidth,a=r?.width?String(r.width):e.defaultWidth;n=e.values[a]||e.values[t]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function B(e){return(t,r={})=>{let n,a=r.width,o=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;let s=i[0],l=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?function(e,t){for(let r=0;re.test(s)):function(e,t){for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}(l,e=>e.test(s));return n=e.valueCallback?e.valueCallback(c):c,{value:n=r.valueCallback?r.valueCallback(n):n,rest:t.slice(s.length)}}}let _={code:"en-US",formatDistance:(e,t,r)=>{let n,a=L[e];if(n="string"==typeof a?a:1===t?a.one:a.other.replace("{{count}}",t.toString()),r?.addSuffix)if(r.comparison&&r.comparison>0)return"in "+n;else return n+" ago";return n},formatLong:O,formatRelative:(e,t,r,n)=>F[e],localize:{ordinalNumber:(e,t)=>{let r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:q({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:q({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:q({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:q({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:q({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:function(e){return(t,r={})=>{let n=t.match(e.matchPattern);if(!n)return null;let a=n[0],o=t.match(e.parsePattern);if(!o)return null;let i=e.valueCallback?e.valueCallback(o[0]):o[0];return{value:i=r.valueCallback?r.valueCallback(i):i,rest:t.slice(a.length)}}}({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:B({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:B({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:B({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:B({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:B({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},$={};function U(e,t){return R(t||e,e)}function H(e){let t=U(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),e-r}function V(e,...t){let r=R.bind(null,e||t.find(e=>"object"==typeof e));return t.map(r)}function W(e,t){let r=U(e)-U(t);return r<0?-1:r>0?1:r}function G(e,t){return function(e,t,r){let n,a=r?.locale??$.locale??_,o=W(e,t);if(isNaN(o))throw RangeError("Invalid time value");let i=Object.assign({},r,{addSuffix:r?.addSuffix,comparison:o}),[s,l]=V(r?.in,...o>0?[t,e]:[e,t]),c=function(e,t,r){var n;return(n=void 0,e=>{let t=(n?Math[n]:Math.trunc)(e);return 0===t?0:t})((U(e)-U(t))/1e3)}(l,s),u=Math.round((c-(H(l)-H(s))/1e3)/60);if(u<2)if(r?.includeSeconds)if(c<5)return a.formatDistance("lessThanXSeconds",5,i);else if(c<10)return a.formatDistance("lessThanXSeconds",10,i);else if(c<20)return a.formatDistance("lessThanXSeconds",20,i);else if(c<40)return a.formatDistance("halfAMinute",0,i);else if(c<60)return a.formatDistance("lessThanXMinutes",1,i);else return a.formatDistance("xMinutes",1,i);else if(0===u)return a.formatDistance("lessThanXMinutes",1,i);else return a.formatDistance("xMinutes",u,i);if(u<45)return a.formatDistance("xMinutes",u,i);if(u<90)return a.formatDistance("aboutXHours",1,i);if(u<1440){let e=Math.round(u/60);return a.formatDistance("aboutXHours",e,i)}if(u<2520)return a.formatDistance("xDays",1,i);else if(u<43200){let e=Math.round(u/1440);return a.formatDistance("xDays",e,i)}else if(u<86400)return n=Math.round(u/43200),a.formatDistance("aboutXMonths",n,i);if((n=function(e,t,r){let[n,a,o]=V(void 0,e,e,t),i=W(a,o),s=Math.abs(function(e,t,r){let[n,a]=V(void 0,e,t);return 12*(n.getFullYear()-a.getFullYear())+(n.getMonth()-a.getMonth())}(a,o));if(s<1)return 0;1===a.getMonth()&&a.getDate()>27&&a.setDate(30),a.setMonth(a.getMonth()-i*s);let l=W(a,o)===-i;(function(e,t){let r=U(e,void 0);return+function(e,t){let r=U(e,t?.in);return r.setHours(23,59,59,999),r}(r,void 0)==+function(e,t){let r=U(e,t?.in),n=r.getMonth();return r.setFullYear(r.getFullYear(),n+1,0),r.setHours(23,59,59,999),r}(r,t)})(n)&&1===s&&1===W(n,o)&&(l=!1);let c=i*(s-l);return 0===c?0:c}(l,s))<12){let e=Math.round(u/43200);return a.formatDistance("xMonths",e,i)}{let e=n%12,t=Math.trunc(n/12);return e<3?a.formatDistance("aboutXYears",t,i):e<9?a.formatDistance("overXYears",t,i):a.formatDistance("almostXYears",t+1,i)}}(e,R(e,Date.now()),t)}var K=r(70569),Y=r(98599),J=r(11273),X=r(65551),Z=r(14163),Q=r(9510),ee=r(43),et=r(31355),er=r(1359),en=r(32547),ea=r(96963),eo=r(55509),ei=r(25028),es=r(46059),el=r(13495),ec="rovingFocusGroup.onEntryFocus",eu={bubbles:!1,cancelable:!0},ed="RovingFocusGroup",[ep,eh,em]=(0,Q.N)(ed),[ef,eg]=(0,J.A)(ed,[em]),[ev,ex]=ef(ed),ey=l.forwardRef((e,t)=>(0,s.jsx)(ep.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,s.jsx)(ep.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,s.jsx)(eb,{...e,ref:t})})}));ey.displayName=ed;var eb=l.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,orientation:n,loop:a=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...h}=e,m=l.useRef(null),f=(0,Y.s)(t,m),g=(0,ee.jH)(o),[v,x]=(0,X.i)({prop:i,defaultProp:c??null,onChange:u,caller:ed}),[y,b]=l.useState(!1),w=(0,el.c)(d),k=eh(r),j=l.useRef(!1),[N,C]=l.useState(0);return l.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(ec,w),()=>e.removeEventListener(ec,w)},[w]),(0,s.jsx)(ev,{scope:r,orientation:n,dir:g,loop:a,currentTabStopId:v,onItemFocus:l.useCallback(e=>x(e),[x]),onItemShiftTab:l.useCallback(()=>b(!0),[]),onFocusableItemAdd:l.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:l.useCallback(()=>C(e=>e-1),[]),children:(0,s.jsx)(Z.sG.div,{tabIndex:y||0===N?-1:0,"data-orientation":n,...h,ref:f,style:{outline:"none",...e.style},onMouseDown:(0,K.mK)(e.onMouseDown,()=>{j.current=!0}),onFocus:(0,K.mK)(e.onFocus,e=>{let t=!j.current;if(e.target===e.currentTarget&&t&&!y){let t=new CustomEvent(ec,eu);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=k().filter(e=>e.focusable);eN([e.find(e=>e.active),e.find(e=>e.id===v),...e].filter(Boolean).map(e=>e.ref.current),p)}}j.current=!1}),onBlur:(0,K.mK)(e.onBlur,()=>b(!1))})})}),ew="RovingFocusGroupItem",ek=l.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,focusable:n=!0,active:a=!1,tabStopId:o,children:i,...c}=e,u=(0,ea.B)(),d=o||u,p=ex(ew,r),h=p.currentTabStopId===d,m=eh(r),{onFocusableItemAdd:f,onFocusableItemRemove:g,currentTabStopId:v}=p;return l.useEffect(()=>{if(n)return f(),()=>g()},[n,f,g]),(0,s.jsx)(ep.ItemSlot,{scope:r,id:d,focusable:n,active:a,children:(0,s.jsx)(Z.sG.span,{tabIndex:h?0:-1,"data-orientation":p.orientation,...c,ref:t,onMouseDown:(0,K.mK)(e.onMouseDown,e=>{n?p.onItemFocus(d):e.preventDefault()}),onFocus:(0,K.mK)(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:(0,K.mK)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var n;let a=(n=e.key,"rtl"!==r?n:"ArrowLeft"===n?"ArrowRight":"ArrowRight"===n?"ArrowLeft":n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(a))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(a)))return ej[a]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=m().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();let n=r.indexOf(e.currentTarget);r=p.loop?function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(r,n+1):r.slice(n+1)}setTimeout(()=>eN(r))}}),children:"function"==typeof i?i({isCurrentTabStop:h,hasTabStop:null!=v}):i})})});ek.displayName=ew;var ej={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function eN(e,t=!1){let r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}var eC=r(8730),eS=r(63376),eE=r(42247),eD=["Enter"," "],eP=["ArrowUp","PageDown","End"],eM=["ArrowDown","PageUp","Home",...eP],eI={ltr:[...eD,"ArrowRight"],rtl:[...eD,"ArrowLeft"]},eT={ltr:["ArrowLeft"],rtl:["ArrowRight"]},eA="Menu",[eR,eL,ez]=(0,Q.N)(eA),[eO,eF]=(0,J.A)(eA,[ez,eo.Bk,eg]),eq=(0,eo.Bk)(),eB=eg(),[e_,e$]=eO(eA),[eU,eH]=eO(eA),eV=e=>{let{__scopeMenu:t,open:r=!1,children:n,dir:a,onOpenChange:o,modal:i=!0}=e,c=eq(t),[u,d]=l.useState(null),p=l.useRef(!1),h=(0,el.c)(o),m=(0,ee.jH)(a);return l.useEffect(()=>{let e=()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>p.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),(0,s.jsx)(eo.bL,{...c,children:(0,s.jsx)(e_,{scope:t,open:r,onOpenChange:h,content:u,onContentChange:d,children:(0,s.jsx)(eU,{scope:t,onClose:l.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:p,dir:m,modal:i,children:n})})})};eV.displayName=eA;var eW=l.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e,a=eq(r);return(0,s.jsx)(eo.Mz,{...a,...n,ref:t})});eW.displayName="MenuAnchor";var eG="MenuPortal",[eK,eY]=eO(eG,{forceMount:void 0}),eJ=e=>{let{__scopeMenu:t,forceMount:r,children:n,container:a}=e,o=e$(eG,t);return(0,s.jsx)(eK,{scope:t,forceMount:r,children:(0,s.jsx)(es.C,{present:r||o.open,children:(0,s.jsx)(ei.Z,{asChild:!0,container:a,children:n})})})};eJ.displayName=eG;var eX="MenuContent",[eZ,eQ]=eO(eX),e0=l.forwardRef((e,t)=>{let r=eY(eX,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,o=e$(eX,e.__scopeMenu),i=eH(eX,e.__scopeMenu);return(0,s.jsx)(eR.Provider,{scope:e.__scopeMenu,children:(0,s.jsx)(es.C,{present:n||o.open,children:(0,s.jsx)(eR.Slot,{scope:e.__scopeMenu,children:i.modal?(0,s.jsx)(e1,{...a,ref:t}):(0,s.jsx)(e2,{...a,ref:t})})})})}),e1=l.forwardRef((e,t)=>{let r=e$(eX,e.__scopeMenu),n=l.useRef(null),a=(0,Y.s)(t,n);return l.useEffect(()=>{let e=n.current;if(e)return(0,eS.Eq)(e)},[]),(0,s.jsx)(e4,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:(0,K.mK)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),e2=l.forwardRef((e,t)=>{let r=e$(eX,e.__scopeMenu);return(0,s.jsx)(e4,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),e3=(0,eC.TL)("MenuContent.ScrollLock"),e4=l.forwardRef((e,t)=>{let{__scopeMenu:r,loop:n=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:m,onDismiss:f,disableOutsideScroll:g,...v}=e,x=e$(eX,r),y=eH(eX,r),b=eq(r),w=eB(r),k=eL(r),[j,N]=l.useState(null),C=l.useRef(null),S=(0,Y.s)(t,C,x.onContentChange),E=l.useRef(0),D=l.useRef(""),P=l.useRef(0),M=l.useRef(null),I=l.useRef("right"),T=l.useRef(0),A=g?eE.A:l.Fragment,R=e=>{let t=D.current+e,r=k().filter(e=>!e.disabled),n=document.activeElement,a=r.find(e=>e.ref.current===n)?.textValue,o=function(e,t,r){var n;let a=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=r?e.indexOf(r):-1,i=(n=Math.max(o,0),e.map((t,r)=>e[(n+r)%e.length]));1===a.length&&(i=i.filter(e=>e!==r));let s=i.find(e=>e.toLowerCase().startsWith(a.toLowerCase()));return s!==r?s:void 0}(r.map(e=>e.textValue),t,a),i=r.find(e=>e.textValue===o)?.ref.current;!function e(t){D.current=t,window.clearTimeout(E.current),""!==t&&(E.current=window.setTimeout(()=>e(""),1e3))}(t),i&&setTimeout(()=>i.focus())};l.useEffect(()=>()=>window.clearTimeout(E.current),[]),(0,er.Oh)();let L=l.useCallback(e=>I.current===M.current?.side&&function(e,t){return!!t&&function(e,t){let{x:r,y:n}=e,a=!1;for(let e=0,o=t.length-1;en!=d>n&&r<(u-l)*(n-c)/(d-c)+l&&(a=!a)}return a}({x:e.clientX,y:e.clientY},t)}(e,M.current?.area),[]);return(0,s.jsx)(eZ,{scope:r,searchRef:D,onItemEnter:l.useCallback(e=>{L(e)&&e.preventDefault()},[L]),onItemLeave:l.useCallback(e=>{L(e)||(C.current?.focus(),N(null))},[L]),onTriggerLeave:l.useCallback(e=>{L(e)&&e.preventDefault()},[L]),pointerGraceTimerRef:P,onPointerGraceIntentChange:l.useCallback(e=>{M.current=e},[]),children:(0,s.jsx)(A,{...g?{as:e3,allowPinchZoom:!0}:void 0,children:(0,s.jsx)(en.n,{asChild:!0,trapped:a,onMountAutoFocus:(0,K.mK)(o,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:(0,s.jsx)(et.qW,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:m,onDismiss:f,children:(0,s.jsx)(ey,{asChild:!0,...w,dir:y.dir,orientation:"vertical",loop:n,currentTabStopId:j,onCurrentTabStopIdChange:N,onEntryFocus:(0,K.mK)(u,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,s.jsx)(eo.UC,{role:"menu","aria-orientation":"vertical","data-state":tk(x.open),"data-radix-menu-content":"",dir:y.dir,...b,...v,ref:S,style:{outline:"none",...v.style},onKeyDown:(0,K.mK)(v.onKeyDown,e=>{let t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,r=e.ctrlKey||e.altKey||e.metaKey,n=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!r&&n&&R(e.key));let a=C.current;if(e.target!==a||!eM.includes(e.key))return;e.preventDefault();let o=k().filter(e=>!e.disabled).map(e=>e.ref.current);eP.includes(e.key)&&o.reverse(),function(e){let t=document.activeElement;for(let r of e)if(r===t||(r.focus(),document.activeElement!==t))return}(o)}),onBlur:(0,K.mK)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),D.current="")}),onPointerMove:(0,K.mK)(e.onPointerMove,tC(e=>{let t=e.target,r=T.current!==e.clientX;e.currentTarget.contains(t)&&r&&(I.current=e.clientX>T.current?"right":"left",T.current=e.clientX)}))})})})})})})});e0.displayName=eX;var e5=l.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,s.jsx)(Z.sG.div,{role:"group",...n,ref:t})});e5.displayName="MenuGroup";var e6=l.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,s.jsx)(Z.sG.div,{...n,ref:t})});e6.displayName="MenuLabel";var e8="MenuItem",e9="menu.itemSelect",e7=l.forwardRef((e,t)=>{let{disabled:r=!1,onSelect:n,...a}=e,o=l.useRef(null),i=eH(e8,e.__scopeMenu),c=eQ(e8,e.__scopeMenu),u=(0,Y.s)(t,o),d=l.useRef(!1);return(0,s.jsx)(te,{...a,ref:u,disabled:r,onClick:(0,K.mK)(e.onClick,()=>{let e=o.current;if(!r&&e){let t=new CustomEvent(e9,{bubbles:!0,cancelable:!0});e.addEventListener(e9,e=>n?.(e),{once:!0}),(0,Z.hO)(e,t),t.defaultPrevented?d.current=!1:i.onClose()}}),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:(0,K.mK)(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:(0,K.mK)(e.onKeyDown,e=>{let t=""!==c.searchRef.current;r||t&&" "===e.key||eD.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});e7.displayName=e8;var te=l.forwardRef((e,t)=>{let{__scopeMenu:r,disabled:n=!1,textValue:a,...o}=e,i=eQ(e8,r),c=eB(r),u=l.useRef(null),d=(0,Y.s)(t,u),[p,h]=l.useState(!1),[m,f]=l.useState("");return l.useEffect(()=>{let e=u.current;e&&f((e.textContent??"").trim())},[o.children]),(0,s.jsx)(eR.ItemSlot,{scope:r,disabled:n,textValue:a??m,children:(0,s.jsx)(ek,{asChild:!0,...c,focusable:!n,children:(0,s.jsx)(Z.sG.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...o,ref:d,onPointerMove:(0,K.mK)(e.onPointerMove,tC(e=>{n?i.onItemLeave(e):(i.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,K.mK)(e.onPointerLeave,tC(e=>i.onItemLeave(e))),onFocus:(0,K.mK)(e.onFocus,()=>h(!0)),onBlur:(0,K.mK)(e.onBlur,()=>h(!1))})})})}),tt=l.forwardRef((e,t)=>{let{checked:r=!1,onCheckedChange:n,...a}=e;return(0,s.jsx)(tc,{scope:e.__scopeMenu,checked:r,children:(0,s.jsx)(e7,{role:"menuitemcheckbox","aria-checked":tj(r)?"mixed":r,...a,ref:t,"data-state":tN(r),onSelect:(0,K.mK)(a.onSelect,()=>n?.(!!tj(r)||!r),{checkForDefaultPrevented:!1})})})});tt.displayName="MenuCheckboxItem";var tr="MenuRadioGroup",[tn,ta]=eO(tr,{value:void 0,onValueChange:()=>{}}),to=l.forwardRef((e,t)=>{let{value:r,onValueChange:n,...a}=e,o=(0,el.c)(n);return(0,s.jsx)(tn,{scope:e.__scopeMenu,value:r,onValueChange:o,children:(0,s.jsx)(e5,{...a,ref:t})})});to.displayName=tr;var ti="MenuRadioItem",ts=l.forwardRef((e,t)=>{let{value:r,...n}=e,a=ta(ti,e.__scopeMenu),o=r===a.value;return(0,s.jsx)(tc,{scope:e.__scopeMenu,checked:o,children:(0,s.jsx)(e7,{role:"menuitemradio","aria-checked":o,...n,ref:t,"data-state":tN(o),onSelect:(0,K.mK)(n.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});ts.displayName=ti;var tl="MenuItemIndicator",[tc,tu]=eO(tl,{checked:!1}),td=l.forwardRef((e,t)=>{let{__scopeMenu:r,forceMount:n,...a}=e,o=tu(tl,r);return(0,s.jsx)(es.C,{present:n||tj(o.checked)||!0===o.checked,children:(0,s.jsx)(Z.sG.span,{...a,ref:t,"data-state":tN(o.checked)})})});td.displayName=tl;var tp=l.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,s.jsx)(Z.sG.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});tp.displayName="MenuSeparator";var th=l.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e,a=eq(r);return(0,s.jsx)(eo.i3,{...a,...n,ref:t})});th.displayName="MenuArrow";var tm="MenuSub",[tf,tg]=eO(tm),tv=e=>{let{__scopeMenu:t,children:r,open:n=!1,onOpenChange:a}=e,o=e$(tm,t),i=eq(t),[c,u]=l.useState(null),[d,p]=l.useState(null),h=(0,el.c)(a);return l.useEffect(()=>(!1===o.open&&h(!1),()=>h(!1)),[o.open,h]),(0,s.jsx)(eo.bL,{...i,children:(0,s.jsx)(e_,{scope:t,open:n,onOpenChange:h,content:d,onContentChange:p,children:(0,s.jsx)(tf,{scope:t,contentId:(0,ea.B)(),triggerId:(0,ea.B)(),trigger:c,onTriggerChange:u,children:r})})})};tv.displayName=tm;var tx="MenuSubTrigger",ty=l.forwardRef((e,t)=>{let r=e$(tx,e.__scopeMenu),n=eH(tx,e.__scopeMenu),a=tg(tx,e.__scopeMenu),o=eQ(tx,e.__scopeMenu),i=l.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=o,d={__scopeMenu:e.__scopeMenu},p=l.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return l.useEffect(()=>p,[p]),l.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),u(null)}},[c,u]),(0,s.jsx)(eW,{asChild:!0,...d,children:(0,s.jsx)(te,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":tk(r.open),...e,ref:(0,Y.t)(t,a.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:(0,K.mK)(e.onPointerMove,tC(t=>{o.onItemEnter(t),!t.defaultPrevented&&(e.disabled||r.open||i.current||(o.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{r.onOpenChange(!0),p()},100)))})),onPointerLeave:(0,K.mK)(e.onPointerLeave,tC(e=>{p();let t=r.content?.getBoundingClientRect();if(t){let n=r.content?.dataset.side,a="right"===n,i=t[a?"left":"right"],s=t[a?"right":"left"];o.onPointerGraceIntentChange({area:[{x:e.clientX+(a?-5:5),y:e.clientY},{x:i,y:t.top},{x:s,y:t.top},{x:s,y:t.bottom},{x:i,y:t.bottom}],side:n}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(e),e.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:(0,K.mK)(e.onKeyDown,t=>{let a=""!==o.searchRef.current;e.disabled||a&&" "===t.key||eI[n.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())})})})});ty.displayName=tx;var tb="MenuSubContent",tw=l.forwardRef((e,t)=>{let r=eY(eX,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,o=e$(eX,e.__scopeMenu),i=eH(eX,e.__scopeMenu),c=tg(tb,e.__scopeMenu),u=l.useRef(null),d=(0,Y.s)(t,u);return(0,s.jsx)(eR.Provider,{scope:e.__scopeMenu,children:(0,s.jsx)(es.C,{present:n||o.open,children:(0,s.jsx)(eR.Slot,{scope:e.__scopeMenu,children:(0,s.jsx)(e4,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:d,align:"start",side:"rtl"===i.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{i.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:(0,K.mK)(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:(0,K.mK)(e.onEscapeKeyDown,e=>{i.onClose(),e.preventDefault()}),onKeyDown:(0,K.mK)(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),r=eT[i.dir].includes(e.key);t&&r&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});function tk(e){return e?"open":"closed"}function tj(e){return"indeterminate"===e}function tN(e){return tj(e)?"indeterminate":e?"checked":"unchecked"}function tC(e){return t=>"mouse"===t.pointerType?e(t):void 0}tw.displayName=tb;var tS="DropdownMenu",[tE,tD]=(0,J.A)(tS,[eF]),tP=eF(),[tM,tI]=tE(tS),tT=e=>{let{__scopeDropdownMenu:t,children:r,dir:n,open:a,defaultOpen:o,onOpenChange:i,modal:c=!0}=e,u=tP(t),d=l.useRef(null),[p,h]=(0,X.i)({prop:a,defaultProp:o??!1,onChange:i,caller:tS});return(0,s.jsx)(tM,{scope:t,triggerId:(0,ea.B)(),triggerRef:d,contentId:(0,ea.B)(),open:p,onOpenChange:h,onOpenToggle:l.useCallback(()=>h(e=>!e),[h]),modal:c,children:(0,s.jsx)(eV,{...u,open:p,onOpenChange:h,dir:n,modal:c,children:r})})};tT.displayName=tS;var tA="DropdownMenuTrigger",tR=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,disabled:n=!1,...a}=e,o=tI(tA,r),i=tP(r);return(0,s.jsx)(eW,{asChild:!0,...i,children:(0,s.jsx)(Z.sG.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...a,ref:(0,Y.t)(t,o.triggerRef),onPointerDown:(0,K.mK)(e.onPointerDown,e=>{!n&&0===e.button&&!1===e.ctrlKey&&(o.onOpenToggle(),o.open||e.preventDefault())}),onKeyDown:(0,K.mK)(e.onKeyDown,e=>{!n&&(["Enter"," "].includes(e.key)&&o.onOpenToggle(),"ArrowDown"===e.key&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});tR.displayName=tA;var tL=e=>{let{__scopeDropdownMenu:t,...r}=e,n=tP(t);return(0,s.jsx)(eJ,{...n,...r})};tL.displayName="DropdownMenuPortal";var tz="DropdownMenuContent",tO=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tI(tz,r),o=tP(r),i=l.useRef(!1);return(0,s.jsx)(e0,{id:a.contentId,"aria-labelledby":a.triggerId,...o,...n,ref:t,onCloseAutoFocus:(0,K.mK)(e.onCloseAutoFocus,e=>{i.current||a.triggerRef.current?.focus(),i.current=!1,e.preventDefault()}),onInteractOutside:(0,K.mK)(e.onInteractOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;(!a.modal||n)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});tO.displayName=tz,l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(e5,{...a,...n,ref:t})}).displayName="DropdownMenuGroup",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(e6,{...a,...n,ref:t})}).displayName="DropdownMenuLabel";var tF=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(e7,{...a,...n,ref:t})});tF.displayName="DropdownMenuItem",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(tt,{...a,...n,ref:t})}).displayName="DropdownMenuCheckboxItem",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(to,{...a,...n,ref:t})}).displayName="DropdownMenuRadioGroup",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(ts,{...a,...n,ref:t})}).displayName="DropdownMenuRadioItem",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(td,{...a,...n,ref:t})}).displayName="DropdownMenuItemIndicator";var tq=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(tp,{...a,...n,ref:t})});function tB({...e}){return(0,s.jsx)(tT,{"data-slot":"dropdown-menu",...e})}function t_({...e}){return(0,s.jsx)(tR,{"data-slot":"dropdown-menu-trigger",...e})}function t$({className:e,sideOffset:t=4,...r}){return(0,s.jsx)(tL,{children:(0,s.jsx)(tO,{"data-slot":"dropdown-menu-content",sideOffset:t,className:(0,h.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-40 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-lg",e),...r})})}function tU({className:e,inset:t,variant:r="default",...n}){return(0,s.jsx)(tF,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":r,className:(0,h.cn)("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n})}function tH({className:e,...t}){return(0,s.jsx)(tq,{"data-slot":"dropdown-menu-separator",className:(0,h.cn)("bg-border -mx-1 my-1 h-px",e),...t})}tq.displayName="DropdownMenuSeparator",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(th,{...a,...n,ref:t})}).displayName="DropdownMenuArrow",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(ty,{...a,...n,ref:t})}).displayName="DropdownMenuSubTrigger",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tP(r);return(0,s.jsx)(tw,{...a,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}).displayName="DropdownMenuSubContent";var tV=r(52581);function tW({project:e,onSelect:t,onDelete:r,onExport:n,onExportZip:a,onDuplicate:o,onPreview:i,onUpdate:c,viewMode:u="grid",forceMenuOpen:d=!1,highlightExport:v=!1}){let[A,R]=(0,l.useState)(!1),[L,z]=(0,l.useState)(e.name),[O,F]=(0,l.useState)(e.description||""),[q,B]=(0,l.useState)(null),[_,$]=(0,l.useState)(!0),[U,H]=(0,l.useState)(!1),V=async()=>{if(!L.trim()){tV.oR.error("Project name cannot be empty"),z(e.name),R(!1);return}if(L.length>50)return void tV.oR.error("Project name must be 50 characters or less");if(O.length>200)return void tV.oR.error("Description must be 200 characters or less");try{e.name=L.trim(),e.description=O.trim()||void 0,await p.OP.updateProject(e),c(e),R(!1),tV.oR.success("Project updated")}catch(t){h.v.error("Failed to update project:",t),tV.oR.error("Failed to update project"),z(e.name),F(e.description||"")}},W=()=>{z(e.name),F(e.description||""),R(!1)},K=e=>{if(d)return void H(!0);H(e)},Y=()=>q?Object.entries(q.fileTypes).sort(([,e],[,t])=>t-e).slice(0,3):[],J=e=>{let t=e.toLowerCase();return["html","htm"].includes(t)?(0,s.jsx)(x,{className:"h-3 w-3"}):["css","scss","sass"].includes(t)?(0,s.jsx)(y,{className:"h-3 w-3"}):["js","jsx","ts","tsx"].includes(t)?(0,s.jsx)(x,{className:"h-3 w-3"}):["png","jpg","jpeg","gif","svg"].includes(t)?(0,s.jsx)(b,{className:"h-3 w-3"}):(0,s.jsx)(y,{className:"h-3 w-3"})},X=e=>e&&0!==e?`$${e.toFixed(2)}`:null;return"list"===u?(0,s.jsx)("div",{className:`border border-border rounded-lg p-4 hover:shadow-md transition-all cursor-pointer hover:border-primary/50 ${v?"ring-2 ring-primary/70 animate-ring-opacity":""}`,style:{background:"linear-gradient(var(--project-card-tint), var(--project-card-tint)), var(--card)"},onClick:()=>t(e),children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("div",{className:"flex-1 min-w-0",children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[A?(0,s.jsxs)("div",{className:"flex items-center gap-2",onClick:e=>e.stopPropagation(),children:[(0,s.jsx)(f.p,{value:L,onChange:e=>z(e.target.value),onKeyDown:e=>{"Enter"===e.key&&V(),"Escape"===e.key&&W()},className:"h-7 text-sm",autoFocus:!0,maxLength:50}),(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:[L.length,"/50"]}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:V,children:(0,s.jsx)(w.A,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:W,children:(0,s.jsx)(k.A,{className:"h-3 w-3"})})]}):(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("h3",{className:"font-semibold truncate",children:e.name}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5 opacity-0 group-hover:opacity-100",onClick:e=>{e.stopPropagation(),R(!0)},children:(0,s.jsx)(j,{className:"h-3 w-3"})})]}),e.description&&!A&&(0,s.jsx)("span",{className:"text-sm text-muted-foreground truncate max-w-md",children:e.description})]})}),(0,s.jsxs)("div",{className:"flex items-center gap-4 ml-4",children:[q&&(0,s.jsxs)("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(N,{className:"h-4 w-4"}),q.fileCount," files"]}),(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(C,{className:"h-4 w-4"}),q.formattedSize]}),e.costTracking?.totalCost&&(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(S,{className:"h-4 w-4"}),X(e.costTracking.totalCost)]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:G(e.updatedAt,{addSuffix:!0})}),(0,s.jsxs)(tB,{open:!!d||U,onOpenChange:K,children:[(0,s.jsx)(t_,{asChild:!0,onClick:e=>e.stopPropagation(),"data-tour-id":v?"project-actions-trigger":void 0,children:(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-8 w-8",children:(0,s.jsx)(E,{className:"h-4 w-4"})})}),(0,s.jsxs)(t$,{align:"end",children:[(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),i(e)},children:[(0,s.jsx)(D.A,{className:"mr-2 h-4 w-4"}),"Preview"]}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),o(e)},children:[(0,s.jsx)(P,{className:"mr-2 h-4 w-4"}),"Duplicate"]}),(0,s.jsx)(tH,{}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),a(e)},children:[(0,s.jsx)(M,{className:"mr-2 h-4 w-4"}),"Export as ZIP"]}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),n(e)},"data-tour-id":v?"project-export-json":void 0,children:[(0,s.jsx)(I,{className:"mr-2 h-4 w-4"}),"Export as JSON"]}),(0,s.jsx)(tH,{}),(0,s.jsxs)(tU,{className:"text-destructive",onClick:t=>{t.stopPropagation(),r(e)},children:[(0,s.jsx)(T,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})]})]})]})}):(0,s.jsx)("div",{className:`border border-border rounded-lg p-4 hover:shadow-lg transition-all cursor-pointer hover:border-primary/50 group ${v?"ring-2 ring-primary/70 animate-ring-opacity":""}`,style:{background:"linear-gradient(var(--project-card-tint), var(--project-card-tint)), var(--card)"},onClick:()=>t(e),"data-tour-id":"project-card",children:(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex justify-between items-start",children:[A?(0,s.jsxs)("div",{className:"flex-1",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(f.p,{value:L,onChange:e=>z(e.target.value),onKeyDown:e=>{"Enter"===e.key&&!1===e.shiftKey&&(e.preventDefault(),V()),"Escape"===e.key&&W()},className:"h-8 text-sm font-semibold",autoFocus:!0,maxLength:50}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:V,children:(0,s.jsx)(w.A,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:W,children:(0,s.jsx)(k.A,{className:"h-3 w-3"})})]}),(0,s.jsxs)("span",{className:"text-xs text-muted-foreground mt-1",children:[L.length,"/50"]})]}):(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold text-lg truncate flex-1",children:e.name}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5 opacity-0 group-hover:opacity-100 transition-opacity",onClick:e=>{e.stopPropagation(),R(!0)},children:(0,s.jsx)(j,{className:"h-3 w-3"})})]}),(0,s.jsxs)(tB,{open:!!d||U,onOpenChange:K,children:[(0,s.jsx)(t_,{asChild:!0,onClick:e=>e.stopPropagation(),"data-tour-id":v?"project-actions-trigger":void 0,children:(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-8 w-8",children:(0,s.jsx)(E,{className:"h-4 w-4"})})}),(0,s.jsxs)(t$,{align:"end",children:[(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),i(e)},children:[(0,s.jsx)(D.A,{className:"mr-2 h-4 w-4"}),"Preview"]}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),o(e)},children:[(0,s.jsx)(P,{className:"mr-2 h-4 w-4"}),"Duplicate"]}),(0,s.jsx)(tH,{}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),a(e)},children:[(0,s.jsx)(M,{className:"mr-2 h-4 w-4"}),"Export as ZIP"]}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),n(e)},"data-tour-id":v?"project-export-json":void 0,children:[(0,s.jsx)(I,{className:"mr-2 h-4 w-4"}),"Export as JSON"]}),(0,s.jsx)(tH,{}),(0,s.jsxs)(tU,{className:"text-destructive",onClick:t=>{t.stopPropagation(),r(e)},children:[(0,s.jsx)(T,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})]}),A?(0,s.jsxs)("div",{onClick:e=>e.stopPropagation(),children:[(0,s.jsx)(g,{value:O,onChange:e=>F(e.target.value),onKeyDown:e=>{"Escape"===e.key&&W()},placeholder:"Add a description...",className:"min-h-[60px] text-sm resize-none",maxLength:200}),(0,s.jsx)("div",{className:"flex items-center justify-between mt-1",children:(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:[O.length,"/200"]})})]}):(0,s.jsx)("div",{className:"min-h-[40px]",children:e.description?(0,s.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-2",children:e.description}):(0,s.jsx)("p",{className:"text-sm text-muted-foreground/50 italic",children:"No description"})}),_?(0,s.jsx)("div",{className:"h-6 bg-muted animate-pulse rounded"}):q&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground pt-2 border-t",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(N,{className:"h-4 w-4"}),q.fileCount," ",1===q.fileCount?"file":"files"]}),(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(C,{className:"h-4 w-4"}),q.formattedSize]}),e.costTracking?.totalCost&&e.costTracking.totalCost>0&&(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(S,{className:"h-4 w-4"}),X(e.costTracking.totalCost)]})]}),Y().length>0&&(0,s.jsx)("div",{className:"flex items-center gap-3 text-xs",children:Y().map(([e,t])=>(0,s.jsxs)("div",{className:"flex items-center gap-1 text-muted-foreground",children:[J(e),(0,s.jsxs)("span",{children:[e," (",t,")"]})]},e))})]}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground pt-2 border-t",children:(0,s.jsxs)("p",{children:["Updated ",G(e.updatedAt,{addSuffix:!0})]})})]})})}var tG=r(22106),tK=r(78122);let tY=(0,v.A)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),tJ=(0,v.A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),tX=(0,v.A)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]),tZ=(0,v.A)("crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]),tQ=(0,v.A)("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]),t0=(0,v.A)("tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]),t1=(0,v.A)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);var t2=r(63974);let t3={mobile:{width:"375px",height:"100%",maxHeight:"667px"},tablet:{width:"768px",height:"100%",maxHeight:"1024px"},desktop:{width:"100%",height:"100%",maxHeight:"900px",maxWidth:"1440px"},responsive:{width:"100%",height:"100%"}};function t4({projectId:e,refreshTrigger:t,onFocusSelection:r,hasFocusTarget:n=!1,onClose:a}){let[o,i]=(0,l.useState)(null),[c,u]=(0,l.useState)("/"),[d,f]=(0,l.useState)(!0),[g,v]=(0,l.useState)(null),[x,y]=(0,l.useState)("tablet"),[b,w]=(0,l.useState)(["/"]),[j,N]=(0,l.useState)(0),[C,S]=(0,l.useState)(!1),[E,P]=(0,l.useState)(!1),M=(0,l.useRef)(null),I=(0,l.useRef)(null),T=(0,l.useRef)(null),A=(0,l.useRef)("/"),R=(0,l.useRef)(null),L=(0,l.useRef)(!1),z=(0,l.useCallback)(e=>{if(M.current&&M.current.contentWindow)try{M.current.contentWindow.postMessage(e,"*")}catch(e){h.v.warn("Failed to communicate with preview iframe",e)}},[]),O=(0,l.useRef)(!1),F=(0,l.useRef)(null),q=(0,l.useRef)(null),B=(0,l.useRef)(null),_=()=>(0,s.jsxs)("div",{className:"p-3 border-b bg-muted/70 flex items-center gap-2",children:[(0,s.jsx)(D.A,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-preview-active)"}}),a?(0,s.jsxs)("button",{type:"button",onClick:a,"aria-label":"Hide preview",className:"relative hidden h-6 w-6 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-destructive md:flex group",children:[(0,s.jsx)(D.A,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-preview-active)"}}),(0,s.jsx)(k.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}):(0,s.jsx)(D.A,{className:"hidden h-4 w-4 md:inline-flex",style:{color:"var(--button-preview-active)"}}),(0,s.jsx)("h3",{className:"text-sm font-medium",children:"Live Preview"})]}),$=(0,l.useCallback)(async(t=!1,r=!0)=>{r&&f(!0),v(null);try{await p.OP.init();let r=t?A.current:null;I.current&&I.current.cleanupBlobUrls();let n=new tG.B(p.OP,e);I.current=n;let a=await n.compileProject();i(a),T.current=a;let o=r;o||(o=a.blobUrls.has("/index.html")?"/":a.entryPoint||(a.routes.length>0?a.routes[0].path:"/")),H(o,a)}catch(e){v(e instanceof Error?e.message:"Failed to compile project"),h.v.error("Compilation error:",e)}finally{r&&f(!1)}},[e]),U=(0,l.useCallback)((e=!1,t=!0)=>{if(O.current){let r=F.current;F.current={preserve:(r?.preserve??!1)||e,showLoading:(r?.showLoading??!1)||t};return}(async(e,t)=>{O.current=!0;try{await $(e,t)}finally{O.current=!1;let e=F.current;F.current=null,e&&U(e.preserve,e.showLoading)}})(e,t)},[$]);(0,l.useCallback)((e=!1,t=!1)=>{let r=B.current;B.current={preserve:(r?.preserve??!1)||e,showLoading:(r?.showLoading??!1)||t},q.current&&window.clearTimeout(q.current),q.current=window.setTimeout(()=>{let e=B.current;B.current=null,q.current=null,e&&U(e.preserve,e.showLoading)},150)},[U]);let H=(e,t)=>{let r,n=t||T.current||o;if(!n)return void h.v.warn("No compiled project available");if(L.current?P(!1):z({type:"selector-toggle",active:!1}),!M.current||!C){R.current=e;return}let a=e;a.startsWith("/")||(a="/"+a);let i=n.routes.find(e=>e.path===a);r=i?i.file:"/"===a?"/index.html":a+".html";let s=n.files.find(e=>e.path===r);if(!s){v(`Page not found: ${e}`),n.files.find(e=>"/index.html"===e.path||"index.html"===e.path)&&"/"!==e&&H("/",t);return}let l="string"==typeof s.content?s.content:new TextDecoder().decode(s.content);l=(l=(l=l.replace(/href="([^"]+)"/g,(e,t)=>{if(!t.endsWith(".css")||t.startsWith("http")||t.startsWith("//"))return e;let r=t.startsWith("/")?t:"/"+t,a=n.blobUrls.get(r);return a?`href="${a}"`:e})).replace(/src="([^"]+)"/g,(e,t)=>{if(!t.endsWith(".js")||t.startsWith("http")||t.startsWith("//"))return e;let r=t.startsWith("/")?t:"/"+t,a=n.blobUrls.get(r);return a?`src="${a}"`:e})).replace(/src="([^"]+\.(png|jpg|jpeg|gif|svg|webp))"/gi,(e,t)=>{let r=t.startsWith("/")?t:"/"+t,a=n.blobUrls.get(r);return a?`src="${a}"`:e});let c=` +(()=>{var e={};e.id=974,e.ids=[974],e.modules={3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},5699:(e,t,r)=>{Promise.resolve().then(r.bind(r,90597))},9999:(e,t,r)=>{"use strict";let n,a;r.r(t),r.d(t,{default:()=>us});var i={};r.r(i),r.d(i,{boolean:()=>o1,booleanish:()=>o2,commaOrSpaceSeparated:()=>o8,commaSeparated:()=>o6,number:()=>o4,overloadedBoolean:()=>o3,spaceSeparated:()=>o5});var o={};r.r(o),r.d(o,{attentionMarkers:()=>l2,contentInitial:()=>lJ,disable:()=>l3,document:()=>lY,flow:()=>lZ,flowInitial:()=>lX,insideSpan:()=>l1,string:()=>lQ,text:()=>l0});var s=r(60687),l=r(43210),c=r.t(l,2),u=r.n(l),d=r(16189),p=r(28602),h=r(96241),m=r(24934),f=r(68988);let g=l.forwardRef(({className:e,...t},r)=>(0,s.jsx)("textarea",{className:(0,h.cn)("flex min-h-[84px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...t}));g.displayName="Textarea";var v=r(62688);let x=(0,v.A)("file-code",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]),y=(0,v.A)("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),b=(0,v.A)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var w=r(13964),k=r(11860);let j=(0,v.A)("pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]),N=(0,v.A)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),C=(0,v.A)("hard-drive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]),S=(0,v.A)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]),E=(0,v.A)("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);var D=r(13861);let M=(0,v.A)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),P=(0,v.A)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),T=(0,v.A)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),I=(0,v.A)("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),A=Symbol.for("constructDateFrom");function R(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&A in e?e[A](t):e instanceof Date?new e.constructor(t):new Date(t)}let L={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function z(e){return (t={})=>{let r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}let O={date:z({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:z({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:z({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},F={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function _(e){return(t,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,a=r?.width?String(r.width):t;n=e.formattingValues[a]||e.formattingValues[t]}else{let t=e.defaultWidth,a=r?.width?String(r.width):e.defaultWidth;n=e.values[a]||e.values[t]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function q(e){return(t,r={})=>{let n,a=r.width,i=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;let s=o[0],l=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?function(e,t){for(let r=0;re.test(s)):function(e,t){for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}(l,e=>e.test(s));return n=e.valueCallback?e.valueCallback(c):c,{value:n=r.valueCallback?r.valueCallback(n):n,rest:t.slice(s.length)}}}let B={code:"en-US",formatDistance:(e,t,r)=>{let n,a=L[e];if(n="string"==typeof a?a:1===t?a.one:a.other.replace("{{count}}",t.toString()),r?.addSuffix)if(r.comparison&&r.comparison>0)return"in "+n;else return n+" ago";return n},formatLong:O,formatRelative:(e,t,r,n)=>F[e],localize:{ordinalNumber:(e,t)=>{let r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:_({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:_({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:_({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:_({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:_({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:function(e){return(t,r={})=>{let n=t.match(e.matchPattern);if(!n)return null;let a=n[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];return{value:o=r.valueCallback?r.valueCallback(o):o,rest:t.slice(a.length)}}}({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:q({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:q({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:q({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:q({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:q({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},$={};function U(e,t){return R(t||e,e)}function H(e){let t=U(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),e-r}function V(e,...t){let r=R.bind(null,e||t.find(e=>"object"==typeof e));return t.map(r)}function W(e,t){let r=U(e)-U(t);return r<0?-1:r>0?1:r}function G(e,t){return function(e,t,r){let n,a=r?.locale??$.locale??B,i=W(e,t);if(isNaN(i))throw RangeError("Invalid time value");let o=Object.assign({},r,{addSuffix:r?.addSuffix,comparison:i}),[s,l]=V(r?.in,...i>0?[t,e]:[e,t]),c=function(e,t,r){var n;return(n=void 0,e=>{let t=(n?Math[n]:Math.trunc)(e);return 0===t?0:t})((U(e)-U(t))/1e3)}(l,s),u=Math.round((c-(H(l)-H(s))/1e3)/60);if(u<2)if(r?.includeSeconds)if(c<5)return a.formatDistance("lessThanXSeconds",5,o);else if(c<10)return a.formatDistance("lessThanXSeconds",10,o);else if(c<20)return a.formatDistance("lessThanXSeconds",20,o);else if(c<40)return a.formatDistance("halfAMinute",0,o);else if(c<60)return a.formatDistance("lessThanXMinutes",1,o);else return a.formatDistance("xMinutes",1,o);else if(0===u)return a.formatDistance("lessThanXMinutes",1,o);else return a.formatDistance("xMinutes",u,o);if(u<45)return a.formatDistance("xMinutes",u,o);if(u<90)return a.formatDistance("aboutXHours",1,o);if(u<1440){let e=Math.round(u/60);return a.formatDistance("aboutXHours",e,o)}if(u<2520)return a.formatDistance("xDays",1,o);else if(u<43200){let e=Math.round(u/1440);return a.formatDistance("xDays",e,o)}else if(u<86400)return n=Math.round(u/43200),a.formatDistance("aboutXMonths",n,o);if((n=function(e,t,r){let[n,a,i]=V(void 0,e,e,t),o=W(a,i),s=Math.abs(function(e,t,r){let[n,a]=V(void 0,e,t);return 12*(n.getFullYear()-a.getFullYear())+(n.getMonth()-a.getMonth())}(a,i));if(s<1)return 0;1===a.getMonth()&&a.getDate()>27&&a.setDate(30),a.setMonth(a.getMonth()-o*s);let l=W(a,i)===-o;(function(e,t){let r=U(e,void 0);return+function(e,t){let r=U(e,t?.in);return r.setHours(23,59,59,999),r}(r,void 0)==+function(e,t){let r=U(e,t?.in),n=r.getMonth();return r.setFullYear(r.getFullYear(),n+1,0),r.setHours(23,59,59,999),r}(r,t)})(n)&&1===s&&1===W(n,i)&&(l=!1);let c=o*(s-l);return 0===c?0:c}(l,s))<12){let e=Math.round(u/43200);return a.formatDistance("xMonths",e,o)}{let e=n%12,t=Math.trunc(n/12);return e<3?a.formatDistance("aboutXYears",t,o):e<9?a.formatDistance("overXYears",t,o):a.formatDistance("almostXYears",t+1,o)}}(e,R(e,Date.now()),t)}var K=r(70569),Y=r(98599),J=r(11273),X=r(65551),Z=r(14163),Q=r(9510),ee=r(43),et=r(31355),er=r(1359),en=r(32547),ea=r(96963),ei=r(55509),eo=r(25028),es=r(46059),el=r(13495),ec="rovingFocusGroup.onEntryFocus",eu={bubbles:!1,cancelable:!0},ed="RovingFocusGroup",[ep,eh,em]=(0,Q.N)(ed),[ef,eg]=(0,J.A)(ed,[em]),[ev,ex]=ef(ed),ey=l.forwardRef((e,t)=>(0,s.jsx)(ep.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,s.jsx)(ep.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,s.jsx)(eb,{...e,ref:t})})}));ey.displayName=ed;var eb=l.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,orientation:n,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...h}=e,m=l.useRef(null),f=(0,Y.s)(t,m),g=(0,ee.jH)(i),[v,x]=(0,X.i)({prop:o,defaultProp:c??null,onChange:u,caller:ed}),[y,b]=l.useState(!1),w=(0,el.c)(d),k=eh(r),j=l.useRef(!1),[N,C]=l.useState(0);return l.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(ec,w),()=>e.removeEventListener(ec,w)},[w]),(0,s.jsx)(ev,{scope:r,orientation:n,dir:g,loop:a,currentTabStopId:v,onItemFocus:l.useCallback(e=>x(e),[x]),onItemShiftTab:l.useCallback(()=>b(!0),[]),onFocusableItemAdd:l.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:l.useCallback(()=>C(e=>e-1),[]),children:(0,s.jsx)(Z.sG.div,{tabIndex:y||0===N?-1:0,"data-orientation":n,...h,ref:f,style:{outline:"none",...e.style},onMouseDown:(0,K.mK)(e.onMouseDown,()=>{j.current=!0}),onFocus:(0,K.mK)(e.onFocus,e=>{let t=!j.current;if(e.target===e.currentTarget&&t&&!y){let t=new CustomEvent(ec,eu);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=k().filter(e=>e.focusable);eN([e.find(e=>e.active),e.find(e=>e.id===v),...e].filter(Boolean).map(e=>e.ref.current),p)}}j.current=!1}),onBlur:(0,K.mK)(e.onBlur,()=>b(!1))})})}),ew="RovingFocusGroupItem",ek=l.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,focusable:n=!0,active:a=!1,tabStopId:i,children:o,...c}=e,u=(0,ea.B)(),d=i||u,p=ex(ew,r),h=p.currentTabStopId===d,m=eh(r),{onFocusableItemAdd:f,onFocusableItemRemove:g,currentTabStopId:v}=p;return l.useEffect(()=>{if(n)return f(),()=>g()},[n,f,g]),(0,s.jsx)(ep.ItemSlot,{scope:r,id:d,focusable:n,active:a,children:(0,s.jsx)(Z.sG.span,{tabIndex:h?0:-1,"data-orientation":p.orientation,...c,ref:t,onMouseDown:(0,K.mK)(e.onMouseDown,e=>{n?p.onItemFocus(d):e.preventDefault()}),onFocus:(0,K.mK)(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:(0,K.mK)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var n;let a=(n=e.key,"rtl"!==r?n:"ArrowLeft"===n?"ArrowRight":"ArrowRight"===n?"ArrowLeft":n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(a))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(a)))return ej[a]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=m().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();let n=r.indexOf(e.currentTarget);r=p.loop?function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(r,n+1):r.slice(n+1)}setTimeout(()=>eN(r))}}),children:"function"==typeof o?o({isCurrentTabStop:h,hasTabStop:null!=v}):o})})});ek.displayName=ew;var ej={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function eN(e,t=!1){let r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}var eC=r(8730),eS=r(63376),eE=r(42247),eD=["Enter"," "],eM=["ArrowUp","PageDown","End"],eP=["ArrowDown","PageUp","Home",...eM],eT={ltr:[...eD,"ArrowRight"],rtl:[...eD,"ArrowLeft"]},eI={ltr:["ArrowLeft"],rtl:["ArrowRight"]},eA="Menu",[eR,eL,ez]=(0,Q.N)(eA),[eO,eF]=(0,J.A)(eA,[ez,ei.Bk,eg]),e_=(0,ei.Bk)(),eq=eg(),[eB,e$]=eO(eA),[eU,eH]=eO(eA),eV=e=>{let{__scopeMenu:t,open:r=!1,children:n,dir:a,onOpenChange:i,modal:o=!0}=e,c=e_(t),[u,d]=l.useState(null),p=l.useRef(!1),h=(0,el.c)(i),m=(0,ee.jH)(a);return l.useEffect(()=>{let e=()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>p.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),(0,s.jsx)(ei.bL,{...c,children:(0,s.jsx)(eB,{scope:t,open:r,onOpenChange:h,content:u,onContentChange:d,children:(0,s.jsx)(eU,{scope:t,onClose:l.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:p,dir:m,modal:o,children:n})})})};eV.displayName=eA;var eW=l.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e,a=e_(r);return(0,s.jsx)(ei.Mz,{...a,...n,ref:t})});eW.displayName="MenuAnchor";var eG="MenuPortal",[eK,eY]=eO(eG,{forceMount:void 0}),eJ=e=>{let{__scopeMenu:t,forceMount:r,children:n,container:a}=e,i=e$(eG,t);return(0,s.jsx)(eK,{scope:t,forceMount:r,children:(0,s.jsx)(es.C,{present:r||i.open,children:(0,s.jsx)(eo.Z,{asChild:!0,container:a,children:n})})})};eJ.displayName=eG;var eX="MenuContent",[eZ,eQ]=eO(eX),e0=l.forwardRef((e,t)=>{let r=eY(eX,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,i=e$(eX,e.__scopeMenu),o=eH(eX,e.__scopeMenu);return(0,s.jsx)(eR.Provider,{scope:e.__scopeMenu,children:(0,s.jsx)(es.C,{present:n||i.open,children:(0,s.jsx)(eR.Slot,{scope:e.__scopeMenu,children:o.modal?(0,s.jsx)(e1,{...a,ref:t}):(0,s.jsx)(e2,{...a,ref:t})})})})}),e1=l.forwardRef((e,t)=>{let r=e$(eX,e.__scopeMenu),n=l.useRef(null),a=(0,Y.s)(t,n);return l.useEffect(()=>{let e=n.current;if(e)return(0,eS.Eq)(e)},[]),(0,s.jsx)(e4,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:(0,K.mK)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),e2=l.forwardRef((e,t)=>{let r=e$(eX,e.__scopeMenu);return(0,s.jsx)(e4,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),e3=(0,eC.TL)("MenuContent.ScrollLock"),e4=l.forwardRef((e,t)=>{let{__scopeMenu:r,loop:n=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:m,onDismiss:f,disableOutsideScroll:g,...v}=e,x=e$(eX,r),y=eH(eX,r),b=e_(r),w=eq(r),k=eL(r),[j,N]=l.useState(null),C=l.useRef(null),S=(0,Y.s)(t,C,x.onContentChange),E=l.useRef(0),D=l.useRef(""),M=l.useRef(0),P=l.useRef(null),T=l.useRef("right"),I=l.useRef(0),A=g?eE.A:l.Fragment,R=e=>{let t=D.current+e,r=k().filter(e=>!e.disabled),n=document.activeElement,a=r.find(e=>e.ref.current===n)?.textValue,i=function(e,t,r){var n;let a=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=r?e.indexOf(r):-1,o=(n=Math.max(i,0),e.map((t,r)=>e[(n+r)%e.length]));1===a.length&&(o=o.filter(e=>e!==r));let s=o.find(e=>e.toLowerCase().startsWith(a.toLowerCase()));return s!==r?s:void 0}(r.map(e=>e.textValue),t,a),o=r.find(e=>e.textValue===i)?.ref.current;!function e(t){D.current=t,window.clearTimeout(E.current),""!==t&&(E.current=window.setTimeout(()=>e(""),1e3))}(t),o&&setTimeout(()=>o.focus())};l.useEffect(()=>()=>window.clearTimeout(E.current),[]),(0,er.Oh)();let L=l.useCallback(e=>T.current===P.current?.side&&function(e,t){return!!t&&function(e,t){let{x:r,y:n}=e,a=!1;for(let e=0,i=t.length-1;en!=d>n&&r<(u-l)*(n-c)/(d-c)+l&&(a=!a)}return a}({x:e.clientX,y:e.clientY},t)}(e,P.current?.area),[]);return(0,s.jsx)(eZ,{scope:r,searchRef:D,onItemEnter:l.useCallback(e=>{L(e)&&e.preventDefault()},[L]),onItemLeave:l.useCallback(e=>{L(e)||(C.current?.focus(),N(null))},[L]),onTriggerLeave:l.useCallback(e=>{L(e)&&e.preventDefault()},[L]),pointerGraceTimerRef:M,onPointerGraceIntentChange:l.useCallback(e=>{P.current=e},[]),children:(0,s.jsx)(A,{...g?{as:e3,allowPinchZoom:!0}:void 0,children:(0,s.jsx)(en.n,{asChild:!0,trapped:a,onMountAutoFocus:(0,K.mK)(i,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,s.jsx)(et.qW,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:m,onDismiss:f,children:(0,s.jsx)(ey,{asChild:!0,...w,dir:y.dir,orientation:"vertical",loop:n,currentTabStopId:j,onCurrentTabStopIdChange:N,onEntryFocus:(0,K.mK)(u,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,s.jsx)(ei.UC,{role:"menu","aria-orientation":"vertical","data-state":tk(x.open),"data-radix-menu-content":"",dir:y.dir,...b,...v,ref:S,style:{outline:"none",...v.style},onKeyDown:(0,K.mK)(v.onKeyDown,e=>{let t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,r=e.ctrlKey||e.altKey||e.metaKey,n=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!r&&n&&R(e.key));let a=C.current;if(e.target!==a||!eP.includes(e.key))return;e.preventDefault();let i=k().filter(e=>!e.disabled).map(e=>e.ref.current);eM.includes(e.key)&&i.reverse(),function(e){let t=document.activeElement;for(let r of e)if(r===t||(r.focus(),document.activeElement!==t))return}(i)}),onBlur:(0,K.mK)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),D.current="")}),onPointerMove:(0,K.mK)(e.onPointerMove,tC(e=>{let t=e.target,r=I.current!==e.clientX;e.currentTarget.contains(t)&&r&&(T.current=e.clientX>I.current?"right":"left",I.current=e.clientX)}))})})})})})})});e0.displayName=eX;var e5=l.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,s.jsx)(Z.sG.div,{role:"group",...n,ref:t})});e5.displayName="MenuGroup";var e6=l.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,s.jsx)(Z.sG.div,{...n,ref:t})});e6.displayName="MenuLabel";var e8="MenuItem",e9="menu.itemSelect",e7=l.forwardRef((e,t)=>{let{disabled:r=!1,onSelect:n,...a}=e,i=l.useRef(null),o=eH(e8,e.__scopeMenu),c=eQ(e8,e.__scopeMenu),u=(0,Y.s)(t,i),d=l.useRef(!1);return(0,s.jsx)(te,{...a,ref:u,disabled:r,onClick:(0,K.mK)(e.onClick,()=>{let e=i.current;if(!r&&e){let t=new CustomEvent(e9,{bubbles:!0,cancelable:!0});e.addEventListener(e9,e=>n?.(e),{once:!0}),(0,Z.hO)(e,t),t.defaultPrevented?d.current=!1:o.onClose()}}),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:(0,K.mK)(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:(0,K.mK)(e.onKeyDown,e=>{let t=""!==c.searchRef.current;r||t&&" "===e.key||eD.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});e7.displayName=e8;var te=l.forwardRef((e,t)=>{let{__scopeMenu:r,disabled:n=!1,textValue:a,...i}=e,o=eQ(e8,r),c=eq(r),u=l.useRef(null),d=(0,Y.s)(t,u),[p,h]=l.useState(!1),[m,f]=l.useState("");return l.useEffect(()=>{let e=u.current;e&&f((e.textContent??"").trim())},[i.children]),(0,s.jsx)(eR.ItemSlot,{scope:r,disabled:n,textValue:a??m,children:(0,s.jsx)(ek,{asChild:!0,...c,focusable:!n,children:(0,s.jsx)(Z.sG.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:d,onPointerMove:(0,K.mK)(e.onPointerMove,tC(e=>{n?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,K.mK)(e.onPointerLeave,tC(e=>o.onItemLeave(e))),onFocus:(0,K.mK)(e.onFocus,()=>h(!0)),onBlur:(0,K.mK)(e.onBlur,()=>h(!1))})})})}),tt=l.forwardRef((e,t)=>{let{checked:r=!1,onCheckedChange:n,...a}=e;return(0,s.jsx)(tc,{scope:e.__scopeMenu,checked:r,children:(0,s.jsx)(e7,{role:"menuitemcheckbox","aria-checked":tj(r)?"mixed":r,...a,ref:t,"data-state":tN(r),onSelect:(0,K.mK)(a.onSelect,()=>n?.(!!tj(r)||!r),{checkForDefaultPrevented:!1})})})});tt.displayName="MenuCheckboxItem";var tr="MenuRadioGroup",[tn,ta]=eO(tr,{value:void 0,onValueChange:()=>{}}),ti=l.forwardRef((e,t)=>{let{value:r,onValueChange:n,...a}=e,i=(0,el.c)(n);return(0,s.jsx)(tn,{scope:e.__scopeMenu,value:r,onValueChange:i,children:(0,s.jsx)(e5,{...a,ref:t})})});ti.displayName=tr;var to="MenuRadioItem",ts=l.forwardRef((e,t)=>{let{value:r,...n}=e,a=ta(to,e.__scopeMenu),i=r===a.value;return(0,s.jsx)(tc,{scope:e.__scopeMenu,checked:i,children:(0,s.jsx)(e7,{role:"menuitemradio","aria-checked":i,...n,ref:t,"data-state":tN(i),onSelect:(0,K.mK)(n.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});ts.displayName=to;var tl="MenuItemIndicator",[tc,tu]=eO(tl,{checked:!1}),td=l.forwardRef((e,t)=>{let{__scopeMenu:r,forceMount:n,...a}=e,i=tu(tl,r);return(0,s.jsx)(es.C,{present:n||tj(i.checked)||!0===i.checked,children:(0,s.jsx)(Z.sG.span,{...a,ref:t,"data-state":tN(i.checked)})})});td.displayName=tl;var tp=l.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,s.jsx)(Z.sG.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});tp.displayName="MenuSeparator";var th=l.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e,a=e_(r);return(0,s.jsx)(ei.i3,{...a,...n,ref:t})});th.displayName="MenuArrow";var tm="MenuSub",[tf,tg]=eO(tm),tv=e=>{let{__scopeMenu:t,children:r,open:n=!1,onOpenChange:a}=e,i=e$(tm,t),o=e_(t),[c,u]=l.useState(null),[d,p]=l.useState(null),h=(0,el.c)(a);return l.useEffect(()=>(!1===i.open&&h(!1),()=>h(!1)),[i.open,h]),(0,s.jsx)(ei.bL,{...o,children:(0,s.jsx)(eB,{scope:t,open:n,onOpenChange:h,content:d,onContentChange:p,children:(0,s.jsx)(tf,{scope:t,contentId:(0,ea.B)(),triggerId:(0,ea.B)(),trigger:c,onTriggerChange:u,children:r})})})};tv.displayName=tm;var tx="MenuSubTrigger",ty=l.forwardRef((e,t)=>{let r=e$(tx,e.__scopeMenu),n=eH(tx,e.__scopeMenu),a=tg(tx,e.__scopeMenu),i=eQ(tx,e.__scopeMenu),o=l.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=i,d={__scopeMenu:e.__scopeMenu},p=l.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return l.useEffect(()=>p,[p]),l.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),u(null)}},[c,u]),(0,s.jsx)(eW,{asChild:!0,...d,children:(0,s.jsx)(te,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":tk(r.open),...e,ref:(0,Y.t)(t,a.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:(0,K.mK)(e.onPointerMove,tC(t=>{i.onItemEnter(t),!t.defaultPrevented&&(e.disabled||r.open||o.current||(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),p()},100)))})),onPointerLeave:(0,K.mK)(e.onPointerLeave,tC(e=>{p();let t=r.content?.getBoundingClientRect();if(t){let n=r.content?.dataset.side,a="right"===n,o=t[a?"left":"right"],s=t[a?"right":"left"];i.onPointerGraceIntentChange({area:[{x:e.clientX+(a?-5:5),y:e.clientY},{x:o,y:t.top},{x:s,y:t.top},{x:s,y:t.bottom},{x:o,y:t.bottom}],side:n}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(e),e.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:(0,K.mK)(e.onKeyDown,t=>{let a=""!==i.searchRef.current;e.disabled||a&&" "===t.key||eT[n.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())})})})});ty.displayName=tx;var tb="MenuSubContent",tw=l.forwardRef((e,t)=>{let r=eY(eX,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,i=e$(eX,e.__scopeMenu),o=eH(eX,e.__scopeMenu),c=tg(tb,e.__scopeMenu),u=l.useRef(null),d=(0,Y.s)(t,u);return(0,s.jsx)(eR.Provider,{scope:e.__scopeMenu,children:(0,s.jsx)(es.C,{present:n||i.open,children:(0,s.jsx)(eR.Slot,{scope:e.__scopeMenu,children:(0,s.jsx)(e4,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:d,align:"start",side:"rtl"===o.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:(0,K.mK)(e.onFocusOutside,e=>{e.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:(0,K.mK)(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:(0,K.mK)(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),r=eI[o.dir].includes(e.key);t&&r&&(i.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});function tk(e){return e?"open":"closed"}function tj(e){return"indeterminate"===e}function tN(e){return tj(e)?"indeterminate":e?"checked":"unchecked"}function tC(e){return t=>"mouse"===t.pointerType?e(t):void 0}tw.displayName=tb;var tS="DropdownMenu",[tE,tD]=(0,J.A)(tS,[eF]),tM=eF(),[tP,tT]=tE(tS),tI=e=>{let{__scopeDropdownMenu:t,children:r,dir:n,open:a,defaultOpen:i,onOpenChange:o,modal:c=!0}=e,u=tM(t),d=l.useRef(null),[p,h]=(0,X.i)({prop:a,defaultProp:i??!1,onChange:o,caller:tS});return(0,s.jsx)(tP,{scope:t,triggerId:(0,ea.B)(),triggerRef:d,contentId:(0,ea.B)(),open:p,onOpenChange:h,onOpenToggle:l.useCallback(()=>h(e=>!e),[h]),modal:c,children:(0,s.jsx)(eV,{...u,open:p,onOpenChange:h,dir:n,modal:c,children:r})})};tI.displayName=tS;var tA="DropdownMenuTrigger",tR=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,disabled:n=!1,...a}=e,i=tT(tA,r),o=tM(r);return(0,s.jsx)(eW,{asChild:!0,...o,children:(0,s.jsx)(Z.sG.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...a,ref:(0,Y.t)(t,i.triggerRef),onPointerDown:(0,K.mK)(e.onPointerDown,e=>{!n&&0===e.button&&!1===e.ctrlKey&&(i.onOpenToggle(),i.open||e.preventDefault())}),onKeyDown:(0,K.mK)(e.onKeyDown,e=>{!n&&(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});tR.displayName=tA;var tL=e=>{let{__scopeDropdownMenu:t,...r}=e,n=tM(t);return(0,s.jsx)(eJ,{...n,...r})};tL.displayName="DropdownMenuPortal";var tz="DropdownMenuContent",tO=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tT(tz,r),i=tM(r),o=l.useRef(!1);return(0,s.jsx)(e0,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...n,ref:t,onCloseAutoFocus:(0,K.mK)(e.onCloseAutoFocus,e=>{o.current||a.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:(0,K.mK)(e.onInteractOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;(!a.modal||n)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});tO.displayName=tz,l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tM(r);return(0,s.jsx)(e5,{...a,...n,ref:t})}).displayName="DropdownMenuGroup",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tM(r);return(0,s.jsx)(e6,{...a,...n,ref:t})}).displayName="DropdownMenuLabel";var tF=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tM(r);return(0,s.jsx)(e7,{...a,...n,ref:t})});tF.displayName="DropdownMenuItem",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tM(r);return(0,s.jsx)(tt,{...a,...n,ref:t})}).displayName="DropdownMenuCheckboxItem",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tM(r);return(0,s.jsx)(ti,{...a,...n,ref:t})}).displayName="DropdownMenuRadioGroup",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tM(r);return(0,s.jsx)(ts,{...a,...n,ref:t})}).displayName="DropdownMenuRadioItem",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tM(r);return(0,s.jsx)(td,{...a,...n,ref:t})}).displayName="DropdownMenuItemIndicator";var t_=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tM(r);return(0,s.jsx)(tp,{...a,...n,ref:t})});function tq({...e}){return(0,s.jsx)(tI,{"data-slot":"dropdown-menu",...e})}function tB({...e}){return(0,s.jsx)(tR,{"data-slot":"dropdown-menu-trigger",...e})}function t$({className:e,sideOffset:t=4,...r}){return(0,s.jsx)(tL,{children:(0,s.jsx)(tO,{"data-slot":"dropdown-menu-content",sideOffset:t,className:(0,h.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-40 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-lg",e),...r})})}function tU({className:e,inset:t,variant:r="default",...n}){return(0,s.jsx)(tF,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":r,className:(0,h.cn)("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n})}function tH({className:e,...t}){return(0,s.jsx)(t_,{"data-slot":"dropdown-menu-separator",className:(0,h.cn)("bg-border -mx-1 my-1 h-px",e),...t})}t_.displayName="DropdownMenuSeparator",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tM(r);return(0,s.jsx)(th,{...a,...n,ref:t})}).displayName="DropdownMenuArrow",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tM(r);return(0,s.jsx)(ty,{...a,...n,ref:t})}).displayName="DropdownMenuSubTrigger",l.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,a=tM(r);return(0,s.jsx)(tw,{...a,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}).displayName="DropdownMenuSubContent";var tV=r(52581);function tW({project:e,onSelect:t,onDelete:r,onExport:n,onExportZip:a,onDuplicate:i,onPreview:o,onUpdate:c,viewMode:u="grid",forceMenuOpen:d=!1,highlightExport:v=!1}){let[A,R]=(0,l.useState)(!1),[L,z]=(0,l.useState)(e.name),[O,F]=(0,l.useState)(e.description||""),[_,q]=(0,l.useState)(null),[B,$]=(0,l.useState)(!0),[U,H]=(0,l.useState)(!1),V=async()=>{if(!L.trim()){tV.oR.error("Project name cannot be empty"),z(e.name),R(!1);return}if(L.length>50)return void tV.oR.error("Project name must be 50 characters or less");if(O.length>200)return void tV.oR.error("Description must be 200 characters or less");try{e.name=L.trim(),e.description=O.trim()||void 0,await p.OP.updateProject(e),c(e),R(!1),tV.oR.success("Project updated")}catch(t){h.v.error("Failed to update project:",t),tV.oR.error("Failed to update project"),z(e.name),F(e.description||"")}},W=()=>{z(e.name),F(e.description||""),R(!1)},K=e=>{if(d)return void H(!0);H(e)},Y=()=>_?Object.entries(_.fileTypes).sort(([,e],[,t])=>t-e).slice(0,3):[],J=e=>{let t=e.toLowerCase();return["html","htm"].includes(t)?(0,s.jsx)(x,{className:"h-3 w-3"}):["css","scss","sass"].includes(t)?(0,s.jsx)(y,{className:"h-3 w-3"}):["js","jsx","ts","tsx"].includes(t)?(0,s.jsx)(x,{className:"h-3 w-3"}):["png","jpg","jpeg","gif","svg"].includes(t)?(0,s.jsx)(b,{className:"h-3 w-3"}):(0,s.jsx)(y,{className:"h-3 w-3"})},X=e=>e&&0!==e?`$${e.toFixed(2)}`:null;return"list"===u?(0,s.jsx)("div",{className:`border border-border rounded-lg p-4 hover:shadow-md transition-all cursor-pointer hover:border-primary/50 ${v?"ring-2 ring-primary/70 animate-ring-opacity":""}`,style:{background:"linear-gradient(var(--project-card-tint), var(--project-card-tint)), var(--card)"},onClick:()=>t(e),children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("div",{className:"flex-1 min-w-0",children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[A?(0,s.jsxs)("div",{className:"flex items-center gap-2",onClick:e=>e.stopPropagation(),children:[(0,s.jsx)(f.p,{value:L,onChange:e=>z(e.target.value),onKeyDown:e=>{"Enter"===e.key&&V(),"Escape"===e.key&&W()},className:"h-7 text-sm",autoFocus:!0,maxLength:50}),(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:[L.length,"/50"]}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:V,children:(0,s.jsx)(w.A,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:W,children:(0,s.jsx)(k.A,{className:"h-3 w-3"})})]}):(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("h3",{className:"font-semibold truncate",children:e.name}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5 opacity-0 group-hover:opacity-100",onClick:e=>{e.stopPropagation(),R(!0)},children:(0,s.jsx)(j,{className:"h-3 w-3"})})]}),e.description&&!A&&(0,s.jsx)("span",{className:"text-sm text-muted-foreground truncate max-w-md",children:e.description})]})}),(0,s.jsxs)("div",{className:"flex items-center gap-4 ml-4",children:[_&&(0,s.jsxs)("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(N,{className:"h-4 w-4"}),_.fileCount," files"]}),(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(C,{className:"h-4 w-4"}),_.formattedSize]}),e.costTracking?.totalCost&&(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(S,{className:"h-4 w-4"}),X(e.costTracking.totalCost)]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:G(e.updatedAt,{addSuffix:!0})}),(0,s.jsxs)(tq,{open:!!d||U,onOpenChange:K,children:[(0,s.jsx)(tB,{asChild:!0,onClick:e=>e.stopPropagation(),"data-tour-id":v?"project-actions-trigger":void 0,children:(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-8 w-8",children:(0,s.jsx)(E,{className:"h-4 w-4"})})}),(0,s.jsxs)(t$,{align:"end",children:[(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),o(e)},children:[(0,s.jsx)(D.A,{className:"mr-2 h-4 w-4"}),"Preview"]}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),i(e)},children:[(0,s.jsx)(M,{className:"mr-2 h-4 w-4"}),"Duplicate"]}),(0,s.jsx)(tH,{}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),a(e)},children:[(0,s.jsx)(P,{className:"mr-2 h-4 w-4"}),"Export as ZIP"]}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),n(e)},"data-tour-id":v?"project-export-json":void 0,children:[(0,s.jsx)(T,{className:"mr-2 h-4 w-4"}),"Export as JSON"]}),(0,s.jsx)(tH,{}),(0,s.jsxs)(tU,{className:"text-destructive",onClick:t=>{t.stopPropagation(),r(e)},children:[(0,s.jsx)(I,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})]})]})]})}):(0,s.jsx)("div",{className:`border border-border rounded-lg p-4 hover:shadow-lg transition-all cursor-pointer hover:border-primary/50 group ${v?"ring-2 ring-primary/70 animate-ring-opacity":""}`,style:{background:"linear-gradient(var(--project-card-tint), var(--project-card-tint)), var(--card)"},onClick:()=>t(e),"data-tour-id":"project-card",children:(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex justify-between items-start",children:[A?(0,s.jsxs)("div",{className:"flex-1",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(f.p,{value:L,onChange:e=>z(e.target.value),onKeyDown:e=>{"Enter"===e.key&&!1===e.shiftKey&&(e.preventDefault(),V()),"Escape"===e.key&&W()},className:"h-8 text-sm font-semibold",autoFocus:!0,maxLength:50}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:V,children:(0,s.jsx)(w.A,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:W,children:(0,s.jsx)(k.A,{className:"h-3 w-3"})})]}),(0,s.jsxs)("span",{className:"text-xs text-muted-foreground mt-1",children:[L.length,"/50"]})]}):(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold text-lg truncate flex-1",children:e.name}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5 opacity-0 group-hover:opacity-100 transition-opacity",onClick:e=>{e.stopPropagation(),R(!0)},children:(0,s.jsx)(j,{className:"h-3 w-3"})})]}),(0,s.jsxs)(tq,{open:!!d||U,onOpenChange:K,children:[(0,s.jsx)(tB,{asChild:!0,onClick:e=>e.stopPropagation(),"data-tour-id":v?"project-actions-trigger":void 0,children:(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-8 w-8",children:(0,s.jsx)(E,{className:"h-4 w-4"})})}),(0,s.jsxs)(t$,{align:"end",children:[(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),o(e)},children:[(0,s.jsx)(D.A,{className:"mr-2 h-4 w-4"}),"Preview"]}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),i(e)},children:[(0,s.jsx)(M,{className:"mr-2 h-4 w-4"}),"Duplicate"]}),(0,s.jsx)(tH,{}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),a(e)},children:[(0,s.jsx)(P,{className:"mr-2 h-4 w-4"}),"Export as ZIP"]}),(0,s.jsxs)(tU,{onClick:t=>{t.stopPropagation(),n(e)},"data-tour-id":v?"project-export-json":void 0,children:[(0,s.jsx)(T,{className:"mr-2 h-4 w-4"}),"Export as JSON"]}),(0,s.jsx)(tH,{}),(0,s.jsxs)(tU,{className:"text-destructive",onClick:t=>{t.stopPropagation(),r(e)},children:[(0,s.jsx)(I,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})]}),A?(0,s.jsxs)("div",{onClick:e=>e.stopPropagation(),children:[(0,s.jsx)(g,{value:O,onChange:e=>F(e.target.value),onKeyDown:e=>{"Escape"===e.key&&W()},placeholder:"Add a description...",className:"min-h-[60px] text-sm resize-none",maxLength:200}),(0,s.jsx)("div",{className:"flex items-center justify-between mt-1",children:(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:[O.length,"/200"]})})]}):(0,s.jsx)("div",{className:"min-h-[40px]",children:e.description?(0,s.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-2",children:e.description}):(0,s.jsx)("p",{className:"text-sm text-muted-foreground/50 italic",children:"No description"})}),B?(0,s.jsx)("div",{className:"h-6 bg-muted animate-pulse rounded"}):_&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground pt-2 border-t",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(N,{className:"h-4 w-4"}),_.fileCount," ",1===_.fileCount?"file":"files"]}),(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(C,{className:"h-4 w-4"}),_.formattedSize]}),e.costTracking?.totalCost&&e.costTracking.totalCost>0&&(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(S,{className:"h-4 w-4"}),X(e.costTracking.totalCost)]})]}),Y().length>0&&(0,s.jsx)("div",{className:"flex items-center gap-3 text-xs",children:Y().map(([e,t])=>(0,s.jsxs)("div",{className:"flex items-center gap-1 text-muted-foreground",children:[J(e),(0,s.jsxs)("span",{children:[e," (",t,")"]})]},e))})]}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground pt-2 border-t",children:(0,s.jsxs)("p",{children:["Updated ",G(e.updatedAt,{addSuffix:!0})]})})]})})}var tG=r(22106),tK=r(78122);let tY=(0,v.A)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),tJ=(0,v.A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),tX=(0,v.A)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]),tZ=(0,v.A)("crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]),tQ=(0,v.A)("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]),t0=(0,v.A)("tablet",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]),t1=(0,v.A)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);var t2=r(63974);let t3={mobile:{width:"375px",height:"100%",maxHeight:"667px"},tablet:{width:"768px",height:"100%",maxHeight:"1024px"},desktop:{width:"100%",height:"100%",maxHeight:"900px",maxWidth:"1440px"},responsive:{width:"100%",height:"100%"}};function t4({projectId:e,refreshTrigger:t,onFocusSelection:r,hasFocusTarget:n=!1,onClose:a}){let[i,o]=(0,l.useState)(null),[c,u]=(0,l.useState)("/"),[d,f]=(0,l.useState)(!0),[g,v]=(0,l.useState)(null),[x,y]=(0,l.useState)("tablet"),[b,w]=(0,l.useState)(["/"]),[j,N]=(0,l.useState)(0),[C,S]=(0,l.useState)(!1),[E,M]=(0,l.useState)(!1),P=(0,l.useRef)(null),T=(0,l.useRef)(null),I=(0,l.useRef)(null),A=(0,l.useRef)("/"),R=(0,l.useRef)(null),L=(0,l.useRef)(!1),z=(0,l.useCallback)(e=>{if(P.current&&P.current.contentWindow)try{P.current.contentWindow.postMessage(e,"*")}catch(e){h.v.warn("Failed to communicate with preview iframe",e)}},[]),O=(0,l.useRef)(!1),F=(0,l.useRef)(null),_=(0,l.useRef)(null),q=(0,l.useRef)(null),B=()=>(0,s.jsxs)("div",{className:"p-3 border-b bg-muted/70 flex items-center gap-2",children:[(0,s.jsx)(D.A,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-preview-active)"}}),a?(0,s.jsxs)("button",{type:"button",onClick:a,"aria-label":"Hide preview",className:"relative hidden h-6 w-6 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-destructive md:flex group",children:[(0,s.jsx)(D.A,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-preview-active)"}}),(0,s.jsx)(k.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}):(0,s.jsx)(D.A,{className:"hidden h-4 w-4 md:inline-flex",style:{color:"var(--button-preview-active)"}}),(0,s.jsx)("h3",{className:"text-sm font-medium",children:"Live Preview"})]}),$=(0,l.useCallback)(async(t=!1,r=!0)=>{r&&f(!0),v(null);try{await p.OP.init();let r=t?A.current:null;T.current&&T.current.cleanupBlobUrls();let n=new tG.B(p.OP,e);T.current=n;let a=await n.compileProject();o(a),I.current=a;let i=r;i||(i=a.blobUrls.has("/index.html")?"/":a.entryPoint||(a.routes.length>0?a.routes[0].path:"/")),H(i,a)}catch(e){v(e instanceof Error?e.message:"Failed to compile project"),h.v.error("Compilation error:",e)}finally{r&&f(!1)}},[e]),U=(0,l.useCallback)((e=!1,t=!0)=>{if(O.current){let r=F.current;F.current={preserve:(r?.preserve??!1)||e,showLoading:(r?.showLoading??!1)||t};return}(async(e,t)=>{O.current=!0;try{await $(e,t)}finally{O.current=!1;let e=F.current;F.current=null,e&&U(e.preserve,e.showLoading)}})(e,t)},[$]);(0,l.useCallback)((e=!1,t=!1)=>{let r=q.current;q.current={preserve:(r?.preserve??!1)||e,showLoading:(r?.showLoading??!1)||t},_.current&&window.clearTimeout(_.current),_.current=window.setTimeout(()=>{let e=q.current;q.current=null,_.current=null,e&&U(e.preserve,e.showLoading)},150)},[U]);let H=(e,t)=>{let r,n=t||I.current||i;if(!n)return void h.v.warn("No compiled project available");if(L.current?M(!1):z({type:"selector-toggle",active:!1}),!P.current||!C){R.current=e;return}let a=e;a.startsWith("/")||(a="/"+a);let o=n.routes.find(e=>e.path===a);r=o?o.file:"/"===a?"/index.html":a+".html";let s=n.files.find(e=>e.path===r);if(!s){v(`Page not found: ${e}`),n.files.find(e=>"/index.html"===e.path||"index.html"===e.path)&&"/"!==e&&H("/",t);return}let l="string"==typeof s.content?s.content:new TextDecoder().decode(s.content);l=(l=(l=l.replace(/href="([^"]+)"/g,(e,t)=>{if(!t.endsWith(".css")||t.startsWith("http")||t.startsWith("//"))return e;let r=t.startsWith("/")?t:"/"+t,a=n.blobUrls.get(r);return a?`href="${a}"`:e})).replace(/src="([^"]+)"/g,(e,t)=>{if(!t.endsWith(".js")||t.startsWith("http")||t.startsWith("//"))return e;let r=t.startsWith("/")?t:"/"+t,a=n.blobUrls.get(r);return a?`src="${a}"`:e})).replace(/src="([^"]+\.(png|jpg|jpeg|gif|svg|webp))"/gi,(e,t)=>{let r=t.startsWith("/")?t:"/"+t,a=n.blobUrls.get(r);return a?`src="${a}"`:e});let c=` - `;l.includes("")?l=l.replace("",c+""):l+=c,M.current.srcdoc=l,u(a),A.current=a,N(e=>(w(t=>[...t.slice(0,e+1),a]),e+1))},V=(0,l.useCallback)(e=>{H(e)},[o]),W=()=>{if(j>0){let e=j-1;N(e),H(b[e])}},G=()=>{if(j{H("/")},Y=()=>{U(!0,!1)};return d?(0,s.jsxs)("div",{className:"h-full flex flex-col",children:[(0,s.jsx)(_,{}),(0,s.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,s.jsxs)("div",{className:"text-center space-y-2",children:[(0,s.jsx)(tK.A,{className:"w-8 h-8 animate-spin mx-auto text-primary"}),(0,s.jsx)("p",{className:"text-muted-foreground",children:"Compiling project..."})]})})]}):g?(0,s.jsxs)("div",{className:"h-full flex flex-col",children:[(0,s.jsx)(_,{}),(0,s.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,s.jsxs)("div",{className:"text-center text-destructive space-y-2",children:[(0,s.jsx)("p",{className:"font-medium",children:"Error"}),(0,s.jsx)("p",{className:"text-sm mt-2",children:g}),(0,s.jsx)(m.$,{onClick:Y,className:"mt-4",children:"Try Again"})]})})]}):(0,s.jsxs)("div",{className:"h-full flex flex-col",children:[(0,s.jsx)(_,{}),(0,s.jsxs)("div",{className:"border-b p-2 flex items-center gap-2 md:hidden",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:W,disabled:0===j,children:(0,s.jsx)(tY,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:G,disabled:j>=b.length-1,children:(0,s.jsx)(tJ,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:K,children:(0,s.jsx)(tX,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:Y,children:(0,s.jsx)(tK.A,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>P(e=>!e),disabled:!C,style:E?{backgroundColor:"var(--button-preview-active)",color:"white"}:n?{backgroundColor:"rgba(99, 102, 241, 0.12)",color:"var(--button-preview-active)"}:{},title:E?"Cancel element selection":n?"Replace focused element":"Select element","data-tour-id":"focus-crosshair-button",children:(0,s.jsx)(tZ,{className:"h-3 w-3"})})]}),o&&o.routes.length>1&&(0,s.jsxs)(t2.l6,{value:c,onValueChange:V,children:[(0,s.jsx)(t2.bq,{className:"flex-1 h-8 min-w-0 max-w-full",children:(0,s.jsx)(t2.yv,{className:"truncate"})}),(0,s.jsx)(t2.gC,{children:o.routes.map(e=>(0,s.jsx)(t2.eb,{value:e.path,children:e.title||e.path},e.path))})]})]}),(0,s.jsxs)("div",{className:"border-b p-2 hidden md:flex items-center gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:W,disabled:0===j,children:(0,s.jsx)(tY,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:G,disabled:j>=b.length-1,children:(0,s.jsx)(tJ,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:K,children:(0,s.jsx)(tX,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:Y,children:(0,s.jsx)(tK.A,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>P(e=>!e),disabled:!C,style:{backgroundColor:E?"var(--button-preview-active)":void 0,color:E?"white":void 0},title:E?"Cancel element focus":"Select element","data-tour-id":"focus-crosshair-button",children:(0,s.jsx)(tZ,{className:"h-3 w-3"})})]}),(0,s.jsx)("div",{className:"flex-1 px-3 py-1 bg-muted rounded text-sm",children:c}),o&&o.routes.length>1&&(0,s.jsxs)(t2.l6,{value:c,onValueChange:V,children:[(0,s.jsx)(t2.bq,{className:"w-[200px] h-8",children:(0,s.jsx)(t2.yv,{})}),(0,s.jsx)(t2.gC,{children:o.routes.map(e=>(0,s.jsx)(t2.eb,{value:e.path,children:e.title||e.path},e.path))})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 border-l pl-2",children:[(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5 rounded-sm",style:{backgroundColor:"mobile"===x?"var(--button-preview-active)":void 0,color:"mobile"===x?"white":void 0},onClick:()=>y("mobile"),children:(0,s.jsx)(tQ,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5 rounded-sm",style:{backgroundColor:"tablet"===x?"var(--button-preview-active)":void 0,color:"tablet"===x?"white":void 0},onClick:()=>y("tablet"),children:(0,s.jsx)(t0,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5 rounded-sm",style:{backgroundColor:"desktop"===x?"var(--button-preview-active)":void 0,color:"desktop"===x?"white":void 0},onClick:()=>y("desktop"),children:(0,s.jsx)(t1,{className:"h-3 w-3"})})]})]}),(0,s.jsx)("div",{className:"flex-1 bg-muted/20 dark:bg-muted/10 p-4 overflow-auto min-h-0",children:(0,s.jsx)("div",{className:(0,h.cn)("bg-white mx-auto shadow-2xl transition-all duration-300","responsive"!==x&&"rounded-lg"),style:{width:t3[x].width||"100%",height:t3[x].height||"100%",maxHeight:t3[x].maxHeight||"100%",maxWidth:t3[x].maxWidth||"100%"},children:(0,s.jsx)("iframe",{ref:e=>{M.current=e,e&&!C?setTimeout(()=>{S(!0)},0):!e&&C&&S(!1)},className:"w-full h-full rounded-lg",sandbox:"allow-scripts allow-same-origin allow-forms",title:"Preview"})})})]})}let t5={rE:"1.11.0"};var t6="Dialog",[t8,t9]=(0,J.A)(t6),[t7,re]=t8(t6),rt=e=>{let{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:o,modal:i=!0}=e,c=l.useRef(null),u=l.useRef(null),[d,p]=(0,X.i)({prop:n,defaultProp:a??!1,onChange:o,caller:t6});return(0,s.jsx)(t7,{scope:t,triggerRef:c,contentRef:u,contentId:(0,ea.B)(),titleId:(0,ea.B)(),descriptionId:(0,ea.B)(),open:d,onOpenChange:p,onOpenToggle:l.useCallback(()=>p(e=>!e),[p]),modal:i,children:r})};rt.displayName=t6;var rr="DialogTrigger";l.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=re(rr,r),o=(0,Y.s)(t,a.triggerRef);return(0,s.jsx)(Z.sG.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":rk(a.open),...n,ref:o,onClick:(0,K.mK)(e.onClick,a.onOpenToggle)})}).displayName=rr;var rn="DialogPortal",[ra,ro]=t8(rn,{forceMount:void 0}),ri=e=>{let{__scopeDialog:t,forceMount:r,children:n,container:a}=e,o=re(rn,t);return(0,s.jsx)(ra,{scope:t,forceMount:r,children:l.Children.map(n,e=>(0,s.jsx)(es.C,{present:r||o.open,children:(0,s.jsx)(ei.Z,{asChild:!0,container:a,children:e})}))})};ri.displayName=rn;var rs="DialogOverlay",rl=l.forwardRef((e,t)=>{let r=ro(rs,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,o=re(rs,e.__scopeDialog);return o.modal?(0,s.jsx)(es.C,{present:n||o.open,children:(0,s.jsx)(ru,{...a,ref:t})}):null});rl.displayName=rs;var rc=(0,eC.TL)("DialogOverlay.RemoveScroll"),ru=l.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=re(rs,r);return(0,s.jsx)(eE.A,{as:rc,allowPinchZoom:!0,shards:[a.contentRef],children:(0,s.jsx)(Z.sG.div,{"data-state":rk(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),rd="DialogContent",rp=l.forwardRef((e,t)=>{let r=ro(rd,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,o=re(rd,e.__scopeDialog);return(0,s.jsx)(es.C,{present:n||o.open,children:o.modal?(0,s.jsx)(rh,{...a,ref:t}):(0,s.jsx)(rm,{...a,ref:t})})});rp.displayName=rd;var rh=l.forwardRef((e,t)=>{let r=re(rd,e.__scopeDialog),n=l.useRef(null),a=(0,Y.s)(t,r.contentRef,n);return l.useEffect(()=>{let e=n.current;if(e)return(0,eS.Eq)(e)},[]),(0,s.jsx)(rf,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,K.mK)(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:(0,K.mK)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:(0,K.mK)(e.onFocusOutside,e=>e.preventDefault())})}),rm=l.forwardRef((e,t)=>{let r=re(rd,e.__scopeDialog),n=l.useRef(!1),a=l.useRef(!1);return(0,s.jsx)(rf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||r.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));let o=t.target;r.triggerRef.current?.contains(o)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),rf=l.forwardRef((e,t)=>{let{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:o,...i}=e,c=re(rd,r),u=l.useRef(null),d=(0,Y.s)(t,u);return(0,er.Oh)(),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(en.n,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:o,children:(0,s.jsx)(et.qW,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":rk(c.open),...i,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(rS,{titleId:c.titleId}),(0,s.jsx)(rE,{contentRef:u,descriptionId:c.descriptionId})]})]})}),rg="DialogTitle",rv=l.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=re(rg,r);return(0,s.jsx)(Z.sG.h2,{id:a.titleId,...n,ref:t})});rv.displayName=rg;var rx="DialogDescription",ry=l.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=re(rx,r);return(0,s.jsx)(Z.sG.p,{id:a.descriptionId,...n,ref:t})});ry.displayName=rx;var rb="DialogClose",rw=l.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=re(rb,r);return(0,s.jsx)(Z.sG.button,{type:"button",...n,ref:t,onClick:(0,K.mK)(e.onClick,()=>a.onOpenChange(!1))})});function rk(e){return e?"open":"closed"}rw.displayName=rb;var rj="DialogTitleWarning",[rN,rC]=(0,J.q)(rj,{contentName:rd,titleName:rg,docsSlug:"dialog"}),rS=({titleId:e})=>{let t=rC(rj),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. + `;l.includes("")?l=l.replace("",c+""):l+=c,P.current.srcdoc=l,u(a),A.current=a,N(e=>(w(t=>[...t.slice(0,e+1),a]),e+1))},V=(0,l.useCallback)(e=>{H(e)},[i]),W=()=>{if(j>0){let e=j-1;N(e),H(b[e])}},G=()=>{if(j{H("/")},Y=()=>{U(!0,!1)};return d?(0,s.jsxs)("div",{className:"h-full flex flex-col",children:[(0,s.jsx)(B,{}),(0,s.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,s.jsxs)("div",{className:"text-center space-y-2",children:[(0,s.jsx)(tK.A,{className:"w-8 h-8 animate-spin mx-auto text-primary"}),(0,s.jsx)("p",{className:"text-muted-foreground",children:"Compiling project..."})]})})]}):g?(0,s.jsxs)("div",{className:"h-full flex flex-col",children:[(0,s.jsx)(B,{}),(0,s.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,s.jsxs)("div",{className:"text-center text-destructive space-y-2",children:[(0,s.jsx)("p",{className:"font-medium",children:"Error"}),(0,s.jsx)("p",{className:"text-sm mt-2",children:g}),(0,s.jsx)(m.$,{onClick:Y,className:"mt-4",children:"Try Again"})]})})]}):(0,s.jsxs)("div",{className:"h-full flex flex-col",children:[(0,s.jsx)(B,{}),(0,s.jsxs)("div",{className:"border-b p-2 flex items-center gap-2 md:hidden",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:W,disabled:0===j,children:(0,s.jsx)(tY,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:G,disabled:j>=b.length-1,children:(0,s.jsx)(tJ,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:K,children:(0,s.jsx)(tX,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:Y,children:(0,s.jsx)(tK.A,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>M(e=>!e),disabled:!C,style:E?{backgroundColor:"var(--button-preview-active)",color:"white"}:n?{backgroundColor:"rgba(99, 102, 241, 0.12)",color:"var(--button-preview-active)"}:{},title:E?"Cancel element selection":n?"Replace focused element":"Select element","data-tour-id":"focus-crosshair-button",children:(0,s.jsx)(tZ,{className:"h-3 w-3"})})]}),i&&i.routes.length>1&&(0,s.jsxs)(t2.l6,{value:c,onValueChange:V,children:[(0,s.jsx)(t2.bq,{className:"flex-1 h-8 min-w-0 max-w-full",children:(0,s.jsx)(t2.yv,{className:"truncate"})}),(0,s.jsx)(t2.gC,{children:i.routes.map(e=>(0,s.jsx)(t2.eb,{value:e.path,children:e.title||e.path},e.path))})]})]}),(0,s.jsxs)("div",{className:"border-b p-2 hidden md:flex items-center gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:W,disabled:0===j,children:(0,s.jsx)(tY,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:G,disabled:j>=b.length-1,children:(0,s.jsx)(tJ,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:K,children:(0,s.jsx)(tX,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:Y,children:(0,s.jsx)(tK.A,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>M(e=>!e),disabled:!C,style:{backgroundColor:E?"var(--button-preview-active)":void 0,color:E?"white":void 0},title:E?"Cancel element focus":"Select element","data-tour-id":"focus-crosshair-button",children:(0,s.jsx)(tZ,{className:"h-3 w-3"})})]}),(0,s.jsx)("div",{className:"flex-1 px-3 py-1 bg-muted rounded text-sm",children:c}),i&&i.routes.length>1&&(0,s.jsxs)(t2.l6,{value:c,onValueChange:V,children:[(0,s.jsx)(t2.bq,{className:"w-[200px] h-8",children:(0,s.jsx)(t2.yv,{})}),(0,s.jsx)(t2.gC,{children:i.routes.map(e=>(0,s.jsx)(t2.eb,{value:e.path,children:e.title||e.path},e.path))})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 border-l pl-2",children:[(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5 rounded-sm",style:{backgroundColor:"mobile"===x?"var(--button-preview-active)":void 0,color:"mobile"===x?"white":void 0},onClick:()=>y("mobile"),children:(0,s.jsx)(tQ,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5 rounded-sm",style:{backgroundColor:"tablet"===x?"var(--button-preview-active)":void 0,color:"tablet"===x?"white":void 0},onClick:()=>y("tablet"),children:(0,s.jsx)(t0,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5 rounded-sm",style:{backgroundColor:"desktop"===x?"var(--button-preview-active)":void 0,color:"desktop"===x?"white":void 0},onClick:()=>y("desktop"),children:(0,s.jsx)(t1,{className:"h-3 w-3"})})]})]}),(0,s.jsx)("div",{className:"flex-1 bg-muted/20 dark:bg-muted/10 p-4 overflow-auto min-h-0",children:(0,s.jsx)("div",{className:(0,h.cn)("bg-white mx-auto shadow-2xl transition-all duration-300","responsive"!==x&&"rounded-lg"),style:{width:t3[x].width||"100%",height:t3[x].height||"100%",maxHeight:t3[x].maxHeight||"100%",maxWidth:t3[x].maxWidth||"100%"},children:(0,s.jsx)("iframe",{ref:e=>{P.current=e,e&&!C?setTimeout(()=>{S(!0)},0):!e&&C&&S(!1)},className:"w-full h-full rounded-lg",sandbox:"allow-scripts allow-same-origin allow-forms",title:"Preview"})})})]})}let t5={rE:"1.11.1"};var t6="Dialog",[t8,t9]=(0,J.A)(t6),[t7,re]=t8(t6),rt=e=>{let{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,c=l.useRef(null),u=l.useRef(null),[d,p]=(0,X.i)({prop:n,defaultProp:a??!1,onChange:i,caller:t6});return(0,s.jsx)(t7,{scope:t,triggerRef:c,contentRef:u,contentId:(0,ea.B)(),titleId:(0,ea.B)(),descriptionId:(0,ea.B)(),open:d,onOpenChange:p,onOpenToggle:l.useCallback(()=>p(e=>!e),[p]),modal:o,children:r})};rt.displayName=t6;var rr="DialogTrigger";l.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=re(rr,r),i=(0,Y.s)(t,a.triggerRef);return(0,s.jsx)(Z.sG.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":rk(a.open),...n,ref:i,onClick:(0,K.mK)(e.onClick,a.onOpenToggle)})}).displayName=rr;var rn="DialogPortal",[ra,ri]=t8(rn,{forceMount:void 0}),ro=e=>{let{__scopeDialog:t,forceMount:r,children:n,container:a}=e,i=re(rn,t);return(0,s.jsx)(ra,{scope:t,forceMount:r,children:l.Children.map(n,e=>(0,s.jsx)(es.C,{present:r||i.open,children:(0,s.jsx)(eo.Z,{asChild:!0,container:a,children:e})}))})};ro.displayName=rn;var rs="DialogOverlay",rl=l.forwardRef((e,t)=>{let r=ri(rs,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=re(rs,e.__scopeDialog);return i.modal?(0,s.jsx)(es.C,{present:n||i.open,children:(0,s.jsx)(ru,{...a,ref:t})}):null});rl.displayName=rs;var rc=(0,eC.TL)("DialogOverlay.RemoveScroll"),ru=l.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=re(rs,r);return(0,s.jsx)(eE.A,{as:rc,allowPinchZoom:!0,shards:[a.contentRef],children:(0,s.jsx)(Z.sG.div,{"data-state":rk(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),rd="DialogContent",rp=l.forwardRef((e,t)=>{let r=ri(rd,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=re(rd,e.__scopeDialog);return(0,s.jsx)(es.C,{present:n||i.open,children:i.modal?(0,s.jsx)(rh,{...a,ref:t}):(0,s.jsx)(rm,{...a,ref:t})})});rp.displayName=rd;var rh=l.forwardRef((e,t)=>{let r=re(rd,e.__scopeDialog),n=l.useRef(null),a=(0,Y.s)(t,r.contentRef,n);return l.useEffect(()=>{let e=n.current;if(e)return(0,eS.Eq)(e)},[]),(0,s.jsx)(rf,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,K.mK)(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:(0,K.mK)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:(0,K.mK)(e.onFocusOutside,e=>e.preventDefault())})}),rm=l.forwardRef((e,t)=>{let r=re(rd,e.__scopeDialog),n=l.useRef(!1),a=l.useRef(!1);return(0,s.jsx)(rf,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||r.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));let i=t.target;r.triggerRef.current?.contains(i)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),rf=l.forwardRef((e,t)=>{let{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,c=re(rd,r),u=l.useRef(null),d=(0,Y.s)(t,u);return(0,er.Oh)(),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(en.n,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:i,children:(0,s.jsx)(et.qW,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":rk(c.open),...o,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(rS,{titleId:c.titleId}),(0,s.jsx)(rE,{contentRef:u,descriptionId:c.descriptionId})]})]})}),rg="DialogTitle",rv=l.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=re(rg,r);return(0,s.jsx)(Z.sG.h2,{id:a.titleId,...n,ref:t})});rv.displayName=rg;var rx="DialogDescription",ry=l.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=re(rx,r);return(0,s.jsx)(Z.sG.p,{id:a.descriptionId,...n,ref:t})});ry.displayName=rx;var rb="DialogClose",rw=l.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=re(rb,r);return(0,s.jsx)(Z.sG.button,{type:"button",...n,ref:t,onClick:(0,K.mK)(e.onClick,()=>a.onOpenChange(!1))})});function rk(e){return e?"open":"closed"}rw.displayName=rb;var rj="DialogTitleWarning",[rN,rC]=(0,J.q)(rj,{contentName:rd,titleName:rg,docsSlug:"dialog"}),rS=({titleId:e})=>{let t=rC(rj),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},rE=({contentRef:e,descriptionId:t})=>{let r=rC("DialogDescriptionWarning"),n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return l.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null};function rD({...e}){return(0,s.jsx)(rt,{"data-slot":"dialog",...e})}function rP({...e}){return(0,s.jsx)(ri,{"data-slot":"dialog-portal",...e})}function rM({className:e,...t}){return(0,s.jsx)(rl,{"data-slot":"dialog-overlay",className:(0,h.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 backdrop-blur-sm",e),...t})}function rI({className:e,children:t,showCloseButton:r=!0,...n}){return(0,s.jsxs)(rP,{"data-slot":"dialog-portal",children:[(0,s.jsx)(rM,{}),(0,s.jsxs)(rp,{"data-slot":"dialog-content",className:(0,h.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-2xl duration-200 sm:max-w-lg",e),...n,children:[t,r&&(0,s.jsxs)(rw,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,s.jsx)(k.A,{}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function rT({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"dialog-header",className:(0,h.cn)("flex flex-col gap-2 text-center sm:text-left",e),...t})}function rA({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"dialog-footer",className:(0,h.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function rR({className:e,...t}){return(0,s.jsx)(rv,{"data-slot":"dialog-title",className:(0,h.cn)("text-lg leading-none font-semibold",e),...t})}function rL({className:e,...t}){return(0,s.jsx)(ry,{"data-slot":"dialog-description",className:(0,h.cn)("text-muted-foreground text-sm",e),...t})}var rz=r(96271),rO=r(59821);let rF=(0,v.A)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);var rq=r(25334);function rB({open:e,onOpenChange:t}){return(0,s.jsx)(rD,{open:e,onOpenChange:t,children:(0,s.jsxs)(rI,{className:"max-w-3xl max-h-[90vh]",children:[(0,s.jsx)(rT,{children:(0,s.jsxs)("div",{className:"flex items-center gap-4 mb-2",children:[(0,s.jsx)(rz.g,{width:64,height:64}),(0,s.jsxs)("div",{children:[(0,s.jsx)(rR,{className:"text-2xl",children:"DeepStudio"}),(0,s.jsx)(rL,{className:"text-base",children:"Browser-based Website Builder"})]})]})}),(0,s.jsxs)("div",{className:"space-y-6 overflow-y-auto max-h-[60vh] pr-4",children:[(0,s.jsx)("section",{children:(0,s.jsxs)("div",{className:"text-sm text-gray-600 dark:text-gray-300 leading-relaxed space-y-3",children:[(0,s.jsx)("p",{children:"DeepStudio is a fork from @enzostvs and @victor's DeepSite v2 that over the months of tinkering became a BYOK (Bring Your Own Key) agentic browser-based website builder where you describe what you want and an agent writes the code."}),(0,s.jsx)("p",{children:"This is a solo project and there isn't a huge corpo behind it. I'll do my best to fix issues and possibly keep the project improving, but it's just me doing this for fun so please be patient. All feedback and contributions are more than welcome."}),(0,s.jsx)("p",{children:"If you make something with the app I would be thrilled if you could share what you've made."})]})}),(0,s.jsxs)("section",{children:[(0,s.jsx)("h3",{className:"font-semibold text-lg mb-3",children:"Links & Support"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("a",{href:"https://github.com/o-stahl/deepstudio",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-blue-600 dark:text-blue-400 hover:underline",children:[(0,s.jsx)(rF,{className:"h-4 w-4"}),"GitHub repo",(0,s.jsx)(rq.A,{className:"h-3 w-3"})]}),(0,s.jsxs)("a",{href:"https://huggingface.co/spaces/o-stahl/deepstudio",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-blue-600 dark:text-blue-400 hover:underline",children:[(0,s.jsxs)("svg",{fill:"currentColor",fillRule:"evenodd",height:"1em",style:{flex:"none",lineHeight:1},viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",children:[(0,s.jsx)("title",{children:"HuggingFace"}),(0,s.jsx)("path",{d:"M16.781 3.277c2.997 1.704 4.844 4.851 4.844 8.258 0 .995-.155 1.955-.443 2.857a1.332 1.332 0 011.125.4 1.41 1.41 0 01.2 1.723c.204.165.352.385.428.632l.017.062c.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.255.57-.893 1.018-2.128 1.5l-.202.078-.131.048c-.478.173-.89.295-1.061.345l-.086.024c-.89.243-1.808.375-2.732.394-1.32 0-2.3-.36-2.923-1.067a9.852 9.852 0 01-3.18.018C9.778 21.647 8.802 22 7.494 22a11.249 11.249 0 01-2.541-.343l-.221-.06-.273-.08a16.574 16.574 0 01-1.175-.405c-1.237-.483-1.875-.93-2.13-1.501-.186-.4-.151-.867.093-1.236a1.42 1.42 0 01-.2-1.166c.069-.273.226-.516.447-.694a1.41 1.41 0 01.2-1.722c.233-.248.557-.391.917-.407l.078-.001a9.385 9.385 0 01-.44-2.85c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0zM4.188 14.758c.125.687 2.357 2.35 2.14 2.707-.19.315-.796-.239-.948-.386l-.041-.04-.168-.147c-.561-.479-2.304-1.9-2.74-1.432-.43.46.119.859 1.055 1.42l.784.467.136.083c1.045.643 1.12.84.95 1.113-.188.295-3.07-2.1-3.34-1.083-.27 1.011 2.942 1.304 2.744 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725l.16.04.175.042c1.227.284 3.565.65 4.435-.604.673-.973.64-1.709-.248-2.61l-.057-.057c-.945-.928-1.495-2.288-1.495-2.288l-.017-.058-.025-.072c-.082-.22-.284-.639-.63-.584-.46.073-.798 1.21.12 1.933l.05.038c.977.721-.195 1.21-.573.534l-.058-.104-.143-.25c-.463-.799-1.282-2.111-1.739-2.397-.532-.332-.907-.148-.782.541zm14.842-.541c-.533.335-1.563 2.074-1.94 2.751a.613.613 0 01-.687.302.436.436 0 01-.176-.098.303.303 0 01-.049-.06l-.014-.028-.008-.02-.007-.019-.003-.013-.003-.017a.289.289 0 01-.004-.048c0-.12.071-.266.25-.427.026-.024.054-.047.084-.07l.047-.036c.022-.016.043-.032.063-.049.883-.71.573-1.81.131-1.917l-.031-.006-.056-.004a.368.368 0 00-.062.006l-.028.005-.042.014-.039.017-.028.015-.028.019-.036.027-.023.02c-.173.158-.273.428-.31.542l-.016.054s-.53 1.309-1.439 2.234l-.054.054c-.365.358-.596.69-.702 1.018-.143.437-.066.868.21 1.353.055.097.117.195.187.296.882 1.275 3.282.876 4.494.59l.286-.07.25-.074c.276-.084.736-.233 1.2-.42l.188-.077.065-.028.064-.028.124-.056.081-.038c.529-.252.964-.543.994-.827l.001-.036a.299.299 0 00-.037-.139c-.094-.176-.271-.212-.491-.168l-.045.01c-.044.01-.09.024-.136.04l-.097.035-.054.022c-.559.23-1.238.705-1.607.745h.006a.452.452 0 01-.05.003h-.024l-.024-.003-.023-.005c-.068-.016-.116-.06-.14-.142a.22.22 0 01-.005-.1c.062-.345.958-.595 1.713-.91l.066-.028c.528-.224.97-.483.985-.832v-.04a.47.47 0 00-.016-.098c-.048-.18-.175-.251-.36-.251-.785 0-2.55 1.36-2.92 1.36-.025 0-.048-.007-.058-.024a.6.6 0 01-.046-.088c-.1-.238.068-.462 1.06-1.066l.209-.126c.538-.32 1.01-.588 1.341-.831.29-.212.475-.406.503-.6l.003-.028c.008-.113-.038-.227-.147-.344a.266.266 0 00-.07-.054l-.034-.015-.013-.005a.403.403 0 00-.13-.02c-.162 0-.369.07-.595.18-.637.313-1.431.952-1.826 1.285l-.249.215-.033.033c-.08.078-.288.27-.493.386l-.071.037-.041.019a.535.535 0 01-.122.036h.005a.346.346 0 01-.031.003l.01-.001-.013.001c-.079.005-.145-.021-.19-.095a.113.113 0 01-.014-.065c.027-.465 2.034-1.991 2.152-2.642l.009-.048c.1-.65-.271-.817-.791-.493zM11.938 2.984c-4.798 0-8.688 3.829-8.688 8.55 0 .692.083 1.364.24 2.008l.008-.009c.252-.298.612-.46 1.017-.46.355.008.699.117.993.312.22.14.465.384.715.694.261-.372.69-.598 1.15-.605.852 0 1.367.728 1.562 1.383l.047.105.06.127c.192.396.595 1.139 1.143 1.68 1.06 1.04 1.324 2.115.8 3.266a8.865 8.865 0 002.024-.014c-.505-1.12-.26-2.17.74-3.186l.066-.066c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694a1.87 1.87 0 01.99-.312c.357 0 .682.126.925.36.14-.61.215-1.245.215-1.898 0-4.722-3.89-8.55-8.687-8.55zm1.857 8.926l.439-.212c.553-.264.89-.383.89.152 0 1.093-.771 3.208-3.155 3.262h-.184c-2.325-.052-3.116-2.06-3.156-3.175l-.001-.087c0-1.107 1.452.586 3.25.586.716 0 1.379-.272 1.917-.526zm4.017-3.143c.45 0 .813.358.813.8 0 .441-.364.8-.813.8a.806.806 0 01-.812-.8c0-.442.364-.8.812-.8zm-11.624 0c.448 0 .812.358.812.8 0 .441-.364.8-.812.8a.806.806 0 01-.813-.8c0-.442.364-.8.813-.8zm7.79-.841c.32-.384.846-.54 1.33-.394.483.146.83.564.878 1.06.048.495-.212.97-.659 1.203-.322.168-.447-.477-.767-.585l.002-.003c-.287-.098-.772.362-.925.079a1.215 1.215 0 01.14-1.36zm-4.323 0c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003c-.108.036-.194.134-.273.24l-.118.165c-.11.15-.22.262-.377.18a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394z"})]}),"Live Demo (HuggingFace)",(0,s.jsx)(rq.A,{className:"h-3 w-3"})]}),(0,s.jsx)("a",{href:"https://www.buymeacoffee.com/otst",target:"_blank",rel:"noopener noreferrer",children:(0,s.jsx)("img",{src:"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png",alt:"Buy Me A Coffee",style:{height:"30px",width:"109px"}})})]})]})]}),(0,s.jsxs)("div",{className:"flex justify-between items-center pt-4 border-t",children:[(0,s.jsxs)(rO.E,{variant:"secondary",className:"text-xs",children:["v",process.env.NEXT_PUBLIC_APP_VERSION||t5.rE]}),(0,s.jsx)(m.$,{onClick:()=>t(!1),children:"Close"})]})]})})}let r_=(0,v.A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),r$=(0,v.A)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]),rU=(0,v.A)("settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),rH=(0,v.A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),rV=(0,v.A)("test-tube",[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2",key:"125lnx"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]]);var rW=r(99270);let rG=(0,v.A)("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]),rK=(0,v.A)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),rY=(0,v.A)("list",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);var rJ=r(51567),rX=r(39390);let rZ={name:"Example Studios",description:"Creative agency portfolio showcasing modern web development capabilities",directories:["/styles","/scripts","/portfolio","/assets","/assets/images","/templates"],files:[{path:"/index.html",content:` +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},rE=({contentRef:e,descriptionId:t})=>{let r=rC("DialogDescriptionWarning"),n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return l.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null};function rD({...e}){return(0,s.jsx)(rt,{"data-slot":"dialog",...e})}function rM({...e}){return(0,s.jsx)(ro,{"data-slot":"dialog-portal",...e})}function rP({className:e,...t}){return(0,s.jsx)(rl,{"data-slot":"dialog-overlay",className:(0,h.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 backdrop-blur-sm",e),...t})}function rT({className:e,children:t,showCloseButton:r=!0,...n}){return(0,s.jsxs)(rM,{"data-slot":"dialog-portal",children:[(0,s.jsx)(rP,{}),(0,s.jsxs)(rp,{"data-slot":"dialog-content",className:(0,h.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-2xl duration-200 sm:max-w-lg",e),...n,children:[t,r&&(0,s.jsxs)(rw,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,s.jsx)(k.A,{}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function rI({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"dialog-header",className:(0,h.cn)("flex flex-col gap-2 text-center sm:text-left",e),...t})}function rA({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"dialog-footer",className:(0,h.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function rR({className:e,...t}){return(0,s.jsx)(rv,{"data-slot":"dialog-title",className:(0,h.cn)("text-lg leading-none font-semibold",e),...t})}function rL({className:e,...t}){return(0,s.jsx)(ry,{"data-slot":"dialog-description",className:(0,h.cn)("text-muted-foreground text-sm",e),...t})}var rz=r(96271),rO=r(59821);let rF=(0,v.A)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);var r_=r(25334);function rq({open:e,onOpenChange:t}){return(0,s.jsx)(rD,{open:e,onOpenChange:t,children:(0,s.jsxs)(rT,{className:"max-w-3xl max-h-[90vh]",children:[(0,s.jsx)(rI,{children:(0,s.jsxs)("div",{className:"flex items-center gap-4 mb-2",children:[(0,s.jsx)(rz.g,{width:64,height:64}),(0,s.jsxs)("div",{children:[(0,s.jsx)(rR,{className:"text-2xl",children:"DeepStudio"}),(0,s.jsx)(rL,{className:"text-base",children:"Browser-based Website Builder"})]})]})}),(0,s.jsxs)("div",{className:"space-y-6 overflow-y-auto max-h-[60vh] pr-4",children:[(0,s.jsx)("section",{children:(0,s.jsxs)("div",{className:"text-sm text-gray-600 dark:text-gray-300 leading-relaxed space-y-3",children:[(0,s.jsx)("p",{children:"DeepStudio is a fork from @enzostvs and @victor's DeepSite v2 that over the months of tinkering became a BYOK (Bring Your Own Key) agentic browser-based website builder where you describe what you want and an agent writes the code."}),(0,s.jsx)("p",{children:"This is a solo project and there isn't a huge corpo behind it. I'll do my best to fix issues and possibly keep the project improving, but it's just me doing this for fun so please be patient. All feedback and contributions are more than welcome."}),(0,s.jsx)("p",{children:"If you make something with the app I would be thrilled if you could share what you've made."})]})}),(0,s.jsxs)("section",{children:[(0,s.jsx)("h3",{className:"font-semibold text-lg mb-3",children:"Links & Support"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("a",{href:"https://github.com/o-stahl/deepstudio",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-blue-600 dark:text-blue-400 hover:underline",children:[(0,s.jsx)(rF,{className:"h-4 w-4"}),"GitHub repo",(0,s.jsx)(r_.A,{className:"h-3 w-3"})]}),(0,s.jsxs)("a",{href:"https://huggingface.co/spaces/o-stahl/deepstudio",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-blue-600 dark:text-blue-400 hover:underline",children:[(0,s.jsxs)("svg",{fill:"currentColor",fillRule:"evenodd",height:"1em",style:{flex:"none",lineHeight:1},viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",children:[(0,s.jsx)("title",{children:"HuggingFace"}),(0,s.jsx)("path",{d:"M16.781 3.277c2.997 1.704 4.844 4.851 4.844 8.258 0 .995-.155 1.955-.443 2.857a1.332 1.332 0 011.125.4 1.41 1.41 0 01.2 1.723c.204.165.352.385.428.632l.017.062c.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.255.57-.893 1.018-2.128 1.5l-.202.078-.131.048c-.478.173-.89.295-1.061.345l-.086.024c-.89.243-1.808.375-2.732.394-1.32 0-2.3-.36-2.923-1.067a9.852 9.852 0 01-3.18.018C9.778 21.647 8.802 22 7.494 22a11.249 11.249 0 01-2.541-.343l-.221-.06-.273-.08a16.574 16.574 0 01-1.175-.405c-1.237-.483-1.875-.93-2.13-1.501-.186-.4-.151-.867.093-1.236a1.42 1.42 0 01-.2-1.166c.069-.273.226-.516.447-.694a1.41 1.41 0 01.2-1.722c.233-.248.557-.391.917-.407l.078-.001a9.385 9.385 0 01-.44-2.85c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0zM4.188 14.758c.125.687 2.357 2.35 2.14 2.707-.19.315-.796-.239-.948-.386l-.041-.04-.168-.147c-.561-.479-2.304-1.9-2.74-1.432-.43.46.119.859 1.055 1.42l.784.467.136.083c1.045.643 1.12.84.95 1.113-.188.295-3.07-2.1-3.34-1.083-.27 1.011 2.942 1.304 2.744 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725l.16.04.175.042c1.227.284 3.565.65 4.435-.604.673-.973.64-1.709-.248-2.61l-.057-.057c-.945-.928-1.495-2.288-1.495-2.288l-.017-.058-.025-.072c-.082-.22-.284-.639-.63-.584-.46.073-.798 1.21.12 1.933l.05.038c.977.721-.195 1.21-.573.534l-.058-.104-.143-.25c-.463-.799-1.282-2.111-1.739-2.397-.532-.332-.907-.148-.782.541zm14.842-.541c-.533.335-1.563 2.074-1.94 2.751a.613.613 0 01-.687.302.436.436 0 01-.176-.098.303.303 0 01-.049-.06l-.014-.028-.008-.02-.007-.019-.003-.013-.003-.017a.289.289 0 01-.004-.048c0-.12.071-.266.25-.427.026-.024.054-.047.084-.07l.047-.036c.022-.016.043-.032.063-.049.883-.71.573-1.81.131-1.917l-.031-.006-.056-.004a.368.368 0 00-.062.006l-.028.005-.042.014-.039.017-.028.015-.028.019-.036.027-.023.02c-.173.158-.273.428-.31.542l-.016.054s-.53 1.309-1.439 2.234l-.054.054c-.365.358-.596.69-.702 1.018-.143.437-.066.868.21 1.353.055.097.117.195.187.296.882 1.275 3.282.876 4.494.59l.286-.07.25-.074c.276-.084.736-.233 1.2-.42l.188-.077.065-.028.064-.028.124-.056.081-.038c.529-.252.964-.543.994-.827l.001-.036a.299.299 0 00-.037-.139c-.094-.176-.271-.212-.491-.168l-.045.01c-.044.01-.09.024-.136.04l-.097.035-.054.022c-.559.23-1.238.705-1.607.745h.006a.452.452 0 01-.05.003h-.024l-.024-.003-.023-.005c-.068-.016-.116-.06-.14-.142a.22.22 0 01-.005-.1c.062-.345.958-.595 1.713-.91l.066-.028c.528-.224.97-.483.985-.832v-.04a.47.47 0 00-.016-.098c-.048-.18-.175-.251-.36-.251-.785 0-2.55 1.36-2.92 1.36-.025 0-.048-.007-.058-.024a.6.6 0 01-.046-.088c-.1-.238.068-.462 1.06-1.066l.209-.126c.538-.32 1.01-.588 1.341-.831.29-.212.475-.406.503-.6l.003-.028c.008-.113-.038-.227-.147-.344a.266.266 0 00-.07-.054l-.034-.015-.013-.005a.403.403 0 00-.13-.02c-.162 0-.369.07-.595.18-.637.313-1.431.952-1.826 1.285l-.249.215-.033.033c-.08.078-.288.27-.493.386l-.071.037-.041.019a.535.535 0 01-.122.036h.005a.346.346 0 01-.031.003l.01-.001-.013.001c-.079.005-.145-.021-.19-.095a.113.113 0 01-.014-.065c.027-.465 2.034-1.991 2.152-2.642l.009-.048c.1-.65-.271-.817-.791-.493zM11.938 2.984c-4.798 0-8.688 3.829-8.688 8.55 0 .692.083 1.364.24 2.008l.008-.009c.252-.298.612-.46 1.017-.46.355.008.699.117.993.312.22.14.465.384.715.694.261-.372.69-.598 1.15-.605.852 0 1.367.728 1.562 1.383l.047.105.06.127c.192.396.595 1.139 1.143 1.68 1.06 1.04 1.324 2.115.8 3.266a8.865 8.865 0 002.024-.014c-.505-1.12-.26-2.17.74-3.186l.066-.066c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694a1.87 1.87 0 01.99-.312c.357 0 .682.126.925.36.14-.61.215-1.245.215-1.898 0-4.722-3.89-8.55-8.687-8.55zm1.857 8.926l.439-.212c.553-.264.89-.383.89.152 0 1.093-.771 3.208-3.155 3.262h-.184c-2.325-.052-3.116-2.06-3.156-3.175l-.001-.087c0-1.107 1.452.586 3.25.586.716 0 1.379-.272 1.917-.526zm4.017-3.143c.45 0 .813.358.813.8 0 .441-.364.8-.813.8a.806.806 0 01-.812-.8c0-.442.364-.8.812-.8zm-11.624 0c.448 0 .812.358.812.8 0 .441-.364.8-.812.8a.806.806 0 01-.813-.8c0-.442.364-.8.813-.8zm7.79-.841c.32-.384.846-.54 1.33-.394.483.146.83.564.878 1.06.048.495-.212.97-.659 1.203-.322.168-.447-.477-.767-.585l.002-.003c-.287-.098-.772.362-.925.079a1.215 1.215 0 01.14-1.36zm-4.323 0c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003c-.108.036-.194.134-.273.24l-.118.165c-.11.15-.22.262-.377.18a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394z"})]}),"Live Demo (HuggingFace)",(0,s.jsx)(r_.A,{className:"h-3 w-3"})]}),(0,s.jsx)("a",{href:"https://www.buymeacoffee.com/otst",target:"_blank",rel:"noopener noreferrer",children:(0,s.jsx)("img",{src:"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png",alt:"Buy Me A Coffee",style:{height:"30px",width:"109px"}})})]})]})]}),(0,s.jsxs)("div",{className:"flex justify-between items-center pt-4 border-t",children:[(0,s.jsxs)(rO.E,{variant:"secondary",className:"text-xs",children:["v",process.env.NEXT_PUBLIC_APP_VERSION||t5.rE]}),(0,s.jsx)(m.$,{onClick:()=>t(!1),children:"Close"})]})]})})}let rB=(0,v.A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),r$=(0,v.A)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]),rU=(0,v.A)("settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),rH=(0,v.A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),rV=(0,v.A)("test-tube",[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2",key:"125lnx"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]]);var rW=r(99270);let rG=(0,v.A)("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]),rK=(0,v.A)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),rY=(0,v.A)("list",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);var rJ=r(51567),rX=r(39390);let rZ={name:"Example Studios",description:"Creative agency portfolio showcasing modern web development capabilities",directories:["/styles","/scripts","/portfolio","/assets","/assets/images","/templates"],files:[{path:"/index.html",content:` @@ -3251,10 +3251,10 @@ document.addEventListener('DOMContentLoaded', () => { `},{path:"/data.json",content:`{ "title": "Welcome", "message": "Start building your website!" -}`}]};var r0=r(32623);async function r1(e,t,r,n){await r0.$.runWithSuppressedDirty(t,async()=>{for(let n of r.directories)await e.createDirectory(t,n);for(let n of r.files){let r=n.content;if(n.isBase64){let e=atob(n.content),t=new Uint8Array(e.length);for(let r=0;r0)for(let r of n)try{let n=await fetch(`${window.location.origin}/${r.filename}`);if(n.ok){let a=await n.arrayBuffer();await e.createFile(t,r.path,a)}}catch(e){}})}var r2=r(33135),r3=r(4950),r4=r(83721),r5=r(18853),r6="Switch",[r8,r9]=(0,J.A)(r6),[r7,ne]=r8(r6),nt=l.forwardRef((e,t)=>{let{__scopeSwitch:r,name:n,checked:a,defaultChecked:o,required:i,disabled:c,value:u="on",onCheckedChange:d,form:p,...h}=e,[m,f]=l.useState(null),g=(0,Y.s)(t,e=>f(e)),v=l.useRef(!1),x=!m||p||!!m.closest("form"),[y,b]=(0,X.i)({prop:a,defaultProp:o??!1,onChange:d,caller:r6});return(0,s.jsxs)(r7,{scope:r,checked:y,disabled:c,children:[(0,s.jsx)(Z.sG.button,{type:"button",role:"switch","aria-checked":y,"aria-required":i,"data-state":no(y),"data-disabled":c?"":void 0,disabled:c,value:u,...h,ref:g,onClick:(0,K.mK)(e.onClick,e=>{b(e=>!e),x&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),x&&(0,s.jsx)(na,{control:m,bubbles:!v.current,name:n,value:u,checked:y,required:i,disabled:c,form:p,style:{transform:"translateX(-100%)"}})]})});nt.displayName=r6;var nr="SwitchThumb",nn=l.forwardRef((e,t)=>{let{__scopeSwitch:r,...n}=e,a=ne(nr,r);return(0,s.jsx)(Z.sG.span,{"data-state":no(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:t})});nn.displayName=nr;var na=l.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...a},o)=>{let i=l.useRef(null),c=(0,Y.s)(i,o),u=(0,r4.Z)(r),d=(0,r5.X)(t);return l.useEffect(()=>{let e=i.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(u!==r&&t){let a=new Event("click",{bubbles:n});t.call(e,r),e.dispatchEvent(a)}},[u,r,n]),(0,s.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:c,style:{...a.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function no(e){return e?"checked":"unchecked"}function ni({className:e,...t}){return(0,s.jsx)(nt,{"data-slot":"switch",className:(0,h.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:(0,s.jsx)(nn,{"data-slot":"switch-thumb",className:(0,h.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}na.displayName="SwitchBubbleInput";var ns=r(10218);let nl=(0,v.A)("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);var nc=r(78272);let nu=(0,v.A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),nd=(0,v.A)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);var np=r(86884),nh=r(94084),nm=r.n(nh);class nf{static{this.BACKUP_VERSION="1.9.0"}static{this.FILE_EXTENSION=".osws"}static{this.MAX_IMPORT_SIZE=0x6400000}static async exportAllData(){try{h.v.info("Starting data export...");let e={version:this.BACKUP_VERSION,exportDate:new Date().toISOString(),databases:{vfs:await this.exportVFSData(),conversations:await this.exportConversationData(),checkpoints:await this.exportCheckpointData()},metadata:{projectCount:0,totalSize:0,exportedFrom:"deepstudio"}};e.metadata.projectCount=e.databases.vfs.projects.length,e.metadata.totalSize=this.calculateDataSize(e);let t=new(nm());t.file("backup.json",JSON.stringify(e,null,2));let r=await t.generateAsync({type:"blob",compression:"DEFLATE",compressionOptions:{level:6}}),n=`oswstudio-backup-${new Date().toISOString().split("T")[0]}${this.FILE_EXTENSION}`;this.downloadBlob(r,n),h.v.info(`Export completed: ${e.metadata.projectCount} projects, ${this.formatBytes(e.metadata.totalSize)}`)}catch(e){throw h.v.error("Export failed:",e),Error(`Export failed: ${e instanceof Error?e.message:"Unknown error"}`)}}static async importAllData(e,t={mode:"merge"}){try{if(!e.name.endsWith(this.FILE_EXTENSION))throw Error(`Invalid file type. Expected ${this.FILE_EXTENSION} file.`);if(e.size>this.MAX_IMPORT_SIZE)throw Error(`File too large. Maximum size is ${this.formatBytes(this.MAX_IMPORT_SIZE)}.`);t.onProgress?.(10,"Reading backup file...");let r=new(nm()),n=(await r.loadAsync(e)).file("backup.json");if(!n)throw Error("Invalid backup file format.");let a=await n.async("string"),o=JSON.parse(a);this.validateBackupData(o),t.onProgress?.(30,"Validating backup data..."),"replace"===t.mode&&(t.onProgress?.(40,"Clearing existing data..."),await this.clearAllData()),t.onProgress?.(50,"Importing projects and files..."),await this.importVFSData(o.databases.vfs),t.onProgress?.(70,"Importing conversations..."),await this.importConversationData(o.databases.conversations),t.onProgress?.(90,"Importing checkpoints..."),await this.importCheckpointData(o.databases.checkpoints),t.onProgress?.(100,"Import completed successfully!"),h.v.info(`Import completed: ${o.metadata.projectCount} projects restored`)}catch(e){throw h.v.error("Import failed:",e),Error(`Import failed: ${e instanceof Error?e.message:"Unknown error"}`)}}static async validateBackupFile(e){try{if(!e.name.endsWith(this.FILE_EXTENSION))return{valid:!1,reason:"Invalid file extension"};if(e.size>this.MAX_IMPORT_SIZE)return{valid:!1,reason:"File too large"};let t=new(nm()),r=(await t.loadAsync(e)).file("backup.json");if(!r)return{valid:!1,reason:"Invalid backup file format"};let n=await r.async("string"),a=JSON.parse(n);return this.validateBackupData(a),{valid:!0,metadata:a.metadata}}catch(e){return{valid:!1,reason:e instanceof Error?e.message:"Unknown error"}}}static async exportVFSData(){let e={projects:[],files:[],fileTree:[]};return new Promise((t,r)=>{let n=indexedDB.open("deepstudio-vfs",1);n.onsuccess=async()=>{try{let r=n.result,a=r.transaction(["projects"],"readonly"),o=a.objectStore("projects").getAll();o.onsuccess=()=>{e.projects=o.result||[]};let i=r.transaction(["files"],"readonly"),s=i.objectStore("files").getAll();s.onsuccess=()=>{e.files=s.result||[]};let l=r.transaction(["fileTree"],"readonly"),c=l.objectStore("fileTree").getAll();c.onsuccess=()=>{e.fileTree=c.result||[]},await Promise.all([new Promise(e=>a.oncomplete=()=>e(void 0)),new Promise(e=>i.oncomplete=()=>e(void 0)),new Promise(e=>l.oncomplete=()=>e(void 0))]),t(e)}catch(e){r(e)}},n.onerror=()=>r(n.error)})}static async exportConversationData(){return new Promise((e,t)=>{let r=indexedDB.open("DeepStudioConversations",1);r.onsuccess=()=>{let n=r.result.transaction(["conversations"],"readonly").objectStore("conversations").getAll();n.onsuccess=()=>{e(n.result||[])},n.onerror=()=>t(n.error)},r.onerror=()=>t(r.error)})}static async exportCheckpointData(){return new Promise((e,t)=>{let r=indexedDB.open("DeepStudioCheckpoints",1);r.onsuccess=()=>{let n=r.result.transaction(["checkpoints"],"readonly").objectStore("checkpoints").getAll();n.onsuccess=()=>{e(n.result||[])},n.onerror=()=>t(n.error)},r.onerror=()=>t(r.error)})}static async importVFSData(e){return new Promise((t,r)=>{let n=indexedDB.open("deepstudio-vfs",1);n.onsuccess=async()=>{try{let r=n.result,a=r.transaction(["projects"],"readwrite").objectStore("projects");for(let t of e.projects)await new Promise((e,r)=>{let n=a.put(t);n.onsuccess=()=>e(),n.onerror=()=>r(n.error)});let o=r.transaction(["files"],"readwrite").objectStore("files");for(let t of e.files)await new Promise((e,r)=>{let n=o.put(t);n.onsuccess=()=>e(),n.onerror=()=>r(n.error)});let i=r.transaction(["fileTree"],"readwrite").objectStore("fileTree");for(let t of e.fileTree)await new Promise((e,r)=>{let n=i.put(t);n.onsuccess=()=>e(),n.onerror=()=>r(n.error)});t()}catch(e){r(e)}},n.onerror=()=>r(n.error)})}static async importConversationData(e){return new Promise((t,r)=>{let n=indexedDB.open("DeepStudioConversations",1);n.onsuccess=async()=>{try{let r=n.result.transaction(["conversations"],"readwrite").objectStore("conversations");for(let t of e)await new Promise((e,n)=>{let a=r.put(t);a.onsuccess=()=>e(),a.onerror=()=>n(a.error)});t()}catch(e){r(e)}},n.onerror=()=>r(n.error)})}static async importCheckpointData(e){return new Promise((t,r)=>{let n=indexedDB.open("DeepStudioCheckpoints",1);n.onsuccess=async()=>{try{let r=n.result.transaction(["checkpoints"],"readwrite").objectStore("checkpoints");for(let t of e)await new Promise((e,n)=>{let a=r.put(t);a.onsuccess=()=>e(),a.onerror=()=>n(a.error)});t()}catch(e){r(e)}},n.onerror=()=>r(n.error)})}static async clearAllData(){for(let e of["deepstudio-vfs","DeepStudioConversations","DeepStudioCheckpoints"])await new Promise((t,r)=>{let n=indexedDB.deleteDatabase(e);n.onsuccess=()=>t(),n.onerror=()=>r(n.error)})}static validateBackupData(e){if(!e.version||!e.exportDate||!e.databases||!e.metadata)throw Error("Invalid backup file structure");if(!e.databases.vfs||!e.databases.conversations||!e.databases.checkpoints)throw Error("Incomplete backup data");let t=e.version.split(".").map(Number),r=this.BACKUP_VERSION.split(".").map(Number);if(t[0]>r[0])throw Error(`Backup version ${e.version} is not compatible with current version ${this.BACKUP_VERSION}`)}static calculateDataSize(e){return JSON.stringify(e).length}static formatBytes(e){if(0===e)return"0 Bytes";let t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(2))+" "+["Bytes","KB","MB","GB"][t]}static downloadBlob(e,t){let r=URL.createObjectURL(e),n=document.createElement("a");n.href=r,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}}var ng=r(66156),nv="Collapsible",[nx,ny]=(0,J.A)(nv),[nb,nw]=nx(nv),nk=l.forwardRef((e,t)=>{let{__scopeCollapsible:r,open:n,defaultOpen:a,disabled:o,onOpenChange:i,...c}=e,[u,d]=(0,X.i)({prop:n,defaultProp:a??!1,onChange:i,caller:nv});return(0,s.jsx)(nb,{scope:r,disabled:o,contentId:(0,ea.B)(),open:u,onOpenToggle:l.useCallback(()=>d(e=>!e),[d]),children:(0,s.jsx)(Z.sG.div,{"data-state":nD(u),"data-disabled":o?"":void 0,...c,ref:t})})});nk.displayName=nv;var nj="CollapsibleTrigger",nN=l.forwardRef((e,t)=>{let{__scopeCollapsible:r,...n}=e,a=nw(nj,r);return(0,s.jsx)(Z.sG.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":nD(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...n,ref:t,onClick:(0,K.mK)(e.onClick,a.onOpenToggle)})});nN.displayName=nj;var nC="CollapsibleContent",nS=l.forwardRef((e,t)=>{let{forceMount:r,...n}=e,a=nw(nC,e.__scopeCollapsible);return(0,s.jsx)(es.C,{present:r||a.open,children:({present:e})=>(0,s.jsx)(nE,{...n,ref:t,present:e})})});nS.displayName=nC;var nE=l.forwardRef((e,t)=>{let{__scopeCollapsible:r,present:n,children:a,...o}=e,i=nw(nC,r),[c,u]=l.useState(n),d=l.useRef(null),p=(0,Y.s)(t,d),h=l.useRef(0),m=h.current,f=l.useRef(0),g=f.current,v=i.open||c,x=l.useRef(v),y=l.useRef(void 0);return l.useEffect(()=>{let e=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,ng.N)(()=>{let e=d.current;if(e){y.current=y.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let t=e.getBoundingClientRect();h.current=t.height,f.current=t.width,x.current||(e.style.transitionDuration=y.current.transitionDuration,e.style.animationName=y.current.animationName),u(n)}},[i.open,n]),(0,s.jsx)(Z.sG.div,{"data-state":nD(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!v,...o,ref:p,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:v&&a})});function nD(e){return e?"open":"closed"}function nP({...e}){return(0,s.jsx)(nk,{"data-slot":"collapsible",...e})}function nM({...e}){return(0,s.jsx)(nN,{"data-slot":"collapsible-trigger",...e})}function nI({...e}){return(0,s.jsx)(nS,{"data-slot":"collapsible-content",...e})}function nT({onClose:e}){let[t,r]=(0,l.useState)({}),[n,a]=(0,l.useState)({}),{theme:o,setTheme:i}=(0,ns.D)(),[c,u]=(0,l.useState)(!1),[d,p]=(0,l.useState)(!1),[h,g]=(0,l.useState)(!1),[v,x]=(0,l.useState)(!1),[y,b]=(0,l.useState)(0),[w,k]=(0,l.useState)(""),[j,N]=(0,l.useState)({application:!0,costTracking:!1,dataManagement:!1}),C=(e,t)=>{r3.s.setSetting(e,t),r(r=>({...r,[e]:t}))},E=async()=>{try{g(!0),await nf.exportAllData(),tV.oR.success("Data exported successfully!")}catch(e){tV.oR.error(e instanceof Error?e.message:"Export failed")}finally{g(!1)}},D=e=>{N(t=>({...t,[e]:!t[e]}))};return(0,s.jsxs)("div",{className:"max-h-[calc(100vh-4rem)] overflow-y-auto",children:[(0,s.jsxs)("div",{className:"space-y-3 pb-4",children:[(0,s.jsxs)(nP,{open:j.application,onOpenChange:()=>D("application"),children:[(0,s.jsxs)(nM,{className:"flex items-center justify-between w-full p-3 rounded-lg hover:bg-muted/50 transition-colors",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(nl,{className:"h-4 w-4"}),(0,s.jsx)("h4",{className:"font-medium text-sm",children:"Application Settings"})]}),(0,s.jsx)(nc.A,{className:`h-4 w-4 transition-transform duration-200 ${j.application?"rotate-180":""}`})]}),(0,s.jsxs)(nI,{className:"px-3 pt-2 pb-3",children:[(0,s.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"Configure your preferences and display options"}),(0,s.jsx)("div",{className:"space-y-4",children:(0,s.jsxs)("div",{children:[(0,s.jsx)(rX.J,{htmlFor:"theme",children:"Theme"}),(0,s.jsxs)(t2.l6,{value:c?o:"dark",onValueChange:e=>{i(e),C("theme",e)},children:[(0,s.jsx)(t2.bq,{id:"theme",className:"mt-2",children:(0,s.jsx)(t2.yv,{})}),(0,s.jsxs)(t2.gC,{children:[(0,s.jsx)(t2.eb,{value:"light",children:"Light"}),(0,s.jsx)(t2.eb,{value:"dark",children:"Dark"}),(0,s.jsx)(t2.eb,{value:"system",children:"System"})]})]})]})})]})]}),(0,s.jsxs)(nP,{open:j.costTracking,onOpenChange:()=>D("costTracking"),children:[(0,s.jsxs)(nM,{className:"flex items-center justify-between w-full p-3 rounded-lg hover:bg-muted/50 transition-colors",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(S,{className:"h-4 w-4"}),(0,s.jsx)("h4",{className:"font-medium text-sm",children:"Cost Tracking"})]}),(0,s.jsx)(nc.A,{className:`h-4 w-4 transition-transform duration-200 ${j.costTracking?"rotate-180":""}`})]}),(0,s.jsx)(nI,{className:"px-3 pt-2 pb-3",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(rX.J,{htmlFor:"show-costs",children:"Display Costs"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Show cost information in messages"})]}),(0,s.jsx)(ni,{id:"show-costs",checked:!1!==n.showCosts,onCheckedChange:e=>{let t={...n,showCosts:e};r3.s.setCostSettings(t),a(t)}})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(rX.J,{htmlFor:"daily-limit",children:"Daily Cost Limit (USD)"}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,s.jsx)(f.p,{id:"daily-limit",type:"number",min:"0",step:"0.01",placeholder:"No limit",value:n.dailyLimit||"",onChange:e=>{let t=e.target.value?parseFloat(e.target.value):void 0,r={...n,dailyLimit:t};r3.s.setCostSettings(r),a(r)}}),n.dailyLimit&&(0,s.jsxs)("span",{className:"text-sm text-muted-foreground",children:["$",n.dailyLimit.toFixed(2),"/day"]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(rX.J,{htmlFor:"project-limit",children:"Project Cost Limit (USD)"}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,s.jsx)(f.p,{id:"project-limit",type:"number",min:"0",step:"0.01",placeholder:"No limit",value:n.projectLimit||"",onChange:e=>{let t=e.target.value?parseFloat(e.target.value):void 0,r={...n,projectLimit:t};r3.s.setCostSettings(r),a(r)}}),n.projectLimit&&(0,s.jsxs)("span",{className:"text-sm text-muted-foreground",children:["$",n.projectLimit.toFixed(2),"/project"]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(rX.J,{htmlFor:"warning-threshold",children:"Warning Threshold (%)"}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,s.jsx)(f.p,{id:"warning-threshold",type:"number",min:"50",max:"100",step:"5",value:n.warningThreshold||80,onChange:e=>{let t=parseInt(e.target.value),r={...n,warningThreshold:t};r3.s.setCostSettings(r),a(r)}}),(0,s.jsxs)("span",{className:"text-sm text-muted-foreground flex items-center gap-1",children:[(0,s.jsx)(nu,{className:"h-3 w-3"}),"Warn at ",n.warningThreshold||80,"%"]})]})]}),(0,s.jsx)("div",{className:"border-t pt-3 mt-3",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:"Lifetime Total"}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:np.U.formatCost(r3.s.getLifetimeCosts().total)})]}),(0,s.jsx)(m.$,{variant:"outline",size:"sm",onClick:()=>{confirm("Reset lifetime cost tracking? This cannot be undone.")&&(r3.s.resetLifetimeCosts(),tV.oR.success("Lifetime costs reset"))},children:"Reset Stats"})]})})]})})]}),(0,s.jsxs)(nP,{open:j.dataManagement,onOpenChange:()=>D("dataManagement"),children:[(0,s.jsxs)(nM,{className:"flex items-center justify-between w-full p-3 rounded-lg hover:bg-muted/50 transition-colors",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(nd,{className:"h-4 w-4"}),(0,s.jsx)("h4",{className:"font-medium text-sm",children:"Data Management"})]}),(0,s.jsx)(nc.A,{className:`h-4 w-4 transition-transform duration-200 ${j.dataManagement?"rotate-180":""}`})]}),(0,s.jsxs)(nI,{className:"px-3 pt-2 pb-3",children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground mb-4",children:"Backup and restore your projects, conversations, and settings. Use this to migrate your data to OSWStudio or create backups."}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:"Export All Data"}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:"Download a backup file containing all your projects and data"})]}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:E,disabled:h,className:"flex items-center gap-2",children:[(0,s.jsx)(I,{className:"h-4 w-4"}),h?"Exporting...":"Export"]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:"Import Data"}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:"Restore from a .osws backup file"})]}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>{let e=document.createElement("input");e.type="file",e.accept=".osws",e.onchange=async e=>{let t=e.target.files?.[0];if(t)try{x(!0),b(0),k("Validating file...");let e=await nf.validateBackupFile(t);if(!e.valid)return void tV.oR.error(`Invalid backup file: ${e.reason}`);let r=confirm(`Import ${e.metadata?.projectCount||0} projects? +}`}]};var r0=r(32623);async function r1(e,t,r,n){await r0.$.runWithSuppressedDirty(t,async()=>{for(let n of r.directories)await e.createDirectory(t,n);for(let n of r.files){let r=n.content;if(n.isBase64){let e=atob(n.content),t=new Uint8Array(e.length);for(let r=0;r0)for(let r of n)try{let n=await fetch(`${window.location.origin}/${r.filename}`);if(n.ok){let a=await n.arrayBuffer();await e.createFile(t,r.path,a)}}catch(e){}})}var r2=r(33135),r3=r(4950),r4=r(83721),r5=r(18853),r6="Switch",[r8,r9]=(0,J.A)(r6),[r7,ne]=r8(r6),nt=l.forwardRef((e,t)=>{let{__scopeSwitch:r,name:n,checked:a,defaultChecked:i,required:o,disabled:c,value:u="on",onCheckedChange:d,form:p,...h}=e,[m,f]=l.useState(null),g=(0,Y.s)(t,e=>f(e)),v=l.useRef(!1),x=!m||p||!!m.closest("form"),[y,b]=(0,X.i)({prop:a,defaultProp:i??!1,onChange:d,caller:r6});return(0,s.jsxs)(r7,{scope:r,checked:y,disabled:c,children:[(0,s.jsx)(Z.sG.button,{type:"button",role:"switch","aria-checked":y,"aria-required":o,"data-state":ni(y),"data-disabled":c?"":void 0,disabled:c,value:u,...h,ref:g,onClick:(0,K.mK)(e.onClick,e=>{b(e=>!e),x&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),x&&(0,s.jsx)(na,{control:m,bubbles:!v.current,name:n,value:u,checked:y,required:o,disabled:c,form:p,style:{transform:"translateX(-100%)"}})]})});nt.displayName=r6;var nr="SwitchThumb",nn=l.forwardRef((e,t)=>{let{__scopeSwitch:r,...n}=e,a=ne(nr,r);return(0,s.jsx)(Z.sG.span,{"data-state":ni(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:t})});nn.displayName=nr;var na=l.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...a},i)=>{let o=l.useRef(null),c=(0,Y.s)(o,i),u=(0,r4.Z)(r),d=(0,r5.X)(t);return l.useEffect(()=>{let e=o.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(u!==r&&t){let a=new Event("click",{bubbles:n});t.call(e,r),e.dispatchEvent(a)}},[u,r,n]),(0,s.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:c,style:{...a.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function ni(e){return e?"checked":"unchecked"}function no({className:e,...t}){return(0,s.jsx)(nt,{"data-slot":"switch",className:(0,h.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:(0,s.jsx)(nn,{"data-slot":"switch-thumb",className:(0,h.cn)("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}na.displayName="SwitchBubbleInput";var ns=r(10218);let nl=(0,v.A)("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);var nc=r(78272);let nu=(0,v.A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),nd=(0,v.A)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);var np=r(86884),nh=r(94084),nm=r.n(nh);class nf{static{this.BACKUP_VERSION="1.9.0"}static{this.FILE_EXTENSION=".osws"}static{this.MAX_IMPORT_SIZE=0x6400000}static async exportAllData(){try{h.v.info("Starting data export...");let e={version:this.BACKUP_VERSION,exportDate:new Date().toISOString(),databases:{vfs:await this.exportVFSData(),conversations:await this.exportConversationData(),checkpoints:await this.exportCheckpointData()},metadata:{projectCount:0,totalSize:0,exportedFrom:"deepstudio"}};e.metadata.projectCount=e.databases.vfs.projects.length,e.metadata.totalSize=this.calculateDataSize(e);let t=new(nm());t.file("backup.json",JSON.stringify(e,null,2));let r=await t.generateAsync({type:"blob",compression:"DEFLATE",compressionOptions:{level:6}}),n=`oswstudio-backup-${new Date().toISOString().split("T")[0]}${this.FILE_EXTENSION}`;this.downloadBlob(r,n),h.v.info(`Export completed: ${e.metadata.projectCount} projects, ${this.formatBytes(e.metadata.totalSize)}`)}catch(e){throw h.v.error("Export failed:",e),Error(`Export failed: ${e instanceof Error?e.message:"Unknown error"}`)}}static async importAllData(e,t={mode:"merge"}){try{if(!e.name.endsWith(this.FILE_EXTENSION))throw Error(`Invalid file type. Expected ${this.FILE_EXTENSION} file.`);if(e.size>this.MAX_IMPORT_SIZE)throw Error(`File too large. Maximum size is ${this.formatBytes(this.MAX_IMPORT_SIZE)}.`);t.onProgress?.(10,"Reading backup file...");let r=new(nm()),n=(await r.loadAsync(e)).file("backup.json");if(!n)throw Error("Invalid backup file format.");let a=await n.async("string"),i=JSON.parse(a);this.validateBackupData(i),t.onProgress?.(30,"Validating backup data..."),"replace"===t.mode&&(t.onProgress?.(40,"Clearing existing data..."),await this.clearAllData()),t.onProgress?.(50,"Importing projects and files..."),await this.importVFSData(i.databases.vfs),t.onProgress?.(70,"Importing conversations..."),await this.importConversationData(i.databases.conversations),t.onProgress?.(90,"Importing checkpoints..."),await this.importCheckpointData(i.databases.checkpoints),t.onProgress?.(100,"Import completed successfully!"),h.v.info(`Import completed: ${i.metadata.projectCount} projects restored`)}catch(e){throw h.v.error("Import failed:",e),Error(`Import failed: ${e instanceof Error?e.message:"Unknown error"}`)}}static async validateBackupFile(e){try{if(!e.name.endsWith(this.FILE_EXTENSION))return{valid:!1,reason:"Invalid file extension"};if(e.size>this.MAX_IMPORT_SIZE)return{valid:!1,reason:"File too large"};let t=new(nm()),r=(await t.loadAsync(e)).file("backup.json");if(!r)return{valid:!1,reason:"Invalid backup file format"};let n=await r.async("string"),a=JSON.parse(n);return this.validateBackupData(a),{valid:!0,metadata:a.metadata}}catch(e){return{valid:!1,reason:e instanceof Error?e.message:"Unknown error"}}}static async exportVFSData(){let e={projects:[],files:[],fileTree:[]};return new Promise((t,r)=>{let n=indexedDB.open("deepstudio-vfs",1);n.onsuccess=async()=>{try{let r=n.result,a=r.transaction(["projects"],"readonly"),i=a.objectStore("projects").getAll();i.onsuccess=()=>{e.projects=i.result||[]};let o=r.transaction(["files"],"readonly"),s=o.objectStore("files").getAll();s.onsuccess=()=>{e.files=s.result||[]};let l=r.transaction(["fileTree"],"readonly"),c=l.objectStore("fileTree").getAll();c.onsuccess=()=>{e.fileTree=c.result||[]},await Promise.all([new Promise(e=>a.oncomplete=()=>e(void 0)),new Promise(e=>o.oncomplete=()=>e(void 0)),new Promise(e=>l.oncomplete=()=>e(void 0))]),t(e)}catch(e){r(e)}},n.onerror=()=>r(n.error)})}static async exportConversationData(){return new Promise((e,t)=>{let r=indexedDB.open("DeepStudioConversations",1);r.onsuccess=()=>{let n=r.result.transaction(["conversations"],"readonly").objectStore("conversations").getAll();n.onsuccess=()=>{e(n.result||[])},n.onerror=()=>t(n.error)},r.onerror=()=>t(r.error)})}static async exportCheckpointData(){return new Promise((e,t)=>{let r=indexedDB.open("DeepStudioCheckpoints",1);r.onsuccess=()=>{let n=r.result.transaction(["checkpoints"],"readonly").objectStore("checkpoints").getAll();n.onsuccess=()=>{e(n.result||[])},n.onerror=()=>t(n.error)},r.onerror=()=>t(r.error)})}static async importVFSData(e){return new Promise((t,r)=>{let n=indexedDB.open("deepstudio-vfs",1);n.onsuccess=async()=>{try{let r=n.result,a=r.transaction(["projects"],"readwrite").objectStore("projects");for(let t of e.projects)await new Promise((e,r)=>{let n=a.put(t);n.onsuccess=()=>e(),n.onerror=()=>r(n.error)});let i=r.transaction(["files"],"readwrite").objectStore("files");for(let t of e.files)await new Promise((e,r)=>{let n=i.put(t);n.onsuccess=()=>e(),n.onerror=()=>r(n.error)});let o=r.transaction(["fileTree"],"readwrite").objectStore("fileTree");for(let t of e.fileTree)await new Promise((e,r)=>{let n=o.put(t);n.onsuccess=()=>e(),n.onerror=()=>r(n.error)});t()}catch(e){r(e)}},n.onerror=()=>r(n.error)})}static async importConversationData(e){return new Promise((t,r)=>{let n=indexedDB.open("DeepStudioConversations",1);n.onsuccess=async()=>{try{let r=n.result.transaction(["conversations"],"readwrite").objectStore("conversations");for(let t of e)await new Promise((e,n)=>{let a=r.put(t);a.onsuccess=()=>e(),a.onerror=()=>n(a.error)});t()}catch(e){r(e)}},n.onerror=()=>r(n.error)})}static async importCheckpointData(e){return new Promise((t,r)=>{let n=indexedDB.open("DeepStudioCheckpoints",1);n.onsuccess=async()=>{try{let r=n.result.transaction(["checkpoints"],"readwrite").objectStore("checkpoints");for(let t of e)await new Promise((e,n)=>{let a=r.put(t);a.onsuccess=()=>e(),a.onerror=()=>n(a.error)});t()}catch(e){r(e)}},n.onerror=()=>r(n.error)})}static async clearAllData(){for(let e of["deepstudio-vfs","DeepStudioConversations","DeepStudioCheckpoints"])await new Promise((t,r)=>{let n=indexedDB.deleteDatabase(e);n.onsuccess=()=>t(),n.onerror=()=>r(n.error)})}static validateBackupData(e){if(!e.version||!e.exportDate||!e.databases||!e.metadata)throw Error("Invalid backup file structure");if(!e.databases.vfs||!e.databases.conversations||!e.databases.checkpoints)throw Error("Incomplete backup data");let t=e.version.split(".").map(Number),r=this.BACKUP_VERSION.split(".").map(Number);if(t[0]>r[0])throw Error(`Backup version ${e.version} is not compatible with current version ${this.BACKUP_VERSION}`)}static calculateDataSize(e){return JSON.stringify(e).length}static formatBytes(e){if(0===e)return"0 Bytes";let t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(2))+" "+["Bytes","KB","MB","GB"][t]}static downloadBlob(e,t){let r=URL.createObjectURL(e),n=document.createElement("a");n.href=r,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}}var ng=r(66156),nv="Collapsible",[nx,ny]=(0,J.A)(nv),[nb,nw]=nx(nv),nk=l.forwardRef((e,t)=>{let{__scopeCollapsible:r,open:n,defaultOpen:a,disabled:i,onOpenChange:o,...c}=e,[u,d]=(0,X.i)({prop:n,defaultProp:a??!1,onChange:o,caller:nv});return(0,s.jsx)(nb,{scope:r,disabled:i,contentId:(0,ea.B)(),open:u,onOpenToggle:l.useCallback(()=>d(e=>!e),[d]),children:(0,s.jsx)(Z.sG.div,{"data-state":nD(u),"data-disabled":i?"":void 0,...c,ref:t})})});nk.displayName=nv;var nj="CollapsibleTrigger",nN=l.forwardRef((e,t)=>{let{__scopeCollapsible:r,...n}=e,a=nw(nj,r);return(0,s.jsx)(Z.sG.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":nD(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...n,ref:t,onClick:(0,K.mK)(e.onClick,a.onOpenToggle)})});nN.displayName=nj;var nC="CollapsibleContent",nS=l.forwardRef((e,t)=>{let{forceMount:r,...n}=e,a=nw(nC,e.__scopeCollapsible);return(0,s.jsx)(es.C,{present:r||a.open,children:({present:e})=>(0,s.jsx)(nE,{...n,ref:t,present:e})})});nS.displayName=nC;var nE=l.forwardRef((e,t)=>{let{__scopeCollapsible:r,present:n,children:a,...i}=e,o=nw(nC,r),[c,u]=l.useState(n),d=l.useRef(null),p=(0,Y.s)(t,d),h=l.useRef(0),m=h.current,f=l.useRef(0),g=f.current,v=o.open||c,x=l.useRef(v),y=l.useRef(void 0);return l.useEffect(()=>{let e=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,ng.N)(()=>{let e=d.current;if(e){y.current=y.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let t=e.getBoundingClientRect();h.current=t.height,f.current=t.width,x.current||(e.style.transitionDuration=y.current.transitionDuration,e.style.animationName=y.current.animationName),u(n)}},[o.open,n]),(0,s.jsx)(Z.sG.div,{"data-state":nD(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!v,...i,ref:p,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:v&&a})});function nD(e){return e?"open":"closed"}function nM({...e}){return(0,s.jsx)(nk,{"data-slot":"collapsible",...e})}function nP({...e}){return(0,s.jsx)(nN,{"data-slot":"collapsible-trigger",...e})}function nT({...e}){return(0,s.jsx)(nS,{"data-slot":"collapsible-content",...e})}function nI({onClose:e}){let[t,r]=(0,l.useState)({}),[n,a]=(0,l.useState)({}),{theme:i,setTheme:o}=(0,ns.D)(),[c,u]=(0,l.useState)(!1),[d,p]=(0,l.useState)(!1),[h,g]=(0,l.useState)(!1),[v,x]=(0,l.useState)(!1),[y,b]=(0,l.useState)(0),[w,k]=(0,l.useState)(""),[j,N]=(0,l.useState)({application:!0,costTracking:!1,dataManagement:!1}),C=(e,t)=>{r3.s.setSetting(e,t),r(r=>({...r,[e]:t}))},E=async()=>{try{g(!0),await nf.exportAllData(),tV.oR.success("Data exported successfully!")}catch(e){tV.oR.error(e instanceof Error?e.message:"Export failed")}finally{g(!1)}},D=e=>{N(t=>({...t,[e]:!t[e]}))};return(0,s.jsxs)("div",{className:"max-h-[calc(100vh-4rem)] overflow-y-auto",children:[(0,s.jsxs)("div",{className:"space-y-3 pb-4",children:[(0,s.jsxs)(nM,{open:j.application,onOpenChange:()=>D("application"),children:[(0,s.jsxs)(nP,{className:"flex items-center justify-between w-full p-3 rounded-lg hover:bg-muted/50 transition-colors",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(nl,{className:"h-4 w-4"}),(0,s.jsx)("h4",{className:"font-medium text-sm",children:"Application Settings"})]}),(0,s.jsx)(nc.A,{className:`h-4 w-4 transition-transform duration-200 ${j.application?"rotate-180":""}`})]}),(0,s.jsxs)(nT,{className:"px-3 pt-2 pb-3",children:[(0,s.jsx)("p",{className:"text-muted-foreground text-xs mb-4",children:"Configure your preferences and display options"}),(0,s.jsx)("div",{className:"space-y-4",children:(0,s.jsxs)("div",{children:[(0,s.jsx)(rX.J,{htmlFor:"theme",children:"Theme"}),(0,s.jsxs)(t2.l6,{value:c?i:"dark",onValueChange:e=>{o(e),C("theme",e)},children:[(0,s.jsx)(t2.bq,{id:"theme",className:"mt-2",children:(0,s.jsx)(t2.yv,{})}),(0,s.jsxs)(t2.gC,{children:[(0,s.jsx)(t2.eb,{value:"light",children:"Light"}),(0,s.jsx)(t2.eb,{value:"dark",children:"Dark"}),(0,s.jsx)(t2.eb,{value:"system",children:"System"})]})]})]})})]})]}),(0,s.jsxs)(nM,{open:j.costTracking,onOpenChange:()=>D("costTracking"),children:[(0,s.jsxs)(nP,{className:"flex items-center justify-between w-full p-3 rounded-lg hover:bg-muted/50 transition-colors",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(S,{className:"h-4 w-4"}),(0,s.jsx)("h4",{className:"font-medium text-sm",children:"Cost Tracking"})]}),(0,s.jsx)(nc.A,{className:`h-4 w-4 transition-transform duration-200 ${j.costTracking?"rotate-180":""}`})]}),(0,s.jsx)(nT,{className:"px-3 pt-2 pb-3",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(rX.J,{htmlFor:"show-costs",children:"Display Costs"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Show cost information in messages"})]}),(0,s.jsx)(no,{id:"show-costs",checked:!1!==n.showCosts,onCheckedChange:e=>{let t={...n,showCosts:e};r3.s.setCostSettings(t),a(t)}})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(rX.J,{htmlFor:"daily-limit",children:"Daily Cost Limit (USD)"}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,s.jsx)(f.p,{id:"daily-limit",type:"number",min:"0",step:"0.01",placeholder:"No limit",value:n.dailyLimit||"",onChange:e=>{let t=e.target.value?parseFloat(e.target.value):void 0,r={...n,dailyLimit:t};r3.s.setCostSettings(r),a(r)}}),n.dailyLimit&&(0,s.jsxs)("span",{className:"text-sm text-muted-foreground",children:["$",n.dailyLimit.toFixed(2),"/day"]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(rX.J,{htmlFor:"project-limit",children:"Project Cost Limit (USD)"}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,s.jsx)(f.p,{id:"project-limit",type:"number",min:"0",step:"0.01",placeholder:"No limit",value:n.projectLimit||"",onChange:e=>{let t=e.target.value?parseFloat(e.target.value):void 0,r={...n,projectLimit:t};r3.s.setCostSettings(r),a(r)}}),n.projectLimit&&(0,s.jsxs)("span",{className:"text-sm text-muted-foreground",children:["$",n.projectLimit.toFixed(2),"/project"]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(rX.J,{htmlFor:"warning-threshold",children:"Warning Threshold (%)"}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,s.jsx)(f.p,{id:"warning-threshold",type:"number",min:"50",max:"100",step:"5",value:n.warningThreshold||80,onChange:e=>{let t=parseInt(e.target.value),r={...n,warningThreshold:t};r3.s.setCostSettings(r),a(r)}}),(0,s.jsxs)("span",{className:"text-sm text-muted-foreground flex items-center gap-1",children:[(0,s.jsx)(nu,{className:"h-3 w-3"}),"Warn at ",n.warningThreshold||80,"%"]})]})]}),(0,s.jsx)("div",{className:"border-t pt-3 mt-3",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:"Lifetime Total"}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:np.U.formatCost(r3.s.getLifetimeCosts().total)})]}),(0,s.jsx)(m.$,{variant:"outline",size:"sm",onClick:()=>{confirm("Reset lifetime cost tracking? This cannot be undone.")&&(r3.s.resetLifetimeCosts(),tV.oR.success("Lifetime costs reset"))},children:"Reset Stats"})]})})]})})]}),(0,s.jsxs)(nM,{open:j.dataManagement,onOpenChange:()=>D("dataManagement"),children:[(0,s.jsxs)(nP,{className:"flex items-center justify-between w-full p-3 rounded-lg hover:bg-muted/50 transition-colors",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(nd,{className:"h-4 w-4"}),(0,s.jsx)("h4",{className:"font-medium text-sm",children:"Data Management"})]}),(0,s.jsx)(nc.A,{className:`h-4 w-4 transition-transform duration-200 ${j.dataManagement?"rotate-180":""}`})]}),(0,s.jsxs)(nT,{className:"px-3 pt-2 pb-3",children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground mb-4",children:"Backup and restore your projects, conversations, and settings. Use this to migrate your data to OSWStudio or create backups."}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:"Export All Data"}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:"Download a backup file containing all your projects and data"})]}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:E,disabled:h,className:"flex items-center gap-2",children:[(0,s.jsx)(T,{className:"h-4 w-4"}),h?"Exporting...":"Export"]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium",children:"Import Data"}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:"Restore from a .osws backup file"})]}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>{let e=document.createElement("input");e.type="file",e.accept=".osws",e.onchange=async e=>{let t=e.target.files?.[0];if(t)try{x(!0),b(0),k("Validating file...");let e=await nf.validateBackupFile(t);if(!e.valid)return void tV.oR.error(`Invalid backup file: ${e.reason}`);let r=confirm(`Import ${e.metadata?.projectCount||0} projects? -Choose OK to REPLACE all current data, or Cancel to MERGE with existing data.`);await nf.importAllData(t,{mode:r?"replace":"merge",onProgress:(e,t)=>{b(e),k(t)}}),tV.oR.success("Data imported successfully!"),setTimeout(()=>window.location.reload(),1e3)}catch(e){tV.oR.error(e instanceof Error?e.message:"Import failed")}finally{x(!1),b(0),k("")}},e.click()},disabled:v,className:"flex items-center gap-2",children:[(0,s.jsx)(r$,{className:"h-4 w-4"}),v?"Importing...":"Import"]})]}),v&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex justify-between text-xs",children:[(0,s.jsx)("span",{children:w}),(0,s.jsxs)("span",{children:[y,"%"]})]}),(0,s.jsx)("div",{className:"w-full bg-muted rounded-full h-2",children:(0,s.jsx)("div",{className:"bg-primary h-2 rounded-full transition-all duration-300",style:{width:`${y}%`}})})]})]})]})]})]}),(0,s.jsxs)("div",{className:"flex justify-between pt-4 px-3 border-t mt-4",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(m.$,{variant:"destructive",onClick:()=>{confirm("Are you sure you want to clear all settings?")&&(r3.s.clearSettings(),r({}),tV.oR.success("Settings cleared"))},children:"Clear All Settings"}),(0,s.jsxs)(m.$,{variant:"outline",onClick:()=>p(!0),children:[(0,s.jsx)(rH,{className:"mr-2 h-4 w-4"}),"About DeepStudio"]})]}),e&&(0,s.jsx)(m.$,{onClick:e,children:"Close"})]}),(0,s.jsx)(rB,{open:d,onOpenChange:p})]})}let nA=[{id:"welcome",title:"Welcome to DeepStudio",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"Let's take a guided tour of the workspace so you can see how projects, agents, and saves all fit together."}),(0,s.jsx)("p",{children:"The tour takes under two minutes and you can skip at any time."})]}),location:"project-manager",primaryLabel:"Start tour",secondaryLabel:"Skip"},{id:"projects-overview",title:"Projects at a Glance",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"This is your project gallery. Recent work appears here with quick actions for opening, duplicating, or exporting."}),(0,s.jsx)("p",{children:"I've loaded a demo project so you can explore without setting anything up."})]}),location:"project-manager",target:'[data-tour-id="projects-list"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"create-project",title:"Creating a Project",body:(0,s.jsx)("div",{className:"space-y-2 text-sm text-muted-foreground",children:(0,s.jsx)("p",{children:"Use the New Project button to start fresh. The dialog lets you name the project and add an optional description."})}),location:"project-manager",target:'[data-tour-id="new-project-button"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"project-controls",title:"Exporting a Project",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"Click the dropdown menu on any project card to access export options. You can export as a ZIP for deployment or JSON for backup."}),(0,s.jsx)("p",{children:"Projects can also be duplicated or deleted from this menu."})]}),location:"project-manager",target:'[data-tour-id="project-export-json"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"edit-project",title:"Editing a Project",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"To get to the workspace and start editing, simply click on the project card. This will open the full development environment."}),(0,s.jsx)("p",{children:"Click Next to enter the workspace and continue the tour."})]}),location:"project-manager",target:'[data-tour-id="project-card"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"workspace-overview",title:"Workspace Layout",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"The workspace has four main areas: the assistant conversation, the virtual file explorer, your editor tabs, and the live preview."}),(0,s.jsx)("p",{children:"The VFS works like a project file tree—add HTML, CSS, JS, or assets and the agent can edit them just like local files."})]}),location:"workspace",target:'[data-tour-id="workspace-panels"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"workspace-edit",title:"See the Agent in Action",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:'I\'ll request the agent to change the color of "Our Services" button to a green accent and the agent performs the task.'}),(0,s.jsx)("p",{children:"This mimics what you will see when asking the agent to perform tasks."})]}),location:"workspace",target:'[data-tour-id="assistant-panel"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"workspace-focus",title:"Element Focus Tool",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"The crosshair tool in the preview panel lets you select and focus on specific elements in your design."}),(0,s.jsx)("p",{children:"Click it to activate element selection mode, then click any element in the preview to highlight it."})]}),location:"workspace",target:'[data-tour-id="focus-crosshair-button"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"workspace-checkpoint",title:"Checkpoints & Manual Saves",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:'The "Discard Changes" button restores to the original saved point, letting you revert any changes back to your last manual save.'}),(0,s.jsx)("p",{children:"If you like the result, use the Save button to lock it in as your manual checkpoint."})]}),location:"workspace",target:'[data-tour-id="discard-changes-button"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"clear-conversation",title:"Clear Conversation",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"The agent will have the last tasks and responses in memory. You can clear it with the trashcan button to start fresh."}),(0,s.jsx)("p",{children:"This removes the conversation history but keeps your project files intact."})]}),location:"workspace",target:'[data-tour-id="clear-chat-button"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"provider-settings",title:"Connect Your Provider",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsxs)("p",{children:["Set your API key under Settings → Provider. I recommend trying OpenRouter with the ",(0,s.jsx)("code",{children:"gpt-oss-120b"})," model, but you can use any supported provider."]}),(0,s.jsx)("p",{children:"You can return here anytime from the header menu."}),(0,s.jsx)("p",{className:"text-xs text-orange-500/90",children:"Privacy note: Remote LLM providers (OpenAI, Anthropic, etc.) will receive your code when generating. For complete privacy, use local models with Ollama or LM Studio."})]}),location:"workspace",target:'[data-tour-id="provider-settings-trigger"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"wrap-up",title:"You're Ready!",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"That's the basics—prompt the agent, preview updates, and save when you're happy. You can replay this tour from the Help menu anytime."}),(0,s.jsx)("p",{children:"Have fun building! Let me know what you ship."})]}),location:"workspace",showBack:!0,primaryLabel:"Finish",secondaryLabel:"Skip"}];var nR=r(25495),nL=r(94742);let nz=(0,l.createContext)(null);function nO({children:e}){let[t,r]=(0,l.useState)("idle"),[n,a]=(0,l.useState)(0),[o,i]=(0,l.useState)(0),[c,u]=(0,l.useState)([]),[d,p]=(0,l.useState)(!1),[h,m]=(0,l.useState)([]),[f,g]=(0,l.useState)(null),[v,x]=(0,l.useState)({projectId:null,preCheckpointId:null,postCheckpointId:null,originalCss:null,updatedCss:null}),y=(0,l.useRef)(v),b=(0,l.useRef)(null),w=(0,l.useRef)(null),k=(0,l.useRef)(null),j=(0,l.useRef)(null),N=(0,l.useRef)(null),C=(0,l.useRef)(null),S=(0,l.useMemo)(()=>(function(e){if(!(e<0)&&!(e>=nA.length))return nA[e]})(n),[n]),E=(0,l.useCallback)(()=>{x({projectId:null,preCheckpointId:null,postCheckpointId:null,originalCss:null,updatedCss:null}),b.current=null,w.current=null,k.current=null,j.current=null},[]),D=(0,l.useCallback)(()=>{"running"!==t&&(r("running"),a(0),i(e=>e+1),u([]),E())},[E,t]),P=(0,l.useCallback)(e=>{C.current=e},[]),M=(0,l.useCallback)((e="finish")=>{let t=y.current;t.projectId&&t.preCheckpointId&&t.postCheckpointId&&r0.$.runWithSuppressedDirty(t.projectId,async()=>{await nL.Y.restoreCheckpoint(t.preCheckpointId)}).then(()=>{}).catch(e=>{console.error("[GuidedTour] Failed to restore baseline during cleanup",e)}),E(),u([]),a(0),i(e=>e+1),r("finish"===e?"completed":"idle"),r3.s.setHasSeenTour(!0),N.current?.abort(),C.current=null},[E]),I=(0,l.useCallback)(()=>{M("skip")},[M]),T=(0,l.useCallback)(()=>{a(e=>{let t=e+1;return t>=nA.length?(M(),e):(i(e=>e+1),t)})},[M]),A=(0,l.useCallback)(()=>{a(e=>{let t=Math.max(0,e-1);return t!==e&&i(e=>e+1),t})},[]),R=(0,l.useMemo)(()=>({state:{status:t,stepIndex:n,stepKey:o,currentStep:S,transcript:c,isBusy:d,projectList:h},start:D,skip:I,next:T,previous:A,setProjectList:e=>{m(e)},setActiveProjectId:g,setTranscript:u,setWorkspaceHandler:P}),[t,n,o,S,c,d,h,D,I,T,A,P]);return(0,s.jsx)(nz.Provider,{value:R,children:e})}function nF(){let e=(0,l.useContext)(nz);if(!e)throw Error("useGuidedTour must be used within a GuidedTourProvider");return e}var nq=r(41862);function nB({location:e}){let{state:t,next:r,previous:n,skip:a}=nF(),{status:o,currentStep:i,stepKey:c,isBusy:u,stepIndex:d}=t,[p,h]=(0,l.useState)(null),f=nA.length,g=(0,l.useMemo)(()=>!!i&&!!u&&("workspace-edit"===i.id||"workspace-focus"===i.id||"workspace-checkpoint"===i.id),[i,u]);if("running"!==o||!i||i.location!==e)return null;let v=i.primaryLabel??"Next",x=i.secondaryLabel??"Skip";return(0,s.jsxs)("div",{className:"fixed inset-0 z-[2000] pointer-events-auto",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-background/30"}),p&&(0,s.jsx)("div",{className:"pointer-events-none fixed rounded-xl border-2 border-primary ring-4 ring-primary/30 transition-all animate-ring-opacity",style:{top:p.top,left:p.left,width:p.width,height:p.height}}),(0,s.jsx)("div",{className:"absolute bottom-10 left-1/2 flex w-full max-w-xl -translate-x-1/2 flex-col gap-4 px-4",children:(0,s.jsxs)("div",{className:"pointer-events-auto rounded-2xl border bg-background/95 p-6 shadow-2xl",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-foreground",children:i.title}),(0,s.jsxs)("span",{className:"text-sm text-muted-foreground font-medium",children:[d+1,"/",f]})]}),(0,s.jsx)("div",{className:"mt-2 text-sm leading-relaxed text-muted-foreground",children:i.body})]}),u&&(0,s.jsx)(nq.A,{className:"h-5 w-5 animate-spin text-primary"})]}),(0,s.jsxs)("div",{className:"mt-6 flex items-center justify-between",children:[i.showBack?(0,s.jsx)(m.$,{variant:"ghost",onClick:n,disabled:u,children:"Back"}):(0,s.jsx)("div",{}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(m.$,{variant:"ghost",onClick:a,children:x}),(0,s.jsx)(m.$,{onClick:r,disabled:g,children:v})]})]})]})})]})}function n_({onProjectSelect:e}){let t=(0,d.useRouter)(),[r,n]=(0,l.useState)([]),[a,o]=(0,l.useState)(!0),[i,c]=(0,l.useState)(""),[u,v]=(0,l.useState)(!1),[x,y]=(0,l.useState)(""),[b,w]=(0,l.useState)(""),[k,j]=(0,l.useState)("blank"),[C,S]=(0,l.useState)("updated"),[E,D]=(0,l.useState)("grid"),[P,M]=(0,l.useState)(null),[I,T]=(0,l.useState)(!1),{state:A,setProjectList:R,start:L}=nF(),z=A.currentStep?.id,O="running"===A.status,[F,q]=(0,l.useState)(!1),[B,_]=(0,l.useState)(null),$=(0,l.useRef)(!1),U=(0,l.useRef)(!1);(0,l.useCallback)(async()=>{if(!$.current){$.current=!0,o(!0);try{await p.OP.init();let e=(await p.OP.listProjects()).sort((e,t)=>t.updatedAt.getTime()-e.updatedAt.getTime());n(e),R(e)}catch(e){h.v.error("Failed to load projects:",e),tV.oR.error("Failed to load projects")}finally{o(!1),q(!0),$.current=!1}}},[R]);let H=(0,l.useCallback)(async()=>{try{await p.OP.init();let e=(await p.OP.listProjects()).sort((e,t)=>t.updatedAt.getTime()-e.updatedAt.getTime());n(e),R(e)}catch(e){h.v.error("Failed to reload projects:",e),tV.oR.error("Failed to reload projects")}},[R]),V=async()=>{if(!U.current){U.current=!0;try{let t=await p.OP.createProject("Multi-File Demo","Interactive examples showing how HTML, CSS, and JavaScript files work together");return await r1(p.OP,t.id,rZ,rZ.assets),tV.oR.success("Demo project created successfully"),await H(),e(t),t}catch(e){throw h.v.error("Failed to create demo project:",e),tV.oR.error("Failed to create demo project"),U.current=!1,e}}},W=async()=>{try{0===r.length&&await V(),L()}catch(e){h.v.error("Failed to prepare for tour:",e),tV.oR.error("Failed to start tour - could not create demo project")}},G=async()=>{if(!x.trim())return void tV.oR.error("Please enter a project name");if(x.length>50)return void tV.oR.error("Project name must be 50 characters or less");if(b.length>200)return void tV.oR.error("Description must be 200 characters or less");try{let t=await p.OP.createProject(x.trim().slice(0,50),b.trim().slice(0,200)||void 0);"demo"===k?await r1(p.OP,t.id,rZ,rZ.assets):await r1(p.OP,t.id,rQ),tV.oR.success("Project created successfully"),v(!1),y(""),w(""),j("blank"),await H(),e(t)}catch(e){h.v.error("Failed to create project:",e),tV.oR.error("Failed to create project")}},K=async e=>{if(confirm(`Are you sure you want to delete "${e.name}"? This cannot be undone.`))try{await p.OP.deleteProject(e.id),tV.oR.success("Project deleted"),await H()}catch(e){h.v.error("Failed to delete project:",e),tV.oR.error("Failed to delete project")}},Y=async t=>{try{let r=await p.OP.duplicateProject(t.id);tV.oR.success("Project duplicated successfully"),await H(),e(r)}catch(e){h.v.error("Failed to duplicate project:",e),tV.oR.error("Failed to duplicate project")}},J=async e=>{try{let t=await p.OP.exportProject(e.id),r=JSON.stringify(t,null,2),n=new Blob([r],{type:"application/json"}),a=URL.createObjectURL(n),o=document.createElement("a");o.href=a,o.download=`${e.name.replace(/\s+/g,"-")}-export.json`,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a),tV.oR.success("Project exported")}catch(e){h.v.error("Failed to export project:",e),tV.oR.error("Failed to export project")}},X=async e=>{try{let t=await p.OP.exportProjectAsZip(e.id),r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download=`${e.name.replace(/\s+/g,"-")}.zip`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r),tV.oR.success("Project exported as ZIP")}catch(e){h.v.error("Failed to export project as ZIP:",e),tV.oR.error("Failed to export project as ZIP")}},Z=async()=>{let t=document.createElement("input");t.type="file",t.accept=".json",t.onchange=async t=>{let r=t.target.files?.[0];if(r)try{let t=await r.text(),n=JSON.parse(t);if(!n.project||!n.files)throw Error("Invalid project file");let a=await p.OP.importProject(n);tV.oR.success("Project imported successfully"),await H(),e(a)}catch(e){h.v.error("Failed to import project:",e),tV.oR.error("Failed to import project")}},t.click()},Q=((e,t)=>{let r=[...e];switch(t){case"updated":return r.sort((e,t)=>t.updatedAt.getTime()-e.updatedAt.getTime());case"created":return r.sort((e,t)=>t.createdAt.getTime()-e.createdAt.getTime());case"name":return r.sort((e,t)=>e.name.localeCompare(t.name));case"size":return r.sort((e,t)=>t.updatedAt.getTime()-e.updatedAt.getTime());default:return r}})(r.filter(e=>e.name.toLowerCase().includes(i.toLowerCase())||e.description?.toLowerCase().includes(i.toLowerCase())),C);if(a&&!F)return(0,s.jsx)("div",{className:"flex items-center justify-center h-screen",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto"}),(0,s.jsx)("p",{className:"mt-4",children:"Loading projects..."})]})});let ee=[{id:"new-project",label:"New Project",icon:r_,onClick:()=>v(!0),content:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>v(!0),"data-tour-id":"new-project-button",className:"justify-start",children:[(0,s.jsx)(r_,{className:"mr-2 h-4 w-4"}),"New Project"]})},{id:"import",label:"Import",icon:r$,onClick:Z,variant:"outline"}],et=(0,s.jsxs)(r2.AM,{children:[(0,s.jsx)(r2.Wv,{asChild:!0,children:(0,s.jsx)(m.$,{variant:"outline",size:"icon",className:"h-8 w-8",children:(0,s.jsx)(rU,{className:"h-4 w-4"})})}),(0,s.jsx)(r2.hl,{className:"w-96",align:"end",children:(0,s.jsx)(nT,{})})]}),er=(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)(r2.AM,{children:[(0,s.jsx)(r2.Wv,{asChild:!0,children:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",className:"w-full justify-start",children:[(0,s.jsx)(rU,{className:"mr-2 h-4 w-4"}),"Settings"]})}),(0,s.jsx)(r2.hl,{className:"w-[calc(100vw-2rem)]",align:"start",children:(0,s.jsx)(nT,{})})]}),(0,s.jsx)("div",{className:"border-t my-2"}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:W,disabled:O,className:"w-full justify-start","data-tour-id":"footer-guided-tour",children:[(0,s.jsx)(rH,{className:"mr-2 h-4 w-4"}),"Guided Tour"]}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>t.push("/test-generation"),className:"w-full justify-start",children:[(0,s.jsx)(rV,{className:"mr-2 h-4 w-4"}),"Model Tester"]}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>T(!0),className:"w-full justify-start",children:[(0,s.jsx)(rH,{className:"mr-2 h-4 w-4"}),"About DeepStudio"]}),(0,s.jsx)(m.$,{variant:"outline",size:"sm",asChild:!0,className:"w-full justify-start",children:(0,s.jsxs)("a",{href:"https://github.com/o-stahl/deepstudio",target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)(rF,{className:"mr-2 h-4 w-4"}),"GitHub"]})})]});return(0,s.jsxs)("div",{className:"flex flex-col h-[100dvh]",style:{background:"linear-gradient(var(--project-background-tint), var(--project-background-tint)), var(--background)"},children:[(0,s.jsx)(rJ.j,{onLogoClick:()=>T(!0),actions:ee,mobileMenuContent:er,desktopOnlyContent:et,leftText:"DeepStudio"}),(0,s.jsx)("main",{className:"flex-1 min-h-0 overflow-auto",children:(0,s.jsxs)("div",{className:"container mx-auto p-6 max-w-6xl",children:[(0,s.jsx)("div",{className:"mb-6 space-y-4",children:(0,s.jsxs)("div",{className:"flex flex-col md:flex-row gap-4","data-tour-id":"projects-actions",children:[(0,s.jsxs)("div",{className:"relative flex-1",children:[(0,s.jsx)(rW.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),(0,s.jsx)(f.p,{placeholder:"Search projects...",value:i,onChange:e=>c(e.target.value),className:"pl-10 bg-card"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)(t2.l6,{value:C,onValueChange:e=>S(e),children:[(0,s.jsxs)(t2.bq,{className:"flex-1 md:w-[180px] bg-card",children:[(0,s.jsx)(rG,{className:"h-4 w-4 mr-2"}),(0,s.jsx)(t2.yv,{placeholder:"Sort by..."})]}),(0,s.jsxs)(t2.gC,{children:[(0,s.jsx)(t2.eb,{value:"updated",children:"Last Updated"}),(0,s.jsx)(t2.eb,{value:"created",children:"Date Created"}),(0,s.jsx)(t2.eb,{value:"name",children:"Name"})]})]}),(0,s.jsxs)("div",{className:"flex gap-0.5 border rounded-sm p-1 bg-card h-9",children:[(0,s.jsx)(m.$,{size:"icon",variant:"grid"===E?"default":"ghost",className:"h-full w-8 rounded-sm",onClick:()=>D("grid"),children:(0,s.jsx)(rK,{className:"h-4 w-4"})}),(0,s.jsx)(m.$,{size:"icon",variant:"list"===E?"default":"ghost",className:"h-full w-8 rounded-sm",onClick:()=>D("list"),children:(0,s.jsx)(rY,{className:"h-4 w-4"})})]})]})]})}),0===Q.length?(0,s.jsxs)("div",{className:"text-center py-12",children:[(0,s.jsx)(N,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,s.jsx)("h2",{className:"text-xl font-semibold mb-2",children:i?"No projects found":"No projects yet"}),(0,s.jsx)("p",{className:"text-muted-foreground mb-6",children:i?"Try a different search term":"Create your first project to get started"}),!i&&(0,s.jsxs)("div",{className:"flex gap-3 justify-center",children:[(0,s.jsxs)(m.$,{onClick:()=>v(!0),children:[(0,s.jsx)(r_,{className:"mr-2 h-4 w-4"}),"Create Project"]}),(0,s.jsxs)(m.$,{variant:"outline",onClick:V,children:[(0,s.jsx)(N,{className:"mr-2 h-4 w-4"}),"Create Demo Project"]})]})]}):(0,s.jsx)("div",{className:"grid"===E?"grid gap-4 md:grid-cols-2 lg:grid-cols-3":"space-y-3","data-tour-id":"projects-list",children:Q.map(t=>"object"==typeof t&&t.id&&t.name?(0,s.jsx)(tW,{project:t,onSelect:e,onDelete:K,onExport:J,onExportZip:X,onDuplicate:Y,onPreview:M,onUpdate:e=>{n(r.map(t=>t.id===e.id?e:t))},viewMode:E,forceMenuOpen:B===t.id,highlightExport:O&&"project-controls"===z&&B===t.id},t.id):(h.v.error("Invalid project object:",t),null))})]})}),(0,s.jsx)("footer",{className:"hidden md:block border-t bg-card/50 py-3 px-6",children:(0,s.jsxs)("div",{className:"flex justify-center gap-2",children:[(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:W,disabled:O,"data-tour-id":"footer-guided-tour",children:[(0,s.jsx)(rH,{className:"mr-2 h-4 w-4"}),"Guided Tour"]}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>t.push("/test-generation"),children:[(0,s.jsx)(rV,{className:"mr-2 h-4 w-4"}),"Model Tester"]}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>T(!0),children:[(0,s.jsx)(rH,{className:"mr-2 h-4 w-4"}),"About DeepStudio"]}),(0,s.jsx)(m.$,{variant:"outline",size:"sm",asChild:!0,children:(0,s.jsxs)("a",{href:"https://github.com/o-stahl/deepstudio",target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)(rF,{className:"mr-2 h-4 w-4"}),"GitHub"]})})]})}),(0,s.jsx)(rD,{open:u,onOpenChange:v,children:(0,s.jsxs)(rI,{children:[(0,s.jsxs)(rT,{children:[(0,s.jsx)(rR,{children:"Create New Project"}),(0,s.jsx)(rL,{children:"Start a new multipage website project"})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(rX.J,{htmlFor:"name",children:"Project Name"}),(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:[x.length,"/50"]})]}),(0,s.jsx)(f.p,{id:"name",value:x,onChange:e=>y(e.target.value.slice(0,50)),placeholder:"My Awesome Website",className:"mt-2",maxLength:50})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(rX.J,{htmlFor:"template",children:"Template"}),(0,s.jsxs)(t2.l6,{value:k,onValueChange:e=>j(e),children:[(0,s.jsx)(t2.bq,{id:"template",className:"mt-2",children:(0,s.jsx)(t2.yv,{placeholder:"Select a template"})}),(0,s.jsxs)(t2.gC,{children:[(0,s.jsx)(t2.eb,{value:"blank",children:"Blank (HTML/CSS/JS starter)"}),(0,s.jsx)(t2.eb,{value:"demo",children:"Demo (multi-page example)"})]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(rX.J,{htmlFor:"description",children:"Description (optional)"}),(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:[b.length,"/200"]})]}),(0,s.jsx)(g,{id:"description",value:b,onChange:e=>w(e.target.value.slice(0,200)),placeholder:"A brief description of your project",className:"mt-2 resize-none",rows:3,maxLength:200})]})]}),(0,s.jsxs)(rA,{children:[(0,s.jsx)(m.$,{variant:"outline",onClick:()=>v(!1),children:"Cancel"}),(0,s.jsx)(m.$,{onClick:G,children:"Create Project"})]})]})}),P&&(0,s.jsx)(rD,{open:!!P,onOpenChange:()=>M(null),children:(0,s.jsxs)(rI,{className:"max-w-[90vw] sm:max-w-[85vw] lg:max-w-[80vw] 2xl:max-w-[1400px] max-h-[90vh] w-full h-full p-0 flex flex-col",children:[(0,s.jsx)(rT,{className:"p-4 border-b",children:(0,s.jsxs)(rR,{children:["Preview: ",P.name]})}),(0,s.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,s.jsx)(t4,{projectId:P.id})})]})}),(0,s.jsx)(rB,{open:I,onOpenChange:T}),(0,s.jsx)(nB,{location:"project-manager"})]})}var n$=r(24923);let nU=(0,v.A)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]),nH=(0,v.A)("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]),nV=(0,v.A)("file",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]),nW=(0,v.A)("folder-tree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);var nG="ContextMenu",[nK,nY]=(0,J.A)(nG,[eF]),nJ=eF(),[nX,nZ]=nK(nG),nQ=e=>{let{__scopeContextMenu:t,children:r,onOpenChange:n,dir:a,modal:o=!0}=e,[i,c]=l.useState(!1),u=nJ(t),d=(0,el.c)(n),p=l.useCallback(e=>{c(e),d(e)},[d]);return(0,s.jsx)(nX,{scope:t,open:i,onOpenChange:p,modal:o,children:(0,s.jsx)(eV,{...u,dir:a,open:i,onOpenChange:p,modal:o,children:r})})};nQ.displayName=nG;var n0="ContextMenuTrigger",n1=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,disabled:n=!1,...a}=e,o=nZ(n0,r),i=nJ(r),c=l.useRef({x:0,y:0}),u=l.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),d=l.useRef(0),p=l.useCallback(()=>window.clearTimeout(d.current),[]),h=e=>{c.current={x:e.clientX,y:e.clientY},o.onOpenChange(!0)};return l.useEffect(()=>p,[p]),l.useEffect(()=>void(n&&p()),[n,p]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eW,{...i,virtualRef:u}),(0,s.jsx)(Z.sG.span,{"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,...a,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:n?e.onContextMenu:(0,K.mK)(e.onContextMenu,e=>{p(),h(e),e.preventDefault()}),onPointerDown:n?e.onPointerDown:(0,K.mK)(e.onPointerDown,aa(e=>{p(),d.current=window.setTimeout(()=>h(e),700)})),onPointerMove:n?e.onPointerMove:(0,K.mK)(e.onPointerMove,aa(p)),onPointerCancel:n?e.onPointerCancel:(0,K.mK)(e.onPointerCancel,aa(p)),onPointerUp:n?e.onPointerUp:(0,K.mK)(e.onPointerUp,aa(p))})]})});n1.displayName=n0;var n2=e=>{let{__scopeContextMenu:t,...r}=e,n=nJ(t);return(0,s.jsx)(eJ,{...n,...r})};n2.displayName="ContextMenuPortal";var n3="ContextMenuContent",n4=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nZ(n3,r),o=nJ(r),i=l.useRef(!1);return(0,s.jsx)(e0,{...o,...n,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&i.current&&t.preventDefault(),i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||a.modal||(i.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});n4.displayName=n3,l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nJ(r);return(0,s.jsx)(e5,{...a,...n,ref:t})}).displayName="ContextMenuGroup";var n5=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nJ(r);return(0,s.jsx)(e6,{...a,...n,ref:t})});n5.displayName="ContextMenuLabel";var n6=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nJ(r);return(0,s.jsx)(e7,{...a,...n,ref:t})});n6.displayName="ContextMenuItem";var n8=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nJ(r);return(0,s.jsx)(tt,{...a,...n,ref:t})});n8.displayName="ContextMenuCheckboxItem",l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nJ(r);return(0,s.jsx)(to,{...a,...n,ref:t})}).displayName="ContextMenuRadioGroup";var n9=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nJ(r);return(0,s.jsx)(ts,{...a,...n,ref:t})});n9.displayName="ContextMenuRadioItem";var n7=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nJ(r);return(0,s.jsx)(td,{...a,...n,ref:t})});n7.displayName="ContextMenuItemIndicator";var ae=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nJ(r);return(0,s.jsx)(tp,{...a,...n,ref:t})});ae.displayName="ContextMenuSeparator",l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nJ(r);return(0,s.jsx)(th,{...a,...n,ref:t})}).displayName="ContextMenuArrow";var at="ContextMenuSub",ar=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nJ(r);return(0,s.jsx)(ty,{...a,...n,ref:t})});ar.displayName="ContextMenuSubTrigger";var an=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nJ(r);return(0,s.jsx)(tw,{...a,...n,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});function aa(e){return t=>"mouse"!==t.pointerType?e(t):void 0}an.displayName="ContextMenuSubContent";let ao=(0,v.A)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);l.forwardRef(({className:e,inset:t,children:r,...n},a)=>(0,s.jsxs)(ar,{ref:a,className:(0,h.cn)("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...n,children:[r,(0,s.jsx)(tJ,{className:"ml-auto h-4 w-4"})]})).displayName=ar.displayName,l.forwardRef(({className:e,...t},r)=>(0,s.jsx)(an,{ref:r,className:(0,h.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})).displayName=an.displayName;let ai=l.forwardRef(({className:e,...t},r)=>(0,s.jsx)(n2,{children:(0,s.jsx)(n4,{ref:r,className:(0,h.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));ai.displayName=n4.displayName;let as=l.forwardRef(({className:e,inset:t,...r},n)=>(0,s.jsx)(n6,{ref:n,className:(0,h.cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));function al({projectId:e,onFileSelect:t,selectedPath:r,onClose:n}){let[a,o]=(0,l.useState)([]),[i,c]=(0,l.useState)([]),[u,d]=(0,l.useState)(new Set(["/"])),[g,v]=(0,l.useState)(null),[x,y]=(0,l.useState)(""),[w,j]=(0,l.useState)(!1),[C,S]=(0,l.useState)(null),[E,D]=(0,l.useState)(null),P=(0,l.useRef)(null),M=(0,l.useCallback)(async()=>{try{await p.OP.init();let t=await p.OP.getAllFilesAndDirectories(e),r=t.filter(e=>"directory"!==e.type);o(r),c(I(t))}catch(e){h.v.error("Failed to load files:",e)}},[e]),I=e=>{let t=[],r=new Map;e.forEach(e=>{if("directory"===e.type){let t=e.path.split("/").filter(Boolean),n={path:e.path,name:e.name||t[t.length-1]||"unnamed",type:"directory",children:[]};r.set(e.path,n)}}),e.forEach(e=>{if("directory"!==e.type){let t=e.path.split("/").filter(Boolean),n="";for(let e=0;e{let a=n.split("/").filter(Boolean);if(1===a.length)t.push(e);else{let t="/"+a.slice(0,-1).join("/"),n=r.get(t);n&&n.children&&n.children.push(e)}}),e.forEach(e=>{if("directory"!==e.type){let n=e.path.split("/").filter(Boolean),a={path:e.path,name:e.name,type:"file"};if(1===n.length)t.push(a);else{let e="/"+n.slice(0,-1).join("/"),t=r.get(e);t&&t.children?.push(a)}}});let n=e=>{e.sort((e,t)=>e.type===t.type?e.name.localeCompare(t.name):"directory"===e.type?-1:1),e.forEach(e=>{e.children&&n(e.children)})};return n(t),t},T=e=>{d(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},A=async e=>{if("directory"===e.type)T(e.path);else{let r=a.find(t=>t.path===e.path);r&&t&&t(r)}},R=async(t="/")=>{let r=prompt("Enter file name:");if(!r)return;let n="/"===t?`/${r}`:`${t}/${r}`;try{await p.OP.createFile(e,n,""),await M()}catch(e){h.v.error("Failed to create file:",e)}},L=async(t="/")=>{let r=prompt("Enter directory name:");if(!r)return;let n="/"===t?`/${r}`:`${t}/${r}`;try{await p.OP.createDirectory(e,n),await M()}catch(e){h.v.error("Failed to create directory:",e)}},z=async(t,r)=>{if(confirm(`Delete ${r} "${t}"?`))try{"file"===r?await p.OP.deleteFile(e,t):await p.OP.deleteDirectory(e,t),await M()}catch(e){h.v.error(`Failed to delete ${r}:`,e)}},O=async(t,r)=>{if(!x)return;let n=t.split("/");n[n.length-1]=x;let a=n.join("/");try{"directory"===r?await p.OP.renameDirectory(e,t,a):await p.OP.renameFile(e,t,a),await M(),v(null),y("")}catch(e){h.v.error(`Failed to rename ${r}:`,e)}},F=async e=>{for(let t of(e.preventDefault(),e.stopPropagation(),j(!1),Array.from(e.dataTransfer.items)))if("file"===t.kind){let e=t.getAsFile();e&&await q(e,"/")}},q=async(t,r)=>{if(!(0,n$.fu)(t.name))return void tV.oR.error(`File type not supported: ${t.name}`);let n=(0,n$.Gr)(t.name),a=n$.Q6[n];if(t.size>a)return void tV.oR.error(`File too large: ${t.name}. Maximum size is ${Math.round(a/1024/1024)}MB`);let o="/"===r?`/${t.name}`:`${r}/${t.name}`;try{let r;r="image"===n||"video"===n||"binary"===n?await t.arrayBuffer():await t.text(),await p.OP.createFile(e,o,r),await M(),tV.oR.success(`Uploaded ${t.name}`)}catch(n){if(n.message?.includes("already exists")){if(confirm(`File "${t.name}" already exists. Overwrite?`))try{await p.OP.deleteFile(e,o),await q(t,r)}catch(e){h.v.error("Failed to overwrite file:",e),tV.oR.error("Failed to overwrite file")}}else h.v.error("Failed to upload file:",n),tV.oR.error(`Failed to upload ${t.name}: ${n.message}`)}},B=(e,t)=>{e.stopPropagation(),S(t),e.dataTransfer.effectAllowed="move"},_=()=>{S(null),D(null)},$=(e,t)=>{e.preventDefault(),e.stopPropagation(),C&&t!==C.path&&(e.dataTransfer.dropEffect="move",D(t))},U=async(t,r)=>{if(t.preventDefault(),t.stopPropagation(),!C||r&&C.path===r.path)return void D(null);let n=r&&"directory"===r.type?r.path:"/";if("directory"===C.type){let e=C.path.endsWith("/")?C.path:C.path+"/";if((n.endsWith("/")?n:n+"/").startsWith(e)){tV.oR.error("Cannot move a folder into itself"),D(null);return}}let a=C.name,o="/"===n?`/${a}`:`${n}/${a}`;try{"directory"===C.type?await p.OP.moveDirectory(e,C.path,o):await p.OP.moveFile(e,C.path,o),await M(),tV.oR.success(`Moved ${C.name} to ${"/"===n?"root":n}`)}catch(e){h.v.error("Failed to move item:",e),tV.oR.error(`Failed to move: ${e.message}`)}D(null)},H=(e,t=0)=>{let n=u.has(e.path),a=r===e.path,o=g===e.path,i=E===e.path;return(0,s.jsxs)("div",{draggable:!o,onDragStart:t=>B(t,e),onDragEnd:_,onDragOver:t=>"directory"===e.type&&$(t,e.path),onDrop:t=>"directory"===e.type&&U(t,e),children:[(0,s.jsxs)(nQ,{children:[(0,s.jsx)(n1,{children:(0,s.jsxs)("div",{className:(0,h.cn)("flex items-center gap-2 px-2 py-1.5 hover:bg-accent hover:text-accent-foreground cursor-pointer rounded-md transition-colors",a&&"bg-accent text-accent-foreground",i&&"directory"===e.type&&"bg-blue-500/20 border border-blue-500",C?.path===e.path&&"opacity-50","group"),style:{paddingLeft:`${16*t+8}px`},onClick:()=>A(e),children:["directory"===e.type?(0,s.jsxs)(s.Fragment,{children:[n?(0,s.jsx)(nc.A,{className:"w-4 h-4 text-muted-foreground"}):(0,s.jsx)(tJ,{className:"w-4 h-4 text-muted-foreground"}),n?(0,s.jsx)(N,{className:"w-4 h-4 text-blue-500"}):(0,s.jsx)(nU,{className:"w-4 h-4 text-blue-500"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"w-4"}),(()=>{let t=(0,n$.Gr)(e.path);return"image"===t?(0,s.jsx)(b,{className:"w-4 h-4 text-green-500"}):"video"===t?(0,s.jsx)(nH,{className:"w-4 h-4 text-purple-500"}):(0,s.jsx)(nV,{className:"w-4 h-4 text-muted-foreground"})})()]}),o?(0,s.jsx)(f.p,{value:x,onChange:e=>y(e.target.value),onBlur:()=>O(e.path,e.type),onKeyDown:t=>{"Enter"===t.key?O(e.path,e.type):"Escape"===t.key&&(v(null),y(""))},className:"h-5 text-sm",autoFocus:!0,onClick:e=>e.stopPropagation()}):(0,s.jsx)("span",{className:"text-sm flex-1",children:e.name})]})}),(0,s.jsxs)(ai,{children:["directory"===e.type&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(as,{onClick:()=>R(e.path),children:[(0,s.jsx)(nV,{className:"mr-2 h-4 w-4"}),"New File"]}),(0,s.jsxs)(as,{onClick:()=>L(e.path),children:[(0,s.jsx)(nU,{className:"mr-2 h-4 w-4"}),"New Folder"]}),(0,s.jsxs)(as,{onClick:()=>P.current?.click(),children:[(0,s.jsx)(r$,{className:"mr-2 h-4 w-4"}),"Upload Files"]})]}),(0,s.jsx)(as,{onClick:()=>{v(e.path),y(e.name)},children:"Rename"}),(0,s.jsx)(as,{onClick:()=>z(e.path,e.type),className:"text-destructive",children:"Delete"})]})]}),"directory"===e.type&&n&&e.children&&(0,s.jsx)("div",{children:e.children.map(e=>H(e,t+1))})]},e.path)};return(0,s.jsxs)("div",{className:"h-full flex flex-col",onDrop:F,onDragOver:e=>{e.preventDefault(),e.stopPropagation(),j(!0)},onDragLeave:e=>{e.preventDefault(),e.stopPropagation();let t=e.currentTarget.getBoundingClientRect(),r=e.clientX,n=e.clientY;(r=t.right||n=t.bottom)&&j(!1)},children:[(0,s.jsx)("input",{ref:P,type:"file",multiple:!0,className:"hidden",onChange:async e=>{for(let t of Array.from(e.target.files||[]))await q(t,"/");P.current&&(P.current.value="")}}),(0,s.jsxs)("div",{className:"p-3 border-b bg-muted/70 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(nW,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-files-active)"}}),n?(0,s.jsxs)("button",{type:"button",onClick:n,"aria-label":"Hide file explorer",className:"relative hidden h-6 w-6 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-destructive md:flex group",children:[(0,s.jsx)(nW,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-files-active)"}}),(0,s.jsx)(k.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}):(0,s.jsx)(nW,{className:"hidden h-4 w-4 md:inline-flex",style:{color:"var(--button-files-active)"}}),(0,s.jsx)("h3",{className:"text-sm font-medium",children:"File Explorer"})]}),(0,s.jsxs)("div",{className:"flex gap-1",children:[(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>P.current?.click(),title:"Upload files",children:(0,s.jsx)(r$,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>R("/"),title:"New file",children:(0,s.jsx)(nV,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>L("/"),title:"New folder",children:(0,s.jsx)(nU,{className:"h-3 w-3"})})]})]}),(0,s.jsxs)(nQ,{children:[(0,s.jsx)(n1,{asChild:!0,children:(0,s.jsxs)("div",{className:(0,h.cn)("flex-1 overflow-y-auto p-3 space-y-0.5 relative",w&&"bg-blue-500/10"),onDragOver:e=>{C&&(e.preventDefault(),e.stopPropagation(),D("/"))},onDrop:e=>{C&&U(e,null)},children:[w&&(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:(0,s.jsxs)("div",{className:"bg-blue-500/20 border-2 border-dashed border-blue-500 rounded-lg p-8",children:[(0,s.jsx)(r$,{className:"h-12 w-12 text-blue-500 mx-auto mb-2"}),(0,s.jsx)("p",{className:"text-sm text-blue-600",children:"Drop files here to upload"})]})}),0===i.length?(0,s.jsx)("div",{className:"flex-1 flex items-center justify-center py-8",children:(0,s.jsxs)("div",{className:"text-center space-y-3",children:[(0,s.jsx)(nU,{className:"h-12 w-12 mx-auto opacity-50 text-muted-foreground"}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("p",{className:"text-base font-medium text-foreground",children:"No files yet"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Create your first file to get started"})]})]})}):(0,s.jsx)("div",{className:"contents",children:i.map(e=>H(e))})]})}),(0,s.jsxs)(ai,{children:[(0,s.jsxs)(as,{onClick:()=>R("/"),children:[(0,s.jsx)(nV,{className:"mr-2 h-4 w-4"}),"New File"]}),(0,s.jsxs)(as,{onClick:()=>L("/"),children:[(0,s.jsx)(nU,{className:"mr-2 h-4 w-4"}),"New Folder"]}),(0,s.jsxs)(as,{onClick:()=>P.current?.click(),children:[(0,s.jsx)(r$,{className:"mr-2 h-4 w-4"}),"Upload Files"]})]})]})]})}function ac(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}as.displayName=n6.displayName,l.forwardRef(({className:e,children:t,checked:r,...n},a)=>(0,s.jsxs)(n8,{ref:a,className:(0,h.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(n7,{children:(0,s.jsx)(w.A,{className:"h-4 w-4"})})}),t]})).displayName=n8.displayName,l.forwardRef(({className:e,children:t,...r},n)=>(0,s.jsxs)(n9,{ref:n,className:(0,h.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(n7,{children:(0,s.jsx)(ao,{className:"h-2 w-2 fill-current"})})}),t]})).displayName=n9.displayName,l.forwardRef(({className:e,inset:t,...r},n)=>(0,s.jsx)(n5,{ref:n,className:(0,h.cn)("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...r})).displayName=n5.displayName,l.forwardRef(({className:e,...t},r)=>(0,s.jsx)(ae,{ref:r,className:(0,h.cn)("-mx-1 my-1 h-px bg-border",e),...t})).displayName=ae.displayName;function au(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=e.length?e.apply(this,a):function(){for(var e=arguments.length,n=Array(e),o=0;o=e.length?e.apply(this,a):function(){for(var e=arguments.length,n=Array(e),o=0;o1&&void 0!==arguments[1]?arguments[1]:{};av.initial(e),av.handler(t);var r={current:e},n=ah(ab)(r,t),a=ah(ay)(r),o=ah(av.changes)(e),i=ah(ax)(r);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return av.selector(e),e(r.current)},function(e){(function(){for(var e=arguments.length,t=Array(e),r=0;r{n.current=!1}:e,t)};function a_(){}function a$(e,t,r,n){var a,o,i,s,l,c;return a=e,o=n,a.editor.getModel(aU(a,o))||(i=e,s=t,l=r,c=n,i.editor.createModel(s,l,c?aU(i,c):void 0))}function aU(e,t){return e.Uri.parse(t)}(0,l.memo)(function({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:a,originalModelPath:o,modifiedModelPath:i,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:c=!1,theme:u="light",loading:d="Loading...",options:p={},height:h="100%",width:m="100%",className:f,wrapperProps:g={},beforeMount:v=a_,onMount:x=a_}){let[y,b]=(0,l.useState)(!1),[w,k]=(0,l.useState)(!0),j=(0,l.useRef)(null),N=(0,l.useRef)(null),C=(0,l.useRef)(null),S=(0,l.useRef)(x),E=(0,l.useRef)(v),D=(0,l.useRef)(!1);aq(()=>{let e=aR.init();return e.then(e=>(N.current=e)&&k(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>{let t;return j.current?(t=j.current?.getModel(),void(s||t?.original?.dispose(),c||t?.modified?.dispose(),j.current?.dispose())):e.cancel()}}),aB(()=>{if(j.current&&N.current){let t=j.current.getOriginalEditor(),a=a$(N.current,e||"",n||r||"text",o||"");a!==t.getModel()&&t.setModel(a)}},[o],y),aB(()=>{if(j.current&&N.current){let e=j.current.getModifiedEditor(),n=a$(N.current,t||"",a||r||"text",i||"");n!==e.getModel()&&e.setModel(n)}},[i],y),aB(()=>{let e=j.current.getModifiedEditor();e.getOption(N.current.editor.EditorOption.readOnly)?e.setValue(t||""):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[t],y),aB(()=>{j.current?.getModel()?.original.setValue(e||"")},[e],y),aB(()=>{let{original:e,modified:t}=j.current.getModel();N.current.editor.setModelLanguage(e,n||r||"text"),N.current.editor.setModelLanguage(t,a||r||"text")},[r,n,a],y),aB(()=>{N.current?.editor.setTheme(u)},[u],y),aB(()=>{j.current?.updateOptions(p)},[p],y);let P=(0,l.useCallback)(()=>{if(!N.current)return;E.current(N.current);let s=a$(N.current,e||"",n||r||"text",o||""),l=a$(N.current,t||"",a||r||"text",i||"");j.current?.setModel({original:s,modified:l})},[r,t,a,e,n,o,i]),M=(0,l.useCallback)(()=>{!D.current&&C.current&&(j.current=N.current.editor.createDiffEditor(C.current,{automaticLayout:!0,...p}),P(),N.current?.editor.setTheme(u),b(!0),D.current=!0)},[p,u,P]);return(0,l.useEffect)(()=>{y&&S.current(j.current,N.current)},[y]),(0,l.useEffect)(()=>{w||y||M()},[w,y,M]),l.createElement(aF,{width:m,height:h,isEditorReady:y,loading:d,_ref:C,className:f,wrapperProps:g})});var aH=function(e){let t=(0,l.useRef)();return(0,l.useEffect)(()=>{t.current=e},[e]),t.current},aV=new Map,aW=(0,l.memo)(function({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:a,path:o,theme:i="light",line:s,loading:c="Loading...",options:u={},overrideServices:d={},saveViewState:p=!0,keepCurrentModel:h=!1,width:m="100%",height:f="100%",className:g,wrapperProps:v={},beforeMount:x=a_,onMount:y=a_,onChange:b,onValidate:w=a_}){let[k,j]=(0,l.useState)(!1),[N,C]=(0,l.useState)(!0),S=(0,l.useRef)(null),E=(0,l.useRef)(null),D=(0,l.useRef)(null),P=(0,l.useRef)(y),M=(0,l.useRef)(x),I=(0,l.useRef)(),T=(0,l.useRef)(n),A=aH(o),R=(0,l.useRef)(!1),L=(0,l.useRef)(!1);aq(()=>{let e=aR.init();return e.then(e=>(S.current=e)&&C(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>E.current?void(I.current?.dispose(),h?p&&aV.set(o,E.current.saveViewState()):E.current.getModel()?.dispose(),E.current.dispose()):e.cancel()}),aB(()=>{let i=a$(S.current,e||n||"",t||a||"",o||r||"");i!==E.current?.getModel()&&(p&&aV.set(A,E.current?.saveViewState()),E.current?.setModel(i),p&&E.current?.restoreViewState(aV.get(o)))},[o],k),aB(()=>{E.current?.updateOptions(u)},[u],k),aB(()=>{E.current&&void 0!==n&&(E.current.getOption(S.current.editor.EditorOption.readOnly)?E.current.setValue(n):n!==E.current.getValue()&&(L.current=!0,E.current.executeEdits("",[{range:E.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),E.current.pushUndoStop(),L.current=!1))},[n],k),aB(()=>{let e=E.current?.getModel();e&&a&&S.current?.editor.setModelLanguage(e,a)},[a],k),aB(()=>{void 0!==s&&E.current?.revealLine(s)},[s],k),aB(()=>{S.current?.editor.setTheme(i)},[i],k);let z=(0,l.useCallback)(()=>{if(!(!D.current||!S.current)&&!R.current){M.current(S.current);let l=o||r,c=a$(S.current,n||e||"",t||a||"",l||"");E.current=S.current?.editor.create(D.current,{model:c,automaticLayout:!0,...u},d),p&&E.current.restoreViewState(aV.get(l)),S.current.editor.setTheme(i),void 0!==s&&E.current.revealLine(s),j(!0),R.current=!0}},[e,t,r,n,a,o,u,d,p,i,s]);return(0,l.useEffect)(()=>{k&&P.current(E.current,S.current)},[k]),(0,l.useEffect)(()=>{N||k||z()},[N,k,z]),T.current=n,(0,l.useEffect)(()=>{k&&b&&(I.current?.dispose(),I.current=E.current?.onDidChangeModelContent(e=>{L.current||b(E.current.getValue(),e)}))},[k,b]),(0,l.useEffect)(()=>{if(k){let e=S.current.editor.onDidChangeMarkers(e=>{let t=E.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=S.current.editor.getModelMarkers({resource:t});w?.(e)}});return()=>{e?.dispose()}}return()=>{}},[k,w]),l.createElement(aF,{width:m,height:f,isEditorReady:k,loading:c,_ref:D,className:g,wrapperProps:v})});let aG=(0,v.A)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]),aK=(0,v.A)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var aY=r(93613);function aJ({projectId:e,onFilesChange:t,onClose:r}){let[n,a]=(0,l.useState)(new Map),[o,i]=(0,l.useState)(null),{resolvedTheme:c}=(0,ns.D)(),[u,d]=(0,l.useState)(!1),f=(e,t)=>{t&&t.stopPropagation();let r=n.get(e);if((!r?.modified||confirm(`Close ${r.file.name} without saving?`))&&(a(t=>{let r=new Map(t);return r.delete(e),r}),o===e)){let t=Array.from(n.keys()).filter(t=>t!==e);i(t.length>0?t[t.length-1]:null)}},g=(0,l.useCallback)((e,t)=>{void 0!==e&&"text"===y(t).type&&a(r=>{let n=new Map(r),a=n.get(t);return a&&n.set(t,{...a,content:e,modified:a.file.content!==e}),n})},[]),v=(0,l.useCallback)(async t=>{let r=n.get(t);if(r&&r.modified)try{await p.OP.init();let n=await p.OP.updateFile(e,t,r.content);a(e=>{let a=new Map(e);return a.set(t,{file:n,content:r.content,modified:!1}),a}),window.dispatchEvent(new CustomEvent("fileContentChanged",{detail:{path:t,projectId:e}}))}catch(e){h.v.error("Failed to save file:",e)}},[n,e]);(0,l.useCallback)(e=>{(e.metaKey||e.ctrlKey)&&"s"===e.key&&(e.preventDefault(),o&&v(o))},[o,v]);let y=e=>{let t=e.split(".").pop()?.toLowerCase();if(["png","jpg","jpeg","gif","bmp","svg","webp"].includes(t||""))return{type:"image",language:"plaintext"};let r={js:"javascript",mjs:"javascript",ts:"typescript",tsx:"typescript",html:"html",htm:"html",css:"css",json:"json",md:"markdown",txt:"plaintext",xml:"xml",yaml:"yaml",yml:"yaml"};return r[t||""]?{type:"text",language:r[t||""]}:["zip","tar","gz","exe","bin","pdf","doc","docx","xls","xlsx","ppt","pptx"].includes(t||"")?{type:"unsupported",language:"plaintext"}:{type:"text",language:"plaintext"}},w=e=>y(e).language,j=o?n.get(o):null;return(0,s.jsxs)("div",{className:"h-full flex flex-col",children:[(0,s.jsxs)("div",{className:"p-3 border-b bg-muted/70 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(aG,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-editor-active)"}}),r?(0,s.jsxs)("button",{type:"button",onClick:r,"aria-label":"Hide code editor",className:"relative hidden h-6 w-6 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-destructive md:flex group",children:[(0,s.jsx)(aG,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-editor-active)"}}),(0,s.jsx)(k.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}):(0,s.jsx)(aG,{className:"hidden h-4 w-4 md:inline-flex",style:{color:"var(--button-editor-active)"}}),(0,s.jsx)("h3",{className:"text-sm font-medium",children:"Code Editor"})]}),j?.modified&&"text"===y(j.file.path).type&&(0,s.jsxs)(m.$,{size:"sm",variant:"ghost",className:"h-5 px-2 gap-1.5",onClick:()=>v(o),children:[(0,s.jsx)(aK,{className:"h-3 w-3"}),(0,s.jsx)("span",{className:"text-xs",children:"Save"})]})]}),0===n.size?(0,s.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:(0,s.jsxs)("div",{className:"text-center space-y-3",children:[(0,s.jsx)(x,{className:"h-12 w-12 mx-auto opacity-50"}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("p",{className:"text-base font-medium",children:"No files open"}),(0,s.jsx)("p",{className:"text-sm",children:"Select a file from the explorer to edit"})]})]})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"border-b bg-muted/70",children:(0,s.jsx)("div",{className:"flex items-center overflow-x-auto scrollbar-thin",children:Array.from(n.entries()).map(([e,t])=>(0,s.jsxs)("div",{className:(0,h.cn)("flex items-center gap-2 px-4 py-2.5 border-r cursor-pointer transition-all relative group",o===e?"bg-background border-b-2 border-b-primary shadow-sm":"hover:bg-muted/50 border-b-2 border-b-transparent"),onClick:()=>i(e),children:[(0,s.jsxs)("span",{className:"text-sm",children:[t.file.name,t.modified&&(0,s.jsx)("span",{className:"text-orange-500 ml-1",children:"●"})]}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-4 w-4 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:t=>f(e,t),children:(0,s.jsx)(k.A,{className:"h-3 w-3 hover:text-destructive"})})]},e))})}),j&&(0,s.jsx)("div",{className:"flex-1 border-t",children:(()=>{let e=y(j.file.path);return"image"===e.type?(0,s.jsx)("div",{className:"h-full flex items-center justify-center bg-background p-8",children:(0,s.jsxs)("div",{className:"text-center space-y-4 max-w-2xl",children:[(0,s.jsx)(b,{className:"h-12 w-12 mx-auto text-muted-foreground"}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("h3",{className:"text-lg font-medium",children:"Image Preview"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:j.file.name})]}),(0,s.jsx)("div",{className:"border rounded-lg p-4 bg-muted/30 max-h-96 overflow-auto",children:(0,s.jsx)("img",{src:`data:image/${j.file.path.split(".").pop()};base64,${j.content}`,alt:j.file.name,className:"max-w-full h-auto rounded shadow-sm",onError:e=>{let t=e.target;if(t.style.display="none",!t.parentElement?.querySelector(".error-msg")){let e=document.createElement("div");e.className="error-msg text-sm text-muted-foreground flex items-center gap-2",e.innerHTML='Unable to display image',t.parentElement?.appendChild(e)}}})}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Image files cannot be edited in the text editor"})]})}):"unsupported"===e.type?(0,s.jsx)("div",{className:"h-full flex items-center justify-center bg-background p-8",children:(0,s.jsxs)("div",{className:"text-center space-y-4",children:[(0,s.jsx)(aY.A,{className:"h-12 w-12 mx-auto text-muted-foreground"}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("h3",{className:"text-lg font-medium",children:"Unsupported File Type"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:j.file.name}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground max-w-md",children:"This file type is not supported for editing in the text editor. Binary files and certain document formats cannot be displayed here."})]})]})}):(0,s.jsx)(aW,{height:"100%",language:w(j.file.path),value:j.content,onChange:e=>g(e,j.file.path),theme:u?"dark"===c?"vs-dark":"light":"vs-dark",options:{minimap:{enabled:!1},fontSize:14,lineNumbers:"on",roundedSelection:!1,scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on",wrappingIndent:"indent"}})})()})]})]})}function aX(e){window.dispatchEvent(new CustomEvent("openFile",{detail:e}))}var aZ=r(28559);let aQ=(0,v.A)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),a0=(0,v.A)("message-square",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]),a1=(0,v.A)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);var a2=r(3589),a3=r(99526);function a4(){let[e,t]=(0,l.useState)(()=>r3.s.getCostSettings()),r=!1!==e.showCosts;return{costSettings:e,shouldShowCosts:r}}var a5=r(10158);class a6{async initDB(){if(!this.isInitialized)return new Promise((e,t)=>{let r=indexedDB.open(this.dbName,1);r.onerror=()=>{h.v.error("Failed to open conversation database"),t(r.error)},r.onsuccess=()=>{this.db=r.result,this.isInitialized=!0,e()},r.onupgradeneeded=e=>{let t=e.target.result;if(!t.objectStoreNames.contains(this.storeName)){let e=t.createObjectStore(this.storeName,{keyPath:"id"});e.createIndex("projectId","projectId",{unique:!1}),e.createIndex("lastUpdated","lastUpdated",{unique:!1})}}})}getConversationId(e){return`conv_${e}`}async loadConversationFromDB(e){if(await this.initDB(),!this.db)return null;let t=this.getConversationId(e);return new Promise((r,n)=>{let a=this.db.transaction([this.storeName],"readonly").objectStore(this.storeName).get(t);a.onsuccess=()=>{let t=a.result;if(t){let n={id:t.id,projectId:t.projectId,messages:t.messages||[],lastUpdated:t.lastUpdated,version:t.version||1};this.conversationBreaks.set(e,t.breaks||[]),r(n)}else r(null)},a.onerror=()=>{h.v.error("Failed to load conversation from DB"),n(a.error)}})}async saveConversationToDB(e){if(await this.initDB(),!this.db)return;let t=this.conversationBreaks.get(e.projectId)||[],r={id:e.id,projectId:e.projectId,messages:e.messages,lastUpdated:e.lastUpdated,version:e.version,breaks:t};return new Promise((e,t)=>{let n=this.db.transaction([this.storeName],"readwrite").objectStore(this.storeName).put(r);n.onsuccess=()=>e(),n.onerror=()=>{h.v.error("Failed to save conversation to DB"),t(n.error)}})}async deleteConversationFromDB(e){if(await this.initDB(),!this.db)return;let t=this.getConversationId(e);return new Promise((e,r)=>{let n=this.db.transaction([this.storeName],"readwrite").objectStore(this.storeName).delete(t);n.onsuccess=()=>e(),n.onerror=()=>{h.v.error("Failed to delete conversation from DB"),r(n.error)}})}async getConversation(e){let t=this.conversations.get(e);if(!t){let r=await this.loadConversationFromDB(e);t=r||{id:this.getConversationId(e),projectId:e,messages:[],lastUpdated:new Date().toISOString(),version:1},this.conversations.set(e,t)}return t}async updateConversation(e,t){let r=await this.getConversation(e);r.messages=[...t],r.lastUpdated=new Date().toISOString(),r.version+=1,this.conversations.set(e,r),await this.saveConversationToDB(r),h.v.debug(`[ConversationState] Updated conversation for project ${e} with ${t.length} messages`)}async clearConversation(e){let t=await this.getConversation(e);await this.recordConversationBreak(e,{type:"clear",timestamp:new Date().toISOString(),description:"User cleared chat"}),t.messages=[],t.lastUpdated=new Date().toISOString(),t.version+=1,this.conversations.set(e,t),await this.saveConversationToDB(t),h.v.debug(`[ConversationState] Cleared conversation for project ${e}`)}async recordConversationBreak(e,t){let r=this.conversationBreaks.get(e)||[];r.push(t),r.length>20&&(r=r.slice(-20)),this.conversationBreaks.set(e,r);let n=this.conversations.get(e);n&&await this.saveConversationToDB(n),h.v.debug(`[ConversationState] Recorded conversation break for project ${e}:`,t.type)}getRecentBreaks(e,t=5){return(this.conversationBreaks.get(e)||[]).slice(-t)}async addBreakContextMessage(e,t){let r,n=await this.getConversation(e);switch(t.type){case"checkpoint_restore":r=`[Context: Project was restored to checkpoint "${t.description||"previous state"}" at ${new Date(t.timestamp).toLocaleTimeString()}]`;break;case"retry":r=`[Context: Retrying previous request after restoring to checkpoint at ${new Date(t.timestamp).toLocaleTimeString()}]`;break;case"page_refresh":r=`[Context: Session resumed after page refresh at ${new Date(t.timestamp).toLocaleTimeString()}]`;break;case"manual_save":r=`[Context: Project saved manually at ${new Date(t.timestamp).toLocaleTimeString()}${t.description?` (${t.description})`:""}]`;break;default:return}let a={role:"system",content:r};n.messages.push(a),await this.updateConversation(e,n.messages)}async getConversationMessages(e,t){let r=await this.getConversation(e);if(!t||r.messages.length<=t)return[...r.messages];let n=[...r.messages],a=n.filter(e=>"system"===e.role),o=n.filter(e=>"system"!==e.role).slice(-(t-a.length));return[...a,...o]}async deleteProject(e){this.conversations.delete(e),this.conversationBreaks.delete(e),await this.deleteConversationFromDB(e),h.v.debug(`[ConversationState] Deleted all conversation data for project ${e}`)}async getConversationStats(e){let t=await this.getConversation(e),r=this.conversationBreaks.get(e)||[];return{messageCount:t.messages.length,lastUpdated:t.lastUpdated,breaks:r.length,version:t.version}}constructor(){this.conversations=new Map,this.conversationBreaks=new Map,this.dbName="DeepStudioConversations",this.storeName="conversations",this.db=null,this.isInitialized=!1}}let a8=new a6;class a9{static convertToOrchestratorMessages(e){let t=[];for(let r of e)if(!r.isTask){if("user"===r.role)t.push({role:"user",content:r.content||""});else if("assistant"===r.role){let e={role:"assistant",content:r.content||""};if(r.toolCalls&&r.toolCalls.length>0&&(e.tool_calls=r.toolCalls),r.toolMessages&&!e.tool_calls){let t=[];for(let e of r.toolMessages)"tool"===e.type&&e.name&&t.push({id:e.id||`tool_${t.length}`,type:"function",function:{name:e.name,arguments:JSON.stringify(e.parameters||{})}});t.length>0&&(e.tool_calls=t)}if((r.checkpointId||r.cost||r.usage||r.toolMessages)&&(e.ui_metadata={},r.checkpointId&&(e.ui_metadata.checkpointId=r.checkpointId),r.cost&&(e.ui_metadata.cost=r.cost),r.usage&&(e.ui_metadata.usage=r.usage),r.toolMessages&&(e.ui_metadata.toolMessages=r.toolMessages)),r.toolMessages){let t=r.toolMessages,n=[];for(let e of t)"message"===e.type&&e.content&&n.push(e.content);if(n.length>0){let t=[e.content,...n].filter(e=>e&&e.trim()).join("\n\n");e.content=t}}if(t.push(e),r.toolMessages){let e=r.toolMessages;for(let r=0;r`${e}_recovered_${r++}`;for(let r=0;r0&&(o.toolCalls=e)}if(!o.toolMessages&&a.tool_calls&&a.tool_calls.length>0){let t=[];for(let o of(a.content&&a.content.trim()&&t.push({id:n("msg"),type:"message",content:a.content}),a.tool_calls)){let a=o.id||n("tool"),i={};if(o.function?.arguments)try{i=JSON.parse(o.function.arguments)}catch{i={arguments:o.function.arguments}}let s=null;for(let t=r+1;t0&&(o.toolMessages=t),o.toolCalls=a.tool_calls}t.push(o)}}}return h.v.debug(`[ConversationConverter] Converted ${e.length} orchestrator messages to ${t.length} UI messages`),t}static truncateConversation(e,t=50){if(e.length<=t)return e;let r=e.filter(e=>"system"===e.role),n=e.filter(e=>"system"!==e.role),a=t-r.length;return a<=0?r:[...r,...n.slice(-a)]}static createContextMessage(e,t){return{role:"system",content:`[Context: ${t}]`}}static prepareConversationForOrchestrator(e,t={}){let r=this.convertToOrchestratorMessages(e);return t.includeSystemPrompt&&t.systemPrompt&&(r.some(e=>"system"===e.role)||r.unshift({role:"system",content:t.systemPrompt})),t.maxMessages&&(r=this.truncateConversation(r,t.maxMessages)),h.v.debug(`[ConversationConverter] Prepared ${r.length} messages for orchestrator`),r}}var a7=r(57462);let oe=(0,v.A)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),ot=(0,l.createContext)(null);ot.displayName="PanelGroupContext";let or={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},on=c["useId".toString()],oa="function"==typeof on?on:()=>null,oo=0;function oi(e=null){let t=oa(),r=(0,l.useRef)(e||t||null);return null===r.current&&(r.current=""+oo++),null!=e?e:r.current}function os({children:e,className:t="",collapsedSize:r,collapsible:n,defaultSize:a,forwardedRef:o,id:i,maxSize:s,minSize:c,onCollapse:u,onExpand:d,onResize:p,order:h,style:m,tagName:f="div",...g}){let v=(0,l.useContext)(ot);if(null===v)throw Error("Panel components must be rendered within a PanelGroup container");let{collapsePanel:x,expandPanel:y,getPanelSize:b,getPanelStyle:w,groupId:k,isPanelCollapsed:j,reevaluatePanelConstraints:N,registerPanel:C,resizePanel:S,unregisterPanel:E}=v,D=oi(i),P=(0,l.useRef)({callbacks:{onCollapse:u,onExpand:d,onResize:p},constraints:{collapsedSize:r,collapsible:n,defaultSize:a,maxSize:s,minSize:c},id:D,idIsFromProps:void 0!==i,order:h});(0,l.useRef)({didLogMissingDefaultSizeWarning:!1}),(0,l.useImperativeHandle)(o,()=>({collapse:()=>{x(P.current)},expand:e=>{y(P.current,e)},getId:()=>D,getSize:()=>b(P.current),isCollapsed:()=>j(P.current),isExpanded:()=>!j(P.current),resize:e=>{S(P.current,e)}}),[x,y,b,j,D,S]);let M=w(P.current,a);return(0,l.createElement)(f,{...g,children:e,className:t,id:D,style:{...M,...m},[or.groupId]:k,[or.panel]:"",[or.panelCollapsible]:n||void 0,[or.panelId]:D,[or.panelSize]:parseFloat(""+M.flexGrow).toFixed(1)})}let ol=(0,l.forwardRef)((e,t)=>(0,l.createElement)(os,{...e,forwardedRef:t}));os.displayName="Panel",ol.displayName="forwardRef(Panel)";let oc=null,ou=-1,od=null;function op(e,t,r){var a,o,i;0;let s=function(e,t,r){let n=(t&ok)!=0,a=(t&oj)!=0,o=(t&oN)!=0,i=(t&oC)!=0;!1;if(t){if(n)if(o)return"se-resize";else if(i)return"ne-resize";else return"e-resize";else if(a)if(o)return"sw-resize";else if(i)return"nw-resize";else return"w-resize";else if(o)return"s-resize";else if(i)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}(e,t,r);if(oc!==s){if(oc=s,null===od){od=document.createElement("style");n&&od.setAttribute("nonce",n),document.head.appendChild(od)}ou>=0&&(null==(i=od.sheet)||i.removeRule(ou)),ou=null!=(a=null==(o=od.sheet)?void 0:o.insertRule(`*{cursor: ${s} !important;}`))?a:-1}}function oh(e){return"keydown"===e.type}function om(e){return e.type.startsWith("pointer")}function of(e){return e.type.startsWith("mouse")}function og(e){if(om(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(of(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}let ov=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function ox(e){let t=e.length;for(;t--;){let r=e[t];if(oB(r,"Missing node"),function(e){let t=getComputedStyle(e);return!!("fixed"===t.position||"auto"!==t.zIndex&&("static"!==t.position||function(e){var t;let r=getComputedStyle(null!=(t=ow(e))?t:e).display;return"flex"===r||"inline-flex"===r}(e))||1>+t.opacity||"transform"in t&&"none"!==t.transform||"webkitTransform"in t&&"none"!==t.webkitTransform||"mixBlendMode"in t&&"normal"!==t.mixBlendMode||"filter"in t&&"none"!==t.filter||"webkitFilter"in t&&"none"!==t.webkitFilter||"isolation"in t&&"isolate"===t.isolation||ov.test(t.willChange))||"touch"===t.webkitOverflowScrolling}(r))return r}return null}function oy(e){return e&&Number(getComputedStyle(e).zIndex)||0}function ob(e){let t=[];for(;e;)t.push(e),e=ow(e);return t}function ow(e){let{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}let ok=1,oj=2,oN=4,oC=8,oS="coarse"===function(){if("function"==typeof matchMedia)return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}(),oE=[],oD=!1,oP=new Map,oM=new Map,oI=new Set;function oT(e){let{target:t}=e,{x:r,y:n}=og(e);oD=!0,oz({target:t,x:r,y:n}),oF(),oE.length>0&&(oq("down",e),oO(),e.preventDefault(),oL(t)||e.stopImmediatePropagation())}function oA(e){let{x:t,y:r}=og(e);if(oD&&0===e.buttons&&(oD=!1,oq("up",e)),!oD){let{target:n}=e;oz({target:n,x:t,y:r})}oq("move",e),oO(),oE.length>0&&e.preventDefault()}function oR(e){let{target:t}=e,{x:r,y:n}=og(e);oM.clear(),oD=!1,oE.length>0&&(e.preventDefault(),oL(t)||e.stopImmediatePropagation()),oq("up",e),oz({target:t,x:r,y:n}),oO(),oF()}function oL(e){let t=e;for(;t;){if(t.hasAttribute(or.resizeHandle))return!0;t=t.parentElement}return!1}function oz({target:e,x:t,y:r}){oE.splice(0);let n=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(n=e),oI.forEach(e=>{let{element:a,hitAreaMargins:o}=e,i=a.getBoundingClientRect(),{bottom:s,left:l,right:c,top:u}=i,d=oS?o.coarse:o.fine;if(t>=l-d&&t<=c+d&&r>=u-d&&r<=s+d){if(null!==n&&document.contains(n)&&a!==n&&!a.contains(n)&&!n.contains(a)&&function(e,t){let r;if(e===t)throw Error("Cannot compare node with itself");let n={a:ob(e),b:ob(t)};for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;oB(r,"Stacking order can only be calculated for elements with a common ancestor");let a={a:oy(ox(n.a)),b:oy(ox(n.b))};if(a.a===a.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},a=e.length;for(;a--;){let r=e[a];if(r===t.a)return 1;if(r===t.b)return -1}}return Math.sign(a.a-a.b)}(n,a)>0){let e=n,t=!1;for(;e&&!e.contains(a);){var p,h;if(p=e.getBoundingClientRect(),h=i,p.xh.x&&p.yh.y){t=!0;break}e=e.parentElement}if(t)return}oE.push(e)}})}function oO(){let e=!1,t=!1;oE.forEach(r=>{let{direction:n}=r;"horizontal"===n?e=!0:t=!0});let r=0;oM.forEach(e=>{r|=e}),e&&t?op("intersection",r,oD):e?op("horizontal",r,oD):t?op("vertical",r,oD):null!==od&&(document.head.removeChild(od),oc=null,od=null,ou=-1)}function oF(){var e;null==(e=a)||e.abort();let t={capture:!0,signal:(a=new AbortController).signal};oI.size&&(oD?(oE.length>0&&oP.forEach((e,r)=>{let{body:n}=r;e>0&&(n.addEventListener("contextmenu",oR,t),n.addEventListener("pointerleave",oA,t),n.addEventListener("pointermove",oA,t))}),oP.forEach((e,r)=>{let{body:n}=r;n.addEventListener("pointerup",oR,t),n.addEventListener("pointercancel",oR,t)})):oP.forEach((e,r)=>{let{body:n}=r;e>0&&(n.addEventListener("pointerdown",oT,t),n.addEventListener("pointermove",oA,t))}))}function oq(e,t){oI.forEach(r=>{let{setResizeHandlerState:n}=r;n(e,oE.includes(r),t)})}function oB(e,t){if(!e)throw console.error(t),Error(t)}function o_(e,t,r=10){return e.toFixed(r)===t.toFixed(r)?0:e>t?1:-1}function o$(e,t,r=10){return 0===o_(e,t,r)}function oU(e,t,r){return 0===o_(e,t,r)}function oH({panelConstraints:e,panelIndex:t,size:r}){let n=e[t];oB(null!=n,`Panel constraints not found for index ${t}`);let{collapsedSize:a=0,collapsible:o,maxSize:i=100,minSize:s=0}=n;return 0>o_(r,s)&&(r=o&&0>o_(r,(a+s)/2)?a:s),r=parseFloat((r=Math.min(i,r)).toFixed(10))}function oV({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:n,prevLayout:a,trigger:o}){if(oU(e,0))return t;let i=[...t],[s,l]=n;oB(null!=s,"Invalid first pivot index"),oB(null!=l,"Invalid second pivot index");let c=0;if("keyboard"===o){{let n=e<0?l:s,a=r[n];oB(a,`Panel constraints not found for index ${n}`);let{collapsedSize:o=0,collapsible:i,minSize:c=0}=a;if(i){let r=t[n];if(oB(null!=r,`Previous layout not found for panel index ${n}`),oU(r,o)){let t=c-r;o_(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let n=e<0?s:l,a=r[n];oB(a,`No panel constraints found for index ${n}`);let{collapsedSize:o=0,collapsible:i,minSize:c=0}=a;if(i){let r=t[n];if(oB(null!=r,`Previous layout not found for panel index ${n}`),oU(r,c)){let t=r-o;o_(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let n=e<0?1:-1,a=e<0?l:s,o=0;for(;;){let e=t[a];if(oB(null!=e,`Previous layout not found for panel index ${a}`),o+=oH({panelConstraints:r,panelIndex:a,size:100})-e,(a+=n)<0||a>=r.length)break}let i=Math.min(Math.abs(e),Math.abs(o));e=e<0?0-i:i}{let n=e<0?s:l;for(;n>=0&&n=0))break;e<0?n--:n++}}if(function(e,t,r){if(e.length!==t.length)return!1;for(let r=0;r=0&&n0?n--:n++}}}return oU(i.reduce((e,t)=>t+e,0),100)?i:a}function oW(e,t=document){return Array.from(t.querySelectorAll(`[${or.resizeHandleId}][data-panel-group-id="${e}"]`))}function oG(e,t,r=document){let n=oW(e,r).findIndex(e=>e.getAttribute(or.resizeHandleId)===t);return null!=n?n:null}function oK(e,t,r){let n=oG(e,t,r);return null!=n?[n,n+1]:[-1,-1]}function oY(e,t=document){if((t instanceof HTMLElement||"object"==typeof t&&null!==t&&"tagName"in t&&"getAttribute"in t)&&t.dataset.panelGroupId==e)return t;let r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function oJ(e,t=document){let r=t.querySelector(`[${or.resizeHandleId}="${e}"]`);return r||null}function oX(e,t){let{x:r,y:n}=og(t);return"horizontal"===e?r:n}function oZ(e,t,r){t.forEach((t,n)=>{let a=e[n];oB(a,`Panel data not found for index ${n}`);let{callbacks:o,constraints:i,id:s}=a,{collapsedSize:l=0,collapsible:c}=i,u=r[s];if(null==u||t!==u){r[s]=t;let{onCollapse:e,onExpand:n,onResize:a}=o;a&&a(t,u),c&&(e||n)&&(n&&(null==u||o$(u,l))&&!o$(t,l)&&n(),e&&(null==u||!o$(u,l))&&o$(t,l)&&e())}})}function oQ(e,t){if(e.length!==t.length)return!1;for(let r=0;rlocalStorage.getItem(e),e.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function o1(e){return`react-resizable-panels:${e}`}function o2(e,t,r,n,a){var o;let i=o1(e),s=t.map(e=>{let{constraints:t,id:r,idIsFromProps:n,order:a}=e;return n?r:a?`${a}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(","),l=null!=(o=function(e,t){try{let r=o1(e),n=t.getItem(r);if(n){let e=JSON.parse(n);if("object"==typeof e&&null!=e)return e}}catch(e){}return null}(e,a))?o:{};l[s]={expandToSizes:Object.fromEntries(r.entries()),layout:n};try{a.setItem(i,JSON.stringify(l))}catch(e){console.error(e)}}let o3={getItem:e=>(o0(o3),o3.getItem(e)),setItem:(e,t)=>{o0(o3),o3.setItem(e,t)}},o4={};function o5({autoSaveId:e=null,children:t,className:r="",direction:n,forwardedRef:a,id:o=null,onLayout:i=null,keyboardResizeBy:s=null,storage:c=o3,style:u,tagName:d="div",...p}){let h=oi(o),m=(0,l.useRef)(null),[f,g]=(0,l.useState)(null),[v,x]=(0,l.useState)([]),y=function(){let[e,t]=(0,l.useState)(0);return(0,l.useCallback)(()=>t(e=>e+1),[])}(),b=(0,l.useRef)({}),w=(0,l.useRef)(new Map),k=(0,l.useRef)(0),j=(0,l.useRef)({autoSaveId:e,direction:n,dragState:f,id:h,keyboardResizeBy:s,onLayout:i,storage:c}),N=(0,l.useRef)({layout:v,panelDataArray:[],panelDataArrayChanged:!1});(0,l.useRef)({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),(0,l.useImperativeHandle)(a,()=>({getId:()=>j.current.id,getLayout:()=>{let{layout:e}=N.current;return e},setLayout:e=>{let{onLayout:t}=j.current,{layout:r,panelDataArray:n}=N.current,a=function({layout:e,panelConstraints:t}){let r=[...e],n=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(", ")}`);if(!oU(n,100)&&r.length>0)for(let e=0;ee.constraints)});!function(e,t){if(e.length!==t.length)return!1;for(let r=0;r{if(!o)return;let e=t.current;oB(e,"Eager values not found");let{panelDataArray:a}=e;oB(null!=oY(r,o),`No group found for id "${r}"`);let s=oW(r,o);oB(s,`No resize handles found for group id "${r}"`);let l=s.map(e=>{let t=e.getAttribute(or.resizeHandleId);oB(t,"Resize handle element has no handle id attribute");let[s,l]=function(e,t,r,n=document){var a,o,i,s;let l=oJ(t,n),c=oW(e,n),u=l?c.indexOf(l):-1;return[null!=(a=null==(o=r[u])?void 0:o.id)?a:null,null!=(i=null==(s=r[u+1])?void 0:s.id)?i:null]}(r,t,a,o);if(null==s||null==l)return()=>{};let c=e=>{if(!e.defaultPrevented&&"Enter"===e.key){e.preventDefault();let l=a.findIndex(e=>e.id===s);if(l>=0){let e=a[l];oB(e,`No panel data found for index ${l}`);let s=n[l],{collapsedSize:c=0,collapsible:u,minSize:d=0}=e.constraints;if(null!=s&&u){let e=oV({delta:oU(s,c)?d-c:c-s,initialLayout:n,panelConstraints:a.map(e=>e.constraints),pivotIndices:oK(r,t,o),prevLayout:n,trigger:"keyboard"});n!==e&&i(e)}}}};return e.addEventListener("keydown",c),()=>{e.removeEventListener("keydown",c)}});return()=>{l.forEach(e=>e())}},[o,e,t,r,n,a,i])}({committedValuesRef:j,eagerValuesRef:N,groupId:h,layout:v,panelDataArray:N.current.panelDataArray,setLayout:x,panelGroupElement:m.current}),(0,l.useEffect)(()=>{let{panelDataArray:t}=N.current;if(e){if(0===v.length||v.length!==t.length)return;let r=o4[e];null==r&&(r=function(e,t=10){let r=null;return(...n)=>{null!==r&&clearTimeout(r),r=setTimeout(()=>{e(...n)},t)}}(o2,100),o4[e]=r),r(e,[...t],new Map(w.current),v,c)}},[e,v,c]),(0,l.useEffect)(()=>{});let C=(0,l.useCallback)(e=>{let{onLayout:t}=j.current,{layout:r,panelDataArray:n}=N.current;if(e.constraints.collapsible){let a=n.map(e=>e.constraints),{collapsedSize:o=0,panelSize:i,pivotIndices:s}=o9(n,e,r);if(oB(null!=i,`Panel size not found for panel "${e.id}"`),!o$(i,o)){w.current.set(e.id,i);let l=oV({delta:o8(n,e)===n.length-1?i-o:o-i,initialLayout:r,panelConstraints:a,pivotIndices:s,prevLayout:r,trigger:"imperative-api"});oQ(r,l)||(x(l),N.current.layout=l,t&&t(l),oZ(n,l,b.current))}}},[]),S=(0,l.useCallback)((e,t)=>{let{onLayout:r}=j.current,{layout:n,panelDataArray:a}=N.current;if(e.constraints.collapsible){let o=a.map(e=>e.constraints),{collapsedSize:i=0,panelSize:s=0,minSize:l=0,pivotIndices:c}=o9(a,e,n),u=null!=t?t:l;if(o$(s,i)){let t=w.current.get(e.id),i=null!=t&&t>=u?t:u,l=oV({delta:o8(a,e)===a.length-1?s-i:i-s,initialLayout:n,panelConstraints:o,pivotIndices:c,prevLayout:n,trigger:"imperative-api"});oQ(n,l)||(x(l),N.current.layout=l,r&&r(l),oZ(a,l,b.current))}}},[]),E=(0,l.useCallback)(e=>{let{layout:t,panelDataArray:r}=N.current,{panelSize:n}=o9(r,e,t);return oB(null!=n,`Panel size not found for panel "${e.id}"`),n},[]),D=(0,l.useCallback)((e,t)=>{let{panelDataArray:r}=N.current,n=o8(r,e);return function({defaultSize:e,dragState:t,layout:r,panelData:n,panelIndex:a,precision:o=3}){let i,s=r[a];return{flexBasis:0,flexGrow:null==s?void 0!=e?e.toFixed(o):"1":1===n.length?"1":s.toFixed(o),flexShrink:1,overflow:"hidden",pointerEvents:null!==t?"none":void 0}}({defaultSize:t,dragState:f,layout:v,panelData:r,panelIndex:n})},[f,v]),P=(0,l.useCallback)(e=>{let{layout:t,panelDataArray:r}=N.current,{collapsedSize:n=0,collapsible:a,panelSize:o}=o9(r,e,t);return oB(null!=o,`Panel size not found for panel "${e.id}"`),!0===a&&o$(o,n)},[]),M=(0,l.useCallback)(e=>{let{layout:t,panelDataArray:r}=N.current,{collapsedSize:n=0,collapsible:a,panelSize:o}=o9(r,e,t);return oB(null!=o,`Panel size not found for panel "${e.id}"`),!a||o_(o,n)>0},[]),I=(0,l.useCallback)(e=>{let{panelDataArray:t}=N.current;t.push(e),t.sort((e,t)=>{let r=e.order,n=t.order;return null==r&&null==n?0:null==r?-1:null==n?1:r-n}),N.current.panelDataArrayChanged=!0,y()},[y]),T=(0,l.useCallback)(e=>{let t=!1,r=m.current;return r&&"rtl"===window.getComputedStyle(r,null).getPropertyValue("direction")&&(t=!0),function(r){var n,a;r.preventDefault();let o=m.current;if(!o)return()=>null;let{direction:i,dragState:s,id:l,keyboardResizeBy:c,onLayout:u}=j.current,{layout:d,panelDataArray:p}=N.current,{initialLayout:h}=null!=s?s:{},f=oK(l,e,o),g=function(e,t,r,n,a,o){if(oh(e)){let t="horizontal"===r,n=0;n=e.shiftKey?100:null!=a?a:10;let o=0;switch(e.key){case"ArrowDown":o=t?0:n;break;case"ArrowLeft":o=t?-n:0;break;case"ArrowRight":o=t?n:0;break;case"ArrowUp":o=t?0:-n;break;case"End":o=100;break;case"Home":o=-100}return o}return null==n?0:function(e,t,r,n,a){let o="horizontal"===r,i=oJ(t,a);oB(i,`No resize handle element found for id "${t}"`);let s=i.getAttribute(or.groupId);oB(s,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=n,c=oX(r,e),u=oY(s,a);oB(u,`No group element found for id "${s}"`);let d=u.getBoundingClientRect();return(c-l)/(o?d.width:d.height)*100}(e,t,r,n,o)}(r,e,i,s,c,o),v="horizontal"===i;v&&t&&(g=-g);let y=oV({delta:g,initialLayout:null!=h?h:d,panelConstraints:p.map(e=>e.constraints),pivotIndices:f,prevLayout:d,trigger:oh(r)?"keyboard":"mouse-or-touch"}),w=!oQ(d,y);(om(r)||of(r))&&k.current!=g&&((k.current=g,w||0===g)?oM.set(e,0):v?(n=g<0?ok:oj,oM.set(e,n)):(a=g<0?oN:oC,oM.set(e,a))),w&&(x(y),N.current.layout=y,u&&u(y),oZ(p,y,b.current))}},[]),A=(0,l.useCallback)((e,t)=>{let{onLayout:r}=j.current,{layout:n,panelDataArray:a}=N.current,o=a.map(e=>e.constraints),{panelSize:i,pivotIndices:s}=o9(a,e,n);oB(null!=i,`Panel size not found for panel "${e.id}"`);let l=oV({delta:o8(a,e)===a.length-1?i-t:t-i,initialLayout:n,panelConstraints:o,pivotIndices:s,prevLayout:n,trigger:"imperative-api"});oQ(n,l)||(x(l),N.current.layout=l,r&&r(l),oZ(a,l,b.current))},[]),R=(0,l.useCallback)((e,t)=>{let{layout:r,panelDataArray:n}=N.current,{collapsedSize:a=0,collapsible:o}=t,{collapsedSize:i=0,collapsible:s,maxSize:l=100,minSize:c=0}=e.constraints,{panelSize:u}=o9(n,e,r);null!=u&&(o&&s&&o$(u,a)?o$(a,i)||A(e,i):ul&&A(e,l))},[A]),L=(0,l.useCallback)((e,t)=>{let{direction:r}=j.current,{layout:n}=N.current;if(!m.current)return;let a=oJ(e,m.current);oB(a,`Drag handle element not found for id "${e}"`);let o=oX(r,t);g({dragHandleId:e,dragHandleRect:a.getBoundingClientRect(),initialCursorPosition:o,initialLayout:n})},[]),z=(0,l.useCallback)(()=>{g(null)},[]),O=(0,l.useCallback)(e=>{let{panelDataArray:t}=N.current,r=o8(t,e);r>=0&&(t.splice(r,1),delete b.current[e.id],N.current.panelDataArrayChanged=!0,y())},[y]),F=(0,l.useMemo)(()=>({collapsePanel:C,direction:n,dragState:f,expandPanel:S,getPanelSize:E,getPanelStyle:D,groupId:h,isPanelCollapsed:P,isPanelExpanded:M,reevaluatePanelConstraints:R,registerPanel:I,registerResizeHandle:T,resizePanel:A,startDragging:L,stopDragging:z,unregisterPanel:O,panelGroupElement:m.current}),[C,f,n,S,E,D,h,P,M,R,I,T,A,L,z,O]);return(0,l.createElement)(ot.Provider,{value:F},(0,l.createElement)(d,{...p,children:t,className:r,id:o,ref:m,style:{display:"flex",flexDirection:"horizontal"===n?"row":"column",height:"100%",overflow:"hidden",width:"100%",...u},[or.group]:"",[or.groupDirection]:n,[or.groupId]:h}))}let o6=(0,l.forwardRef)((e,t)=>(0,l.createElement)(o5,{...e,forwardedRef:t}));function o8(e,t){return e.findIndex(e=>e===t||e.id===t.id)}function o9(e,t,r){let n=o8(e,t),a=n===e.length-1,o=r[n];return{...t.constraints,panelSize:o,pivotIndices:a?[n-1,n]:[n,n+1]}}function o7({children:e=null,className:t="",disabled:r=!1,hitAreaMargins:n,id:a,onBlur:o,onClick:i,onDragging:s,onFocus:c,onPointerDown:u,onPointerUp:d,style:p={},tabIndex:h=0,tagName:m="div",...f}){var g,v;let x=(0,l.useRef)(null),y=(0,l.useRef)({onClick:i,onDragging:s,onPointerDown:u,onPointerUp:d});(0,l.useEffect)(()=>{y.current.onClick=i,y.current.onDragging=s,y.current.onPointerDown=u,y.current.onPointerUp=d});let b=(0,l.useContext)(ot);if(null===b)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");let{direction:w,groupId:k,registerResizeHandle:j,startDragging:N,stopDragging:C,panelGroupElement:S}=b,E=oi(a),[D,P]=(0,l.useState)("inactive"),[M,I]=(0,l.useState)(!1),[T,A]=(0,l.useState)(null),R=(0,l.useRef)({state:D});(0,l.useEffect)(()=>{if(r)A(null);else{let e=j(E);A(()=>e)}},[r,E,j]);let L=null!=(g=null==n?void 0:n.coarse)?g:15,z=null!=(v=null==n?void 0:n.fine)?v:5;return(0,l.useEffect)(()=>{if(r||null==T)return;let e=x.current;oB(e,"Element ref not attached");let t=!1;return function(e,t,r,n,a){var o;let{ownerDocument:i}=t,s={direction:r,element:t,hitAreaMargins:n,setResizeHandlerState:a},l=null!=(o=oP.get(i))?o:0;return oP.set(i,l+1),oI.add(s),oF(),function(){var t;oM.delete(e),oI.delete(s);let r=null!=(t=oP.get(i))?t:1;if(oP.set(i,r-1),oF(),1===r&&oP.delete(i),oE.includes(s)){let e=oE.indexOf(s);e>=0&&oE.splice(e,1),oO(),a("up",!0,null)}}}(E,e,w,{coarse:L,fine:z},(e,r,n)=>{if(!r)return void P("inactive");switch(e){case"down":{P("drag"),t=!1,oB(n,'Expected event to be defined for "down" action'),N(E,n);let{onDragging:e,onPointerDown:r}=y.current;null==e||e(!0),null==r||r();break}case"move":{let{state:e}=R.current;t=!0,"drag"!==e&&P("hover"),oB(n,'Expected event to be defined for "move" action'),T(n);break}case"up":{P("hover"),C();let{onClick:e,onDragging:r,onPointerUp:n}=y.current;null==r||r(!1),null==n||n(),t||null==e||e()}}})},[L,w,r,z,j,E,T,N,C]),!function({disabled:e,handleId:t,resizeHandler:r,panelGroupElement:n}){(0,l.useEffect)(()=>{if(e||null==r||null==n)return;let a=oJ(t,n);if(null==a)return;let o=e=>{if(!e.defaultPrevented)switch(e.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":e.preventDefault(),r(e);break;case"F6":{e.preventDefault();let r=a.getAttribute(or.groupId);oB(r,`No group element found for id "${r}"`);let o=oW(r,n),i=oG(r,t,n);oB(null!==i,`No resize element found for id "${t}"`);let s=e.shiftKey?i>0?i-1:o.length-1:i+1{a.removeEventListener("keydown",o)}},[n,e,t,r])}({disabled:r,handleId:E,resizeHandler:T,panelGroupElement:S}),(0,l.createElement)(m,{...f,children:e,className:t,id:a,onBlur:()=>{I(!1),null==o||o()},onFocus:()=>{I(!0),null==c||c()},ref:x,role:"separator",style:{touchAction:"none",userSelect:"none",...p},tabIndex:h,[or.groupDirection]:w,[or.groupId]:k,[or.resizeHandle]:"",[or.resizeHandleActive]:"drag"===D?"pointer":M?"keyboard":void 0,[or.resizeHandleEnabled]:!r,[or.resizeHandleId]:E,[or.resizeHandleState]:D})}o5.displayName="PanelGroup",o6.displayName="forwardRef(PanelGroup)",o7.displayName="PanelResizeHandle";let ie=({className:e,...t})=>(0,s.jsx)(o6,{className:(0,h.cn)("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),it=({withHandle:e,className:t,...r})=>(0,s.jsx)(o7,{className:(0,h.cn)("group relative flex w-2 mx-1 items-center justify-center bg-transparent hover:bg-border/50 transition-colors after:absolute after:inset-y-0 after:left-1/2 after:w-4 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-2 data-[panel-group-direction=vertical]:my-1 data-[panel-group-direction=vertical]:mx-0 data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-4 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90 cursor-col-resize data-[panel-group-direction=vertical]:cursor-row-resize",t),...r,children:e&&(0,s.jsx)("div",{className:"z-10 flex h-12 w-1 items-center justify-center rounded-full bg-border/30 hover:bg-border/50 transition-colors opacity-0 group-hover:opacity-100",children:(0,s.jsx)(oe,{className:"h-3 w-3 text-muted-foreground/50"})})});var ir=r(69024),[ia,io]=(0,J.A)("Tooltip",[eo.Bk]),ii=(0,eo.Bk)(),is="TooltipProvider",il="tooltip.open",[ic,iu]=ia(is),id=e=>{let{__scopeTooltip:t,delayDuration:r=700,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:o}=e,i=l.useRef(!0),c=l.useRef(!1),u=l.useRef(0);return l.useEffect(()=>{let e=u.current;return()=>window.clearTimeout(e)},[]),(0,s.jsx)(ic,{scope:t,isOpenDelayedRef:i,delayDuration:r,onOpen:l.useCallback(()=>{window.clearTimeout(u.current),i.current=!1},[]),onClose:l.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.current=!0,n)},[n]),isPointerInTransitRef:c,onPointerInTransitChange:l.useCallback(e=>{c.current=e},[]),disableHoverableContent:a,children:o})};id.displayName=is;var ip="Tooltip",[ih,im]=ia(ip),ig=e=>{let{__scopeTooltip:t,children:r,open:n,defaultOpen:a,onOpenChange:o,disableHoverableContent:i,delayDuration:c}=e,u=iu(ip,e.__scopeTooltip),d=ii(t),[p,h]=l.useState(null),m=(0,ea.B)(),f=l.useRef(0),g=i??u.disableHoverableContent,v=c??u.delayDuration,x=l.useRef(!1),[y,b]=(0,X.i)({prop:n,defaultProp:a??!1,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(il))):u.onClose(),o?.(e)},caller:ip}),w=l.useMemo(()=>y?x.current?"delayed-open":"instant-open":"closed",[y]),k=l.useCallback(()=>{window.clearTimeout(f.current),f.current=0,x.current=!1,b(!0)},[b]),j=l.useCallback(()=>{window.clearTimeout(f.current),f.current=0,b(!1)},[b]),N=l.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{x.current=!0,b(!0),f.current=0},v)},[v,b]);return l.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),(0,s.jsx)(eo.bL,{...d,children:(0,s.jsx)(ih,{scope:t,contentId:m,open:y,stateAttribute:w,trigger:p,onTriggerChange:h,onTriggerEnter:l.useCallback(()=>{u.isOpenDelayedRef.current?N():k()},[u.isOpenDelayedRef,N,k]),onTriggerLeave:l.useCallback(()=>{g?j():(window.clearTimeout(f.current),f.current=0)},[j,g]),onOpen:k,onClose:j,disableHoverableContent:g,children:r})})};ig.displayName=ip;var iv="TooltipTrigger",ix=l.forwardRef((e,t)=>{let{__scopeTooltip:r,...n}=e,a=im(iv,r),o=iu(iv,r),i=ii(r),c=l.useRef(null),u=(0,Y.s)(t,c,a.onTriggerChange),d=l.useRef(!1),p=l.useRef(!1),h=l.useCallback(()=>d.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),(0,s.jsx)(eo.Mz,{asChild:!0,...i,children:(0,s.jsx)(Z.sG.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...n,ref:u,onPointerMove:(0,K.mK)(e.onPointerMove,e=>{"touch"!==e.pointerType&&(p.current||o.isPointerInTransitRef.current||(a.onTriggerEnter(),p.current=!0))}),onPointerLeave:(0,K.mK)(e.onPointerLeave,()=>{a.onTriggerLeave(),p.current=!1}),onPointerDown:(0,K.mK)(e.onPointerDown,()=>{a.open&&a.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:(0,K.mK)(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:(0,K.mK)(e.onBlur,a.onClose),onClick:(0,K.mK)(e.onClick,a.onClose)})})});ix.displayName=iv;var iy="TooltipPortal",[ib,iw]=ia(iy,{forceMount:void 0}),ik=e=>{let{__scopeTooltip:t,forceMount:r,children:n,container:a}=e,o=im(iy,t);return(0,s.jsx)(ib,{scope:t,forceMount:r,children:(0,s.jsx)(es.C,{present:r||o.open,children:(0,s.jsx)(ei.Z,{asChild:!0,container:a,children:n})})})};ik.displayName=iy;var ij="TooltipContent",iN=l.forwardRef((e,t)=>{let r=iw(ij,e.__scopeTooltip),{forceMount:n=r.forceMount,side:a="top",...o}=e,i=im(ij,e.__scopeTooltip);return(0,s.jsx)(es.C,{present:n||i.open,children:i.disableHoverableContent?(0,s.jsx)(iP,{side:a,...o,ref:t}):(0,s.jsx)(iC,{side:a,...o,ref:t})})}),iC=l.forwardRef((e,t)=>{let r=im(ij,e.__scopeTooltip),n=iu(ij,e.__scopeTooltip),a=l.useRef(null),o=(0,Y.s)(t,a),[i,c]=l.useState(null),{trigger:u,onClose:d}=r,p=a.current,{onPointerInTransitChange:h}=n,m=l.useCallback(()=>{c(null),h(!1)},[h]),f=l.useCallback((e,t)=>{let r=e.currentTarget,n={x:e.clientX,y:e.clientY},a=function(e,t){let r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,a,o)){case o:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw Error("unreachable")}}(n,r.getBoundingClientRect());c(function(e){let t=e.slice();return t.sort((e,t)=>e.xt.x?1:e.yt.y)),function(e){if(e.length<=1)return e.slice();let t=[];for(let r=0;r=2;){let e=t[t.length-1],r=t[t.length-2];if((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x))t.pop();else break}t.push(n)}t.pop();let r=[];for(let t=e.length-1;t>=0;t--){let n=e[t];for(;r.length>=2;){let e=r[r.length-1],t=r[r.length-2];if((e.x-t.x)*(n.y-t.y)>=(e.y-t.y)*(n.x-t.x))r.pop();else break}r.push(n)}return(r.pop(),1===t.length&&1===r.length&&t[0].x===r[0].x&&t[0].y===r[0].y)?t:t.concat(r)}(t)}([...function(e,t,r=5){let n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r})}return n}(n,a),...function(e){let{top:t,right:r,bottom:n,left:a}=e;return[{x:a,y:t},{x:r,y:t},{x:r,y:n},{x:a,y:n}]}(t.getBoundingClientRect())])),h(!0)},[h]);return l.useEffect(()=>()=>m(),[m]),l.useEffect(()=>{if(u&&p){let e=e=>f(e,p),t=e=>f(e,u);return u.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}},[u,p,f,m]),l.useEffect(()=>{if(i){let e=e=>{let t=e.target,r={x:e.clientX,y:e.clientY},n=u?.contains(t)||p?.contains(t),a=!function(e,t){let{x:r,y:n}=e,a=!1;for(let e=0,o=t.length-1;en!=d>n&&r<(u-l)*(n-c)/(d-c)+l&&(a=!a)}return a}(r,i);n?m():a&&(m(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[u,p,i,d,m]),(0,s.jsx)(iP,{...e,ref:o})}),[iS,iE]=ia(ip,{isInside:!1}),iD=(0,eC.Dc)("TooltipContent"),iP=l.forwardRef((e,t)=>{let{__scopeTooltip:r,children:n,"aria-label":a,onEscapeKeyDown:o,onPointerDownOutside:i,...c}=e,u=im(ij,r),d=ii(r),{onClose:p}=u;return l.useEffect(()=>(document.addEventListener(il,p),()=>document.removeEventListener(il,p)),[p]),l.useEffect(()=>{if(u.trigger){let e=e=>{let t=e.target;t?.contains(u.trigger)&&p()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[u.trigger,p]),(0,s.jsx)(et.qW,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:(0,s.jsxs)(eo.UC,{"data-state":u.stateAttribute,...d,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,s.jsx)(iD,{children:n}),(0,s.jsx)(iS,{scope:r,isInside:!0,children:(0,s.jsx)(ir.bL,{id:u.contentId,role:"tooltip",children:a||n})})]})})});iN.displayName=ij;var iM="TooltipArrow",iI=l.forwardRef((e,t)=>{let{__scopeTooltip:r,...n}=e,a=ii(r);return iE(iM,r).isInside?null:(0,s.jsx)(eo.i3,{...a,...n,ref:t})});function iT({delayDuration:e=0,...t}){return(0,s.jsx)(id,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function iA({...e}){return(0,s.jsx)(iT,{children:(0,s.jsx)(ig,{"data-slot":"tooltip",...e})})}function iR({...e}){return(0,s.jsx)(ix,{"data-slot":"tooltip-trigger",...e})}function iL({className:e,sideOffset:t=0,children:r,arrowStyle:n,...a}){return(0,s.jsx)(ik,{children:(0,s.jsxs)(iN,{"data-slot":"tooltip-content",sideOffset:t,className:(0,h.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...a,children:[r,(0,s.jsx)(iI,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",style:n})]})})}iI.displayName=iM;var iz=r(48730);let iO={pending:(0,s.jsx)(iz.A,{className:"h-4 w-4 text-muted-foreground"}),in_progress:(0,s.jsx)(nq.A,{className:"h-4 w-4 text-blue-500 animate-spin"}),success:(0,s.jsx)(w.A,{className:"h-4 w-4 text-green-500"}),failed:(0,s.jsx)(k.A,{className:"h-4 w-4 text-red-500"}),skipped:(0,s.jsx)("span",{className:"text-muted-foreground",children:"⊘"})},iF={pending:"text-muted-foreground",in_progress:"text-blue-500",success:"text-green-500",failed:"text-red-500",skipped:"text-gray-400"};function iq({title:e,steps:t,checkpointId:r,onRestore:n,isSavedCheckpoint:a,expanded:o=!0,onToggleExpand:i}){let l=t.filter(e=>"success"===e.status).length,c=t.filter(e=>"failed"===e.status).length,u=t.some(e=>"in_progress"===e.status),d=t.every(e=>"pending"!==e.status&&"in_progress"!==e.status),p=r&&d?(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)(rO.E,{variant:a?"default":"outline",className:"h-6 px-2 text-xs",children:a?"Saved version":"Checkpoint"}),n&&(0,s.jsxs)(m.$,{size:"sm",variant:"ghost",onClick:()=>n(r),className:"h-6 px-2 text-xs",title:"Restore to this checkpoint",children:[(0,s.jsx)(aQ,{className:"h-3 w-3 mr-1"}),"Restore"]})]}):null;return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("div",{className:"flex items-start justify-between",children:(0,s.jsxs)("div",{className:"flex items-start gap-2 flex-1",children:[(0,s.jsx)("button",{onClick:i,className:"mt-0.5 hover:bg-muted rounded p-0.5","aria-label":o?"Collapse":"Expand",children:o?(0,s.jsx)(nc.A,{className:"h-4 w-4"}):(0,s.jsx)(tJ,{className:"h-4 w-4"})}),(0,s.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium",children:e}),u&&(0,s.jsx)("span",{className:"text-xs text-blue-500 animate-pulse",children:"In Progress..."}),d&&(0,s.jsx)("span",{className:(0,h.cn)("text-xs",0===c?"text-green-500":"text-orange-500"),children:0===c?"✓ Complete":`⚠ ${l}/${t.length} succeeded`})]}),!o&&t.length>0&&(0,s.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(w.A,{className:"h-3 w-3 text-green-500"}),l]}),c>0&&(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(k.A,{className:"h-3 w-3 text-red-500"}),c]}),(0,s.jsxs)("span",{children:[t.length," total"]})]})]})]})}),o&&t.length>0&&(0,s.jsx)("div",{className:"ml-6 space-y-1 text-sm",children:t.map(e=>(0,s.jsxs)("div",{className:(0,h.cn)("flex items-start gap-2 py-1",iF[e.status]),children:[(0,s.jsx)("span",{className:"mt-0.5",children:iO[e.status]}),(0,s.jsxs)("div",{className:"flex-1 space-y-0.5",children:[(0,s.jsx)("div",{children:e.description}),e.error&&(0,s.jsxs)("div",{className:"text-xs text-red-400 ml-6",children:["Error: ",e.error]})]})]},e.id))}),p&&(0,s.jsx)("div",{className:"ml-6",children:p})]})}var iB=r(5336),i_=r(35071);let i$=(0,v.A)("iteration-cw",[["path",{d:"M4 10a8 8 0 1 1 8 8H4",key:"svv66n"}],["path",{d:"m8 22-4-4 4-4",key:"6g7gki"}]]);var iU=r(45583);let iH=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,iV=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,iW={};function iG(e,t){return((t||iW).jsx?iV:iH).test(e)}let iK=/[ \t\n\f\r]/g;function iY(e){return""===e.replace(iK,"")}class iJ{constructor(e,t,r){this.normal=t,this.property=e,r&&(this.space=r)}}function iX(e,t){let r={},n={};for(let t of e)Object.assign(r,t.property),Object.assign(n,t.normal);return new iJ(r,n,t)}function iZ(e){return e.toLowerCase()}iJ.prototype.normal={},iJ.prototype.property={},iJ.prototype.space=void 0;class iQ{constructor(e,t){this.attribute=t,this.property=e}}iQ.prototype.attribute="",iQ.prototype.booleanish=!1,iQ.prototype.boolean=!1,iQ.prototype.commaOrSpaceSeparated=!1,iQ.prototype.commaSeparated=!1,iQ.prototype.defined=!1,iQ.prototype.mustUseProperty=!1,iQ.prototype.number=!1,iQ.prototype.overloadedBoolean=!1,iQ.prototype.property="",iQ.prototype.spaceSeparated=!1,iQ.prototype.space=void 0;let i0=0,i1=i9(),i2=i9(),i3=i9(),i4=i9(),i5=i9(),i6=i9(),i8=i9();function i9(){return 2**++i0}let i7=Object.keys(o);class se extends iQ{constructor(e,t,r,n){let a=-1;if(super(e,t),function(e,t,r){r&&(e[t]=r)}(this,"space",n),"number"==typeof r)for(;++a"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function sn(e,t){return t in e?e[t]:t}function sa(e,t){return sn(e,t.toLowerCase())}let so=st({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:i6,acceptCharset:i5,accessKey:i5,action:null,allow:null,allowFullScreen:i1,allowPaymentRequest:i1,allowUserMedia:i1,alt:null,as:null,async:i1,autoCapitalize:null,autoComplete:i5,autoFocus:i1,autoPlay:i1,blocking:i5,capture:null,charSet:null,checked:i1,cite:null,className:i5,cols:i4,colSpan:null,content:null,contentEditable:i2,controls:i1,controlsList:i5,coords:i4|i6,crossOrigin:null,data:null,dateTime:null,decoding:null,default:i1,defer:i1,dir:null,dirName:null,disabled:i1,download:i3,draggable:i2,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:i1,formTarget:null,headers:i5,height:i4,hidden:i3,high:i4,href:null,hrefLang:null,htmlFor:i5,httpEquiv:i5,id:null,imageSizes:null,imageSrcSet:null,inert:i1,inputMode:null,integrity:null,is:null,isMap:i1,itemId:null,itemProp:i5,itemRef:i5,itemScope:i1,itemType:i5,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:i1,low:i4,manifest:null,max:null,maxLength:i4,media:null,method:null,min:null,minLength:i4,multiple:i1,muted:i1,name:null,nonce:null,noModule:i1,noValidate:i1,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:i1,optimum:i4,pattern:null,ping:i5,placeholder:null,playsInline:i1,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:i1,referrerPolicy:null,rel:i5,required:i1,reversed:i1,rows:i4,rowSpan:i4,sandbox:i5,scope:null,scoped:i1,seamless:i1,selected:i1,shadowRootClonable:i1,shadowRootDelegatesFocus:i1,shadowRootMode:null,shape:null,size:i4,sizes:null,slot:null,span:i4,spellCheck:i2,src:null,srcDoc:null,srcLang:null,srcSet:null,start:i4,step:null,style:null,tabIndex:i4,target:null,title:null,translate:null,type:null,typeMustMatch:i1,useMap:null,value:i2,width:i4,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:i5,axis:null,background:null,bgColor:null,border:i4,borderColor:null,bottomMargin:i4,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:i1,declare:i1,event:null,face:null,frame:null,frameBorder:null,hSpace:i4,leftMargin:i4,link:null,longDesc:null,lowSrc:null,marginHeight:i4,marginWidth:i4,noResize:i1,noHref:i1,noShade:i1,noWrap:i1,object:null,profile:null,prompt:null,rev:null,rightMargin:i4,rules:null,scheme:null,scrolling:i2,standby:null,summary:null,text:null,topMargin:i4,valueType:null,version:null,vAlign:null,vLink:null,vSpace:i4,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:i1,disableRemotePlayback:i1,prefix:null,property:null,results:i4,security:null,unselectable:null},space:"html",transform:sa}),si=st({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:i8,accentHeight:i4,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:i4,amplitude:i4,arabicForm:null,ascent:i4,attributeName:null,attributeType:null,azimuth:i4,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:i4,by:null,calcMode:null,capHeight:i4,className:i5,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:i4,diffuseConstant:i4,direction:null,display:null,dur:null,divisor:i4,dominantBaseline:null,download:i1,dx:null,dy:null,edgeMode:null,editable:null,elevation:i4,enableBackground:null,end:null,event:null,exponent:i4,externalResourcesRequired:null,fill:null,fillOpacity:i4,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:i6,g2:i6,glyphName:i6,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:i4,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:i4,horizOriginX:i4,horizOriginY:i4,id:null,ideographic:i4,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:i4,k:i4,k1:i4,k2:i4,k3:i4,k4:i4,kernelMatrix:i8,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:i4,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:i4,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:i4,overlineThickness:i4,paintOrder:null,panose1:null,path:null,pathLength:i4,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:i5,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:i4,pointsAtY:i4,pointsAtZ:i4,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:i8,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:i8,rev:i8,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:i8,requiredFeatures:i8,requiredFonts:i8,requiredFormats:i8,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:i4,specularExponent:i4,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:i4,strikethroughThickness:i4,string:null,stroke:null,strokeDashArray:i8,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:i4,strokeOpacity:i4,strokeWidth:null,style:null,surfaceScale:i4,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:i8,tabIndex:i4,tableValues:null,target:null,targetX:i4,targetY:i4,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:i8,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:i4,underlineThickness:i4,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:i4,values:null,vAlphabetic:i4,vMathematical:i4,vectorEffect:null,vHanging:i4,vIdeographic:i4,version:null,vertAdvY:i4,vertOriginX:i4,vertOriginY:i4,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:i4,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:sn}),ss=st({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),sl=st({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:sa}),sc=st({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),su=iX([sr,so,ss,sl,sc],"html"),sd=iX([sr,si,ss,sl,sc],"svg"),sp=/[A-Z]/g,sh=/-[a-z]/g,sm=/^data[-\w.:]+$/i;function sf(e){return"-"+e.toLowerCase()}function sg(e){return e.charAt(1).toUpperCase()}let sv={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var sx=r(11120);let sy=sw("end"),sb=sw("start");function sw(e){return function(t){let r=t&&t.position&&t.position[e]||{};if("number"==typeof r.line&&r.line>0&&"number"==typeof r.column&&r.column>0)return{line:r.line,column:r.column,offset:"number"==typeof r.offset&&r.offset>-1?r.offset:void 0}}}function sk(e){return e&&"object"==typeof e?"position"in e||"type"in e?sN(e.position):"start"in e||"end"in e?sN(e):"line"in e||"column"in e?sj(e):"":""}function sj(e){return sC(e&&e.line)+":"+sC(e&&e.column)}function sN(e){return sj(e&&e.start)+"-"+sj(e&&e.end)}function sC(e){return e&&"number"==typeof e?e:1}class sS extends Error{constructor(e,t,r){super(),"string"==typeof t&&(r=t,t=void 0);let n="",a={},o=!1;if(t&&(a="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?n=e:!a.cause&&e&&(o=!0,n=e.message,a.cause=e),!a.ruleId&&!a.source&&"string"==typeof r){let e=r.indexOf(":");-1===e?a.ruleId=r:(a.source=r.slice(0,e),a.ruleId=r.slice(e+1))}if(!a.place&&a.ancestors&&a.ancestors){let e=a.ancestors[a.ancestors.length-1];e&&(a.place=e.position)}let i=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=i?i.column:void 0,this.fatal=void 0,this.file="",this.message=n,this.line=i?i.line:void 0,this.name=sk(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&"string"==typeof a.cause.stack?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}sS.prototype.file="",sS.prototype.name="",sS.prototype.reason="",sS.prototype.message="",sS.prototype.stack="",sS.prototype.column=void 0,sS.prototype.line=void 0,sS.prototype.ancestors=void 0,sS.prototype.cause=void 0,sS.prototype.fatal=void 0,sS.prototype.place=void 0,sS.prototype.ruleId=void 0,sS.prototype.source=void 0;let sE={}.hasOwnProperty,sD=new Map,sP=/[A-Z]/g,sM=new Set(["table","tbody","thead","tfoot","tr"]),sI=new Set(["td","th"]),sT="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function sA(e,t,r){var n;return"element"===t.type?function(e,t,r){let n=e.schema,a=n;"svg"===t.tagName.toLowerCase()&&"html"===n.space&&(e.schema=sd),e.ancestors.push(t);let o=sO(e,t.tagName,!1),i=function(e,t){let r,n,a={};for(n in t.properties)if("children"!==n&&sE.call(t.properties,n)){let o=function(e,t,r){let n=function(e,t){let r=iZ(t),n=t,a=iQ;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&"data"===r.slice(0,4)&&sm.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(sh,sg);n="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!sh.test(e)){let r=e.replace(sp,sf);"-"!==r.charAt(0)&&(r="-"+r),t="data"+r}}a=se}return new a(n,t)}(e.schema,t);if(!(null==r||"number"==typeof r&&Number.isNaN(r))){if(Array.isArray(r)&&(r=n.commaSeparated?function(e,t){let r={};return(""===e[e.length-1]?[...e,""]:e).join((r.padRight?" ":"")+","+(!1===r.padLeft?"":" ")).trim()}(r):r.join(" ").trim()),"style"===n.property){let t="object"==typeof r?r:function(e,t){try{return sx(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};let t=new sS("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=sT+"#cannot-parse-style-attribute",t}}(e,String(r));return"css"===e.stylePropertyNameCase&&(t=function(e){let t,r={};for(t in e)sE.call(e,t)&&(r[function(e){let t=e.replace(sP,sq);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return r}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&n.space?sv[n.property]||n.property:n.attribute,r]}}(e,n,t.properties[n]);if(o){let[n,i]=o;e.tableCellAlignToStyle&&"align"===n&&"string"==typeof i&&sI.has(t.tagName)?r=i:a[n]=i}}return r&&((a.style||(a.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r),a}(e,t),s=sz(e,t);return sM.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&iY(e.value):iY(e))})),sR(e,i,o,t),sL(i,s),e.ancestors.pop(),e.schema=n,e.create(t,o,i,r)}(e,t,r):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}sF(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,r){let n=e.schema,a=n;"svg"===t.name&&"html"===n.space&&(e.schema=sd),e.ancestors.push(t);let o=null===t.name?e.Fragment:sO(e,t.name,!0),i=function(e,t){let r={};for(let n of t.attributes)if("mdxJsxExpressionAttribute"===n.type)if(n.data&&n.data.estree&&e.evaluater){let t=n.data.estree.body[0];t.type;let a=t.expression;a.type;let o=a.properties[0];o.type,Object.assign(r,e.evaluater.evaluateExpression(o.argument))}else sF(e,t.position);else{let a,o=n.name;if(n.value&&"object"==typeof n.value)if(n.value.data&&n.value.data.estree&&e.evaluater){let t=n.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else sF(e,t.position);else a=null===n.value||n.value;r[o]=a}return r}(e,t),s=sz(e,t);return sR(e,i,o,t),sL(i,s),e.ancestors.pop(),e.schema=n,e.create(t,o,i,r)}(e,t,r):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);sF(e,t.position)}(e,t):"root"===t.type?function(e,t,r){let n={};return sL(n,sz(e,t)),e.create(t,e.Fragment,n,r)}(e,t,r):"text"===t.type?(n=0,t.value):void 0}function sR(e,t,r,n){"string"!=typeof r&&r!==e.Fragment&&e.passNode&&(t.node=n)}function sL(e,t){if(t.length>0){let r=t.length>1?t:t[0];r&&(e.children=r)}}function sz(e,t){let r=[],n=-1,a=e.passKeys?new Map:sD;for(;++no?0:o+t:t>o?o:t,r=r>0?r:0,n.length<1e4)(a=Array.from(n)).unshift(t,r),e.splice(...a);else for(r&&e.splice(t,r);i0?(sH(e,e.length,0,t),e):t}class sW{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,t,r){this.setCursor(Math.trunc(e));let n=this.right.splice(this.right.length-(t||0),Number.POSITIVE_INFINITY);return r&&sG(this.left,r),n.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),sG(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),sG(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e-1&&e.test(String.fromCharCode(t))}}function s7(e,t,r,n){let a=n?n-1:Number.POSITIVE_INFINITY,o=0;return function(n){return s5(n)?(e.enter(r),function n(i){return s5(i)&&o++n))return;let s=a.events.length,l=s;for(;l--;)if("exit"===a.events[l][0]&&"chunkFlow"===a.events[l][1].type){if(e){r=a.events[l][1].end;break}e=!0}for(g(i),o=s;ot;){let t=o[r];a.containerState=t[1],t[0].exit.call(a,e)}o.length=t}function v(){t.write([null]),r=void 0,t=void 0,a.containerState._closeFlow=void 0}}},lr={tokenize:function(e,t,r){return s7(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},ln={partial:!0,tokenize:function(e,t,r){return function(t){return s5(t)?s7(e,n,"linePrefix")(t):n(t)};function n(e){return null===e||s3(e)?t(e):r(e)}}},la={resolve:function(e){return sK(e),e},tokenize:function(e,t){let r;return function(t){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),n(t)};function n(t){return null===t?a(t):s3(t)?e.check(lo,o,a)(t):(e.consume(t),n)}function a(r){return e.exit("chunkContent"),e.exit("content"),t(r)}function o(t){return e.consume(t),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,n}}},lo={partial:!0,tokenize:function(e,t,r){let n=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s7(e,a,"linePrefix")};function a(a){if(null===a||s3(a))return r(a);let o=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(n.parser.constructs.flow,r,t)(a)}}},li={tokenize:function(e){let t=this,r=e.attempt(ln,function(n){return null===n?void e.consume(n):(e.enter("lineEndingBlank"),e.consume(n),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r)},e.attempt(this.parser.constructs.flowInitial,n,s7(e,e.attempt(this.parser.constructs.flow,n,e.attempt(la,n)),"linePrefix")));return r;function n(n){return null===n?void e.consume(n):(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),t.currentConstruct=void 0,r)}}},ls={resolveAll:ld()},ll=lu("string"),lc=lu("text");function lu(e){return{resolveAll:ld("text"===e?lp:void 0),tokenize:function(t){let r=this,n=this.parser.constructs[e],a=t.attempt(n,o,i);return o;function o(e){return l(e)?a(e):i(e)}function i(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),s)}function s(e){return l(e)?(t.exit("data"),a(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;let t=n[e],a=-1;if(t)for(;++a=3&&(null===i||s3(i))?(e.exit("thematicBreak"),t(i)):r(i)}(i)}}},lm={continuation:{tokenize:function(e,t,r){let n=this;return n.containerState._closeFlow=void 0,e.check(ln,function(r){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,s7(e,t,"listItemIndent",n.containerState.size+1)(r)},function(r){return n.containerState.furtherBlankLines||!s5(r)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,a(r)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(lg,t,a)(r))});function a(a){return n.containerState._closeFlow=!0,n.interrupt=void 0,s7(e,e.attempt(lm,t,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,r){let n=this,a=n.events[n.events.length-1],o=a&&"linePrefix"===a[1].type?a[2].sliceSerialize(a[1],!0).length:0,i=0;return function(t){let a=n.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===a?!n.containerState.marker||t===n.containerState.marker:s0(t)){if(n.containerState.type||(n.containerState.type=a,e.enter(a,{_container:!0})),"listUnordered"===a)return e.enter("listItemPrefix"),42===t||45===t?e.check(lh,r,s)(t):s(t);if(!n.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(a){return s0(a)&&++i<10?(e.consume(a),t):(!n.interrupt||i<2)&&(n.containerState.marker?a===n.containerState.marker:41===a||46===a)?(e.exit("listItemValue"),s(a)):r(a)}(t)}return r(t)};function s(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||t,e.check(ln,n.interrupt?r:l,e.attempt(lf,u,c))}function l(e){return n.containerState.initialBlankLine=!0,o++,u(e)}function c(t){return s5(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):r(t)}function u(r){return n.containerState.size=o+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(r)}}},lf={partial:!0,tokenize:function(e,t,r){let n=this;return s7(e,function(e){let a=n.events[n.events.length-1];return!s5(e)&&a&&"listItemPrefixWhitespace"===a[1].type?t(e):r(e)},"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},lg={partial:!0,tokenize:function(e,t,r){let n=this;return s7(e,function(e){let a=n.events[n.events.length-1];return a&&"listItemIndent"===a[1].type&&a[2].sliceSerialize(a[1],!0).length===n.containerState.size?t(e):r(e)},"listItemIndent",n.containerState.size+1)}},lv={continuation:{tokenize:function(e,t,r){let n=this;return function(t){return s5(t)?s7(e,a,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):a(t)};function a(n){return e.attempt(lv,t,r)(n)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,r){let n=this;return function(t){if(62===t){let r=n.containerState;return r.open||(e.enter("blockQuote",{_container:!0}),r.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),a}return r(t)};function a(r){return s5(r)?(e.enter("blockQuotePrefixWhitespace"),e.consume(r),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(r))}}};function lx(e,t,r,n,a,o,i,s,l){let c=l||Number.POSITIVE_INFINITY,u=0;return function(t){return 60===t?(e.enter(n),e.enter(a),e.enter(o),e.consume(t),e.exit(o),d):null===t||32===t||41===t||sQ(t)?r(t):(e.enter(n),e.enter(i),e.enter(s),e.enter("chunkString",{contentType:"string"}),m(t))};function d(r){return 62===r?(e.enter(o),e.consume(r),e.exit(o),e.exit(a),e.exit(n),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(r))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(s),d(t)):null===t||60===t||s3(t)?r(t):(e.consume(t),92===t?h:p)}function h(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function m(a){return!u&&(null===a||41===a||s4(a))?(e.exit("chunkString"),e.exit(s),e.exit(i),e.exit(n),t(a)):u999||null===d||91===d||93===d&&!i||94===d&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?r(d):93===d?(e.exit(o),e.enter(a),e.consume(d),e.exit(a),e.exit(n),t):s3(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||s3(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),i||(i=!s5(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function lb(e,t,r,n,a,o){let i;return function(t){return 34===t||39===t||40===t?(e.enter(n),e.enter(a),e.consume(t),e.exit(a),i=40===t?41:t,s):r(t)};function s(r){return r===i?(e.enter(a),e.consume(r),e.exit(a),e.exit(n),t):(e.enter(o),l(r))}function l(t){return t===i?(e.exit(o),s(i)):null===t?r(t):s3(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s7(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===i||null===t||s3(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===i||92===t?(e.consume(t),c):c(t)}}function lw(e,t){let r;return function n(a){return s3(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),r=!0,n):s5(a)?s7(e,n,r?"linePrefix":"lineSuffix")(a):t(a)}}function lk(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let lj={partial:!0,tokenize:function(e,t,r){return function(t){return s4(t)?lw(e,n)(t):r(t)};function n(t){return lb(e,a,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function a(t){return s5(t)?s7(e,o,"whitespace")(t):o(t)}function o(e){return null===e||s3(e)?t(e):r(e)}}},lN={name:"codeIndented",tokenize:function(e,t,r){let n=this;return function(t){return e.enter("codeIndented"),s7(e,a,"linePrefix",5)(t)};function a(t){let a=n.events[n.events.length-1];return a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?function t(r){return null===r?o(r):s3(r)?e.attempt(lC,t,o)(r):(e.enter("codeFlowValue"),function r(n){return null===n||s3(n)?(e.exit("codeFlowValue"),t(n)):(e.consume(n),r)}(r))}(t):r(t)}function o(r){return e.exit("codeIndented"),t(r)}}},lC={partial:!0,tokenize:function(e,t,r){let n=this;return a;function a(t){return n.parser.lazy[n.now().line]?r(t):s3(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):s7(e,o,"linePrefix",5)(t)}function o(e){let o=n.events[n.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(e):s3(e)?a(e):r(e)}}},lS={name:"setextUnderline",resolveTo:function(e,t){let r,n,a,o=e.length;for(;o--;)if("enter"===e[o][0]){if("content"===e[o][1].type){r=o;break}"paragraph"===e[o][1].type&&(n=o)}else"content"===e[o][1].type&&e.splice(o,1),a||"definition"!==e[o][1].type||(a=o);let i={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[n][1].type="setextHeadingText",a?(e.splice(n,0,["enter",i,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=i,e.push(["exit",i,t]),e},tokenize:function(e,t,r){let n,a=this;return function(t){var i;let s,l=a.events.length;for(;l--;)if("lineEnding"!==a.events[l][1].type&&"linePrefix"!==a.events[l][1].type&&"content"!==a.events[l][1].type){s="paragraph"===a.events[l][1].type;break}return!a.parser.lazy[a.now().line]&&(a.interrupt||s)?(e.enter("setextHeadingLine"),n=t,i=t,e.enter("setextHeadingLineSequence"),function t(r){return r===n?(e.consume(r),t):(e.exit("setextHeadingLineSequence"),s5(r)?s7(e,o,"lineSuffix")(r):o(r))}(i)):r(t)};function o(n){return null===n||s3(n)?(e.exit("setextHeadingLine"),t(n)):r(n)}}},lE=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],lD=["pre","script","style","textarea"],lP={partial:!0,tokenize:function(e,t,r){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),e.attempt(ln,t,r)}}},lM={partial:!0,tokenize:function(e,t,r){let n=this;return function(t){return s3(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):r(t)};function a(e){return n.parser.lazy[n.now().line]?r(e):t(e)}}},lI={partial:!0,tokenize:function(e,t,r){let n=this;return function(t){return null===t?r(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a)};function a(e){return n.parser.lazy[n.now().line]?r(e):t(e)}}},lT={concrete:!0,name:"codeFenced",tokenize:function(e,t,r){let n,a=this,o={partial:!0,tokenize:function(e,t,r){let o=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i};function i(t){return e.enter("codeFencedFence"),s5(t)?s7(e,l,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===n?(e.enter("codeFencedFenceSequence"),function t(a){return a===n?(o++,e.consume(a),t):o>=s?(e.exit("codeFencedFenceSequence"),s5(a)?s7(e,c,"whitespace")(a):c(a)):r(a)}(t)):r(t)}function c(n){return null===n||s3(n)?(e.exit("codeFencedFence"),t(n)):r(n)}}},i=0,s=0;return function(t){var o=t;let c=a.events[a.events.length-1];return i=c&&"linePrefix"===c[1].type?c[2].sliceSerialize(c[1],!0).length:0,n=o,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(a){return a===n?(s++,e.consume(a),t):s<3?r(a):(e.exit("codeFencedFenceSequence"),s5(a)?s7(e,l,"whitespace")(a):l(a))}(o)};function l(o){return null===o||s3(o)?(e.exit("codeFencedFence"),a.interrupt?t(o):e.check(lI,u,m)(o)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(a){return null===a||s3(a)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),l(a)):s5(a)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),s7(e,c,"whitespace")(a)):96===a&&a===n?r(a):(e.consume(a),t)}(o))}function c(t){return null===t||s3(t)?l(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(a){return null===a||s3(a)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),l(a)):96===a&&a===n?r(a):(e.consume(a),t)}(t))}function u(t){return e.attempt(o,m,d)(t)}function d(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),p}function p(t){return i>0&&s5(t)?s7(e,h,"linePrefix",i+1)(t):h(t)}function h(t){return null===t||s3(t)?e.check(lI,u,m)(t):(e.enter("codeFlowValue"),function t(r){return null===r||s3(r)?(e.exit("codeFlowValue"),h(r)):(e.consume(r),t)}(t))}function m(r){return e.exit("codeFenced"),t(r)}}},lA={AElig:"\xc6",AMP:"&",Aacute:"\xc1",Abreve:"Ă",Acirc:"\xc2",Acy:"А",Afr:"\uD835\uDD04",Agrave:"\xc0",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"\uD835\uDD38",ApplyFunction:"⁡",Aring:"\xc5",Ascr:"\uD835\uDC9C",Assign:"≔",Atilde:"\xc3",Auml:"\xc4",Backslash:"∖",Barv:"⫧",Barwed:"⌆",Bcy:"Б",Because:"∵",Bernoullis:"ℬ",Beta:"Β",Bfr:"\uD835\uDD05",Bopf:"\uD835\uDD39",Breve:"˘",Bscr:"ℬ",Bumpeq:"≎",CHcy:"Ч",COPY:"\xa9",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",Cayleys:"ℭ",Ccaron:"Č",Ccedil:"\xc7",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"\xb8",CenterDot:"\xb7",Cfr:"ℭ",Chi:"Χ",CircleDot:"⊙",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",Colon:"∷",Colone:"⩴",Congruent:"≡",Conint:"∯",ContourIntegral:"∮",Copf:"ℂ",Coproduct:"∐",CounterClockwiseContourIntegral:"∳",Cross:"⨯",Cscr:"\uD835\uDC9E",Cup:"⋓",CupCap:"≍",DD:"ⅅ",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",Darr:"↡",Dashv:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",Delta:"Δ",Dfr:"\uD835\uDD07",DiacriticalAcute:"\xb4",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",Diamond:"⋄",DifferentialD:"ⅆ",Dopf:"\uD835\uDD3B",Dot:"\xa8",DotDot:"⃜",DotEqual:"≐",DoubleContourIntegral:"∯",DoubleDot:"\xa8",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",Downarrow:"⇓",Dscr:"\uD835\uDC9F",Dstrok:"Đ",ENG:"Ŋ",ETH:"\xd0",Eacute:"\xc9",Ecaron:"Ě",Ecirc:"\xca",Ecy:"Э",Edot:"Ė",Efr:"\uD835\uDD08",Egrave:"\xc8",Element:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"\uD835\uDD3C",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",Equilibrium:"⇌",Escr:"ℰ",Esim:"⩳",Eta:"Η",Euml:"\xcb",Exists:"∃",ExponentialE:"ⅇ",Fcy:"Ф",Ffr:"\uD835\uDD09",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",Fopf:"\uD835\uDD3D",ForAll:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"\uD835\uDD0A",Gg:"⋙",Gopf:"\uD835\uDD3E",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"\uD835\uDCA2",Gt:"≫",HARDcy:"Ъ",Hacek:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",HilbertSpace:"ℋ",Hopf:"ℍ",HorizontalLine:"─",Hscr:"ℋ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"\xcd",Icirc:"\xce",Icy:"И",Idot:"İ",Ifr:"ℑ",Igrave:"\xcc",Im:"ℑ",Imacr:"Ī",ImaginaryI:"ⅈ",Implies:"⇒",Int:"∬",Integral:"∫",Intersection:"⋂",InvisibleComma:"⁣",InvisibleTimes:"⁢",Iogon:"Į",Iopf:"\uD835\uDD40",Iota:"Ι",Iscr:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"\xcf",Jcirc:"Ĵ",Jcy:"Й",Jfr:"\uD835\uDD0D",Jopf:"\uD835\uDD41",Jscr:"\uD835\uDCA5",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"\uD835\uDD0E",Kopf:"\uD835\uDD42",Kscr:"\uD835\uDCA6",LJcy:"Љ",LT:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Larr:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",LeftRightArrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",Leftarrow:"⇐",Leftrightarrow:"⇔",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",LessLess:"⪡",LessSlantEqual:"⩽",LessTilde:"≲",Lfr:"\uD835\uDD0F",Ll:"⋘",Lleftarrow:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",LongLeftRightArrow:"⟷",LongRightArrow:"⟶",Longleftarrow:"⟸",Longleftrightarrow:"⟺",Longrightarrow:"⟹",Lopf:"\uD835\uDD43",LowerLeftArrow:"↙",LowerRightArrow:"↘",Lscr:"ℒ",Lsh:"↰",Lstrok:"Ł",Lt:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"\uD835\uDD10",MinusPlus:"∓",Mopf:"\uD835\uDD44",Mscr:"ℳ",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",Nfr:"\uD835\uDD11",NoBreak:"⁠",NonBreakingSpace:"\xa0",Nopf:"ℕ",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",Nscr:"\uD835\uDCA9",Ntilde:"\xd1",Nu:"Ν",OElig:"Œ",Oacute:"\xd3",Ocirc:"\xd4",Ocy:"О",Odblac:"Ő",Ofr:"\uD835\uDD12",Ograve:"\xd2",Omacr:"Ō",Omega:"Ω",Omicron:"Ο",Oopf:"\uD835\uDD46",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",Or:"⩔",Oscr:"\uD835\uDCAA",Oslash:"\xd8",Otilde:"\xd5",Otimes:"⨷",Ouml:"\xd6",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",PartialD:"∂",Pcy:"П",Pfr:"\uD835\uDD13",Phi:"Φ",Pi:"Π",PlusMinus:"\xb1",Poincareplane:"ℌ",Popf:"ℙ",Pr:"⪻",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",Prime:"″",Product:"∏",Proportion:"∷",Proportional:"∝",Pscr:"\uD835\uDCAB",Psi:"Ψ",QUOT:'"',Qfr:"\uD835\uDD14",Qopf:"ℚ",Qscr:"\uD835\uDCAC",RBarr:"⤐",REG:"\xae",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",Rfr:"ℜ",Rho:"Ρ",RightAngleBracket:"⟩",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",Rightarrow:"⇒",Ropf:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",Rscr:"ℛ",Rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"\uD835\uDD16",ShortDownArrow:"↓",ShortLeftArrow:"←",ShortRightArrow:"→",ShortUpArrow:"↑",Sigma:"Σ",SmallCircle:"∘",Sopf:"\uD835\uDD4A",Sqrt:"√",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",Sscr:"\uD835\uDCAE",Star:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",SuchThat:"∋",Sum:"∑",Sup:"⋑",Superset:"⊃",SupersetEqual:"⊇",Supset:"⋑",THORN:"\xde",TRADE:"™",TSHcy:"Ћ",TScy:"Ц",Tab:" ",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"\uD835\uDD17",Therefore:"∴",Theta:"Θ",ThickSpace:"  ",ThinSpace:" ",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",Topf:"\uD835\uDD4B",TripleDot:"⃛",Tscr:"\uD835\uDCAF",Tstrok:"Ŧ",Uacute:"\xda",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"\xdb",Ucy:"У",Udblac:"Ű",Ufr:"\uD835\uDD18",Ugrave:"\xd9",Umacr:"Ū",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",Uopf:"\uD835\uDD4C",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",UpEquilibrium:"⥮",UpTee:"⊥",UpTeeArrow:"↥",Uparrow:"⇑",Updownarrow:"⇕",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"\uD835\uDCB0",Utilde:"Ũ",Uuml:"\xdc",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"\uD835\uDD19",Vopf:"\uD835\uDD4D",Vscr:"\uD835\uDCB1",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",Wfr:"\uD835\uDD1A",Wopf:"\uD835\uDD4E",Wscr:"\uD835\uDCB2",Xfr:"\uD835\uDD1B",Xi:"Ξ",Xopf:"\uD835\uDD4F",Xscr:"\uD835\uDCB3",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"\xdd",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"\uD835\uDD1C",Yopf:"\uD835\uDD50",Yscr:"\uD835\uDCB4",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",ZeroWidthSpace:"​",Zeta:"Ζ",Zfr:"ℨ",Zopf:"ℤ",Zscr:"\uD835\uDCB5",aacute:"\xe1",abreve:"ă",ac:"∾",acE:"∾̳",acd:"∿",acirc:"\xe2",acute:"\xb4",acy:"а",aelig:"\xe6",af:"⁡",afr:"\uD835\uDD1E",agrave:"\xe0",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",amp:"&",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"\xc5",angzarr:"⍼",aogon:"ą",aopf:"\uD835\uDD52",ap:"≈",apE:"⩰",apacir:"⩯",ape:"≊",apid:"≋",apos:"'",approx:"≈",approxeq:"≊",aring:"\xe5",ascr:"\uD835\uDCB6",ast:"*",asymp:"≈",asympeq:"≍",atilde:"\xe3",auml:"\xe4",awconint:"∳",awint:"⨑",bNot:"⫭",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",beta:"β",beth:"ℶ",between:"≬",bfr:"\uD835\uDD1F",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"\uD835\uDD53",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxh:"─",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",bprime:"‵",breve:"˘",brvbar:"\xa6",bscr:"\uD835\uDCB7",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",bumpeq:"≏",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"��︀",caret:"⁁",caron:"ˇ",ccaps:"⩍",ccaron:"č",ccedil:"\xe7",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cedil:"\xb8",cemptyv:"⦲",cent:"\xa2",centerdot:"\xb7",cfr:"\uD835\uDD20",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledR:"\xae",circledS:"Ⓢ",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",conint:"∮",copf:"\uD835\uDD54",coprod:"∐",copy:"\xa9",copysr:"℗",crarr:"↵",cross:"✗",cscr:"\uD835\uDCB8",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"\xa4",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dArr:"⇓",dHar:"⥥",dagger:"†",daleth:"ℸ",darr:"↓",dash:"‐",dashv:"⊣",dbkarow:"⤏",dblac:"˝",dcaron:"ď",dcy:"д",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",ddotseq:"⩷",deg:"\xb0",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"\uD835\uDD21",dharl:"⇃",dharr:"⇂",diam:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"\xa8",digamma:"ϝ",disin:"⋲",div:"\xf7",divide:"\xf7",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"\uD835\uDD55",dot:"˙",doteq:"≐",doteqdot:"≑",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",downarrow:"↓",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"\uD835\uDCB9",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eDDot:"⩷",eDot:"≑",eacute:"\xe9",easter:"⩮",ecaron:"ě",ecir:"≖",ecirc:"\xea",ecolon:"≕",ecy:"э",edot:"ė",ee:"ⅇ",efDot:"≒",efr:"\uD835\uDD22",eg:"⪚",egrave:"\xe8",egs:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"\uD835\uDD56",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",equals:"=",equest:"≟",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",erarr:"⥱",escr:"ℯ",esdot:"≐",esim:"≂",eta:"η",eth:"\xf0",euml:"\xeb",euro:"€",excl:"!",exist:"∃",expectation:"ℰ",exponentiale:"ⅇ",fallingdotseq:"≒",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"\uD835\uDD23",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"\uD835\uDD57",forall:"∀",fork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"\xbd",frac13:"⅓",frac14:"\xbc",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"\xbe",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"\uD835\uDCBB",gE:"≧",gEl:"⪌",gacute:"ǵ",gamma:"γ",gammad:"ϝ",gap:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",ge:"≥",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"\uD835\uDD24",gg:"≫",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",gl:"≷",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"\uD835\uDD58",grave:"`",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",hArr:"⇔",hairsp:" ",half:"\xbd",hamilt:"ℋ",hardcy:"ъ",harr:"↔",harrcir:"⥈",harrw:"↭",hbar:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"\uD835\uDD25",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"\uD835\uDD59",horbar:"―",hscr:"\uD835\uDCBD",hslash:"ℏ",hstrok:"ħ",hybull:"⁃",hyphen:"‐",iacute:"\xed",ic:"⁣",icirc:"\xee",icy:"и",iecy:"е",iexcl:"\xa1",iff:"⇔",ifr:"\uD835\uDD26",igrave:"\xec",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",image:"ℑ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",intcal:"⊺",integers:"ℤ",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iocy:"ё",iogon:"į",iopf:"\uD835\uDD5A",iota:"ι",iprod:"⨼",iquest:"\xbf",iscr:"\uD835\uDCBE",isin:"∈",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",iukcy:"і",iuml:"\xef",jcirc:"ĵ",jcy:"й",jfr:"\uD835\uDD27",jmath:"ȷ",jopf:"\uD835\uDD5B",jscr:"\uD835\uDCBF",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",kcedil:"ķ",kcy:"к",kfr:"\uD835\uDD28",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"\uD835\uDD5C",kscr:"\uD835\uDCC0",lAarr:"⇚",lArr:"⇐",lAtail:"⤛",lBarr:"⤎",lE:"≦",lEg:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",laquo:"\xab",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lceil:"⌈",lcub:"{",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leftarrow:"←",leftarrowtail:"↢",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",leftthreetimes:"⋋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",lessgtr:"≶",lesssim:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"\uD835\uDD29",lg:"≶",lgE:"⪑",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",ll:"≪",llarr:"⇇",llcorner:"⌞",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",longleftrightarrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"\uD835\uDD5D",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"\uD835\uDCC1",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",ltrie:"⊴",ltrif:"◂",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"\xaf",male:"♂",malt:"✠",maltese:"✠",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",measuredangle:"∡",mfr:"\uD835\uDD2A",mho:"℧",micro:"\xb5",mid:"∣",midast:"*",midcir:"⫰",middot:"\xb7",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"\uD835\uDD5E",mp:"∓",mscr:"\uD835\uDCC2",mstpos:"∾",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nGtv:"≫̸",nLeftarrow:"⇍",nLeftrightarrow:"⇎",nLl:"⋘̸",nLt:"≪⃒",nLtv:"≪̸",nRightarrow:"⇏",nVDash:"⊯",nVdash:"⊮",nabla:"∇",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:"\xa0",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",ne:"≠",neArr:"⇗",nearhk:"⤤",nearr:"↗",nearrow:"↗",nedot:"≐̸",nequiv:"≢",nesear:"⤨",nesim:"≂̸",nexist:"∄",nexists:"∄",nfr:"\uD835\uDD2B",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",ngsim:"≵",ngt:"≯",ngtr:"≯",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",nlArr:"⇍",nlE:"≦̸",nlarr:"↚",nldr:"‥",nle:"≰",nleftarrow:"↚",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nlsim:"≴",nlt:"≮",nltri:"⋪",nltrie:"⋬",nmid:"∤",nopf:"\uD835\uDD5F",not:"\xac",notin:"∉",notinE:"⋹̸",notindot:"⋵̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"\uD835\uDCC3",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"\xf1",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",oS:"Ⓢ",oacute:"\xf3",oast:"⊛",ocir:"⊚",ocirc:"\xf4",ocy:"о",odash:"⊝",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"\uD835\uDD2C",ogon:"˛",ograve:"\xf2",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",ominus:"⊖",oopf:"\uD835\uDD60",opar:"⦷",operp:"⦹",oplus:"⊕",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"\xaa",ordm:"\xba",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oscr:"ℴ",oslash:"\xf8",osol:"⊘",otilde:"\xf5",otimes:"⊗",otimesas:"⨶",ouml:"\xf6",ovbar:"⌽",par:"∥",para:"\xb6",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"\uD835\uDD2D",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",plusmn:"\xb1",plussim:"⨦",plustwo:"⨧",pm:"\xb1",pointint:"⨕",popf:"\uD835\uDD61",pound:"\xa3",pr:"≺",prE:"⪳",prap:"⪷",prcue:"≼",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",primes:"ℙ",prnE:"⪵",prnap:"⪹",prnsim:"⋨",prod:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"\uD835\uDCC5",psi:"ψ",puncsp:" ",qfr:"\uD835\uDD2E",qint:"⨌",qopf:"\uD835\uDD62",qprime:"⁗",qscr:"\uD835\uDCC6",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',rAarr:"⇛",rArr:"⇒",rAtail:"⤜",rBarr:"⤏",rHar:"⥤",race:"∽̱",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"\xbb",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rarrw:"↝",ratail:"⤚",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rceil:"⌉",rcub:"}",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"\xae",rfisht:"⥽",rfloor:"⌋",rfr:"\uD835\uDD2F",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",rhov:"ϱ",rightarrow:"→",rightarrowtail:"↣",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",rightthreetimes:"⋌",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"\uD835\uDD63",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",rsaquo:"›",rscr:"\uD835\uDCC7",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",sbquo:"‚",sc:"≻",scE:"⪴",scap:"⪸",scaron:"š",sccue:"≽",sce:"⪰",scedil:"ş",scirc:"ŝ",scnE:"⪶",scnap:"⪺",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",seArr:"⇘",searhk:"⤥",searr:"↘",searrow:"↘",sect:"\xa7",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"\uD835\uDD30",sfrown:"⌢",sharp:"♯",shchcy:"щ",shcy:"ш",shortmid:"∣",shortparallel:"∥",shy:"\xad",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"\uD835\uDD64",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",squarf:"▪",squf:"▪",srarr:"→",sscr:"\uD835\uDCC8",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"\xaf",sub:"⊂",subE:"⫅",subdot:"⪽",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",sum:"∑",sung:"♪",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",sup:"⊃",supE:"⫆",supdot:"⪾",supdsub:"⫘",supe:"⊇",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swarhk:"⤦",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"\xdf",target:"⌖",tau:"τ",tbrk:"⎴",tcaron:"ť",tcedil:"ţ",tcy:"т",tdot:"⃛",telrec:"⌕",tfr:"\uD835\uDD31",there4:"∴",therefore:"∴",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",thinsp:" ",thkap:"≈",thksim:"∼",thorn:"\xfe",tilde:"˜",times:"\xd7",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"\uD835\uDD65",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"\uD835\uDCC9",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uArr:"⇑",uHar:"⥣",uacute:"\xfa",uarr:"↑",ubrcy:"ў",ubreve:"ŭ",ucirc:"\xfb",ucy:"у",udarr:"⇅",udblac:"ű",udhar:"⥮",ufisht:"⥾",ufr:"\uD835\uDD32",ugrave:"\xf9",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uml:"\xa8",uogon:"ų",uopf:"\uD835\uDD66",uparrow:"↑",updownarrow:"↕",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",upsi:"υ",upsih:"ϒ",upsilon:"υ",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"\uD835\uDCCA",utdot:"⋰",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"\xfc",uwangle:"⦧",vArr:"⇕",vBar:"⫨",vBarv:"⫩",vDash:"⊨",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vcy:"в",vdash:"⊢",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",vert:"|",vfr:"\uD835\uDD33",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"\uD835\uDD67",vprop:"∝",vrtri:"⊳",vscr:"\uD835\uDCCB",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",wedgeq:"≙",weierp:"℘",wfr:"\uD835\uDD34",wopf:"\uD835\uDD68",wp:"℘",wr:"≀",wreath:"≀",wscr:"\uD835\uDCCC",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"\uD835\uDD35",xhArr:"⟺",xharr:"⟷",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"\uD835\uDD69",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",xscr:"\uD835\uDCCD",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"\xfd",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"\xa5",yfr:"\uD835\uDD36",yicy:"ї",yopf:"\uD835\uDD6A",yscr:"\uD835\uDCCE",yucy:"ю",yuml:"\xff",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeetrf:"ℨ",zeta:"ζ",zfr:"\uD835\uDD37",zhcy:"ж",zigrarr:"⇝",zopf:"\uD835\uDD6B",zscr:"\uD835\uDCCF",zwj:"‍",zwnj:"‌"},lR={}.hasOwnProperty;function lL(e){return!!lR.call(lA,e)&&lA[e]}let lz={name:"characterReference",tokenize:function(e,t,r){let n,a,o=this,i=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),n=31,a=sX,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),n=6,a=s1,c):(e.enter("characterReferenceValue"),n=7,a=s0,c(t))}function c(s){if(59===s&&i){let n=e.exit("characterReferenceValue");return a!==sX||lL(o.sliceSerialize(n))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):r(s)}return a(s)&&i++1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;let d={...e[r][1].end},p={...e[u][1].start};lG(d,-s),lG(p,s),o={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},i={type:s>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:p},a={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[u][1].start}},n={type:s>1?"strong":"emphasis",start:{...o.start},end:{...i.end}},e[r][1].end={...o.start},e[u][1].start={...i.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=sV(l,[["enter",e[r][1],t],["exit",e[r][1],t]])),l=sV(l,[["enter",n,t],["enter",o,t],["exit",o,t],["enter",a,t]]),l=sV(l,lq(t.parser.constructs.insideSpan.null,e.slice(r+1,u),t)),l=sV(l,[["exit",a,t],["enter",i,t],["exit",i,t],["exit",n,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=sV(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,sH(e,r-1,u-r+3,l),u=r+l.length-c-2;break}}for(u=-1;++uo&&"whitespace"===e[a][1].type&&(a-=2),"atxHeadingSequence"===e[a][1].type&&(o===a-1||a-4>o&&"whitespace"===e[a-2][1].type)&&(a-=o+1===a?2:4),a>o&&(r={type:"atxHeadingText",start:e[o][1].start,end:e[a][1].end},n={type:"chunkText",start:e[o][1].start,end:e[a][1].end,contentType:"text"},sH(e,o,a-o+1,[["enter",r,t],["enter",n,t],["exit",n,t],["exit",r,t]])),e},tokenize:function(e,t,r){let n=0;return function(a){var o;return e.enter("atxHeading"),o=a,e.enter("atxHeadingSequence"),function a(o){return 35===o&&n++<6?(e.consume(o),a):null===o||s4(o)?(e.exit("atxHeadingSequence"),function r(n){return 35===n?(e.enter("atxHeadingSequence"),function t(n){return 35===n?(e.consume(n),t):(e.exit("atxHeadingSequence"),r(n))}(n)):null===n||s3(n)?(e.exit("atxHeading"),t(n)):s5(n)?s7(e,r,"whitespace")(n):(e.enter("atxHeadingText"),function t(n){return null===n||35===n||s4(n)?(e.exit("atxHeadingText"),r(n)):(e.consume(n),t)}(n))}(o)):r(o)}(o)}}},42:lh,45:[lS,lh],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,r){let n,a,o,i,s,l=this;return function(t){var r;return r=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(r),c};function c(i){return 33===i?(e.consume(i),u):47===i?(e.consume(i),a=!0,h):63===i?(e.consume(i),n=3,l.interrupt?t:T):sJ(i)?(e.consume(i),o=String.fromCharCode(i),m):r(i)}function u(a){return 45===a?(e.consume(a),n=2,d):91===a?(e.consume(a),n=5,i=0,p):sJ(a)?(e.consume(a),n=4,l.interrupt?t:T):r(a)}function d(n){return 45===n?(e.consume(n),l.interrupt?t:T):r(n)}function p(n){let a="CDATA[";return n===a.charCodeAt(i++)?(e.consume(n),i===a.length)?l.interrupt?t:N:p:r(n)}function h(t){return sJ(t)?(e.consume(t),o=String.fromCharCode(t),m):r(t)}function m(i){if(null===i||47===i||62===i||s4(i)){let s=47===i,c=o.toLowerCase();return!s&&!a&&lD.includes(c)?(n=1,l.interrupt?t(i):N(i)):lE.includes(o.toLowerCase())?(n=6,s)?(e.consume(i),f):l.interrupt?t(i):N(i):(n=7,l.interrupt&&!l.parser.lazy[l.now().line]?r(i):a?function t(r){return s5(r)?(e.consume(r),t):k(r)}(i):g(i))}return 45===i||sX(i)?(e.consume(i),o+=String.fromCharCode(i),m):r(i)}function f(n){return 62===n?(e.consume(n),l.interrupt?t:N):r(n)}function g(t){return 47===t?(e.consume(t),k):58===t||95===t||sJ(t)?(e.consume(t),v):s5(t)?(e.consume(t),g):k(t)}function v(t){return 45===t||46===t||58===t||95===t||sX(t)?(e.consume(t),v):x(t)}function x(t){return 61===t?(e.consume(t),y):s5(t)?(e.consume(t),x):g(t)}function y(t){return null===t||60===t||61===t||62===t||96===t?r(t):34===t||39===t?(e.consume(t),s=t,b):s5(t)?(e.consume(t),y):function t(r){return null===r||34===r||39===r||47===r||60===r||61===r||62===r||96===r||s4(r)?x(r):(e.consume(r),t)}(t)}function b(t){return t===s?(e.consume(t),s=null,w):null===t||s3(t)?r(t):(e.consume(t),b)}function w(e){return 47===e||62===e||s5(e)?g(e):r(e)}function k(t){return 62===t?(e.consume(t),j):r(t)}function j(t){return null===t||s3(t)?N(t):s5(t)?(e.consume(t),j):r(t)}function N(t){return 45===t&&2===n?(e.consume(t),D):60===t&&1===n?(e.consume(t),P):62===t&&4===n?(e.consume(t),A):63===t&&3===n?(e.consume(t),T):93===t&&5===n?(e.consume(t),I):s3(t)&&(6===n||7===n)?(e.exit("htmlFlowData"),e.check(lP,R,C)(t)):null===t||s3(t)?(e.exit("htmlFlowData"),C(t)):(e.consume(t),N)}function C(t){return e.check(lM,S,R)(t)}function S(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),E}function E(t){return null===t||s3(t)?C(t):(e.enter("htmlFlowData"),N(t))}function D(t){return 45===t?(e.consume(t),T):N(t)}function P(t){return 47===t?(e.consume(t),o="",M):N(t)}function M(t){if(62===t){let r=o.toLowerCase();return lD.includes(r)?(e.consume(t),A):N(t)}return sJ(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),M):N(t)}function I(t){return 93===t?(e.consume(t),T):N(t)}function T(t){return 62===t?(e.consume(t),A):45===t&&2===n?(e.consume(t),T):N(t)}function A(t){return null===t||s3(t)?(e.exit("htmlFlowData"),R(t)):(e.consume(t),A)}function R(r){return e.exit("htmlFlow"),t(r)}}},61:lS,95:lh,96:lT,126:lT},lQ={38:lz,92:lO},l0={[-5]:lF,[-4]:lF,[-3]:lF,33:lH,38:lz,42:lW,60:[{name:"autolink",tokenize:function(e,t,r){let n=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a};function a(t){return sJ(t)?(e.consume(t),o):64===t?r(t):s(t)}function o(t){return 43===t||45===t||46===t||sX(t)?(n=1,function t(r){return 58===r?(e.consume(r),n=0,i):(43===r||45===r||46===r||sX(r))&&n++<32?(e.consume(r),t):(n=0,s(r))}(t)):s(t)}function i(n){return 62===n?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):null===n||32===n||60===n||sQ(n)?r(n):(e.consume(n),i)}function s(t){return 64===t?(e.consume(t),l):sZ(t)?(e.consume(t),s):r(t)}function l(a){return sX(a)?function a(o){return 46===o?(e.consume(o),n=0,l):62===o?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(o),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(o){if((45===o||sX(o))&&n++<63){let r=45===o?t:a;return e.consume(o),r}return r(o)}(o)}(a):r(a)}}},{name:"htmlText",tokenize:function(e,t,r){let n,a,o,i=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),b):63===t?(e.consume(t),x):sJ(t)?(e.consume(t),k):r(t)}function l(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),a=0,h):sJ(t)?(e.consume(t),v):r(t)}function c(t){return 45===t?(e.consume(t),p):r(t)}function u(t){return null===t?r(t):45===t?(e.consume(t),d):s3(t)?(o=u,M(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),p):u(t)}function p(e){return 62===e?P(e):45===e?d(e):u(e)}function h(t){let n="CDATA[";return t===n.charCodeAt(a++)?(e.consume(t),a===n.length?m:h):r(t)}function m(t){return null===t?r(t):93===t?(e.consume(t),f):s3(t)?(o=m,M(t)):(e.consume(t),m)}function f(t){return 93===t?(e.consume(t),g):m(t)}function g(t){return 62===t?P(t):93===t?(e.consume(t),g):m(t)}function v(t){return null===t||62===t?P(t):s3(t)?(o=v,M(t)):(e.consume(t),v)}function x(t){return null===t?r(t):63===t?(e.consume(t),y):s3(t)?(o=x,M(t)):(e.consume(t),x)}function y(e){return 62===e?P(e):x(e)}function b(t){return sJ(t)?(e.consume(t),w):r(t)}function w(t){return 45===t||sX(t)?(e.consume(t),w):function t(r){return s3(r)?(o=t,M(r)):s5(r)?(e.consume(r),t):P(r)}(t)}function k(t){return 45===t||sX(t)?(e.consume(t),k):47===t||62===t||s4(t)?j(t):r(t)}function j(t){return 47===t?(e.consume(t),P):58===t||95===t||sJ(t)?(e.consume(t),N):s3(t)?(o=j,M(t)):s5(t)?(e.consume(t),j):P(t)}function N(t){return 45===t||46===t||58===t||95===t||sX(t)?(e.consume(t),N):function t(r){return 61===r?(e.consume(r),C):s3(r)?(o=t,M(r)):s5(r)?(e.consume(r),t):j(r)}(t)}function C(t){return null===t||60===t||61===t||62===t||96===t?r(t):34===t||39===t?(e.consume(t),n=t,S):s3(t)?(o=C,M(t)):s5(t)?(e.consume(t),C):(e.consume(t),E)}function S(t){return t===n?(e.consume(t),n=void 0,D):null===t?r(t):s3(t)?(o=S,M(t)):(e.consume(t),S)}function E(t){return null===t||34===t||39===t||60===t||61===t||96===t?r(t):47===t||62===t||s4(t)?j(t):(e.consume(t),E)}function D(e){return 47===e||62===e||s4(e)?j(e):r(e)}function P(n){return 62===n?(e.consume(n),e.exit("htmlTextData"),e.exit("htmlText"),t):r(n)}function M(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),I}function I(t){return s5(t)?s7(e,T,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):T(t)}function T(t){return e.enter("htmlTextData"),o(t)}}}],91:lK,92:[{name:"hardBreakEscape",tokenize:function(e,t,r){return function(t){return e.enter("hardBreakEscape"),e.consume(t),n};function n(n){return s3(n)?(e.exit("hardBreakEscape"),t(n)):r(n)}}},lO],93:lB,95:lW,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,r,n=e.length-4,a=3;if(("lineEnding"===e[3][1].type||"space"===e[a][1].type)&&("lineEnding"===e[n][1].type||"space"===e[n][1].type)){for(t=a;++t13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(65535&r)==65535||(65535&r)==65534||r>1114111?"�":String.fromCodePoint(r)}let l6=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function l8(e,t,r){if(t)return t;if(35===r.charCodeAt(0)){let e=r.charCodeAt(1),t=120===e||88===e;return l5(r.slice(t?2:1),t?16:10)}return lL(r)||e}let l9={}.hasOwnProperty;function l7(e){return{line:e.line,column:e.column,offset:e.offset}}function ce(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+sk({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+sk({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+sk({start:t.start,end:t.end})+") is still open")}function ct(e){let t=this;t.parser=function(r){var n,a;let o,s,l,c;return"string"!=typeof(n={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(a=n,n=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:n(v),autolinkProtocol:c,autolinkEmail:c,atxHeading:n(m),blockQuote:n(function(){return{type:"blockquote",children:[]}}),characterEscape:c,characterReference:c,codeFenced:n(h),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:n(h,a),codeText:n(function(){return{type:"inlineCode",value:""}},a),codeTextData:c,data:c,codeFlowValue:c,definition:n(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:n(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:n(f),hardBreakTrailing:n(f),htmlFlow:n(g,a),htmlFlowData:c,htmlText:n(g,a),htmlTextData:c,image:n(function(){return{type:"image",title:null,url:"",alt:null}}),label:a,link:n(v),listItem:n(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:n(x,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:n(x),paragraph:n(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:n(m),strong:n(function(){return{type:"strong",children:[]}}),thematicBreak:n(function(){return{type:"thematicBreak"}})},exit:{atxHeading:i(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:i(),autolinkEmail:function(e){u.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){u.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:i(),characterEscapeValue:u,characterReferenceMarkerHexadecimal:p,characterReferenceMarkerNumeric:p,characterReferenceValue:function(e){let t,r=this.sliceSerialize(e),n=this.data.characterReferenceType;n?(t=l5(r,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):t=lL(r);let a=this.stack[this.stack.length-1];a.value+=t},characterReference:function(e){this.stack.pop().position.end=l7(e.end)},codeFenced:i(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:u,codeIndented:i(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:i(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:u,data:u,definition:i(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),r=this.stack[this.stack.length-1];r.label=t,r.identifier=lk(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:i(),hardBreakEscape:i(d),hardBreakTrailing:i(d),htmlFlow:i(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:u,htmlText:i(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:u,image:i(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),r=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===r.type?r.children=e.children:r.alt=t},labelText:function(e){let t=this.sliceSerialize(e),r=this.stack[this.stack.length-2];r.label=t.replace(l6,l8),r.identifier=lk(t).toLowerCase()},lineEnding:function(e){let r=this.stack[this.stack.length-1];if(this.data.atHardBreak){r.children[r.children.length-1].position.end=l7(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(r.type)&&(c.call(this,e),u.call(this,e))},link:i(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:i(),listOrdered:i(),listUnordered:i(),paragraph:i(),referenceString:function(e){let t=this.resume(),r=this.stack[this.stack.length-1];r.label=t,r.identifier=lk(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:i(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:i(),thematicBreak:i()}};!function e(t,r){let n=-1;for(;++n0){let e=i.tokenStack[i.tokenStack.length-1];(e[1]||ce).call(i,void 0,e[0])}for(n.position={start:l7(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:l7(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u-1){let e=r[0];"string"==typeof e?r[0]=e.slice(a):r.shift()}i>0&&r.push(e[o].slice(0,i))}return r}(i,e)}function p(){let{_bufferIndex:e,_index:t,line:r,column:a,offset:o}=n;return{_bufferIndex:e,_index:t,line:r,column:a,offset:o}}function h(e,t){t.restore()}function m(e,t){return function(r,a,o){var i;let u,d,h,m;return Array.isArray(r)?f(r):"tokenize"in r?f([r]):(i=r,function(e){let t=null!==e&&i[e],r=null!==e&&i.null;return f([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(r)?r:r?[r]:[]])(e)});function f(e){return(u=e,d=0,0===e.length)?o:v(e[d])}function v(e){return function(r){return(m=function(){let e=p(),t=c.previous,r=c.currentConstruct,a=c.events.length,o=Array.from(s);return{from:a,restore:function(){n=e,c.previous=t,c.currentConstruct=r,c.events.length=a,s=o,g()}}}(),h=e,e.partial||(c.currentConstruct=e),e.name&&c.parser.constructs.disable.null.includes(e.name))?y(r):e.tokenize.call(t?Object.assign(Object.create(c),t):c,l,x,y)(r)}}function x(t){return e(h,m),a}function y(e){return(m.restore(),++d{let r=(t,r)=>(e.set(r,t),t),n=a=>{if(e.has(a))return e.get(a);let[o,i]=t[a];switch(o){case 0:case -1:return r(i,a);case 1:{let e=r([],a);for(let t of i)e.push(n(t));return e}case 2:{let e=r({},a);for(let[t,r]of i)e[n(t)]=n(r);return e}case 3:return r(new Date(i),a);case 4:{let{source:e,flags:t}=i;return r(new RegExp(e,t),a)}case 5:{let e=r(new Map,a);for(let[t,r]of i)e.set(n(t),n(r));return e}case 6:{let e=r(new Set,a);for(let t of i)e.add(n(t));return e}case 7:{let{name:e,message:t}=i;return r(new cr[e](t),a)}case 8:return r(BigInt(i),a);case"BigInt":return r(Object(BigInt(i)),a);case"ArrayBuffer":return r(new Uint8Array(i).buffer,i);case"DataView":{let{buffer:e}=new Uint8Array(i);return r(new DataView(e),i)}}return r(new cr[o](i),a)};return n},ca=e=>cn(new Map,e)(0),{toString:co}={},{keys:ci}=Object,cs=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let r=co.call(e).slice(8,-1);switch(r){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,r]}return r.includes("Array")?[1,r]:r.includes("Error")?[7,r]:[2,r]},cl=([e,t])=>0===e&&("function"===t||"symbol"===t),cc=(e,t,r,n)=>{let a=(e,t)=>{let a=n.push(e)-1;return r.set(t,a),a},o=n=>{if(r.has(n))return r.get(n);let[i,s]=cs(n);switch(i){case 0:{let t=n;switch(s){case"bigint":i=8,t=n.toString();break;case"function":case"symbol":if(e)throw TypeError("unable to serialize "+s);t=null;break;case"undefined":return a([-1],n)}return a([i,t],n)}case 1:{if(s){let e=n;return"DataView"===s?e=new Uint8Array(n.buffer):"ArrayBuffer"===s&&(e=new Uint8Array(n)),a([s,[...e]],n)}let e=[],t=a([i,e],n);for(let t of n)e.push(o(t));return t}case 2:{if(s)switch(s){case"BigInt":return a([s,n.toString()],n);case"Boolean":case"Number":case"String":return a([s,n.valueOf()],n)}if(t&&"toJSON"in n)return o(n.toJSON());let r=[],l=a([i,r],n);for(let t of ci(n))(e||!cl(cs(n[t])))&&r.push([o(t),o(n[t])]);return l}case 3:return a([i,n.toISOString()],n);case 4:{let{source:e,flags:t}=n;return a([i,{source:e,flags:t}],n)}case 5:{let t=[],r=a([i,t],n);for(let[r,a]of n)(e||!(cl(cs(r))||cl(cs(a))))&&t.push([o(r),o(a)]);return r}case 6:{let t=[],r=a([i,t],n);for(let r of n)(e||!cl(cs(r)))&&t.push(o(r));return r}}let{message:l}=n;return a([i,{name:s,message:l}],n)};return o},cu=(e,{json:t,lossy:r}={})=>{let n=[];return cc(!(t||r),!!t,new Map,n)(e),n},cd="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?ca(cu(e,t)):structuredClone(e):(e,t)=>ca(cu(e,t));function cp(e){let t=[],r=-1,n=0,a=0;for(;++r55295&&o<57344){let t=e.charCodeAt(r+1);o<56320&&t>56319&&t<57344?(i=String.fromCharCode(o,t),a=1):i="�"}else i=String.fromCharCode(o);i&&(t.push(e.slice(n,r),encodeURIComponent(i)),n=r+a+1,i=""),a&&(r+=a,a=0)}return t.join("")+e.slice(n)}function ch(e,t){let r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function cm(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let cf=function(e){var t,r;if(null==e)return cv;if("function"==typeof e)return cg(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],r=-1;for(;++r":"")+"\x1b[39m)"})}return o;function o(){var a;let o,i,s,h=cx;if((!l||d(t,r,n[n.length-1]||void 0))&&!1===(h=Array.isArray(a=c(t,n))?a:"number"==typeof a?[!0,a]:null==a?cx:[a])[0])return h;if("children"in t&&t.children&&t.children&&"skip"!==h[0])for(i=(u?t.children.length:-1)+p,s=n.concat(t);i>-1&&i1:t}function ck(e,t,r){let n=0,a=e.length;if(t){let t=e.codePointAt(n);for(;9===t||32===t;)n++,t=e.codePointAt(n)}if(r){let t=e.codePointAt(a-1);for(;9===t||32===t;)a--,t=e.codePointAt(a-1)}return a>n?e.slice(n,a):""}let cj={blockquote:function(e,t){let r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)},break:function(e,t){let r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:"\n"}]},code:function(e,t){let r=t.value?t.value+"\n":"",n={};t.lang&&(n.className=["language-"+t.lang]);let a={type:"element",tagName:"code",properties:n,children:[{type:"text",value:r}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a={type:"element",tagName:"pre",properties:{},children:[a=e.applyData(t,a)]},e.patch(t,a),a},delete:function(e,t){let r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},emphasis:function(e,t){let r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},footnoteReference:function(e,t){let r,n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),o=cp(a.toLowerCase()),i=e.footnoteOrder.indexOf(a),s=e.footnoteCounts.get(a);void 0===s?(s=0,e.footnoteOrder.push(a),r=e.footnoteOrder.length):r=i+1,s+=1,e.footnoteCounts.set(a,s);let l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(r)}]};e.patch(t,l);let c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){let r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},html:function(e,t){if(e.options.allowDangerousHtml){let r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}},imageReference:function(e,t){let r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return cb(e,t);let a={src:cp(n.url||""),alt:t.alt};null!==n.title&&void 0!==n.title&&(a.title=n.title);let o={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,o),e.applyData(t,o)},image:function(e,t){let r={src:cp(t.url)};null!==t.alt&&void 0!==t.alt&&(r.alt=t.alt),null!==t.title&&void 0!==t.title&&(r.title=t.title);let n={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,n),e.applyData(t,n)},inlineCode:function(e,t){let r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);let n={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,n),e.applyData(t,n)},linkReference:function(e,t){let r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return cb(e,t);let a={href:cp(n.url||"")};null!==n.title&&void 0!==n.title&&(a.title=n.title);let o={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)},link:function(e,t){let r={href:cp(t.url)};null!==t.title&&void 0!==t.title&&(r.title=t.title);let n={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},listItem:function(e,t,r){let n=e.all(t),a=r?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let r=e.children,n=-1;for(;!t&&++n0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s0){let n={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},o=sb(t.children[1]),i=sy(t.children[t.children.length-1]);o&&i&&(n.position={start:o,end:i}),a.push(n)}let o={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)},tableCell:function(e,t){let r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},tableRow:function(e,t,r){let n=r?r.children:void 0,a=0===(n?n.indexOf(t):1)?"th":"td",o=r&&"table"===r.type?r.align:void 0,i=o?o.length:t.children.length,s=-1,l=[];for(;++s0,!0),n[0]),a=n.index+n[0].length,n=r.exec(t);return o.push(ck(t.slice(a),a>0,!1)),o.join("")}(String(t.value))};return e.patch(t,r),e.applyData(t,r)},thematicBreak:function(e,t){let r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)},toml:cN,yaml:cN,definition:cN,footnoteDefinition:cN};function cN(){}let cC={}.hasOwnProperty,cS={};function cE(e,t){e.position&&(t.position=function(e){let t=sb(e),r=sy(e);if(t&&r)return{start:t,end:r}}(e))}function cD(e,t){let r=t;if(e&&e.data){let t=e.data.hName,n=e.data.hChildren,a=e.data.hProperties;"string"==typeof t&&("element"===r.type?r.tagName=t:r={type:"element",tagName:t,properties:{},children:"children"in r?r.children:[r]}),"element"===r.type&&a&&Object.assign(r.properties,cd(a)),"children"in r&&r.children&&null!=n&&(r.children=n)}return r}function cP(e,t){let r=[],n=-1;for(t&&r.push({type:"text",value:"\n"});++n0&&r.push({type:"text",value:"\n"}),r}function cM(e){let t=0,r=e.charCodeAt(t);for(;9===r||32===r;)t++,r=e.charCodeAt(t);return e.slice(t)}function cI(e,t){let r=function(e,t){let r=t||cS,n=new Map,a=new Map,o={all:function(e){let t=[];if("children"in e){let r=e.children,n=-1;for(;++n0&&d.push({type:"text",value:" "});let e="string"==typeof r?r:r(l,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof n?n:n(l,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let h=o[o.length-1];if(h&&"element"===h.type&&"p"===h.tagName){let e=h.children[h.children.length-1];e&&"text"===e.type?e.value+=" ":h.children.push({type:"text",value:" "}),h.children.push(...d)}else o.push(...d);let m={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(o,!0)};e.patch(a,m),s.push(m)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...cd(i),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(r),o=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return a&&o.children.push({type:"text",value:"\n"},a),o}function cT(e,t){return e&&"run"in e?async function(r,n){let a=cI(r,{file:n,...t});await e.run(a,n)}:function(r,n){return cI(r,{file:n,...e||t})}}function cA(e){if(e)throw e}var cR=r(19566);function cL(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let cz=require("node:path"),cO=require("node:process");function cF(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let cq=require("node:url"),cB=["history","path","basename","stem","extname","dirname"];class c_{constructor(e){let t,r;t=e?cF(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":cO.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++nt.length;i&&t.push(n);try{o=e.apply(this,t)}catch(e){if(i&&r)throw e;return n(e)}i||(o&&o.then&&"function"==typeof o.then?o.then(a,n):o instanceof Error?n(o):a(o))};function n(e,...a){r||(r=!0,t(e,...a))}function a(e){n(null,e)}})(s,a)(...i):n(null,...i)}(null,...t)},use:function(r){if("function"!=typeof r)throw TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),t}};return t}()}copy(){let e=new cG,t=-1;for(;++t0){let[n,...o]=t,i=r[a][1];cL(i)&&cL(n)&&(n=cR(!0,i,n)),r[a]=[e,n,...o]}}}}let cK=new cG().freeze();function cY(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function cJ(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function cX(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function cZ(e){if(!cL(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function cQ(e,t,r){if(!r)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function c0(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new c_(e)}let c1=[],c2={allowDangerousHtml:!0},c3=/^(https?|ircs?|mailto|xmpp)$/i,c4=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function c5(e){let t=function(e){let t=e.rehypePlugins||c1,r=e.remarkPlugins||c1,n=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...c2}:c2;return cK().use(ct).use(r).use(cT,n).use(t)}(e),r=function(e){let t=e.children||"",r=new c_;return"string"==typeof t&&(r.value=t),r}(e);return function(e,t){let r=t.allowedElements,n=t.allowElement,a=t.components,o=t.disallowedElements,i=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||c6;for(let e of c4)Object.hasOwn(t,e.from)&&(e.from,e.to&&e.to,e.id);return cy(e,function(e,t,a){if("raw"===e.type&&a&&"number"==typeof t)return i?a.children.splice(t,1):a.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in sB)if(Object.hasOwn(sB,t)&&Object.hasOwn(e.properties,t)){let r=e.properties[t],n=sB[t];(null===n||n.includes(e.tagName))&&(e.properties[t]=c(String(r||""),t,e))}}if("element"===e.type){let i=r?!r.includes(e.tagName):!!o&&o.includes(e.tagName);if(!i&&n&&"number"==typeof t&&(i=!n(e,t,a)),i&&a&&"number"==typeof t)return l&&e.children?a.children.splice(t,1,...e.children):a.children.splice(t,1),t}}),function(e,t){var r,n,a,o,i;let s;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let l=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=l,n=t.jsxDEV,s=function(e,t,a,o){let i=Array.isArray(a.children),s=sb(e);return n(t,a,o,i,{columnNumber:s?s.column-1:void 0,fileName:r,lineNumber:s?s.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");a=0,o=t.jsx,i=t.jsxs,s=function(e,t,r,n){let a=Array.isArray(r.children)?i:o;return n?a(t,r,n):a(t,r)}}let c={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:l,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?sd:su,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},u=sA(c,e,void 0);return u&&"string"!=typeof u?u:c.create(e,c.Fragment,{children:u||void 0},void 0)}(e,{Fragment:s.Fragment,components:a,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0})}(t.runSync(t.parse(r),r),e)}function c6(e){let t=e.indexOf(":"),r=e.indexOf("?"),n=e.indexOf("#"),a=e.indexOf("/");return -1===t||-1!==a&&t>a||-1!==r&&t>r||-1!==n&&t>n||c3.test(e.slice(0,t))?e:""}function c8({content:e,className:t}){return(0,s.jsx)("div",{className:(0,h.cn)("prose prose-sm dark:prose-invert max-w-none",t),children:(0,s.jsx)(c5,{components:{h1:({children:e})=>(0,s.jsx)("h1",{className:"text-xl font-bold mb-2 mt-4",children:e}),h2:({children:e})=>(0,s.jsx)("h2",{className:"text-lg font-semibold mb-2 mt-3",children:e}),h3:({children:e})=>(0,s.jsx)("h3",{className:"text-base font-semibold mb-1 mt-2",children:e}),h4:({children:e})=>(0,s.jsx)("h4",{className:"text-sm font-semibold mb-1 mt-2",children:e}),p:({children:e})=>(0,s.jsx)("p",{className:"mb-2 last:mb-0",children:e}),ul:({children:e})=>(0,s.jsx)("ul",{className:"list-disc pl-5 mb-2 space-y-0.5",children:e}),ol:({children:e})=>(0,s.jsx)("ol",{className:"list-decimal pl-5 mb-2 space-y-0.5",children:e}),li:({children:e})=>(0,s.jsx)("li",{className:"text-sm",children:e}),code:({className:e,children:t,...r})=>/language-(\w+)/.exec(e||"")?(0,s.jsx)("pre",{className:"p-3 rounded-md bg-muted overflow-x-auto mb-2",children:(0,s.jsx)("code",{className:"font-mono text-xs",children:t})}):(0,s.jsx)("code",{className:"px-1.5 py-0.5 rounded bg-muted font-mono text-xs",...r,children:t}),blockquote:({children:e})=>(0,s.jsx)("blockquote",{className:"border-l-2 border-muted-foreground/30 pl-3 py-0.5 mb-2 italic text-muted-foreground",children:e}),a:({href:e,children:t})=>(0,s.jsx)("a",{href:e,className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",children:t}),strong:({children:e})=>(0,s.jsx)("strong",{className:"font-semibold",children:e}),em:({children:e})=>(0,s.jsx)("em",{className:"italic",children:e}),hr:()=>(0,s.jsx)("hr",{className:"my-3 border-muted"}),table:({children:e})=>(0,s.jsx)("div",{className:"overflow-x-auto mb-2",children:(0,s.jsx)("table",{className:"min-w-full divide-y divide-muted",children:e})}),thead:({children:e})=>(0,s.jsx)("thead",{className:"bg-muted/30",children:e}),tbody:({children:e})=>(0,s.jsx)("tbody",{className:"divide-y divide-muted",children:e}),tr:({children:e})=>(0,s.jsx)("tr",{children:e}),th:({children:e})=>(0,s.jsx)("th",{className:"px-2 py-1 text-left text-xs font-medium",children:e}),td:({children:e})=>(0,s.jsx)("td",{className:"px-2 py-1 text-xs",children:e})},children:e})})}let c9={shell:(0,s.jsx)(tJ,{className:"h-3 w-3 text-blue-500"}),json_patch:(0,s.jsx)(x,{className:"h-3 w-3 text-orange-500"}),evaluation:(0,s.jsx)(iB.A,{className:"h-3 w-3 text-orange-500"}),complete_task:(0,s.jsx)(iB.A,{className:"h-3 w-3 text-green-500"})},c7={pending:(0,s.jsx)(nq.A,{className:"h-3 w-3 animate-spin text-gray-400"}),executing:(0,s.jsx)(nq.A,{className:"h-3 w-3 animate-spin text-blue-500"}),completed:(0,s.jsx)(iB.A,{className:"h-3 w-3 text-green-500"}),failed:(0,s.jsx)(i_.A,{className:"h-3 w-3 text-red-500"})};function ue({content:e,toolCalls:t=[],toolMessages:r,checkpointId:n,onRestore:a,onRetry:o,isSavedCheckpoint:i,isExecuting:l=!1,className:c,cost:d,usage:p}){let[f,g]=u().useState(new Set),[v,x]=u().useState(!1),{shouldShowCosts:y}=a4(),b=!!(e&&""!==e.trim()),w=e=>{let t=new Set(f);t.has(e)?t.delete(e):t.add(e),g(t)},k=n&&(a||o)&&!l?(0,s.jsxs)("div",{className:"pt-2 flex flex-wrap items-center gap-2","data-tour-id":"checkpoint-actions",children:[(0,s.jsx)(rO.E,{variant:i?"default":"outline",className:"h-6 px-2 text-xs",children:i?"Saved version":"Checkpoint"}),a&&(0,s.jsxs)(m.$,{size:"sm",variant:"ghost",onClick:()=>a(n),className:"h-7 text-xs","data-tour-id":"checkpoint-restore-button",children:[(0,s.jsx)(aQ,{className:"h-3 w-3 mr-1"}),"Restore"]}),o&&(0,s.jsxs)(m.$,{size:"sm",variant:"ghost",onClick:()=>o(n),className:"h-7 text-xs","data-tour-id":"checkpoint-retry-button",children:[(0,s.jsx)(i$,{className:"h-3 w-3 mr-1"}),"Retry"]})]}):null;return r&&r.length>0?(0,s.jsxs)("div",{className:(0,h.cn)("space-y-2",c),children:[b&&(0,s.jsx)("div",{className:"text-sm text-foreground/90",children:(0,s.jsx)(c8,{content:e??""})}),y&&(void 0!==d||p)&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[void 0!==d&&(0,s.jsxs)(rO.E,{variant:"secondary",className:"text-xs cursor-pointer",onClick:()=>x(!v),children:[(0,s.jsx)(S,{className:"h-3 w-3 mr-1"}),np.U.formatCost(d)]}),p&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(rO.E,{variant:"outline",className:"text-xs",children:[(0,s.jsx)(iU.A,{className:"h-3 w-3 mr-1"}),p.totalTokens.toLocaleString()," tokens"]}),p.provider&&(0,s.jsxs)(rO.E,{variant:"outline",className:"text-xs",children:[p.provider,p.model&&` / ${p.model.split("/").pop()}`]})]}),v&&p&&(0,s.jsxs)("div",{className:"w-full mt-2 p-2 bg-muted/30 rounded text-xs space-y-1",children:[(0,s.jsxs)("div",{children:["Input: ",p.promptTokens.toLocaleString()," tokens"]}),(0,s.jsxs)("div",{children:["Output: ",p.completionTokens.toLocaleString()," tokens"]}),(0,s.jsxs)("div",{children:["Total: ",p.totalTokens.toLocaleString()," tokens"]}),void 0!==d&&(0,s.jsxs)("div",{className:"font-medium",children:["Cost: ",np.U.formatCost(d)]})]})]}),r.map(e=>"message"===e.type?(0,s.jsx)("div",{className:"text-sm text-foreground/90 bg-muted/20 px-3 py-2 rounded",children:(0,s.jsx)(c8,{content:e.content||""})},e.id):"divider"===e.type?(0,s.jsxs)("div",{className:"flex items-center gap-2 my-2",children:[(0,s.jsx)("div",{className:"flex-1 h-px bg-border"}),(0,s.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground whitespace-nowrap",children:e.title||"Section"}),(0,s.jsx)("div",{className:"flex-1 h-px bg-border"})]},e.id):(0,s.jsxs)("div",{className:(0,h.cn)("bg-muted/30 rounded-md transition-all",f.has(e.id)?"p-2":"p-1.5"),children:[(0,s.jsxs)("button",{onClick:()=>w(e.id),className:"flex items-center gap-2 w-full text-left hover:bg-muted/50 rounded px-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:["evaluation"===e.name?e.parameters?.goal_achieved?(0,s.jsx)(iB.A,{className:"h-3 w-3 text-green-500"}):(0,s.jsx)(i_.A,{className:"h-3 w-3 text-red-500"}):e.name&&c9[""===e.name&&e.parameters?.tool||e.name]||(0,s.jsx)(tJ,{className:"h-3 w-3"}),(0,s.jsx)("span",{className:"text-xs font-mono",children:"shell"===e.name&&e.parameters?.cmd?.[0]?e.parameters.cmd[0]:""===e.name&&e.parameters?.tool||e.name})]}),"shell"===e.name&&e.parameters?.cmd?(0,s.jsx)("code",{className:"text-xs text-muted-foreground",children:(()=>{let t=e.parameters.cmd;if(Array.isArray(t)){let e=t.slice(1).join(" ");return e.substring(0,50)+(e.length>50?"...":"")}return"string"==typeof t?t.substring(0,50)+(t.length>50?"...":""):JSON.stringify(t).substring(0,50)})()}):(e.parameters?.path||e.parameters?.file_path)&&(0,s.jsx)("code",{className:"text-xs text-muted-foreground",children:e.parameters.path||e.parameters.file_path}),(0,s.jsx)("div",{className:"ml-auto",children:c7[e.status||"completed"]})]}),"complete_task"===e.name&&e.parameters?.summary&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-green-600 dark:text-green-400",children:e.parameters.summary})}),""===e.name&&e.parameters?.description&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:e.parameters.description})}),"evaluation"===e.name&&e.parameters&&(0,s.jsxs)("div",{className:"px-2 py-1 mt-1 space-y-2",children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:e.parameters.reasoning}),(0,s.jsxs)("div",{className:"flex items-center gap-3 text-xs",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[e.parameters.goal_achieved?(0,s.jsx)(iB.A,{className:"h-3 w-3 text-green-500"}):(0,s.jsx)(i_.A,{className:"h-3 w-3 text-red-500"}),(0,s.jsx)("span",{className:e.parameters.goal_achieved?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400",children:e.parameters.goal_achieved?"Goal achieved":"Goal not achieved"})]}),!e.parameters.should_continue&&(0,s.jsxs)("div",{className:"flex items-center gap-1 text-muted-foreground",children:[(0,s.jsx)("span",{children:"•"}),(0,s.jsx)("span",{children:"Stopping"})]})]})]}),e.result?.error&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsxs)("span",{className:"text-xs text-red-500",children:["Error: ",e.result.error]})}),"shell"===e.name&&e.result?.success===!1&&e.result?.stderr&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-red-500",children:e.result.stderr})}),f.has(e.id)&&(0,s.jsxs)("div",{className:"mt-2 pl-5 space-y-1 text-xs",children:[e.parameters&&Object.keys(e.parameters).length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Parameters:"}),(0,s.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded overflow-x-auto",children:JSON.stringify(e.parameters,null,2)})]}),e.result&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Result:"}),(0,s.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded overflow-x-auto max-h-32",children:"string"==typeof e.result?e.result:JSON.stringify(e.result,null,2)})]})]})]},e.id)),k]}):(0,s.jsxs)("div",{className:(0,h.cn)("space-y-2",c),children:[b&&(0,s.jsx)("div",{className:"text-sm text-foreground/90",children:(0,s.jsx)(c8,{content:e??""})}),y&&(void 0!==d||p)&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-2",children:[void 0!==d&&(0,s.jsxs)(rO.E,{variant:"secondary",className:"text-xs cursor-pointer",onClick:()=>x(!v),children:[(0,s.jsx)(S,{className:"h-3 w-3 mr-1"}),np.U.formatCost(d)]}),p&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(rO.E,{variant:"outline",className:"text-xs",children:[(0,s.jsx)(iU.A,{className:"h-3 w-3 mr-1"}),p.totalTokens.toLocaleString()," tokens"]}),p.provider&&(0,s.jsxs)(rO.E,{variant:"outline",className:"text-xs",children:[p.provider,p.model&&` / ${p.model.split("/").pop()}`]})]}),v&&p&&(0,s.jsxs)("div",{className:"w-full mt-2 p-2 bg-muted/30 rounded text-xs space-y-1",children:[(0,s.jsxs)("div",{children:["Input: ",p.promptTokens.toLocaleString()," tokens"]}),(0,s.jsxs)("div",{children:["Output: ",p.completionTokens.toLocaleString()," tokens"]}),(0,s.jsxs)("div",{children:["Total: ",p.totalTokens.toLocaleString()," tokens"]}),void 0!==d&&(0,s.jsxs)("div",{className:"font-medium",children:["Cost: ",np.U.formatCost(d)]})]})]}),t.length>0&&(0,s.jsx)("div",{className:"space-y-1",children:t.map((e,t)=>(0,s.jsxs)("div",{className:(0,h.cn)("bg-muted/30 rounded-md transition-all",f.has(String(t))?"p-2":"p-1.5"),children:[(0,s.jsxs)("button",{onClick:()=>w(String(t)),className:"flex items-center gap-2 w-full text-left hover:bg-muted/50 rounded px-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:["evaluation"===e.name?e.parameters?.goal_achieved?(0,s.jsx)(iB.A,{className:"h-3 w-3 text-green-500"}):(0,s.jsx)(i_.A,{className:"h-3 w-3 text-red-500"}):e.name&&c9[""===e.name&&e.parameters?.tool||e.name]||(0,s.jsx)(tJ,{className:"h-3 w-3"}),(0,s.jsx)("span",{className:"text-xs font-mono",children:"shell"===e.name&&e.parameters?.cmd?.[0]?e.parameters.cmd[0]:""===e.name&&e.parameters?.tool||e.name})]}),"shell"===e.name&&e.parameters?.cmd?(0,s.jsx)("code",{className:"text-xs text-muted-foreground",children:(()=>{let t=e.parameters.cmd;if(Array.isArray(t)){let e=t.slice(1).join(" ");return e.substring(0,50)+(e.length>50?"...":"")}return"string"==typeof t?t.substring(0,50)+(t.length>50?"...":""):JSON.stringify(t).substring(0,50)})()}):(e.parameters?.path||e.parameters?.file_path)&&(0,s.jsx)("code",{className:"text-xs text-muted-foreground",children:e.parameters.path||e.parameters.file_path}),(0,s.jsx)("div",{className:"ml-auto",children:c7[e.status||"completed"]})]}),"complete_task"===e.name&&e.parameters?.summary&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-green-600 dark:text-green-400",children:e.parameters.summary})}),""===e.name&&e.parameters?.description&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:e.parameters.description})}),e.result?.error&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsxs)("span",{className:"text-xs text-red-500",children:["Error: ",e.result.error]})}),"shell"===e.name&&e.result?.success===!1&&e.result?.stderr&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-red-500",children:e.result.stderr})}),f.has(String(t))&&(0,s.jsxs)("div",{className:"mt-2 pl-5 space-y-1 text-xs",children:[e.parameters&&Object.keys(e.parameters).length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Parameters:"}),(0,s.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded overflow-x-auto",children:JSON.stringify(e.parameters,null,2)})]}),e.result&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Result:"}),(0,s.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded overflow-x-auto max-h-32",children:"string"==typeof e.result?e.result:JSON.stringify(e.result,null,2)})]})]})]},t))}),k]})}var ut=r(97815);function ur({project:e,onBack:t}){let[r,n]=(0,l.useState)(0),[a,o]=(0,l.useState)(""),[i,c]=(0,l.useState)(!1),[u,d]=(0,l.useState)(null),[f,v]=(0,l.useState)([]),[x,y]=(0,l.useState)("preview"),[b,w]=(0,l.useState)(!1),[j,N]=(0,l.useState)(!1),[C,S]=(0,l.useState)(e.lastSavedAt??null),[E,P]=(0,l.useState)(null),M=(0,l.useRef)(null),I=(0,l.useRef)(null),A=(0,l.useRef)(0),R=(0,l.useCallback)(()=>{try{let e=globalThis?.crypto;if(e&&"function"==typeof e.randomUUID)return e.randomUUID()}catch{}let e=`${Date.now()}_${A.current}`;return A.current+=1,e},[]),L=(0,l.useCallback)(e=>{if(null!=I.current&&I.current>=0&&I.current{let e=[ea,ei,el,eu].filter(Boolean).length;if(4===e)return{assistant:25,files:15,editor:35,preview:25};if(3===e){if(!ea)return{assistant:0,files:20,editor:40,preview:40};if(!ei)return{assistant:30,files:0,editor:40,preview:30};if(!el)return{assistant:33,files:20,editor:0,preview:47};if(!eu)return{assistant:30,files:20,editor:50,preview:0}}else if(2===e)return{assistant:50,files:50,editor:50,preview:50};return{assistant:100,files:100,editor:100,preview:100}})(),eh=e=>{if(!e)return"Select Model";let t=e.split("/");return t[t.length-1].split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")},em=(0,l.useCallback)((e,t=1200)=>{if(!e)return"";if(e.length<=t)return e;let r=Math.max(0,Math.floor(.6*t)),n=Math.max(0,Math.floor(.3*t)),a=e.slice(0,r),o=n>0?e.slice(-n):"";return`${a} +Choose OK to REPLACE all current data, or Cancel to MERGE with existing data.`);await nf.importAllData(t,{mode:r?"replace":"merge",onProgress:(e,t)=>{b(e),k(t)}}),tV.oR.success("Data imported successfully!"),setTimeout(()=>window.location.reload(),1e3)}catch(e){tV.oR.error(e instanceof Error?e.message:"Import failed")}finally{x(!1),b(0),k("")}},e.click()},disabled:v,className:"flex items-center gap-2",children:[(0,s.jsx)(r$,{className:"h-4 w-4"}),v?"Importing...":"Import"]})]}),v&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex justify-between text-xs",children:[(0,s.jsx)("span",{children:w}),(0,s.jsxs)("span",{children:[y,"%"]})]}),(0,s.jsx)("div",{className:"w-full bg-muted rounded-full h-2",children:(0,s.jsx)("div",{className:"bg-primary h-2 rounded-full transition-all duration-300",style:{width:`${y}%`}})})]})]})]})]})]}),(0,s.jsxs)("div",{className:"flex justify-between pt-4 px-3 border-t mt-4",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(m.$,{variant:"destructive",onClick:()=>{confirm("Are you sure you want to clear all settings?")&&(r3.s.clearSettings(),r({}),tV.oR.success("Settings cleared"))},children:"Clear All Settings"}),(0,s.jsxs)(m.$,{variant:"outline",onClick:()=>p(!0),children:[(0,s.jsx)(rH,{className:"mr-2 h-4 w-4"}),"About DeepStudio"]})]}),e&&(0,s.jsx)(m.$,{onClick:e,children:"Close"})]}),(0,s.jsx)(rq,{open:d,onOpenChange:p})]})}let nA=[{id:"welcome",title:"Welcome to DeepStudio",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"Let's take a guided tour of the workspace so you can see how projects, agents, and saves all fit together."}),(0,s.jsx)("p",{children:"The tour takes under two minutes and you can skip at any time."})]}),location:"project-manager",primaryLabel:"Start tour",secondaryLabel:"Skip"},{id:"projects-overview",title:"Projects at a Glance",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"This is your project gallery. Recent work appears here with quick actions for opening, duplicating, or exporting."}),(0,s.jsx)("p",{children:"I've loaded a demo project so you can explore without setting anything up."})]}),location:"project-manager",target:'[data-tour-id="projects-list"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"create-project",title:"Creating a Project",body:(0,s.jsx)("div",{className:"space-y-2 text-sm text-muted-foreground",children:(0,s.jsx)("p",{children:"Use the New Project button to start fresh. The dialog lets you name the project and add an optional description."})}),location:"project-manager",target:'[data-tour-id="new-project-button"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"project-controls",title:"Exporting a Project",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"Click the dropdown menu on any project card to access export options. You can export as a ZIP for deployment or JSON for backup."}),(0,s.jsx)("p",{children:"Projects can also be duplicated or deleted from this menu."})]}),location:"project-manager",target:'[data-tour-id="project-export-json"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"edit-project",title:"Editing a Project",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"To get to the workspace and start editing, simply click on the project card. This will open the full development environment."}),(0,s.jsx)("p",{children:"Click Next to enter the workspace and continue the tour."})]}),location:"project-manager",target:'[data-tour-id="project-card"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"workspace-overview",title:"Workspace Layout",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"The workspace has four main areas: the assistant conversation, the virtual file explorer, your editor tabs, and the live preview."}),(0,s.jsx)("p",{children:"The VFS works like a project file tree—add HTML, CSS, JS, or assets and the agent can edit them just like local files."})]}),location:"workspace",target:'[data-tour-id="workspace-panels"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"workspace-edit",title:"See the Agent in Action",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:'I\'ll request the agent to change the color of "Our Services" button to a green accent and the agent performs the task.'}),(0,s.jsx)("p",{children:"This mimics what you will see when asking the agent to perform tasks."})]}),location:"workspace",target:'[data-tour-id="assistant-panel"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"workspace-focus",title:"Element Focus Tool",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"The crosshair tool in the preview panel lets you select and focus on specific elements in your design."}),(0,s.jsx)("p",{children:"Click it to activate element selection mode, then click any element in the preview to highlight it."})]}),location:"workspace",target:'[data-tour-id="focus-crosshair-button"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"workspace-checkpoint",title:"Checkpoints & Manual Saves",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:'The "Discard Changes" button restores to the original saved point, letting you revert any changes back to your last manual save.'}),(0,s.jsx)("p",{children:"If you like the result, use the Save button to lock it in as your manual checkpoint."})]}),location:"workspace",target:'[data-tour-id="discard-changes-button"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"clear-conversation",title:"Clear Conversation",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"The agent will have the last tasks and responses in memory. You can clear it with the trashcan button to start fresh."}),(0,s.jsx)("p",{children:"This removes the conversation history but keeps your project files intact."})]}),location:"workspace",target:'[data-tour-id="clear-chat-button"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"provider-settings",title:"Connect Your Provider",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsxs)("p",{children:["Set your API key under Settings → Provider. I recommend trying OpenRouter with the ",(0,s.jsx)("code",{children:"gpt-oss-120b"})," model, but you can use any supported provider."]}),(0,s.jsx)("p",{children:"You can return here anytime from the header menu."}),(0,s.jsx)("p",{className:"text-xs text-orange-500/90",children:"Privacy note: Remote LLM providers (OpenAI, Anthropic, etc.) will receive your code when generating. For complete privacy, use local models with Ollama or LM Studio."})]}),location:"workspace",target:'[data-tour-id="provider-settings-trigger"]',showBack:!0,primaryLabel:"Next",secondaryLabel:"Skip"},{id:"wrap-up",title:"You're Ready!",body:(0,s.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,s.jsx)("p",{children:"That's the basics—prompt the agent, preview updates, and save when you're happy. You can replay this tour from the Help menu anytime."}),(0,s.jsx)("p",{children:"Have fun building! Let me know what you ship."})]}),location:"workspace",showBack:!0,primaryLabel:"Finish",secondaryLabel:"Skip"}];var nR=r(25495),nL=r(94742);let nz=(0,l.createContext)(null);function nO({children:e}){let[t,r]=(0,l.useState)("idle"),[n,a]=(0,l.useState)(0),[i,o]=(0,l.useState)(0),[c,u]=(0,l.useState)([]),[d,p]=(0,l.useState)(!1),[h,m]=(0,l.useState)([]),[f,g]=(0,l.useState)(null),[v,x]=(0,l.useState)({projectId:null,preCheckpointId:null,postCheckpointId:null,originalCss:null,updatedCss:null}),y=(0,l.useRef)(v),b=(0,l.useRef)(null),w=(0,l.useRef)(null),k=(0,l.useRef)(null),j=(0,l.useRef)(null),N=(0,l.useRef)(null),C=(0,l.useRef)(null),S=(0,l.useMemo)(()=>(function(e){if(!(e<0)&&!(e>=nA.length))return nA[e]})(n),[n]),E=(0,l.useCallback)(()=>{x({projectId:null,preCheckpointId:null,postCheckpointId:null,originalCss:null,updatedCss:null}),b.current=null,w.current=null,k.current=null,j.current=null},[]),D=(0,l.useCallback)(()=>{"running"!==t&&(r("running"),a(0),o(e=>e+1),u([]),E())},[E,t]),M=(0,l.useCallback)(e=>{C.current=e},[]),P=(0,l.useCallback)((e="finish")=>{let t=y.current;t.projectId&&t.preCheckpointId&&t.postCheckpointId&&r0.$.runWithSuppressedDirty(t.projectId,async()=>{await nL.Y.restoreCheckpoint(t.preCheckpointId)}).then(()=>{}).catch(e=>{console.error("[GuidedTour] Failed to restore baseline during cleanup",e)}),E(),u([]),a(0),o(e=>e+1),r("finish"===e?"completed":"idle"),r3.s.setHasSeenTour(!0),N.current?.abort(),C.current=null},[E]),T=(0,l.useCallback)(()=>{P("skip")},[P]),I=(0,l.useCallback)(()=>{a(e=>{let t=e+1;return t>=nA.length?(P(),e):(o(e=>e+1),t)})},[P]),A=(0,l.useCallback)(()=>{a(e=>{let t=Math.max(0,e-1);return t!==e&&o(e=>e+1),t})},[]),R=(0,l.useMemo)(()=>({state:{status:t,stepIndex:n,stepKey:i,currentStep:S,transcript:c,isBusy:d,projectList:h},start:D,skip:T,next:I,previous:A,setProjectList:e=>{m(e)},setActiveProjectId:g,setTranscript:u,setWorkspaceHandler:M}),[t,n,i,S,c,d,h,D,T,I,A,M]);return(0,s.jsx)(nz.Provider,{value:R,children:e})}function nF(){let e=(0,l.useContext)(nz);if(!e)throw Error("useGuidedTour must be used within a GuidedTourProvider");return e}var n_=r(41862);function nq({location:e}){let{state:t,next:r,previous:n,skip:a}=nF(),{status:i,currentStep:o,stepKey:c,isBusy:u,stepIndex:d}=t,[p,h]=(0,l.useState)(null),f=nA.length,g=(0,l.useMemo)(()=>!!o&&!!u&&("workspace-edit"===o.id||"workspace-focus"===o.id||"workspace-checkpoint"===o.id),[o,u]);if("running"!==i||!o||o.location!==e)return null;let v=o.primaryLabel??"Next",x=o.secondaryLabel??"Skip";return(0,s.jsxs)("div",{className:"fixed inset-0 z-[2000] pointer-events-auto",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-background/30"}),p&&(0,s.jsx)("div",{className:"pointer-events-none fixed rounded-xl border-2 border-primary ring-4 ring-primary/30 transition-all animate-ring-opacity",style:{top:p.top,left:p.left,width:p.width,height:p.height}}),(0,s.jsx)("div",{className:"absolute bottom-10 left-1/2 flex w-full max-w-xl -translate-x-1/2 flex-col gap-4 px-4",children:(0,s.jsxs)("div",{className:"pointer-events-auto rounded-2xl border bg-background/95 p-6 shadow-2xl",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-foreground",children:o.title}),(0,s.jsxs)("span",{className:"text-sm text-muted-foreground font-medium",children:[d+1,"/",f]})]}),(0,s.jsx)("div",{className:"mt-2 text-sm leading-relaxed text-muted-foreground",children:o.body})]}),u&&(0,s.jsx)(n_.A,{className:"h-5 w-5 animate-spin text-primary"})]}),(0,s.jsxs)("div",{className:"mt-6 flex items-center justify-between",children:[o.showBack?(0,s.jsx)(m.$,{variant:"ghost",onClick:n,disabled:u,children:"Back"}):(0,s.jsx)("div",{}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(m.$,{variant:"ghost",onClick:a,children:x}),(0,s.jsx)(m.$,{onClick:r,disabled:g,children:v})]})]})]})})]})}function nB({onProjectSelect:e,bannerRef:t}){(0,d.useRouter)();let[r,n]=(0,l.useState)([]),[a,i]=(0,l.useState)(!0),[o,c]=(0,l.useState)(""),[u,v]=(0,l.useState)(!1),[x,y]=(0,l.useState)(""),[b,w]=(0,l.useState)(""),[k,j]=(0,l.useState)("blank"),[C,S]=(0,l.useState)("updated"),[E,D]=(0,l.useState)("grid"),[M,P]=(0,l.useState)(null),[T,I]=(0,l.useState)(!1),{state:A,setProjectList:R,start:L}=nF(),z=A.currentStep?.id,O="running"===A.status,[F,_]=(0,l.useState)(!1),[q,B]=(0,l.useState)(null),$=(0,l.useRef)(!1);(0,l.useRef)(!1),(0,l.useCallback)(async()=>{if(!$.current){$.current=!0,i(!0);try{await p.OP.init();let e=(await p.OP.listProjects()).sort((e,t)=>t.updatedAt.getTime()-e.updatedAt.getTime());n(e),R(e)}catch(e){h.v.error("Failed to load projects:",e),tV.oR.error("Failed to load projects")}finally{i(!1),_(!0),$.current=!1}}},[R]);let U=(0,l.useCallback)(async()=>{try{await p.OP.init();let e=(await p.OP.listProjects()).sort((e,t)=>t.updatedAt.getTime()-e.updatedAt.getTime());n(e),R(e)}catch(e){h.v.error("Failed to reload projects:",e),tV.oR.error("Failed to reload projects")}},[R]),H=async()=>{if(!x.trim())return void tV.oR.error("Please enter a project name");if(x.length>50)return void tV.oR.error("Project name must be 50 characters or less");if(b.length>200)return void tV.oR.error("Description must be 200 characters or less");try{let t=await p.OP.createProject(x.trim().slice(0,50),b.trim().slice(0,200)||void 0);"demo"===k?await r1(p.OP,t.id,rZ,rZ.assets):await r1(p.OP,t.id,rQ),tV.oR.success("Project created successfully"),v(!1),y(""),w(""),j("blank"),await U(),e(t)}catch(e){h.v.error("Failed to create project:",e),tV.oR.error("Failed to create project")}},V=async e=>{if(confirm(`Are you sure you want to delete "${e.name}"? This cannot be undone.`))try{await p.OP.deleteProject(e.id),tV.oR.success("Project deleted"),await U()}catch(e){h.v.error("Failed to delete project:",e),tV.oR.error("Failed to delete project")}},W=async t=>{try{let r=await p.OP.duplicateProject(t.id);tV.oR.success("Project duplicated successfully"),await U(),e(r)}catch(e){h.v.error("Failed to duplicate project:",e),tV.oR.error("Failed to duplicate project")}},G=async e=>{try{let t=await p.OP.exportProject(e.id),r=JSON.stringify(t,null,2),n=new Blob([r],{type:"application/json"}),a=URL.createObjectURL(n),i=document.createElement("a");i.href=a,i.download=`${e.name.replace(/\s+/g,"-")}-export.json`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(a),tV.oR.success("Project exported")}catch(e){h.v.error("Failed to export project:",e),tV.oR.error("Failed to export project")}},K=async e=>{try{let t=await p.OP.exportProjectAsZip(e.id),r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download=`${e.name.replace(/\s+/g,"-")}.zip`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r),tV.oR.success("Project exported as ZIP")}catch(e){h.v.error("Failed to export project as ZIP:",e),tV.oR.error("Failed to export project as ZIP")}},Y=((e,t)=>{let r=[...e];switch(t){case"updated":return r.sort((e,t)=>t.updatedAt.getTime()-e.updatedAt.getTime());case"created":return r.sort((e,t)=>t.createdAt.getTime()-e.createdAt.getTime());case"name":return r.sort((e,t)=>e.name.localeCompare(t.name));case"size":return r.sort((e,t)=>t.updatedAt.getTime()-e.updatedAt.getTime());default:return r}})(r.filter(e=>e.name.toLowerCase().includes(o.toLowerCase())||e.description?.toLowerCase().includes(o.toLowerCase())),C);if(a&&!F)return(0,s.jsx)("div",{className:"flex items-center justify-center h-screen",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto"}),(0,s.jsx)("p",{className:"mt-4",children:"Loading projects..."})]})});let J=[{id:"new-project",label:"New Project",icon:rB,onClick:()=>t.current?.bounce(),content:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>t.current?.bounce(),"data-tour-id":"new-project-button",className:"justify-start",children:[(0,s.jsx)(rB,{className:"mr-2 h-4 w-4"}),"New Project"]})},{id:"import",label:"Import",icon:r$,onClick:()=>t.current?.bounce(),variant:"outline"}],X=(0,s.jsxs)(r2.AM,{children:[(0,s.jsx)(r2.Wv,{asChild:!0,children:(0,s.jsx)(m.$,{variant:"outline",size:"icon",className:"h-8 w-8",children:(0,s.jsx)(rU,{className:"h-4 w-4"})})}),(0,s.jsx)(r2.hl,{className:"w-96",align:"end",children:(0,s.jsx)(nI,{})})]}),Z=(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)(r2.AM,{children:[(0,s.jsx)(r2.Wv,{asChild:!0,children:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",className:"w-full justify-start",children:[(0,s.jsx)(rU,{className:"mr-2 h-4 w-4"}),"Settings"]})}),(0,s.jsx)(r2.hl,{className:"w-[calc(100vw-2rem)]",align:"start",children:(0,s.jsx)(nI,{})})]}),(0,s.jsx)("div",{className:"border-t my-2"}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>t.current?.bounce(),className:"w-full justify-start","data-tour-id":"footer-guided-tour",children:[(0,s.jsx)(rH,{className:"mr-2 h-4 w-4"}),"Guided Tour"]}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>t.current?.bounce(),className:"w-full justify-start",children:[(0,s.jsx)(rV,{className:"mr-2 h-4 w-4"}),"Model Tester"]}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>t.current?.bounce(),className:"w-full justify-start",children:[(0,s.jsx)(rH,{className:"mr-2 h-4 w-4"}),"About DeepStudio"]}),(0,s.jsx)(m.$,{variant:"outline",size:"sm",asChild:!0,className:"w-full justify-start",children:(0,s.jsxs)("a",{href:"https://huggingface.co/spaces/otst/osw-studio",target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)(rF,{className:"mr-2 h-4 w-4"}),"OSW Studio"]})})]});return(0,s.jsxs)("div",{className:"flex flex-col h-[100dvh]",style:{background:"linear-gradient(var(--project-background-tint), var(--project-background-tint)), var(--background)"},children:[(0,s.jsx)(rJ.j,{onLogoClick:()=>I(!0),actions:J,mobileMenuContent:Z,desktopOnlyContent:X,leftText:"DeepStudio"}),(0,s.jsx)("main",{className:"flex-1 min-h-0 overflow-auto",children:(0,s.jsxs)("div",{className:"container mx-auto p-6 max-w-6xl",children:[(0,s.jsx)("div",{className:"mb-6 space-y-4",children:(0,s.jsxs)("div",{className:"flex flex-col md:flex-row gap-4","data-tour-id":"projects-actions",children:[(0,s.jsxs)("div",{className:"relative flex-1",children:[(0,s.jsx)(rW.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),(0,s.jsx)(f.p,{placeholder:"Search projects...",value:o,onChange:e=>c(e.target.value),className:"pl-10 bg-card"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)(t2.l6,{value:C,onValueChange:e=>S(e),children:[(0,s.jsxs)(t2.bq,{className:"flex-1 md:w-[180px] bg-card",children:[(0,s.jsx)(rG,{className:"h-4 w-4 mr-2"}),(0,s.jsx)(t2.yv,{placeholder:"Sort by..."})]}),(0,s.jsxs)(t2.gC,{children:[(0,s.jsx)(t2.eb,{value:"updated",children:"Last Updated"}),(0,s.jsx)(t2.eb,{value:"created",children:"Date Created"}),(0,s.jsx)(t2.eb,{value:"name",children:"Name"})]})]}),(0,s.jsxs)("div",{className:"flex gap-0.5 border rounded-sm p-1 bg-card h-9",children:[(0,s.jsx)(m.$,{size:"icon",variant:"grid"===E?"default":"ghost",className:"h-full w-8 rounded-sm",onClick:()=>D("grid"),children:(0,s.jsx)(rK,{className:"h-4 w-4"})}),(0,s.jsx)(m.$,{size:"icon",variant:"list"===E?"default":"ghost",className:"h-full w-8 rounded-sm",onClick:()=>D("list"),children:(0,s.jsx)(rY,{className:"h-4 w-4"})})]})]})]})}),0===Y.length?(0,s.jsxs)("div",{className:"text-center py-12",children:[(0,s.jsx)(N,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,s.jsx)("h2",{className:"text-xl font-semibold mb-2",children:o?"No projects found":"No projects yet"}),(0,s.jsx)("p",{className:"text-muted-foreground mb-6",children:o?"Try a different search term":"Create your first project to get started"}),!o&&(0,s.jsxs)("div",{className:"flex gap-3 justify-center",children:[(0,s.jsxs)(m.$,{onClick:()=>t.current?.bounce(),children:[(0,s.jsx)(rB,{className:"mr-2 h-4 w-4"}),"Create Project"]}),(0,s.jsxs)(m.$,{variant:"outline",onClick:()=>t.current?.bounce(),children:[(0,s.jsx)(N,{className:"mr-2 h-4 w-4"}),"Create Demo Project"]})]})]}):(0,s.jsx)("div",{className:"grid"===E?"grid gap-4 md:grid-cols-2 lg:grid-cols-3":"space-y-3","data-tour-id":"projects-list",children:Y.map(t=>"object"==typeof t&&t.id&&t.name?(0,s.jsx)(tW,{project:t,onSelect:e,onDelete:V,onExport:G,onExportZip:K,onDuplicate:W,onPreview:P,onUpdate:e=>{n(r.map(t=>t.id===e.id?e:t))},viewMode:E,forceMenuOpen:q===t.id,highlightExport:O&&"project-controls"===z&&q===t.id},t.id):(h.v.error("Invalid project object:",t),null))})]})}),(0,s.jsx)("footer",{className:"hidden md:block border-t bg-card/50 py-3 px-6",children:(0,s.jsxs)("div",{className:"flex justify-center gap-2",children:[(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>t.current?.bounce(),"data-tour-id":"footer-guided-tour",children:[(0,s.jsx)(rH,{className:"mr-2 h-4 w-4"}),"Guided Tour"]}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>t.current?.bounce(),children:[(0,s.jsx)(rV,{className:"mr-2 h-4 w-4"}),"Model Tester"]}),(0,s.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>t.current?.bounce(),children:[(0,s.jsx)(rH,{className:"mr-2 h-4 w-4"}),"About DeepStudio"]}),(0,s.jsx)(m.$,{variant:"outline",size:"sm",asChild:!0,children:(0,s.jsxs)("a",{href:"https://huggingface.co/spaces/otst/osw-studio",target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsx)(rF,{className:"mr-2 h-4 w-4"}),"OSW Studio"]})})]})}),(0,s.jsx)(rD,{open:u,onOpenChange:v,children:(0,s.jsxs)(rT,{children:[(0,s.jsxs)(rI,{children:[(0,s.jsx)(rR,{children:"Create New Project"}),(0,s.jsx)(rL,{children:"Start a new multipage website project"})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(rX.J,{htmlFor:"name",children:"Project Name"}),(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:[x.length,"/50"]})]}),(0,s.jsx)(f.p,{id:"name",value:x,onChange:e=>y(e.target.value.slice(0,50)),placeholder:"My Awesome Website",className:"mt-2",maxLength:50})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(rX.J,{htmlFor:"template",children:"Template"}),(0,s.jsxs)(t2.l6,{value:k,onValueChange:e=>j(e),children:[(0,s.jsx)(t2.bq,{id:"template",className:"mt-2",children:(0,s.jsx)(t2.yv,{placeholder:"Select a template"})}),(0,s.jsxs)(t2.gC,{children:[(0,s.jsx)(t2.eb,{value:"blank",children:"Blank (HTML/CSS/JS starter)"}),(0,s.jsx)(t2.eb,{value:"demo",children:"Demo (multi-page example)"})]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(rX.J,{htmlFor:"description",children:"Description (optional)"}),(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:[b.length,"/200"]})]}),(0,s.jsx)(g,{id:"description",value:b,onChange:e=>w(e.target.value.slice(0,200)),placeholder:"A brief description of your project",className:"mt-2 resize-none",rows:3,maxLength:200})]})]}),(0,s.jsxs)(rA,{children:[(0,s.jsx)(m.$,{variant:"outline",onClick:()=>v(!1),children:"Cancel"}),(0,s.jsx)(m.$,{onClick:H,children:"Create Project"})]})]})}),M&&(0,s.jsx)(rD,{open:!!M,onOpenChange:()=>P(null),children:(0,s.jsxs)(rT,{className:"max-w-[90vw] sm:max-w-[85vw] lg:max-w-[80vw] 2xl:max-w-[1400px] max-h-[90vh] w-full h-full p-0 flex flex-col",children:[(0,s.jsx)(rI,{className:"p-4 border-b",children:(0,s.jsxs)(rR,{children:["Preview: ",M.name]})}),(0,s.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,s.jsx)(t4,{projectId:M.id})})]})}),(0,s.jsx)(rq,{open:T,onOpenChange:I}),(0,s.jsx)(nq,{location:"project-manager"})]})}var n$=r(24923);let nU=(0,v.A)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]),nH=(0,v.A)("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]),nV=(0,v.A)("file",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]),nW=(0,v.A)("folder-tree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);var nG="ContextMenu",[nK,nY]=(0,J.A)(nG,[eF]),nJ=eF(),[nX,nZ]=nK(nG),nQ=e=>{let{__scopeContextMenu:t,children:r,onOpenChange:n,dir:a,modal:i=!0}=e,[o,c]=l.useState(!1),u=nJ(t),d=(0,el.c)(n),p=l.useCallback(e=>{c(e),d(e)},[d]);return(0,s.jsx)(nX,{scope:t,open:o,onOpenChange:p,modal:i,children:(0,s.jsx)(eV,{...u,dir:a,open:o,onOpenChange:p,modal:i,children:r})})};nQ.displayName=nG;var n0="ContextMenuTrigger",n1=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,disabled:n=!1,...a}=e,i=nZ(n0,r),o=nJ(r),c=l.useRef({x:0,y:0}),u=l.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...c.current})}),d=l.useRef(0),p=l.useCallback(()=>window.clearTimeout(d.current),[]),h=e=>{c.current={x:e.clientX,y:e.clientY},i.onOpenChange(!0)};return l.useEffect(()=>p,[p]),l.useEffect(()=>void(n&&p()),[n,p]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eW,{...o,virtualRef:u}),(0,s.jsx)(Z.sG.span,{"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,...a,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:n?e.onContextMenu:(0,K.mK)(e.onContextMenu,e=>{p(),h(e),e.preventDefault()}),onPointerDown:n?e.onPointerDown:(0,K.mK)(e.onPointerDown,aa(e=>{p(),d.current=window.setTimeout(()=>h(e),700)})),onPointerMove:n?e.onPointerMove:(0,K.mK)(e.onPointerMove,aa(p)),onPointerCancel:n?e.onPointerCancel:(0,K.mK)(e.onPointerCancel,aa(p)),onPointerUp:n?e.onPointerUp:(0,K.mK)(e.onPointerUp,aa(p))})]})});n1.displayName=n0;var n2=e=>{let{__scopeContextMenu:t,...r}=e,n=nJ(t);return(0,s.jsx)(eJ,{...n,...r})};n2.displayName="ContextMenuPortal";var n3="ContextMenuContent",n4=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nZ(n3,r),i=nJ(r),o=l.useRef(!1);return(0,s.jsx)(e0,{...i,...n,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||a.modal||(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});n4.displayName=n3,l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nJ(r);return(0,s.jsx)(e5,{...a,...n,ref:t})}).displayName="ContextMenuGroup";var n5=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nJ(r);return(0,s.jsx)(e6,{...a,...n,ref:t})});n5.displayName="ContextMenuLabel";var n6=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nJ(r);return(0,s.jsx)(e7,{...a,...n,ref:t})});n6.displayName="ContextMenuItem";var n8=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nJ(r);return(0,s.jsx)(tt,{...a,...n,ref:t})});n8.displayName="ContextMenuCheckboxItem",l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nJ(r);return(0,s.jsx)(ti,{...a,...n,ref:t})}).displayName="ContextMenuRadioGroup";var n9=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nJ(r);return(0,s.jsx)(ts,{...a,...n,ref:t})});n9.displayName="ContextMenuRadioItem";var n7=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nJ(r);return(0,s.jsx)(td,{...a,...n,ref:t})});n7.displayName="ContextMenuItemIndicator";var ae=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nJ(r);return(0,s.jsx)(tp,{...a,...n,ref:t})});ae.displayName="ContextMenuSeparator",l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nJ(r);return(0,s.jsx)(th,{...a,...n,ref:t})}).displayName="ContextMenuArrow";var at="ContextMenuSub",ar=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nJ(r);return(0,s.jsx)(ty,{...a,...n,ref:t})});ar.displayName="ContextMenuSubTrigger";var an=l.forwardRef((e,t)=>{let{__scopeContextMenu:r,...n}=e,a=nJ(r);return(0,s.jsx)(tw,{...a,...n,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});function aa(e){return t=>"mouse"!==t.pointerType?e(t):void 0}an.displayName="ContextMenuSubContent";let ai=(0,v.A)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);l.forwardRef(({className:e,inset:t,children:r,...n},a)=>(0,s.jsxs)(ar,{ref:a,className:(0,h.cn)("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...n,children:[r,(0,s.jsx)(tJ,{className:"ml-auto h-4 w-4"})]})).displayName=ar.displayName,l.forwardRef(({className:e,...t},r)=>(0,s.jsx)(an,{ref:r,className:(0,h.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})).displayName=an.displayName;let ao=l.forwardRef(({className:e,...t},r)=>(0,s.jsx)(n2,{children:(0,s.jsx)(n4,{ref:r,className:(0,h.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));ao.displayName=n4.displayName;let as=l.forwardRef(({className:e,inset:t,...r},n)=>(0,s.jsx)(n6,{ref:n,className:(0,h.cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));function al({projectId:e,onFileSelect:t,selectedPath:r,onClose:n}){let[a,i]=(0,l.useState)([]),[o,c]=(0,l.useState)([]),[u,d]=(0,l.useState)(new Set(["/"])),[g,v]=(0,l.useState)(null),[x,y]=(0,l.useState)(""),[w,j]=(0,l.useState)(!1),[C,S]=(0,l.useState)(null),[E,D]=(0,l.useState)(null),M=(0,l.useRef)(null),P=(0,l.useCallback)(async()=>{try{await p.OP.init();let t=await p.OP.getAllFilesAndDirectories(e),r=t.filter(e=>"directory"!==e.type);i(r),c(T(t))}catch(e){h.v.error("Failed to load files:",e)}},[e]),T=e=>{let t=[],r=new Map;e.forEach(e=>{if("directory"===e.type){let t=e.path.split("/").filter(Boolean),n={path:e.path,name:e.name||t[t.length-1]||"unnamed",type:"directory",children:[]};r.set(e.path,n)}}),e.forEach(e=>{if("directory"!==e.type){let t=e.path.split("/").filter(Boolean),n="";for(let e=0;e{let a=n.split("/").filter(Boolean);if(1===a.length)t.push(e);else{let t="/"+a.slice(0,-1).join("/"),n=r.get(t);n&&n.children&&n.children.push(e)}}),e.forEach(e=>{if("directory"!==e.type){let n=e.path.split("/").filter(Boolean),a={path:e.path,name:e.name,type:"file"};if(1===n.length)t.push(a);else{let e="/"+n.slice(0,-1).join("/"),t=r.get(e);t&&t.children?.push(a)}}});let n=e=>{e.sort((e,t)=>e.type===t.type?e.name.localeCompare(t.name):"directory"===e.type?-1:1),e.forEach(e=>{e.children&&n(e.children)})};return n(t),t},I=e=>{d(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},A=async e=>{if("directory"===e.type)I(e.path);else{let r=a.find(t=>t.path===e.path);r&&t&&t(r)}},R=async(t="/")=>{let r=prompt("Enter file name:");if(!r)return;let n="/"===t?`/${r}`:`${t}/${r}`;try{await p.OP.createFile(e,n,""),await P()}catch(e){h.v.error("Failed to create file:",e)}},L=async(t="/")=>{let r=prompt("Enter directory name:");if(!r)return;let n="/"===t?`/${r}`:`${t}/${r}`;try{await p.OP.createDirectory(e,n),await P()}catch(e){h.v.error("Failed to create directory:",e)}},z=async(t,r)=>{if(confirm(`Delete ${r} "${t}"?`))try{"file"===r?await p.OP.deleteFile(e,t):await p.OP.deleteDirectory(e,t),await P()}catch(e){h.v.error(`Failed to delete ${r}:`,e)}},O=async(t,r)=>{if(!x)return;let n=t.split("/");n[n.length-1]=x;let a=n.join("/");try{"directory"===r?await p.OP.renameDirectory(e,t,a):await p.OP.renameFile(e,t,a),await P(),v(null),y("")}catch(e){h.v.error(`Failed to rename ${r}:`,e)}},F=async e=>{for(let t of(e.preventDefault(),e.stopPropagation(),j(!1),Array.from(e.dataTransfer.items)))if("file"===t.kind){let e=t.getAsFile();e&&await _(e,"/")}},_=async(t,r)=>{if(!(0,n$.fu)(t.name))return void tV.oR.error(`File type not supported: ${t.name}`);let n=(0,n$.Gr)(t.name),a=n$.Q6[n];if(t.size>a)return void tV.oR.error(`File too large: ${t.name}. Maximum size is ${Math.round(a/1024/1024)}MB`);let i="/"===r?`/${t.name}`:`${r}/${t.name}`;try{let r;r="image"===n||"video"===n||"binary"===n?await t.arrayBuffer():await t.text(),await p.OP.createFile(e,i,r),await P(),tV.oR.success(`Uploaded ${t.name}`)}catch(n){if(n.message?.includes("already exists")){if(confirm(`File "${t.name}" already exists. Overwrite?`))try{await p.OP.deleteFile(e,i),await _(t,r)}catch(e){h.v.error("Failed to overwrite file:",e),tV.oR.error("Failed to overwrite file")}}else h.v.error("Failed to upload file:",n),tV.oR.error(`Failed to upload ${t.name}: ${n.message}`)}},q=(e,t)=>{e.stopPropagation(),S(t),e.dataTransfer.effectAllowed="move"},B=()=>{S(null),D(null)},$=(e,t)=>{e.preventDefault(),e.stopPropagation(),C&&t!==C.path&&(e.dataTransfer.dropEffect="move",D(t))},U=async(t,r)=>{if(t.preventDefault(),t.stopPropagation(),!C||r&&C.path===r.path)return void D(null);let n=r&&"directory"===r.type?r.path:"/";if("directory"===C.type){let e=C.path.endsWith("/")?C.path:C.path+"/";if((n.endsWith("/")?n:n+"/").startsWith(e)){tV.oR.error("Cannot move a folder into itself"),D(null);return}}let a=C.name,i="/"===n?`/${a}`:`${n}/${a}`;try{"directory"===C.type?await p.OP.moveDirectory(e,C.path,i):await p.OP.moveFile(e,C.path,i),await P(),tV.oR.success(`Moved ${C.name} to ${"/"===n?"root":n}`)}catch(e){h.v.error("Failed to move item:",e),tV.oR.error(`Failed to move: ${e.message}`)}D(null)},H=(e,t=0)=>{let n=u.has(e.path),a=r===e.path,i=g===e.path,o=E===e.path;return(0,s.jsxs)("div",{draggable:!i,onDragStart:t=>q(t,e),onDragEnd:B,onDragOver:t=>"directory"===e.type&&$(t,e.path),onDrop:t=>"directory"===e.type&&U(t,e),children:[(0,s.jsxs)(nQ,{children:[(0,s.jsx)(n1,{children:(0,s.jsxs)("div",{className:(0,h.cn)("flex items-center gap-2 px-2 py-1.5 hover:bg-accent hover:text-accent-foreground cursor-pointer rounded-md transition-colors",a&&"bg-accent text-accent-foreground",o&&"directory"===e.type&&"bg-blue-500/20 border border-blue-500",C?.path===e.path&&"opacity-50","group"),style:{paddingLeft:`${16*t+8}px`},onClick:()=>A(e),children:["directory"===e.type?(0,s.jsxs)(s.Fragment,{children:[n?(0,s.jsx)(nc.A,{className:"w-4 h-4 text-muted-foreground"}):(0,s.jsx)(tJ,{className:"w-4 h-4 text-muted-foreground"}),n?(0,s.jsx)(N,{className:"w-4 h-4 text-blue-500"}):(0,s.jsx)(nU,{className:"w-4 h-4 text-blue-500"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"w-4"}),(()=>{let t=(0,n$.Gr)(e.path);return"image"===t?(0,s.jsx)(b,{className:"w-4 h-4 text-green-500"}):"video"===t?(0,s.jsx)(nH,{className:"w-4 h-4 text-purple-500"}):(0,s.jsx)(nV,{className:"w-4 h-4 text-muted-foreground"})})()]}),i?(0,s.jsx)(f.p,{value:x,onChange:e=>y(e.target.value),onBlur:()=>O(e.path,e.type),onKeyDown:t=>{"Enter"===t.key?O(e.path,e.type):"Escape"===t.key&&(v(null),y(""))},className:"h-5 text-sm",autoFocus:!0,onClick:e=>e.stopPropagation()}):(0,s.jsx)("span",{className:"text-sm flex-1",children:e.name})]})}),(0,s.jsxs)(ao,{children:["directory"===e.type&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(as,{onClick:()=>R(e.path),children:[(0,s.jsx)(nV,{className:"mr-2 h-4 w-4"}),"New File"]}),(0,s.jsxs)(as,{onClick:()=>L(e.path),children:[(0,s.jsx)(nU,{className:"mr-2 h-4 w-4"}),"New Folder"]}),(0,s.jsxs)(as,{onClick:()=>M.current?.click(),children:[(0,s.jsx)(r$,{className:"mr-2 h-4 w-4"}),"Upload Files"]})]}),(0,s.jsx)(as,{onClick:()=>{v(e.path),y(e.name)},children:"Rename"}),(0,s.jsx)(as,{onClick:()=>z(e.path,e.type),className:"text-destructive",children:"Delete"})]})]}),"directory"===e.type&&n&&e.children&&(0,s.jsx)("div",{children:e.children.map(e=>H(e,t+1))})]},e.path)};return(0,s.jsxs)("div",{className:"h-full flex flex-col",onDrop:F,onDragOver:e=>{e.preventDefault(),e.stopPropagation(),j(!0)},onDragLeave:e=>{e.preventDefault(),e.stopPropagation();let t=e.currentTarget.getBoundingClientRect(),r=e.clientX,n=e.clientY;(r=t.right||n=t.bottom)&&j(!1)},children:[(0,s.jsx)("input",{ref:M,type:"file",multiple:!0,className:"hidden",onChange:async e=>{for(let t of Array.from(e.target.files||[]))await _(t,"/");M.current&&(M.current.value="")}}),(0,s.jsxs)("div",{className:"p-3 border-b bg-muted/70 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(nW,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-files-active)"}}),n?(0,s.jsxs)("button",{type:"button",onClick:n,"aria-label":"Hide file explorer",className:"relative hidden h-6 w-6 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-destructive md:flex group",children:[(0,s.jsx)(nW,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-files-active)"}}),(0,s.jsx)(k.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}):(0,s.jsx)(nW,{className:"hidden h-4 w-4 md:inline-flex",style:{color:"var(--button-files-active)"}}),(0,s.jsx)("h3",{className:"text-sm font-medium",children:"File Explorer"})]}),(0,s.jsxs)("div",{className:"flex gap-1",children:[(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>M.current?.click(),title:"Upload files",children:(0,s.jsx)(r$,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>R("/"),title:"New file",children:(0,s.jsx)(nV,{className:"h-3 w-3"})}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-5 w-5",onClick:()=>L("/"),title:"New folder",children:(0,s.jsx)(nU,{className:"h-3 w-3"})})]})]}),(0,s.jsxs)(nQ,{children:[(0,s.jsx)(n1,{asChild:!0,children:(0,s.jsxs)("div",{className:(0,h.cn)("flex-1 overflow-y-auto p-3 space-y-0.5 relative",w&&"bg-blue-500/10"),onDragOver:e=>{C&&(e.preventDefault(),e.stopPropagation(),D("/"))},onDrop:e=>{C&&U(e,null)},children:[w&&(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:(0,s.jsxs)("div",{className:"bg-blue-500/20 border-2 border-dashed border-blue-500 rounded-lg p-8",children:[(0,s.jsx)(r$,{className:"h-12 w-12 text-blue-500 mx-auto mb-2"}),(0,s.jsx)("p",{className:"text-sm text-blue-600",children:"Drop files here to upload"})]})}),0===o.length?(0,s.jsx)("div",{className:"flex-1 flex items-center justify-center py-8",children:(0,s.jsxs)("div",{className:"text-center space-y-3",children:[(0,s.jsx)(nU,{className:"h-12 w-12 mx-auto opacity-50 text-muted-foreground"}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("p",{className:"text-base font-medium text-foreground",children:"No files yet"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Create your first file to get started"})]})]})}):(0,s.jsx)("div",{className:"contents",children:o.map(e=>H(e))})]})}),(0,s.jsxs)(ao,{children:[(0,s.jsxs)(as,{onClick:()=>R("/"),children:[(0,s.jsx)(nV,{className:"mr-2 h-4 w-4"}),"New File"]}),(0,s.jsxs)(as,{onClick:()=>L("/"),children:[(0,s.jsx)(nU,{className:"mr-2 h-4 w-4"}),"New Folder"]}),(0,s.jsxs)(as,{onClick:()=>M.current?.click(),children:[(0,s.jsx)(r$,{className:"mr-2 h-4 w-4"}),"Upload Files"]})]})]})]})}function ac(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}as.displayName=n6.displayName,l.forwardRef(({className:e,children:t,checked:r,...n},a)=>(0,s.jsxs)(n8,{ref:a,className:(0,h.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(n7,{children:(0,s.jsx)(w.A,{className:"h-4 w-4"})})}),t]})).displayName=n8.displayName,l.forwardRef(({className:e,children:t,...r},n)=>(0,s.jsxs)(n9,{ref:n,className:(0,h.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(n7,{children:(0,s.jsx)(ai,{className:"h-2 w-2 fill-current"})})}),t]})).displayName=n9.displayName,l.forwardRef(({className:e,inset:t,...r},n)=>(0,s.jsx)(n5,{ref:n,className:(0,h.cn)("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...r})).displayName=n5.displayName,l.forwardRef(({className:e,...t},r)=>(0,s.jsx)(ae,{ref:r,className:(0,h.cn)("-mx-1 my-1 h-px bg-border",e),...t})).displayName=ae.displayName;function au(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=e.length?e.apply(this,a):function(){for(var e=arguments.length,n=Array(e),i=0;i=e.length?e.apply(this,a):function(){for(var e=arguments.length,n=Array(e),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};av.initial(e),av.handler(t);var r={current:e},n=ah(ab)(r,t),a=ah(ay)(r),i=ah(av.changes)(e),o=ah(ax)(r);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return av.selector(e),e(r.current)},function(e){(function(){for(var e=arguments.length,t=Array(e),r=0;r{n.current=!1}:e,t)};function aB(){}function a$(e,t,r,n){var a,i,o,s,l,c;return a=e,i=n,a.editor.getModel(aU(a,i))||(o=e,s=t,l=r,c=n,o.editor.createModel(s,l,c?aU(o,c):void 0))}function aU(e,t){return e.Uri.parse(t)}(0,l.memo)(function({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:a,originalModelPath:i,modifiedModelPath:o,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:c=!1,theme:u="light",loading:d="Loading...",options:p={},height:h="100%",width:m="100%",className:f,wrapperProps:g={},beforeMount:v=aB,onMount:x=aB}){let[y,b]=(0,l.useState)(!1),[w,k]=(0,l.useState)(!0),j=(0,l.useRef)(null),N=(0,l.useRef)(null),C=(0,l.useRef)(null),S=(0,l.useRef)(x),E=(0,l.useRef)(v),D=(0,l.useRef)(!1);a_(()=>{let e=aR.init();return e.then(e=>(N.current=e)&&k(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>{let t;return j.current?(t=j.current?.getModel(),void(s||t?.original?.dispose(),c||t?.modified?.dispose(),j.current?.dispose())):e.cancel()}}),aq(()=>{if(j.current&&N.current){let t=j.current.getOriginalEditor(),a=a$(N.current,e||"",n||r||"text",i||"");a!==t.getModel()&&t.setModel(a)}},[i],y),aq(()=>{if(j.current&&N.current){let e=j.current.getModifiedEditor(),n=a$(N.current,t||"",a||r||"text",o||"");n!==e.getModel()&&e.setModel(n)}},[o],y),aq(()=>{let e=j.current.getModifiedEditor();e.getOption(N.current.editor.EditorOption.readOnly)?e.setValue(t||""):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[t],y),aq(()=>{j.current?.getModel()?.original.setValue(e||"")},[e],y),aq(()=>{let{original:e,modified:t}=j.current.getModel();N.current.editor.setModelLanguage(e,n||r||"text"),N.current.editor.setModelLanguage(t,a||r||"text")},[r,n,a],y),aq(()=>{N.current?.editor.setTheme(u)},[u],y),aq(()=>{j.current?.updateOptions(p)},[p],y);let M=(0,l.useCallback)(()=>{if(!N.current)return;E.current(N.current);let s=a$(N.current,e||"",n||r||"text",i||""),l=a$(N.current,t||"",a||r||"text",o||"");j.current?.setModel({original:s,modified:l})},[r,t,a,e,n,i,o]),P=(0,l.useCallback)(()=>{!D.current&&C.current&&(j.current=N.current.editor.createDiffEditor(C.current,{automaticLayout:!0,...p}),M(),N.current?.editor.setTheme(u),b(!0),D.current=!0)},[p,u,M]);return(0,l.useEffect)(()=>{y&&S.current(j.current,N.current)},[y]),(0,l.useEffect)(()=>{w||y||P()},[w,y,P]),l.createElement(aF,{width:m,height:h,isEditorReady:y,loading:d,_ref:C,className:f,wrapperProps:g})});var aH=function(e){let t=(0,l.useRef)();return(0,l.useEffect)(()=>{t.current=e},[e]),t.current},aV=new Map,aW=(0,l.memo)(function({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:a,path:i,theme:o="light",line:s,loading:c="Loading...",options:u={},overrideServices:d={},saveViewState:p=!0,keepCurrentModel:h=!1,width:m="100%",height:f="100%",className:g,wrapperProps:v={},beforeMount:x=aB,onMount:y=aB,onChange:b,onValidate:w=aB}){let[k,j]=(0,l.useState)(!1),[N,C]=(0,l.useState)(!0),S=(0,l.useRef)(null),E=(0,l.useRef)(null),D=(0,l.useRef)(null),M=(0,l.useRef)(y),P=(0,l.useRef)(x),T=(0,l.useRef)(),I=(0,l.useRef)(n),A=aH(i),R=(0,l.useRef)(!1),L=(0,l.useRef)(!1);a_(()=>{let e=aR.init();return e.then(e=>(S.current=e)&&C(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>E.current?void(T.current?.dispose(),h?p&&aV.set(i,E.current.saveViewState()):E.current.getModel()?.dispose(),E.current.dispose()):e.cancel()}),aq(()=>{let o=a$(S.current,e||n||"",t||a||"",i||r||"");o!==E.current?.getModel()&&(p&&aV.set(A,E.current?.saveViewState()),E.current?.setModel(o),p&&E.current?.restoreViewState(aV.get(i)))},[i],k),aq(()=>{E.current?.updateOptions(u)},[u],k),aq(()=>{E.current&&void 0!==n&&(E.current.getOption(S.current.editor.EditorOption.readOnly)?E.current.setValue(n):n!==E.current.getValue()&&(L.current=!0,E.current.executeEdits("",[{range:E.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),E.current.pushUndoStop(),L.current=!1))},[n],k),aq(()=>{let e=E.current?.getModel();e&&a&&S.current?.editor.setModelLanguage(e,a)},[a],k),aq(()=>{void 0!==s&&E.current?.revealLine(s)},[s],k),aq(()=>{S.current?.editor.setTheme(o)},[o],k);let z=(0,l.useCallback)(()=>{if(!(!D.current||!S.current)&&!R.current){P.current(S.current);let l=i||r,c=a$(S.current,n||e||"",t||a||"",l||"");E.current=S.current?.editor.create(D.current,{model:c,automaticLayout:!0,...u},d),p&&E.current.restoreViewState(aV.get(l)),S.current.editor.setTheme(o),void 0!==s&&E.current.revealLine(s),j(!0),R.current=!0}},[e,t,r,n,a,i,u,d,p,o,s]);return(0,l.useEffect)(()=>{k&&M.current(E.current,S.current)},[k]),(0,l.useEffect)(()=>{N||k||z()},[N,k,z]),I.current=n,(0,l.useEffect)(()=>{k&&b&&(T.current?.dispose(),T.current=E.current?.onDidChangeModelContent(e=>{L.current||b(E.current.getValue(),e)}))},[k,b]),(0,l.useEffect)(()=>{if(k){let e=S.current.editor.onDidChangeMarkers(e=>{let t=E.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=S.current.editor.getModelMarkers({resource:t});w?.(e)}});return()=>{e?.dispose()}}return()=>{}},[k,w]),l.createElement(aF,{width:m,height:f,isEditorReady:k,loading:c,_ref:D,className:g,wrapperProps:v})});let aG=(0,v.A)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]),aK=(0,v.A)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var aY=r(93613);function aJ({projectId:e,onFilesChange:t,onClose:r}){let[n,a]=(0,l.useState)(new Map),[i,o]=(0,l.useState)(null),{resolvedTheme:c}=(0,ns.D)(),[u,d]=(0,l.useState)(!1),f=(e,t)=>{t&&t.stopPropagation();let r=n.get(e);if((!r?.modified||confirm(`Close ${r.file.name} without saving?`))&&(a(t=>{let r=new Map(t);return r.delete(e),r}),i===e)){let t=Array.from(n.keys()).filter(t=>t!==e);o(t.length>0?t[t.length-1]:null)}},g=(0,l.useCallback)((e,t)=>{void 0!==e&&"text"===y(t).type&&a(r=>{let n=new Map(r),a=n.get(t);return a&&n.set(t,{...a,content:e,modified:a.file.content!==e}),n})},[]),v=(0,l.useCallback)(async t=>{let r=n.get(t);if(r&&r.modified)try{await p.OP.init();let n=await p.OP.updateFile(e,t,r.content);a(e=>{let a=new Map(e);return a.set(t,{file:n,content:r.content,modified:!1}),a}),window.dispatchEvent(new CustomEvent("fileContentChanged",{detail:{path:t,projectId:e}}))}catch(e){h.v.error("Failed to save file:",e)}},[n,e]);(0,l.useCallback)(e=>{(e.metaKey||e.ctrlKey)&&"s"===e.key&&(e.preventDefault(),i&&v(i))},[i,v]);let y=e=>{let t=e.split(".").pop()?.toLowerCase();if(["png","jpg","jpeg","gif","bmp","svg","webp"].includes(t||""))return{type:"image",language:"plaintext"};let r={js:"javascript",mjs:"javascript",ts:"typescript",tsx:"typescript",html:"html",htm:"html",css:"css",json:"json",md:"markdown",txt:"plaintext",xml:"xml",yaml:"yaml",yml:"yaml"};return r[t||""]?{type:"text",language:r[t||""]}:["zip","tar","gz","exe","bin","pdf","doc","docx","xls","xlsx","ppt","pptx"].includes(t||"")?{type:"unsupported",language:"plaintext"}:{type:"text",language:"plaintext"}},w=e=>y(e).language,j=i?n.get(i):null;return(0,s.jsxs)("div",{className:"h-full flex flex-col",children:[(0,s.jsxs)("div",{className:"p-3 border-b bg-muted/70 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(aG,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-editor-active)"}}),r?(0,s.jsxs)("button",{type:"button",onClick:r,"aria-label":"Hide code editor",className:"relative hidden h-6 w-6 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-destructive md:flex group",children:[(0,s.jsx)(aG,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-editor-active)"}}),(0,s.jsx)(k.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}):(0,s.jsx)(aG,{className:"hidden h-4 w-4 md:inline-flex",style:{color:"var(--button-editor-active)"}}),(0,s.jsx)("h3",{className:"text-sm font-medium",children:"Code Editor"})]}),j?.modified&&"text"===y(j.file.path).type&&(0,s.jsxs)(m.$,{size:"sm",variant:"ghost",className:"h-5 px-2 gap-1.5",onClick:()=>v(i),children:[(0,s.jsx)(aK,{className:"h-3 w-3"}),(0,s.jsx)("span",{className:"text-xs",children:"Save"})]})]}),0===n.size?(0,s.jsx)("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:(0,s.jsxs)("div",{className:"text-center space-y-3",children:[(0,s.jsx)(x,{className:"h-12 w-12 mx-auto opacity-50"}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("p",{className:"text-base font-medium",children:"No files open"}),(0,s.jsx)("p",{className:"text-sm",children:"Select a file from the explorer to edit"})]})]})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"border-b bg-muted/70",children:(0,s.jsx)("div",{className:"flex items-center overflow-x-auto scrollbar-thin",children:Array.from(n.entries()).map(([e,t])=>(0,s.jsxs)("div",{className:(0,h.cn)("flex items-center gap-2 px-4 py-2.5 border-r cursor-pointer transition-all relative group",i===e?"bg-background border-b-2 border-b-primary shadow-sm":"hover:bg-muted/50 border-b-2 border-b-transparent"),onClick:()=>o(e),children:[(0,s.jsxs)("span",{className:"text-sm",children:[t.file.name,t.modified&&(0,s.jsx)("span",{className:"text-orange-500 ml-1",children:"●"})]}),(0,s.jsx)(m.$,{size:"icon",variant:"ghost",className:"h-4 w-4 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:t=>f(e,t),children:(0,s.jsx)(k.A,{className:"h-3 w-3 hover:text-destructive"})})]},e))})}),j&&(0,s.jsx)("div",{className:"flex-1 border-t",children:(()=>{let e=y(j.file.path);return"image"===e.type?(0,s.jsx)("div",{className:"h-full flex items-center justify-center bg-background p-8",children:(0,s.jsxs)("div",{className:"text-center space-y-4 max-w-2xl",children:[(0,s.jsx)(b,{className:"h-12 w-12 mx-auto text-muted-foreground"}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("h3",{className:"text-lg font-medium",children:"Image Preview"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:j.file.name})]}),(0,s.jsx)("div",{className:"border rounded-lg p-4 bg-muted/30 max-h-96 overflow-auto",children:(0,s.jsx)("img",{src:`data:image/${j.file.path.split(".").pop()};base64,${j.content}`,alt:j.file.name,className:"max-w-full h-auto rounded shadow-sm",onError:e=>{let t=e.target;if(t.style.display="none",!t.parentElement?.querySelector(".error-msg")){let e=document.createElement("div");e.className="error-msg text-sm text-muted-foreground flex items-center gap-2",e.innerHTML='Unable to display image',t.parentElement?.appendChild(e)}}})}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Image files cannot be edited in the text editor"})]})}):"unsupported"===e.type?(0,s.jsx)("div",{className:"h-full flex items-center justify-center bg-background p-8",children:(0,s.jsxs)("div",{className:"text-center space-y-4",children:[(0,s.jsx)(aY.A,{className:"h-12 w-12 mx-auto text-muted-foreground"}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("h3",{className:"text-lg font-medium",children:"Unsupported File Type"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:j.file.name}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground max-w-md",children:"This file type is not supported for editing in the text editor. Binary files and certain document formats cannot be displayed here."})]})]})}):(0,s.jsx)(aW,{height:"100%",language:w(j.file.path),value:j.content,onChange:e=>g(e,j.file.path),theme:u?"dark"===c?"vs-dark":"light":"vs-dark",options:{minimap:{enabled:!1},fontSize:14,lineNumbers:"on",roundedSelection:!1,scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,wordWrap:"on",wrappingIndent:"indent"}})})()})]})]})}function aX(e){window.dispatchEvent(new CustomEvent("openFile",{detail:e}))}var aZ=r(28559);let aQ=(0,v.A)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),a0=(0,v.A)("message-square",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]),a1=(0,v.A)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);var a2=r(3589),a3=r(99526);function a4(){let[e,t]=(0,l.useState)(()=>r3.s.getCostSettings()),r=!1!==e.showCosts;return{costSettings:e,shouldShowCosts:r}}var a5=r(10158);class a6{async initDB(){if(!this.isInitialized)return new Promise((e,t)=>{let r=indexedDB.open(this.dbName,1);r.onerror=()=>{h.v.error("Failed to open conversation database"),t(r.error)},r.onsuccess=()=>{this.db=r.result,this.isInitialized=!0,e()},r.onupgradeneeded=e=>{let t=e.target.result;if(!t.objectStoreNames.contains(this.storeName)){let e=t.createObjectStore(this.storeName,{keyPath:"id"});e.createIndex("projectId","projectId",{unique:!1}),e.createIndex("lastUpdated","lastUpdated",{unique:!1})}}})}getConversationId(e){return`conv_${e}`}async loadConversationFromDB(e){if(await this.initDB(),!this.db)return null;let t=this.getConversationId(e);return new Promise((r,n)=>{let a=this.db.transaction([this.storeName],"readonly").objectStore(this.storeName).get(t);a.onsuccess=()=>{let t=a.result;if(t){let n={id:t.id,projectId:t.projectId,messages:t.messages||[],lastUpdated:t.lastUpdated,version:t.version||1};this.conversationBreaks.set(e,t.breaks||[]),r(n)}else r(null)},a.onerror=()=>{h.v.error("Failed to load conversation from DB"),n(a.error)}})}async saveConversationToDB(e){if(await this.initDB(),!this.db)return;let t=this.conversationBreaks.get(e.projectId)||[],r={id:e.id,projectId:e.projectId,messages:e.messages,lastUpdated:e.lastUpdated,version:e.version,breaks:t};return new Promise((e,t)=>{let n=this.db.transaction([this.storeName],"readwrite").objectStore(this.storeName).put(r);n.onsuccess=()=>e(),n.onerror=()=>{h.v.error("Failed to save conversation to DB"),t(n.error)}})}async deleteConversationFromDB(e){if(await this.initDB(),!this.db)return;let t=this.getConversationId(e);return new Promise((e,r)=>{let n=this.db.transaction([this.storeName],"readwrite").objectStore(this.storeName).delete(t);n.onsuccess=()=>e(),n.onerror=()=>{h.v.error("Failed to delete conversation from DB"),r(n.error)}})}async getConversation(e){let t=this.conversations.get(e);if(!t){let r=await this.loadConversationFromDB(e);t=r||{id:this.getConversationId(e),projectId:e,messages:[],lastUpdated:new Date().toISOString(),version:1},this.conversations.set(e,t)}return t}async updateConversation(e,t){let r=await this.getConversation(e);r.messages=[...t],r.lastUpdated=new Date().toISOString(),r.version+=1,this.conversations.set(e,r),await this.saveConversationToDB(r),h.v.debug(`[ConversationState] Updated conversation for project ${e} with ${t.length} messages`)}async clearConversation(e){let t=await this.getConversation(e);await this.recordConversationBreak(e,{type:"clear",timestamp:new Date().toISOString(),description:"User cleared chat"}),t.messages=[],t.lastUpdated=new Date().toISOString(),t.version+=1,this.conversations.set(e,t),await this.saveConversationToDB(t),h.v.debug(`[ConversationState] Cleared conversation for project ${e}`)}async recordConversationBreak(e,t){let r=this.conversationBreaks.get(e)||[];r.push(t),r.length>20&&(r=r.slice(-20)),this.conversationBreaks.set(e,r);let n=this.conversations.get(e);n&&await this.saveConversationToDB(n),h.v.debug(`[ConversationState] Recorded conversation break for project ${e}:`,t.type)}getRecentBreaks(e,t=5){return(this.conversationBreaks.get(e)||[]).slice(-t)}async addBreakContextMessage(e,t){let r,n=await this.getConversation(e);switch(t.type){case"checkpoint_restore":r=`[Context: Project was restored to checkpoint "${t.description||"previous state"}" at ${new Date(t.timestamp).toLocaleTimeString()}]`;break;case"retry":r=`[Context: Retrying previous request after restoring to checkpoint at ${new Date(t.timestamp).toLocaleTimeString()}]`;break;case"page_refresh":r=`[Context: Session resumed after page refresh at ${new Date(t.timestamp).toLocaleTimeString()}]`;break;case"manual_save":r=`[Context: Project saved manually at ${new Date(t.timestamp).toLocaleTimeString()}${t.description?` (${t.description})`:""}]`;break;default:return}let a={role:"system",content:r};n.messages.push(a),await this.updateConversation(e,n.messages)}async getConversationMessages(e,t){let r=await this.getConversation(e);if(!t||r.messages.length<=t)return[...r.messages];let n=[...r.messages],a=n.filter(e=>"system"===e.role),i=n.filter(e=>"system"!==e.role).slice(-(t-a.length));return[...a,...i]}async deleteProject(e){this.conversations.delete(e),this.conversationBreaks.delete(e),await this.deleteConversationFromDB(e),h.v.debug(`[ConversationState] Deleted all conversation data for project ${e}`)}async getConversationStats(e){let t=await this.getConversation(e),r=this.conversationBreaks.get(e)||[];return{messageCount:t.messages.length,lastUpdated:t.lastUpdated,breaks:r.length,version:t.version}}constructor(){this.conversations=new Map,this.conversationBreaks=new Map,this.dbName="DeepStudioConversations",this.storeName="conversations",this.db=null,this.isInitialized=!1}}let a8=new a6;class a9{static convertToOrchestratorMessages(e){let t=[];for(let r of e)if(!r.isTask){if("user"===r.role)t.push({role:"user",content:r.content||""});else if("assistant"===r.role){let e={role:"assistant",content:r.content||""};if(r.toolCalls&&r.toolCalls.length>0&&(e.tool_calls=r.toolCalls),r.toolMessages&&!e.tool_calls){let t=[];for(let e of r.toolMessages)"tool"===e.type&&e.name&&t.push({id:e.id||`tool_${t.length}`,type:"function",function:{name:e.name,arguments:JSON.stringify(e.parameters||{})}});t.length>0&&(e.tool_calls=t)}if((r.checkpointId||r.cost||r.usage||r.toolMessages)&&(e.ui_metadata={},r.checkpointId&&(e.ui_metadata.checkpointId=r.checkpointId),r.cost&&(e.ui_metadata.cost=r.cost),r.usage&&(e.ui_metadata.usage=r.usage),r.toolMessages&&(e.ui_metadata.toolMessages=r.toolMessages)),r.toolMessages){let t=r.toolMessages,n=[];for(let e of t)"message"===e.type&&e.content&&n.push(e.content);if(n.length>0){let t=[e.content,...n].filter(e=>e&&e.trim()).join("\n\n");e.content=t}}if(t.push(e),r.toolMessages){let e=r.toolMessages;for(let r=0;r`${e}_recovered_${r++}`;for(let r=0;r0&&(i.toolCalls=e)}if(!i.toolMessages&&a.tool_calls&&a.tool_calls.length>0){let t=[];for(let i of(a.content&&a.content.trim()&&t.push({id:n("msg"),type:"message",content:a.content}),a.tool_calls)){let a=i.id||n("tool"),o={};if(i.function?.arguments)try{o=JSON.parse(i.function.arguments)}catch{o={arguments:i.function.arguments}}let s=null;for(let t=r+1;t0&&(i.toolMessages=t),i.toolCalls=a.tool_calls}t.push(i)}}}return h.v.debug(`[ConversationConverter] Converted ${e.length} orchestrator messages to ${t.length} UI messages`),t}static truncateConversation(e,t=50){if(e.length<=t)return e;let r=e.filter(e=>"system"===e.role),n=e.filter(e=>"system"!==e.role),a=t-r.length;return a<=0?r:[...r,...n.slice(-a)]}static createContextMessage(e,t){return{role:"system",content:`[Context: ${t}]`}}static prepareConversationForOrchestrator(e,t={}){let r=this.convertToOrchestratorMessages(e);return t.includeSystemPrompt&&t.systemPrompt&&(r.some(e=>"system"===e.role)||r.unshift({role:"system",content:t.systemPrompt})),t.maxMessages&&(r=this.truncateConversation(r,t.maxMessages)),h.v.debug(`[ConversationConverter] Prepared ${r.length} messages for orchestrator`),r}}var a7=r(57462);let ie=(0,v.A)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),it=(0,l.createContext)(null);it.displayName="PanelGroupContext";let ir={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},ia=c["useId".toString()],ii="function"==typeof ia?ia:()=>null,io=0;function is(e=null){let t=ii(),r=(0,l.useRef)(e||t||null);return null===r.current&&(r.current=""+io++),null!=e?e:r.current}function il({children:e,className:t="",collapsedSize:r,collapsible:n,defaultSize:a,forwardedRef:i,id:o,maxSize:s,minSize:c,onCollapse:u,onExpand:d,onResize:p,order:h,style:m,tagName:f="div",...g}){let v=(0,l.useContext)(it);if(null===v)throw Error("Panel components must be rendered within a PanelGroup container");let{collapsePanel:x,expandPanel:y,getPanelSize:b,getPanelStyle:w,groupId:k,isPanelCollapsed:j,reevaluatePanelConstraints:N,registerPanel:C,resizePanel:S,unregisterPanel:E}=v,D=is(o),M=(0,l.useRef)({callbacks:{onCollapse:u,onExpand:d,onResize:p},constraints:{collapsedSize:r,collapsible:n,defaultSize:a,maxSize:s,minSize:c},id:D,idIsFromProps:void 0!==o,order:h});(0,l.useRef)({didLogMissingDefaultSizeWarning:!1}),(0,l.useImperativeHandle)(i,()=>({collapse:()=>{x(M.current)},expand:e=>{y(M.current,e)},getId:()=>D,getSize:()=>b(M.current),isCollapsed:()=>j(M.current),isExpanded:()=>!j(M.current),resize:e=>{S(M.current,e)}}),[x,y,b,j,D,S]);let P=w(M.current,a);return(0,l.createElement)(f,{...g,children:e,className:t,id:D,style:{...P,...m},[ir.groupId]:k,[ir.panel]:"",[ir.panelCollapsible]:n||void 0,[ir.panelId]:D,[ir.panelSize]:parseFloat(""+P.flexGrow).toFixed(1)})}let ic=(0,l.forwardRef)((e,t)=>(0,l.createElement)(il,{...e,forwardedRef:t}));il.displayName="Panel",ic.displayName="forwardRef(Panel)";let iu=null,id=-1,ip=null;function ih(e,t,r){var a,i,o;0;let s=function(e,t,r){let n=(t&iN)!=0,a=(t&iC)!=0,i=(t&iS)!=0,o=(t&iE)!=0;!1;if(t){if(n)if(i)return"se-resize";else if(o)return"ne-resize";else return"e-resize";else if(a)if(i)return"sw-resize";else if(o)return"nw-resize";else return"w-resize";else if(i)return"s-resize";else if(o)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}(e,t,r);if(iu!==s){if(iu=s,null===ip){ip=document.createElement("style");n&&ip.setAttribute("nonce",n),document.head.appendChild(ip)}id>=0&&(null==(o=ip.sheet)||o.removeRule(id)),id=null!=(a=null==(i=ip.sheet)?void 0:i.insertRule(`*{cursor: ${s} !important;}`))?a:-1}}function im(e){return"keydown"===e.type}function ig(e){return e.type.startsWith("pointer")}function iv(e){return e.type.startsWith("mouse")}function ix(e){if(ig(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(iv(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}let iy=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function ib(e){let t=e.length;for(;t--;){let r=e[t];if(i$(r,"Missing node"),function(e){let t=getComputedStyle(e);return!!("fixed"===t.position||"auto"!==t.zIndex&&("static"!==t.position||function(e){var t;let r=getComputedStyle(null!=(t=ij(e))?t:e).display;return"flex"===r||"inline-flex"===r}(e))||1>+t.opacity||"transform"in t&&"none"!==t.transform||"webkitTransform"in t&&"none"!==t.webkitTransform||"mixBlendMode"in t&&"normal"!==t.mixBlendMode||"filter"in t&&"none"!==t.filter||"webkitFilter"in t&&"none"!==t.webkitFilter||"isolation"in t&&"isolate"===t.isolation||iy.test(t.willChange))||"touch"===t.webkitOverflowScrolling}(r))return r}return null}function iw(e){return e&&Number(getComputedStyle(e).zIndex)||0}function ik(e){let t=[];for(;e;)t.push(e),e=ij(e);return t}function ij(e){let{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}let iN=1,iC=2,iS=4,iE=8,iD="coarse"===function(){if("function"==typeof matchMedia)return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}(),iM=[],iP=!1,iT=new Map,iI=new Map,iA=new Set;function iR(e){let{target:t}=e,{x:r,y:n}=ix(e);iP=!0,iF({target:t,x:r,y:n}),iq(),iM.length>0&&(iB("down",e),i_(),e.preventDefault(),iO(t)||e.stopImmediatePropagation())}function iL(e){let{x:t,y:r}=ix(e);if(iP&&0===e.buttons&&(iP=!1,iB("up",e)),!iP){let{target:n}=e;iF({target:n,x:t,y:r})}iB("move",e),i_(),iM.length>0&&e.preventDefault()}function iz(e){let{target:t}=e,{x:r,y:n}=ix(e);iI.clear(),iP=!1,iM.length>0&&(e.preventDefault(),iO(t)||e.stopImmediatePropagation()),iB("up",e),iF({target:t,x:r,y:n}),i_(),iq()}function iO(e){let t=e;for(;t;){if(t.hasAttribute(ir.resizeHandle))return!0;t=t.parentElement}return!1}function iF({target:e,x:t,y:r}){iM.splice(0);let n=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(n=e),iA.forEach(e=>{let{element:a,hitAreaMargins:i}=e,o=a.getBoundingClientRect(),{bottom:s,left:l,right:c,top:u}=o,d=iD?i.coarse:i.fine;if(t>=l-d&&t<=c+d&&r>=u-d&&r<=s+d){if(null!==n&&document.contains(n)&&a!==n&&!a.contains(n)&&!n.contains(a)&&function(e,t){let r;if(e===t)throw Error("Cannot compare node with itself");let n={a:ik(e),b:ik(t)};for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;i$(r,"Stacking order can only be calculated for elements with a common ancestor");let a={a:iw(ib(n.a)),b:iw(ib(n.b))};if(a.a===a.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},a=e.length;for(;a--;){let r=e[a];if(r===t.a)return 1;if(r===t.b)return -1}}return Math.sign(a.a-a.b)}(n,a)>0){let e=n,t=!1;for(;e&&!e.contains(a);){var p,h;if(p=e.getBoundingClientRect(),h=o,p.xh.x&&p.yh.y){t=!0;break}e=e.parentElement}if(t)return}iM.push(e)}})}function i_(){let e=!1,t=!1;iM.forEach(r=>{let{direction:n}=r;"horizontal"===n?e=!0:t=!0});let r=0;iI.forEach(e=>{r|=e}),e&&t?ih("intersection",r,iP):e?ih("horizontal",r,iP):t?ih("vertical",r,iP):null!==ip&&(document.head.removeChild(ip),iu=null,ip=null,id=-1)}function iq(){var e;null==(e=a)||e.abort();let t={capture:!0,signal:(a=new AbortController).signal};iA.size&&(iP?(iM.length>0&&iT.forEach((e,r)=>{let{body:n}=r;e>0&&(n.addEventListener("contextmenu",iz,t),n.addEventListener("pointerleave",iL,t),n.addEventListener("pointermove",iL,t))}),iT.forEach((e,r)=>{let{body:n}=r;n.addEventListener("pointerup",iz,t),n.addEventListener("pointercancel",iz,t)})):iT.forEach((e,r)=>{let{body:n}=r;e>0&&(n.addEventListener("pointerdown",iR,t),n.addEventListener("pointermove",iL,t))}))}function iB(e,t){iA.forEach(r=>{let{setResizeHandlerState:n}=r;n(e,iM.includes(r),t)})}function i$(e,t){if(!e)throw console.error(t),Error(t)}function iU(e,t,r=10){return e.toFixed(r)===t.toFixed(r)?0:e>t?1:-1}function iH(e,t,r=10){return 0===iU(e,t,r)}function iV(e,t,r){return 0===iU(e,t,r)}function iW({panelConstraints:e,panelIndex:t,size:r}){let n=e[t];i$(null!=n,`Panel constraints not found for index ${t}`);let{collapsedSize:a=0,collapsible:i,maxSize:o=100,minSize:s=0}=n;return 0>iU(r,s)&&(r=i&&0>iU(r,(a+s)/2)?a:s),r=parseFloat((r=Math.min(o,r)).toFixed(10))}function iG({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:n,prevLayout:a,trigger:i}){if(iV(e,0))return t;let o=[...t],[s,l]=n;i$(null!=s,"Invalid first pivot index"),i$(null!=l,"Invalid second pivot index");let c=0;if("keyboard"===i){{let n=e<0?l:s,a=r[n];i$(a,`Panel constraints not found for index ${n}`);let{collapsedSize:i=0,collapsible:o,minSize:c=0}=a;if(o){let r=t[n];if(i$(null!=r,`Previous layout not found for panel index ${n}`),iV(r,i)){let t=c-r;iU(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let n=e<0?s:l,a=r[n];i$(a,`No panel constraints found for index ${n}`);let{collapsedSize:i=0,collapsible:o,minSize:c=0}=a;if(o){let r=t[n];if(i$(null!=r,`Previous layout not found for panel index ${n}`),iV(r,c)){let t=r-i;iU(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let n=e<0?1:-1,a=e<0?l:s,i=0;for(;;){let e=t[a];if(i$(null!=e,`Previous layout not found for panel index ${a}`),i+=iW({panelConstraints:r,panelIndex:a,size:100})-e,(a+=n)<0||a>=r.length)break}let o=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-o:o}{let n=e<0?s:l;for(;n>=0&&n=0))break;e<0?n--:n++}}if(function(e,t,r){if(e.length!==t.length)return!1;for(let r=0;r=0&&n0?n--:n++}}}return iV(o.reduce((e,t)=>t+e,0),100)?o:a}function iK(e,t=document){return Array.from(t.querySelectorAll(`[${ir.resizeHandleId}][data-panel-group-id="${e}"]`))}function iY(e,t,r=document){let n=iK(e,r).findIndex(e=>e.getAttribute(ir.resizeHandleId)===t);return null!=n?n:null}function iJ(e,t,r){let n=iY(e,t,r);return null!=n?[n,n+1]:[-1,-1]}function iX(e,t=document){if((t instanceof HTMLElement||"object"==typeof t&&null!==t&&"tagName"in t&&"getAttribute"in t)&&t.dataset.panelGroupId==e)return t;let r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function iZ(e,t=document){let r=t.querySelector(`[${ir.resizeHandleId}="${e}"]`);return r||null}function iQ(e,t){let{x:r,y:n}=ix(t);return"horizontal"===e?r:n}function i0(e,t,r){t.forEach((t,n)=>{let a=e[n];i$(a,`Panel data not found for index ${n}`);let{callbacks:i,constraints:o,id:s}=a,{collapsedSize:l=0,collapsible:c}=o,u=r[s];if(null==u||t!==u){r[s]=t;let{onCollapse:e,onExpand:n,onResize:a}=i;a&&a(t,u),c&&(e||n)&&(n&&(null==u||iH(u,l))&&!iH(t,l)&&n(),e&&(null==u||!iH(u,l))&&iH(t,l)&&e())}})}function i1(e,t){if(e.length!==t.length)return!1;for(let r=0;rlocalStorage.getItem(e),e.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function i3(e){return`react-resizable-panels:${e}`}function i4(e,t,r,n,a){var i;let o=i3(e),s=t.map(e=>{let{constraints:t,id:r,idIsFromProps:n,order:a}=e;return n?r:a?`${a}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(","),l=null!=(i=function(e,t){try{let r=i3(e),n=t.getItem(r);if(n){let e=JSON.parse(n);if("object"==typeof e&&null!=e)return e}}catch(e){}return null}(e,a))?i:{};l[s]={expandToSizes:Object.fromEntries(r.entries()),layout:n};try{a.setItem(o,JSON.stringify(l))}catch(e){console.error(e)}}let i5={getItem:e=>(i2(i5),i5.getItem(e)),setItem:(e,t)=>{i2(i5),i5.setItem(e,t)}},i6={};function i8({autoSaveId:e=null,children:t,className:r="",direction:n,forwardedRef:a,id:i=null,onLayout:o=null,keyboardResizeBy:s=null,storage:c=i5,style:u,tagName:d="div",...p}){let h=is(i),m=(0,l.useRef)(null),[f,g]=(0,l.useState)(null),[v,x]=(0,l.useState)([]),y=function(){let[e,t]=(0,l.useState)(0);return(0,l.useCallback)(()=>t(e=>e+1),[])}(),b=(0,l.useRef)({}),w=(0,l.useRef)(new Map),k=(0,l.useRef)(0),j=(0,l.useRef)({autoSaveId:e,direction:n,dragState:f,id:h,keyboardResizeBy:s,onLayout:o,storage:c}),N=(0,l.useRef)({layout:v,panelDataArray:[],panelDataArrayChanged:!1});(0,l.useRef)({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),(0,l.useImperativeHandle)(a,()=>({getId:()=>j.current.id,getLayout:()=>{let{layout:e}=N.current;return e},setLayout:e=>{let{onLayout:t}=j.current,{layout:r,panelDataArray:n}=N.current,a=function({layout:e,panelConstraints:t}){let r=[...e],n=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(", ")}`);if(!iV(n,100)&&r.length>0)for(let e=0;ee.constraints)});!function(e,t){if(e.length!==t.length)return!1;for(let r=0;r{if(!i)return;let e=t.current;i$(e,"Eager values not found");let{panelDataArray:a}=e;i$(null!=iX(r,i),`No group found for id "${r}"`);let s=iK(r,i);i$(s,`No resize handles found for group id "${r}"`);let l=s.map(e=>{let t=e.getAttribute(ir.resizeHandleId);i$(t,"Resize handle element has no handle id attribute");let[s,l]=function(e,t,r,n=document){var a,i,o,s;let l=iZ(t,n),c=iK(e,n),u=l?c.indexOf(l):-1;return[null!=(a=null==(i=r[u])?void 0:i.id)?a:null,null!=(o=null==(s=r[u+1])?void 0:s.id)?o:null]}(r,t,a,i);if(null==s||null==l)return()=>{};let c=e=>{if(!e.defaultPrevented&&"Enter"===e.key){e.preventDefault();let l=a.findIndex(e=>e.id===s);if(l>=0){let e=a[l];i$(e,`No panel data found for index ${l}`);let s=n[l],{collapsedSize:c=0,collapsible:u,minSize:d=0}=e.constraints;if(null!=s&&u){let e=iG({delta:iV(s,c)?d-c:c-s,initialLayout:n,panelConstraints:a.map(e=>e.constraints),pivotIndices:iJ(r,t,i),prevLayout:n,trigger:"keyboard"});n!==e&&o(e)}}}};return e.addEventListener("keydown",c),()=>{e.removeEventListener("keydown",c)}});return()=>{l.forEach(e=>e())}},[i,e,t,r,n,a,o])}({committedValuesRef:j,eagerValuesRef:N,groupId:h,layout:v,panelDataArray:N.current.panelDataArray,setLayout:x,panelGroupElement:m.current}),(0,l.useEffect)(()=>{let{panelDataArray:t}=N.current;if(e){if(0===v.length||v.length!==t.length)return;let r=i6[e];null==r&&(r=function(e,t=10){let r=null;return(...n)=>{null!==r&&clearTimeout(r),r=setTimeout(()=>{e(...n)},t)}}(i4,100),i6[e]=r),r(e,[...t],new Map(w.current),v,c)}},[e,v,c]),(0,l.useEffect)(()=>{});let C=(0,l.useCallback)(e=>{let{onLayout:t}=j.current,{layout:r,panelDataArray:n}=N.current;if(e.constraints.collapsible){let a=n.map(e=>e.constraints),{collapsedSize:i=0,panelSize:o,pivotIndices:s}=oe(n,e,r);if(i$(null!=o,`Panel size not found for panel "${e.id}"`),!iH(o,i)){w.current.set(e.id,o);let l=iG({delta:i7(n,e)===n.length-1?o-i:i-o,initialLayout:r,panelConstraints:a,pivotIndices:s,prevLayout:r,trigger:"imperative-api"});i1(r,l)||(x(l),N.current.layout=l,t&&t(l),i0(n,l,b.current))}}},[]),S=(0,l.useCallback)((e,t)=>{let{onLayout:r}=j.current,{layout:n,panelDataArray:a}=N.current;if(e.constraints.collapsible){let i=a.map(e=>e.constraints),{collapsedSize:o=0,panelSize:s=0,minSize:l=0,pivotIndices:c}=oe(a,e,n),u=null!=t?t:l;if(iH(s,o)){let t=w.current.get(e.id),o=null!=t&&t>=u?t:u,l=iG({delta:i7(a,e)===a.length-1?s-o:o-s,initialLayout:n,panelConstraints:i,pivotIndices:c,prevLayout:n,trigger:"imperative-api"});i1(n,l)||(x(l),N.current.layout=l,r&&r(l),i0(a,l,b.current))}}},[]),E=(0,l.useCallback)(e=>{let{layout:t,panelDataArray:r}=N.current,{panelSize:n}=oe(r,e,t);return i$(null!=n,`Panel size not found for panel "${e.id}"`),n},[]),D=(0,l.useCallback)((e,t)=>{let{panelDataArray:r}=N.current,n=i7(r,e);return function({defaultSize:e,dragState:t,layout:r,panelData:n,panelIndex:a,precision:i=3}){let o,s=r[a];return{flexBasis:0,flexGrow:null==s?void 0!=e?e.toFixed(i):"1":1===n.length?"1":s.toFixed(i),flexShrink:1,overflow:"hidden",pointerEvents:null!==t?"none":void 0}}({defaultSize:t,dragState:f,layout:v,panelData:r,panelIndex:n})},[f,v]),M=(0,l.useCallback)(e=>{let{layout:t,panelDataArray:r}=N.current,{collapsedSize:n=0,collapsible:a,panelSize:i}=oe(r,e,t);return i$(null!=i,`Panel size not found for panel "${e.id}"`),!0===a&&iH(i,n)},[]),P=(0,l.useCallback)(e=>{let{layout:t,panelDataArray:r}=N.current,{collapsedSize:n=0,collapsible:a,panelSize:i}=oe(r,e,t);return i$(null!=i,`Panel size not found for panel "${e.id}"`),!a||iU(i,n)>0},[]),T=(0,l.useCallback)(e=>{let{panelDataArray:t}=N.current;t.push(e),t.sort((e,t)=>{let r=e.order,n=t.order;return null==r&&null==n?0:null==r?-1:null==n?1:r-n}),N.current.panelDataArrayChanged=!0,y()},[y]),I=(0,l.useCallback)(e=>{let t=!1,r=m.current;return r&&"rtl"===window.getComputedStyle(r,null).getPropertyValue("direction")&&(t=!0),function(r){var n,a;r.preventDefault();let i=m.current;if(!i)return()=>null;let{direction:o,dragState:s,id:l,keyboardResizeBy:c,onLayout:u}=j.current,{layout:d,panelDataArray:p}=N.current,{initialLayout:h}=null!=s?s:{},f=iJ(l,e,i),g=function(e,t,r,n,a,i){if(im(e)){let t="horizontal"===r,n=0;n=e.shiftKey?100:null!=a?a:10;let i=0;switch(e.key){case"ArrowDown":i=t?0:n;break;case"ArrowLeft":i=t?-n:0;break;case"ArrowRight":i=t?n:0;break;case"ArrowUp":i=t?0:-n;break;case"End":i=100;break;case"Home":i=-100}return i}return null==n?0:function(e,t,r,n,a){let i="horizontal"===r,o=iZ(t,a);i$(o,`No resize handle element found for id "${t}"`);let s=o.getAttribute(ir.groupId);i$(s,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=n,c=iQ(r,e),u=iX(s,a);i$(u,`No group element found for id "${s}"`);let d=u.getBoundingClientRect();return(c-l)/(i?d.width:d.height)*100}(e,t,r,n,i)}(r,e,o,s,c,i),v="horizontal"===o;v&&t&&(g=-g);let y=iG({delta:g,initialLayout:null!=h?h:d,panelConstraints:p.map(e=>e.constraints),pivotIndices:f,prevLayout:d,trigger:im(r)?"keyboard":"mouse-or-touch"}),w=!i1(d,y);(ig(r)||iv(r))&&k.current!=g&&((k.current=g,w||0===g)?iI.set(e,0):v?(n=g<0?iN:iC,iI.set(e,n)):(a=g<0?iS:iE,iI.set(e,a))),w&&(x(y),N.current.layout=y,u&&u(y),i0(p,y,b.current))}},[]),A=(0,l.useCallback)((e,t)=>{let{onLayout:r}=j.current,{layout:n,panelDataArray:a}=N.current,i=a.map(e=>e.constraints),{panelSize:o,pivotIndices:s}=oe(a,e,n);i$(null!=o,`Panel size not found for panel "${e.id}"`);let l=iG({delta:i7(a,e)===a.length-1?o-t:t-o,initialLayout:n,panelConstraints:i,pivotIndices:s,prevLayout:n,trigger:"imperative-api"});i1(n,l)||(x(l),N.current.layout=l,r&&r(l),i0(a,l,b.current))},[]),R=(0,l.useCallback)((e,t)=>{let{layout:r,panelDataArray:n}=N.current,{collapsedSize:a=0,collapsible:i}=t,{collapsedSize:o=0,collapsible:s,maxSize:l=100,minSize:c=0}=e.constraints,{panelSize:u}=oe(n,e,r);null!=u&&(i&&s&&iH(u,a)?iH(a,o)||A(e,o):ul&&A(e,l))},[A]),L=(0,l.useCallback)((e,t)=>{let{direction:r}=j.current,{layout:n}=N.current;if(!m.current)return;let a=iZ(e,m.current);i$(a,`Drag handle element not found for id "${e}"`);let i=iQ(r,t);g({dragHandleId:e,dragHandleRect:a.getBoundingClientRect(),initialCursorPosition:i,initialLayout:n})},[]),z=(0,l.useCallback)(()=>{g(null)},[]),O=(0,l.useCallback)(e=>{let{panelDataArray:t}=N.current,r=i7(t,e);r>=0&&(t.splice(r,1),delete b.current[e.id],N.current.panelDataArrayChanged=!0,y())},[y]),F=(0,l.useMemo)(()=>({collapsePanel:C,direction:n,dragState:f,expandPanel:S,getPanelSize:E,getPanelStyle:D,groupId:h,isPanelCollapsed:M,isPanelExpanded:P,reevaluatePanelConstraints:R,registerPanel:T,registerResizeHandle:I,resizePanel:A,startDragging:L,stopDragging:z,unregisterPanel:O,panelGroupElement:m.current}),[C,f,n,S,E,D,h,M,P,R,T,I,A,L,z,O]);return(0,l.createElement)(it.Provider,{value:F},(0,l.createElement)(d,{...p,children:t,className:r,id:i,ref:m,style:{display:"flex",flexDirection:"horizontal"===n?"row":"column",height:"100%",overflow:"hidden",width:"100%",...u},[ir.group]:"",[ir.groupDirection]:n,[ir.groupId]:h}))}let i9=(0,l.forwardRef)((e,t)=>(0,l.createElement)(i8,{...e,forwardedRef:t}));function i7(e,t){return e.findIndex(e=>e===t||e.id===t.id)}function oe(e,t,r){let n=i7(e,t),a=n===e.length-1,i=r[n];return{...t.constraints,panelSize:i,pivotIndices:a?[n-1,n]:[n,n+1]}}function ot({children:e=null,className:t="",disabled:r=!1,hitAreaMargins:n,id:a,onBlur:i,onClick:o,onDragging:s,onFocus:c,onPointerDown:u,onPointerUp:d,style:p={},tabIndex:h=0,tagName:m="div",...f}){var g,v;let x=(0,l.useRef)(null),y=(0,l.useRef)({onClick:o,onDragging:s,onPointerDown:u,onPointerUp:d});(0,l.useEffect)(()=>{y.current.onClick=o,y.current.onDragging=s,y.current.onPointerDown=u,y.current.onPointerUp=d});let b=(0,l.useContext)(it);if(null===b)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");let{direction:w,groupId:k,registerResizeHandle:j,startDragging:N,stopDragging:C,panelGroupElement:S}=b,E=is(a),[D,M]=(0,l.useState)("inactive"),[P,T]=(0,l.useState)(!1),[I,A]=(0,l.useState)(null),R=(0,l.useRef)({state:D});(0,l.useEffect)(()=>{if(r)A(null);else{let e=j(E);A(()=>e)}},[r,E,j]);let L=null!=(g=null==n?void 0:n.coarse)?g:15,z=null!=(v=null==n?void 0:n.fine)?v:5;return(0,l.useEffect)(()=>{if(r||null==I)return;let e=x.current;i$(e,"Element ref not attached");let t=!1;return function(e,t,r,n,a){var i;let{ownerDocument:o}=t,s={direction:r,element:t,hitAreaMargins:n,setResizeHandlerState:a},l=null!=(i=iT.get(o))?i:0;return iT.set(o,l+1),iA.add(s),iq(),function(){var t;iI.delete(e),iA.delete(s);let r=null!=(t=iT.get(o))?t:1;if(iT.set(o,r-1),iq(),1===r&&iT.delete(o),iM.includes(s)){let e=iM.indexOf(s);e>=0&&iM.splice(e,1),i_(),a("up",!0,null)}}}(E,e,w,{coarse:L,fine:z},(e,r,n)=>{if(!r)return void M("inactive");switch(e){case"down":{M("drag"),t=!1,i$(n,'Expected event to be defined for "down" action'),N(E,n);let{onDragging:e,onPointerDown:r}=y.current;null==e||e(!0),null==r||r();break}case"move":{let{state:e}=R.current;t=!0,"drag"!==e&&M("hover"),i$(n,'Expected event to be defined for "move" action'),I(n);break}case"up":{M("hover"),C();let{onClick:e,onDragging:r,onPointerUp:n}=y.current;null==r||r(!1),null==n||n(),t||null==e||e()}}})},[L,w,r,z,j,E,I,N,C]),!function({disabled:e,handleId:t,resizeHandler:r,panelGroupElement:n}){(0,l.useEffect)(()=>{if(e||null==r||null==n)return;let a=iZ(t,n);if(null==a)return;let i=e=>{if(!e.defaultPrevented)switch(e.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":e.preventDefault(),r(e);break;case"F6":{e.preventDefault();let r=a.getAttribute(ir.groupId);i$(r,`No group element found for id "${r}"`);let i=iK(r,n),o=iY(r,t,n);i$(null!==o,`No resize element found for id "${t}"`);let s=e.shiftKey?o>0?o-1:i.length-1:o+1{a.removeEventListener("keydown",i)}},[n,e,t,r])}({disabled:r,handleId:E,resizeHandler:I,panelGroupElement:S}),(0,l.createElement)(m,{...f,children:e,className:t,id:a,onBlur:()=>{T(!1),null==i||i()},onFocus:()=>{T(!0),null==c||c()},ref:x,role:"separator",style:{touchAction:"none",userSelect:"none",...p},tabIndex:h,[ir.groupDirection]:w,[ir.groupId]:k,[ir.resizeHandle]:"",[ir.resizeHandleActive]:"drag"===D?"pointer":P?"keyboard":void 0,[ir.resizeHandleEnabled]:!r,[ir.resizeHandleId]:E,[ir.resizeHandleState]:D})}i8.displayName="PanelGroup",i9.displayName="forwardRef(PanelGroup)",ot.displayName="PanelResizeHandle";let or=({className:e,...t})=>(0,s.jsx)(i9,{className:(0,h.cn)("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),on=({withHandle:e,className:t,...r})=>(0,s.jsx)(ot,{className:(0,h.cn)("group relative flex w-2 mx-1 items-center justify-center bg-transparent hover:bg-border/50 transition-colors after:absolute after:inset-y-0 after:left-1/2 after:w-4 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-2 data-[panel-group-direction=vertical]:my-1 data-[panel-group-direction=vertical]:mx-0 data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-4 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90 cursor-col-resize data-[panel-group-direction=vertical]:cursor-row-resize",t),...r,children:e&&(0,s.jsx)("div",{className:"z-10 flex h-12 w-1 items-center justify-center rounded-full bg-border/30 hover:bg-border/50 transition-colors opacity-0 group-hover:opacity-100",children:(0,s.jsx)(ie,{className:"h-3 w-3 text-muted-foreground/50"})})});var oa=r(69024),[oi,oo]=(0,J.A)("Tooltip",[ei.Bk]),os=(0,ei.Bk)(),ol="TooltipProvider",oc="tooltip.open",[ou,od]=oi(ol),op=e=>{let{__scopeTooltip:t,delayDuration:r=700,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:i}=e,o=l.useRef(!0),c=l.useRef(!1),u=l.useRef(0);return l.useEffect(()=>{let e=u.current;return()=>window.clearTimeout(e)},[]),(0,s.jsx)(ou,{scope:t,isOpenDelayedRef:o,delayDuration:r,onOpen:l.useCallback(()=>{window.clearTimeout(u.current),o.current=!1},[]),onClose:l.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.current=!0,n)},[n]),isPointerInTransitRef:c,onPointerInTransitChange:l.useCallback(e=>{c.current=e},[]),disableHoverableContent:a,children:i})};op.displayName=ol;var oh="Tooltip",[om,of]=oi(oh),og=e=>{let{__scopeTooltip:t,children:r,open:n,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:c}=e,u=od(oh,e.__scopeTooltip),d=os(t),[p,h]=l.useState(null),m=(0,ea.B)(),f=l.useRef(0),g=o??u.disableHoverableContent,v=c??u.delayDuration,x=l.useRef(!1),[y,b]=(0,X.i)({prop:n,defaultProp:a??!1,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(oc))):u.onClose(),i?.(e)},caller:oh}),w=l.useMemo(()=>y?x.current?"delayed-open":"instant-open":"closed",[y]),k=l.useCallback(()=>{window.clearTimeout(f.current),f.current=0,x.current=!1,b(!0)},[b]),j=l.useCallback(()=>{window.clearTimeout(f.current),f.current=0,b(!1)},[b]),N=l.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{x.current=!0,b(!0),f.current=0},v)},[v,b]);return l.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),(0,s.jsx)(ei.bL,{...d,children:(0,s.jsx)(om,{scope:t,contentId:m,open:y,stateAttribute:w,trigger:p,onTriggerChange:h,onTriggerEnter:l.useCallback(()=>{u.isOpenDelayedRef.current?N():k()},[u.isOpenDelayedRef,N,k]),onTriggerLeave:l.useCallback(()=>{g?j():(window.clearTimeout(f.current),f.current=0)},[j,g]),onOpen:k,onClose:j,disableHoverableContent:g,children:r})})};og.displayName=oh;var ov="TooltipTrigger",ox=l.forwardRef((e,t)=>{let{__scopeTooltip:r,...n}=e,a=of(ov,r),i=od(ov,r),o=os(r),c=l.useRef(null),u=(0,Y.s)(t,c,a.onTriggerChange),d=l.useRef(!1),p=l.useRef(!1),h=l.useCallback(()=>d.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),(0,s.jsx)(ei.Mz,{asChild:!0,...o,children:(0,s.jsx)(Z.sG.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...n,ref:u,onPointerMove:(0,K.mK)(e.onPointerMove,e=>{"touch"!==e.pointerType&&(p.current||i.isPointerInTransitRef.current||(a.onTriggerEnter(),p.current=!0))}),onPointerLeave:(0,K.mK)(e.onPointerLeave,()=>{a.onTriggerLeave(),p.current=!1}),onPointerDown:(0,K.mK)(e.onPointerDown,()=>{a.open&&a.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:(0,K.mK)(e.onFocus,()=>{d.current||a.onOpen()}),onBlur:(0,K.mK)(e.onBlur,a.onClose),onClick:(0,K.mK)(e.onClick,a.onClose)})})});ox.displayName=ov;var oy="TooltipPortal",[ob,ow]=oi(oy,{forceMount:void 0}),ok=e=>{let{__scopeTooltip:t,forceMount:r,children:n,container:a}=e,i=of(oy,t);return(0,s.jsx)(ob,{scope:t,forceMount:r,children:(0,s.jsx)(es.C,{present:r||i.open,children:(0,s.jsx)(eo.Z,{asChild:!0,container:a,children:n})})})};ok.displayName=oy;var oj="TooltipContent",oN=l.forwardRef((e,t)=>{let r=ow(oj,e.__scopeTooltip),{forceMount:n=r.forceMount,side:a="top",...i}=e,o=of(oj,e.__scopeTooltip);return(0,s.jsx)(es.C,{present:n||o.open,children:o.disableHoverableContent?(0,s.jsx)(oM,{side:a,...i,ref:t}):(0,s.jsx)(oC,{side:a,...i,ref:t})})}),oC=l.forwardRef((e,t)=>{let r=of(oj,e.__scopeTooltip),n=od(oj,e.__scopeTooltip),a=l.useRef(null),i=(0,Y.s)(t,a),[o,c]=l.useState(null),{trigger:u,onClose:d}=r,p=a.current,{onPointerInTransitChange:h}=n,m=l.useCallback(()=>{c(null),h(!1)},[h]),f=l.useCallback((e,t)=>{let r=e.currentTarget,n={x:e.clientX,y:e.clientY},a=function(e,t){let r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,a,i)){case i:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw Error("unreachable")}}(n,r.getBoundingClientRect());c(function(e){let t=e.slice();return t.sort((e,t)=>e.xt.x?1:e.yt.y)),function(e){if(e.length<=1)return e.slice();let t=[];for(let r=0;r=2;){let e=t[t.length-1],r=t[t.length-2];if((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x))t.pop();else break}t.push(n)}t.pop();let r=[];for(let t=e.length-1;t>=0;t--){let n=e[t];for(;r.length>=2;){let e=r[r.length-1],t=r[r.length-2];if((e.x-t.x)*(n.y-t.y)>=(e.y-t.y)*(n.x-t.x))r.pop();else break}r.push(n)}return(r.pop(),1===t.length&&1===r.length&&t[0].x===r[0].x&&t[0].y===r[0].y)?t:t.concat(r)}(t)}([...function(e,t,r=5){let n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r})}return n}(n,a),...function(e){let{top:t,right:r,bottom:n,left:a}=e;return[{x:a,y:t},{x:r,y:t},{x:r,y:n},{x:a,y:n}]}(t.getBoundingClientRect())])),h(!0)},[h]);return l.useEffect(()=>()=>m(),[m]),l.useEffect(()=>{if(u&&p){let e=e=>f(e,p),t=e=>f(e,u);return u.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}},[u,p,f,m]),l.useEffect(()=>{if(o){let e=e=>{let t=e.target,r={x:e.clientX,y:e.clientY},n=u?.contains(t)||p?.contains(t),a=!function(e,t){let{x:r,y:n}=e,a=!1;for(let e=0,i=t.length-1;en!=d>n&&r<(u-l)*(n-c)/(d-c)+l&&(a=!a)}return a}(r,o);n?m():a&&(m(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[u,p,o,d,m]),(0,s.jsx)(oM,{...e,ref:i})}),[oS,oE]=oi(oh,{isInside:!1}),oD=(0,eC.Dc)("TooltipContent"),oM=l.forwardRef((e,t)=>{let{__scopeTooltip:r,children:n,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...c}=e,u=of(oj,r),d=os(r),{onClose:p}=u;return l.useEffect(()=>(document.addEventListener(oc,p),()=>document.removeEventListener(oc,p)),[p]),l.useEffect(()=>{if(u.trigger){let e=e=>{let t=e.target;t?.contains(u.trigger)&&p()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[u.trigger,p]),(0,s.jsx)(et.qW,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:(0,s.jsxs)(ei.UC,{"data-state":u.stateAttribute,...d,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,s.jsx)(oD,{children:n}),(0,s.jsx)(oS,{scope:r,isInside:!0,children:(0,s.jsx)(oa.bL,{id:u.contentId,role:"tooltip",children:a||n})})]})})});oN.displayName=oj;var oP="TooltipArrow",oT=l.forwardRef((e,t)=>{let{__scopeTooltip:r,...n}=e,a=os(r);return oE(oP,r).isInside?null:(0,s.jsx)(ei.i3,{...a,...n,ref:t})});function oI({delayDuration:e=0,...t}){return(0,s.jsx)(op,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function oA({...e}){return(0,s.jsx)(oI,{children:(0,s.jsx)(og,{"data-slot":"tooltip",...e})})}function oR({...e}){return(0,s.jsx)(ox,{"data-slot":"tooltip-trigger",...e})}function oL({className:e,sideOffset:t=0,children:r,arrowStyle:n,...a}){return(0,s.jsx)(ok,{children:(0,s.jsxs)(oN,{"data-slot":"tooltip-content",sideOffset:t,className:(0,h.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...a,children:[r,(0,s.jsx)(oT,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",style:n})]})})}oT.displayName=oP;var oz=r(48730);let oO={pending:(0,s.jsx)(oz.A,{className:"h-4 w-4 text-muted-foreground"}),in_progress:(0,s.jsx)(n_.A,{className:"h-4 w-4 text-blue-500 animate-spin"}),success:(0,s.jsx)(w.A,{className:"h-4 w-4 text-green-500"}),failed:(0,s.jsx)(k.A,{className:"h-4 w-4 text-red-500"}),skipped:(0,s.jsx)("span",{className:"text-muted-foreground",children:"⊘"})},oF={pending:"text-muted-foreground",in_progress:"text-blue-500",success:"text-green-500",failed:"text-red-500",skipped:"text-gray-400"};function o_({title:e,steps:t,checkpointId:r,onRestore:n,isSavedCheckpoint:a,expanded:i=!0,onToggleExpand:o}){let l=t.filter(e=>"success"===e.status).length,c=t.filter(e=>"failed"===e.status).length,u=t.some(e=>"in_progress"===e.status),d=t.every(e=>"pending"!==e.status&&"in_progress"!==e.status),p=r&&d?(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)(rO.E,{variant:a?"default":"outline",className:"h-6 px-2 text-xs",children:a?"Saved version":"Checkpoint"}),n&&(0,s.jsxs)(m.$,{size:"sm",variant:"ghost",onClick:()=>n(r),className:"h-6 px-2 text-xs",title:"Restore to this checkpoint",children:[(0,s.jsx)(aQ,{className:"h-3 w-3 mr-1"}),"Restore"]})]}):null;return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("div",{className:"flex items-start justify-between",children:(0,s.jsxs)("div",{className:"flex items-start gap-2 flex-1",children:[(0,s.jsx)("button",{onClick:o,className:"mt-0.5 hover:bg-muted rounded p-0.5","aria-label":i?"Collapse":"Expand",children:i?(0,s.jsx)(nc.A,{className:"h-4 w-4"}):(0,s.jsx)(tJ,{className:"h-4 w-4"})}),(0,s.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium",children:e}),u&&(0,s.jsx)("span",{className:"text-xs text-blue-500 animate-pulse",children:"In Progress..."}),d&&(0,s.jsx)("span",{className:(0,h.cn)("text-xs",0===c?"text-green-500":"text-orange-500"),children:0===c?"✓ Complete":`⚠ ${l}/${t.length} succeeded`})]}),!i&&t.length>0&&(0,s.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(w.A,{className:"h-3 w-3 text-green-500"}),l]}),c>0&&(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)(k.A,{className:"h-3 w-3 text-red-500"}),c]}),(0,s.jsxs)("span",{children:[t.length," total"]})]})]})]})}),i&&t.length>0&&(0,s.jsx)("div",{className:"ml-6 space-y-1 text-sm",children:t.map(e=>(0,s.jsxs)("div",{className:(0,h.cn)("flex items-start gap-2 py-1",oF[e.status]),children:[(0,s.jsx)("span",{className:"mt-0.5",children:oO[e.status]}),(0,s.jsxs)("div",{className:"flex-1 space-y-0.5",children:[(0,s.jsx)("div",{children:e.description}),e.error&&(0,s.jsxs)("div",{className:"text-xs text-red-400 ml-6",children:["Error: ",e.error]})]})]},e.id))}),p&&(0,s.jsx)("div",{className:"ml-6",children:p})]})}var oq=r(5336),oB=r(35071);let o$=(0,v.A)("iteration-cw",[["path",{d:"M4 10a8 8 0 1 1 8 8H4",key:"svv66n"}],["path",{d:"m8 22-4-4 4-4",key:"6g7gki"}]]);var oU=r(45583);let oH=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oV=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oW={};function oG(e,t){return((t||oW).jsx?oV:oH).test(e)}let oK=/[ \t\n\f\r]/g;function oY(e){return""===e.replace(oK,"")}class oJ{constructor(e,t,r){this.normal=t,this.property=e,r&&(this.space=r)}}function oX(e,t){let r={},n={};for(let t of e)Object.assign(r,t.property),Object.assign(n,t.normal);return new oJ(r,n,t)}function oZ(e){return e.toLowerCase()}oJ.prototype.normal={},oJ.prototype.property={},oJ.prototype.space=void 0;class oQ{constructor(e,t){this.attribute=t,this.property=e}}oQ.prototype.attribute="",oQ.prototype.booleanish=!1,oQ.prototype.boolean=!1,oQ.prototype.commaOrSpaceSeparated=!1,oQ.prototype.commaSeparated=!1,oQ.prototype.defined=!1,oQ.prototype.mustUseProperty=!1,oQ.prototype.number=!1,oQ.prototype.overloadedBoolean=!1,oQ.prototype.property="",oQ.prototype.spaceSeparated=!1,oQ.prototype.space=void 0;let o0=0,o1=o9(),o2=o9(),o3=o9(),o4=o9(),o5=o9(),o6=o9(),o8=o9();function o9(){return 2**++o0}let o7=Object.keys(i);class se extends oQ{constructor(e,t,r,n){let a=-1;if(super(e,t),function(e,t,r){r&&(e[t]=r)}(this,"space",n),"number"==typeof r)for(;++a"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function sn(e,t){return t in e?e[t]:t}function sa(e,t){return sn(e,t.toLowerCase())}let si=st({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:o6,acceptCharset:o5,accessKey:o5,action:null,allow:null,allowFullScreen:o1,allowPaymentRequest:o1,allowUserMedia:o1,alt:null,as:null,async:o1,autoCapitalize:null,autoComplete:o5,autoFocus:o1,autoPlay:o1,blocking:o5,capture:null,charSet:null,checked:o1,cite:null,className:o5,cols:o4,colSpan:null,content:null,contentEditable:o2,controls:o1,controlsList:o5,coords:o4|o6,crossOrigin:null,data:null,dateTime:null,decoding:null,default:o1,defer:o1,dir:null,dirName:null,disabled:o1,download:o3,draggable:o2,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:o1,formTarget:null,headers:o5,height:o4,hidden:o3,high:o4,href:null,hrefLang:null,htmlFor:o5,httpEquiv:o5,id:null,imageSizes:null,imageSrcSet:null,inert:o1,inputMode:null,integrity:null,is:null,isMap:o1,itemId:null,itemProp:o5,itemRef:o5,itemScope:o1,itemType:o5,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:o1,low:o4,manifest:null,max:null,maxLength:o4,media:null,method:null,min:null,minLength:o4,multiple:o1,muted:o1,name:null,nonce:null,noModule:o1,noValidate:o1,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:o1,optimum:o4,pattern:null,ping:o5,placeholder:null,playsInline:o1,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:o1,referrerPolicy:null,rel:o5,required:o1,reversed:o1,rows:o4,rowSpan:o4,sandbox:o5,scope:null,scoped:o1,seamless:o1,selected:o1,shadowRootClonable:o1,shadowRootDelegatesFocus:o1,shadowRootMode:null,shape:null,size:o4,sizes:null,slot:null,span:o4,spellCheck:o2,src:null,srcDoc:null,srcLang:null,srcSet:null,start:o4,step:null,style:null,tabIndex:o4,target:null,title:null,translate:null,type:null,typeMustMatch:o1,useMap:null,value:o2,width:o4,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:o5,axis:null,background:null,bgColor:null,border:o4,borderColor:null,bottomMargin:o4,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:o1,declare:o1,event:null,face:null,frame:null,frameBorder:null,hSpace:o4,leftMargin:o4,link:null,longDesc:null,lowSrc:null,marginHeight:o4,marginWidth:o4,noResize:o1,noHref:o1,noShade:o1,noWrap:o1,object:null,profile:null,prompt:null,rev:null,rightMargin:o4,rules:null,scheme:null,scrolling:o2,standby:null,summary:null,text:null,topMargin:o4,valueType:null,version:null,vAlign:null,vLink:null,vSpace:o4,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:o1,disableRemotePlayback:o1,prefix:null,property:null,results:o4,security:null,unselectable:null},space:"html",transform:sa}),so=st({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:o8,accentHeight:o4,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:o4,amplitude:o4,arabicForm:null,ascent:o4,attributeName:null,attributeType:null,azimuth:o4,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:o4,by:null,calcMode:null,capHeight:o4,className:o5,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:o4,diffuseConstant:o4,direction:null,display:null,dur:null,divisor:o4,dominantBaseline:null,download:o1,dx:null,dy:null,edgeMode:null,editable:null,elevation:o4,enableBackground:null,end:null,event:null,exponent:o4,externalResourcesRequired:null,fill:null,fillOpacity:o4,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:o6,g2:o6,glyphName:o6,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:o4,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:o4,horizOriginX:o4,horizOriginY:o4,id:null,ideographic:o4,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:o4,k:o4,k1:o4,k2:o4,k3:o4,k4:o4,kernelMatrix:o8,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:o4,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:o4,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:o4,overlineThickness:o4,paintOrder:null,panose1:null,path:null,pathLength:o4,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:o5,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:o4,pointsAtY:o4,pointsAtZ:o4,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:o8,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:o8,rev:o8,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:o8,requiredFeatures:o8,requiredFonts:o8,requiredFormats:o8,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:o4,specularExponent:o4,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:o4,strikethroughThickness:o4,string:null,stroke:null,strokeDashArray:o8,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:o4,strokeOpacity:o4,strokeWidth:null,style:null,surfaceScale:o4,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:o8,tabIndex:o4,tableValues:null,target:null,targetX:o4,targetY:o4,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:o8,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:o4,underlineThickness:o4,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:o4,values:null,vAlphabetic:o4,vMathematical:o4,vectorEffect:null,vHanging:o4,vIdeographic:o4,version:null,vertAdvY:o4,vertOriginX:o4,vertOriginY:o4,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:o4,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:sn}),ss=st({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),sl=st({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:sa}),sc=st({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),su=oX([sr,si,ss,sl,sc],"html"),sd=oX([sr,so,ss,sl,sc],"svg"),sp=/[A-Z]/g,sh=/-[a-z]/g,sm=/^data[-\w.:]+$/i;function sf(e){return"-"+e.toLowerCase()}function sg(e){return e.charAt(1).toUpperCase()}let sv={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var sx=r(11120);let sy=sw("end"),sb=sw("start");function sw(e){return function(t){let r=t&&t.position&&t.position[e]||{};if("number"==typeof r.line&&r.line>0&&"number"==typeof r.column&&r.column>0)return{line:r.line,column:r.column,offset:"number"==typeof r.offset&&r.offset>-1?r.offset:void 0}}}function sk(e){return e&&"object"==typeof e?"position"in e||"type"in e?sN(e.position):"start"in e||"end"in e?sN(e):"line"in e||"column"in e?sj(e):"":""}function sj(e){return sC(e&&e.line)+":"+sC(e&&e.column)}function sN(e){return sj(e&&e.start)+"-"+sj(e&&e.end)}function sC(e){return e&&"number"==typeof e?e:1}class sS extends Error{constructor(e,t,r){super(),"string"==typeof t&&(r=t,t=void 0);let n="",a={},i=!1;if(t&&(a="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?n=e:!a.cause&&e&&(i=!0,n=e.message,a.cause=e),!a.ruleId&&!a.source&&"string"==typeof r){let e=r.indexOf(":");-1===e?a.ruleId=r:(a.source=r.slice(0,e),a.ruleId=r.slice(e+1))}if(!a.place&&a.ancestors&&a.ancestors){let e=a.ancestors[a.ancestors.length-1];e&&(a.place=e.position)}let o=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=n,this.line=o?o.line:void 0,this.name=sk(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=i&&a.cause&&"string"==typeof a.cause.stack?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}sS.prototype.file="",sS.prototype.name="",sS.prototype.reason="",sS.prototype.message="",sS.prototype.stack="",sS.prototype.column=void 0,sS.prototype.line=void 0,sS.prototype.ancestors=void 0,sS.prototype.cause=void 0,sS.prototype.fatal=void 0,sS.prototype.place=void 0,sS.prototype.ruleId=void 0,sS.prototype.source=void 0;let sE={}.hasOwnProperty,sD=new Map,sM=/[A-Z]/g,sP=new Set(["table","tbody","thead","tfoot","tr"]),sT=new Set(["td","th"]),sI="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function sA(e,t,r){var n;return"element"===t.type?function(e,t,r){let n=e.schema,a=n;"svg"===t.tagName.toLowerCase()&&"html"===n.space&&(e.schema=sd),e.ancestors.push(t);let i=sO(e,t.tagName,!1),o=function(e,t){let r,n,a={};for(n in t.properties)if("children"!==n&&sE.call(t.properties,n)){let i=function(e,t,r){let n=function(e,t){let r=oZ(t),n=t,a=oQ;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&"data"===r.slice(0,4)&&sm.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(sh,sg);n="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!sh.test(e)){let r=e.replace(sp,sf);"-"!==r.charAt(0)&&(r="-"+r),t="data"+r}}a=se}return new a(n,t)}(e.schema,t);if(!(null==r||"number"==typeof r&&Number.isNaN(r))){if(Array.isArray(r)&&(r=n.commaSeparated?function(e,t){let r={};return(""===e[e.length-1]?[...e,""]:e).join((r.padRight?" ":"")+","+(!1===r.padLeft?"":" ")).trim()}(r):r.join(" ").trim()),"style"===n.property){let t="object"==typeof r?r:function(e,t){try{return sx(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};let t=new sS("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=sI+"#cannot-parse-style-attribute",t}}(e,String(r));return"css"===e.stylePropertyNameCase&&(t=function(e){let t,r={};for(t in e)sE.call(e,t)&&(r[function(e){let t=e.replace(sM,s_);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return r}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&n.space?sv[n.property]||n.property:n.attribute,r]}}(e,n,t.properties[n]);if(i){let[n,o]=i;e.tableCellAlignToStyle&&"align"===n&&"string"==typeof o&&sT.has(t.tagName)?r=o:a[n]=o}}return r&&((a.style||(a.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r),a}(e,t),s=sz(e,t);return sP.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&oY(e.value):oY(e))})),sR(e,o,i,t),sL(o,s),e.ancestors.pop(),e.schema=n,e.create(t,i,o,r)}(e,t,r):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}sF(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,r){let n=e.schema,a=n;"svg"===t.name&&"html"===n.space&&(e.schema=sd),e.ancestors.push(t);let i=null===t.name?e.Fragment:sO(e,t.name,!0),o=function(e,t){let r={};for(let n of t.attributes)if("mdxJsxExpressionAttribute"===n.type)if(n.data&&n.data.estree&&e.evaluater){let t=n.data.estree.body[0];t.type;let a=t.expression;a.type;let i=a.properties[0];i.type,Object.assign(r,e.evaluater.evaluateExpression(i.argument))}else sF(e,t.position);else{let a,i=n.name;if(n.value&&"object"==typeof n.value)if(n.value.data&&n.value.data.estree&&e.evaluater){let t=n.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else sF(e,t.position);else a=null===n.value||n.value;r[i]=a}return r}(e,t),s=sz(e,t);return sR(e,o,i,t),sL(o,s),e.ancestors.pop(),e.schema=n,e.create(t,i,o,r)}(e,t,r):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);sF(e,t.position)}(e,t):"root"===t.type?function(e,t,r){let n={};return sL(n,sz(e,t)),e.create(t,e.Fragment,n,r)}(e,t,r):"text"===t.type?(n=0,t.value):void 0}function sR(e,t,r,n){"string"!=typeof r&&r!==e.Fragment&&e.passNode&&(t.node=n)}function sL(e,t){if(t.length>0){let r=t.length>1?t:t[0];r&&(e.children=r)}}function sz(e,t){let r=[],n=-1,a=e.passKeys?new Map:sD;for(;++ni?0:i+t:t>i?i:t,r=r>0?r:0,n.length<1e4)(a=Array.from(n)).unshift(t,r),e.splice(...a);else for(r&&e.splice(t,r);o0?(sH(e,e.length,0,t),e):t}class sW{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,t,r){this.setCursor(Math.trunc(e));let n=this.right.splice(this.right.length-(t||0),Number.POSITIVE_INFINITY);return r&&sG(this.left,r),n.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),sG(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),sG(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e-1&&e.test(String.fromCharCode(t))}}function s7(e,t,r,n){let a=n?n-1:Number.POSITIVE_INFINITY,i=0;return function(n){return s5(n)?(e.enter(r),function n(o){return s5(o)&&i++n))return;let s=a.events.length,l=s;for(;l--;)if("exit"===a.events[l][0]&&"chunkFlow"===a.events[l][1].type){if(e){r=a.events[l][1].end;break}e=!0}for(g(o),i=s;it;){let t=i[r];a.containerState=t[1],t[0].exit.call(a,e)}i.length=t}function v(){t.write([null]),r=void 0,t=void 0,a.containerState._closeFlow=void 0}}},lr={tokenize:function(e,t,r){return s7(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},ln={partial:!0,tokenize:function(e,t,r){return function(t){return s5(t)?s7(e,n,"linePrefix")(t):n(t)};function n(e){return null===e||s3(e)?t(e):r(e)}}},la={resolve:function(e){return sK(e),e},tokenize:function(e,t){let r;return function(t){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),n(t)};function n(t){return null===t?a(t):s3(t)?e.check(li,i,a)(t):(e.consume(t),n)}function a(r){return e.exit("chunkContent"),e.exit("content"),t(r)}function i(t){return e.consume(t),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,n}}},li={partial:!0,tokenize:function(e,t,r){let n=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s7(e,a,"linePrefix")};function a(a){if(null===a||s3(a))return r(a);let i=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(a):e.interrupt(n.parser.constructs.flow,r,t)(a)}}},lo={tokenize:function(e){let t=this,r=e.attempt(ln,function(n){return null===n?void e.consume(n):(e.enter("lineEndingBlank"),e.consume(n),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r)},e.attempt(this.parser.constructs.flowInitial,n,s7(e,e.attempt(this.parser.constructs.flow,n,e.attempt(la,n)),"linePrefix")));return r;function n(n){return null===n?void e.consume(n):(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),t.currentConstruct=void 0,r)}}},ls={resolveAll:ld()},ll=lu("string"),lc=lu("text");function lu(e){return{resolveAll:ld("text"===e?lp:void 0),tokenize:function(t){let r=this,n=this.parser.constructs[e],a=t.attempt(n,i,o);return i;function i(e){return l(e)?a(e):o(e)}function o(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),s)}function s(e){return l(e)?(t.exit("data"),a(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;let t=n[e],a=-1;if(t)for(;++a=3&&(null===o||s3(o))?(e.exit("thematicBreak"),t(o)):r(o)}(o)}}},lm={continuation:{tokenize:function(e,t,r){let n=this;return n.containerState._closeFlow=void 0,e.check(ln,function(r){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,s7(e,t,"listItemIndent",n.containerState.size+1)(r)},function(r){return n.containerState.furtherBlankLines||!s5(r)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,a(r)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(lg,t,a)(r))});function a(a){return n.containerState._closeFlow=!0,n.interrupt=void 0,s7(e,e.attempt(lm,t,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,r){let n=this,a=n.events[n.events.length-1],i=a&&"linePrefix"===a[1].type?a[2].sliceSerialize(a[1],!0).length:0,o=0;return function(t){let a=n.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===a?!n.containerState.marker||t===n.containerState.marker:s0(t)){if(n.containerState.type||(n.containerState.type=a,e.enter(a,{_container:!0})),"listUnordered"===a)return e.enter("listItemPrefix"),42===t||45===t?e.check(lh,r,s)(t):s(t);if(!n.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(a){return s0(a)&&++o<10?(e.consume(a),t):(!n.interrupt||o<2)&&(n.containerState.marker?a===n.containerState.marker:41===a||46===a)?(e.exit("listItemValue"),s(a)):r(a)}(t)}return r(t)};function s(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||t,e.check(ln,n.interrupt?r:l,e.attempt(lf,u,c))}function l(e){return n.containerState.initialBlankLine=!0,i++,u(e)}function c(t){return s5(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):r(t)}function u(r){return n.containerState.size=i+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(r)}}},lf={partial:!0,tokenize:function(e,t,r){let n=this;return s7(e,function(e){let a=n.events[n.events.length-1];return!s5(e)&&a&&"listItemPrefixWhitespace"===a[1].type?t(e):r(e)},"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},lg={partial:!0,tokenize:function(e,t,r){let n=this;return s7(e,function(e){let a=n.events[n.events.length-1];return a&&"listItemIndent"===a[1].type&&a[2].sliceSerialize(a[1],!0).length===n.containerState.size?t(e):r(e)},"listItemIndent",n.containerState.size+1)}},lv={continuation:{tokenize:function(e,t,r){let n=this;return function(t){return s5(t)?s7(e,a,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):a(t)};function a(n){return e.attempt(lv,t,r)(n)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,r){let n=this;return function(t){if(62===t){let r=n.containerState;return r.open||(e.enter("blockQuote",{_container:!0}),r.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),a}return r(t)};function a(r){return s5(r)?(e.enter("blockQuotePrefixWhitespace"),e.consume(r),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(r))}}};function lx(e,t,r,n,a,i,o,s,l){let c=l||Number.POSITIVE_INFINITY,u=0;return function(t){return 60===t?(e.enter(n),e.enter(a),e.enter(i),e.consume(t),e.exit(i),d):null===t||32===t||41===t||sQ(t)?r(t):(e.enter(n),e.enter(o),e.enter(s),e.enter("chunkString",{contentType:"string"}),m(t))};function d(r){return 62===r?(e.enter(i),e.consume(r),e.exit(i),e.exit(a),e.exit(n),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(r))}function p(t){return 62===t?(e.exit("chunkString"),e.exit(s),d(t)):null===t||60===t||s3(t)?r(t):(e.consume(t),92===t?h:p)}function h(t){return 60===t||62===t||92===t?(e.consume(t),p):p(t)}function m(a){return!u&&(null===a||41===a||s4(a))?(e.exit("chunkString"),e.exit(s),e.exit(o),e.exit(n),t(a)):u999||null===d||91===d||93===d&&!o||94===d&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?r(d):93===d?(e.exit(i),e.enter(a),e.consume(d),e.exit(a),e.exit(n),t):s3(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||s3(t)||l++>999?(e.exit("chunkString"),c(t)):(e.consume(t),o||(o=!s5(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),l++,u):u(t)}}function lb(e,t,r,n,a,i){let o;return function(t){return 34===t||39===t||40===t?(e.enter(n),e.enter(a),e.consume(t),e.exit(a),o=40===t?41:t,s):r(t)};function s(r){return r===o?(e.enter(a),e.consume(r),e.exit(a),e.exit(n),t):(e.enter(i),l(r))}function l(t){return t===o?(e.exit(i),s(o)):null===t?r(t):s3(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s7(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===o||null===t||s3(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?u:c)}function u(t){return t===o||92===t?(e.consume(t),c):c(t)}}function lw(e,t){let r;return function n(a){return s3(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),r=!0,n):s5(a)?s7(e,n,r?"linePrefix":"lineSuffix")(a):t(a)}}function lk(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let lj={partial:!0,tokenize:function(e,t,r){return function(t){return s4(t)?lw(e,n)(t):r(t)};function n(t){return lb(e,a,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function a(t){return s5(t)?s7(e,i,"whitespace")(t):i(t)}function i(e){return null===e||s3(e)?t(e):r(e)}}},lN={name:"codeIndented",tokenize:function(e,t,r){let n=this;return function(t){return e.enter("codeIndented"),s7(e,a,"linePrefix",5)(t)};function a(t){let a=n.events[n.events.length-1];return a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?function t(r){return null===r?i(r):s3(r)?e.attempt(lC,t,i)(r):(e.enter("codeFlowValue"),function r(n){return null===n||s3(n)?(e.exit("codeFlowValue"),t(n)):(e.consume(n),r)}(r))}(t):r(t)}function i(r){return e.exit("codeIndented"),t(r)}}},lC={partial:!0,tokenize:function(e,t,r){let n=this;return a;function a(t){return n.parser.lazy[n.now().line]?r(t):s3(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):s7(e,i,"linePrefix",5)(t)}function i(e){let i=n.events[n.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):s3(e)?a(e):r(e)}}},lS={name:"setextUnderline",resolveTo:function(e,t){let r,n,a,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){r=i;break}"paragraph"===e[i][1].type&&(n=i)}else"content"===e[i][1].type&&e.splice(i,1),a||"definition"!==e[i][1].type||(a=i);let o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[n][1].type="setextHeadingText",a?(e.splice(n,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e},tokenize:function(e,t,r){let n,a=this;return function(t){var o;let s,l=a.events.length;for(;l--;)if("lineEnding"!==a.events[l][1].type&&"linePrefix"!==a.events[l][1].type&&"content"!==a.events[l][1].type){s="paragraph"===a.events[l][1].type;break}return!a.parser.lazy[a.now().line]&&(a.interrupt||s)?(e.enter("setextHeadingLine"),n=t,o=t,e.enter("setextHeadingLineSequence"),function t(r){return r===n?(e.consume(r),t):(e.exit("setextHeadingLineSequence"),s5(r)?s7(e,i,"lineSuffix")(r):i(r))}(o)):r(t)};function i(n){return null===n||s3(n)?(e.exit("setextHeadingLine"),t(n)):r(n)}}},lE=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],lD=["pre","script","style","textarea"],lM={partial:!0,tokenize:function(e,t,r){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),e.attempt(ln,t,r)}}},lP={partial:!0,tokenize:function(e,t,r){let n=this;return function(t){return s3(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):r(t)};function a(e){return n.parser.lazy[n.now().line]?r(e):t(e)}}},lT={partial:!0,tokenize:function(e,t,r){let n=this;return function(t){return null===t?r(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a)};function a(e){return n.parser.lazy[n.now().line]?r(e):t(e)}}},lI={concrete:!0,name:"codeFenced",tokenize:function(e,t,r){let n,a=this,i={partial:!0,tokenize:function(e,t,r){let i=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(t){return e.enter("codeFencedFence"),s5(t)?s7(e,l,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===n?(e.enter("codeFencedFenceSequence"),function t(a){return a===n?(i++,e.consume(a),t):i>=s?(e.exit("codeFencedFenceSequence"),s5(a)?s7(e,c,"whitespace")(a):c(a)):r(a)}(t)):r(t)}function c(n){return null===n||s3(n)?(e.exit("codeFencedFence"),t(n)):r(n)}}},o=0,s=0;return function(t){var i=t;let c=a.events[a.events.length-1];return o=c&&"linePrefix"===c[1].type?c[2].sliceSerialize(c[1],!0).length:0,n=i,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(a){return a===n?(s++,e.consume(a),t):s<3?r(a):(e.exit("codeFencedFenceSequence"),s5(a)?s7(e,l,"whitespace")(a):l(a))}(i)};function l(i){return null===i||s3(i)?(e.exit("codeFencedFence"),a.interrupt?t(i):e.check(lT,u,m)(i)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(a){return null===a||s3(a)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),l(a)):s5(a)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),s7(e,c,"whitespace")(a)):96===a&&a===n?r(a):(e.consume(a),t)}(i))}function c(t){return null===t||s3(t)?l(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(a){return null===a||s3(a)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),l(a)):96===a&&a===n?r(a):(e.consume(a),t)}(t))}function u(t){return e.attempt(i,m,d)(t)}function d(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),p}function p(t){return o>0&&s5(t)?s7(e,h,"linePrefix",o+1)(t):h(t)}function h(t){return null===t||s3(t)?e.check(lT,u,m)(t):(e.enter("codeFlowValue"),function t(r){return null===r||s3(r)?(e.exit("codeFlowValue"),h(r)):(e.consume(r),t)}(t))}function m(r){return e.exit("codeFenced"),t(r)}}},lA={AElig:"\xc6",AMP:"&",Aacute:"\xc1",Abreve:"Ă",Acirc:"\xc2",Acy:"А",Afr:"\uD835\uDD04",Agrave:"\xc0",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"\uD835\uDD38",ApplyFunction:"⁡",Aring:"\xc5",Ascr:"\uD835\uDC9C",Assign:"≔",Atilde:"\xc3",Auml:"\xc4",Backslash:"∖",Barv:"⫧",Barwed:"⌆",Bcy:"Б",Because:"∵",Bernoullis:"ℬ",Beta:"Β",Bfr:"\uD835\uDD05",Bopf:"\uD835\uDD39",Breve:"˘",Bscr:"ℬ",Bumpeq:"≎",CHcy:"Ч",COPY:"\xa9",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",Cayleys:"ℭ",Ccaron:"Č",Ccedil:"\xc7",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"\xb8",CenterDot:"\xb7",Cfr:"ℭ",Chi:"Χ",CircleDot:"⊙",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",Colon:"∷",Colone:"⩴",Congruent:"≡",Conint:"∯",ContourIntegral:"∮",Copf:"ℂ",Coproduct:"∐",CounterClockwiseContourIntegral:"∳",Cross:"⨯",Cscr:"\uD835\uDC9E",Cup:"⋓",CupCap:"≍",DD:"ⅅ",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",Darr:"↡",Dashv:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",Delta:"Δ",Dfr:"\uD835\uDD07",DiacriticalAcute:"\xb4",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",Diamond:"⋄",DifferentialD:"ⅆ",Dopf:"\uD835\uDD3B",Dot:"\xa8",DotDot:"⃜",DotEqual:"≐",DoubleContourIntegral:"∯",DoubleDot:"\xa8",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",Downarrow:"⇓",Dscr:"\uD835\uDC9F",Dstrok:"Đ",ENG:"Ŋ",ETH:"\xd0",Eacute:"\xc9",Ecaron:"Ě",Ecirc:"\xca",Ecy:"Э",Edot:"Ė",Efr:"\uD835\uDD08",Egrave:"\xc8",Element:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"\uD835\uDD3C",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",Equilibrium:"⇌",Escr:"ℰ",Esim:"⩳",Eta:"Η",Euml:"\xcb",Exists:"∃",ExponentialE:"ⅇ",Fcy:"Ф",Ffr:"\uD835\uDD09",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",Fopf:"\uD835\uDD3D",ForAll:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"\uD835\uDD0A",Gg:"⋙",Gopf:"\uD835\uDD3E",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"\uD835\uDCA2",Gt:"≫",HARDcy:"Ъ",Hacek:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",HilbertSpace:"ℋ",Hopf:"ℍ",HorizontalLine:"─",Hscr:"ℋ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"\xcd",Icirc:"\xce",Icy:"И",Idot:"İ",Ifr:"ℑ",Igrave:"\xcc",Im:"ℑ",Imacr:"Ī",ImaginaryI:"ⅈ",Implies:"⇒",Int:"∬",Integral:"∫",Intersection:"⋂",InvisibleComma:"⁣",InvisibleTimes:"⁢",Iogon:"Į",Iopf:"\uD835\uDD40",Iota:"Ι",Iscr:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"\xcf",Jcirc:"Ĵ",Jcy:"Й",Jfr:"\uD835\uDD0D",Jopf:"\uD835\uDD41",Jscr:"\uD835\uDCA5",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"\uD835\uDD0E",Kopf:"\uD835\uDD42",Kscr:"\uD835\uDCA6",LJcy:"Љ",LT:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Larr:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",LeftRightArrow:"↔",LeftRightVector:"⥎",LeftTee:"���",LeftTeeArrow:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",Leftarrow:"⇐",Leftrightarrow:"⇔",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",LessLess:"⪡",LessSlantEqual:"⩽",LessTilde:"≲",Lfr:"\uD835\uDD0F",Ll:"⋘",Lleftarrow:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",LongLeftRightArrow:"⟷",LongRightArrow:"⟶",Longleftarrow:"⟸",Longleftrightarrow:"⟺",Longrightarrow:"⟹",Lopf:"\uD835\uDD43",LowerLeftArrow:"↙",LowerRightArrow:"↘",Lscr:"ℒ",Lsh:"↰",Lstrok:"Ł",Lt:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"\uD835\uDD10",MinusPlus:"∓",Mopf:"\uD835\uDD44",Mscr:"ℳ",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",Nfr:"\uD835\uDD11",NoBreak:"⁠",NonBreakingSpace:"\xa0",Nopf:"ℕ",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",Nscr:"\uD835\uDCA9",Ntilde:"\xd1",Nu:"Ν",OElig:"Œ",Oacute:"\xd3",Ocirc:"\xd4",Ocy:"О",Odblac:"Ő",Ofr:"\uD835\uDD12",Ograve:"\xd2",Omacr:"Ō",Omega:"Ω",Omicron:"Ο",Oopf:"\uD835\uDD46",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",Or:"⩔",Oscr:"\uD835\uDCAA",Oslash:"\xd8",Otilde:"\xd5",Otimes:"⨷",Ouml:"\xd6",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",PartialD:"∂",Pcy:"П",Pfr:"\uD835\uDD13",Phi:"Φ",Pi:"Π",PlusMinus:"\xb1",Poincareplane:"ℌ",Popf:"ℙ",Pr:"⪻",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",Prime:"″",Product:"∏",Proportion:"∷",Proportional:"∝",Pscr:"\uD835\uDCAB",Psi:"Ψ",QUOT:'"',Qfr:"\uD835\uDD14",Qopf:"ℚ",Qscr:"\uD835\uDCAC",RBarr:"⤐",REG:"\xae",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",Rfr:"ℜ",Rho:"Ρ",RightAngleBracket:"⟩",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",Rightarrow:"⇒",Ropf:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",Rscr:"ℛ",Rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"\uD835\uDD16",ShortDownArrow:"↓",ShortLeftArrow:"←",ShortRightArrow:"→",ShortUpArrow:"↑",Sigma:"Σ",SmallCircle:"∘",Sopf:"\uD835\uDD4A",Sqrt:"√",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",Sscr:"\uD835\uDCAE",Star:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",SuchThat:"∋",Sum:"∑",Sup:"⋑",Superset:"⊃",SupersetEqual:"⊇",Supset:"⋑",THORN:"\xde",TRADE:"™",TSHcy:"Ћ",TScy:"Ц",Tab:" ",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"\uD835\uDD17",Therefore:"∴",Theta:"Θ",ThickSpace:"  ",ThinSpace:" ",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",Topf:"\uD835\uDD4B",TripleDot:"⃛",Tscr:"\uD835\uDCAF",Tstrok:"Ŧ",Uacute:"\xda",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"\xdb",Ucy:"У",Udblac:"Ű",Ufr:"\uD835\uDD18",Ugrave:"\xd9",Umacr:"Ū",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",Uopf:"\uD835\uDD4C",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",UpEquilibrium:"⥮",UpTee:"⊥",UpTeeArrow:"↥",Uparrow:"⇑",Updownarrow:"⇕",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"\uD835\uDCB0",Utilde:"Ũ",Uuml:"\xdc",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"\uD835\uDD19",Vopf:"\uD835\uDD4D",Vscr:"\uD835\uDCB1",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",Wfr:"\uD835\uDD1A",Wopf:"\uD835\uDD4E",Wscr:"\uD835\uDCB2",Xfr:"\uD835\uDD1B",Xi:"Ξ",Xopf:"\uD835\uDD4F",Xscr:"\uD835\uDCB3",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"\xdd",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"\uD835\uDD1C",Yopf:"\uD835\uDD50",Yscr:"\uD835\uDCB4",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",ZeroWidthSpace:"​",Zeta:"Ζ",Zfr:"ℨ",Zopf:"ℤ",Zscr:"\uD835\uDCB5",aacute:"\xe1",abreve:"ă",ac:"∾",acE:"∾̳",acd:"∿",acirc:"\xe2",acute:"\xb4",acy:"а",aelig:"\xe6",af:"⁡",afr:"\uD835\uDD1E",agrave:"\xe0",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",amp:"&",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"\xc5",angzarr:"⍼",aogon:"ą",aopf:"\uD835\uDD52",ap:"≈",apE:"⩰",apacir:"⩯",ape:"≊",apid:"≋",apos:"'",approx:"≈",approxeq:"≊",aring:"\xe5",ascr:"\uD835\uDCB6",ast:"*",asymp:"≈",asympeq:"≍",atilde:"\xe3",auml:"\xe4",awconint:"∳",awint:"⨑",bNot:"⫭",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",beta:"β",beth:"ℶ",between:"≬",bfr:"\uD835\uDD1F",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"\uD835\uDD53",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxh:"─",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",bprime:"‵",breve:"˘",brvbar:"\xa6",bscr:"\uD835\uDCB7",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",bumpeq:"≏",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",caron:"ˇ",ccaps:"⩍",ccaron:"č",ccedil:"\xe7",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cedil:"\xb8",cemptyv:"⦲",cent:"\xa2",centerdot:"\xb7",cfr:"\uD835\uDD20",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledR:"\xae",circledS:"Ⓢ",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",conint:"∮",copf:"\uD835\uDD54",coprod:"∐",copy:"\xa9",copysr:"℗",crarr:"↵",cross:"✗",cscr:"\uD835\uDCB8",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"\xa4",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dArr:"⇓",dHar:"⥥",dagger:"†",daleth:"ℸ",darr:"↓",dash:"‐",dashv:"⊣",dbkarow:"⤏",dblac:"˝",dcaron:"ď",dcy:"д",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",ddotseq:"⩷",deg:"\xb0",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"\uD835\uDD21",dharl:"⇃",dharr:"⇂",diam:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"\xa8",digamma:"ϝ",disin:"⋲",div:"\xf7",divide:"\xf7",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"\uD835\uDD55",dot:"˙",doteq:"≐",doteqdot:"≑",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",downarrow:"↓",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"\uD835\uDCB9",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eDDot:"⩷",eDot:"≑",eacute:"\xe9",easter:"⩮",ecaron:"ě",ecir:"≖",ecirc:"\xea",ecolon:"≕",ecy:"э",edot:"ė",ee:"ⅇ",efDot:"≒",efr:"\uD835\uDD22",eg:"⪚",egrave:"\xe8",egs:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"\uD835\uDD56",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",equals:"=",equest:"≟",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",erarr:"⥱",escr:"ℯ",esdot:"≐",esim:"≂",eta:"η",eth:"\xf0",euml:"\xeb",euro:"€",excl:"!",exist:"∃",expectation:"ℰ",exponentiale:"ⅇ",fallingdotseq:"≒",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"\uD835\uDD23",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"\uD835\uDD57",forall:"∀",fork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"\xbd",frac13:"⅓",frac14:"\xbc",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"\xbe",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"\uD835\uDCBB",gE:"≧",gEl:"⪌",gacute:"ǵ",gamma:"γ",gammad:"ϝ",gap:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",ge:"≥",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"\uD835\uDD24",gg:"≫",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",gl:"≷",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"\uD835\uDD58",grave:"`",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",hArr:"⇔",hairsp:" ",half:"\xbd",hamilt:"ℋ",hardcy:"ъ",harr:"↔",harrcir:"⥈",harrw:"↭",hbar:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"\uD835\uDD25",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"\uD835\uDD59",horbar:"―",hscr:"\uD835\uDCBD",hslash:"ℏ",hstrok:"ħ",hybull:"⁃",hyphen:"‐",iacute:"\xed",ic:"⁣",icirc:"\xee",icy:"и",iecy:"е",iexcl:"\xa1",iff:"⇔",ifr:"\uD835\uDD26",igrave:"\xec",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",image:"ℑ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",intcal:"⊺",integers:"ℤ",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iocy:"ё",iogon:"į",iopf:"\uD835\uDD5A",iota:"ι",iprod:"⨼",iquest:"\xbf",iscr:"\uD835\uDCBE",isin:"∈",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",itilde:"ĩ",iukcy:"і",iuml:"\xef",jcirc:"ĵ",jcy:"й",jfr:"\uD835\uDD27",jmath:"ȷ",jopf:"\uD835\uDD5B",jscr:"\uD835\uDCBF",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",kcedil:"ķ",kcy:"к",kfr:"\uD835\uDD28",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"\uD835\uDD5C",kscr:"\uD835\uDCC0",lAarr:"⇚",lArr:"⇐",lAtail:"⤛",lBarr:"⤎",lE:"≦",lEg:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",laquo:"\xab",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lceil:"⌈",lcub:"{",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leftarrow:"←",leftarrowtail:"↢",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",leftthreetimes:"⋋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",lessgtr:"≶",lesssim:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"\uD835\uDD29",lg:"≶",lgE:"⪑",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",ll:"≪",llarr:"⇇",llcorner:"⌞",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",longleftrightarrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"\uD835\uDD5D",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",lscr:"\uD835\uDCC1",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",ltrie:"⊴",ltrif:"◂",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"\xaf",male:"♂",malt:"✠",maltese:"✠",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",measuredangle:"∡",mfr:"\uD835\uDD2A",mho:"℧",micro:"\xb5",mid:"∣",midast:"*",midcir:"⫰",middot:"\xb7",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"\uD835\uDD5E",mp:"∓",mscr:"\uD835\uDCC2",mstpos:"∾",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nGtv:"≫̸",nLeftarrow:"⇍",nLeftrightarrow:"⇎",nLl:"⋘̸",nLt:"≪⃒",nLtv:"≪̸",nRightarrow:"⇏",nVDash:"⊯",nVdash:"⊮",nabla:"∇",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:"\xa0",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",ne:"≠",neArr:"⇗",nearhk:"⤤",nearr:"↗",nearrow:"↗",nedot:"≐̸",nequiv:"≢",nesear:"⤨",nesim:"≂̸",nexist:"∄",nexists:"∄",nfr:"\uD835\uDD2B",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",ngsim:"≵",ngt:"≯",ngtr:"≯",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",nlArr:"⇍",nlE:"≦̸",nlarr:"↚",nldr:"‥",nle:"≰",nleftarrow:"↚",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nlsim:"≴",nlt:"≮",nltri:"⋪",nltrie:"⋬",nmid:"∤",nopf:"\uD835\uDD5F",not:"\xac",notin:"∉",notinE:"⋹̸",notindot:"⋵̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"\uD835\uDCC3",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"\xf1",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",oS:"Ⓢ",oacute:"\xf3",oast:"⊛",ocir:"⊚",ocirc:"\xf4",ocy:"о",odash:"⊝",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"\uD835\uDD2C",ogon:"˛",ograve:"\xf2",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",ominus:"⊖",oopf:"\uD835\uDD60",opar:"⦷",operp:"⦹",oplus:"⊕",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"\xaa",ordm:"\xba",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oscr:"ℴ",oslash:"\xf8",osol:"⊘",otilde:"\xf5",otimes:"⊗",otimesas:"⨶",ouml:"\xf6",ovbar:"⌽",par:"∥",para:"\xb6",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"\uD835\uDD2D",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",plusmn:"\xb1",plussim:"⨦",plustwo:"⨧",pm:"\xb1",pointint:"⨕",popf:"\uD835\uDD61",pound:"\xa3",pr:"≺",prE:"⪳",prap:"⪷",prcue:"≼",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",primes:"ℙ",prnE:"⪵",prnap:"⪹",prnsim:"⋨",prod:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"\uD835\uDCC5",psi:"ψ",puncsp:" ",qfr:"\uD835\uDD2E",qint:"⨌",qopf:"\uD835\uDD62",qprime:"⁗",qscr:"\uD835\uDCC6",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',rAarr:"⇛",rArr:"⇒",rAtail:"⤜",rBarr:"⤏",rHar:"⥤",race:"∽̱",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"\xbb",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rarrw:"↝",ratail:"⤚",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rceil:"⌉",rcub:"}",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"\xae",rfisht:"⥽",rfloor:"⌋",rfr:"\uD835\uDD2F",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",rhov:"ϱ",rightarrow:"→",rightarrowtail:"↣",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",rightthreetimes:"⋌",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"\uD835\uDD63",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",rsaquo:"›",rscr:"\uD835\uDCC7",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",sbquo:"‚",sc:"≻",scE:"⪴",scap:"⪸",scaron:"š",sccue:"≽",sce:"⪰",scedil:"ş",scirc:"ŝ",scnE:"⪶",scnap:"⪺",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",seArr:"⇘",searhk:"⤥",searr:"↘",searrow:"↘",sect:"\xa7",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"\uD835\uDD30",sfrown:"⌢",sharp:"♯",shchcy:"щ",shcy:"ш",shortmid:"∣",shortparallel:"∥",shy:"\xad",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"\uD835\uDD64",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",squarf:"▪",squf:"▪",srarr:"→",sscr:"\uD835\uDCC8",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"\xaf",sub:"⊂",subE:"⫅",subdot:"⪽",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",sum:"∑",sung:"♪",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",sup:"⊃",supE:"⫆",supdot:"⪾",supdsub:"⫘",supe:"⊇",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swarhk:"⤦",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"\xdf",target:"⌖",tau:"τ",tbrk:"⎴",tcaron:"ť",tcedil:"ţ",tcy:"т",tdot:"⃛",telrec:"⌕",tfr:"\uD835\uDD31",there4:"∴",therefore:"∴",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",thinsp:" ",thkap:"≈",thksim:"∼",thorn:"\xfe",tilde:"˜",times:"\xd7",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"\uD835\uDD65",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"\uD835\uDCC9",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uArr:"⇑",uHar:"⥣",uacute:"\xfa",uarr:"↑",ubrcy:"ў",ubreve:"ŭ",ucirc:"\xfb",ucy:"у",udarr:"⇅",udblac:"ű",udhar:"⥮",ufisht:"⥾",ufr:"\uD835\uDD32",ugrave:"\xf9",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uml:"\xa8",uogon:"ų",uopf:"\uD835\uDD66",uparrow:"↑",updownarrow:"↕",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",upsi:"υ",upsih:"ϒ",upsilon:"υ",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"\uD835\uDCCA",utdot:"⋰",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"\xfc",uwangle:"⦧",vArr:"⇕",vBar:"⫨",vBarv:"⫩",vDash:"⊨",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vcy:"в",vdash:"⊢",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",vert:"|",vfr:"\uD835\uDD33",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"\uD835\uDD67",vprop:"∝",vrtri:"⊳",vscr:"\uD835\uDCCB",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",wedgeq:"≙",weierp:"℘",wfr:"\uD835\uDD34",wopf:"\uD835\uDD68",wp:"℘",wr:"≀",wreath:"≀",wscr:"\uD835\uDCCC",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"\uD835\uDD35",xhArr:"��",xharr:"⟷",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"\uD835\uDD69",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",xscr:"\uD835\uDCCD",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"\xfd",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"\xa5",yfr:"\uD835\uDD36",yicy:"ї",yopf:"\uD835\uDD6A",yscr:"\uD835\uDCCE",yucy:"ю",yuml:"\xff",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeetrf:"ℨ",zeta:"ζ",zfr:"\uD835\uDD37",zhcy:"ж",zigrarr:"⇝",zopf:"\uD835\uDD6B",zscr:"\uD835\uDCCF",zwj:"‍",zwnj:"‌"},lR={}.hasOwnProperty;function lL(e){return!!lR.call(lA,e)&&lA[e]}let lz={name:"characterReference",tokenize:function(e,t,r){let n,a,i=this,o=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),n=31,a=sX,c(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),n=6,a=s1,c):(e.enter("characterReferenceValue"),n=7,a=s0,c(t))}function c(s){if(59===s&&o){let n=e.exit("characterReferenceValue");return a!==sX||lL(i.sliceSerialize(n))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):r(s)}return a(s)&&o++1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;let d={...e[r][1].end},p={...e[u][1].start};lG(d,-s),lG(p,s),i={type:s>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:s>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:p},a={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[u][1].start}},n={type:s>1?"strong":"emphasis",start:{...i.start},end:{...o.end}},e[r][1].end={...i.start},e[u][1].start={...o.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=sV(l,[["enter",e[r][1],t],["exit",e[r][1],t]])),l=sV(l,[["enter",n,t],["enter",i,t],["exit",i,t],["enter",a,t]]),l=sV(l,l_(t.parser.constructs.insideSpan.null,e.slice(r+1,u),t)),l=sV(l,[["exit",a,t],["enter",o,t],["exit",o,t],["exit",n,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,l=sV(l,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,sH(e,r-1,u-r+3,l),u=r+l.length-c-2;break}}for(u=-1;++ui&&"whitespace"===e[a][1].type&&(a-=2),"atxHeadingSequence"===e[a][1].type&&(i===a-1||a-4>i&&"whitespace"===e[a-2][1].type)&&(a-=i+1===a?2:4),a>i&&(r={type:"atxHeadingText",start:e[i][1].start,end:e[a][1].end},n={type:"chunkText",start:e[i][1].start,end:e[a][1].end,contentType:"text"},sH(e,i,a-i+1,[["enter",r,t],["enter",n,t],["exit",n,t],["exit",r,t]])),e},tokenize:function(e,t,r){let n=0;return function(a){var i;return e.enter("atxHeading"),i=a,e.enter("atxHeadingSequence"),function a(i){return 35===i&&n++<6?(e.consume(i),a):null===i||s4(i)?(e.exit("atxHeadingSequence"),function r(n){return 35===n?(e.enter("atxHeadingSequence"),function t(n){return 35===n?(e.consume(n),t):(e.exit("atxHeadingSequence"),r(n))}(n)):null===n||s3(n)?(e.exit("atxHeading"),t(n)):s5(n)?s7(e,r,"whitespace")(n):(e.enter("atxHeadingText"),function t(n){return null===n||35===n||s4(n)?(e.exit("atxHeadingText"),r(n)):(e.consume(n),t)}(n))}(i)):r(i)}(i)}}},42:lh,45:[lS,lh],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,r){let n,a,i,o,s,l=this;return function(t){var r;return r=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(r),c};function c(o){return 33===o?(e.consume(o),u):47===o?(e.consume(o),a=!0,h):63===o?(e.consume(o),n=3,l.interrupt?t:I):sJ(o)?(e.consume(o),i=String.fromCharCode(o),m):r(o)}function u(a){return 45===a?(e.consume(a),n=2,d):91===a?(e.consume(a),n=5,o=0,p):sJ(a)?(e.consume(a),n=4,l.interrupt?t:I):r(a)}function d(n){return 45===n?(e.consume(n),l.interrupt?t:I):r(n)}function p(n){let a="CDATA[";return n===a.charCodeAt(o++)?(e.consume(n),o===a.length)?l.interrupt?t:N:p:r(n)}function h(t){return sJ(t)?(e.consume(t),i=String.fromCharCode(t),m):r(t)}function m(o){if(null===o||47===o||62===o||s4(o)){let s=47===o,c=i.toLowerCase();return!s&&!a&&lD.includes(c)?(n=1,l.interrupt?t(o):N(o)):lE.includes(i.toLowerCase())?(n=6,s)?(e.consume(o),f):l.interrupt?t(o):N(o):(n=7,l.interrupt&&!l.parser.lazy[l.now().line]?r(o):a?function t(r){return s5(r)?(e.consume(r),t):k(r)}(o):g(o))}return 45===o||sX(o)?(e.consume(o),i+=String.fromCharCode(o),m):r(o)}function f(n){return 62===n?(e.consume(n),l.interrupt?t:N):r(n)}function g(t){return 47===t?(e.consume(t),k):58===t||95===t||sJ(t)?(e.consume(t),v):s5(t)?(e.consume(t),g):k(t)}function v(t){return 45===t||46===t||58===t||95===t||sX(t)?(e.consume(t),v):x(t)}function x(t){return 61===t?(e.consume(t),y):s5(t)?(e.consume(t),x):g(t)}function y(t){return null===t||60===t||61===t||62===t||96===t?r(t):34===t||39===t?(e.consume(t),s=t,b):s5(t)?(e.consume(t),y):function t(r){return null===r||34===r||39===r||47===r||60===r||61===r||62===r||96===r||s4(r)?x(r):(e.consume(r),t)}(t)}function b(t){return t===s?(e.consume(t),s=null,w):null===t||s3(t)?r(t):(e.consume(t),b)}function w(e){return 47===e||62===e||s5(e)?g(e):r(e)}function k(t){return 62===t?(e.consume(t),j):r(t)}function j(t){return null===t||s3(t)?N(t):s5(t)?(e.consume(t),j):r(t)}function N(t){return 45===t&&2===n?(e.consume(t),D):60===t&&1===n?(e.consume(t),M):62===t&&4===n?(e.consume(t),A):63===t&&3===n?(e.consume(t),I):93===t&&5===n?(e.consume(t),T):s3(t)&&(6===n||7===n)?(e.exit("htmlFlowData"),e.check(lM,R,C)(t)):null===t||s3(t)?(e.exit("htmlFlowData"),C(t)):(e.consume(t),N)}function C(t){return e.check(lP,S,R)(t)}function S(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),E}function E(t){return null===t||s3(t)?C(t):(e.enter("htmlFlowData"),N(t))}function D(t){return 45===t?(e.consume(t),I):N(t)}function M(t){return 47===t?(e.consume(t),i="",P):N(t)}function P(t){if(62===t){let r=i.toLowerCase();return lD.includes(r)?(e.consume(t),A):N(t)}return sJ(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),P):N(t)}function T(t){return 93===t?(e.consume(t),I):N(t)}function I(t){return 62===t?(e.consume(t),A):45===t&&2===n?(e.consume(t),I):N(t)}function A(t){return null===t||s3(t)?(e.exit("htmlFlowData"),R(t)):(e.consume(t),A)}function R(r){return e.exit("htmlFlow"),t(r)}}},61:lS,95:lh,96:lI,126:lI},lQ={38:lz,92:lO},l0={[-5]:lF,[-4]:lF,[-3]:lF,33:lH,38:lz,42:lW,60:[{name:"autolink",tokenize:function(e,t,r){let n=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a};function a(t){return sJ(t)?(e.consume(t),i):64===t?r(t):s(t)}function i(t){return 43===t||45===t||46===t||sX(t)?(n=1,function t(r){return 58===r?(e.consume(r),n=0,o):(43===r||45===r||46===r||sX(r))&&n++<32?(e.consume(r),t):(n=0,s(r))}(t)):s(t)}function o(n){return 62===n?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):null===n||32===n||60===n||sQ(n)?r(n):(e.consume(n),o)}function s(t){return 64===t?(e.consume(t),l):sZ(t)?(e.consume(t),s):r(t)}function l(a){return sX(a)?function a(i){return 46===i?(e.consume(i),n=0,l):62===i?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(i),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(i){if((45===i||sX(i))&&n++<63){let r=45===i?t:a;return e.consume(i),r}return r(i)}(i)}(a):r(a)}}},{name:"htmlText",tokenize:function(e,t,r){let n,a,i,o=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),b):63===t?(e.consume(t),x):sJ(t)?(e.consume(t),k):r(t)}function l(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),a=0,h):sJ(t)?(e.consume(t),v):r(t)}function c(t){return 45===t?(e.consume(t),p):r(t)}function u(t){return null===t?r(t):45===t?(e.consume(t),d):s3(t)?(i=u,P(t)):(e.consume(t),u)}function d(t){return 45===t?(e.consume(t),p):u(t)}function p(e){return 62===e?M(e):45===e?d(e):u(e)}function h(t){let n="CDATA[";return t===n.charCodeAt(a++)?(e.consume(t),a===n.length?m:h):r(t)}function m(t){return null===t?r(t):93===t?(e.consume(t),f):s3(t)?(i=m,P(t)):(e.consume(t),m)}function f(t){return 93===t?(e.consume(t),g):m(t)}function g(t){return 62===t?M(t):93===t?(e.consume(t),g):m(t)}function v(t){return null===t||62===t?M(t):s3(t)?(i=v,P(t)):(e.consume(t),v)}function x(t){return null===t?r(t):63===t?(e.consume(t),y):s3(t)?(i=x,P(t)):(e.consume(t),x)}function y(e){return 62===e?M(e):x(e)}function b(t){return sJ(t)?(e.consume(t),w):r(t)}function w(t){return 45===t||sX(t)?(e.consume(t),w):function t(r){return s3(r)?(i=t,P(r)):s5(r)?(e.consume(r),t):M(r)}(t)}function k(t){return 45===t||sX(t)?(e.consume(t),k):47===t||62===t||s4(t)?j(t):r(t)}function j(t){return 47===t?(e.consume(t),M):58===t||95===t||sJ(t)?(e.consume(t),N):s3(t)?(i=j,P(t)):s5(t)?(e.consume(t),j):M(t)}function N(t){return 45===t||46===t||58===t||95===t||sX(t)?(e.consume(t),N):function t(r){return 61===r?(e.consume(r),C):s3(r)?(i=t,P(r)):s5(r)?(e.consume(r),t):j(r)}(t)}function C(t){return null===t||60===t||61===t||62===t||96===t?r(t):34===t||39===t?(e.consume(t),n=t,S):s3(t)?(i=C,P(t)):s5(t)?(e.consume(t),C):(e.consume(t),E)}function S(t){return t===n?(e.consume(t),n=void 0,D):null===t?r(t):s3(t)?(i=S,P(t)):(e.consume(t),S)}function E(t){return null===t||34===t||39===t||60===t||61===t||96===t?r(t):47===t||62===t||s4(t)?j(t):(e.consume(t),E)}function D(e){return 47===e||62===e||s4(e)?j(e):r(e)}function M(n){return 62===n?(e.consume(n),e.exit("htmlTextData"),e.exit("htmlText"),t):r(n)}function P(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),T}function T(t){return s5(t)?s7(e,I,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):I(t)}function I(t){return e.enter("htmlTextData"),i(t)}}}],91:lK,92:[{name:"hardBreakEscape",tokenize:function(e,t,r){return function(t){return e.enter("hardBreakEscape"),e.consume(t),n};function n(n){return s3(n)?(e.exit("hardBreakEscape"),t(n)):r(n)}}},lO],93:lq,95:lW,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,r,n=e.length-4,a=3;if(("lineEnding"===e[3][1].type||"space"===e[a][1].type)&&("lineEnding"===e[n][1].type||"space"===e[n][1].type)){for(t=a;++t13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(65535&r)==65535||(65535&r)==65534||r>1114111?"�":String.fromCodePoint(r)}let l6=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function l8(e,t,r){if(t)return t;if(35===r.charCodeAt(0)){let e=r.charCodeAt(1),t=120===e||88===e;return l5(r.slice(t?2:1),t?16:10)}return lL(r)||e}let l9={}.hasOwnProperty;function l7(e){return{line:e.line,column:e.column,offset:e.offset}}function ce(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+sk({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+sk({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+sk({start:t.start,end:t.end})+") is still open")}function ct(e){let t=this;t.parser=function(r){var n,a;let i,s,l,c;return"string"!=typeof(n={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(a=n,n=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:n(v),autolinkProtocol:c,autolinkEmail:c,atxHeading:n(m),blockQuote:n(function(){return{type:"blockquote",children:[]}}),characterEscape:c,characterReference:c,codeFenced:n(h),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:n(h,a),codeText:n(function(){return{type:"inlineCode",value:""}},a),codeTextData:c,data:c,codeFlowValue:c,definition:n(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:n(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:n(f),hardBreakTrailing:n(f),htmlFlow:n(g,a),htmlFlowData:c,htmlText:n(g,a),htmlTextData:c,image:n(function(){return{type:"image",title:null,url:"",alt:null}}),label:a,link:n(v),listItem:n(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:n(x,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:n(x),paragraph:n(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:n(m),strong:n(function(){return{type:"strong",children:[]}}),thematicBreak:n(function(){return{type:"thematicBreak"}})},exit:{atxHeading:o(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:o(),autolinkEmail:function(e){u.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){u.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:o(),characterEscapeValue:u,characterReferenceMarkerHexadecimal:p,characterReferenceMarkerNumeric:p,characterReferenceValue:function(e){let t,r=this.sliceSerialize(e),n=this.data.characterReferenceType;n?(t=l5(r,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):t=lL(r);let a=this.stack[this.stack.length-1];a.value+=t},characterReference:function(e){this.stack.pop().position.end=l7(e.end)},codeFenced:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:u,codeIndented:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:u,data:u,definition:o(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),r=this.stack[this.stack.length-1];r.label=t,r.identifier=lk(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:o(),hardBreakEscape:o(d),hardBreakTrailing:o(d),htmlFlow:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:u,htmlText:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:u,image:o(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),r=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===r.type?r.children=e.children:r.alt=t},labelText:function(e){let t=this.sliceSerialize(e),r=this.stack[this.stack.length-2];r.label=t.replace(l6,l8),r.identifier=lk(t).toLowerCase()},lineEnding:function(e){let r=this.stack[this.stack.length-1];if(this.data.atHardBreak){r.children[r.children.length-1].position.end=l7(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(r.type)&&(c.call(this,e),u.call(this,e))},link:o(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:o(),listOrdered:o(),listUnordered:o(),paragraph:o(),referenceString:function(e){let t=this.resume(),r=this.stack[this.stack.length-1];r.label=t,r.identifier=lk(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:o(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:o(),thematicBreak:o()}};!function e(t,r){let n=-1;for(;++n0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||ce).call(o,void 0,e[0])}for(n.position={start:l7(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:l7(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u-1){let e=r[0];"string"==typeof e?r[0]=e.slice(a):r.shift()}o>0&&r.push(e[i].slice(0,o))}return r}(o,e)}function p(){let{_bufferIndex:e,_index:t,line:r,column:a,offset:i}=n;return{_bufferIndex:e,_index:t,line:r,column:a,offset:i}}function h(e,t){t.restore()}function m(e,t){return function(r,a,i){var o;let u,d,h,m;return Array.isArray(r)?f(r):"tokenize"in r?f([r]):(o=r,function(e){let t=null!==e&&o[e],r=null!==e&&o.null;return f([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(r)?r:r?[r]:[]])(e)});function f(e){return(u=e,d=0,0===e.length)?i:v(e[d])}function v(e){return function(r){return(m=function(){let e=p(),t=c.previous,r=c.currentConstruct,a=c.events.length,i=Array.from(s);return{from:a,restore:function(){n=e,c.previous=t,c.currentConstruct=r,c.events.length=a,s=i,g()}}}(),h=e,e.partial||(c.currentConstruct=e),e.name&&c.parser.constructs.disable.null.includes(e.name))?y(r):e.tokenize.call(t?Object.assign(Object.create(c),t):c,l,x,y)(r)}}function x(t){return e(h,m),a}function y(e){return(m.restore(),++d{let r=(t,r)=>(e.set(r,t),t),n=a=>{if(e.has(a))return e.get(a);let[i,o]=t[a];switch(i){case 0:case -1:return r(o,a);case 1:{let e=r([],a);for(let t of o)e.push(n(t));return e}case 2:{let e=r({},a);for(let[t,r]of o)e[n(t)]=n(r);return e}case 3:return r(new Date(o),a);case 4:{let{source:e,flags:t}=o;return r(new RegExp(e,t),a)}case 5:{let e=r(new Map,a);for(let[t,r]of o)e.set(n(t),n(r));return e}case 6:{let e=r(new Set,a);for(let t of o)e.add(n(t));return e}case 7:{let{name:e,message:t}=o;return r(new cr[e](t),a)}case 8:return r(BigInt(o),a);case"BigInt":return r(Object(BigInt(o)),a);case"ArrayBuffer":return r(new Uint8Array(o).buffer,o);case"DataView":{let{buffer:e}=new Uint8Array(o);return r(new DataView(e),o)}}return r(new cr[i](o),a)};return n},ca=e=>cn(new Map,e)(0),{toString:ci}={},{keys:co}=Object,cs=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let r=ci.call(e).slice(8,-1);switch(r){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,r]}return r.includes("Array")?[1,r]:r.includes("Error")?[7,r]:[2,r]},cl=([e,t])=>0===e&&("function"===t||"symbol"===t),cc=(e,t,r,n)=>{let a=(e,t)=>{let a=n.push(e)-1;return r.set(t,a),a},i=n=>{if(r.has(n))return r.get(n);let[o,s]=cs(n);switch(o){case 0:{let t=n;switch(s){case"bigint":o=8,t=n.toString();break;case"function":case"symbol":if(e)throw TypeError("unable to serialize "+s);t=null;break;case"undefined":return a([-1],n)}return a([o,t],n)}case 1:{if(s){let e=n;return"DataView"===s?e=new Uint8Array(n.buffer):"ArrayBuffer"===s&&(e=new Uint8Array(n)),a([s,[...e]],n)}let e=[],t=a([o,e],n);for(let t of n)e.push(i(t));return t}case 2:{if(s)switch(s){case"BigInt":return a([s,n.toString()],n);case"Boolean":case"Number":case"String":return a([s,n.valueOf()],n)}if(t&&"toJSON"in n)return i(n.toJSON());let r=[],l=a([o,r],n);for(let t of co(n))(e||!cl(cs(n[t])))&&r.push([i(t),i(n[t])]);return l}case 3:return a([o,n.toISOString()],n);case 4:{let{source:e,flags:t}=n;return a([o,{source:e,flags:t}],n)}case 5:{let t=[],r=a([o,t],n);for(let[r,a]of n)(e||!(cl(cs(r))||cl(cs(a))))&&t.push([i(r),i(a)]);return r}case 6:{let t=[],r=a([o,t],n);for(let r of n)(e||!cl(cs(r)))&&t.push(i(r));return r}}let{message:l}=n;return a([o,{name:s,message:l}],n)};return i},cu=(e,{json:t,lossy:r}={})=>{let n=[];return cc(!(t||r),!!t,new Map,n)(e),n},cd="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?ca(cu(e,t)):structuredClone(e):(e,t)=>ca(cu(e,t));function cp(e){let t=[],r=-1,n=0,a=0;for(;++r55295&&i<57344){let t=e.charCodeAt(r+1);i<56320&&t>56319&&t<57344?(o=String.fromCharCode(i,t),a=1):o="�"}else o=String.fromCharCode(i);o&&(t.push(e.slice(n,r),encodeURIComponent(o)),n=r+a+1,o=""),a&&(r+=a,a=0)}return t.join("")+e.slice(n)}function ch(e,t){let r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function cm(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let cf=function(e){var t,r;if(null==e)return cv;if("function"==typeof e)return cg(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],r=-1;for(;++r":"")+"\x1b[39m)"})}return i;function i(){var a;let i,o,s,h=cx;if((!l||d(t,r,n[n.length-1]||void 0))&&!1===(h=Array.isArray(a=c(t,n))?a:"number"==typeof a?[!0,a]:null==a?cx:[a])[0])return h;if("children"in t&&t.children&&t.children&&"skip"!==h[0])for(o=(u?t.children.length:-1)+p,s=n.concat(t);o>-1&&o1:t}function ck(e,t,r){let n=0,a=e.length;if(t){let t=e.codePointAt(n);for(;9===t||32===t;)n++,t=e.codePointAt(n)}if(r){let t=e.codePointAt(a-1);for(;9===t||32===t;)a--,t=e.codePointAt(a-1)}return a>n?e.slice(n,a):""}let cj={blockquote:function(e,t){let r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)},break:function(e,t){let r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:"\n"}]},code:function(e,t){let r=t.value?t.value+"\n":"",n={};t.lang&&(n.className=["language-"+t.lang]);let a={type:"element",tagName:"code",properties:n,children:[{type:"text",value:r}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a={type:"element",tagName:"pre",properties:{},children:[a=e.applyData(t,a)]},e.patch(t,a),a},delete:function(e,t){let r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},emphasis:function(e,t){let r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},footnoteReference:function(e,t){let r,n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),i=cp(a.toLowerCase()),o=e.footnoteOrder.indexOf(a),s=e.footnoteCounts.get(a);void 0===s?(s=0,e.footnoteOrder.push(a),r=e.footnoteOrder.length):r=o+1,s+=1,e.footnoteCounts.set(a,s);let l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(r)}]};e.patch(t,l);let c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){let r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},html:function(e,t){if(e.options.allowDangerousHtml){let r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}},imageReference:function(e,t){let r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return cb(e,t);let a={src:cp(n.url||""),alt:t.alt};null!==n.title&&void 0!==n.title&&(a.title=n.title);let i={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){let r={src:cp(t.url)};null!==t.alt&&void 0!==t.alt&&(r.alt=t.alt),null!==t.title&&void 0!==t.title&&(r.title=t.title);let n={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,n),e.applyData(t,n)},inlineCode:function(e,t){let r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);let n={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,n),e.applyData(t,n)},linkReference:function(e,t){let r=String(t.identifier).toUpperCase(),n=e.definitionById.get(r);if(!n)return cb(e,t);let a={href:cp(n.url||"")};null!==n.title&&void 0!==n.title&&(a.title=n.title);let i={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){let r={href:cp(t.url)};null!==t.title&&void 0!==t.title&&(r.title=t.title);let n={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},listItem:function(e,t,r){let n=e.all(t),a=r?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let r=e.children,n=-1;for(;!t&&++n0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let s=-1;for(;++s0){let n={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},i=sb(t.children[1]),o=sy(t.children[t.children.length-1]);i&&o&&(n.position={start:i,end:o}),a.push(n)}let i={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,i),e.applyData(t,i)},tableCell:function(e,t){let r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},tableRow:function(e,t,r){let n=r?r.children:void 0,a=0===(n?n.indexOf(t):1)?"th":"td",i=r&&"table"===r.type?r.align:void 0,o=i?i.length:t.children.length,s=-1,l=[];for(;++s0,!0),n[0]),a=n.index+n[0].length,n=r.exec(t);return i.push(ck(t.slice(a),a>0,!1)),i.join("")}(String(t.value))};return e.patch(t,r),e.applyData(t,r)},thematicBreak:function(e,t){let r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)},toml:cN,yaml:cN,definition:cN,footnoteDefinition:cN};function cN(){}let cC={}.hasOwnProperty,cS={};function cE(e,t){e.position&&(t.position=function(e){let t=sb(e),r=sy(e);if(t&&r)return{start:t,end:r}}(e))}function cD(e,t){let r=t;if(e&&e.data){let t=e.data.hName,n=e.data.hChildren,a=e.data.hProperties;"string"==typeof t&&("element"===r.type?r.tagName=t:r={type:"element",tagName:t,properties:{},children:"children"in r?r.children:[r]}),"element"===r.type&&a&&Object.assign(r.properties,cd(a)),"children"in r&&r.children&&null!=n&&(r.children=n)}return r}function cM(e,t){let r=[],n=-1;for(t&&r.push({type:"text",value:"\n"});++n0&&r.push({type:"text",value:"\n"}),r}function cP(e){let t=0,r=e.charCodeAt(t);for(;9===r||32===r;)t++,r=e.charCodeAt(t);return e.slice(t)}function cT(e,t){let r=function(e,t){let r=t||cS,n=new Map,a=new Map,i={all:function(e){let t=[];if("children"in e){let r=e.children,n=-1;for(;++n0&&d.push({type:"text",value:" "});let e="string"==typeof r?r:r(l,u);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof n?n:n(l,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let h=i[i.length-1];if(h&&"element"===h.type&&"p"===h.tagName){let e=h.children[h.children.length-1];e&&"text"===e.type?e.value+=" ":h.children.push({type:"text",value:" "}),h.children.push(...d)}else i.push(...d);let m={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(i,!0)};e.patch(a,m),s.push(m)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...cd(o),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(r),i=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return a&&i.children.push({type:"text",value:"\n"},a),i}function cI(e,t){return e&&"run"in e?async function(r,n){let a=cT(r,{file:n,...t});await e.run(a,n)}:function(r,n){return cT(r,{file:n,...e||t})}}function cA(e){if(e)throw e}var cR=r(19566);function cL(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let cz=require("node:path"),cO=require("node:process");function cF(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let c_=require("node:url"),cq=["history","path","basename","stem","extname","dirname"];class cB{constructor(e){let t,r;t=e?cF(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":cO.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++nt.length;o&&t.push(n);try{i=e.apply(this,t)}catch(e){if(o&&r)throw e;return n(e)}o||(i&&i.then&&"function"==typeof i.then?i.then(a,n):i instanceof Error?n(i):a(i))};function n(e,...a){r||(r=!0,t(e,...a))}function a(e){n(null,e)}})(s,a)(...o):n(null,...o)}(null,...t)},use:function(r){if("function"!=typeof r)throw TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),t}};return t}()}copy(){let e=new cG,t=-1;for(;++t0){let[n,...i]=t,o=r[a][1];cL(o)&&cL(n)&&(n=cR(!0,o,n)),r[a]=[e,n,...i]}}}}let cK=new cG().freeze();function cY(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function cJ(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function cX(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function cZ(e){if(!cL(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function cQ(e,t,r){if(!r)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function c0(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new cB(e)}let c1=[],c2={allowDangerousHtml:!0},c3=/^(https?|ircs?|mailto|xmpp)$/i,c4=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function c5(e){let t=function(e){let t=e.rehypePlugins||c1,r=e.remarkPlugins||c1,n=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...c2}:c2;return cK().use(ct).use(r).use(cI,n).use(t)}(e),r=function(e){let t=e.children||"",r=new cB;return"string"==typeof t&&(r.value=t),r}(e);return function(e,t){let r=t.allowedElements,n=t.allowElement,a=t.components,i=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||c6;for(let e of c4)Object.hasOwn(t,e.from)&&(e.from,e.to&&e.to,e.id);return cy(e,function(e,t,a){if("raw"===e.type&&a&&"number"==typeof t)return o?a.children.splice(t,1):a.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in sq)if(Object.hasOwn(sq,t)&&Object.hasOwn(e.properties,t)){let r=e.properties[t],n=sq[t];(null===n||n.includes(e.tagName))&&(e.properties[t]=c(String(r||""),t,e))}}if("element"===e.type){let o=r?!r.includes(e.tagName):!!i&&i.includes(e.tagName);if(!o&&n&&"number"==typeof t&&(o=!n(e,t,a)),o&&a&&"number"==typeof t)return l&&e.children?a.children.splice(t,1,...e.children):a.children.splice(t,1),t}}),function(e,t){var r,n,a,i,o;let s;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let l=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=l,n=t.jsxDEV,s=function(e,t,a,i){let o=Array.isArray(a.children),s=sb(e);return n(t,a,i,o,{columnNumber:s?s.column-1:void 0,fileName:r,lineNumber:s?s.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");a=0,i=t.jsx,o=t.jsxs,s=function(e,t,r,n){let a=Array.isArray(r.children)?o:i;return n?a(t,r,n):a(t,r)}}let c={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:l,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?sd:su,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},u=sA(c,e,void 0);return u&&"string"!=typeof u?u:c.create(e,c.Fragment,{children:u||void 0},void 0)}(e,{Fragment:s.Fragment,components:a,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0})}(t.runSync(t.parse(r),r),e)}function c6(e){let t=e.indexOf(":"),r=e.indexOf("?"),n=e.indexOf("#"),a=e.indexOf("/");return -1===t||-1!==a&&t>a||-1!==r&&t>r||-1!==n&&t>n||c3.test(e.slice(0,t))?e:""}function c8({content:e,className:t}){return(0,s.jsx)("div",{className:(0,h.cn)("prose prose-sm dark:prose-invert max-w-none",t),children:(0,s.jsx)(c5,{components:{h1:({children:e})=>(0,s.jsx)("h1",{className:"text-xl font-bold mb-2 mt-4",children:e}),h2:({children:e})=>(0,s.jsx)("h2",{className:"text-lg font-semibold mb-2 mt-3",children:e}),h3:({children:e})=>(0,s.jsx)("h3",{className:"text-base font-semibold mb-1 mt-2",children:e}),h4:({children:e})=>(0,s.jsx)("h4",{className:"text-sm font-semibold mb-1 mt-2",children:e}),p:({children:e})=>(0,s.jsx)("p",{className:"mb-2 last:mb-0",children:e}),ul:({children:e})=>(0,s.jsx)("ul",{className:"list-disc pl-5 mb-2 space-y-0.5",children:e}),ol:({children:e})=>(0,s.jsx)("ol",{className:"list-decimal pl-5 mb-2 space-y-0.5",children:e}),li:({children:e})=>(0,s.jsx)("li",{className:"text-sm",children:e}),code:({className:e,children:t,...r})=>/language-(\w+)/.exec(e||"")?(0,s.jsx)("pre",{className:"p-3 rounded-md bg-muted overflow-x-auto mb-2",children:(0,s.jsx)("code",{className:"font-mono text-xs",children:t})}):(0,s.jsx)("code",{className:"px-1.5 py-0.5 rounded bg-muted font-mono text-xs",...r,children:t}),blockquote:({children:e})=>(0,s.jsx)("blockquote",{className:"border-l-2 border-muted-foreground/30 pl-3 py-0.5 mb-2 italic text-muted-foreground",children:e}),a:({href:e,children:t})=>(0,s.jsx)("a",{href:e,className:"text-primary hover:underline",target:"_blank",rel:"noopener noreferrer",children:t}),strong:({children:e})=>(0,s.jsx)("strong",{className:"font-semibold",children:e}),em:({children:e})=>(0,s.jsx)("em",{className:"italic",children:e}),hr:()=>(0,s.jsx)("hr",{className:"my-3 border-muted"}),table:({children:e})=>(0,s.jsx)("div",{className:"overflow-x-auto mb-2",children:(0,s.jsx)("table",{className:"min-w-full divide-y divide-muted",children:e})}),thead:({children:e})=>(0,s.jsx)("thead",{className:"bg-muted/30",children:e}),tbody:({children:e})=>(0,s.jsx)("tbody",{className:"divide-y divide-muted",children:e}),tr:({children:e})=>(0,s.jsx)("tr",{children:e}),th:({children:e})=>(0,s.jsx)("th",{className:"px-2 py-1 text-left text-xs font-medium",children:e}),td:({children:e})=>(0,s.jsx)("td",{className:"px-2 py-1 text-xs",children:e})},children:e})})}let c9={shell:(0,s.jsx)(tJ,{className:"h-3 w-3 text-blue-500"}),json_patch:(0,s.jsx)(x,{className:"h-3 w-3 text-orange-500"}),evaluation:(0,s.jsx)(oq.A,{className:"h-3 w-3 text-orange-500"}),complete_task:(0,s.jsx)(oq.A,{className:"h-3 w-3 text-green-500"})},c7={pending:(0,s.jsx)(n_.A,{className:"h-3 w-3 animate-spin text-gray-400"}),executing:(0,s.jsx)(n_.A,{className:"h-3 w-3 animate-spin text-blue-500"}),completed:(0,s.jsx)(oq.A,{className:"h-3 w-3 text-green-500"}),failed:(0,s.jsx)(oB.A,{className:"h-3 w-3 text-red-500"})};function ue({content:e,toolCalls:t=[],toolMessages:r,checkpointId:n,onRestore:a,onRetry:i,isSavedCheckpoint:o,isExecuting:l=!1,className:c,cost:d,usage:p}){let[f,g]=u().useState(new Set),[v,x]=u().useState(!1),{shouldShowCosts:y}=a4(),b=!!(e&&""!==e.trim()),w=e=>{let t=new Set(f);t.has(e)?t.delete(e):t.add(e),g(t)},k=n&&(a||i)&&!l?(0,s.jsxs)("div",{className:"pt-2 flex flex-wrap items-center gap-2","data-tour-id":"checkpoint-actions",children:[(0,s.jsx)(rO.E,{variant:o?"default":"outline",className:"h-6 px-2 text-xs",children:o?"Saved version":"Checkpoint"}),a&&(0,s.jsxs)(m.$,{size:"sm",variant:"ghost",onClick:()=>a(n),className:"h-7 text-xs","data-tour-id":"checkpoint-restore-button",children:[(0,s.jsx)(aQ,{className:"h-3 w-3 mr-1"}),"Restore"]}),i&&(0,s.jsxs)(m.$,{size:"sm",variant:"ghost",onClick:()=>i(n),className:"h-7 text-xs","data-tour-id":"checkpoint-retry-button",children:[(0,s.jsx)(o$,{className:"h-3 w-3 mr-1"}),"Retry"]})]}):null;return r&&r.length>0?(0,s.jsxs)("div",{className:(0,h.cn)("space-y-2",c),children:[b&&(0,s.jsx)("div",{className:"text-sm text-foreground/90",children:(0,s.jsx)(c8,{content:e??""})}),y&&(void 0!==d||p)&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[void 0!==d&&(0,s.jsxs)(rO.E,{variant:"secondary",className:"text-xs cursor-pointer",onClick:()=>x(!v),children:[(0,s.jsx)(S,{className:"h-3 w-3 mr-1"}),np.U.formatCost(d)]}),p&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(rO.E,{variant:"outline",className:"text-xs",children:[(0,s.jsx)(oU.A,{className:"h-3 w-3 mr-1"}),p.totalTokens.toLocaleString()," tokens"]}),p.provider&&(0,s.jsxs)(rO.E,{variant:"outline",className:"text-xs",children:[p.provider,p.model&&` / ${p.model.split("/").pop()}`]})]}),v&&p&&(0,s.jsxs)("div",{className:"w-full mt-2 p-2 bg-muted/30 rounded text-xs space-y-1",children:[(0,s.jsxs)("div",{children:["Input: ",p.promptTokens.toLocaleString()," tokens"]}),(0,s.jsxs)("div",{children:["Output: ",p.completionTokens.toLocaleString()," tokens"]}),(0,s.jsxs)("div",{children:["Total: ",p.totalTokens.toLocaleString()," tokens"]}),void 0!==d&&(0,s.jsxs)("div",{className:"font-medium",children:["Cost: ",np.U.formatCost(d)]})]})]}),r.map(e=>"message"===e.type?(0,s.jsx)("div",{className:"text-sm text-foreground/90 bg-muted/20 px-3 py-2 rounded",children:(0,s.jsx)(c8,{content:e.content||""})},e.id):"divider"===e.type?(0,s.jsxs)("div",{className:"flex items-center gap-2 my-2",children:[(0,s.jsx)("div",{className:"flex-1 h-px bg-border"}),(0,s.jsx)("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground whitespace-nowrap",children:e.title||"Section"}),(0,s.jsx)("div",{className:"flex-1 h-px bg-border"})]},e.id):(0,s.jsxs)("div",{className:(0,h.cn)("bg-muted/30 rounded-md transition-all",f.has(e.id)?"p-2":"p-1.5"),children:[(0,s.jsxs)("button",{onClick:()=>w(e.id),className:"flex items-center gap-2 w-full text-left hover:bg-muted/50 rounded px-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:["evaluation"===e.name?e.parameters?.goal_achieved?(0,s.jsx)(oq.A,{className:"h-3 w-3 text-green-500"}):(0,s.jsx)(oB.A,{className:"h-3 w-3 text-red-500"}):e.name&&c9[""===e.name&&e.parameters?.tool||e.name]||(0,s.jsx)(tJ,{className:"h-3 w-3"}),(0,s.jsx)("span",{className:"text-xs font-mono",children:"shell"===e.name&&e.parameters?.cmd?.[0]?e.parameters.cmd[0]:""===e.name&&e.parameters?.tool||e.name})]}),"shell"===e.name&&e.parameters?.cmd?(0,s.jsx)("code",{className:"text-xs text-muted-foreground",children:(()=>{let t=e.parameters.cmd;if(Array.isArray(t)){let e=t.slice(1).join(" ");return e.substring(0,50)+(e.length>50?"...":"")}return"string"==typeof t?t.substring(0,50)+(t.length>50?"...":""):JSON.stringify(t).substring(0,50)})()}):(e.parameters?.path||e.parameters?.file_path)&&(0,s.jsx)("code",{className:"text-xs text-muted-foreground",children:e.parameters.path||e.parameters.file_path}),(0,s.jsx)("div",{className:"ml-auto",children:c7[e.status||"completed"]})]}),"complete_task"===e.name&&e.parameters?.summary&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-green-600 dark:text-green-400",children:e.parameters.summary})}),""===e.name&&e.parameters?.description&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:e.parameters.description})}),"evaluation"===e.name&&e.parameters&&(0,s.jsxs)("div",{className:"px-2 py-1 mt-1 space-y-2",children:[(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:e.parameters.reasoning}),(0,s.jsxs)("div",{className:"flex items-center gap-3 text-xs",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[e.parameters.goal_achieved?(0,s.jsx)(oq.A,{className:"h-3 w-3 text-green-500"}):(0,s.jsx)(oB.A,{className:"h-3 w-3 text-red-500"}),(0,s.jsx)("span",{className:e.parameters.goal_achieved?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400",children:e.parameters.goal_achieved?"Goal achieved":"Goal not achieved"})]}),!e.parameters.should_continue&&(0,s.jsxs)("div",{className:"flex items-center gap-1 text-muted-foreground",children:[(0,s.jsx)("span",{children:"•"}),(0,s.jsx)("span",{children:"Stopping"})]})]})]}),e.result?.error&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsxs)("span",{className:"text-xs text-red-500",children:["Error: ",e.result.error]})}),"shell"===e.name&&e.result?.success===!1&&e.result?.stderr&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-red-500",children:e.result.stderr})}),f.has(e.id)&&(0,s.jsxs)("div",{className:"mt-2 pl-5 space-y-1 text-xs",children:[e.parameters&&Object.keys(e.parameters).length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Parameters:"}),(0,s.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded overflow-x-auto",children:JSON.stringify(e.parameters,null,2)})]}),e.result&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Result:"}),(0,s.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded overflow-x-auto max-h-32",children:"string"==typeof e.result?e.result:JSON.stringify(e.result,null,2)})]})]})]},e.id)),k]}):(0,s.jsxs)("div",{className:(0,h.cn)("space-y-2",c),children:[b&&(0,s.jsx)("div",{className:"text-sm text-foreground/90",children:(0,s.jsx)(c8,{content:e??""})}),y&&(void 0!==d||p)&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-2",children:[void 0!==d&&(0,s.jsxs)(rO.E,{variant:"secondary",className:"text-xs cursor-pointer",onClick:()=>x(!v),children:[(0,s.jsx)(S,{className:"h-3 w-3 mr-1"}),np.U.formatCost(d)]}),p&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(rO.E,{variant:"outline",className:"text-xs",children:[(0,s.jsx)(oU.A,{className:"h-3 w-3 mr-1"}),p.totalTokens.toLocaleString()," tokens"]}),p.provider&&(0,s.jsxs)(rO.E,{variant:"outline",className:"text-xs",children:[p.provider,p.model&&` / ${p.model.split("/").pop()}`]})]}),v&&p&&(0,s.jsxs)("div",{className:"w-full mt-2 p-2 bg-muted/30 rounded text-xs space-y-1",children:[(0,s.jsxs)("div",{children:["Input: ",p.promptTokens.toLocaleString()," tokens"]}),(0,s.jsxs)("div",{children:["Output: ",p.completionTokens.toLocaleString()," tokens"]}),(0,s.jsxs)("div",{children:["Total: ",p.totalTokens.toLocaleString()," tokens"]}),void 0!==d&&(0,s.jsxs)("div",{className:"font-medium",children:["Cost: ",np.U.formatCost(d)]})]})]}),t.length>0&&(0,s.jsx)("div",{className:"space-y-1",children:t.map((e,t)=>(0,s.jsxs)("div",{className:(0,h.cn)("bg-muted/30 rounded-md transition-all",f.has(String(t))?"p-2":"p-1.5"),children:[(0,s.jsxs)("button",{onClick:()=>w(String(t)),className:"flex items-center gap-2 w-full text-left hover:bg-muted/50 rounded px-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:["evaluation"===e.name?e.parameters?.goal_achieved?(0,s.jsx)(oq.A,{className:"h-3 w-3 text-green-500"}):(0,s.jsx)(oB.A,{className:"h-3 w-3 text-red-500"}):e.name&&c9[""===e.name&&e.parameters?.tool||e.name]||(0,s.jsx)(tJ,{className:"h-3 w-3"}),(0,s.jsx)("span",{className:"text-xs font-mono",children:"shell"===e.name&&e.parameters?.cmd?.[0]?e.parameters.cmd[0]:""===e.name&&e.parameters?.tool||e.name})]}),"shell"===e.name&&e.parameters?.cmd?(0,s.jsx)("code",{className:"text-xs text-muted-foreground",children:(()=>{let t=e.parameters.cmd;if(Array.isArray(t)){let e=t.slice(1).join(" ");return e.substring(0,50)+(e.length>50?"...":"")}return"string"==typeof t?t.substring(0,50)+(t.length>50?"...":""):JSON.stringify(t).substring(0,50)})()}):(e.parameters?.path||e.parameters?.file_path)&&(0,s.jsx)("code",{className:"text-xs text-muted-foreground",children:e.parameters.path||e.parameters.file_path}),(0,s.jsx)("div",{className:"ml-auto",children:c7[e.status||"completed"]})]}),"complete_task"===e.name&&e.parameters?.summary&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-green-600 dark:text-green-400",children:e.parameters.summary})}),""===e.name&&e.parameters?.description&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:e.parameters.description})}),e.result?.error&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsxs)("span",{className:"text-xs text-red-500",children:["Error: ",e.result.error]})}),"shell"===e.name&&e.result?.success===!1&&e.result?.stderr&&(0,s.jsx)("div",{className:"px-2 py-1 mt-1",children:(0,s.jsx)("span",{className:"text-xs text-red-500",children:e.result.stderr})}),f.has(String(t))&&(0,s.jsxs)("div",{className:"mt-2 pl-5 space-y-1 text-xs",children:[e.parameters&&Object.keys(e.parameters).length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Parameters:"}),(0,s.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded overflow-x-auto",children:JSON.stringify(e.parameters,null,2)})]}),e.result&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"Result:"}),(0,s.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded overflow-x-auto max-h-32",children:"string"==typeof e.result?e.result:JSON.stringify(e.result,null,2)})]})]})]},t))}),k]})}var ut=r(97815);function ur({project:e,onBack:t}){let[r,n]=(0,l.useState)(0),[a,i]=(0,l.useState)(""),[o,c]=(0,l.useState)(!1),[u,d]=(0,l.useState)(null),[f,v]=(0,l.useState)([]),[x,y]=(0,l.useState)("preview"),[b,w]=(0,l.useState)(!1),[j,N]=(0,l.useState)(!1),[C,S]=(0,l.useState)(e.lastSavedAt??null),[E,M]=(0,l.useState)(null),P=(0,l.useRef)(null),T=(0,l.useRef)(null),A=(0,l.useRef)(0),R=(0,l.useCallback)(()=>{try{let e=globalThis?.crypto;if(e&&"function"==typeof e.randomUUID)return e.randomUUID()}catch{}let e=`${Date.now()}_${A.current}`;return A.current+=1,e},[]),L=(0,l.useCallback)(e=>{if(null!=T.current&&T.current>=0&&T.current{let e=[ea,eo,el,eu].filter(Boolean).length;if(4===e)return{assistant:25,files:15,editor:35,preview:25};if(3===e){if(!ea)return{assistant:0,files:20,editor:40,preview:40};if(!eo)return{assistant:30,files:0,editor:40,preview:30};if(!el)return{assistant:33,files:20,editor:0,preview:47};if(!eu)return{assistant:30,files:20,editor:50,preview:0}}else if(2===e)return{assistant:50,files:50,editor:50,preview:50};return{assistant:100,files:100,editor:100,preview:100}})(),eh=e=>{if(!e)return"Select Model";let t=e.split("/");return t[t.length-1].split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")},em=(0,l.useCallback)((e,t=1200)=>{if(!e)return"";if(e.length<=t)return e;let r=Math.max(0,Math.floor(.6*t)),n=Math.max(0,Math.floor(.3*t)),a=e.slice(0,r),i=n>0?e.slice(-n):"";return`${a} (...truncated...) -${o}`},[]),ef=(0,l.useCallback)(e=>{let t=Object.entries(e.attributes||{}).slice(0,6);if(0===t.length)return`<${e.tagName}>`;let r=t.map(([e,t])=>{let r=t.length>40?`${t.slice(0,37)}…`:t;return`${e}="${r}"`}).join(" ");return`<${e.tagName} ${r}>`},[]),eg=(0,l.useCallback)(e=>{let t=ef(e),r=em(e.outerHTML,1200),n=e.domPath||"(unknown path)";return["Focus context:",`- Target: ${t}`,`- DOM path: ${n}`,"- HTML snippet:","```html",r,"```"].join("\n")},[ef,em]),ev=(0,l.useCallback)(e=>{if(!e){P(null),M.current=null;return}let t=`${e.domPath||""}::${e.tagName||""}::${e.outerHTML?e.outerHTML.length:0}`,r=Date.now();if(M.current&&M.current.signature===t&&r-M.current.timestamp<400)return;let n={...e,timestamp:r};P(n),tV.oR.info("Focus context set",{description:ef(n)}),M.current={signature:t,timestamp:r}},[ef]);E&&ef(E);let ex=E?em(E.outerHTML,240):"",ey=ex?.trim()??"",eb=E?(0,s.jsxs)("div",{id:"focus-context-hint",className:"rounded-md border border-dashed border-primary/40 bg-primary/5 px-3 py-2 text-xs text-muted-foreground shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 text-foreground",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-xs uppercase tracking-wide text-primary",children:"context"}),(0,s.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"included in next message"})]}),(0,s.jsx)(m.$,{size:"sm",variant:"ghost",className:"h-6 px-2 text-xs",onClick:()=>P(null),title:"Clear focus context",children:"Clear"})]}),(0,s.jsxs)("div",{className:"mt-2 space-y-2",children:[E.domPath&&(0,s.jsx)("div",{className:"text-[11px] font-mono text-muted-foreground/80 break-all leading-snug",children:E.domPath}),ey&&(0,s.jsx)("pre",{className:"max-h-24 overflow-auto rounded border border-border/50 bg-background/90 px-2 py-1 text-[11px] text-foreground leading-relaxed",children:(0,s.jsx)("code",{children:ey})})]})]}):null,ew=(0,l.useCallback)(()=>{if(!ee.current)return;let{scrollTop:e,scrollHeight:t,clientHeight:r}=ee.current;t-e-r<100?(er.current=!0,en.current=!1):i||(er.current=!1,en.current=!0)},[i]),ek=(0,l.useCallback)(e=>{window.innerWidth<768?(y("editor"),setTimeout(()=>{aX(e)},0)):el?aX(e):(ec(!0),setTimeout(()=>{aX(e)},0))},[el]),ej=(0,l.useCallback)(()=>{n(e=>e+1),window.dispatchEvent(new CustomEvent("filesChanged"))},[]),eN=(0,l.useCallback)(async()=>{if(!j){N(!0);try{let t=await r0.$.save(e.id),r=await p.OP.getProject(e.id);S(r.lastSavedAt??new Date(t.timestamp)),O(t.id);let n=new Date().toISOString(),a={type:"manual_save",timestamp:n,checkpointId:t.id,description:"Manual save"};await a8.recordConversationBreak(e.id,a),await a8.addBreakContextMessage(e.id,a),tV.oR.success("Project saved")}catch(e){h.v.error("Failed to save project",e),tV.oR.error("Failed to save project")}finally{N(!1)}}},[e.id,j]),eC=(0,l.useCallback)(async(t,r)=>{try{if(!await nL.Y.checkpointExists(t)){tV.oR.error("Checkpoint no longer exists - it may have been cleaned up"),h.v.warn(`[Workspace] Checkpoint ${t} no longer exists`);return}if(await r0.$.runWithSuppressedDirty(e.id,()=>nL.Y.restoreCheckpoint(t))){tV.oR.success(`Restored to: ${r||"checkpoint"}`),ej(),await a8.recordConversationBreak(e.id,{type:"checkpoint_restore",timestamp:new Date().toISOString(),checkpointId:t,description:r||"checkpoint"}),await a8.addBreakContextMessage(e.id,{type:"checkpoint_restore",timestamp:new Date().toISOString(),checkpointId:t,description:r||"checkpoint"});let n=r0.$.getSavedCheckpointId(e.id);if(n&&n===t){r0.$.markClean(e.id);let t=await p.OP.getProject(e.id);S(t.lastSavedAt??null)}else r0.$.markDirty(e.id);v(e=>[...e,{id:R(),role:"assistant",content:`Restored to checkpoint: ${r||"previous state"}`,checkpointId:t}]);let a=a9.convertToOrchestratorMessages(f);await a8.updateConversation(e.id,a)}else tV.oR.error("Failed to restore checkpoint")}catch(e){h.v.error("Error restoring checkpoint:",e),tV.oR.error("Failed to restore checkpoint")}},[ej,f,e.id]),eS=(0,l.useCallback)(async(t,r)=>{try{if(!await nL.Y.checkpointExists(t)){tV.oR.error("Checkpoint no longer exists - cannot retry"),h.v.warn(`[Workspace] Checkpoint ${t} no longer exists`);return}let n=null;for(let e=r-1;e>=0;e--)if("user"===f[e].role){n=f[e];break}if(!n)return void tV.oR.error("Cannot find original user message to retry");if(!await r0.$.runWithSuppressedDirty(e.id,()=>nL.Y.restoreCheckpoint(t)))return void tV.oR.error("Failed to restore checkpoint");let a=r0.$.getSavedCheckpointId(e.id);if(a&&a===t){r0.$.markClean(e.id);let t=await p.OP.getProject(e.id);S(t.lastSavedAt??null)}else r0.$.markDirty(e.id);await a8.recordConversationBreak(e.id,{type:"retry",timestamp:new Date().toISOString(),checkpointId:t,description:`Retrying: "${n.content.substring(0,50)}..."`});let i=f.slice(0,r-1);v(i);let s=a9.convertToOrchestratorMessages(i);await a8.updateConversation(e.id,s),await a8.addBreakContextMessage(e.id,{type:"retry",timestamp:new Date().toISOString(),checkpointId:t,description:"Retrying after restoring to checkpoint"}),tV.oR.success("Restored checkpoint and retrying..."),ej(),o(n.content),setTimeout(()=>{let e=document.querySelector('[data-retry-trigger="true"]');e&&e.click()},100)}catch(e){h.v.error("Error during retry:",e),tV.oR.error("Failed to retry")}},[f,ej,e.id]),eE=async()=>{if(Z)return;let t=a.trim();if(!t)return void tV.oR.error("Please enter a prompt");let r=r3.s.getSelectedProvider(),n=(0,a5.sO)(r),i=r3.s.getApiKey();if(n.apiKeyRequired&&!i)return void tV.oR.error(`Please set your ${n.name} API key in settings`);if(n.isLocal&&!r3.s.getProviderModel(r))return void tV.oR.error(`No model selected for ${n.name}. Please select a model in settings.`);er.current=!0,en.current=!1,c(!0);let s=E?`${eg(E)} +${i}`},[]),ef=(0,l.useCallback)(e=>{let t=Object.entries(e.attributes||{}).slice(0,6);if(0===t.length)return`<${e.tagName}>`;let r=t.map(([e,t])=>{let r=t.length>40?`${t.slice(0,37)}…`:t;return`${e}="${r}"`}).join(" ");return`<${e.tagName} ${r}>`},[]),eg=(0,l.useCallback)(e=>{let t=ef(e),r=em(e.outerHTML,1200),n=e.domPath||"(unknown path)";return["Focus context:",`- Target: ${t}`,`- DOM path: ${n}`,"- HTML snippet:","```html",r,"```"].join("\n")},[ef,em]),ev=(0,l.useCallback)(e=>{if(!e){M(null),P.current=null;return}let t=`${e.domPath||""}::${e.tagName||""}::${e.outerHTML?e.outerHTML.length:0}`,r=Date.now();if(P.current&&P.current.signature===t&&r-P.current.timestamp<400)return;let n={...e,timestamp:r};M(n),tV.oR.info("Focus context set",{description:ef(n)}),P.current={signature:t,timestamp:r}},[ef]);E&&ef(E);let ex=E?em(E.outerHTML,240):"",ey=ex?.trim()??"",eb=E?(0,s.jsxs)("div",{id:"focus-context-hint",className:"rounded-md border border-dashed border-primary/40 bg-primary/5 px-3 py-2 text-xs text-muted-foreground shadow-sm",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 text-foreground",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium text-xs uppercase tracking-wide text-primary",children:"context"}),(0,s.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"included in next message"})]}),(0,s.jsx)(m.$,{size:"sm",variant:"ghost",className:"h-6 px-2 text-xs",onClick:()=>M(null),title:"Clear focus context",children:"Clear"})]}),(0,s.jsxs)("div",{className:"mt-2 space-y-2",children:[E.domPath&&(0,s.jsx)("div",{className:"text-[11px] font-mono text-muted-foreground/80 break-all leading-snug",children:E.domPath}),ey&&(0,s.jsx)("pre",{className:"max-h-24 overflow-auto rounded border border-border/50 bg-background/90 px-2 py-1 text-[11px] text-foreground leading-relaxed",children:(0,s.jsx)("code",{children:ey})})]})]}):null,ew=(0,l.useCallback)(()=>{if(!ee.current)return;let{scrollTop:e,scrollHeight:t,clientHeight:r}=ee.current;t-e-r<100?(er.current=!0,en.current=!1):o||(er.current=!1,en.current=!0)},[o]),ek=(0,l.useCallback)(e=>{window.innerWidth<768?(y("editor"),setTimeout(()=>{aX(e)},0)):el?aX(e):(ec(!0),setTimeout(()=>{aX(e)},0))},[el]),ej=(0,l.useCallback)(()=>{n(e=>e+1),window.dispatchEvent(new CustomEvent("filesChanged"))},[]),eN=(0,l.useCallback)(async()=>{if(!j){N(!0);try{let t=await r0.$.save(e.id),r=await p.OP.getProject(e.id);S(r.lastSavedAt??new Date(t.timestamp)),O(t.id);let n=new Date().toISOString(),a={type:"manual_save",timestamp:n,checkpointId:t.id,description:"Manual save"};await a8.recordConversationBreak(e.id,a),await a8.addBreakContextMessage(e.id,a),tV.oR.success("Project saved")}catch(e){h.v.error("Failed to save project",e),tV.oR.error("Failed to save project")}finally{N(!1)}}},[e.id,j]),eC=(0,l.useCallback)(async(t,r)=>{try{if(!await nL.Y.checkpointExists(t)){tV.oR.error("Checkpoint no longer exists - it may have been cleaned up"),h.v.warn(`[Workspace] Checkpoint ${t} no longer exists`);return}if(await r0.$.runWithSuppressedDirty(e.id,()=>nL.Y.restoreCheckpoint(t))){tV.oR.success(`Restored to: ${r||"checkpoint"}`),ej(),await a8.recordConversationBreak(e.id,{type:"checkpoint_restore",timestamp:new Date().toISOString(),checkpointId:t,description:r||"checkpoint"}),await a8.addBreakContextMessage(e.id,{type:"checkpoint_restore",timestamp:new Date().toISOString(),checkpointId:t,description:r||"checkpoint"});let n=r0.$.getSavedCheckpointId(e.id);if(n&&n===t){r0.$.markClean(e.id);let t=await p.OP.getProject(e.id);S(t.lastSavedAt??null)}else r0.$.markDirty(e.id);v(e=>[...e,{id:R(),role:"assistant",content:`Restored to checkpoint: ${r||"previous state"}`,checkpointId:t}]);let a=a9.convertToOrchestratorMessages(f);await a8.updateConversation(e.id,a)}else tV.oR.error("Failed to restore checkpoint")}catch(e){h.v.error("Error restoring checkpoint:",e),tV.oR.error("Failed to restore checkpoint")}},[ej,f,e.id]),eS=(0,l.useCallback)(async(t,r)=>{try{if(!await nL.Y.checkpointExists(t)){tV.oR.error("Checkpoint no longer exists - cannot retry"),h.v.warn(`[Workspace] Checkpoint ${t} no longer exists`);return}let n=null;for(let e=r-1;e>=0;e--)if("user"===f[e].role){n=f[e];break}if(!n)return void tV.oR.error("Cannot find original user message to retry");if(!await r0.$.runWithSuppressedDirty(e.id,()=>nL.Y.restoreCheckpoint(t)))return void tV.oR.error("Failed to restore checkpoint");let a=r0.$.getSavedCheckpointId(e.id);if(a&&a===t){r0.$.markClean(e.id);let t=await p.OP.getProject(e.id);S(t.lastSavedAt??null)}else r0.$.markDirty(e.id);await a8.recordConversationBreak(e.id,{type:"retry",timestamp:new Date().toISOString(),checkpointId:t,description:`Retrying: "${n.content.substring(0,50)}..."`});let o=f.slice(0,r-1);v(o);let s=a9.convertToOrchestratorMessages(o);await a8.updateConversation(e.id,s),await a8.addBreakContextMessage(e.id,{type:"retry",timestamp:new Date().toISOString(),checkpointId:t,description:"Retrying after restoring to checkpoint"}),tV.oR.success("Restored checkpoint and retrying..."),ej(),i(n.content),setTimeout(()=>{let e=document.querySelector('[data-retry-trigger="true"]');e&&e.click()},100)}catch(e){h.v.error("Error during retry:",e),tV.oR.error("Failed to retry")}},[f,ej,e.id]),eE=async()=>{if(Z)return;let t=a.trim();if(!t)return void tV.oR.error("Please enter a prompt");let r=r3.s.getSelectedProvider(),n=(0,a5.sO)(r),o=r3.s.getApiKey();if(n.apiKeyRequired&&!o)return void tV.oR.error(`Please set your ${n.name} API key in settings`);if(n.isLocal&&!r3.s.getProviderModel(r))return void tV.oR.error(`No model selected for ${n.name}. Please select a model in settings.`);er.current=!0,en.current=!1,c(!0);let s=E?`${eg(E)} -${t}`:t,l={id:R(),role:"user",content:s};v(e=>[...e,l]);try{let t;I.current=null,v(e=>L([...e]).arr);let r=await a8.getConversationMessages(e.id,50),n=f.length,a=r.filter(e=>"user"===e.role||"assistant"===e.role).length;h.v.debug("[Workspace] Context validation:",{uiMessages:n,contextMessages:a,totalContextIncludingSystem:r.length,contextTypes:r.map(e=>e.role)}),0===n&&a>0&&(h.v.warn(`[Workspace] GHOST CONVERSATION DETECTED: UI has ${n} messages but context has ${a} messages!`),h.v.warn("[Workspace] This causes the LLM to continue previous conversations that the user cannot see."),h.v.warn("[Workspace] Clearing context to match UI state..."),await a8.clearConversation(e.id),r.length=0);try{let r=await p.OP.listDirectory(e.id,"/");r.length>0&&(t=r.map(e=>e.path).join("\n"))}catch{}let i=(0,a7.m)(t),l=await new Promise(e=>{v(t=>(e(t),t))}),c=a9.prepareConversationForOrchestrator(l,{maxMessages:50,includeSystemPrompt:!0,systemPrompt:i}),u=new a3.r(e.id,c,(e,t)=>{if("assistant_delta"===e&&(t?.text||t?.snapshot)){let e=t.text,r=t.snapshot;v(t=>{let{arr:n,idx:a}=L([...t]);if(a<0||a>=n.length||!n[a])return h.v.error("[assistant_delta] Invalid index or missing message:",{idx:a,arrayLength:n.length}),t;let o=n[a],i={...o,toolMessages:[...o.toolMessages||[]]},s=i.toolMessages;(0===s.length||"message"!==s[s.length-1].type)&&s.push({id:R(),type:"message",content:""});let l=s[s.length-1];return void 0!==r?l.content=r:e&&(l.content=(l.content||"")+e),n[a]=i,n})}if("toolCalls"===e&&t?.toolCalls){let e=t.toolCalls;h.v.debug(`[Workspace] Received ${e.length} tool calls`),v(t=>{let{arr:r,idx:n}=L([...t]),a=r[n],o={...a,toolMessages:[...a.toolMessages||[]]},i=o.toolMessages;for(let t=0;t{if(null==I.current)return e;let r=[...e],n=r[I.current];return r[I.current]={...n,cost:t.totalCost,usage:t.usage},r}),"evaluation"===e&&t?.summary){let e=t.summary;v(t=>{let{arr:r,idx:n}=L([...t]),a=r[n],o={...a,toolMessages:[...a.toolMessages||[]]};return o.toolMessages.push({id:R(),type:"message",content:e}),r[n]=o,r})}if("divider"===e&&v(e=>{let{arr:r,idx:n}=L([...e]),a=r[n],o={...a,toolMessages:[...a.toolMessages||[]]};return o.toolMessages.push({id:R(),type:"divider",title:t?.title||"Section"}),r[n]=o,r}),"tool_result"===e&&t){let{toolIndex:e,result:r}=t;h.v.debug(`[Workspace] Received tool result for tool ${e}`,{resultPreview:"string"==typeof r?r.substring(0,100):r}),v(e=>{let{arr:t,idx:n}=L([...e]),a=t[n],o={...a,toolMessages:[...a.toolMessages||[]]},i=o.toolMessages;for(let e=i.length-1;e>=0;e--)if("tool"===i[e].type&&!i[e].result){i[e]={...i[e],result:r};break}return t[n]=o,t})}if("tool_status"===e&&t){let{toolIndex:e,status:r,result:n,error:a}=t;v(e=>{let{arr:t,idx:o}=L([...e]),i=t[o],s={...i,toolMessages:[...i.toolMessages||[]]},l=s.toolMessages;for(let e=l.length-1;e>=0;e--)if("tool"===l[e].type&&("pending"===l[e].status||"executing"===l[e].status)){l[e]={...l[e],status:r,result:n||a||l[e].result};break}return t[o]=s,t})}});d(u);let m=await u.execute(s);v(e=>{if(null==I.current)return e;let t=[...e],r=t[I.current];return t[I.current]={...r,checkpointId:m.checkpointId,cost:m.totalCost,usage:m.usageInfo},t}),m.success&&ej();let g=await new Promise(e=>{v(t=>(e(t),t))}),x=a9.convertToOrchestratorMessages(g);await a8.updateConversation(e.id,x),o("")}catch(e){h.v.error("Generation error:",e),tV.oR.error(e instanceof Error?e.message:"Failed to generate"),v(t=>[...t,{id:R(),role:"assistant",content:`Error: ${e instanceof Error?e.message:"Unknown error"}`}])}finally{c(!1),d(null),I.current=null}},eD=(0,l.useCallback)(()=>{u&&(u.stop(),tV.oR.info("Generation stopped"))},[u]),eP=[{id:"back",label:"Back to projects",icon:aZ.A,onClick:t,variant:"outline"}];eP.push({id:"save",label:j?"Saving…":b?"Save":"Saved",icon:aK,onClick:eN,variant:b?"default":"outline",disabled:!b||j}),z&&eP.push({id:"discard",label:"Discard Changes",icon:aQ,onClick:()=>eC(z,"Last saved state"),variant:"outline",disabled:j||!b,dataTourId:"discard-changes-button"});let eM=(0,s.jsxs)(r2.AM,{children:[(0,s.jsx)(r2.Wv,{asChild:!0,children:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",className:"h-8 px-3 flex items-center gap-2",title:"Project cost and settings",children:[Q&&(0,s.jsxs)("span",{className:"text-sm font-medium",children:["$",W.toFixed(3)]}),(0,s.jsx)(rU,{className:"h-4 w-4"})]})}),(0,s.jsx)(r2.hl,{className:"w-96",align:"end",children:(0,s.jsx)(nT,{})})]}),eI=(0,s.jsxs)("div",{className:"space-y-2",children:[Q&&(0,s.jsx)("div",{className:"pb-2 border-b border-border/50",children:(0,s.jsxs)("span",{className:"text-sm font-medium",children:["Project cost: $",W.toFixed(W>=10?2:3)]})}),(0,s.jsxs)(r2.AM,{children:[(0,s.jsx)(r2.Wv,{asChild:!0,children:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",className:"w-full justify-start",children:[(0,s.jsx)(rU,{className:"h-4 w-4 mr-2"}),"Settings"]})}),(0,s.jsx)(r2.hl,{className:"w-[calc(100vw-2rem)]",align:"start",children:(0,s.jsx)(nT,{})})]})]});return(0,s.jsxs)(iT,{children:[(0,s.jsxs)("div",{className:"h-screen flex flex-col",children:[(0,s.jsx)(rJ.j,{leftText:e.name,onLogoClick:t,actions:eP,mobileMenuContent:eI,desktopOnlyContent:eM}),(0,s.jsxs)("div",{className:"hidden md:flex flex-1 overflow-hidden bg-background",children:[(0,s.jsxs)("div",{className:"w-10 bg-muted/70 border-r border-border flex flex-col items-center py-3 gap-1.5",children:[(0,s.jsxs)(iA,{children:[(0,s.jsx)(iR,{asChild:!0,children:(0,s.jsx)("button",{className:`h-5 w-5 px-1 rounded-sm flex items-center justify-center transition-all ${ea?"shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:ea?"var(--button-assistant-active)":void 0,color:ea?"white":void 0},onClick:()=>eo(!ea),children:(0,s.jsx)(a0,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(iL,{side:"right",className:"border-0",style:{backgroundColor:"var(--button-assistant-active)",color:"white"},arrowStyle:{backgroundColor:"var(--button-assistant-active)",fill:"var(--button-assistant-active)"},children:(0,s.jsx)("p",{children:"Chat"})})]}),(0,s.jsxs)(iA,{children:[(0,s.jsx)(iR,{asChild:!0,children:(0,s.jsx)("button",{className:`h-5 w-5 px-1 rounded-sm flex items-center justify-center transition-all ${ei?"shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:ei?"var(--button-files-active)":void 0,color:ei?"white":void 0},onClick:()=>es(!ei),children:(0,s.jsx)(nW,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(iL,{side:"right",className:"border-0",style:{backgroundColor:"var(--button-files-active)",color:"white"},arrowStyle:{backgroundColor:"var(--button-files-active)",fill:"var(--button-files-active)"},children:(0,s.jsx)("p",{children:"File Explorer"})})]}),(0,s.jsxs)(iA,{children:[(0,s.jsx)(iR,{asChild:!0,children:(0,s.jsx)("button",{className:`h-5 w-5 px-1 rounded-sm flex items-center justify-center transition-all ${el?"shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:el?"var(--button-editor-active)":void 0,color:el?"white":void 0},onClick:()=>ec(!el),children:(0,s.jsx)(aG,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(iL,{side:"right",className:"border-0",style:{backgroundColor:"var(--button-editor-active)",color:"white"},arrowStyle:{backgroundColor:"var(--button-editor-active)",fill:"var(--button-editor-active)"},children:(0,s.jsx)("p",{children:"Code Editor"})})]}),(0,s.jsxs)(iA,{children:[(0,s.jsx)(iR,{asChild:!0,children:(0,s.jsx)("button",{className:`h-5 w-5 mx-1 rounded-sm flex items-center justify-center transition-all ${eu?"shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:eu?"var(--button-preview-active)":void 0,color:eu?"white":void 0},onClick:()=>ed(!eu),children:(0,s.jsx)(D.A,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(iL,{side:"right",className:"border-0",style:{backgroundColor:"var(--button-preview-active)",color:"white"},arrowStyle:{backgroundColor:"var(--button-preview-active)",fill:"var(--button-preview-active)"},children:(0,s.jsx)("p",{children:"Preview"})})]})]}),(0,s.jsx)("div",{className:"flex-1 p-2 overflow-hidden","data-tour-id":"workspace-panels",children:(0,s.jsxs)(ie,{direction:"horizontal",autoSaveId:"workspace-layout",children:[ea&&(0,s.jsx)(ol,{id:"assistant",order:1,defaultSize:ep.assistant,minSize:15,children:(0,s.jsxs)("div",{className:"h-full flex flex-col border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(var(--panel-assistant-tint), var(--panel-assistant-tint)), var(--card)"},"data-tour-id":"assistant-panel",children:[(0,s.jsxs)("div",{className:"p-3 border-b bg-muted/80 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(a0,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-assistant-active)"}}),(0,s.jsxs)("button",{type:"button",onClick:()=>eo(!1),"aria-label":"Hide chat",className:"relative hidden h-6 w-6 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-destructive md:flex group",children:[(0,s.jsx)(a0,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-assistant-active)"}}),(0,s.jsx)(k.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}),(0,s.jsx)("h3",{className:"text-sm font-medium",children:"Chat"})]}),(0,s.jsx)(m.$,{size:"sm",variant:"ghost",onClick:async()=>{h.v.debug(`[Workspace] Clearing chat - UI has ${f.length} messages`),v([]),await a8.clearConversation(e.id);let t=await a8.getConversationMessages(e.id);t.length>0?h.v.error(`[Workspace] Clear failed! Still has ${t.length} messages in storage`):h.v.debug(`[Workspace] Successfully cleared all conversation data for project ${e.id}`)},className:"h-5 w-5 p-0",title:"Clear chat","data-tour-id":"clear-chat-button",children:(0,s.jsx)(T,{className:"h-3 w-3"})})]}),(0,s.jsxs)("div",{ref:ee,onScroll:ew,className:"flex-1 overflow-y-auto p-4 space-y-3 flex flex-col","data-tour-id":"checkpoint-panel",children:[0===f.length?(0,s.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,s.jsxs)("div",{className:"text-center space-y-3",children:[(0,s.jsx)(a0,{className:"h-12 w-12 mx-auto opacity-50 text-muted-foreground"}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("p",{className:"text-base font-medium text-foreground",children:"Ready to build"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Describe what you want to create or change"})]})]})}):f.map((e,t)=>e.isTask&&e.taskSteps?(0,s.jsx)("div",{className:"bg-card border border-border p-3 rounded-lg text-sm",children:(0,s.jsx)(iq,{title:e.taskTitle||"Task Progress",steps:e.taskSteps,checkpointId:e.checkpointId,onRestore:e=>eC(e,"task checkpoint"),isSavedCheckpoint:e.checkpointId===z,expanded:F.has(t),onToggleExpand:()=>{let e=new Set(F);e.has(t)?e.delete(t):e.add(t),q(e)}})},e.id):"assistant"===e.role&&(e.toolMessages&&e.toolMessages.length>0||e.toolCalls&&e.toolCalls.length>0)?(0,s.jsxs)("div",{className:"bg-card border border-border p-3 rounded-lg text-sm mr-2",children:[(0,s.jsx)("div",{className:"mb-2",children:(0,s.jsx)("p",{className:"font-medium",children:"AI"})}),(0,s.jsx)(ue,{content:e.content,toolCalls:e.toolCalls,toolMessages:e.toolMessages,checkpointId:e.checkpointId,onRestore:e.checkpointId?e=>eC(e,"checkpoint"):void 0,onRetry:e.checkpointId?e=>eS(e,t):void 0,isSavedCheckpoint:e.checkpointId===z,isExecuting:i,cost:e.cost,usage:e.usage})]},e.id):(0,s.jsxs)("div",{className:`p-3 rounded-lg text-sm ${"user"===e.role?"bg-muted/50 ml-8":"bg-card border border-border mr-2"}`,children:[(0,s.jsx)("div",{className:"mb-1",children:(0,s.jsx)("p",{className:"font-medium",children:"user"===e.role?"You":"AI"})}),(0,s.jsx)(c8,{content:e.content})]},e.id)),(0,s.jsx)("div",{ref:et})]}),(0,s.jsxs)("div",{className:"p-3 space-y-2",children:[eb,(0,s.jsxs)("div",{className:"bg-card border border-border rounded-lg shadow-sm overflow-hidden",children:[(0,s.jsxs)("div",{className:"relative flex bg-card rounded-lg transition-all",children:[(0,s.jsx)(g,{value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{!Z&&"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),eE())},placeholder:"Describe what you want to build...",className:"flex-1 px-3 py-2 bg-transparent border-0 resize-none focus:outline-none text-sm placeholder:text-muted-foreground text-foreground",rows:3,disabled:i||Z}),(0,s.jsxs)("div",{className:"flex flex-col p-2 gap-2",children:[(0,s.jsxs)(iA,{children:[(0,s.jsx)(iR,{asChild:!0,children:(0,s.jsx)(m.$,{onClick:i?eD:eE,disabled:Z?!i:!i&&!a.trim(),size:"sm",className:"flex items-center gap-2","data-retry-trigger":"true",children:i?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(nq.A,{className:"h-4 w-4 animate-spin"}),"Stop"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a1,{className:"h-4 w-4"}),"Send"]})})}),(0,s.jsx)(iL,{side:"left",children:(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("p",{className:"text-xs",children:[(0,s.jsx)("kbd",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"Ctrl/Cmd+Enter"})," to send"]}),(0,s.jsxs)("p",{className:"text-xs",children:[(0,s.jsx)("kbd",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"Enter"})," for newline"]})]})})]}),a.length>0&&(0,s.jsxs)("div",{className:"px-3 py-1.5 bg-muted text-muted-foreground rounded-md text-xs text-center",children:[a.length," chars"]})]})]}),(0,s.jsx)("div",{className:"border-t border-border bg-muted/50 px-2 py-2",children:(0,s.jsx)("div",{className:"flex items-center justify-between",children:(0,s.jsxs)(r2.AM,{open:$,onOpenChange:U,children:[(0,s.jsx)(r2.Wv,{asChild:!0,children:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",className:"h-7 text-xs","data-tour-id":"provider-settings-trigger",children:[(0,s.jsx)("span",{children:eh(B)}),$?(0,s.jsx)(nc.A,{className:"h-3 w-3 ml-1"}):(0,s.jsx)(a2.A,{className:"h-3 w-3 ml-1"})]})}),(0,s.jsx)(r2.hl,{className:"w-96",align:"start",children:(0,s.jsx)(ut.t,{onClose:()=>U(!1),onModelChange:e=>_(e)})})]})})})]})]})]})}),ea&&(ei||el||eu)&&(0,s.jsx)(it,{withHandle:!0}),ei&&(0,s.jsx)(ol,{id:"files",order:2,defaultSize:ep.files,minSize:14,children:(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-files-rgb), 0.01), rgba(var(--panel-files-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(al,{projectId:e.id,onFileSelect:ek,onClose:()=>es(!1)})})}),ei&&(el||eu)&&(0,s.jsx)(it,{withHandle:!0}),el&&(0,s.jsx)(ol,{id:"editor",order:3,defaultSize:ep.editor,minSize:20,children:(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-editor-rgb), 0.01), rgba(var(--panel-editor-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(aJ,{projectId:e.id,onFilesChange:ej,onClose:()=>ec(!1)})})}),el&&eu&&(0,s.jsx)(it,{withHandle:!0}),eu&&(0,s.jsx)(ol,{id:"preview",order:4,defaultSize:ep.preview,minSize:20,children:(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-preview-rgb), 0.01), rgba(var(--panel-preview-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(t4,{projectId:e.id,refreshTrigger:r,onFocusSelection:ev,hasFocusTarget:!!E,onClose:()=>ed(!1)})})})]})})]}),(0,s.jsxs)("div",{className:"flex md:hidden flex-1 overflow-hidden bg-background flex-col",children:[(0,s.jsxs)("div",{className:"flex-1 p-2 pb-16 overflow-hidden",children:["assistant"===x&&(0,s.jsxs)("div",{className:"h-full flex flex-col border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(var(--panel-assistant-tint), var(--panel-assistant-tint)), var(--card)"},children:[(0,s.jsxs)("div",{className:"p-3 border-b bg-muted/80 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(a0,{className:"h-4 w-4",style:{color:"var(--button-assistant-active)"}}),(0,s.jsx)("h3",{className:"text-sm font-medium",children:"Chat"})]}),(0,s.jsx)(m.$,{size:"sm",variant:"ghost",onClick:async()=>{h.v.debug(`[Workspace] Clearing chat - UI has ${f.length} messages`),v([]),await a8.clearConversation(e.id)},className:"h-5 w-5 p-0",title:"Clear chat",children:(0,s.jsx)(T,{className:"h-3 w-3"})})]}),(0,s.jsxs)("div",{ref:ee,onScroll:ew,className:"flex-1 overflow-auto p-2 space-y-2",children:[f.map((e,t)=>e.isTask&&e.taskSteps?(0,s.jsxs)("div",{className:"border border-border rounded-lg p-3 bg-card",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("p",{className:"font-medium text-sm",children:"Task Progress"}),e.checkpointId&&(0,s.jsxs)(m.$,{size:"sm",variant:"ghost",onClick:()=>eC(e.checkpointId,"checkpoint"),className:"h-6 px-2 text-xs",title:"Restore to this checkpoint",children:[(0,s.jsx)(aQ,{className:"h-3 w-3 mr-1"}),"Restore"]})]}),(0,s.jsx)(ue,{content:e.content,toolCalls:e.toolCalls,toolMessages:e.toolMessages,checkpointId:e.checkpointId,onRestore:e.checkpointId?e=>eC(e,"checkpoint"):void 0,onRetry:e.checkpointId?e=>eS(e,t):void 0,isSavedCheckpoint:e.checkpointId===z,isExecuting:i,cost:e.cost,usage:e.usage})]},e.id):"assistant"===e.role&&(e.toolMessages&&e.toolMessages.length>0||e.toolCalls&&e.toolCalls.length>0)?(0,s.jsxs)("div",{className:"bg-card border border-border p-3 rounded-lg text-sm mr-2",children:[(0,s.jsx)("div",{className:"mb-2",children:(0,s.jsx)("p",{className:"font-medium",children:"AI"})}),(0,s.jsx)(ue,{content:e.content,toolCalls:e.toolCalls,toolMessages:e.toolMessages,checkpointId:e.checkpointId,onRestore:e.checkpointId?e=>eC(e,"checkpoint"):void 0,onRetry:e.checkpointId?e=>eS(e,t):void 0,isSavedCheckpoint:e.checkpointId===z,isExecuting:i,cost:e.cost,usage:e.usage})]},e.id):(0,s.jsxs)("div",{className:`p-3 rounded-lg text-sm ${"user"===e.role?"bg-muted/50 ml-8":"bg-card border border-border mr-2"}`,children:[(0,s.jsx)("div",{className:"mb-1",children:(0,s.jsx)("p",{className:"font-medium",children:"user"===e.role?"You":"AI"})}),(0,s.jsx)(c8,{content:e.content})]},e.id)),(0,s.jsx)("div",{ref:et})]}),(0,s.jsxs)("div",{className:"p-3 space-y-2",children:[eb,(0,s.jsxs)("div",{className:"bg-card border border-border rounded-lg shadow-sm overflow-hidden",children:[(0,s.jsxs)("div",{className:"relative flex bg-card rounded-lg transition-all",children:[(0,s.jsx)(g,{value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{!Z&&"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),eE())},placeholder:"Describe what you want to build...",className:"flex-1 px-3 py-2 bg-transparent border-0 resize-none focus:outline-none text-sm placeholder:text-muted-foreground text-foreground",rows:3,disabled:i||Z}),(0,s.jsx)("div",{className:"flex flex-col p-2 gap-2",children:(0,s.jsx)(m.$,{onClick:i?eD:eE,disabled:Z?!i:!i&&!a.trim(),size:"sm",className:"flex items-center gap-2",children:i?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(nq.A,{className:"h-4 w-4 animate-spin"}),"Stop"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a1,{className:"h-4 w-4"}),"Send"]})})})]}),(0,s.jsx)("div",{className:"border-t border-border bg-muted/50 px-2 py-2",children:(0,s.jsxs)(r2.AM,{open:H,onOpenChange:V,children:[(0,s.jsx)(r2.Wv,{asChild:!0,children:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",className:"h-7 text-xs","data-tour-id":"provider-settings-trigger",children:[(0,s.jsx)("span",{children:eh(B)}),H?(0,s.jsx)(nc.A,{className:"h-3 w-3 ml-1"}):(0,s.jsx)(a2.A,{className:"h-3 w-3 ml-1"})]})}),(0,s.jsx)(r2.hl,{className:"w-[calc(100vw-2rem)]",align:"start",children:(0,s.jsx)(ut.t,{onClose:()=>V(!1),onModelChange:e=>_(e)})})]})})]})]})]}),"files"===x&&(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-files-rgb), 0.01), rgba(var(--panel-files-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(al,{projectId:e.id,onFileSelect:ek,onClose:()=>es(!1)})}),"editor"===x&&(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-editor-rgb), 0.01), rgba(var(--panel-editor-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(aJ,{projectId:e.id,onFilesChange:ej,onClose:()=>ec(!1)})}),"preview"===x&&(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-preview-rgb), 0.01), rgba(var(--panel-preview-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(t4,{projectId:e.id,refreshTrigger:r,onFocusSelection:ev,hasFocusTarget:!!E,onClose:()=>ed(!1)})})]}),(0,s.jsx)("div",{className:"fixed bottom-0 left-0 right-0 bg-card border-t border-border",children:(0,s.jsxs)("div",{className:"flex justify-center items-center p-2 gap-2",children:[(0,s.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"assistant"===x?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"assistant"===x?"var(--button-assistant-active)":void 0},onClick:()=>y("assistant"),children:(0,s.jsx)(a0,{className:"h-4 w-4"})}),(0,s.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"files"===x?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"files"===x?"var(--button-files-active)":void 0},onClick:()=>y("files"),children:(0,s.jsx)(nW,{className:"h-4 w-4"})}),(0,s.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"editor"===x?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"editor"===x?"var(--button-editor-active)":void 0},onClick:()=>y("editor"),children:(0,s.jsx)(aG,{className:"h-4 w-4"})}),(0,s.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"preview"===x?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"preview"===x?"var(--button-preview-active)":void 0},onClick:()=>y("preview"),children:(0,s.jsx)(D.A,{className:"h-4 w-4"})})]})})]})]}),(0,s.jsx)(nB,{location:"workspace"}),(0,s.jsx)(nB,{location:"settings"})]})}function un(){let[e,t]=(0,l.useState)(null),{state:r,setActiveProjectId:n}=nF();r.currentStep?.id,r.status;let a=(0,l.useMemo)(()=>e?(0,s.jsx)(ur,{project:e,onBack:()=>t(null)}):(0,s.jsx)(n_,{onProjectSelect:t}),[e]);return(0,s.jsxs)(s.Fragment,{children:[a,(0,s.jsx)(nB,{location:"global"})]})}function ua(){return(0,s.jsx)(nO,{children:(0,s.jsx)(un,{})})}},10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},11120:function(e,t,r){"use strict";var n=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(r(65840)),a=r(86908);function o(e,t){var r={};return e&&"string"==typeof e&&(0,n.default)(e,function(e,n){e&&n&&(r[(0,a.camelCase)(e,t)]=n)}),r}o.default=o,e.exports=o},19121:e=>{"use strict";e.exports=require("next/dist/server/app-render/action-async-storage.external.js")},19566:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},i=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var n,a=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!a&&!o)return!1;for(n in e);return void 0===n||t.call(e,n)},s=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,r){if("__proto__"===r){if(!t.call(e,r))return;else if(a)return a(e,r).value}return e[r]};e.exports=function e(){var t,r,n,a,c,u,d=arguments[0],p=1,h=arguments.length,m=!1;for("boolean"==typeof d&&(m=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p{Promise.resolve().then(r.bind(r,6741))},27910:e=>{"use strict";e.exports=require("stream")},28354:e=>{"use strict";e.exports=require("util")},29021:e=>{"use strict";e.exports=require("fs")},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:e=>{"use strict";e.exports=require("path")},44517:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,l=/^\s+|\s+$/g;function c(e){return e?e.replace(l,""):""}e.exports=function(e,l){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];l=l||{};var u=1,d=1;function p(e){var t=e.match(r);t&&(u+=t.length);var n=e.lastIndexOf("\n");d=~n?e.length-n:d+e.length}function h(){var e={line:u,column:d};return function(t){return t.position=new m(e),v(n),t}}function m(e){this.start=e,this.end={line:u,column:d},this.source=l.source}m.prototype.content=e;var f=[];function g(t){var r=Error(l.source+":"+u+":"+d+": "+t);if(r.reason=t,r.filename=l.source,r.line=u,r.column=d,r.source=e,l.silent)f.push(r);else throw r}function v(t){var r=t.exec(e);if(r){var n=r[0];return p(n),e=e.slice(n.length),r}}function x(e){var t;for(e=e||[];t=y();)!1!==t&&e.push(t);return e}function y(){var t=h();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var r=2;""!=e.charAt(r)&&("*"!=e.charAt(r)||"/"!=e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return g("End of comment missing");var n=e.slice(2,r-2);return d+=2,p(n),e=e.slice(r),d+=2,t({type:"comment",comment:n})}}v(n);var b,w=[];for(x(w);b=function(){var e=h(),r=v(a);if(r){if(y(),!v(o))return g("property missing ':'");var n=v(i),l=e({type:"declaration",property:c(r[0].replace(t,"")),value:n?c(n[0].replace(t,"")):""});return v(s),l}}();)!1!==b&&(w.push(b),x(w));return w}},55511:e=>{"use strict";e.exports=require("crypto")},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},65840:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r=null;if(!e||"string"!=typeof e)return r;var n=(0,a.default)(e),o="function"==typeof t;return n.forEach(function(e){if("declaration"===e.type){var n=e.property,a=e.value;o?t(n,a,e):a&&((r=r||{})[n]=a)}}),r};var a=n(r(44517))},71997:(e,t,r)=>{"use strict";r.r(t),r.d(t,{GlobalError:()=>i.a,__next_app__:()=>d,pages:()=>u,routeModule:()=>p,tree:()=>c});var n=r(65239),a=r(48088),o=r(88170),i=r.n(o),s=r(30893),l={};for(let e in s)0>["default","tree","pages","GlobalError","__next_app__","routeModule"].indexOf(e)&&(l[e]=()=>s[e]);r.d(t,l);let c={children:["",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(r.bind(r,90597)),"/Users/otto/Desktop/deepstudio/deepstudio-git/app/page.tsx"],metadata:{icon:[async e=>(await Promise.resolve().then(r.bind(r,46055))).default(e)],apple:[],openGraph:[],twitter:[],manifest:void 0}}]},{layout:[()=>Promise.resolve().then(r.bind(r,58014)),"/Users/otto/Desktop/deepstudio/deepstudio-git/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(r.t.bind(r,57398,23)),"next/dist/client/components/not-found-error"],forbidden:[()=>Promise.resolve().then(r.t.bind(r,89999,23)),"next/dist/client/components/forbidden-error"],unauthorized:[()=>Promise.resolve().then(r.t.bind(r,65284,23)),"next/dist/client/components/unauthorized-error"],metadata:{icon:[async e=>(await Promise.resolve().then(r.bind(r,46055))).default(e)],apple:[],openGraph:[],twitter:[],manifest:void 0}}]}.children,u=["/Users/otto/Desktop/deepstudio/deepstudio-git/app/page.tsx"],d={require:r,loadChunk:()=>Promise.resolve()},p=new n.AppPageRouteModule({definition:{kind:a.RouteKind.APP_PAGE,page:"/page",pathname:"/",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:c}})},79428:e=>{"use strict";e.exports=require("buffer")},79551:e=>{"use strict";e.exports=require("url")},86908:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.camelCase=void 0;var r=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,a=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(e,t){return t.toUpperCase()},l=function(e,t){return"".concat(t,"-")};t.camelCase=function(e,t){var c;return(void 0===t&&(t={}),!(c=e)||a.test(c)||r.test(c))?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(i,l):e.replace(o,l)).replace(n,s))}},90597:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});let n=(0,r(12907).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/otto/Desktop/deepstudio/deepstudio-git/app/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/otto/Desktop/deepstudio/deepstudio-git/app/page.tsx","default")},94735:e=>{"use strict";e.exports=require("events")}};var t=require("../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),n=t.X(0,[447,551,212,617],()=>r(71997));module.exports=n})(); \ No newline at end of file +${t}`:t,l={id:R(),role:"user",content:s};v(e=>[...e,l]);try{let t;T.current=null,v(e=>L([...e]).arr);let r=await a8.getConversationMessages(e.id,50),n=f.length,a=r.filter(e=>"user"===e.role||"assistant"===e.role).length;h.v.debug("[Workspace] Context validation:",{uiMessages:n,contextMessages:a,totalContextIncludingSystem:r.length,contextTypes:r.map(e=>e.role)}),0===n&&a>0&&(h.v.warn(`[Workspace] GHOST CONVERSATION DETECTED: UI has ${n} messages but context has ${a} messages!`),h.v.warn("[Workspace] This causes the LLM to continue previous conversations that the user cannot see."),h.v.warn("[Workspace] Clearing context to match UI state..."),await a8.clearConversation(e.id),r.length=0);try{let r=await p.OP.listDirectory(e.id,"/");r.length>0&&(t=r.map(e=>e.path).join("\n"))}catch{}let o=(0,a7.m)(t),l=await new Promise(e=>{v(t=>(e(t),t))}),c=a9.prepareConversationForOrchestrator(l,{maxMessages:50,includeSystemPrompt:!0,systemPrompt:o}),u=new a3.r(e.id,c,(e,t)=>{if("assistant_delta"===e&&(t?.text||t?.snapshot)){let e=t.text,r=t.snapshot;v(t=>{let{arr:n,idx:a}=L([...t]);if(a<0||a>=n.length||!n[a])return h.v.error("[assistant_delta] Invalid index or missing message:",{idx:a,arrayLength:n.length}),t;let i=n[a],o={...i,toolMessages:[...i.toolMessages||[]]},s=o.toolMessages;(0===s.length||"message"!==s[s.length-1].type)&&s.push({id:R(),type:"message",content:""});let l=s[s.length-1];return void 0!==r?l.content=r:e&&(l.content=(l.content||"")+e),n[a]=o,n})}if("toolCalls"===e&&t?.toolCalls){let e=t.toolCalls;h.v.debug(`[Workspace] Received ${e.length} tool calls`),v(t=>{let{arr:r,idx:n}=L([...t]),a=r[n],i={...a,toolMessages:[...a.toolMessages||[]]},o=i.toolMessages;for(let t=0;t{if(null==T.current)return e;let r=[...e],n=r[T.current];return r[T.current]={...n,cost:t.totalCost,usage:t.usage},r}),"evaluation"===e&&t?.summary){let e=t.summary;v(t=>{let{arr:r,idx:n}=L([...t]),a=r[n],i={...a,toolMessages:[...a.toolMessages||[]]};return i.toolMessages.push({id:R(),type:"message",content:e}),r[n]=i,r})}if("divider"===e&&v(e=>{let{arr:r,idx:n}=L([...e]),a=r[n],i={...a,toolMessages:[...a.toolMessages||[]]};return i.toolMessages.push({id:R(),type:"divider",title:t?.title||"Section"}),r[n]=i,r}),"tool_result"===e&&t){let{toolIndex:e,result:r}=t;h.v.debug(`[Workspace] Received tool result for tool ${e}`,{resultPreview:"string"==typeof r?r.substring(0,100):r}),v(e=>{let{arr:t,idx:n}=L([...e]),a=t[n],i={...a,toolMessages:[...a.toolMessages||[]]},o=i.toolMessages;for(let e=o.length-1;e>=0;e--)if("tool"===o[e].type&&!o[e].result){o[e]={...o[e],result:r};break}return t[n]=i,t})}if("tool_status"===e&&t){let{toolIndex:e,status:r,result:n,error:a}=t;v(e=>{let{arr:t,idx:i}=L([...e]),o=t[i],s={...o,toolMessages:[...o.toolMessages||[]]},l=s.toolMessages;for(let e=l.length-1;e>=0;e--)if("tool"===l[e].type&&("pending"===l[e].status||"executing"===l[e].status)){l[e]={...l[e],status:r,result:n||a||l[e].result};break}return t[i]=s,t})}});d(u);let m=await u.execute(s);v(e=>{if(null==T.current)return e;let t=[...e],r=t[T.current];return t[T.current]={...r,checkpointId:m.checkpointId,cost:m.totalCost,usage:m.usageInfo},t}),m.success&&ej();let g=await new Promise(e=>{v(t=>(e(t),t))}),x=a9.convertToOrchestratorMessages(g);await a8.updateConversation(e.id,x),i("")}catch(e){h.v.error("Generation error:",e),tV.oR.error(e instanceof Error?e.message:"Failed to generate"),v(t=>[...t,{id:R(),role:"assistant",content:`Error: ${e instanceof Error?e.message:"Unknown error"}`}])}finally{c(!1),d(null),T.current=null}},eD=(0,l.useCallback)(()=>{u&&(u.stop(),tV.oR.info("Generation stopped"))},[u]),eM=[{id:"back",label:"Back to projects",icon:aZ.A,onClick:t,variant:"outline"}];eM.push({id:"save",label:j?"Saving…":b?"Save":"Saved",icon:aK,onClick:eN,variant:b?"default":"outline",disabled:!b||j}),z&&eM.push({id:"discard",label:"Discard Changes",icon:aQ,onClick:()=>eC(z,"Last saved state"),variant:"outline",disabled:j||!b,dataTourId:"discard-changes-button"});let eP=(0,s.jsxs)(r2.AM,{children:[(0,s.jsx)(r2.Wv,{asChild:!0,children:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",className:"h-8 px-3 flex items-center gap-2",title:"Project cost and settings",children:[Q&&(0,s.jsxs)("span",{className:"text-sm font-medium",children:["$",W.toFixed(3)]}),(0,s.jsx)(rU,{className:"h-4 w-4"})]})}),(0,s.jsx)(r2.hl,{className:"w-96",align:"end",children:(0,s.jsx)(nI,{})})]}),eT=(0,s.jsxs)("div",{className:"space-y-2",children:[Q&&(0,s.jsx)("div",{className:"pb-2 border-b border-border/50",children:(0,s.jsxs)("span",{className:"text-sm font-medium",children:["Project cost: $",W.toFixed(W>=10?2:3)]})}),(0,s.jsxs)(r2.AM,{children:[(0,s.jsx)(r2.Wv,{asChild:!0,children:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",className:"w-full justify-start",children:[(0,s.jsx)(rU,{className:"h-4 w-4 mr-2"}),"Settings"]})}),(0,s.jsx)(r2.hl,{className:"w-[calc(100vw-2rem)]",align:"start",children:(0,s.jsx)(nI,{})})]})]});return(0,s.jsxs)(oI,{children:[(0,s.jsxs)("div",{className:"h-screen flex flex-col",children:[(0,s.jsx)(rJ.j,{leftText:e.name,onLogoClick:t,actions:eM,mobileMenuContent:eT,desktopOnlyContent:eP}),(0,s.jsxs)("div",{className:"hidden md:flex flex-1 overflow-hidden bg-background",children:[(0,s.jsxs)("div",{className:"w-10 bg-muted/70 border-r border-border flex flex-col items-center py-3 gap-1.5",children:[(0,s.jsxs)(oA,{children:[(0,s.jsx)(oR,{asChild:!0,children:(0,s.jsx)("button",{className:`h-5 w-5 px-1 rounded-sm flex items-center justify-center transition-all ${ea?"shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:ea?"var(--button-assistant-active)":void 0,color:ea?"white":void 0},onClick:()=>ei(!ea),children:(0,s.jsx)(a0,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(oL,{side:"right",className:"border-0",style:{backgroundColor:"var(--button-assistant-active)",color:"white"},arrowStyle:{backgroundColor:"var(--button-assistant-active)",fill:"var(--button-assistant-active)"},children:(0,s.jsx)("p",{children:"Chat"})})]}),(0,s.jsxs)(oA,{children:[(0,s.jsx)(oR,{asChild:!0,children:(0,s.jsx)("button",{className:`h-5 w-5 px-1 rounded-sm flex items-center justify-center transition-all ${eo?"shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:eo?"var(--button-files-active)":void 0,color:eo?"white":void 0},onClick:()=>es(!eo),children:(0,s.jsx)(nW,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(oL,{side:"right",className:"border-0",style:{backgroundColor:"var(--button-files-active)",color:"white"},arrowStyle:{backgroundColor:"var(--button-files-active)",fill:"var(--button-files-active)"},children:(0,s.jsx)("p",{children:"File Explorer"})})]}),(0,s.jsxs)(oA,{children:[(0,s.jsx)(oR,{asChild:!0,children:(0,s.jsx)("button",{className:`h-5 w-5 px-1 rounded-sm flex items-center justify-center transition-all ${el?"shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:el?"var(--button-editor-active)":void 0,color:el?"white":void 0},onClick:()=>ec(!el),children:(0,s.jsx)(aG,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(oL,{side:"right",className:"border-0",style:{backgroundColor:"var(--button-editor-active)",color:"white"},arrowStyle:{backgroundColor:"var(--button-editor-active)",fill:"var(--button-editor-active)"},children:(0,s.jsx)("p",{children:"Code Editor"})})]}),(0,s.jsxs)(oA,{children:[(0,s.jsx)(oR,{asChild:!0,children:(0,s.jsx)("button",{className:`h-5 w-5 mx-1 rounded-sm flex items-center justify-center transition-all ${eu?"shadow-sm":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:eu?"var(--button-preview-active)":void 0,color:eu?"white":void 0},onClick:()=>ed(!eu),children:(0,s.jsx)(D.A,{className:"h-3.5 w-3.5"})})}),(0,s.jsx)(oL,{side:"right",className:"border-0",style:{backgroundColor:"var(--button-preview-active)",color:"white"},arrowStyle:{backgroundColor:"var(--button-preview-active)",fill:"var(--button-preview-active)"},children:(0,s.jsx)("p",{children:"Preview"})})]})]}),(0,s.jsx)("div",{className:"flex-1 p-2 overflow-hidden","data-tour-id":"workspace-panels",children:(0,s.jsxs)(or,{direction:"horizontal",autoSaveId:"workspace-layout",children:[ea&&(0,s.jsx)(ic,{id:"assistant",order:1,defaultSize:ep.assistant,minSize:15,children:(0,s.jsxs)("div",{className:"h-full flex flex-col border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(var(--panel-assistant-tint), var(--panel-assistant-tint)), var(--card)"},"data-tour-id":"assistant-panel",children:[(0,s.jsxs)("div",{className:"p-3 border-b bg-muted/80 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(a0,{className:"h-4 w-4 md:hidden",style:{color:"var(--button-assistant-active)"}}),(0,s.jsxs)("button",{type:"button",onClick:()=>ei(!1),"aria-label":"Hide chat",className:"relative hidden h-6 w-6 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-destructive md:flex group",children:[(0,s.jsx)(a0,{className:"h-4 w-4 transition-opacity group-hover:opacity-0",style:{color:"var(--button-assistant-active)"}}),(0,s.jsx)(k.A,{className:"absolute h-3 w-3 opacity-0 transition-opacity group-hover:opacity-100"})]}),(0,s.jsx)("h3",{className:"text-sm font-medium",children:"Chat"})]}),(0,s.jsx)(m.$,{size:"sm",variant:"ghost",onClick:async()=>{h.v.debug(`[Workspace] Clearing chat - UI has ${f.length} messages`),v([]),await a8.clearConversation(e.id);let t=await a8.getConversationMessages(e.id);t.length>0?h.v.error(`[Workspace] Clear failed! Still has ${t.length} messages in storage`):h.v.debug(`[Workspace] Successfully cleared all conversation data for project ${e.id}`)},className:"h-5 w-5 p-0",title:"Clear chat","data-tour-id":"clear-chat-button",children:(0,s.jsx)(I,{className:"h-3 w-3"})})]}),(0,s.jsxs)("div",{ref:ee,onScroll:ew,className:"flex-1 overflow-y-auto p-4 space-y-3 flex flex-col","data-tour-id":"checkpoint-panel",children:[0===f.length?(0,s.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,s.jsxs)("div",{className:"text-center space-y-3",children:[(0,s.jsx)(a0,{className:"h-12 w-12 mx-auto opacity-50 text-muted-foreground"}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("p",{className:"text-base font-medium text-foreground",children:"Ready to build"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Describe what you want to create or change"})]})]})}):f.map((e,t)=>e.isTask&&e.taskSteps?(0,s.jsx)("div",{className:"bg-card border border-border p-3 rounded-lg text-sm",children:(0,s.jsx)(o_,{title:e.taskTitle||"Task Progress",steps:e.taskSteps,checkpointId:e.checkpointId,onRestore:e=>eC(e,"task checkpoint"),isSavedCheckpoint:e.checkpointId===z,expanded:F.has(t),onToggleExpand:()=>{let e=new Set(F);e.has(t)?e.delete(t):e.add(t),_(e)}})},e.id):"assistant"===e.role&&(e.toolMessages&&e.toolMessages.length>0||e.toolCalls&&e.toolCalls.length>0)?(0,s.jsxs)("div",{className:"bg-card border border-border p-3 rounded-lg text-sm mr-2",children:[(0,s.jsx)("div",{className:"mb-2",children:(0,s.jsx)("p",{className:"font-medium",children:"AI"})}),(0,s.jsx)(ue,{content:e.content,toolCalls:e.toolCalls,toolMessages:e.toolMessages,checkpointId:e.checkpointId,onRestore:e.checkpointId?e=>eC(e,"checkpoint"):void 0,onRetry:e.checkpointId?e=>eS(e,t):void 0,isSavedCheckpoint:e.checkpointId===z,isExecuting:o,cost:e.cost,usage:e.usage})]},e.id):(0,s.jsxs)("div",{className:`p-3 rounded-lg text-sm ${"user"===e.role?"bg-muted/50 ml-8":"bg-card border border-border mr-2"}`,children:[(0,s.jsx)("div",{className:"mb-1",children:(0,s.jsx)("p",{className:"font-medium",children:"user"===e.role?"You":"AI"})}),(0,s.jsx)(c8,{content:e.content})]},e.id)),(0,s.jsx)("div",{ref:et})]}),(0,s.jsxs)("div",{className:"p-3 space-y-2",children:[eb,(0,s.jsxs)("div",{className:"bg-card border border-border rounded-lg shadow-sm overflow-hidden",children:[(0,s.jsxs)("div",{className:"relative flex bg-card rounded-lg transition-all",children:[(0,s.jsx)(g,{value:a,onChange:e=>i(e.target.value),onKeyDown:e=>{!Z&&"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),eE())},placeholder:"Describe what you want to build...",className:"flex-1 px-3 py-2 bg-transparent border-0 resize-none focus:outline-none text-sm placeholder:text-muted-foreground text-foreground",rows:3,disabled:o||Z}),(0,s.jsxs)("div",{className:"flex flex-col p-2 gap-2",children:[(0,s.jsxs)(oA,{children:[(0,s.jsx)(oR,{asChild:!0,children:(0,s.jsx)(m.$,{onClick:o?eD:eE,disabled:Z?!o:!o&&!a.trim(),size:"sm",className:"flex items-center gap-2","data-retry-trigger":"true",children:o?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n_.A,{className:"h-4 w-4 animate-spin"}),"Stop"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a1,{className:"h-4 w-4"}),"Send"]})})}),(0,s.jsx)(oL,{side:"left",children:(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsxs)("p",{className:"text-xs",children:[(0,s.jsx)("kbd",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"Ctrl/Cmd+Enter"})," to send"]}),(0,s.jsxs)("p",{className:"text-xs",children:[(0,s.jsx)("kbd",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:"Enter"})," for newline"]})]})})]}),a.length>0&&(0,s.jsxs)("div",{className:"px-3 py-1.5 bg-muted text-muted-foreground rounded-md text-xs text-center",children:[a.length," chars"]})]})]}),(0,s.jsx)("div",{className:"border-t border-border bg-muted/50 px-2 py-2",children:(0,s.jsx)("div",{className:"flex items-center justify-between",children:(0,s.jsxs)(r2.AM,{open:$,onOpenChange:U,children:[(0,s.jsx)(r2.Wv,{asChild:!0,children:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",className:"h-7 text-xs","data-tour-id":"provider-settings-trigger",children:[(0,s.jsx)("span",{children:eh(q)}),$?(0,s.jsx)(nc.A,{className:"h-3 w-3 ml-1"}):(0,s.jsx)(a2.A,{className:"h-3 w-3 ml-1"})]})}),(0,s.jsx)(r2.hl,{className:"w-96",align:"start",children:(0,s.jsx)(ut.t,{onClose:()=>U(!1),onModelChange:e=>B(e)})})]})})})]})]})]})}),ea&&(eo||el||eu)&&(0,s.jsx)(on,{withHandle:!0}),eo&&(0,s.jsx)(ic,{id:"files",order:2,defaultSize:ep.files,minSize:14,children:(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-files-rgb), 0.01), rgba(var(--panel-files-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(al,{projectId:e.id,onFileSelect:ek,onClose:()=>es(!1)})})}),eo&&(el||eu)&&(0,s.jsx)(on,{withHandle:!0}),el&&(0,s.jsx)(ic,{id:"editor",order:3,defaultSize:ep.editor,minSize:20,children:(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-editor-rgb), 0.01), rgba(var(--panel-editor-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(aJ,{projectId:e.id,onFilesChange:ej,onClose:()=>ec(!1)})})}),el&&eu&&(0,s.jsx)(on,{withHandle:!0}),eu&&(0,s.jsx)(ic,{id:"preview",order:4,defaultSize:ep.preview,minSize:20,children:(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-preview-rgb), 0.01), rgba(var(--panel-preview-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(t4,{projectId:e.id,refreshTrigger:r,onFocusSelection:ev,hasFocusTarget:!!E,onClose:()=>ed(!1)})})})]})})]}),(0,s.jsxs)("div",{className:"flex md:hidden flex-1 overflow-hidden bg-background flex-col",children:[(0,s.jsxs)("div",{className:"flex-1 p-2 pb-16 overflow-hidden",children:["assistant"===x&&(0,s.jsxs)("div",{className:"h-full flex flex-col border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(var(--panel-assistant-tint), var(--panel-assistant-tint)), var(--card)"},children:[(0,s.jsxs)("div",{className:"p-3 border-b bg-muted/80 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(a0,{className:"h-4 w-4",style:{color:"var(--button-assistant-active)"}}),(0,s.jsx)("h3",{className:"text-sm font-medium",children:"Chat"})]}),(0,s.jsx)(m.$,{size:"sm",variant:"ghost",onClick:async()=>{h.v.debug(`[Workspace] Clearing chat - UI has ${f.length} messages`),v([]),await a8.clearConversation(e.id)},className:"h-5 w-5 p-0",title:"Clear chat",children:(0,s.jsx)(I,{className:"h-3 w-3"})})]}),(0,s.jsxs)("div",{ref:ee,onScroll:ew,className:"flex-1 overflow-auto p-2 space-y-2",children:[f.map((e,t)=>e.isTask&&e.taskSteps?(0,s.jsxs)("div",{className:"border border-border rounded-lg p-3 bg-card",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("p",{className:"font-medium text-sm",children:"Task Progress"}),e.checkpointId&&(0,s.jsxs)(m.$,{size:"sm",variant:"ghost",onClick:()=>eC(e.checkpointId,"checkpoint"),className:"h-6 px-2 text-xs",title:"Restore to this checkpoint",children:[(0,s.jsx)(aQ,{className:"h-3 w-3 mr-1"}),"Restore"]})]}),(0,s.jsx)(ue,{content:e.content,toolCalls:e.toolCalls,toolMessages:e.toolMessages,checkpointId:e.checkpointId,onRestore:e.checkpointId?e=>eC(e,"checkpoint"):void 0,onRetry:e.checkpointId?e=>eS(e,t):void 0,isSavedCheckpoint:e.checkpointId===z,isExecuting:o,cost:e.cost,usage:e.usage})]},e.id):"assistant"===e.role&&(e.toolMessages&&e.toolMessages.length>0||e.toolCalls&&e.toolCalls.length>0)?(0,s.jsxs)("div",{className:"bg-card border border-border p-3 rounded-lg text-sm mr-2",children:[(0,s.jsx)("div",{className:"mb-2",children:(0,s.jsx)("p",{className:"font-medium",children:"AI"})}),(0,s.jsx)(ue,{content:e.content,toolCalls:e.toolCalls,toolMessages:e.toolMessages,checkpointId:e.checkpointId,onRestore:e.checkpointId?e=>eC(e,"checkpoint"):void 0,onRetry:e.checkpointId?e=>eS(e,t):void 0,isSavedCheckpoint:e.checkpointId===z,isExecuting:o,cost:e.cost,usage:e.usage})]},e.id):(0,s.jsxs)("div",{className:`p-3 rounded-lg text-sm ${"user"===e.role?"bg-muted/50 ml-8":"bg-card border border-border mr-2"}`,children:[(0,s.jsx)("div",{className:"mb-1",children:(0,s.jsx)("p",{className:"font-medium",children:"user"===e.role?"You":"AI"})}),(0,s.jsx)(c8,{content:e.content})]},e.id)),(0,s.jsx)("div",{ref:et})]}),(0,s.jsxs)("div",{className:"p-3 space-y-2",children:[eb,(0,s.jsxs)("div",{className:"bg-card border border-border rounded-lg shadow-sm overflow-hidden",children:[(0,s.jsxs)("div",{className:"relative flex bg-card rounded-lg transition-all",children:[(0,s.jsx)(g,{value:a,onChange:e=>i(e.target.value),onKeyDown:e=>{!Z&&"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),eE())},placeholder:"Describe what you want to build...",className:"flex-1 px-3 py-2 bg-transparent border-0 resize-none focus:outline-none text-sm placeholder:text-muted-foreground text-foreground",rows:3,disabled:o||Z}),(0,s.jsx)("div",{className:"flex flex-col p-2 gap-2",children:(0,s.jsx)(m.$,{onClick:o?eD:eE,disabled:Z?!o:!o&&!a.trim(),size:"sm",className:"flex items-center gap-2",children:o?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n_.A,{className:"h-4 w-4 animate-spin"}),"Stop"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a1,{className:"h-4 w-4"}),"Send"]})})})]}),(0,s.jsx)("div",{className:"border-t border-border bg-muted/50 px-2 py-2",children:(0,s.jsxs)(r2.AM,{open:H,onOpenChange:V,children:[(0,s.jsx)(r2.Wv,{asChild:!0,children:(0,s.jsxs)(m.$,{variant:"outline",size:"sm",className:"h-7 text-xs","data-tour-id":"provider-settings-trigger",children:[(0,s.jsx)("span",{children:eh(q)}),H?(0,s.jsx)(nc.A,{className:"h-3 w-3 ml-1"}):(0,s.jsx)(a2.A,{className:"h-3 w-3 ml-1"})]})}),(0,s.jsx)(r2.hl,{className:"w-[calc(100vw-2rem)]",align:"start",children:(0,s.jsx)(ut.t,{onClose:()=>V(!1),onModelChange:e=>B(e)})})]})})]})]})]}),"files"===x&&(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-files-rgb), 0.01), rgba(var(--panel-files-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(al,{projectId:e.id,onFileSelect:ek,onClose:()=>es(!1)})}),"editor"===x&&(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-editor-rgb), 0.01), rgba(var(--panel-editor-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(aJ,{projectId:e.id,onFilesChange:ej,onClose:()=>ec(!1)})}),"preview"===x&&(0,s.jsx)("div",{className:"h-full border border-border rounded-lg shadow-sm overflow-hidden relative",style:{background:"linear-gradient(0deg, rgba(var(--panel-preview-rgb), 0.01), rgba(var(--panel-preview-rgb), 0.01)), var(--card)"},children:(0,s.jsx)(t4,{projectId:e.id,refreshTrigger:r,onFocusSelection:ev,hasFocusTarget:!!E,onClose:()=>ed(!1)})})]}),(0,s.jsx)("div",{className:"fixed bottom-0 left-0 right-0 bg-card border-t border-border",children:(0,s.jsxs)("div",{className:"flex justify-center items-center p-2 gap-2",children:[(0,s.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"assistant"===x?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"assistant"===x?"var(--button-assistant-active)":void 0},onClick:()=>y("assistant"),children:(0,s.jsx)(a0,{className:"h-4 w-4"})}),(0,s.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"files"===x?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"files"===x?"var(--button-files-active)":void 0},onClick:()=>y("files"),children:(0,s.jsx)(nW,{className:"h-4 w-4"})}),(0,s.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"editor"===x?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"editor"===x?"var(--button-editor-active)":void 0},onClick:()=>y("editor"),children:(0,s.jsx)(aG,{className:"h-4 w-4"})}),(0,s.jsx)("button",{className:`flex items-center justify-center py-2 px-2 rounded-lg transition-all shadow-sm ${"preview"===x?"text-white":"bg-transparent text-muted-foreground hover:bg-muted/80 hover:text-foreground"}`,style:{backgroundColor:"preview"===x?"var(--button-preview-active)":void 0},onClick:()=>y("preview"),children:(0,s.jsx)(D.A,{className:"h-4 w-4"})})]})})]})]}),(0,s.jsx)(nq,{location:"workspace"}),(0,s.jsx)(nq,{location:"settings"})]})}var un=r(76180),ua=r.n(un);let ui=(0,l.forwardRef)(({hidden:e=!1},t)=>{let[r,n]=(0,l.useState)(!1),[a,i]=(0,l.useState)(!1);return((0,l.useImperativeHandle)(t,()=>({bounce:()=>{r&&n(!1),i(!0),setTimeout(()=>i(!1),800)},show:()=>{n(!1)}})),r||e)?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ua(),{id:"379a48f9d6bb8275",children:"@-webkit-keyframes gentleBounceUp{0%,100%{-webkit-transform:translatey(0);transform:translatey(0)}25%{-webkit-transform:translatey(-12px);transform:translatey(-12px)}50%{-webkit-transform:translatey(-6px);transform:translatey(-6px)}75%{-webkit-transform:translatey(-8px);transform:translatey(-8px)}}@-moz-keyframes gentleBounceUp{0%,100%{-moz-transform:translatey(0);transform:translatey(0)}25%{-moz-transform:translatey(-12px);transform:translatey(-12px)}50%{-moz-transform:translatey(-6px);transform:translatey(-6px)}75%{-moz-transform:translatey(-8px);transform:translatey(-8px)}}@-o-keyframes gentleBounceUp{0%,100%{-o-transform:translatey(0);transform:translatey(0)}25%{-o-transform:translatey(-12px);transform:translatey(-12px)}50%{-o-transform:translatey(-6px);transform:translatey(-6px)}75%{-o-transform:translatey(-8px);transform:translatey(-8px)}}@keyframes gentleBounceUp{0%,100%{-webkit-transform:translatey(0);-moz-transform:translatey(0);-o-transform:translatey(0);transform:translatey(0)}25%{-webkit-transform:translatey(-12px);-moz-transform:translatey(-12px);-o-transform:translatey(-12px);transform:translatey(-12px)}50%{-webkit-transform:translatey(-6px);-moz-transform:translatey(-6px);-o-transform:translatey(-6px);transform:translatey(-6px)}75%{-webkit-transform:translatey(-8px);-moz-transform:translatey(-8px);-o-transform:translatey(-8px);transform:translatey(-8px)}}"}),(0,s.jsx)("div",{style:{animation:a?"gentleBounceUp 0.8s ease-in-out":void 0},className:"jsx-379a48f9d6bb8275 fixed bottom-0 left-0 right-0 z-50 bg-card border-t-2 border-border shadow-2xl",children:(0,s.jsx)("div",{className:"jsx-379a48f9d6bb8275 container mx-auto px-4 py-4 max-w-6xl",children:(0,s.jsxs)("div",{className:"jsx-379a48f9d6bb8275 flex items-start justify-between gap-4",children:[(0,s.jsxs)("div",{className:"jsx-379a48f9d6bb8275 flex-1 space-y-2",children:[(0,s.jsx)("div",{className:"jsx-379a48f9d6bb8275 flex items-center gap-2",children:(0,s.jsx)("h3",{className:"jsx-379a48f9d6bb8275 text-lg font-bold text-foreground",children:"\uD83C\uDF89 DeepStudio is now OSW Studio!"})}),(0,s.jsx)("p",{className:"jsx-379a48f9d6bb8275 text-sm text-muted-foreground leading-relaxed",children:'The app remains functionally the same under the same license, just with a new name, logo and a lot of new functionalities that should make the agentic development even more agentic. This "DeepStudio" space will remain up and running for a couple of months to give you time to migrate over to "osw-studio".'}),(0,s.jsxs)("div",{className:"jsx-379a48f9d6bb8275 grid sm:grid-cols-2 gap-3 pt-2",children:[(0,s.jsxs)("div",{className:"jsx-379a48f9d6bb8275 space-y-1.5",children:[(0,s.jsx)("p",{className:"jsx-379a48f9d6bb8275 text-sm font-semibold text-foreground",children:"Migration Steps:"}),(0,s.jsxs)("ol",{className:"jsx-379a48f9d6bb8275 text-xs space-y-1 text-muted-foreground",children:[(0,s.jsx)("li",{className:"jsx-379a48f9d6bb8275",children:"1. Settings → Data Management → Export All Data"}),(0,s.jsx)("li",{className:"jsx-379a48f9d6bb8275",children:"2. Open OSW Studio and import your data"}),(0,s.jsx)("li",{className:"jsx-379a48f9d6bb8275",children:"3. ❤️ Like the space to help you and others find it"})]})]}),(0,s.jsx)("div",{className:"jsx-379a48f9d6bb8275 flex flex-col gap-2 sm:items-end sm:justify-center",children:(0,s.jsx)(m.$,{asChild:!0,size:"sm",className:"font-semibold",children:(0,s.jsxs)("a",{href:"https://huggingface.co/spaces/otst/osw-studio",target:"_blank",rel:"noopener noreferrer",className:"jsx-379a48f9d6bb8275 flex items-center gap-2",children:[(0,s.jsx)(r_.A,{className:"h-4 w-4"}),"Open OSW Studio"]})})})]})]}),(0,s.jsx)(m.$,{variant:"ghost",size:"icon",onClick:()=>n(!0),className:"text-muted-foreground hover:text-foreground hover:bg-muted flex-shrink-0",title:"Dismiss (will reappear on interactions)",children:(0,s.jsx)(k.A,{className:"h-5 w-5"})})]})})})]})});function uo(){let[e,t]=(0,l.useState)(null),{state:r,setActiveProjectId:n}=nF(),a=(0,l.useRef)(null);(0,d.usePathname)(),r.currentStep?.id,r.status;let i=e=>{a.current?.bounce()},o=(0,l.useMemo)(()=>e?(0,s.jsx)(ur,{project:e,onBack:()=>t(null)}):(0,s.jsx)(nB,{onProjectSelect:i,bannerRef:a}),[e]);return(0,s.jsxs)(s.Fragment,{children:[o,(0,s.jsx)(nq,{location:"global"}),(0,s.jsx)(ui,{ref:a,hidden:!1})]})}function us(){return(0,s.jsx)(nO,{children:(0,s.jsx)(uo,{})})}ui.displayName="MigrationBanner"},10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},11120:function(e,t,r){"use strict";var n=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(r(65840)),a=r(86908);function i(e,t){var r={};return e&&"string"==typeof e&&(0,n.default)(e,function(e,n){e&&n&&(r[(0,a.camelCase)(e,t)]=n)}),r}i.default=i,e.exports=i},19121:e=>{"use strict";e.exports=require("next/dist/server/app-render/action-async-storage.external.js")},19566:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},o=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var n,a=t.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!a&&!i)return!1;for(n in e);return void 0===n||t.call(e,n)},s=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,r){if("__proto__"===r){if(!t.call(e,r))return;else if(a)return a(e,r).value}return e[r]};e.exports=function e(){var t,r,n,a,c,u,d=arguments[0],p=1,h=arguments.length,m=!1;for("boolean"==typeof d&&(m=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p{Promise.resolve().then(r.bind(r,9999))},27910:e=>{"use strict";e.exports=require("stream")},28354:e=>{"use strict";e.exports=require("util")},29021:e=>{"use strict";e.exports=require("fs")},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:e=>{"use strict";e.exports=require("path")},44517:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,l=/^\s+|\s+$/g;function c(e){return e?e.replace(l,""):""}e.exports=function(e,l){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];l=l||{};var u=1,d=1;function p(e){var t=e.match(r);t&&(u+=t.length);var n=e.lastIndexOf("\n");d=~n?e.length-n:d+e.length}function h(){var e={line:u,column:d};return function(t){return t.position=new m(e),v(n),t}}function m(e){this.start=e,this.end={line:u,column:d},this.source=l.source}m.prototype.content=e;var f=[];function g(t){var r=Error(l.source+":"+u+":"+d+": "+t);if(r.reason=t,r.filename=l.source,r.line=u,r.column=d,r.source=e,l.silent)f.push(r);else throw r}function v(t){var r=t.exec(e);if(r){var n=r[0];return p(n),e=e.slice(n.length),r}}function x(e){var t;for(e=e||[];t=y();)!1!==t&&e.push(t);return e}function y(){var t=h();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var r=2;""!=e.charAt(r)&&("*"!=e.charAt(r)||"/"!=e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return g("End of comment missing");var n=e.slice(2,r-2);return d+=2,p(n),e=e.slice(r),d+=2,t({type:"comment",comment:n})}}v(n);var b,w=[];for(x(w);b=function(){var e=h(),r=v(a);if(r){if(y(),!v(i))return g("property missing ':'");var n=v(o),l=e({type:"declaration",property:c(r[0].replace(t,"")),value:n?c(n[0].replace(t,"")):""});return v(s),l}}();)!1!==b&&(w.push(b),x(w));return w}},55511:e=>{"use strict";e.exports=require("crypto")},56397:()=>{},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},65840:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r=null;if(!e||"string"!=typeof e)return r;var n=(0,a.default)(e),i="function"==typeof t;return n.forEach(function(e){if("declaration"===e.type){var n=e.property,a=e.value;i?t(n,a,e):a&&((r=r||{})[n]=a)}}),r};var a=n(r(44517))},71997:(e,t,r)=>{"use strict";r.r(t),r.d(t,{GlobalError:()=>o.a,__next_app__:()=>d,pages:()=>u,routeModule:()=>p,tree:()=>c});var n=r(65239),a=r(48088),i=r(88170),o=r.n(i),s=r(30893),l={};for(let e in s)0>["default","tree","pages","GlobalError","__next_app__","routeModule"].indexOf(e)&&(l[e]=()=>s[e]);r.d(t,l);let c={children:["",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(r.bind(r,90597)),"/Users/otto/Desktop/deepstudio/deepstudio-git/app/page.tsx"],metadata:{icon:[async e=>(await Promise.resolve().then(r.bind(r,46055))).default(e)],apple:[],openGraph:[],twitter:[],manifest:void 0}}]},{layout:[()=>Promise.resolve().then(r.bind(r,58014)),"/Users/otto/Desktop/deepstudio/deepstudio-git/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(r.t.bind(r,57398,23)),"next/dist/client/components/not-found-error"],forbidden:[()=>Promise.resolve().then(r.t.bind(r,89999,23)),"next/dist/client/components/forbidden-error"],unauthorized:[()=>Promise.resolve().then(r.t.bind(r,65284,23)),"next/dist/client/components/unauthorized-error"],metadata:{icon:[async e=>(await Promise.resolve().then(r.bind(r,46055))).default(e)],apple:[],openGraph:[],twitter:[],manifest:void 0}}]}.children,u=["/Users/otto/Desktop/deepstudio/deepstudio-git/app/page.tsx"],d={require:r,loadChunk:()=>Promise.resolve()},p=new n.AppPageRouteModule({definition:{kind:a.RouteKind.APP_PAGE,page:"/page",pathname:"/",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:c}})},75913:(e,t,r)=>{"use strict";r(56397);var n=r(43210),a=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(n),i="undefined"!=typeof process&&process.env&&!0,o=function(e){return"[object String]"===Object.prototype.toString.call(e)},s=function(){function e(e){var t=void 0===e?{}:e,r=t.name,n=void 0===r?"stylesheet":r,a=t.optimizeForSpeed,s=void 0===a?i:a;l(o(n),"`name` must be a string"),this._name=n,this._deletedRulePlaceholder="#"+n+"-deleted-rule____{}",l("boolean"==typeof s,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=s,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0,this._nonce=null}var t,r=e.prototype;return r.setOptimizeForSpeed=function(e){l("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),l(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},r.isOptimizeForSpeed=function(){return this._optimizeForSpeed},r.inject=function(){var e=this;l(!this._injected,"sheet already injected"),this._injected=!0,this._serverSheet={cssRules:[],insertRule:function(t,r){return"number"==typeof r?e._serverSheet.cssRules[r]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),r},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},r.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t>>0},u={};function d(e,t){if(!t)return"jsx-"+e;var r=String(t),n=e+r;return u[n]||(u[n]="jsx-"+c(e+"-"+r)),u[n]}function p(e,t){var r=e+(t=t.replace(/\/style/gi,"\\/style"));return u[r]||(u[r]=t.replace(/__jsx-style-dynamic-selector/g,e)),u[r]}var h=function(){function e(e){var t=void 0===e?{}:e,r=t.styleSheet,n=void 0===r?null:r,a=t.optimizeForSpeed,i=void 0!==a&&a;this._sheet=n||new s({name:"styled-jsx",optimizeForSpeed:i}),this._sheet.inject(),n&&"boolean"==typeof i&&(this._sheet.setOptimizeForSpeed(i),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed());var r=this.getIdAndRules(e),n=r.styleId,a=r.rules;if(n in this._instancesCounts){this._instancesCounts[n]+=1;return}var i=a.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[n]=i,this._instancesCounts[n]=1},t.remove=function(e){var t=this,r=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(r in this._instancesCounts,"styleId: `"+r+"` not found"),this._instancesCounts[r]-=1,this._instancesCounts[r]<1){var n=this._fromServer&&this._fromServer[r];n?(n.parentNode.removeChild(n),delete this._fromServer[r]):(this._indices[r].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[r]),delete this._instancesCounts[r]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],r=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return r[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,r;return t=this.cssRules(),void 0===(r=e)&&(r={}),t.map(function(e){var t=e[0],n=e[1];return a.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:r.nonce?r.nonce:void 0,dangerouslySetInnerHTML:{__html:n}})})},t.getIdAndRules=function(e){var t=e.children,r=e.dynamic,n=e.id;if(r){var a=d(n,r);return{styleId:a,rules:Array.isArray(t)?t.map(function(e){return p(a,e)}):[p(a,t)]}}return{styleId:d(n),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),m=n.createContext(null);m.displayName="StyleSheetContext";a.default.useInsertionEffect||a.default.useLayoutEffect;var f=void 0;function g(e){var t=f||n.useContext(m);return t&&t.add(e),null}g.dynamic=function(e){return e.map(function(e){return d(e[0],e[1])}).join(" ")},t.style=g},76180:(e,t,r)=>{"use strict";e.exports=r(75913).style},79428:e=>{"use strict";e.exports=require("buffer")},79551:e=>{"use strict";e.exports=require("url")},86908:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.camelCase=void 0;var r=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,a=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(e,t){return t.toUpperCase()},l=function(e,t){return"".concat(t,"-")};t.camelCase=function(e,t){var c;return(void 0===t&&(t={}),!(c=e)||a.test(c)||r.test(c))?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(o,l):e.replace(i,l)).replace(n,s))}},90597:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});let n=(0,r(12907).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/otto/Desktop/deepstudio/deepstudio-git/app/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/otto/Desktop/deepstudio/deepstudio-git/app/page.tsx","default")},94735:e=>{"use strict";e.exports=require("events")}};var t=require("../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),n=t.X(0,[447,551,212,617],()=>r(71997));module.exports=n})(); \ No newline at end of file