import{o as e,t}from"./rolldown-runtime-f96lzs6p.js";import{C as n,Ct as r,Mt as i,P as a,Q as o,Qt as s,S as c,T as l,W as u,X as d,Y as f,_ as p,c as m,dt as h,en as g,ft as _,g as v,h as y,lt as b,m as x,p as S,s as C,t as w,tn as T,xt as E}from"./vendor/json-editor-vue-9tyg6b65.js";import{A as D,B as O,a as k,w as A}from"./utils-ivfwadyv.js";import{O as j,V as M,t as N,tt as ee}from"./client-kfvz1zfh.js";import{t as P}from"./storage-options-k70ge3wv.js";import{t as F}from"./nicon-hgcqr03x.js";import{t as te}from"./nbutton-g8ropw1z.js";import{t as I}from"./ncard-d0lyv7bx.js";import{n as L}from"./state-routes-pcpgumo2.js";import{t as ne}from"./telemetry-c1eueoux.js";import{t as re}from"./npanel-grids-es6yvxa6.js";import{t as ie}from"./ntext-input-hwoiw74g.js";import{c as ae,d as oe,h as se,s as R,u as ce}from"#entry";import{t as le}from"./ncode-block-cfw508sn.js";import{t as ue}from"./ndrawer-hxlw4o37.js";import{t as de}from"./pages-dm1j9w83.js";import{t as z}from"./nnavbar-eonyi8yr.js";import{t as B}from"./nsection-block-lfx32fn0.js";import{n as fe}from"./constants-g2z8m4rs.js";import{t as pe}from"./nbadge-nhg3871m.js";import{t as me}from"./server-route-inputs-7u2ciu8a.js";var he=e(t(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define(`cronstrue`,[],r):typeof e==`object`?e.cronstrue=r():n.cronstrue=r()})(globalThis,()=>(()=>{var e={6949(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.CronParser=void 0;var r=n(9515);t.CronParser=function(){function e(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=!1),this.expression=e,this.dayOfWeekStartIndexZero=t,this.monthStartIndexZero=n}return e.prototype.parse=function(){var e,t=this.expression??``;if(t===`@reboot`)return e=[`@reboot`,``,``,``,``,``,``],e;if(t.startsWith(`@`)){var n=this.parseSpecial(this.expression);e=this.extractParts(n)}else e=this.extractParts(this.expression);return this.normalize(e),this.validate(e),e},e.prototype.parseSpecial=function(e){var t={"@yearly":`0 0 1 JAN *`,"@annually":`0 0 1 JAN *`,"@monthly":`0 0 1 * *`,"@weekly":`0 0 * * SUN`,"@daily":`0 0 * * *`,"@midnight":`0 0 * * *`,"@hourly":`0 * * * *`,"@reboot":`@reboot`}[e];if(!t)throw Error(`Unknown special expression.`);return t},e.prototype.extractParts=function(e){if(!this.expression)throw Error(`cron expression is empty`);for(var t=e.trim().split(/[ ]+/),n=0;n7)throw Error(`Expression has ${t.length} parts; too many!`);return t},e.prototype.normalize=function(e){var t=this;if(e[3]=e[3].replace(`?`,`*`),e[5]=e[5].replace(`?`,`*`),e[2]=e[2].replace(`?`,`*`),e[0].indexOf(`0/`)==0&&(e[0]=e[0].replace(`0/`,`*/`)),e[1].indexOf(`0/`)==0&&(e[1]=e[1].replace(`0/`,`*/`)),e[2].indexOf(`0/`)==0&&(e[2]=e[2].replace(`0/`,`*/`)),e[3].indexOf(`1/`)==0&&(e[3]=e[3].replace(`1/`,`*/`)),!this.monthStartIndexZero&&e[4].indexOf(`1/`)==0&&(e[4]=e[4].replace(`1/`,`*/`)),e[6].indexOf(`1/`)==0&&(e[6]=e[6].replace(`1/`,`*/`)),e[5]=e[5].replace(/(^\d)|([^#/\s]\d)/g,function(e){var n=e.replace(/\D/,``),r=n;return t.dayOfWeekStartIndexZero?n==`7`&&(r=`0`):r=(parseInt(n)-1).toString(),e.replace(n,r)}),e[5]==`L`&&(e[5]=`6`),e[3]==`?`&&(e[3]=`*`),e[3].indexOf(`W`)>-1&&(e[3].indexOf(`,`)>-1||/[-+]/.test(e[3]))&&!/^\d{1,2}W[+-]\d{1,2}$/.test(e[3]))throw Error(`The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.`);var n={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var r in n)e[5]=e[5].replace(new RegExp(r,`gi`),n[r].toString());e[4]=e[4].replace(/(^\d{1,2})|([^#/\s\d]\d{1,2})/g,function(e){var n=e.replace(/\D/,``),r=n;return t.monthStartIndexZero&&(r=(parseInt(n)+1).toString()),e.replace(n,r)});var i={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var a in i)e[4]=e[4].replace(new RegExp(a,`gi`),i[a].toString());e[0]==`0`&&(e[0]=``),!/\*|\-|\,|\//.test(e[2])&&(/\*|\//.test(e[1])||/\*|\//.test(e[0]))&&(e[2]+=`-${e[2]}`);for(var o=0;o-1&&!/^\*|\-|\,/.test(e[o])){var s=null;switch(o){case 4:s=`12`;break;case 5:s=`6`;break;case 6:s=`9999`;break;default:s=null}if(s!==null){var c=e[o].split(`/`);e[o]=`${c[0]}-${s}/${c[1]}`}}},e.prototype.validate=function(e){var t=`0-9,\\-*/`;this.validateOnlyExpectedCharactersFound(e[0],t),this.validateOnlyExpectedCharactersFound(e[1],t),this.validateOnlyExpectedCharactersFound(e[2],t),this.validateOnlyExpectedCharactersFound(e[3].replace(/^(\d{1,2}W)[+-]\d{1,2}$/,`$1`),`0-9,\\-*/LW`),this.validateOnlyExpectedCharactersFound(e[4],t),this.validateOnlyExpectedCharactersFound(e[5],`0-9,\\-*/L#`),this.validateOnlyExpectedCharactersFound(e[6],t),this.validateAnyRanges(e)},e.prototype.validateAnyRanges=function(e){r.default.secondRange(e[0]),r.default.minuteRange(e[1]),r.default.hourRange(e[2]),r.default.dayOfMonthRange(e[3]),r.default.monthRange(e[4],this.monthStartIndexZero),r.default.dayOfWeekRange(e[5],this.dayOfWeekStartIndexZero)},e.prototype.validateOnlyExpectedCharactersFound=function(e,t){var n=e.match(RegExp(`[^${t}]+`,`gi`));if(n&&n.length)throw Error(`Expression contains invalid values: '${n.toString()}'`)},e}()},8333(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionDescriptor=void 0;var r=n(1823),i=n(6949);t.ExpressionDescriptor=function(){function e(t,n){if(this.expression=t,this.options=n,this.expressionParts=[,,,,,],!this.options.locale&&e.defaultLocale&&(this.options.locale=e.defaultLocale),!e.locales[this.options.locale]){var r=Object.keys(e.locales)[0];console.warn(`Locale '${this.options.locale}' could not be found; falling back to '${r}'.`),this.options.locale=r}this.i18n=e.locales[this.options.locale],n.use24HourTimeFormat===void 0&&(n.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return e.toString=function(t,n){var r=n===void 0?{}:n,i=r.throwExceptionOnParseError,a=i===void 0||i,o=r.verbose,s=o!==void 0&&o,c=r.dayOfWeekStartIndexZero,l=c===void 0||c,u=r.monthStartIndexZero,d=u!==void 0&&u,f=r.use24HourTimeFormat,p=r.trimHoursLeadingZero,m=p!==void 0&&p,h=r.locale,g=h===void 0?null:h,_=r.logicalAndDayFields,v={throwExceptionOnParseError:a,verbose:s,dayOfWeekStartIndexZero:l,monthStartIndexZero:d,use24HourTimeFormat:f,trimHoursLeadingZero:m,locale:g,logicalAndDayFields:_!==void 0&&_};return v.tzOffset&&console.warn(`'tzOffset' option has been deprecated and is no longer supported.`),new e(t,v).getFullDescription()},e.initialize=function(t,n){n===void 0&&(n=`en`),e.specialCharacters=[`/`,`-`,`,`,`*`],e.defaultLocale=n,t.load(e.locales)},e.prototype.getFullDescription=function(){var e,t=``;try{var n=new i.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=n.parse(),this.expressionParts[0]===`@reboot`)return(e=this.i18n).atReboot?.call(e)||`Run once, at startup`;var r=this.getTimeOfDayDescription(),a=this.getDayOfMonthDescription(),o=this.getMonthDescription(),s=this.getDayOfWeekDescription(),c=this.getYearDescription();t+=r+a+s+o+c,t=this.transformVerbosity(t,!!this.options.verbose),t=t.charAt(0).toLocaleUpperCase()+t.substr(1)}catch(e){if(!this.options.throwExceptionOnParseError)t=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw`${e}`}return t},e.prototype.getTimeOfDayDescription=function(){var t=this.expressionParts[0],n=this.expressionParts[1],i=this.expressionParts[2],a=``;if(!r.StringUtilities.containsAny(n,e.specialCharacters)&&!r.StringUtilities.containsAny(i,e.specialCharacters)&&!r.StringUtilities.containsAny(t,e.specialCharacters))a+=this.i18n.atSpace()+this.formatTime(i,n,t);else if(!t&&n.indexOf(`-`)>-1&&!(n.indexOf(`,`)>-1)&&!(n.indexOf(`/`)>-1)&&!r.StringUtilities.containsAny(i,e.specialCharacters)){var o=n.split(`-`);a+=r.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(i,o[0],``),this.formatTime(i,o[1],``))}else if(!t&&i.indexOf(`,`)>-1&&i.indexOf(`-`)==-1&&i.indexOf(`/`)==-1&&!r.StringUtilities.containsAny(n,e.specialCharacters)){var s=i.split(`,`);a+=this.i18n.at();for(var c=0;c-1?i=n.substring(0,n.indexOf(`#`)):n.indexOf(`L`)>-1&&(i=i.replace(`L`,``));var a=parseInt(i),o=e.i18n.daysOfTheWeekInCase?e.i18n.daysOfTheWeekInCase(r)[a]:t[a];if(n.indexOf(`#`)>-1){var s=null,c=n.substring(n.indexOf(`#`)+1),l=n.substring(0,n.indexOf(`#`));switch(c){case`1`:s=e.i18n.first(l);break;case`2`:s=e.i18n.second(l);break;case`3`:s=e.i18n.third(l);break;case`4`:s=e.i18n.fourth(l);break;case`5`:s=e.i18n.fifth(l)}o=s+` `+o}return o},function(t){return parseInt(t)==1?``:r.StringUtilities.format(e.i18n.commaEveryX0DaysOfTheWeek(t),t)},function(t){var n=t.substring(0,t.indexOf(`-`));return e.expressionParts[3]==`*`?e.i18n.commaX0ThroughX1(n):e.i18n.commaAndX0ThroughX1(n)},function(t){var n=null;if(t.indexOf(`#`)>-1){var r=t.substring(t.indexOf(`#`)+1),i=t.substring(0,t.indexOf(`#`));n=e.i18n.commaOnThe(r,i).trim()+e.i18n.spaceX0OfTheMonth()}else n=t.indexOf(`L`)>-1?e.i18n.commaOnTheLastX0OfTheMonth(t.replace(`L`,``)):e.expressionParts[3]==`*`||e.options.logicalAndDayFields?e.i18n.commaOnlyOnX0(t):e.i18n.commaAndOnX0();return n}),n},e.prototype.getMonthDescription=function(){var e=this,t=this.i18n.monthsOfTheYear();return this.getSegmentDescription(this.expressionParts[4],``,function(n,r){return r&&e.i18n.monthsOfTheYearInCase?e.i18n.monthsOfTheYearInCase(r)[parseInt(n)-1]:t[parseInt(n)-1]},function(t){return parseInt(t)==1?``:r.StringUtilities.format(e.i18n.commaEveryX0Months(t),t)},function(t){return e.i18n.commaMonthX0ThroughMonthX1()||e.i18n.commaX0ThroughX1()},function(t){return e.i18n.commaOnlyInMonthX0?e.i18n.commaOnlyInMonthX0():e.i18n.commaOnlyInX0()})},e.prototype.getDayOfMonthDescription=function(){var e=this,t,n,i=null,a=this.expressionParts[3];switch(a){case`L`:i=this.i18n.commaOnTheLastDayOfTheMonth();break;case`WL`:case`LW`:i=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var o=a.match(/^(?:(\d{1,2})W|W(\d{1,2}))(?:([+-])(\d{1,2}))?$/);if(o){var s=parseInt(o[1]||o[2]),c=s==1?this.i18n.firstWeekday():r.StringUtilities.format(this.i18n.weekdayNearestDayX0(),s.toString()),l=o[4];i=l?o[3]==`-`?r.StringUtilities.format((t=this.i18n).commaDaysBeforeTheX0OfTheMonth?.call(t,l)||`, %s days before the %s of the month`,l,c):r.StringUtilities.format((n=this.i18n).commaDaysAfterTheX0OfTheMonth?.call(n,l)||`, %s days after the %s of the month`,l,c):r.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),c);break}var u=a.match(/L-(\d{1,2})/);if(u){var d=u[1];i=r.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(d),d);break}if(a==`*`&&this.expressionParts[5]!=`*`)return``;i=this.getSegmentDescription(a,this.i18n.commaEveryDay(),function(t){return t==`L`?e.i18n.lastDay():e.i18n.dayX0?r.StringUtilities.format(e.i18n.dayX0(),t):t},function(t){return t==`1`?e.i18n.commaEveryDay():e.i18n.commaEveryX0Days(t)},function(t){return e.i18n.commaBetweenDayX0AndX1OfTheMonth(t)},function(t){return e.i18n.commaOnDayX0OfTheMonth(t)})}return i},e.prototype.getYearDescription=function(){var e=this;return this.getSegmentDescription(this.expressionParts[6],``,function(e){return/^\d+$/.test(e)?new Date(parseInt(e),1).getFullYear().toString():e},function(t){return r.StringUtilities.format(e.i18n.commaEveryX0Years(t),t)},function(t){return e.i18n.commaYearX0ThroughYearX1()||e.i18n.commaX0ThroughX1()},function(t){return e.i18n.commaOnlyInYearX0?e.i18n.commaOnlyInYearX0():e.i18n.commaOnlyInX0()})},e.prototype.getSegmentDescription=function(e,t,n,i,a,o,s){var c=null,l=e.indexOf(`/`)>-1,u=e.indexOf(`-`)>-1,d=e.indexOf(`,`)>-1;if(!e)c=``;else if(e===`*`)c=t;else if(!l&&!u&&!d)c=r.StringUtilities.format(o(e),n(e));else if(d){for(var f=e.split(`,`),p=``,m=this.i18n.spaceAnd(),h=0;h0&&f.length>2&&(p+=`,`,h0&&f.length>1&&(h==f.length-1||f.length==2)&&(p+=m==`,`&&f.length>2?` `:`${m} `),f[h].indexOf(`/`)>-1||f[h].indexOf(`-`)>-1){var g=f[h].indexOf(`-`)>-1&&f[h].indexOf(`/`)==-1,_=this.getSegmentDescription(f[h],t,n,i,g?this.i18n.commaX0ThroughX1:a,o);g&&(_=_.replace(`, `,``)),p+=_}else if(!l)p+=n(f[h]);else{var v=this.getSegmentDescription(f[h],t,n,i,a,o);v&&v.startsWith(`, `)&&(v=v.substring(2)),p+=v}c=l?p:r.StringUtilities.format(o(e),p)}else if(l){var f=e.split(`/`);if(c=r.StringUtilities.format(i(f[1]),f[1]),f[0].indexOf(`-`)>-1){var y=this.generateRangeSegmentDescription(f[0],a,n);y.indexOf(`, `)!=0&&(c+=`, `),c+=y}else if(f[0].indexOf(`*`)==-1){var b=r.StringUtilities.format(o(f[0]),n(f[0]));b=b.replace(`, `,``),c+=r.StringUtilities.format(this.i18n.commaStartingX0(),b)}c+=this.getWrappingIncrementDescription(e,s,t,n,i,a,o)}else u&&(c=this.generateRangeSegmentDescription(e,a,n));return c},e.prototype.getWrappingIncrementDescription=function(e,t,n,r,i,a,o){if(!this.options.verbose||!t)return``;var s=e.split(`/`),c=s[0],l=s[1],u=parseInt(l),d=t.max-t.min+1,f=c===`*`,p=Number.isInteger(u)&&u>1,m=p&&d%u===0;if(!f||!p||m)return``;for(var h=[],g=t.min;g<=t.max;g+=u)h.push(g);if(h.length<2)return``;var _=this.getSegmentDescription(h.join(`,`),n,r,i,a,o);return _?`, ${_}`:``},e.prototype.generateRangeSegmentDescription=function(e,t,n){var i=``,a=e.split(`-`),o=n(a[0],1),s=n(a[1],2),c=t(e);return i+=r.StringUtilities.format(c,o,s),i},e.prototype.formatTime=function(e,t,n){var r=0,i=0,a=parseInt(e)+r,o=parseInt(t)+i;o>=60?(o-=60,a+=1):o<0&&(o+=60,--a),a>=24?a-=24:a<0&&(a=24+a);var s=``,c=!1;this.options.use24HourTimeFormat||(c=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),s=c?`${this.getPeriod(a)} `:` ${this.getPeriod(a)}`,a>12&&(a-=12),a===0&&(a=12));var l=``;n&&(l=`:${(`00`+n).substring(n.length)}`);var u=a.toString(),d=(`00`+u).substring(u.length),f=o.toString(),p=(`00`+f).substring(f.length),m=this.options.trimHoursLeadingZero?u:d;return`${c?s:``}${m}:${p}${l}${c?``:s}`},e.prototype.transformVerbosity=function(e,t){if(!t&&(e=e.replace(RegExp(`, ${this.i18n.everyMinute()}`,`g`),``),e=e.replace(RegExp(`, ${this.i18n.everyHour()}`,`g`),``),e=e.replace(new RegExp(this.i18n.commaEveryDay(),`g`),``),e=e.replace(/\, ?$/,``),this.i18n.conciseVerbosityReplacements))for(var n=0,r=Object.entries(this.i18n.conciseVerbosityReplacements());n=12?this.i18n.pm&&this.i18n.pm()||`PM`:this.i18n.am&&this.i18n.am()||`AM`},e.locales={},e}()},3747(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.enLocaleLoader=void 0;var r=n(9486);t.enLocaleLoader=function(){function e(){}return e.prototype.load=function(e){e.en=new r.en},e}()},9486(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.en=void 0,t.en=function(){function e(){}return e.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},e.prototype.atX0MinutesPastTheHourGt20=function(){return null},e.prototype.commaMonthX0ThroughMonthX1=function(){return null},e.prototype.commaYearX0ThroughYearX1=function(){return null},e.prototype.use24HourTimeFormatByDefault=function(){return!1},e.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return`An error occurred when generating the expression description. Check the cron expression syntax.`},e.prototype.everyMinute=function(){return`every minute`},e.prototype.everyHour=function(){return`every hour`},e.prototype.atSpace=function(){return`At `},e.prototype.everyMinuteBetweenX0AndX1=function(){return`Every minute between %s and %s`},e.prototype.at=function(){return`At`},e.prototype.spaceAnd=function(){return` and`},e.prototype.everySecond=function(){return`every second`},e.prototype.everyX0Seconds=function(){return`every %s seconds`},e.prototype.secondsX0ThroughX1PastTheMinute=function(){return`seconds %s through %s past the minute`},e.prototype.atX0SecondsPastTheMinute=function(){return`at %s seconds past the minute`},e.prototype.everyX0Minutes=function(){return`every %s minutes`},e.prototype.minutesX0ThroughX1PastTheHour=function(){return`minutes %s through %s past the hour`},e.prototype.atX0MinutesPastTheHour=function(){return`at %s minutes past the hour`},e.prototype.everyX0Hours=function(){return`every %s hours`},e.prototype.betweenX0AndX1=function(){return`between %s and %s`},e.prototype.atX0=function(){return`at %s`},e.prototype.commaEveryDay=function(){return`, every day`},e.prototype.commaEveryX0DaysOfTheWeek=function(){return`, every %s days of the week`},e.prototype.commaX0ThroughX1=function(){return`, %s through %s`},e.prototype.commaAndX0ThroughX1=function(){return`, %s through %s`},e.prototype.first=function(){return`first`},e.prototype.second=function(){return`second`},e.prototype.third=function(){return`third`},e.prototype.fourth=function(){return`fourth`},e.prototype.fifth=function(){return`fifth`},e.prototype.commaOnThe=function(){return`, on the `},e.prototype.spaceX0OfTheMonth=function(){return` %s of the month`},e.prototype.lastDay=function(){return`the last day`},e.prototype.commaOnTheLastX0OfTheMonth=function(){return`, on the last %s of the month`},e.prototype.commaOnlyOnX0=function(){return`, only on %s`},e.prototype.commaAndOnX0=function(){return`, and on %s`},e.prototype.commaEveryX0Months=function(){return`, every %s months`},e.prototype.commaOnlyInX0=function(){return`, only in %s`},e.prototype.commaOnTheLastDayOfTheMonth=function(){return`, on the last day of the month`},e.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return`, on the last weekday of the month`},e.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return`, %s days before the last day of the month`},e.prototype.firstWeekday=function(){return`first weekday`},e.prototype.weekdayNearestDayX0=function(){return`weekday nearest day %s`},e.prototype.commaOnTheX0OfTheMonth=function(){return`, on the %s of the month`},e.prototype.commaDaysBeforeTheX0OfTheMonth=function(){return`, %s days before the %s of the month`},e.prototype.commaDaysAfterTheX0OfTheMonth=function(){return`, %s days after the %s of the month`},e.prototype.commaEveryX0Days=function(){return`, every %s days in a month`},e.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return`, between day %s and %s of the month`},e.prototype.commaOnDayX0OfTheMonth=function(){return`, on day %s of the month`},e.prototype.commaEveryHour=function(){return`, every hour`},e.prototype.commaEveryX0Years=function(){return`, every %s years`},e.prototype.commaStartingX0=function(){return`, starting %s`},e.prototype.daysOfTheWeek=function(){return[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},e.prototype.monthsOfTheYear=function(){return[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},e.prototype.atReboot=function(){return`Run once, at startup`},e.prototype.onTheHour=function(){return`on the hour`},e}()},9515(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(e,t){if(!e)throw Error(t)}t.default=function(){function e(){}return e.secondRange=function(e){for(var t=e.split(`,`),r=0;r=0&&i<=59,`seconds part must be >= 0 and <= 59`)}},e.minuteRange=function(e){for(var t=e.split(`,`),r=0;r=0&&i<=59,`minutes part must be >= 0 and <= 59`)}},e.hourRange=function(e){for(var t=e.split(`,`),r=0;r=0&&i<=23,`hours part must be >= 0 and <= 23`)}},e.dayOfMonthRange=function(e){for(var t=e.split(`,`),r=0;r=1&&i<=31,`DOM part must be >= 1 and <= 31`)}},e.monthRange=function(e,t){for(var r=e.split(`,`),i=0;i=1&&a<=12,t?`month part must be >= 0 and <= 11`:`month part must be >= 1 and <= 12`)}},e.dayOfWeekRange=function(e,t){for(var r=e.split(`,`),i=0;i=0&&a<=6,t?`DOW part must be >= 0 and <= 6`:`DOW part must be >= 1 and <= 7`)}},e}()},1823(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.StringUtilities=void 0,t.StringUtilities=function(){function e(){}return e.format=function(e){var t=[...arguments].slice(1);return e.replace(/%s/g,function(e){return t.shift()})},e.containsAny=function(e,t){return t.some(function(t){return e.indexOf(t)>-1})},e}()}},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.toString=void 0;var t=n(8333),i=n(3747);t.ExpressionDescriptor.initialize(new i.enLocaleLoader),e.default=t.ExpressionDescriptor,e.toString=t.ExpressionDescriptor.toString})(),r})())}))(),1),V=[`title`],H={"flex-none":``,"text-left":``},U={flex:`~ gap-2`,"min-w-0":``,"items-center":``,"text-sm":``},W={class:`truncate`},G={"text-xs":``,op50:``},K={key:0},ge=[`onClick`],q=Object.assign(l({__name:`CronCollection`,props:{collection:{}},setup(e){let t=e,a=L(),o=r(!0),c=S(()=>he.default.toString(t.collection.cron));return(t,r)=>{let l=F,d=pe;return u(),p(`div`,null,[x(`button`,{flex:`~ gap-2`,"w-full":``,"items-start":``,"items-center":``,p2:``,"hover-bg-active":``,title:c.value,onClick:r[0]||=e=>o.value=!o.value},[x(`div`,H,[n(l,{icon:`carbon:chevron-right`,"mb0.5":``,"transform-rotate":o.value?90:0,transition:``},null,8,[`transform-rotate`])]),x(`span`,U,[n(d,{class:`font-mono n-primary`,textContent:T(e.collection.cron)},null,8,[`textContent`]),x(`span`,W,T(c.value),1),x(`span`,G,`(`+T(e.collection.tasks.length)+`)`,1)])],8,V),r[2]||=x(`div`,{"x-divider":``},null,-1),o.value?(u(),p(`ul`,K,[(u(!0),p(C,null,f(e.collection.tasks,e=>(u(),p(`li`,{key:e},[x(`button`,{flex:`~ gap-2`,"w-full":``,"items-start":``,"items-center":``,px2:``,py1:``,"pl-9":``,"font-mono":``,"hover-bg-active":``,class:s([{"bg-active":i(a)===e}]),onClick:t=>a.value=e},T(e),11,ge),r[1]||=x(`div`,{"x-divider":``},null,-1)]))),128))])):v(``,!0)])}}}),{__name:`CronCollection`}),_e={"h-full":``,"w-full":``,flex:`~ col`},ve={flex:`~ col gap-2`,"n-navbar-glass":``,"flex-none":``,p4:``},ye={flex:`~ gap2 items-center`},be={relative:``,"w-full":``},xe={absolute:``,"right-2":``,"top-1.5":``,flex:`~ gap-1`},Se={flex:`~ gap2 wrap`,"w-full":``,"items-center":``,px4:``,pb2:``,"text-center":``,"text-sm":``,border:`b base`},Ce={class:`hidden md:block`},we={flex:`~ gap2`,"mb--2":``,"items-center":``,op50:``},Te={key:0,border:`b base`,relative:``,"n-code-block":``},Ee={flex:`~ wrap`,"w-full":``},De=[`onClick`],Oe={border:`b base`,flex:`~ gap2`,"items-center":``,px4:``,py2:``},ke={key:1,"text-xs":``,op50:``},J=Object.assign(l({__name:`ServerTaskDetails`,props:{task:{}},emits:[`openDefaultInput`],setup(e,{emit:t}){let l=e,d=t,m=r({payload:{}}),{inputDefaults:g}=P(`serverRoutes`),[D,I]=j(),L=N(),ae=A(),R=E({contentType:`text/plain`,data:``,statusCode:200,error:void 0,fetchTime:0}),ue=S(()=>JSON.stringify(R.data,null,2)),de=S(()=>R.contentType.includes(`application/json`)?`json`:`text`),z=r(!1),B=r(!1),he=oe(),V=r(),H=[`json`],U=r(H[0]),W=E({query:[{active:!0,key:``,value:``,type:`string`}],body:[{active:!0,key:``,value:``,type:`string`}],headers:[]}),G=S({get:()=>W[V.value],set:e=>{W[V.value]=e}}),K=S(()=>({...Z(g.value.query),...Z(W.query)})),ge=S(()=>({...Z(g.value.headers)})),q=S(()=>Object.keys(m.value?.payload??{}).length?{...m.value}:void 0),J=S(()=>q.value?`POST`:`GET`),Ae=S(()=>{let e=window?.location.origin;return e.charAt(e.length-1)===`/`&&(e=e.slice(0,-1)),e}),Y=S(()=>{let e=new URLSearchParams(K.value).toString();e&&=`?${e}`;let t=`/_nitro/tasks/${l.task.name}${e}`,n=ae.value?.app.baseURL||``;return(n===`./`||n===`.`)&&(n=``),n.endsWith(`/`)&&(n=n.slice(0,-1)),n+t}),X=S(()=>Ae.value+Y.value);function Z(e=[]){let t=Object.fromEntries(e.filter(({active:e,key:t,value:n})=>e&&t&&n!==void 0).map(({key:e,value:t})=>[e,t]));return Object.entries(t).length?t:void 0}async function Q(){B.value=!0,z.value=!0;let e=Date.now();ne(`server-tasks:run`,{method:J.value});try{R.data=await O(X.value,{method:`POST`,headers:ge.value,query:K.value,body:q.value,onResponse({response:e}){R.contentType=(e.headers.get(`content-type`)||``).toString().toLowerCase().trim(),R.statusCode=e.status,R.error=void 0},onResponseError(e){R.error=e.response._data,R.data=e.response._data}})}catch{}z.value=!1,R.fetchTime=Date.now()-e}let je=S(()=>{let e=[];return e.push({name:`Query`,slug:`query`,length:W.query.length}),e.push({name:`Body`,slug:`body`,length:W.body.length}),e});b(()=>{if(U.value===`json`&&typeof m.value==`string`)try{m.value=JSON.parse(m.value)}catch{}});let $=M(`nuxt-devtools:server-tasks:inputs`,()=>[],{window:window.parent});ee([W,V],()=>{let e=$.value?.find(e=>e.task===l.task.name);if(e){V.value||=e.tab,e.tab!==V.value&&(e.tab=V.value);let{body:t,query:n,headers:r}=e.inputs;Object.assign(W,{body:t,query:n,headers:r})}else{let e={task:l.task.name,tab:`query`,inputs:W};$.value.push(e),V.value||=e.tab}},{immediate:!0,deep:!0,debounce:500});let Me=ce();return(t,r)=>{let l=te,b=ie,S=F,E=me,O=re,A=se,j=pe,M=le,N=o(`tooltip`);return u(),p(`div`,_e,[x(`div`,ve,[x(`div`,ye,[_((u(),p(`div`,null,[n(l,{class:s([`n-badge-base n-sm`,i(k)(J.value)]),"pointer-events-none":``,"font-mono":``,tabindex:`-1`},{default:h(()=>[c(T(J.value),1)]),_:1},8,[`class`])])),[[N,`Method is ${J.value} as ${J.value===`GET`?`no`:``} json body is sent`]]),x(`div`,be,[n(b,{"model-value":Y.value,readonly:``,"flex-auto":``,"font-mono":``,p:`x5 y2`,n:`sm`},null,8,[`model-value`]),x(`div`,xe,[_(n(l,{title:`Copy URL`,n:`xs blue`,icon:`carbon:copy`,border:!1,onClick:r[0]||=e=>i(Me)(X.value,`server-task-url`)},null,512),[[N,`Copy URL`]]),_(n(l,{title:`Open in Editor`,icon:`carbon-launch`,n:`xs blue`,border:!1,onClick:r[1]||=t=>i(he)(e.task.handler)},null,512),[[N,`Open in Editor`]])])]),n(l,{"h-full":``,n:`primary solid`,onClick:Q},{default:h(()=>[n(S,{icon:`carbon:send`})]),_:1})])]),x(`div`,Se,[(u(!0),p(C,null,f(je.value,e=>_((u(),y(l,{key:e.slug,class:s(V.value===e.slug?`text-primary n-primary`:`border-transparent shadow-none`),onClick:t=>V.value=e.slug},{default:h(()=>[n(S,{icon:i(fe)[e.slug]},null,8,[`icon`]),x(`div`,Ce,[c(T(e.name)+` `+T(e?.length?`(${e.length})`:``)+` `,1),x(`span`,null,T(i(g)[e.slug]?.length?`(${i(g)[e.slug].length})`:``),1)])]),_:2},1032,[`class`,`onClick`])),[[N,e.name]])),128))]),n(i(D),null,{default:h(()=>[n(E,{modelValue:G.value,"onUpdate:modelValue":r[4]||=e=>G.value=e,default:{active:!0,type:`string`},"max-h-xs":``,"of-auto":``},{default:h(()=>[i(g)[V.value]?.length?(u(),p(C,{key:0},[x(`div`,we,[r[6]||=x(`div`,{"w-5":``,"x-divider":``},null,-1),r[7]||=x(`div`,{"flex-none":``},` Default Inputs `,-1),n(l,{icon:`i-carbon-edit`,border:!1,onClick:r[2]||=e=>d(`openDefaultInput`)}),r[8]||=x(`div`,{"x-divider":``},null,-1)]),n(E,{modelValue:i(g)[V.value],"onUpdate:modelValue":r[3]||=e=>i(g)[V.value]=e,disabled:``,p0:``},null,8,[`modelValue`])],64)):v(``,!0)]),_:1},8,[`modelValue`])]),_:1}),G.value?(u(),p(`div`,Te,[V.value===`body`?(u(),p(C,{key:0},[x(`div`,Ee,[(u(),p(C,null,f(H,e=>x(`button`,{key:e,px4:``,py2:``,border:`r base`,hover:`bg-active`,class:s({"border-b":e!==U.value}),onClick:t=>U.value=e},[x(`div`,{class:s({op30:e!==U.value}),"font-mono":``},T(e),3)],10,De)),64)),r[9]||=x(`div`,{border:`b base`,"flex-auto":``},null,-1)]),U.value===`input`?(u(),y(i(I),{key:0})):U.value===`json`?(u(),y(i(w),a({key:1,modelValue:m.value,"onUpdate:modelValue":r[5]||=e=>m.value=e,class:[i(L)===`dark`?`jse-theme-dark`:`light`,`json-editor-vue of-auto text-sm outline-none`]},t.$attrs,{mode:`text`,"navigation-bar":!1,indentation:2,"tab-size":2}),null,16,[`modelValue`,`class`])):v(``,!0)],64)):(u(),y(i(I),{key:1}))])):v(``,!0),B.value?z.value?(u(),y(A,{key:2,"z-10":``,"flex-auto":``,"backdrop-blur":``},{default:h(()=>[...r[11]||=[c(` Running... `,-1)]]),_:1})):(u(),p(C,{key:3},[x(`div`,Oe,[r[13]||=x(`div`,null,`Result`,-1),R.error?(u(),y(j,{key:0,n:`red`},{default:h(()=>[...r[12]||=[c(` Error `,-1)]]),_:1})):v(``,!0),n(j,{n:R.error?`orange`:`green`,textContent:T(R.statusCode)},null,8,[`n`,`textContent`]),R.contentType?(u(),p(`code`,ke,T(R.contentType),1)):v(``,!0),r[14]||=x(`div`,{"flex-auto":``},null,-1),r[15]||=x(`div`,{op50:``},` Tasks finished in `,-1),n(j,{n:`green`},{default:h(()=>[c(T(R.fetchTime)+` ms `,1)]),_:1})]),n(M,{"flex-auto":``,"overflow-auto":``,"py-2":``,code:ue.value,lang:de.value},null,8,[`code`,`lang`])],64)):(u(),y(O,{key:1},{default:h(()=>[n(l,{n:`primary`,onClick:Q},{default:h(()=>[n(S,{icon:`carbon:send`}),r[10]||=c(` Run task `,-1)]),_:1})]),_:1}))])}}}),{__name:`ServerTaskDetails`}),Ae={"flex-none":``,"text-left":``},Y={flex:``,"items-center":``,"text-sm":``,"font-mono":``},X=Object.assign(l({__name:`ServerTaskListItem`,props:{item:{},index:{default:0}},setup(e){let t=r(!0),n=L();return(r,a)=>{let o=F,l=X;return u(),p(`div`,null,[x(`button`,{flex:`~ gap-2`,"w-full":``,"items-start":``,"items-center":``,px2:``,py1:``,"hover-bg-active":``,class:s([{"bg-active":i(n)===e.item.name}]),style:g({paddingLeft:`calc(0.5rem + ${e.index*1.5}em)`}),onClick:a[0]||=r=>{t.value=!t.value,n.value=e.item.name}},[x(`div`,Ae,[e.item.type===`collection`?(u(),y(o,{key:0,icon:`carbon:chevron-right`,"mb0.5":``,"transform-rotate":t.value?90:0,transition:``},null,8,[`transform-rotate`])):v(``,!0)]),x(`span`,Y,[e.item.type===`collection`?(u(),y(o,{key:0,title:`${e.item.tasks?.length} tasks`,icon:`carbon:folder`,mr1:``},null,8,[`title`])):(u(),y(o,{key:1,icon:`carbon:play`,ml3:``,mr1:``})),c(` `+T(e.item.name),1)])],6),a[1]||=x(`div`,{"x-divider":``},null,-1),t.value?d(r.$slots,`default`,{},()=>[(u(!0),p(C,null,f(e.item.tasks,t=>(u(),y(l,{key:t.name,item:t,index:e.index+1},null,8,[`item`,`index`]))),128))],void 0,0):v(``,!0)])}}}),{__name:`ServerTaskListItem`}),Z={flex:`~ gap1`,"text-sm":``},Q={key:0,op50:``},je={op50:``},$=l({__name:`server-tasks`,setup(e){de({icon:`codicon-run-all`,title:`Server Tasks`,layout:`full`,category:`server`,show(){let{enabled:e}=P(`serverTasks`),t=D();return()=>e.value?Object.keys(t.value?.tasks??{}).length:!1}});let t=r(!1),a=D(),s=S(()=>Object.keys(a.value?.tasks??{}).map(e=>({name:e,...a.value.tasks[e],type:`task`}))),c=S(()=>Object.entries(a.value?.scheduledTasks??{}).map(([e,t])=>({cron:e,tasks:t}))),l=L(),{view:d,selectedTask:g,inputDefaults:b}=P(`serverTasks`),w=S(()=>{!l.value&&g.value&&(l.value=g.value.name);let e=s.value.find(e=>e.name===l.value);return l.value!==g.value?.name&&e&&(g.value=e),e}),E=r(``),O=S(()=>new R(s.value,{keys:[`key`,`description`],shouldSort:!0})),k=S(()=>E.value?O.value.search(E.value).map(e=>e.item):s.value),A=S(()=>{let e=[],t=(e,t)=>{e.tasks||=[],e.tasks.push(t)},n=(n,r)=>{let i=r?r.tasks?.find(e=>e.name===n):e.find(e=>e.name===n);if(i)return{...i,type:`collection`};let a={name:n,handler:n,description:``,type:`collection`,tasks:[]};return r?t(r,a):e.push(a),a};return k.value.forEach(r=>{let i,a={...r,type:`task`},o=r.name.split(`:`).concat();o.length>0&&o.at(-1)?.includes(`.`)&&o.pop(),o.forEach(e=>{i=n(e,i)}),i?t(i,a):e.push(a)}),e});function j(){d.value=d.value===`tree`?`list`:`tree`}return(e,r)=>{let a=te,l=z,g=q,S=ae,D=J,O=I,M=re,N=me,ee=B,P=ue,F=o(`tooltip`);return u(),p(C,null,[n(S,{"storage-key":`tab-server-tasks`},{left:h(()=>[n(S,{horizontal:``,"storage-key":`tab-server-tasks-split`},{left:h(()=>[n(l,{search:E.value,"onUpdate:search":r[1]||=e=>E.value=e,pb2:``},{actions:h(()=>[_(n(a,{"text-lg":``,icon:i(d)===`list`?`i-carbon-list`:`i-carbon-tree-view-alt`,title:`Toggle view`,border:!1,onClick:j},null,8,[`icon`]),[[F,`Toggle View`]]),_(n(a,{"text-lg":``,icon:`i-carbon-cics-sit-overrides`,title:`Default Inputs`,border:!1,onClick:r[0]||=e=>t.value=!t.value},null,512),[[F,`Default Inputs`]])]),default:h(()=>[x(`div`,Z,[E.value?(u(),p(`span`,Q,T(k.value.length)+` matched ยท `,1)):v(``,!0),x(`span`,je,T(s.value?.length)+` tasks in total`,1)])]),_:1},8,[`search`]),(u(!0),p(C,null,f(i(d)===`tree`?A.value:k.value,e=>(u(),y(X,{key:e.name,item:e},null,8,[`item`]))),128))]),right:h(()=>[r[6]||=x(`div`,{px4:``,py2:``,border:`b base`},` Cron groups `,-1),x(`div`,null,[x(`ul`,null,[(u(!0),p(C,null,f(c.value,e=>(u(),p(`li`,{key:e.cron},[n(g,{collection:e},null,8,[`collection`])]))),128))])])]),_:1})]),right:h(()=>[(u(),y(m,{max:10},[w.value?(u(),y(D,{key:w.value.name,task:w.value,onOpenDefaultInput:r[2]||=e=>t.value=!0},null,8,[`task`])):v(``,!0)],1024)),w.value?v(``,!0):(u(),y(M,{key:0},{default:h(()=>[n(O,{px6:``,py2:``},{default:h(()=>[...r[7]||=[x(`span`,{op75:``},`Select a task to start`,-1)]]),_:1})]),_:1}))]),_:1}),n(P,{modelValue:t.value,"onUpdate:modelValue":r[4]||=e=>t.value=e,"auto-close":``,"max-w-xl":``,"min-w-xl":``,onClose:r[5]||=e=>t.value=!1},{default:h(()=>[x(`div`,null,[r[8]||=x(`div`,{p4:``,border:`b base`},[x(`span`,{"text-lg":``},`Default Inputs`),x(`br`),x(`span`,{"text-white":``,op50:``},`Merged as default for every task in DevTools`)],-1),n(ee,{text:`Query ${i(b).query?.length?`(${i(b).query.length})`:``}`,padding:!1,icon:i(fe).query},{default:h(()=>[n(N,{modelValue:i(b).query,"onUpdate:modelValue":r[3]||=e=>i(b).query=e,py0:``,default:{active:!0,type:`string`}},null,8,[`modelValue`])]),_:1},8,[`text`,`icon`])])]),_:1},8,[`modelValue`])],64)}}});export{$ as default};