kcode-cli 1.3.20 → 1.3.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +105 -0
- package/dist/cli.js +89 -14
- package/dist/web/assets/dialog-XMzptB8h.js +1 -0
- package/dist/web/assets/dialog-fork-D6v09HNl.js +1 -0
- package/dist/web/assets/dialog-manage-models-Bm6CtoIz.js +2 -0
- package/dist/web/assets/dialog-model-config-gyTP8r4J.js +2 -0
- package/dist/web/assets/dialog-select-file-Dknr4kkI.js +1 -0
- package/dist/web/assets/dialog-select-mcp-Cu7sZ2gM.js +1 -0
- package/dist/web/assets/{ghostty-web-BcHj2Azi.js → ghostty-web-CQPt5osq.js} +1 -1
- package/dist/web/assets/home-DAGgJkXQ.js +1 -0
- package/dist/web/assets/{index-ZtG0ehHM.js → index-0V_fi__s.js} +103 -103
- package/dist/web/assets/{index-SW1-heh1.css → index-eOIcRPgw.css} +1 -1
- package/dist/web/assets/session-C8MftpUd.js +71 -0
- package/dist/web/index.html +2 -2
- package/package.json +3 -2
- package/dist/cli.js.map +0 -7
- package/dist/web/assets/datetime-D2JCa3fE.js +0 -1
- package/dist/web/assets/dialog-ChUDEDFM.js +0 -1
- package/dist/web/assets/dialog-fork-inuujukQ.js +0 -1
- package/dist/web/assets/dialog-manage-models-Da1j6ge0.js +0 -2
- package/dist/web/assets/dialog-model-config-Cb0RJYRC.js +0 -2
- package/dist/web/assets/dialog-select-file-BMB_32aJ.js +0 -1
- package/dist/web/assets/dialog-select-mcp-BjQv9uCE.js +0 -1
- package/dist/web/assets/home-Bu-XaUcM.js +0 -1
- package/dist/web/assets/session-s1rW9No2.js +0 -71
|
@@ -1 +0,0 @@
|
|
|
1
|
-
class P extends Error{}class Gn extends P{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Jn extends P{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class _n extends P{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Q extends P{}class At extends P{constructor(e){super(`Invalid unit ${e}`)}}class N extends P{}class Z extends P{constructor(){super("Zone is an abstract class")}}const c="numeric",W="short",E="long",Ne={year:c,month:c,day:c},zt={year:c,month:W,day:c},Bn={year:c,month:W,day:c,weekday:W},Ut={year:c,month:E,day:c},Rt={year:c,month:E,day:c,weekday:E},qt={hour:c,minute:c},Ht={hour:c,minute:c,second:c},Yt={hour:c,minute:c,second:c,timeZoneName:W},Pt={hour:c,minute:c,second:c,timeZoneName:E},Gt={hour:c,minute:c,hourCycle:"h23"},Jt={hour:c,minute:c,second:c,hourCycle:"h23"},_t={hour:c,minute:c,second:c,hourCycle:"h23",timeZoneName:W},Bt={hour:c,minute:c,second:c,hourCycle:"h23",timeZoneName:E},jt={year:c,month:c,day:c,hour:c,minute:c},Qt={year:c,month:c,day:c,hour:c,minute:c,second:c},Kt={year:c,month:W,day:c,hour:c,minute:c},Xt={year:c,month:W,day:c,hour:c,minute:c,second:c},jn={year:c,month:W,day:c,weekday:W,hour:c,minute:c},en={year:c,month:E,day:c,hour:c,minute:c,timeZoneName:W},tn={year:c,month:E,day:c,hour:c,minute:c,second:c,timeZoneName:W},nn={year:c,month:E,day:c,weekday:E,hour:c,minute:c,timeZoneName:E},rn={year:c,month:E,day:c,weekday:E,hour:c,minute:c,second:c,timeZoneName:E};class me{get type(){throw new Z}get name(){throw new Z}get ianaName(){return this.name}get isUniversal(){throw new Z}offsetName(e,t){throw new Z}formatOffset(e,t){throw new Z}offset(e){throw new Z}equals(e){throw new Z}get isValid(){throw new Z}}let Ce=null;class De extends me{static get instance(){return Ce===null&&(Ce=new De),Ce}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return yn(e,t,r)}formatOffset(e,t){return de(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}const qe=new Map;function Qn(n){let e=qe.get(n);return e===void 0&&(e=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),qe.set(n,e)),e}const Kn={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Xn(n,e){const t=n.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,s,i,a,o,u,l,f]=r;return[a,s,i,o,u,l,f]}function er(n,e){const t=n.formatToParts(e),r=[];for(let s=0;s<t.length;s++){const{type:i,value:a}=t[s],o=Kn[i];i==="era"?r[o]=a:d(o)||(r[o]=parseInt(a,10))}return r}const We=new Map;class $ extends me{static create(e){let t=We.get(e);return t===void 0&&We.set(e,t=new $(e)),t}static resetCache(){We.clear(),qe.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=$.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return yn(e,t,r,this.name)}formatOffset(e,t){return de(this.offset(e),t)}offset(e){if(!this.valid)return NaN;const t=new Date(e);if(isNaN(t))return NaN;const r=Qn(this.name);let[s,i,a,o,u,l,f]=r.formatToParts?er(r,t):Xn(r,t);o==="BC"&&(s=-Math.abs(s)+1);const S=be({year:s,month:i,day:a,hour:u===24?0:u,minute:l,second:f,millisecond:0});let m=+t;const v=m%1e3;return m-=v>=0?v:1e3+v,(S-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let lt={};function tr(n,e={}){const t=JSON.stringify([n,e]);let r=lt[t];return r||(r=new Intl.ListFormat(n,e),lt[t]=r),r}const He=new Map;function Ye(n,e={}){const t=JSON.stringify([n,e]);let r=He.get(t);return r===void 0&&(r=new Intl.DateTimeFormat(n,e),He.set(t,r)),r}const Pe=new Map;function nr(n,e={}){const t=JSON.stringify([n,e]);let r=Pe.get(t);return r===void 0&&(r=new Intl.NumberFormat(n,e),Pe.set(t,r)),r}const Ge=new Map;function rr(n,e={}){const{base:t,...r}=e,s=JSON.stringify([n,r]);let i=Ge.get(s);return i===void 0&&(i=new Intl.RelativeTimeFormat(n,e),Ge.set(s,i)),i}let le=null;function sr(){return le||(le=new Intl.DateTimeFormat().resolvedOptions().locale,le)}const Je=new Map;function sn(n){let e=Je.get(n);return e===void 0&&(e=new Intl.DateTimeFormat(n).resolvedOptions(),Je.set(n,e)),e}const _e=new Map;function ir(n){let e=_e.get(n);if(!e){const t=new Intl.Locale(n);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,"minimalDays"in e||(e={...an,...e}),_e.set(n,e)}return e}function ar(n){const e=n.indexOf("-x-");e!==-1&&(n=n.substring(0,e));const t=n.indexOf("-u-");if(t===-1)return[n];{let r,s;try{r=Ye(n).resolvedOptions(),s=n}catch{const u=n.substring(0,t);r=Ye(u).resolvedOptions(),s=u}const{numberingSystem:i,calendar:a}=r;return[s,i,a]}}function or(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function ur(n){const e=[];for(let t=1;t<=12;t++){const r=h.utc(2009,t,1);e.push(n(r))}return e}function lr(n){const e=[];for(let t=1;t<=7;t++){const r=h.utc(2016,11,13+t);e.push(n(r))}return e}function ke(n,e,t,r){const s=n.listingMode();return s==="error"?null:s==="en"?t(e):r(e)}function cr(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||sn(n.locale).numberingSystem==="latn"}class fr{constructor(e,t,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:s,floor:i,...a}=r;if(!t||Object.keys(a).length>0){const o={useGrouping:!1,...r};r.padTo>0&&(o.minimumIntegerDigits=r.padTo),this.inf=nr(e,o)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):rt(e,3);return O(t,this.padTo)}}}class dr{constructor(e,t,r){this.opts=r,this.originalZone=void 0;let s;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const a=-1*(e.offset/60),o=a>=0?`Etc/GMT+${a}`:`Etc/GMT${a}`;e.offset!==0&&$.create(o).valid?(s=o,this.dt=e):(s="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,s=e.zone.name):(s="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const i={...this.opts};i.timeZone=i.timeZone||s,this.dtf=Ye(t,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:r}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class hr{constructor(e,t,r){this.opts={style:"long",...r},!t&&hn()&&(this.rtf=rr(e,r))}format(e,t){return this.rtf?this.rtf.format(e,t):Lr(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const an={firstDay:1,minimalDays:4,weekend:[6,7]};class k{static fromOpts(e){return k.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,r,s,i=!1){const a=e||p.defaultLocale,o=a||(i?"en-US":sr()),u=t||p.defaultNumberingSystem,l=r||p.defaultOutputCalendar,f=je(s)||p.defaultWeekSettings;return new k(o,u,l,f,a)}static resetCache(){le=null,He.clear(),Pe.clear(),Ge.clear(),Je.clear(),_e.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:r,weekSettings:s}={}){return k.create(e,t,r,s)}constructor(e,t,r,s,i){const[a,o,u]=ar(e);this.locale=a,this.numberingSystem=t||o||null,this.outputCalendar=r||u||null,this.weekSettings=s,this.intl=or(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=cr(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:k.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,je(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return ke(this,e,kn,()=>{const r=t?{month:e,day:"numeric"}:{month:e},s=t?"format":"standalone";return this.monthsCache[s][e]||(this.monthsCache[s][e]=ur(i=>this.extract(i,r,"month"))),this.monthsCache[s][e]})}weekdays(e,t=!1){return ke(this,e,Sn,()=>{const r=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},s=t?"format":"standalone";return this.weekdaysCache[s][e]||(this.weekdaysCache[s][e]=lr(i=>this.extract(i,r,"weekday"))),this.weekdaysCache[s][e]})}meridiems(){return ke(this,void 0,()=>On,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[h.utc(2016,11,13,9),h.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return ke(this,e,vn,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[h.utc(-40,1,1),h.utc(2017,1,1)].map(r=>this.extract(r,t,"era"))),this.eraCache[e]})}extract(e,t,r){const s=this.dtFormatter(e,t),i=s.formatToParts(),a=i.find(o=>o.type.toLowerCase()===r);return a?a.value:null}numberFormatter(e={}){return new fr(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new dr(e,this.intl,t)}relFormatter(e={}){return new hr(this.intl,this.isEnglish(),e)}listFormatter(e={}){return tr(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||sn(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:mn()?ir(this.locale):an}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Le=null;class I extends me{static get utcInstance(){return Le===null&&(Le=new I(0)),Le}static instance(e){return e===0?I.utcInstance:new I(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new I(Fe(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${de(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${de(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return de(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class mr extends me{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function U(n,e){if(d(n)||n===null)return e;if(n instanceof me)return n;if(pr(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?De.instance:t==="utc"||t==="gmt"?I.utcInstance:I.parseSpecifier(t)||$.create(n)}else return R(n)?I.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new mr(n)}const Xe={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},ct={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},yr=Xe.hanidec.replace(/[\[|\]]/g,"").split("");function gr(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t<n.length;t++){const r=n.charCodeAt(t);if(n[t].search(Xe.hanidec)!==-1)e+=yr.indexOf(n[t]);else for(const s in ct){const[i,a]=ct[s];r>=i&&r<=a&&(e+=r-i)}}return parseInt(e,10)}else return e}const Be=new Map;function wr(){Be.clear()}function F({numberingSystem:n},e=""){const t=n||"latn";let r=Be.get(t);r===void 0&&(r=new Map,Be.set(t,r));let s=r.get(e);return s===void 0&&(s=new RegExp(`${Xe[t]}${e}`),r.set(e,s)),s}let ft=()=>Date.now(),dt="system",ht=null,mt=null,yt=null,gt=60,wt,kt=null;class p{static get now(){return ft}static set now(e){ft=e}static set defaultZone(e){dt=e}static get defaultZone(){return U(dt,De.instance)}static get defaultLocale(){return ht}static set defaultLocale(e){ht=e}static get defaultNumberingSystem(){return mt}static set defaultNumberingSystem(e){mt=e}static get defaultOutputCalendar(){return yt}static set defaultOutputCalendar(e){yt=e}static get defaultWeekSettings(){return kt}static set defaultWeekSettings(e){kt=je(e)}static get twoDigitCutoffYear(){return gt}static set twoDigitCutoffYear(e){gt=e%100}static get throwOnInvalid(){return wt}static set throwOnInvalid(e){wt=e}static resetCaches(){k.resetCache(),$.resetCache(),h.resetCache(),wr()}}class C{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const on=[0,31,59,90,120,151,181,212,243,273,304,334],un=[0,31,60,91,121,152,182,213,244,274,305,335];function x(n,e){return new C("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function et(n,e,t){const r=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const s=r.getUTCDay();return s===0?7:s}function ln(n,e,t){return t+(ye(n)?un:on)[e-1]}function cn(n,e){const t=ye(n)?un:on,r=t.findIndex(i=>i<e),s=e-t[r];return{month:r+1,day:s}}function tt(n,e){return(n-e+7)%7+1}function Me(n,e=4,t=1){const{year:r,month:s,day:i}=n,a=ln(r,s,i),o=tt(et(r,s,i),t);let u=Math.floor((a-o+14-e)/7),l;return u<1?(l=r-1,u=he(l,e,t)):u>he(r,e,t)?(l=r+1,u=1):l=r,{weekYear:l,weekNumber:u,weekday:o,...Ve(n)}}function Tt(n,e=4,t=1){const{weekYear:r,weekNumber:s,weekday:i}=n,a=tt(et(r,1,e),t),o=K(r);let u=s*7+i-a-7+e,l;u<1?(l=r-1,u+=K(l)):u>o?(l=r+1,u-=K(r)):l=r;const{month:f,day:y}=cn(l,u);return{year:l,month:f,day:y,...Ve(n)}}function $e(n){const{year:e,month:t,day:r}=n,s=ln(e,t,r);return{year:e,ordinal:s,...Ve(n)}}function pt(n){const{year:e,ordinal:t}=n,{month:r,day:s}=cn(e,t);return{year:e,month:r,day:s,...Ve(n)}}function St(n,e){if(!d(n.localWeekday)||!d(n.localWeekNumber)||!d(n.localWeekYear)){if(!d(n.weekday)||!d(n.weekNumber)||!d(n.weekYear))throw new Q("Cannot mix locale-based week fields with ISO-based week fields");return d(n.localWeekday)||(n.weekday=n.localWeekday),d(n.localWeekNumber)||(n.weekNumber=n.localWeekNumber),d(n.localWeekYear)||(n.weekYear=n.localWeekYear),delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function kr(n,e=4,t=1){const r=xe(n.weekYear),s=b(n.weekNumber,1,he(n.weekYear,e,t)),i=b(n.weekday,1,7);return r?s?i?!1:x("weekday",n.weekday):x("week",n.weekNumber):x("weekYear",n.weekYear)}function Tr(n){const e=xe(n.year),t=b(n.ordinal,1,K(n.year));return e?t?!1:x("ordinal",n.ordinal):x("year",n.year)}function fn(n){const e=xe(n.year),t=b(n.month,1,12),r=b(n.day,1,Ie(n.year,n.month));return e?t?r?!1:x("day",n.day):x("month",n.month):x("year",n.year)}function dn(n){const{hour:e,minute:t,second:r,millisecond:s}=n,i=b(e,0,23)||e===24&&t===0&&r===0&&s===0,a=b(t,0,59),o=b(r,0,59),u=b(s,0,999);return i?a?o?u?!1:x("millisecond",s):x("second",r):x("minute",t):x("hour",e)}function d(n){return typeof n>"u"}function R(n){return typeof n=="number"}function xe(n){return typeof n=="number"&&n%1===0}function pr(n){return typeof n=="string"}function Sr(n){return Object.prototype.toString.call(n)==="[object Date]"}function hn(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function mn(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Or(n){return Array.isArray(n)?n:[n]}function Ot(n,e,t){if(n.length!==0)return n.reduce((r,s)=>{const i=[e(s),s];return r&&t(r[0],i[0])===r[0]?r:i},null)[1]}function vr(n,e){return e.reduce((t,r)=>(t[r]=n[r],t),{})}function ee(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function je(n){if(n==null)return null;if(typeof n!="object")throw new N("Week settings must be an object");if(!b(n.firstDay,1,7)||!b(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(e=>!b(e,1,7)))throw new N("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function b(n,e,t){return xe(n)&&n>=e&&n<=t}function Nr(n,e){return n-e*Math.floor(n/e)}function O(n,e=2){const t=n<0;let r;return t?r="-"+(""+-n).padStart(e,"0"):r=(""+n).padStart(e,"0"),r}function z(n){if(!(d(n)||n===null||n===""))return parseInt(n,10)}function q(n){if(!(d(n)||n===null||n===""))return parseFloat(n)}function nt(n){if(!(d(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function rt(n,e,t=!1){const r=10**e;return(t?Math.trunc:Math.round)(n*r)/r}function ye(n){return n%4===0&&(n%100!==0||n%400===0)}function K(n){return ye(n)?366:365}function Ie(n,e){const t=Nr(e-1,12)+1,r=n+(e-t)/12;return t===2?ye(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function be(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(n.year,n.month-1,n.day)),+e}function vt(n,e,t){return-tt(et(n,1,e),t)+e-1}function he(n,e=4,t=1){const r=vt(n,e,t),s=vt(n+1,e,t);return(K(n)-r+s)/7}function Qe(n){return n>99?n:n>p.twoDigitCutoffYear?1900+n:2e3+n}function yn(n,e,t,r=null){const s=new Date(n),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(i.timeZone=r);const a={timeZoneName:e,...i},o=new Intl.DateTimeFormat(t,a).formatToParts(s).find(u=>u.type.toLowerCase()==="timezonename");return o?o.value:null}function Fe(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const r=parseInt(e,10)||0,s=t<0||Object.is(t,-0)?-r:r;return t*60+s}function gn(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new N(`Invalid unit value ${n}`);return e}function Ee(n,e){const t={};for(const r in n)if(ee(n,r)){const s=n[r];if(s==null)continue;t[e(r)]=gn(s)}return t}function de(n,e){const t=Math.trunc(Math.abs(n/60)),r=Math.trunc(Math.abs(n%60)),s=n>=0?"+":"-";switch(e){case"short":return`${s}${O(t,2)}:${O(r,2)}`;case"narrow":return`${s}${t}${r>0?`:${r}`:""}`;case"techie":return`${s}${O(t,2)}${O(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Ve(n){return vr(n,["hour","minute","second","millisecond"])}const Mr=["January","February","March","April","May","June","July","August","September","October","November","December"],wn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ir=["J","F","M","A","M","J","J","A","S","O","N","D"];function kn(n){switch(n){case"narrow":return[...Ir];case"short":return[...wn];case"long":return[...Mr];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Tn=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],pn=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Er=["M","T","W","T","F","S","S"];function Sn(n){switch(n){case"narrow":return[...Er];case"short":return[...pn];case"long":return[...Tn];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const On=["AM","PM"],Dr=["Before Christ","Anno Domini"],xr=["BC","AD"],br=["B","A"];function vn(n){switch(n){case"narrow":return[...br];case"short":return[...xr];case"long":return[...Dr];default:return null}}function Fr(n){return On[n.hour<12?0:1]}function Vr(n,e){return Sn(e)[n.weekday-1]}function Cr(n,e){return kn(e)[n.month-1]}function Wr(n,e){return vn(e)[n.year<0?0:1]}function Lr(n,e,t="always",r=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&i){const y=n==="days";switch(e){case 1:return y?"tomorrow":`next ${s[n][0]}`;case-1:return y?"yesterday":`last ${s[n][0]}`;case 0:return y?"today":`this ${s[n][0]}`}}const a=Object.is(e,-0)||e<0,o=Math.abs(e),u=o===1,l=s[n],f=r?u?l[1]:l[2]||l[1]:u?s[n][0]:n;return a?`${o} ${f} ago`:`in ${o} ${f}`}function Nt(n,e){let t="";for(const r of n)r.literal?t+=r.val:t+=e(r.val);return t}const $r={D:Ne,DD:zt,DDD:Ut,DDDD:Rt,t:qt,tt:Ht,ttt:Yt,tttt:Pt,T:Gt,TT:Jt,TTT:_t,TTTT:Bt,f:jt,ff:Kt,fff:en,ffff:nn,F:Qt,FF:Xt,FFF:tn,FFFF:rn};class M{static create(e,t={}){return new M(e,t)}static parseFormat(e){let t=null,r="",s=!1;const i=[];for(let a=0;a<e.length;a++){const o=e.charAt(a);o==="'"?(r.length>0&&i.push({literal:s||/^\s+$/.test(r),val:r}),t=null,r="",s=!s):s||o===t?r+=o:(r.length>0&&i.push({literal:/^\s+$/.test(r),val:r}),r=o,t=o)}return r.length>0&&i.push({literal:s||/^\s+$/.test(r),val:r}),i}static macroTokenToFormatOpts(e){return $r[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return O(e,t);const r={...this.opts};return t>0&&(r.padTo=t),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,t){const r=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(m,v)=>this.loc.extract(e,m,v),a=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",o=()=>r?Fr(e):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),u=(m,v)=>r?Cr(e,m):i(v?{month:m}:{month:m,day:"numeric"},"month"),l=(m,v)=>r?Vr(e,m):i(v?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const v=M.macroTokenToFormatOpts(m);return v?this.formatWithSystemDefault(e,v):m},y=m=>r?Wr(e,m):i({era:m},"era"),S=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return o();case"d":return s?i({day:"numeric"},"day"):this.num(e.day);case"dd":return s?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return s?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return u("short",!0);case"LLLL":return u("long",!0);case"LLLLL":return u("narrow",!0);case"M":return s?i({month:"numeric"},"month"):this.num(e.month);case"MM":return s?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return u("short",!1);case"MMMM":return u("long",!1);case"MMMMM":return u("narrow",!1);case"y":return s?i({year:"numeric"},"year"):this.num(e.year);case"yy":return s?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return y("short");case"GG":return y("long");case"GGGGG":return y("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(m)}};return Nt(M.parseFormat(t),S)}formatDurationFromString(e,t){const r=u=>{switch(u[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=u=>l=>{const f=r(l);return f?this.num(u.get(f),l.length):l},i=M.parseFormat(t),a=i.reduce((u,{literal:l,val:f})=>l?u:u.concat(f),[]),o=e.shiftTo(...a.map(r).filter(u=>u));return Nt(i,s(o))}}const Nn=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function te(...n){const e=n.reduce((t,r)=>t+r.source,"");return RegExp(`^${e}$`)}function ne(...n){return e=>n.reduce(([t,r,s],i)=>{const[a,o,u]=i(e,s);return[{...t,...a},o||r,u]},[{},null,1]).slice(0,2)}function re(n,...e){if(n==null)return[null,null];for(const[t,r]of e){const s=t.exec(n);if(s)return r(s)}return[null,null]}function Mn(...n){return(e,t)=>{const r={};let s;for(s=0;s<n.length;s++)r[n[s]]=z(e[t+s]);return[r,null,t+s]}}const In=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Zr=`(?:${In.source}?(?:\\[(${Nn.source})\\])?)?`,st=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,En=RegExp(`${st.source}${Zr}`),it=RegExp(`(?:T${En.source})?`),Ar=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,zr=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Ur=/(\d{4})-?(\d{3})/,Rr=Mn("weekYear","weekNumber","weekDay"),qr=Mn("year","ordinal"),Hr=/(\d{4})-(\d\d)-(\d\d)/,Dn=RegExp(`${st.source} ?(?:${In.source}|(${Nn.source}))?`),Yr=RegExp(`(?: ${Dn.source})?`);function X(n,e,t){const r=n[e];return d(r)?t:z(r)}function Pr(n,e){return[{year:X(n,e),month:X(n,e+1,1),day:X(n,e+2,1)},null,e+3]}function se(n,e){return[{hours:X(n,e,0),minutes:X(n,e+1,0),seconds:X(n,e+2,0),milliseconds:nt(n[e+3])},null,e+4]}function ge(n,e){const t=!n[e]&&!n[e+1],r=Fe(n[e+1],n[e+2]),s=t?null:I.instance(r);return[{},s,e+3]}function we(n,e){const t=n[e]?$.create(n[e]):null;return[{},t,e+1]}const Gr=RegExp(`^T?${st.source}$`),Jr=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function _r(n){const[e,t,r,s,i,a,o,u,l]=n,f=e[0]==="-",y=u&&u[0]==="-",S=(m,v=!1)=>m!==void 0&&(v||m&&f)?-m:m;return[{years:S(q(t)),months:S(q(r)),weeks:S(q(s)),days:S(q(i)),hours:S(q(a)),minutes:S(q(o)),seconds:S(q(u),u==="-0"),milliseconds:S(nt(l),y)}]}const Br={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function at(n,e,t,r,s,i,a){const o={year:e.length===2?Qe(z(e)):z(e),month:wn.indexOf(t)+1,day:z(r),hour:z(s),minute:z(i)};return a&&(o.second=z(a)),n&&(o.weekday=n.length>3?Tn.indexOf(n)+1:pn.indexOf(n)+1),o}const jr=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Qr(n){const[,e,t,r,s,i,a,o,u,l,f,y]=n,S=at(e,s,r,t,i,a,o);let m;return u?m=Br[u]:l?m=0:m=Fe(f,y),[S,new I(m)]}function Kr(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Xr=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,es=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,ts=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Mt(n){const[,e,t,r,s,i,a,o]=n;return[at(e,s,r,t,i,a,o),I.utcInstance]}function ns(n){const[,e,t,r,s,i,a,o]=n;return[at(e,o,t,r,s,i,a),I.utcInstance]}const rs=te(Ar,it),ss=te(zr,it),is=te(Ur,it),as=te(En),xn=ne(Pr,se,ge,we),os=ne(Rr,se,ge,we),us=ne(qr,se,ge,we),ls=ne(se,ge,we);function cs(n){return re(n,[rs,xn],[ss,os],[is,us],[as,ls])}function fs(n){return re(Kr(n),[jr,Qr])}function ds(n){return re(n,[Xr,Mt],[es,Mt],[ts,ns])}function hs(n){return re(n,[Jr,_r])}const ms=ne(se);function ys(n){return re(n,[Gr,ms])}const gs=te(Hr,Yr),ws=te(Dn),ks=ne(se,ge,we);function Ts(n){return re(n,[gs,xn],[ws,ks])}const It="Invalid Duration",bn={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},ps={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...bn},D=146097/400,_=146097/4800,Ss={years:{quarters:4,months:12,weeks:D/7,days:D,hours:D*24,minutes:D*24*60,seconds:D*24*60*60,milliseconds:D*24*60*60*1e3},quarters:{months:3,weeks:D/28,days:D/4,hours:D*24/4,minutes:D*24*60/4,seconds:D*24*60*60/4,milliseconds:D*24*60*60*1e3/4},months:{weeks:_/7,days:_,hours:_*24,minutes:_*24*60,seconds:_*24*60*60,milliseconds:_*24*60*60*1e3},...bn},Y=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Os=Y.slice(0).reverse();function A(n,e,t=!1){const r={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy,matrix:e.matrix||n.matrix};return new g(r)}function Fn(n,e){let t=e.milliseconds??0;for(const r of Os.slice(1))e[r]&&(t+=e[r]*n[r].milliseconds);return t}function Et(n,e){const t=Fn(n,e)<0?-1:1;Y.reduceRight((r,s)=>{if(d(e[s]))return r;if(r){const i=e[r]*t,a=n[s][r],o=Math.floor(i/a);e[s]+=o*t,e[r]-=o*a*t}return s},null),Y.reduce((r,s)=>{if(d(e[s]))return r;if(r){const i=e[r]%1;e[r]-=i,e[s]+=i*n[r][s]}return s},null)}function vs(n){const e={};for(const[t,r]of Object.entries(n))r!==0&&(e[t]=r);return e}class g{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let r=t?Ss:ps;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||k.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,t){return g.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new N(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new g({values:Ee(e,g.normalizeUnit),loc:k.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(R(e))return g.fromMillis(e);if(g.isDuration(e))return e;if(typeof e=="object")return g.fromObject(e);throw new N(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[r]=hs(e);return r?g.fromObject(r,t):g.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[r]=ys(e);return r?g.fromObject(r,t):g.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new N("need to specify a reason the Duration is invalid");const r=e instanceof C?e:new C(e,t);if(p.throwOnInvalid)throw new _n(r);return new g({invalid:r})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new At(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const r={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?M.create(this.loc,r).formatDurationFromString(this,e):It}toHuman(e={}){if(!this.isValid)return It;const t=Y.map(r=>{const s=this.values[r];return d(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:r.slice(0,-1)}).format(s)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=rt(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},h.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Fn(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=g.fromDurationLike(e),r={};for(const s of Y)(ee(t.values,s)||ee(this.values,s))&&(r[s]=t.get(s)+this.get(s));return A(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const t=g.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const r of Object.keys(this.values))t[r]=gn(e(this.values[r],r));return A(this,{values:t},!0)}get(e){return this[g.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...Ee(e,g.normalizeUnit)};return A(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:r,matrix:s}={}){const a={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:s,conversionAccuracy:r};return A(this,a)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Et(this.matrix,e),A(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=vs(this.normalize().shiftToAll().toObject());return A(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(a=>g.normalizeUnit(a));const t={},r={},s=this.toObject();let i;for(const a of Y)if(e.indexOf(a)>=0){i=a;let o=0;for(const l in r)o+=this.matrix[l][a]*r[l],r[l]=0;R(s[a])&&(o+=s[a]);const u=Math.trunc(o);t[a]=u,r[a]=(o*1e3-u*1e3)/1e3}else R(s[a])&&(r[a]=s[a]);for(const a in r)r[a]!==0&&(t[i]+=a===i?r[a]:r[a]/this.matrix[i][a]);return Et(this.matrix,t),A(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return A(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(r,s){return r===void 0||r===0?s===void 0||s===0:r===s}for(const r of Y)if(!t(this.values[r],e.values[r]))return!1;return!0}}const B="Invalid Interval";function Ns(n,e){return!n||!n.isValid?T.invalid("missing or invalid start"):!e||!e.isValid?T.invalid("missing or invalid end"):e<n?T.invalid("end before start",`The end of an interval must be after its start, but you had start=${n.toISO()} and end=${e.toISO()}`):null}class T{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new N("need to specify a reason the Interval is invalid");const r=e instanceof C?e:new C(e,t);if(p.throwOnInvalid)throw new Jn(r);return new T({invalid:r})}static fromDateTimes(e,t){const r=ue(e),s=ue(t),i=Ns(r,s);return i??new T({start:r,end:s})}static after(e,t){const r=g.fromDurationLike(t),s=ue(e);return T.fromDateTimes(s,s.plus(r))}static before(e,t){const r=g.fromDurationLike(t),s=ue(e);return T.fromDateTimes(s.minus(r),s)}static fromISO(e,t){const[r,s]=(e||"").split("/",2);if(r&&s){let i,a;try{i=h.fromISO(r,t),a=i.isValid}catch{a=!1}let o,u;try{o=h.fromISO(s,t),u=o.isValid}catch{u=!1}if(a&&u)return T.fromDateTimes(i,o);if(a){const l=g.fromISO(s,t);if(l.isValid)return T.after(i,l)}else if(u){const l=g.fromISO(r,t);if(l.isValid)return T.before(o,l)}}return T.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",t){if(!this.isValid)return NaN;const r=this.start.startOf(e,t);let s;return t?.useLocaleWeeks?s=this.end.reconfigure({locale:r.locale}):s=this.end,s=s.startOf(e,t),Math.floor(s.diff(r,e).get(e))+(s.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?T.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(ue).filter(a=>this.contains(a)).sort((a,o)=>a.toMillis()-o.toMillis()),r=[];let{s}=this,i=0;for(;s<this.e;){const a=t[i]||this.e,o=+a>+this.e?this.e:a;r.push(T.fromDateTimes(s,o)),s=o,i+=1}return r}splitBy(e){const t=g.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:r}=this,s=1,i;const a=[];for(;r<this.e;){const o=this.start.plus(t.mapUnits(u=>u*s));i=+o>+this.e?this.e:o,a.push(T.fromDateTimes(r,i)),r=i,s+=1}return a}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return t>=r?null:T.fromDateTimes(t,r)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return T.fromDateTimes(t,r)}static merge(e){const[t,r]=e.sort((s,i)=>s.s-i.s).reduce(([s,i],a)=>i?i.overlaps(a)||i.abutsStart(a)?[s,i.union(a)]:[s.concat([i]),a]:[s,a],[[],null]);return r&&t.push(r),t}static xor(e){let t=null,r=0;const s=[],i=e.map(u=>[{time:u.s,type:"s"},{time:u.e,type:"e"}]),a=Array.prototype.concat(...i),o=a.sort((u,l)=>u.time-l.time);for(const u of o)r+=u.type==="s"?1:-1,r===1?t=u.time:(t&&+t!=+u.time&&s.push(T.fromDateTimes(t,u.time)),t=null);return T.merge(s)}difference(...e){return T.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:B}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=Ne,t={}){return this.isValid?M.create(this.s.loc.clone(t),e).formatInterval(this):B}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:B}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:B}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:B}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:B}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):g.invalid(this.invalidReason)}mapEndpoints(e){return T.fromDateTimes(e(this.s),e(this.e))}}class Te{static hasDST(e=p.defaultZone){const t=h.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return $.isValidZone(e)}static normalizeZone(e){return U(e,p.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||k.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||k.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||k.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null,outputCalendar:i="gregory"}={}){return(s||k.create(t,r,i)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null,outputCalendar:i="gregory"}={}){return(s||k.create(t,r,i)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null}={}){return(s||k.create(t,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:s=null}={}){return(s||k.create(t,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return k.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return k.create(t,null,"gregory").eras(e)}static features(){return{relative:hn(),localeWeek:mn()}}}function Dt(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=t(e)-t(n);return Math.floor(g.fromMillis(r).as("days"))}function Ms(n,e,t){const r=[["years",(u,l)=>l.year-u.year],["quarters",(u,l)=>l.quarter-u.quarter+(l.year-u.year)*4],["months",(u,l)=>l.month-u.month+(l.year-u.year)*12],["weeks",(u,l)=>{const f=Dt(u,l);return(f-f%7)/7}],["days",Dt]],s={},i=n;let a,o;for(const[u,l]of r)t.indexOf(u)>=0&&(a=u,s[u]=l(n,e),o=i.plus(s),o>e?(s[u]--,n=i.plus(s),n>e&&(o=n,s[u]--,n=i.plus(s))):n=o);return[n,s,o,a]}function Is(n,e,t,r){let[s,i,a,o]=Ms(n,e,t);const u=e-s,l=t.filter(y=>["hours","minutes","seconds","milliseconds"].indexOf(y)>=0);l.length===0&&(a<e&&(a=s.plus({[o]:1})),a!==s&&(i[o]=(i[o]||0)+u/(a-s)));const f=g.fromObject(i,r);return l.length>0?g.fromMillis(u,r).shiftTo(...l).plus(f):f}const Es="missing Intl.DateTimeFormat.formatToParts support";function w(n,e=t=>t){return{regex:n,deser:([t])=>e(gr(t))}}const Ds=" ",Vn=`[ ${Ds}]`,Cn=new RegExp(Vn,"g");function xs(n){return n.replace(/\./g,"\\.?").replace(Cn,Vn)}function xt(n){return n.replace(/\./g,"").replace(Cn," ").toLowerCase()}function V(n,e){return n===null?null:{regex:RegExp(n.map(xs).join("|")),deser:([t])=>n.findIndex(r=>xt(t)===xt(r))+e}}function bt(n,e){return{regex:n,deser:([,t,r])=>Fe(t,r),groups:e}}function pe(n){return{regex:n,deser:([e])=>e}}function bs(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Fs(n,e){const t=F(e),r=F(e,"{2}"),s=F(e,"{3}"),i=F(e,"{4}"),a=F(e,"{6}"),o=F(e,"{1,2}"),u=F(e,"{1,3}"),l=F(e,"{1,6}"),f=F(e,"{1,9}"),y=F(e,"{2,4}"),S=F(e,"{4,6}"),m=L=>({regex:RegExp(bs(L.val)),deser:([J])=>J,literal:!0}),G=(L=>{if(n.literal)return m(L);switch(L.val){case"G":return V(e.eras("short"),0);case"GG":return V(e.eras("long"),0);case"y":return w(l);case"yy":return w(y,Qe);case"yyyy":return w(i);case"yyyyy":return w(S);case"yyyyyy":return w(a);case"M":return w(o);case"MM":return w(r);case"MMM":return V(e.months("short",!0),1);case"MMMM":return V(e.months("long",!0),1);case"L":return w(o);case"LL":return w(r);case"LLL":return V(e.months("short",!1),1);case"LLLL":return V(e.months("long",!1),1);case"d":return w(o);case"dd":return w(r);case"o":return w(u);case"ooo":return w(s);case"HH":return w(r);case"H":return w(o);case"hh":return w(r);case"h":return w(o);case"mm":return w(r);case"m":return w(o);case"q":return w(o);case"qq":return w(r);case"s":return w(o);case"ss":return w(r);case"S":return w(u);case"SSS":return w(s);case"u":return pe(f);case"uu":return pe(o);case"uuu":return w(t);case"a":return V(e.meridiems(),0);case"kkkk":return w(i);case"kk":return w(y,Qe);case"W":return w(o);case"WW":return w(r);case"E":case"c":return w(t);case"EEE":return V(e.weekdays("short",!1),1);case"EEEE":return V(e.weekdays("long",!1),1);case"ccc":return V(e.weekdays("short",!0),1);case"cccc":return V(e.weekdays("long",!0),1);case"Z":case"ZZ":return bt(new RegExp(`([+-]${o.source})(?::(${r.source}))?`),2);case"ZZZ":return bt(new RegExp(`([+-]${o.source})(${r.source})?`),2);case"z":return pe(/[a-z_+-/]{1,256}?/i);case" ":return pe(/[^\S\n\r]/);default:return m(L)}})(n)||{invalidReason:Es};return G.token=n,G}const Vs={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Cs(n,e,t){const{type:r,value:s}=n;if(r==="literal"){const u=/^\s+$/.test(s);return{literal:!u,val:u?" ":s}}const i=e[r];let a=r;r==="hour"&&(e.hour12!=null?a=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?a="hour12":a="hour24":a=t.hour12?"hour12":"hour24");let o=Vs[a];if(typeof o=="object"&&(o=o[i]),o)return{literal:!1,val:o}}function Ws(n){return[`^${n.map(t=>t.regex).reduce((t,r)=>`${t}(${r.source})`,"")}$`,n]}function Ls(n,e,t){const r=n.match(e);if(r){const s={};let i=1;for(const a in t)if(ee(t,a)){const o=t[a],u=o.groups?o.groups+1:1;!o.literal&&o.token&&(s[o.token.val[0]]=o.deser(r.slice(i,i+u))),i+=u}return[r,s]}else return[r,{}]}function $s(n){const e=i=>{switch(i){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,r;return d(n.z)||(t=$.create(n.z)),d(n.Z)||(t||(t=new I(n.Z)),r=n.Z),d(n.q)||(n.M=(n.q-1)*3+1),d(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),d(n.u)||(n.S=nt(n.u)),[Object.keys(n).reduce((i,a)=>{const o=e(a);return o&&(i[o]=n[a]),i},{}),t,r]}let Ze=null;function Zs(){return Ze||(Ze=h.fromMillis(1555555555555)),Ze}function As(n,e){if(n.literal)return n;const t=M.macroTokenToFormatOpts(n.val),r=Zn(t,e);return r==null||r.includes(void 0)?n:r}function Wn(n,e){return Array.prototype.concat(...n.map(t=>As(t,e)))}class Ln{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=Wn(M.parseFormat(t),e),this.units=this.tokens.map(r=>Fs(r,e)),this.disqualifyingUnit=this.units.find(r=>r.invalidReason),!this.disqualifyingUnit){const[r,s]=Ws(this.units);this.regex=RegExp(r,"i"),this.handlers=s}}explainFromTokens(e){if(this.isValid){const[t,r]=Ls(e,this.regex,this.handlers),[s,i,a]=r?$s(r):[null,null,void 0];if(ee(r,"a")&&ee(r,"H"))throw new Q("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:r,result:s,zone:i,specificOffset:a}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function $n(n,e,t){return new Ln(n,t).explainFromTokens(e)}function zs(n,e,t){const{result:r,zone:s,specificOffset:i,invalidReason:a}=$n(n,e,t);return[r,s,i,a]}function Zn(n,e){if(!n)return null;const r=M.create(e,n).dtFormatter(Zs()),s=r.formatToParts(),i=r.resolvedOptions();return s.map(a=>Cs(a,n,i))}const Ae="Invalid DateTime",Ft=864e13;function ce(n){return new C("unsupported zone",`the zone "${n.name}" is not supported`)}function ze(n){return n.weekData===null&&(n.weekData=Me(n.c)),n.weekData}function Ue(n){return n.localWeekData===null&&(n.localWeekData=Me(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek())),n.localWeekData}function H(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new h({...t,...e,old:t})}function An(n,e,t){let r=n-e*60*1e3;const s=t.offset(r);if(e===s)return[r,e];r-=(s-e)*60*1e3;const i=t.offset(r);return s===i?[r,s]:[n-Math.min(s,i)*60*1e3,Math.max(s,i)]}function Se(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function ve(n,e,t){return An(be(n),e,t)}function Vt(n,e){const t=n.o,r=n.c.year+Math.trunc(e.years),s=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,i={...n.c,year:r,month:s,day:Math.min(n.c.day,Ie(r,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},a=g.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),o=be(i);let[u,l]=An(o,t,n.zone);return a!==0&&(u+=a,l=n.zone.offset(u)),{ts:u,o:l}}function j(n,e,t,r,s,i){const{setZone:a,zone:o}=t;if(n&&Object.keys(n).length!==0||e){const u=e||o,l=h.fromObject(n,{...t,zone:u,specificOffset:i});return a?l:l.setZone(o)}else return h.invalid(new C("unparsable",`the input "${s}" can't be parsed as ${r}`))}function Oe(n,e,t=!0){return n.isValid?M.create(k.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function Re(n,e){const t=n.c.year>9999||n.c.year<0;let r="";return t&&n.c.year>=0&&(r+="+"),r+=O(n.c.year,t?6:4),e?(r+="-",r+=O(n.c.month),r+="-",r+=O(n.c.day)):(r+=O(n.c.month),r+=O(n.c.day)),r}function Ct(n,e,t,r,s,i){let a=O(n.c.hour);return e?(a+=":",a+=O(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(a+=":")):a+=O(n.c.minute),(n.c.millisecond!==0||n.c.second!==0||!t)&&(a+=O(n.c.second),(n.c.millisecond!==0||!r)&&(a+=".",a+=O(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!i?a+="Z":n.o<0?(a+="-",a+=O(Math.trunc(-n.o/60)),a+=":",a+=O(Math.trunc(-n.o%60))):(a+="+",a+=O(Math.trunc(n.o/60)),a+=":",a+=O(Math.trunc(n.o%60)))),i&&(a+="["+n.zone.ianaName+"]"),a}const zn={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Us={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Rs={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Un=["year","month","day","hour","minute","second","millisecond"],qs=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Hs=["year","ordinal","hour","minute","second","millisecond"];function Ys(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new At(n);return e}function Wt(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Ys(n)}}function Ps(n){if(fe===void 0&&(fe=p.now()),n.type!=="iana")return n.offset(fe);const e=n.name;let t=Ke.get(e);return t===void 0&&(t=n.offset(fe),Ke.set(e,t)),t}function Lt(n,e){const t=U(e.zone,p.defaultZone);if(!t.isValid)return h.invalid(ce(t));const r=k.fromObject(e);let s,i;if(d(n.year))s=p.now();else{for(const u of Un)d(n[u])&&(n[u]=zn[u]);const a=fn(n)||dn(n);if(a)return h.invalid(a);const o=Ps(t);[s,i]=ve(n,o,t)}return new h({ts:s,zone:t,loc:r,o:i})}function $t(n,e,t){const r=d(t.round)?!0:t.round,s=(a,o)=>(a=rt(a,r||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(a,o)),i=a=>t.calendary?e.hasSame(n,a)?0:e.startOf(a).diff(n.startOf(a),a).get(a):e.diff(n,a).get(a);if(t.unit)return s(i(t.unit),t.unit);for(const a of t.units){const o=i(a);if(Math.abs(o)>=1)return s(o,a)}return s(n>e?-0:0,t.units[t.units.length-1])}function Zt(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}let fe;const Ke=new Map;class h{constructor(e){const t=e.zone||p.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new C("invalid input"):null)||(t.isValid?null:ce(t));this.ts=d(e.ts)?p.now():e.ts;let s=null,i=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,i]=[e.old.c,e.old.o];else{const o=R(e.o)&&!e.old?e.o:t.offset(this.ts);s=Se(this.ts,o),r=Number.isNaN(s.year)?new C("invalid input"):null,s=r?null:s,i=r?null:o}this._zone=t,this.loc=e.loc||k.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=s,this.o=i,this.isLuxonDateTime=!0}static now(){return new h({})}static local(){const[e,t]=Zt(arguments),[r,s,i,a,o,u,l]=t;return Lt({year:r,month:s,day:i,hour:a,minute:o,second:u,millisecond:l},e)}static utc(){const[e,t]=Zt(arguments),[r,s,i,a,o,u,l]=t;return e.zone=I.utcInstance,Lt({year:r,month:s,day:i,hour:a,minute:o,second:u,millisecond:l},e)}static fromJSDate(e,t={}){const r=Sr(e)?e.valueOf():NaN;if(Number.isNaN(r))return h.invalid("invalid input");const s=U(t.zone,p.defaultZone);return s.isValid?new h({ts:r,zone:s,loc:k.fromObject(t)}):h.invalid(ce(s))}static fromMillis(e,t={}){if(R(e))return e<-Ft||e>Ft?h.invalid("Timestamp out of range"):new h({ts:e,zone:U(t.zone,p.defaultZone),loc:k.fromObject(t)});throw new N(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(R(e))return new h({ts:e*1e3,zone:U(t.zone,p.defaultZone),loc:k.fromObject(t)});throw new N("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const r=U(t.zone,p.defaultZone);if(!r.isValid)return h.invalid(ce(r));const s=k.fromObject(t),i=Ee(e,Wt),{minDaysInFirstWeek:a,startOfWeek:o}=St(i,s),u=p.now(),l=d(t.specificOffset)?r.offset(u):t.specificOffset,f=!d(i.ordinal),y=!d(i.year),S=!d(i.month)||!d(i.day),m=y||S,v=i.weekYear||i.weekNumber;if((m||f)&&v)throw new Q("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(S&&f)throw new Q("Can't mix ordinal dates with month/day");const G=v||i.weekday&&!m;let L,J,ie=Se(u,l);G?(L=qs,J=Us,ie=Me(ie,a,o)):f?(L=Hs,J=Rs,ie=$e(ie)):(L=Un,J=zn);let ot=!1;for(const oe of L){const Pn=i[oe];d(Pn)?ot?i[oe]=J[oe]:i[oe]=ie[oe]:ot=!0}const Rn=G?kr(i,a,o):f?Tr(i):fn(i),ut=Rn||dn(i);if(ut)return h.invalid(ut);const qn=G?Tt(i,a,o):f?pt(i):i,[Hn,Yn]=ve(qn,l,r),ae=new h({ts:Hn,zone:r,o:Yn,loc:s});return i.weekday&&m&&e.weekday!==ae.weekday?h.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${ae.toISO()}`):ae.isValid?ae:h.invalid(ae.invalid)}static fromISO(e,t={}){const[r,s]=cs(e);return j(r,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[r,s]=fs(e);return j(r,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[r,s]=ds(e);return j(r,s,t,"HTTP",t)}static fromFormat(e,t,r={}){if(d(e)||d(t))throw new N("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:i=null}=r,a=k.fromOpts({locale:s,numberingSystem:i,defaultToEN:!0}),[o,u,l,f]=zs(a,e,t);return f?h.invalid(f):j(o,u,r,`format ${t}`,e,l)}static fromString(e,t,r={}){return h.fromFormat(e,t,r)}static fromSQL(e,t={}){const[r,s]=Ts(e);return j(r,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new N("need to specify a reason the DateTime is invalid");const r=e instanceof C?e:new C(e,t);if(p.throwOnInvalid)throw new Gn(r);return new h({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const r=Zn(e,k.fromObject(t));return r?r.map(s=>s?s.val:null).join(""):null}static expandFormat(e,t={}){return Wn(M.parseFormat(e),k.fromObject(t)).map(s=>s.val).join("")}static resetCache(){fe=void 0,Ke.clear()}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?ze(this).weekYear:NaN}get weekNumber(){return this.isValid?ze(this).weekNumber:NaN}get weekday(){return this.isValid?ze(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Ue(this).weekday:NaN}get localWeekNumber(){return this.isValid?Ue(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Ue(this).weekYear:NaN}get ordinal(){return this.isValid?$e(this.c).ordinal:NaN}get monthShort(){return this.isValid?Te.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Te.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Te.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Te.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,r=be(this.c),s=this.zone.offset(r-e),i=this.zone.offset(r+e),a=this.zone.offset(r-s*t),o=this.zone.offset(r-i*t);if(a===o)return[this];const u=r-a*t,l=r-o*t,f=Se(u,a),y=Se(l,o);return f.hour===y.hour&&f.minute===y.minute&&f.second===y.second&&f.millisecond===y.millisecond?[H(this,{ts:u}),H(this,{ts:l})]:[this]}get isInLeapYear(){return ye(this.year)}get daysInMonth(){return Ie(this.year,this.month)}get daysInYear(){return this.isValid?K(this.year):NaN}get weeksInWeekYear(){return this.isValid?he(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?he(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:r,calendar:s}=M.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:r,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(I.instance(e),t)}toLocal(){return this.setZone(p.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:r=!1}={}){if(e=U(e,p.defaultZone),e.equals(this.zone))return this;if(e.isValid){let s=this.ts;if(t||r){const i=e.offset(this.ts),a=this.toObject();[s]=ve(a,i,e)}return H(this,{ts:s,zone:e})}else return h.invalid(ce(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:r}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:r});return H(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=Ee(e,Wt),{minDaysInFirstWeek:r,startOfWeek:s}=St(t,this.loc),i=!d(t.weekYear)||!d(t.weekNumber)||!d(t.weekday),a=!d(t.ordinal),o=!d(t.year),u=!d(t.month)||!d(t.day),l=o||u,f=t.weekYear||t.weekNumber;if((l||a)&&f)throw new Q("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&a)throw new Q("Can't mix ordinal dates with month/day");let y;i?y=Tt({...Me(this.c,r,s),...t},r,s):d(t.ordinal)?(y={...this.toObject(),...t},d(t.day)&&(y.day=Math.min(Ie(y.year,y.month),y.day))):y=pt({...$e(this.c),...t});const[S,m]=ve(y,this.o,this.zone);return H(this,{ts:S,o:m})}plus(e){if(!this.isValid)return this;const t=g.fromDurationLike(e);return H(this,Vt(this,t))}minus(e){if(!this.isValid)return this;const t=g.fromDurationLike(e).negate();return H(this,Vt(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const r={},s=g.normalizeUnit(e);switch(s){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(s==="weeks")if(t){const i=this.loc.getStartOfWeek(),{weekday:a}=this;a<i&&(r.weekNumber=this.weekNumber-1),r.weekday=i}else r.weekday=1;if(s==="quarters"){const i=Math.ceil(this.month/3);r.month=(i-1)*3+1}return this.set(r)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?M.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):Ae}toLocaleString(e=Ne,t={}){return this.isValid?M.create(this.loc.clone(t),e).formatDateTime(this):Ae}toLocaleParts(e={}){return this.isValid?M.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:r=!1,includeOffset:s=!0,extendedZone:i=!1}={}){if(!this.isValid)return null;const a=e==="extended";let o=Re(this,a);return o+="T",o+=Ct(this,a,t,r,s,i),o}toISODate({format:e="extended"}={}){return this.isValid?Re(this,e==="extended"):null}toISOWeekDate(){return Oe(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:r=!0,includePrefix:s=!1,extendedZone:i=!1,format:a="extended"}={}){return this.isValid?(s?"T":"")+Ct(this,a==="extended",t,e,r,i):null}toRFC2822(){return Oe(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Oe(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Re(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:r=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(r&&(s+=" "),t?s+="z":e&&(s+="ZZ")),Oe(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Ae}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",r={}){if(!this.isValid||!e.isValid)return g.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...r},i=Or(t).map(g.normalizeUnit),a=e.valueOf()>this.valueOf(),o=a?this:e,u=a?e:this,l=Is(o,u,i,s);return a?l.negate():l}diffNow(e="milliseconds",t={}){return this.diff(h.now(),e,t)}until(e){return this.isValid?T.fromDateTimes(this,e):this}hasSame(e,t,r){if(!this.isValid)return!1;const s=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,r)<=s&&s<=i.endOf(t,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||h.fromObject({},{zone:this.zone}),r=e.padding?this<t?-e.padding:e.padding:0;let s=["years","months","days","hours","minutes","seconds"],i=e.unit;return Array.isArray(e.unit)&&(s=e.unit,i=void 0),$t(t,this.plus(r),{...e,numeric:"always",units:s,unit:i})}toRelativeCalendar(e={}){return this.isValid?$t(e.base||h.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(h.isDateTime))throw new N("min requires all arguments be DateTimes");return Ot(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(h.isDateTime))throw new N("max requires all arguments be DateTimes");return Ot(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,r={}){const{locale:s=null,numberingSystem:i=null}=r,a=k.fromOpts({locale:s,numberingSystem:i,defaultToEN:!0});return $n(a,e,t)}static fromStringExplain(e,t,r={}){return h.fromFormatExplain(e,t,r)}static buildFormatParser(e,t={}){const{locale:r=null,numberingSystem:s=null}=t,i=k.fromOpts({locale:r,numberingSystem:s,defaultToEN:!0});return new Ln(i,e)}static fromFormatParser(e,t,r={}){if(d(e)||d(t))throw new N("fromFormatParser requires an input string and a format parser");const{locale:s=null,numberingSystem:i=null}=r,a=k.fromOpts({locale:s,numberingSystem:i,defaultToEN:!0});if(!a.equals(t.locale))throw new N(`fromFormatParser called with a locale of ${a}, but the format parser was created for ${t.locale}`);const{result:o,zone:u,specificOffset:l,invalidReason:f}=t.explainFromTokens(e);return f?h.invalid(f):j(o,u,r,`format ${t.format}`,e,l)}static get DATE_SHORT(){return Ne}static get DATE_MED(){return zt}static get DATE_MED_WITH_WEEKDAY(){return Bn}static get DATE_FULL(){return Ut}static get DATE_HUGE(){return Rt}static get TIME_SIMPLE(){return qt}static get TIME_WITH_SECONDS(){return Ht}static get TIME_WITH_SHORT_OFFSET(){return Yt}static get TIME_WITH_LONG_OFFSET(){return Pt}static get TIME_24_SIMPLE(){return Gt}static get TIME_24_WITH_SECONDS(){return Jt}static get TIME_24_WITH_SHORT_OFFSET(){return _t}static get TIME_24_WITH_LONG_OFFSET(){return Bt}static get DATETIME_SHORT(){return jt}static get DATETIME_SHORT_WITH_SECONDS(){return Qt}static get DATETIME_MED(){return Kt}static get DATETIME_MED_WITH_SECONDS(){return Xt}static get DATETIME_MED_WITH_WEEKDAY(){return jn}static get DATETIME_FULL(){return en}static get DATETIME_FULL_WITH_SECONDS(){return tn}static get DATETIME_HUGE(){return nn}static get DATETIME_HUGE_WITH_SECONDS(){return rn}}function ue(n){if(h.isDateTime(n))return n;if(n&&n.valueOf&&R(n.valueOf()))return h.fromJSDate(n);if(n&&typeof n=="object")return h.fromObject(n);throw new N(`Unknown datetime argument: ${n}, of type ${typeof n}`)}export{h as D};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as r,h as a,A as d,bD as l,S as f,M as g,I as m,C as b,ad as c,t as u,bb as w}from"./index-ZtG0ehHM.js";var D=u("<div data-slot=dialog-header>"),C=u("<div data-slot=dialog-body>"),$=u("<div data-component=dialog><div data-slot=dialog-container>");function _(t){const h=w();return(()=>{var n=$(),v=n.firstChild;return r(v,a(l.Content,{"data-slot":"dialog-content",get"data-no-header"(){return!t.title&&!t.action?"":void 0},get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},onOpenAutoFocus:e=>{const i=e.currentTarget?.querySelector("[autofocus]");i&&(e.preventDefault(),i.focus())},get children(){return[a(d,{get when(){return t.title||t.action},get children(){var e=D();return r(e,a(d,{get when(){return t.title},get children(){return a(l.Title,{"data-slot":"dialog-title",get children(){return t.title}})}}),null),r(e,a(f,{get children(){return[a(g,{get when(){return t.action},get children(){return t.action}}),a(g,{when:!0,get children(){return a(l.CloseButton,{"data-slot":"dialog-close-button",as:m,icon:"close",variant:"ghost",get"aria-label"(){return h.t("ui.common.close")}})}})]}}),null),e}}),a(d,{get when(){return t.description},get children(){return a(l.Description,{"data-slot":"dialog-description",style:{"margin-left":"-4px"},get children(){return t.description}})}}),(()=>{var e=C();return r(e,()=>t.children),e})()]}})),b(e=>{var o=t.fit?!0:void 0,i=t.size||"normal",s=t.transition?!0:void 0;return o!==e.e&&c(n,"data-fit",e.e=o),i!==e.t&&c(n,"data-size",e.t=i),s!==e.a&&c(n,"data-transition",e.a=s),e},{e:void 0,t:void 0,a:void 0}),n})()}export{_ as D};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aZ as D,b as k,b1 as v,b0 as S,bk as b,bn as _,g as $,h as d,i as u,n as w,s as g,t as P,k as F}from"./index-ZtG0ehHM.js";import{D as L}from"./dialog-ChUDEDFM.js";import{L as I,e as T}from"./session-s1rW9No2.js";import"./datetime-D2JCa3fE.js";var q=P('<div class="w-full flex items-center gap-2"><span class="truncate flex-1 min-w-0 text-left font-normal"></span><span class="text-text-weak shrink-0 font-normal">');function C(i){return i.toLocaleTimeString(void 0,{timeStyle:"short"})}const Z=()=>{const i=D(),p=k(),c=v(),l=S(),f=b(),h=_(),o=F(),x=$(()=>{const t=i.id;if(!t)return[];const a=c.data.message[t]??[],r=[];for(const s of a){if(s.role!=="user")continue;const e=(c.data.part[s.id]??[]).find(n=>n.type==="text"&&!n.synthetic&&!n.ignored);e&&r.push({id:s.id,text:e.text.replace(/\n/g," ").slice(0,200),time:C(new Date(s.time.created))})}return r.reverse()}),y=t=>{if(!t)return;const a=i.id;if(!a)return;const r=c.data.part[t.id]??[],s=T(r,{directory:l.directory}),m=w(l.directory);l.client.session.fork({sessionID:a,messageID:t.id}).then(e=>{if(!e.data){g({title:o.t("common.requestFailed")});return}h.close(),f.set(s,void 0,{dir:m,id:e.data.id}),p(`/${m}/session/${e.data.id}`)}).catch(e=>{const n=e instanceof Error?e.message:String(e);g({title:o.t("common.requestFailed"),description:n})})};return d(L,{get title(){return o.t("command.session.fork")},get children(){return d(I,{class:"flex-1 min-h-0 [&_[data-slot=list-scroll]]:flex-1 [&_[data-slot=list-scroll]]:min-h-0",get search(){return{placeholder:o.t("common.search.placeholder"),autofocus:!0}},get emptyMessage(){return o.t("dialog.fork.empty")},key:t=>t.id,items:x,filterKeys:["text"],onSelect:y,children:t=>(()=>{var a=q(),r=a.firstChild,s=r.nextSibling;return u(r,()=>t.text),u(s,()=>t.time),a})()})}})};export{Z as DialogFork};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dialog-model-config-Cb0RJYRC.js","assets/index-ZtG0ehHM.js","assets/index-SW1-heh1.css","assets/dialog-ChUDEDFM.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as m,t as f,bn as S,u as I,g as D,h as c,A as C,F as W,B as u,C as $,ad as z,k as L,bo as N,s as M}from"./index-ZtG0ehHM.js";import{D as E}from"./dialog-ChUDEDFM.js";var R=f('<div class="bg-surface-base px-4 rounded-lg">');const U=e=>(()=>{var t=R();return m(t,()=>e.children),t})(),b=1e3,x=128,v=x*b;function h(e){return e.replace(/\/+$/,"")}function w(e){const t=typeof e=="number"?Math.trunc(e):Number.NaN;return Number.isInteger(t)&&t>=v?t:v}function P(e){return String(Math.round(w(e)/b))}function T(e){return Array.isArray(e?.model_configs)?e.model_configs.flatMap(t=>{if(!t||typeof t!="object")return[];const r=typeof t.id=="string"?t.id.trim():"",n=typeof t.modelID=="string"?t.modelID.trim():"",s=typeof t.name=="string"?t.name.trim():"",i=typeof t.baseURL=="string"?h(t.baseURL.trim()):"",a=typeof t.apiKey=="string"?t.apiKey.trim():"",o=w(t.contextWindowSize);return!r||!n||!s||!i||!a?[]:[{id:r,modelID:n,name:s,baseURL:i,apiKey:a,contextWindowSize:o}]}):[]}function B(e){const t=e.form.modelID.trim(),r=e.form.name.trim(),n=h(e.form.baseURL.trim()),s=e.form.apiKey.trim(),i=e.form.contextWindowSize.trim(),a=/^\d+$/.test(i)?Number(i):Number.NaN,o={modelID:t?void 0:e.t("model.config.error.modelID.required"),name:r?void 0:e.t("model.config.error.name.required"),baseURL:n?/^https?:\/\//i.test(n)?void 0:e.t("model.config.error.baseURL.format"):e.t("model.config.error.baseURL.required"),apiKey:s?void 0:e.t("model.config.error.apiKey.required"),contextWindowSize:i?Number.isSafeInteger(a)?a<x?e.t("model.config.error.contextWindowSize.min",{min:x}):void 0:e.t("model.config.error.contextWindowSize.integer"):e.t("model.config.error.contextWindowSize.required")};return o.modelID||o.name||o.baseURL||o.apiKey||o.contextWindowSize?{err:o}:{err:o,result:{modelID:t,name:r,baseURL:n,apiKey:s,contextWindowSize:a*b}}}function K(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"model"}function X(e){const t=new Set(e.existing.map(i=>i.id).filter(i=>i!==e.currentID)),r=K(e.modelID);let n=r,s=2;for(;t.has(n);)n=`${r}-${s++}`;return n}var k=f('<div class="px-2.5 pb-3 overflow-y-auto max-h-[60vh]">'),O=f('<div class="py-4 text-14-regular text-text-weak">'),q=f('<div class="flex flex-wrap items-center justify-between gap-4 min-h-16 py-3 border-b border-border-weak-base last:border-none"data-component=model-config-row><div class="flex flex-col min-w-0"><span class="text-14-medium text-text-strong"></span><span class="text-12-regular text-text-weak"></span><span class="text-12-regular text-text-weak truncate"></span></div><div class="flex items-center gap-1">');const A=()=>{const e=S(),t=I(),r=L(),n=D(()=>T(t.data.config)),s=a=>{const o=n().find(l=>l.id===a);N(()=>import("./dialog-model-config-Cb0RJYRC.js"),__vite__mapDeps([0,1,2,3])).then(l=>{e.show(()=>c(l.DialogModelConfig,{item:o}))})},i=async a=>{const o=n(),l=o.filter(d=>d.id!==a);t.set("config","model_configs",l);try{await t.updateConfig({model_configs:l})}catch(d){t.set("config","model_configs",o);const g=d instanceof Error?d.message:String(d);M({title:r.t("common.requestFailed"),description:g})}};return c(E,{get title(){return r.t("dialog.model.manage")},get description(){return r.t("dialog.model.manage.description")},get action(){return c(u,{class:"h-7 -my-1 text-14-medium",icon:"plus-small",tabIndex:-1,onClick:()=>s(),get children(){return r.t("common.add")}})},transition:!0,get children(){var a=k();return m(a,c(U,{get children(){return c(C,{get when(){return n().length>0},get fallback(){return(()=>{var o=O();return m(o,()=>r.t("dialog.model.manage.empty")),o})()},get children(){return c(W,{get each(){return n()},children:o=>(()=>{var l=q(),d=l.firstChild,g=d.firstChild,p=g.nextSibling,y=p.nextSibling,_=d.nextSibling;return m(g,()=>o.name),m(p,()=>o.modelID),m(y,()=>o.baseURL),m(_,c(u,{size:"large",variant:"ghost",onClick:()=>s(o.id),get children(){return r.t("common.edit")}}),null),m(_,c(u,{size:"large",variant:"ghost",onClick:()=>void i(o.id),get children(){return r.t("common.delete")}}),null),$(()=>z(l,"data-model-config-id",o.id)),l})()})}})}})),a}})},Z=Object.freeze(Object.defineProperty({__proto__:null,DialogManageModels:A},Symbol.toStringTag,{value:"Module"}));export{X as a,Z as d,P as f,T as r,B as v};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dialog-manage-models-Da1j6ge0.js","assets/index-ZtG0ehHM.js","assets/index-SW1-heh1.css","assets/dialog-ChUDEDFM.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{bn as _,u as C,x as h,h as r,i as d,y as S,bm as m,B as z,I as L,t as W,k as K,s as R,bo as U}from"./index-ZtG0ehHM.js";import{D as M}from"./dialog-ChUDEDFM.js";import{f as $,v as B,a as E,r as F}from"./dialog-manage-models-Da1j6ge0.js";var k=W('<div class="flex flex-col gap-6 px-2.5 pb-3 overflow-y-auto max-h-[60vh]"><div class=px-2.5><div class="text-16-medium text-text-strong"></div></div><form class="px-2.5 pb-6 flex flex-col gap-4">');function A(i){const D=_(),u=C(),e=K(),[t,f]=h({modelID:i.item?.modelID??"",name:i.item?.name??"",baseURL:i.item?.baseURL??"",apiKey:i.item?.apiKey??"",contextWindowSize:$(i.item?.contextWindowSize),err:{}}),[v,b]=h({saving:!1}),y=()=>F(u.data.config),p=()=>{U(()=>import("./dialog-manage-models-Da1j6ge0.js").then(o=>o.d),__vite__mapDeps([0,1,2,3])).then(o=>{D.show(()=>r(o.DialogManageModels,{}))})},g=(o,l)=>{f(o,l),f("err",o,void 0)},I=async o=>{if(o.preventDefault(),v.saving)return;const l=B({form:t,t:e.t});f("err",l.err);const c="result"in l?l.result:void 0;if(!c)return;const a=y(),n={id:E({modelID:c.modelID,existing:a,currentID:i.item?.id}),...c},x=i.item?a.map(s=>s.id===i.item?.id?n:s):[...a,n];u.set("config","model_configs",x),b("saving",!0);try{await u.updateConfig({model_configs:x}),p()}catch(s){u.set("config","model_configs",a);const w=s instanceof Error?s.message:String(s);R({title:e.t("common.requestFailed"),description:w})}finally{b("saving",!1)}};return r(M,{get title(){return r(L,{tabIndex:-1,icon:"arrow-left",variant:"ghost",onClick:p,get"aria-label"(){return e.t("common.goBack")}})},transition:!0,get children(){var o=k(),l=o.firstChild,c=l.firstChild,a=l.nextSibling;return d(c,(()=>{var n=S(()=>!!i.item);return()=>n()?e.t("dialog.model.manage.edit"):e.t("dialog.model.manage.add")})()),a.addEventListener("submit",I),d(a,r(m,{autofocus:!0,get label(){return e.t("model.config.field.modelID.label")},get placeholder(){return e.t("model.config.field.modelID.placeholder")},get value(){return t.modelID},onChange:n=>g("modelID",n),get validationState(){return t.err.modelID?"invalid":void 0},get error(){return t.err.modelID}}),null),d(a,r(m,{get label(){return e.t("model.config.field.name.label")},get placeholder(){return e.t("model.config.field.name.placeholder")},get value(){return t.name},onChange:n=>g("name",n),get validationState(){return t.err.name?"invalid":void 0},get error(){return t.err.name}}),null),d(a,r(m,{get label(){return e.t("model.config.field.baseURL.label")},get placeholder(){return e.t("model.config.field.baseURL.placeholder")},get value(){return t.baseURL},onChange:n=>g("baseURL",n),get validationState(){return t.err.baseURL?"invalid":void 0},get error(){return t.err.baseURL}}),null),d(a,r(m,{get label(){return e.t("model.config.field.apiKey.label")},get placeholder(){return e.t("model.config.field.apiKey.placeholder")},get value(){return t.apiKey},onChange:n=>g("apiKey",n),get validationState(){return t.err.apiKey?"invalid":void 0},get error(){return t.err.apiKey}}),null),d(a,r(m,{type:"number",min:128,step:1,inputMode:"numeric",get label(){return e.t("model.config.field.contextWindowSize.label")},get description(){return e.t("model.config.field.contextWindowSize.description")},get placeholder(){return e.t("model.config.field.contextWindowSize.placeholder")},get value(){return t.contextWindowSize},onChange:n=>g("contextWindowSize",n),get validationState(){return t.err.contextWindowSize?"invalid":void 0},get error(){return t.err.contextWindowSize}}),null),d(a,r(z,{class:"w-auto self-start mt-2",type:"submit",size:"large",variant:"primary",get disabled(){return v.saving},get children(){return S(()=>!!v.saving)()?e.t("common.saving"):e.t("common.save")}}),null),o}})}export{A as DialogModelConfig};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a_ as U,a as V,bf as X,bn as Z,b as ee,e as te,u as ne,f as se,g as b,q as re,h as v,b3 as oe,S as ae,M as j,i as p,A as F,j as ie,C as O,bi as ce,m as A,k as le,n as de,t as k}from"./index-ZtG0ehHM.js";import{D as ue}from"./dialog-ChUDEDFM.js";import{u as fe,c as ge,L as he,F as me}from"./session-s1rW9No2.js";import"./datetime-D2JCa3fE.js";function pe(t,n){const i=new Date(t),s=new Date().getTime()-i.getTime(),c=Math.floor(s/1e3),d=Math.floor(c/60),o=Math.floor(d/60),u=Math.floor(o/24);return c<60?n("common.time.justNow"):d<60?n("common.time.minutesAgo.short",{count:d}):o<24?n("common.time.hoursAgo.short",{count:o}):n("common.time.daysAgo.short",{count:u})}var P=k('<span class="text-14-regular text-text-weak truncate">'),we=k('<div class="w-full flex items-center gap-4"><div class="flex items-center gap-2 min-w-0"><span class="text-14-regular text-text-strong whitespace-nowrap">'),ye=k('<span class="text-12-regular text-text-weak whitespace-nowrap ml-2">'),ve=k('<div class="w-full flex items-center justify-between rounded-md pl-1"><div class="flex items-center gap-x-3 grow min-w-0"><div class="flex items-center gap-2 min-w-0"><span class="text-14-regular text-text-strong truncate">'),be=k('<div class="w-full flex items-center justify-between rounded-md pl-1"><div class="flex items-center gap-x-3 grow min-w-0"><div class="flex items-center text-14-regular"><span class="text-text-weak whitespace-nowrap overflow-hidden overflow-ellipsis truncate min-w-0"></span><span class="text-text-strong whitespace-nowrap">');const T=5,xe=["session.new","session.previous","session.next","terminal.toggle","review.toggle"],q=t=>{const n=new Set,i=[];for(const f of t)n.has(f.id)||(n.add(f.id),i.push(f));return i},N=(t,n)=>({id:"command:"+t.id,type:"command",title:t.title,description:t.description,category:n,option:t}),D=(t,n)=>({id:"file:"+t,type:"file",title:t,category:n,path:t}),Se=(t,n)=>({id:`session:${t.directory}:${t.id}`,type:"session",title:t.title,description:t.description,category:n,directory:t.directory,sessionID:t.id,archived:t.archived,updated:t.updated});function $e(t){const n=b(()=>t.filesOnly()?[]:t.command.options.filter(s=>!s.disabled&&!s.id.startsWith("suggested.")&&s.id!=="file.open")),i=b(()=>{const s=t.language.t("palette.group.commands");return n().map(c=>N(c,s))}),f=b(()=>{const s=n(),c=new Map(xe.map((a,l)=>[a,l])),d=s.filter(a=>c.has(a.id)),o=d.length?d:s.slice(0,T),u=d.length?[...o].sort((a,l)=>(c.get(a.id)??0)-(c.get(l.id)??0)):o,y=t.language.t("palette.group.commands");return u.map(a=>N(a,y))});return{allowed:n,list:i,picks:f}}function _e(t){const n=ge({tabs:t.tabs,pathFromTab:t.file.pathFromTab,normalizeTab:s=>s.startsWith("file://")?t.file.tab(s):s}),i=b(()=>{const s=n.openedTabs(),c=n.activeFileTab(),d=c?[c,...s.filter(a=>a!==c)]:s,o=new Set,u=t.language.t("palette.group.files"),y=[];for(const a of d){const l=t.file.pathFromTab(a);l&&(o.has(l)||(o.add(l),y.push(D(l,u))))}return y.slice(0,T)}),f=b(()=>{const s=t.language.t("palette.group.files");return t.file.tree.children("").filter(o=>o.type==="file").map(o=>o.path).sort((o,u)=>o.localeCompare(u)).slice(0,T).map(o=>D(o,s))});return{recent:i,root:f}}function ke(t){const n={token:0,inflight:void 0,cached:void 0};return{sessions:f=>{if(!f.trim())return n.token+=1,n.inflight=void 0,n.cached=void 0,[];if(n.cached)return n.cached;if(n.inflight)return n.inflight;const c=n.token,d=t.directories();return d.length===0?[]:(n.inflight=Promise.all(d.map(o=>{const u=t.label(o);return t.globalSDK.client.session.list({directory:o,roots:!0}).then(y=>(y.data??[]).filter(a=>!!a?.id).map(a=>({id:a.id,title:a.title??t.language.t("command.session.new"),description:u,directory:o,archived:a.time?.archived,updated:a.time?.updated}))).catch(()=>[])})).then(o=>{if(n.token!==c)return[];const u=new Set,y=t.language.t("command.category.session"),a=o.flat().filter(l=>{const x=`${l.directory}:${l.id}`;return u.has(x)?!1:(u.add(x),!0)}).map(l=>Se(l,y));return n.cached=a,a}).catch(()=>[]).finally(()=>{n.inflight=void 0}),n.inflight)}}}function Te(t){const n=U(),i=le(),f=V(),s=X(),c=Z(),d=ee(),o=te(),u=ne(),{params:y,tabs:a,view:l}=fe(),x=()=>t.mode==="files",S={cleanup:void 0,committed:!1},[K,z]=se(!1),E=$e({filesOnly:x,command:n,language:i}),_=_e({file:s,tabs:a,language:i}),I=b(()=>oe(y.dir)??""),L=b(()=>{const e=I();if(e)return f.projects.list().find(r=>r.worktree===e)}),G=b(()=>{const e=I(),r=L();return r?[r.worktree]:e?[e]:[]}),R=b(()=>u.data.path.home),H=e=>{const r=L();if(r?.name)return r.name;const[h]=u.child(e,{bootstrap:!1}),g=R(),m=g?e.replace(g,"~"):e;return(h.vcs?.branch??A(e))||m},{sessions:W}=ke({directories:G,label:H,globalSDK:o,language:i}),B=async e=>{const r=e.trim();if(z(r.length>0),!r&&x()){const $=s.tree.state("")?.loaded,C=$?Promise.resolve():s.tree.list(""),M=q([..._.recent(),..._.root()]);return $||M.length>0?M:(await C,q([..._.recent(),..._.root()]))}if(!r)return[...E.picks(),..._.recent()];if(x()){const $=await s.searchFiles(r),C=i.t("palette.group.files");return $.map(M=>D(M,C))}const[h,g]=await Promise.all([s.searchFiles(r),Promise.resolve(W(r))]),m=i.t("palette.group.files"),w=h.map($=>D($,m));return[...E.list(),...g,...w]},Y=e=>{S.cleanup?.(),e&&e.type==="command"&&(S.cleanup=e.option?.onHighlight?.())},J=e=>{const r=s.tab(e);a().open(r),s.load(e),l().reviewPanel.opened()||l().reviewPanel.open(),f.fileTree.setTab("all"),t.onOpenFile?.(e),a().setActive(r)},Q=e=>{if(e){if(S.committed=!0,S.cleanup=void 0,c.close(),e.type==="command"){e.option?.onSelect?.("palette");return}if(e.type==="session"){if(!e.directory||!e.sessionID)return;d(`/${de(e.directory)}/session/${e.sessionID}`);return}e.path&&J(e.path)}};return re(()=>{S.committed||S.cleanup?.()}),v(ue,{class:"pt-3 pb-0 !max-h-[480px]",transition:!0,get children(){return v(he,{get search(){return{placeholder:x()?i.t("session.header.searchFiles"):i.t("palette.search.placeholder"),autofocus:!0,hideIcon:!0}},get emptyMessage(){return i.t("palette.empty")},get loadingMessage(){return i.t("common.loading")},items:B,key:e=>e.id,filterKeys:["title","description","category"],get groupBy(){return K()?e=>e.category:()=>""},onMove:Y,onSelect:Q,children:e=>v(ae,{get fallback(){return(()=>{var r=be(),h=r.firstChild,g=h.firstChild,m=g.firstChild,w=m.nextSibling;return p(h,v(me,{get node(){return{path:e.path??"",type:"file"}},class:"shrink-0 size-4"}),g),p(m,()=>ce(e.path??"")),p(w,()=>A(e.path??"")),r})()},get children(){return[v(j,{get when(){return e.type==="command"},get children(){var r=we(),h=r.firstChild,g=h.firstChild;return p(g,()=>e.title),p(h,v(F,{get when(){return e.description},get children(){var m=P();return p(m,()=>e.description),m}}),null),r}}),v(j,{get when(){return e.type==="session"},get children(){var r=ve(),h=r.firstChild,g=h.firstChild,m=g.firstChild;return p(h,v(ie,{name:"bubble-5",size:"small",class:"shrink-0 text-icon-weak"}),g),p(m,()=>e.title),p(g,v(F,{get when(){return e.description},get children(){var w=P();return p(w,()=>e.description),O(()=>w.classList.toggle("opacity-70",!!e.archived)),w}}),null),p(r,v(F,{get when(){return e.updated},get children(){var w=ye();return p(w,()=>pe(new Date(e.updated).toISOString(),i.t)),w}}),null),O(()=>m.classList.toggle("opacity-70",!!e.archived)),r}})]}})})}})}export{Te as DialogSelectFile};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ag as U,a4 as D,a8 as F,az as X,f as M,aC as Q,aD as V,g as P,h as r,af as R,w as b,R as B,aa as q,aE as W,a9 as E,as as Y,ap as Z,aq as ee,ay as te,ac as ne,am as ae,an as re,J as se,ak as oe,aF as ce,aG as ie,y as $,a2 as S,N as le,bB as de,al as ue,A as x,b1 as ge,b0 as he,x as me,z as T,X as pe,s as fe,bu as Ce,k as we,aL as be,i as C,t as I}from"./index-ZtG0ehHM.js";import{D as ve}from"./dialog-ChUDEDFM.js";import{a as ye,L as Se}from"./session-s1rW9No2.js";import"./datetime-D2JCa3fE.js";var xe={};ue(xe,{Control:()=>N,Description:()=>j,ErrorMessage:()=>A,Input:()=>z,Label:()=>G,Root:()=>H,Switch:()=>w,Thumb:()=>J,useSwitchContext:()=>v});var K=se();function v(){const a=le(K);if(a===void 0)throw new Error("[kobalte]: `useSwitchContext` must be used within a `Switch` component");return a}function N(a){const e=E(),t=v(),h=D({id:t.generateId("control")},a),[s,u]=F(h,["onClick","onKeyDown"]);return r(R,b({as:"div",onClick:f=>{S(f,s.onClick),t.toggle(),t.inputRef()?.focus()},onKeyDown:f=>{S(f,s.onKeyDown),f.key===de.Space&&(t.toggle(),t.inputRef()?.focus())}},()=>e.dataset(),()=>t.dataset(),u))}function j(a){const e=v();return r(re,b(()=>e.dataset(),a))}function A(a){const e=v();return r(ae,b(()=>e.dataset(),a))}function z(a){const e=E(),t=v(),h=D({id:t.generateId("input")},a),[s,u,l]=F(h,["ref","style","onChange","onFocus","onBlur"],Z),{fieldProps:p}=ee(u);return r(R,b({as:"input",ref(o){var i=q(t.setInputRef,s.ref);typeof i=="function"&&i(o)},type:"checkbox",role:"switch",get id(){return p.id()},get name(){return e.name()},get value(){return t.value()},get checked(){return t.checked()},get required(){return e.isRequired()},get disabled(){return e.isDisabled()},get readonly(){return e.isReadOnly()},get style(){return te({...ne},s.style)},get"aria-checked"(){return t.checked()},get"aria-label"(){return p.ariaLabel()},get"aria-labelledby"(){return p.ariaLabelledBy()},get"aria-describedby"(){return p.ariaDescribedBy()},get"aria-invalid"(){return e.validationState()==="invalid"||void 0},get"aria-required"(){return e.isRequired()||void 0},get"aria-disabled"(){return e.isDisabled()||void 0},get"aria-readonly"(){return e.isReadOnly()||void 0},onChange:o=>{S(o,s.onChange),o.stopPropagation();const i=o.target;t.setIsChecked(i.checked),i.checked=t.checked()},onFocus:o=>{S(o,s.onFocus),t.setIsFocused(!0)},onBlur:o=>{S(o,s.onBlur),t.setIsFocused(!1)}},()=>e.dataset(),()=>t.dataset(),l))}function G(a){const e=v();return r(Y,b(()=>e.dataset(),a))}function H(a){let e;const t=`switch-${U()}`,h=D({value:"on",id:t},a),[s,u,l]=F(h,["ref","children","value","checked","defaultChecked","onChange","onPointerDown"],X),[p,f]=M(),[n,c]=M(!1),{formControlContext:o}=Q(u),i=ye({isSelected:()=>s.checked,defaultIsSelected:()=>s.defaultChecked,onSelectedChange:d=>s.onChange?.(d),isDisabled:()=>o.isDisabled(),isReadOnly:()=>o.isReadOnly()});V(()=>e,()=>i.setIsSelected(s.defaultChecked??!1));const k=d=>{S(d,s.onPointerDown),n()&&d.preventDefault()},_=P(()=>({"data-checked":i.isSelected()?"":void 0})),g={value:()=>s.value,dataset:_,checked:()=>i.isSelected(),inputRef:p,generateId:oe(()=>B(u.id)),toggle:()=>i.toggle(),setIsChecked:d=>i.setIsSelected(d),setIsFocused:c,setInputRef:f};return r(W.Provider,{value:o,get children(){return r(K.Provider,{value:g,get children(){return r(R,b({as:"div",ref(d){var y=q(L=>e=L,s.ref);typeof y=="function"&&y(d)},role:"group",get id(){return B(u.id)},onPointerDown:k},()=>o.dataset(),_,l,{get children(){return r(ke,{state:g,get children(){return s.children}})}}))}})}})}function ke(a){const e=ce(()=>{const t=a.children;return ie(t)?t(a.state):t});return $(e)}function J(a){const e=E(),t=v(),h=D({id:t.generateId("thumb")},a);return r(R,b({as:"div"},()=>e.dataset(),()=>t.dataset(),h))}var w=Object.assign(H,{Control:N,Description:j,ErrorMessage:A,Input:z,Label:G,Thumb:J});function _e(a){const[e,t]=F(a,["children","class","hideLabel","description"]);return r(w,b(t,{get class(){return e.class},"data-component":"switch",get children(){return[r(w.Input,{"data-slot":"switch-input"}),r(x,{get when(){return e.children},get children(){return r(w.Label,{"data-slot":"switch-label",get classList(){return{"sr-only":e.hideLabel}},get children(){return e.children}})}}),r(x,{get when(){return e.description},get children(){return r(w.Description,{"data-slot":"switch-description",get children(){return e.description}})}}),r(w.ErrorMessage,{"data-slot":"switch-error"}),r(w.Control,{"data-slot":"switch-control",get children(){return r(w.Thumb,{"data-slot":"switch-thumb"})}})]}}))}var Pe=I('<span class="text-11-regular text-text-weaker">'),De=I('<span class="text-11-regular text-text-weak">'),Fe=I('<span class="text-11-regular text-text-weaker truncate">'),Re=I('<div class="w-full flex items-center justify-between gap-x-3"><div class="flex flex-col gap-0.5 min-w-0"><div class="flex items-center gap-2"><span class=truncate></span></div></div><div>');const Ie={connected:"mcp.status.connected",failed:"mcp.status.failed",needs_auth:"mcp.status.needs_auth",disabled:"mcp.status.disabled"},Me=()=>{const a=ge(),e=he(),t=we(),[h,s]=me({done:!1,loading:!1});T(pe(()=>a.data.mcp_ready,(n,c)=>{!n&&c&&s("done",!1)},{defer:!0})),T(()=>{if(!(h.done||h.loading)){if(a.data.mcp_ready){s("done",!0);return}s("loading",!0),e.client.mcp.status().then(n=>{a.set("mcp",n.data??{}),a.set("mcp_ready",!0),s("done",!0)}).catch(n=>{s("done",!0),fe({variant:"error",title:t.t("common.requestFailed"),description:n instanceof Error?n.message:String(n)})}).finally(()=>{s("loading",!1)})}});const u=P(()=>Object.entries(a.data.mcp??{}).map(([n,c])=>({name:n,status:c.status})).sort((n,c)=>n.name.localeCompare(c.name))),l=Ce(()=>({mutationFn:async n=>{a.data.mcp[n]?.status==="connected"?await e.client.mcp.disconnect({name:n}):await e.client.mcp.connect({name:n});const o=await e.client.mcp.status();o.data&&a.set("mcp",o.data)}})),p=P(()=>u().filter(n=>n.status==="connected").length),f=P(()=>u().length);return r(ve,{get title(){return t.t("dialog.mcp.title")},get description(){return t.t("dialog.mcp.description",{enabled:p(),total:f()})},get children(){return r(Se,{get search(){return{placeholder:t.t("common.search.placeholder"),autofocus:!0}},get emptyMessage(){return t.t("dialog.mcp.empty")},key:n=>n?.name??"",items:u,filterKeys:["name","status"],sortBy:(n,c)=>n.name.localeCompare(c.name),onSelect:n=>{!n||l.isPending||l.mutate(n.name)},children:n=>{const c=()=>a.data.mcp[n.name],o=()=>c()?.status,i=()=>{const g=o()?Ie[o()]:void 0;if(g)return t.t(g)},k=()=>{const g=c();return g?.status==="failed"?g.error:void 0},_=()=>o()==="connected";return(()=>{var g=Re(),d=g.firstChild,y=d.firstChild,L=y.firstChild,O=d.nextSibling;return C(L,()=>n.name),C(y,r(x,{get when(){return i()},get children(){var m=Pe();return C(m,i),m}}),null),C(y,r(x,{get when(){return $(()=>!!l.isPending)()&&l.variables===n.name},get children(){var m=De();return C(m,()=>t.t("common.loading.ellipsis")),m}}),null),C(d,r(x,{get when(){return k()},get children(){var m=Fe();return C(m,k),m}}),null),O.$$click=m=>m.stopPropagation(),C(O,r(_e,{get checked(){return _()},get disabled(){return $(()=>!!l.isPending)()&&l.variables===n.name},onChange:()=>{l.isPending||l.mutate(n.name)}})),g})()}})}})};be(["click"]);export{Me as DialogSelectMcp};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as A,a as B,b as I,c as E,d as G,e as K,f as R,g as m,i as r,h as n,L as W,M as v,B as u,F as H,T as N,I as q,j as J,S as O,k as Q,s as j,l as y,m as U,n as V,o as X,p as Y,t as i}from"./index-ZtG0ehHM.js";import{D as Z}from"./datetime-D2JCa3fE.js";var ee=i('<div class="mt-20 w-full flex flex-col gap-4"><div class="flex gap-2 items-center justify-between pl-3"><div class="text-14-medium text-text-strong"></div></div><ul class="flex flex-col gap-2">'),te=i('<div class="mt-30 mx-auto flex flex-col items-center gap-3"><div class="text-12-regular text-text-weak">'),re=i('<div class="mt-30 mx-auto flex flex-col items-center gap-3"><div class="flex flex-col gap-1 items-center justify-center"><div class="text-14-medium text-text-strong"></div><div class="text-12-regular text-text-weak">'),ae=i('<div class="mx-auto mt-55 w-full md:w-auto px-4">'),le=i('<div class="flex min-w-0 w-full items-center justify-between gap-3 text-left"><span class="min-w-0 truncate text-14-mono"></span><div class="shrink-0 text-14-regular text-text-weak">'),ne=i('<li class="flex items-center gap-2">');function oe(){const p=A(),w=B(),b=I(),P=E(),c=G(),C=K(),a=Q(),[g,S]=R(!1),D=m(()=>p.data.path.home),F=m(()=>new Set(c.projects.hidden())),M=e=>{const t=D();return!t||!e.startsWith(t)?e:"~"+e.slice(t.length)},T=m(()=>new Map(p.data.project.map(e=>[e.worktree,e]))),k=m(()=>{const e=T();return c.projects.recent().filter(t=>!F().has(t.worktree)).slice().slice(0,5).map(t=>{const l=e.get(t.worktree),s=t.touchedAt??l?.time.updated??l?.time.created;return{worktree:t.worktree,relativeTime:s?Z.fromMillis(s).toRelative():void 0}})});async function $(e,t=!0){const l=await w.projects.open(e);return l.status==="missing"?(j({variant:"error",title:a.t("toast.project.reloadFailed.title",{project:U(e)}),description:y(l.error,a.t)}),!1):(t&&(c.projects.touch(e),b(`/${V(e)}`)),!0)}const h=X({onPendingChange:S,task:async()=>{try{const e=await Y({withPriority:w.projects.withPriority,platform:P,client:C.client,title:a.t("command.project.open")});if(!e)return;await $(e)}catch(e){j({variant:"error",title:a.t("toast.project.openFailed.title"),description:y(e,a.t)})}}});function z(e){c.projects.hide(e)}return(()=>{var e=ae();return r(e,n(W,{class:"md:w-xl opacity-12"}),null),r(e,n(O,{get children(){return[n(v,{get when(){return k().length>0},get children(){var t=ee(),l=t.firstChild,s=l.firstChild,f=l.nextSibling;return r(s,()=>a.t("home.recentProjects")),r(l,n(u,{icon:"folder-add-left",size:"normal",class:"pl-2 pr-3",get disabled(){return g()},onClick:()=>void h(),get children(){return a.t("command.project.open")}}),null),r(f,n(H,{get each(){return k()},children:d=>(()=>{var x=ne();return r(x,n(u,{size:"large",variant:"ghost",class:"min-w-0 flex-1 px-3",onClick:()=>void $(d.worktree),get children(){var o=le(),_=o.firstChild,L=_.nextSibling;return r(_,()=>M(d.worktree)),r(L,()=>d.relativeTime),o}}),null),r(x,n(N,{get value(){return a.t("common.delete")},placement:"top",get children(){return n(q,{icon:"trash",variant:"ghost",class:"size-10 shrink-0 rounded-md",get"aria-label"(){return a.t("common.delete")},onClick:o=>{o.preventDefault(),o.stopPropagation(),z(d.worktree)}})}}),null),x})()})),t}}),n(v,{get when(){return!p.ready},get children(){var t=te(),l=t.firstChild;return r(l,()=>a.t("common.loading")),r(t,n(u,{class:"px-3",get disabled(){return g()},onClick:()=>void h(),get children(){return a.t("command.project.open")}}),null),t}}),n(v,{when:!0,get children(){var t=re(),l=t.firstChild,s=l.firstChild,f=s.nextSibling;return r(t,n(J,{name:"folder-add-left",size:"large"}),l),r(s,()=>a.t("home.empty.title")),r(f,()=>a.t("home.empty.description")),r(t,n(u,{class:"px-3 mt-1",get disabled(){return g()},onClick:()=>void h(),get children(){return a.t("command.project.open")}}),null),t}})]}}),null),e})()}export{oe as default};
|