@nuxt/devtools
Version:
<a href="https://devtools.nuxt.com"><img width="1200" alt="Nuxt DevTools" src="https://github-production-user-asset-6210df.s3.amazonaws.com/904724/261577617-a10567bd-ad33-48cc-9bda-9e37dbe1929f.png"></a> <br>
2 lines (1 loc) • 34.2 kB
JavaScript
import{cg as Oe,d as ee,ch as re,r as H,a as U,o as _,m as $,k as v,i as T,f as l,t as N,F as B,n as Z,D as F,p as j,a4 as oe,ai as ue,cc as Te,am as xe,a9 as Se,ay as se,aa as we,aB as Xe,aY as De,cd as Ee,e as Me,a0 as le,G,j as I,v as P,c8 as Ce,h as A,l as K,aw as Ie,S as $e,_ as ce,V as Ue,y as fe,al as Re,a7 as Le,a8 as Ne,ci as Ae,af as Ve,R as je,cf as Be,ar as We}from"./Bysyzw-g.js";import{_ as He}from"./Ci0JrwP0.js";import{_ as pe}from"./CpQX28Pm.js";import{_ as de}from"./CFByhje9.js";import{_ as ze}from"./CdlRa3-_.js";import{S as he}from"./BcJws1i5.js";import{s as qe}from"./B4nba3hY.js";import{_ as Ye}from"./C6_B1_1h.js";import{_ as Pe}from"./dPiMYs67.js";import"./ZTJOnUjs.js";import"./DFUDf3T0.js";import"./DK4YETzW.js";import"./3LqotSTl.js";import"./CXTghDHT.js";var ve={exports:{}};(function(q,R){(function(x,X){q.exports=X()})(globalThis,()=>(()=>{var L={794:(O,d,k)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.CronParser=void 0;var o=k(586),h=function(){function g(t,e,a){e===void 0&&(e=!0),a===void 0&&(a=!1),this.expression=t,this.dayOfWeekStartIndexZero=e,this.monthStartIndexZero=a}return g.prototype.parse=function(){var t,e,a=(t=this.expression)!==null&&t!==void 0?t:"";if(a.startsWith("@")){var r=this.parseSpecial(this.expression);e=this.extractParts(r)}else e=this.extractParts(this.expression);return this.normalize(e),this.validate(e),e},g.prototype.parseSpecial=function(t){var e={"@yearly":"0 0 1 1 *","@annually":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *"},a=e[t];if(!a)throw new Error("Unknown special expression.");return a},g.prototype.extractParts=function(t){if(!this.expression)throw new Error("cron expression is empty");for(var e=t.trim().split(/[ ]+/),a=0;a<e.length;a++)if(e[a].includes(",")){var r=e[a].split(",").map(function(s){return s.trim()}).filter(function(s){return s!==""}).map(function(s){return isNaN(Number(s))?s:Number(s)}).filter(function(s){return s!==null&&s!==""});r.length===0&&r.push("*"),r.sort(function(s,i){return s!==null&&i!==null?s-i:0}),e[a]=r.map(function(s){return s!==null?s.toString():""}).join(",")}if(e.length<5)throw new Error("Expression has only ".concat(e.length," part").concat(e.length==1?"":"s",". At least 5 parts are required."));if(e.length==5)e.unshift(""),e.push("");else if(e.length==6){var n=/\d{4}$/.test(e[5])||e[4]=="?"||e[2]=="?";n?e.unshift(""):e.push("")}else if(e.length>7)throw new Error("Expression has ".concat(e.length," parts; too many!"));return e},g.prototype.normalize=function(t){var e=this;if(t[3]=t[3].replace("?","*"),t[5]=t[5].replace("?","*"),t[2]=t[2].replace("?","*"),t[0].indexOf("0/")==0&&(t[0]=t[0].replace("0/","*/")),t[1].indexOf("0/")==0&&(t[1]=t[1].replace("0/","*/")),t[2].indexOf("0/")==0&&(t[2]=t[2].replace("0/","*/")),t[3].indexOf("1/")==0&&(t[3]=t[3].replace("1/","*/")),t[4].indexOf("1/")==0&&(t[4]=t[4].replace("1/","*/")),t[6].indexOf("1/")==0&&(t[6]=t[6].replace("1/","*/")),t[5]=t[5].replace(/(^\d)|([^#/\s]\d)/g,function(f){var y=f.replace(/\D/,""),p=y;return e.dayOfWeekStartIndexZero?y=="7"&&(p="0"):p=(parseInt(y)-1).toString(),f.replace(y,p)}),t[5]=="L"&&(t[5]="6"),t[3]=="?"&&(t[3]="*"),t[3].indexOf("W")>-1&&(t[3].indexOf(",")>-1||t[3].indexOf("-")>-1))throw new 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 a={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var r in a)t[5]=t[5].replace(new RegExp(r,"gi"),a[r].toString());t[4]=t[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(f){var y=f.replace(/\D/,""),p=y;return e.monthStartIndexZero&&(p=(parseInt(y)+1).toString()),f.replace(y,p)});var n={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 s in n)t[4]=t[4].replace(new RegExp(s,"gi"),n[s].toString());t[0]=="0"&&(t[0]=""),!/\*|\-|\,|\//.test(t[2])&&(/\*|\//.test(t[1])||/\*|\//.test(t[0]))&&(t[2]+="-".concat(t[2]));for(var i=0;i<t.length;i++)if(t[i].indexOf(",")!=-1&&(t[i]=t[i].split(",").filter(function(f){return f!==""}).join(",")||"*"),t[i]=="*/1"&&(t[i]="*"),t[i].indexOf("/")>-1&&!/^\*|\-|\,/.test(t[i])){var u=null;switch(i){case 4:u="12";break;case 5:u="6";break;case 6:u="9999";break;default:u=null;break}if(u!==null){var m=t[i].split("/");t[i]="".concat(m[0],"-").concat(u,"/").concat(m[1])}}},g.prototype.validate=function(t){this.assertNoInvalidCharacters("DOW",t[5]),this.assertNoInvalidCharacters("DOM",t[3]),this.validateRange(t)},g.prototype.validateRange=function(t){o.default.secondRange(t[0]),o.default.minuteRange(t[1]),o.default.hourRange(t[2]),o.default.dayOfMonthRange(t[3]),o.default.monthRange(t[4],this.monthStartIndexZero),o.default.dayOfWeekRange(t[5],this.dayOfWeekStartIndexZero)},g.prototype.assertNoInvalidCharacters=function(t,e){var a=e.match(/[A-KM-VX-Z]+/gi);if(a&&a.length)throw new Error("".concat(t," part contains invalid values: '").concat(a.toString(),"'"))},g}();d.CronParser=h},728:(O,d,k)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.ExpressionDescriptor=void 0;var o=k(910),h=k(794),g=function(){function t(e,a){if(this.expression=e,this.options=a,this.expressionParts=new Array(5),!this.options.locale&&t.defaultLocale&&(this.options.locale=t.defaultLocale),!t.locales[this.options.locale]){var r=Object.keys(t.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(r,"'.")),this.options.locale=r}this.i18n=t.locales[this.options.locale],a.use24HourTimeFormat===void 0&&(a.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return t.toString=function(e,a){var r=a===void 0?{}:a,n=r.throwExceptionOnParseError,s=n===void 0?!0:n,i=r.verbose,u=i===void 0?!1:i,m=r.dayOfWeekStartIndexZero,f=m===void 0?!0:m,y=r.monthStartIndexZero,p=y===void 0?!1:y,C=r.use24HourTimeFormat,S=r.locale,W=S===void 0?null:S,V=r.tzOffset,E=V===void 0?0:V,z={throwExceptionOnParseError:s,verbose:u,dayOfWeekStartIndexZero:f,monthStartIndexZero:p,use24HourTimeFormat:C,locale:W,tzOffset:E},te=new t(e,z);return te.getFullDescription()},t.initialize=function(e,a){a===void 0&&(a="en"),t.specialCharacters=["/","-",",","*"],t.defaultLocale=a,e.load(t.locales)},t.prototype.getFullDescription=function(){var e="";try{var a=new h.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);this.expressionParts=a.parse();var r=this.getTimeOfDayDescription(),n=this.getDayOfMonthDescription(),s=this.getMonthDescription(),i=this.getDayOfWeekDescription(),u=this.getYearDescription();e+=r+n+i+s+u,e=this.transformVerbosity(e,!!this.options.verbose),e=e.charAt(0).toLocaleUpperCase()+e.substr(1)}catch(m){if(!this.options.throwExceptionOnParseError)e=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(m)}return e},t.prototype.getTimeOfDayDescription=function(){var e=this.expressionParts[0],a=this.expressionParts[1],r=this.expressionParts[2],n="";if(!o.StringUtilities.containsAny(a,t.specialCharacters)&&!o.StringUtilities.containsAny(r,t.specialCharacters)&&!o.StringUtilities.containsAny(e,t.specialCharacters))n+=this.i18n.atSpace()+this.formatTime(r,a,e);else if(!e&&a.indexOf("-")>-1&&!(a.indexOf(",")>-1)&&!(a.indexOf("/")>-1)&&!o.StringUtilities.containsAny(r,t.specialCharacters)){var s=a.split("-");n+=o.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(r,s[0],""),this.formatTime(r,s[1],""))}else if(!e&&r.indexOf(",")>-1&&r.indexOf("-")==-1&&r.indexOf("/")==-1&&!o.StringUtilities.containsAny(a,t.specialCharacters)){var i=r.split(",");n+=this.i18n.at();for(var u=0;u<i.length;u++)n+=" ",n+=this.formatTime(i[u],a,""),u<i.length-2&&(n+=","),u==i.length-2&&(n+=this.i18n.spaceAnd())}else{var m=this.getSecondsDescription(),f=this.getMinutesDescription(),y=this.getHoursDescription();if(n+=m,n&&f&&(n+=", "),n+=f,f===y)return n;n&&y&&(n+=", "),n+=y}return n},t.prototype.getSecondsDescription=function(){var e=this,a=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(r){return r},function(r){return o.StringUtilities.format(e.i18n.everyX0Seconds(r),r)},function(r){return e.i18n.secondsX0ThroughX1PastTheMinute()},function(r){return r=="0"?"":parseInt(r)<20?e.i18n.atX0SecondsPastTheMinute(r):e.i18n.atX0SecondsPastTheMinuteGt20()||e.i18n.atX0SecondsPastTheMinute(r)});return a},t.prototype.getMinutesDescription=function(){var e=this,a=this.expressionParts[0],r=this.expressionParts[2],n=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(s){return s},function(s){return o.StringUtilities.format(e.i18n.everyX0Minutes(s),s)},function(s){return e.i18n.minutesX0ThroughX1PastTheHour()},function(s){try{return s=="0"&&r.indexOf("/")==-1&&a==""?e.i18n.everyHour():parseInt(s)<20?e.i18n.atX0MinutesPastTheHour(s):e.i18n.atX0MinutesPastTheHourGt20()||e.i18n.atX0MinutesPastTheHour(s)}catch{return e.i18n.atX0MinutesPastTheHour(s)}});return n},t.prototype.getHoursDescription=function(){var e=this,a=this.expressionParts[2],r=this.getSegmentDescription(a,this.i18n.everyHour(),function(i){return e.formatTime(i,"0","")},function(i){return o.StringUtilities.format(e.i18n.everyX0Hours(i),i)},function(i){return e.i18n.betweenX0AndX1()},function(i){return e.i18n.atX0()});if(r&&a.includes("-")&&this.expressionParts[1]!="0"){var n=Array.from(r.matchAll(/:00/g));if(n.length>1){var s=n[n.length-1].index;r=r.substring(0,s)+":59"+r.substring(s+3)}}return r},t.prototype.getDayOfWeekDescription=function(){var e=this,a=this.i18n.daysOfTheWeek(),r=null;return this.expressionParts[5]=="*"?r="":r=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(n,s){var i=n;n.indexOf("#")>-1?i=n.substring(0,n.indexOf("#")):n.indexOf("L")>-1&&(i=i.replace("L",""));var u=parseInt(i);if(e.options.tzOffset){var m=e.expressionParts[2],f=parseInt(m)+(e.options.tzOffset?e.options.tzOffset:0);f>=24?u++:f<0&&u--,u>6?u=0:u<0&&(u=6)}var y=e.i18n.daysOfTheWeekInCase?e.i18n.daysOfTheWeekInCase(s)[u]:a[u];if(n.indexOf("#")>-1){var p=null,C=n.substring(n.indexOf("#")+1),S=n.substring(0,n.indexOf("#"));switch(C){case"1":p=e.i18n.first(S);break;case"2":p=e.i18n.second(S);break;case"3":p=e.i18n.third(S);break;case"4":p=e.i18n.fourth(S);break;case"5":p=e.i18n.fifth(S);break}y=p+" "+y}return y},function(n){return parseInt(n)==1?"":o.StringUtilities.format(e.i18n.commaEveryX0DaysOfTheWeek(n),n)},function(n){var s=n.substring(0,n.indexOf("-")),i=e.expressionParts[3]!="*";return i?e.i18n.commaAndX0ThroughX1(s):e.i18n.commaX0ThroughX1(s)},function(n){var s=null;if(n.indexOf("#")>-1){var i=n.substring(n.indexOf("#")+1);s=e.i18n.commaOnThe(i).trim()+e.i18n.spaceX0OfTheMonth()}else if(n.indexOf("L")>-1)s=e.i18n.commaOnTheLastX0OfTheMonth(n.replace("L",""));else{var u=e.expressionParts[3]!="*";s=u?e.i18n.commaAndOnX0():e.i18n.commaOnlyOnX0(n)}return s}),r},t.prototype.getMonthDescription=function(){var e=this,a=this.i18n.monthsOfTheYear(),r=this.getSegmentDescription(this.expressionParts[4],"",function(n,s){return s&&e.i18n.monthsOfTheYearInCase?e.i18n.monthsOfTheYearInCase(s)[parseInt(n)-1]:a[parseInt(n)-1]},function(n){return parseInt(n)==1?"":o.StringUtilities.format(e.i18n.commaEveryX0Months(n),n)},function(n){return e.i18n.commaMonthX0ThroughMonthX1()||e.i18n.commaX0ThroughX1()},function(n){return e.i18n.commaOnlyInMonthX0?e.i18n.commaOnlyInMonthX0():e.i18n.commaOnlyInX0()});return r},t.prototype.getDayOfMonthDescription=function(){var e=this,a=null,r=this.expressionParts[3];switch(r){case"L":a=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":a=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var n=r.match(/(\d{1,2}W)|(W\d{1,2})/);if(n){var s=parseInt(n[0].replace("W","")),i=s==1?this.i18n.firstWeekday():o.StringUtilities.format(this.i18n.weekdayNearestDayX0(),s.toString());a=o.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),i);break}else{var u=r.match(/L-(\d{1,2})/);if(u){var m=u[1];a=o.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(m),m);break}else{if(r=="*"&&this.expressionParts[5]!="*")return"";a=this.getSegmentDescription(r,this.i18n.commaEveryDay(),function(f){return f=="L"?e.i18n.lastDay():e.i18n.dayX0?o.StringUtilities.format(e.i18n.dayX0(),f):f},function(f){return f=="1"?e.i18n.commaEveryDay():e.i18n.commaEveryX0Days(f)},function(f){return e.i18n.commaBetweenDayX0AndX1OfTheMonth(f)},function(f){return e.i18n.commaOnDayX0OfTheMonth(f)})}break}}return a},t.prototype.getYearDescription=function(){var e=this,a=this.getSegmentDescription(this.expressionParts[6],"",function(r){return/^\d+$/.test(r)?new Date(parseInt(r),1).getFullYear().toString():r},function(r){return o.StringUtilities.format(e.i18n.commaEveryX0Years(r),r)},function(r){return e.i18n.commaYearX0ThroughYearX1()||e.i18n.commaX0ThroughX1()},function(r){return e.i18n.commaOnlyInYearX0?e.i18n.commaOnlyInYearX0():e.i18n.commaOnlyInX0()});return a},t.prototype.getSegmentDescription=function(e,a,r,n,s,i){var u=null,m=e.indexOf("/")>-1,f=e.indexOf("-")>-1,y=e.indexOf(",")>-1;if(!e)u="";else if(e==="*")u=a;else if(!m&&!f&&!y)u=o.StringUtilities.format(i(e),r(e));else if(y){for(var p=e.split(","),C="",S=0;S<p.length;S++)if(S>0&&p.length>2&&(C+=",",S<p.length-1&&(C+=" ")),S>0&&p.length>1&&(S==p.length-1||p.length==2)&&(C+="".concat(this.i18n.spaceAnd()," ")),p[S].indexOf("/")>-1||p[S].indexOf("-")>-1){var W=p[S].indexOf("-")>-1&&p[S].indexOf("/")==-1,V=this.getSegmentDescription(p[S],a,r,n,W?this.i18n.commaX0ThroughX1:s,i);W&&(V=V.replace(", ","")),C+=V}else m?C+=this.getSegmentDescription(p[S],a,r,n,s,i):C+=r(p[S]);m?u=C:u=o.StringUtilities.format(i(e),C)}else if(m){var p=e.split("/");if(u=o.StringUtilities.format(n(p[1]),p[1]),p[0].indexOf("-")>-1){var E=this.generateRangeSegmentDescription(p[0],s,r);E.indexOf(", ")!=0&&(u+=", "),u+=E}else if(p[0].indexOf("*")==-1){var z=o.StringUtilities.format(i(p[0]),r(p[0]));z=z.replace(", ",""),u+=o.StringUtilities.format(this.i18n.commaStartingX0(),z)}}else f&&(u=this.generateRangeSegmentDescription(e,s,r));return u},t.prototype.generateRangeSegmentDescription=function(e,a,r){var n="",s=e.split("-"),i=r(s[0],1),u=r(s[1],2),m=a(e);return n+=o.StringUtilities.format(m,i,u),n},t.prototype.formatTime=function(e,a,r){var n=0,s=0;this.options.tzOffset&&(n=this.options.tzOffset>0?Math.floor(this.options.tzOffset):Math.ceil(this.options.tzOffset),s=parseFloat((this.options.tzOffset%1).toFixed(2)),s!=0&&(s*=60));var i=parseInt(e)+n,u=parseInt(a)+s;u>=60?(u-=60,i+=1):u<0&&(u+=60,i-=1),i>=24?i=i-24:i<0&&(i=24+i);var m="",f=!1;this.options.use24HourTimeFormat||(f=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),m=f?"".concat(this.getPeriod(i)," "):" ".concat(this.getPeriod(i)),i>12&&(i-=12),i===0&&(i=12));var y="";return r&&(y=":".concat(("00"+r).substring(r.length))),"".concat(f?m:"").concat(("00"+i.toString()).substring(i.toString().length),":").concat(("00"+u.toString()).substring(u.toString().length)).concat(y).concat(f?"":m)},t.prototype.transformVerbosity=function(e,a){return a||(e=e.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),e=e.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),e=e.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),e=e.replace(/\, ?$/,"")),e},t.prototype.getPeriod=function(e){return e>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},t.locales={},t}();d.ExpressionDescriptor=g},336:(O,d,k)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.enLocaleLoader=void 0;var o=k(751),h=function(){function g(){}return g.prototype.load=function(t){t.en=new o.en},g}();d.enLocaleLoader=h},751:(O,d)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.en=void 0;var k=function(){function o(){}return o.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},o.prototype.atX0MinutesPastTheHourGt20=function(){return null},o.prototype.commaMonthX0ThroughMonthX1=function(){return null},o.prototype.commaYearX0ThroughYearX1=function(){return null},o.prototype.use24HourTimeFormatByDefault=function(){return!1},o.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occured when generating the expression description. Check the cron expression syntax."},o.prototype.everyMinute=function(){return"every minute"},o.prototype.everyHour=function(){return"every hour"},o.prototype.atSpace=function(){return"At "},o.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},o.prototype.at=function(){return"At"},o.prototype.spaceAnd=function(){return" and"},o.prototype.everySecond=function(){return"every second"},o.prototype.everyX0Seconds=function(){return"every %s seconds"},o.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},o.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},o.prototype.everyX0Minutes=function(){return"every %s minutes"},o.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},o.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},o.prototype.everyX0Hours=function(){return"every %s hours"},o.prototype.betweenX0AndX1=function(){return"between %s and %s"},o.prototype.atX0=function(){return"at %s"},o.prototype.commaEveryDay=function(){return", every day"},o.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},o.prototype.commaX0ThroughX1=function(){return", %s through %s"},o.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},o.prototype.first=function(){return"first"},o.prototype.second=function(){return"second"},o.prototype.third=function(){return"third"},o.prototype.fourth=function(){return"fourth"},o.prototype.fifth=function(){return"fifth"},o.prototype.commaOnThe=function(){return", on the "},o.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},o.prototype.lastDay=function(){return"the last day"},o.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},o.prototype.commaOnlyOnX0=function(){return", only on %s"},o.prototype.commaAndOnX0=function(){return", and on %s"},o.prototype.commaEveryX0Months=function(){return", every %s months"},o.prototype.commaOnlyInX0=function(){return", only in %s"},o.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},o.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},o.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},o.prototype.firstWeekday=function(){return"first weekday"},o.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},o.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},o.prototype.commaEveryX0Days=function(){return", every %s days"},o.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},o.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},o.prototype.commaEveryHour=function(){return", every hour"},o.prototype.commaEveryX0Years=function(){return", every %s years"},o.prototype.commaStartingX0=function(){return", starting %s"},o.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},o.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},o}();d.en=k},586:(O,d)=>{Object.defineProperty(d,"__esModule",{value:!0});function k(h,g){if(!h)throw new Error(g)}var o=function(){function h(){}return h.secondRange=function(g){for(var t=g.split(","),e=0;e<t.length;e++)if(!isNaN(parseInt(t[e],10))){var a=parseInt(t[e],10);k(a>=0&&a<=59,"seconds part must be >= 0 and <= 59")}},h.minuteRange=function(g){for(var t=g.split(","),e=0;e<t.length;e++)if(!isNaN(parseInt(t[e],10))){var a=parseInt(t[e],10);k(a>=0&&a<=59,"minutes part must be >= 0 and <= 59")}},h.hourRange=function(g){for(var t=g.split(","),e=0;e<t.length;e++)if(!isNaN(parseInt(t[e],10))){var a=parseInt(t[e],10);k(a>=0&&a<=23,"hours part must be >= 0 and <= 23")}},h.dayOfMonthRange=function(g){for(var t=g.split(","),e=0;e<t.length;e++)if(!isNaN(parseInt(t[e],10))){var a=parseInt(t[e],10);k(a>=1&&a<=31,"DOM part must be >= 1 and <= 31")}},h.monthRange=function(g,t){for(var e=g.split(","),a=0;a<e.length;a++)if(!isNaN(parseInt(e[a],10))){var r=parseInt(e[a],10);k(r>=1&&r<=12,t?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},h.dayOfWeekRange=function(g,t){for(var e=g.split(","),a=0;a<e.length;a++)if(!isNaN(parseInt(e[a],10))){var r=parseInt(e[a],10);k(r>=0&&r<=6,t?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},h}();d.default=o},910:(O,d)=>{Object.defineProperty(d,"__esModule",{value:!0}),d.StringUtilities=void 0;var k=function(){function o(){}return o.format=function(h){for(var g=[],t=1;t<arguments.length;t++)g[t-1]=arguments[t];return h.replace(/%s/g,function(e){return g.shift()})},o.containsAny=function(h,g){return g.some(function(t){return h.indexOf(t)>-1})},o}();d.StringUtilities=k}},x={};function X(O){var d=x[O];if(d!==void 0)return d.exports;var k=x[O]={exports:{}};return L[O](k,k.exports,X),k.exports}var D={};return(()=>{var O=D;Object.defineProperty(O,"__esModule",{value:!0}),O.toString=void 0;var d=X(728),k=X(336);d.ExpressionDescriptor.initialize(new k.enLocaleLoader),O.default=d.ExpressionDescriptor;var o=d.ExpressionDescriptor.toString;O.toString=o})(),D})())})(ve);var Fe=ve.exports;const Ge=Oe(Fe),Ze=["title"],Je={"flex-none":"","text-left":""},Qe={flex:"~ gap-2","min-w-0":"","items-center":"","text-sm":""},Ke={class:"truncate"},et={"text-xs":"",op50:""},tt={key:0},nt=["onClick"],rt=ee({__name:"CronCollection",props:{collection:{}},setup(q){const R=q,L=re(),x=H(!0),X=U(()=>Ge.toString(R.collection.cron));return(D,O)=>{const d=oe,k=pe;return _(),$("div",null,[v("button",{flex:"~ gap-2","w-full":"","items-start":"","items-center":"","hover-bg-active":"",p2:"",title:l(X),onClick:O[0]||(O[0]=o=>x.value=!l(x))},[v("div",Je,[T(d,{icon:"carbon:chevron-right","mb0.5":"","transform-rotate":l(x)?90:0,transition:""},null,8,["transform-rotate"])]),v("span",Qe,[T(k,{class:"font-mono n-primary",textContent:N(D.collection.cron)},null,8,["textContent"]),v("span",Ke,N(l(X)),1),v("span",et,"("+N(D.collection.tasks.length)+")",1)])],8,Ze),O[2]||(O[2]=v("div",{"x-divider":""},null,-1)),l(x)?(_(),$("ul",tt,[(_(!0),$(B,null,Z(D.collection.tasks,o=>(_(),$("li",{key:o},[v("button",{flex:"~ gap-2","w-full":"","items-start":"","items-center":"","hover-bg-active":"",px2:"",py1:"","pl-9":"","font-mono":"",class:F([{"bg-active":l(L)===o}]),onClick:h=>L.value=o},N(o),11,nt),O[1]||(O[1]=v("div",{"x-divider":""},null,-1))]))),128))])):j("",!0)])}}}),ot={"h-full":"","w-full":"",flex:"~ col"},at={flex:"~ col gap-2","flex-none":"",p4:"","n-navbar-glass":""},it={flex:"~ gap2 items-center"},st={relative:"","w-full":""},ut={absolute:"","right-2":"","top-1.5":"",flex:"~ gap-1"},lt={flex:"~ gap2 wrap","w-full":"","items-center":"",px4:"",pb2:"","text-center":"","text-sm":"",border:"b base"},ct={class:"hidden md:block"},ft={flex:"~ gap2","mb--2":"","items-center":"",op50:""},pt={key:0,border:"b base",relative:"","n-code-block":""},dt={flex:"~ wrap","w-full":""},ht=["onClick"],vt={border:"b base",flex:"~ gap2","items-center":"",px4:"",py2:""},mt={key:1,"text-xs":"",op50:""},yt=ee({__name:"ServerTaskDetails",props:{task:{}},emits:["open-default-input"],setup(q,{emit:R}){const L=q,x=R,X=H({payload:{}}),{inputDefaults:D}=ue("serverRoutes"),[O,d]=Te(),k=xe(),o=Se(),h=se({contentType:"text/plain",data:"",statusCode:200,error:void 0,fetchTime:0}),g=U(()=>JSON.stringify(h.data,null,2)),t=U(()=>h.contentType.includes("application/json")?"json":"text"),e=H(!1),a=H(!1),r=we(),n=H(),s=["json"],i=H(s[0]),u=se({query:[{active:!0,key:"",value:"",type:"string"}],body:[{active:!0,key:"",value:"",type:"string"}],headers:[]}),m=U({get:()=>u[n.value],set:b=>{u[n.value]=b}}),f=U(()=>({...E(D.value.query),...E(u.query)})),y=U(()=>({...E(D.value.headers)})),p=U(()=>Object.keys(X.value?.payload??{}).length?{...X.value}:void 0),C=U(()=>p.value?"POST":"GET"),S=U(()=>{let b=window?.location.origin;return b.charAt(b.length-1)==="/"&&(b=b.slice(0,-1)),b}),W=U(()=>{let b=new URLSearchParams(f.value).toString();b&&(b=`?${b}`);const c=`/_nitro/tasks/${L.task.name}${b}`;let M=o.value?.app.baseURL||"";return(M==="./"||M===".")&&(M=""),M.endsWith("/")&&(M=M.slice(0,-1)),M+c}),V=U(()=>S.value+W.value);function E(b){const c=Object.fromEntries(b.filter(({active:M,key:Y,value:J})=>M&&Y&&J!==void 0).map(({key:M,value:Y})=>[M,Y]));return Object.entries(c).length?c:void 0}async function z(){a.value=!0,e.value=!0;const b=Date.now();$e("server-tasks:run",{method:C.value});try{h.data=await $fetch(V.value,{method:"POST",headers:y.value,query:f.value,body:p.value,onResponse({response:c}){h.contentType=(c.headers.get("content-type")||"").toString().toLowerCase().trim(),h.statusCode=c.status,h.error=void 0},onResponseError(c){h.error=c.response._data,h.data=c.response._data}})}catch{}e.value=!1,h.fetchTime=Date.now()-b}const te=U(()=>{const b=[];return b.push({name:"Query",slug:"query",length:u.query.length}),b.push({name:"Body",slug:"body",length:u.body.length}),b});Xe(()=>{if(i.value==="json"&&typeof X.value=="string")try{X.value=JSON.parse(X.value)}catch{}});const ae=De("nuxt-devtools:server-tasks:inputs",()=>[],{window:window.parent});Ee([u,n],()=>{const b=ae.value?.find(c=>c.task===L.task.name);if(b){n.value||(n.value=b.tab),b.tab!==n.value&&(b.tab=n.value);const{body:c,query:M,headers:Y}=b.inputs;Object.assign(u,{body:c,query:M,headers:Y})}else{const c={task:L.task.name,tab:"query",inputs:u};ae.value.push(c),n.value||(n.value=c.tab)}},{immediate:!0,deep:!0,debounce:500});const ye=Me();return(b,c)=>{const M=ce,Y=Ue,J=oe,ie=de,ge=fe,_e=Re,ne=pe,be=ze,Q=le("tooltip");return _(),$("div",ot,[v("div",at,[v("div",it,[G((_(),$("div",null,[T(M,{class:F(["n-badge-base n-sm",("getRequestMethodClass"in b?b.getRequestMethodClass:l(Ce))(l(C))]),"pointer-events-none":"","font-mono":"",tabindex:"-1"},{default:I(()=>[P(N(l(C)),1)]),_:1},8,["class"])])),[[Q,`Method is ${l(C)} as ${l(C)==="GET"?"no":""} json body is sent`]]),v("div",st,[T(Y,{"model-value":l(W),readonly:"","flex-auto":"","font-mono":"",p:"x5 y2",n:"sm"},null,8,["model-value"]),v("div",ut,[G(T(M,{title:"Copy URL",n:"xs blue",icon:"carbon:copy",border:!1,onClick:c[0]||(c[0]=w=>l(ye)(l(V),"server-task-url"))},null,512),[[Q,"Copy URL"]]),G(T(M,{title:"Open in Editor",icon:"carbon-launch",n:"xs blue",border:!1,onClick:c[1]||(c[1]=w=>l(r)(b.task.handler))},null,512),[[Q,"Open in Editor"]])])]),T(M,{"h-full":"",n:"primary solid",onClick:z},{default:I(()=>[T(J,{icon:"carbon:send"})]),_:1})])]),v("div",lt,[(_(!0),$(B,null,Z(l(te),w=>G((_(),A(M,{key:w.slug,class:F(l(n)===w.slug?"text-primary n-primary":"border-transparent shadow-none"),onClick:ke=>n.value=w.slug},{default:I(()=>[T(J,{icon:("ServerRouteTabIcons"in b?b.ServerRouteTabIcons:l(he))[w.slug]},null,8,["icon"]),v("div",ct,[P(N(w.name)+" "+N(w?.length?`(${w.length})`:"")+" ",1),v("span",null,N(l(D)[w.slug]?.length?`(${l(D)[w.slug].length})`:""),1)])]),_:2},1032,["class","onClick"])),[[Q,w.name]])),128))]),T(l(O),null,{default:I(()=>[T(ie,{modelValue:l(m),"onUpdate:modelValue":c[4]||(c[4]=w=>K(m)?m.value=w:null),default:{active:!0,type:"string"},"max-h-xs":"","of-auto":""},{default:I(()=>[l(D)[l(n)]?.length?(_(),$(B,{key:0},[v("div",ft,[c[6]||(c[6]=v("div",{"w-5":"","x-divider":""},null,-1)),c[7]||(c[7]=v("div",{"flex-none":""}," Default Inputs ",-1)),T(M,{icon:"i-carbon-edit",border:!1,onClick:c[2]||(c[2]=w=>x("open-default-input"))}),c[8]||(c[8]=v("div",{"x-divider":""},null,-1))]),T(ie,{modelValue:l(D)[l(n)],"onUpdate:modelValue":c[3]||(c[3]=w=>l(D)[l(n)]=w),disabled:"",p0:""},null,8,["modelValue"])],64)):j("",!0)]),_:1},8,["modelValue"])]),_:1}),l(m)?(_(),$("div",pt,[l(n)==="body"?(_(),$(B,{key:0},[v("div",dt,[(_(),$(B,null,Z(s,w=>v("button",{key:w,px4:"",py2:"",border:"r base",hover:"bg-active",class:F({"border-b":w!==l(i)}),onClick:ke=>i.value=w},[v("div",{class:F({op30:w!==l(i)}),"font-mono":""},N(w),3)],10,ht)),64)),c[9]||(c[9]=v("div",{border:"b base","flex-auto":""},null,-1))]),l(i)==="input"?(_(),A(l(d),{key:0})):l(i)==="json"?(_(),A(l(qe),Ie({key:1,modelValue:l(X),"onUpdate:modelValue":c[5]||(c[5]=w=>K(X)?X.value=w:null),class:[l(k)==="dark"?"jse-theme-dark":"light","json-editor-vue of-auto text-sm outline-none"]},b.$attrs,{mode:"text","navigation-bar":!1,indentation:2,"tab-size":2}),null,16,["modelValue","class"])):j("",!0)],64)):(_(),A(l(d),{key:1}))])):j("",!0),l(a)?l(e)?(_(),A(_e,{key:2,"z-10":"","flex-auto":"","backdrop-blur":""},{default:I(()=>c[11]||(c[11]=[P(" Running... ")])),_:1})):(_(),$(B,{key:3},[v("div",vt,[c[13]||(c[13]=v("div",null,"Result",-1)),l(h).error?(_(),A(ne,{key:0,n:"red"},{default:I(()=>c[12]||(c[12]=[P(" Error ")])),_:1})):j("",!0),T(ne,{n:l(h).error?"orange":"green",textContent:N(l(h).statusCode)},null,8,["n","textContent"]),l(h).contentType?(_(),$("code",mt,N(l(h).contentType),1)):j("",!0),c[14]||(c[14]=v("div",{"flex-auto":""},null,-1)),c[15]||(c[15]=v("div",{op50:""}," Tasks finished in ",-1)),T(ne,{n:"green"},{default:I(()=>[P(N(l(h).fetchTime)+" ms ",1)]),_:1})]),T(be,{"flex-auto":"","overflow-auto":"","py-2":"",code:l(g),lang:l(t)},null,8,["code","lang"])],64)):(_(),A(ge,{key:1},{default:I(()=>[T(M,{n:"primary",onClick:z},{default:I(()=>[T(J,{icon:"carbon:send"}),c[10]||(c[10]=P(" Run task "))]),_:1})]),_:1}))])}}}),gt={"flex-none":"","text-left":""},_t={flex:"","items-center":"","text-sm":"","font-mono":""},me=ee({__name:"ServerTaskListItem",props:{item:{},index:{default:0}},setup(q){const R=H(!0),L=re();return(x,X)=>{const D=oe,O=me;return _(),$("div",null,[v("button",{flex:"~ gap-2","w-full":"","items-start":"","items-center":"","hover-bg-active":"",px2:"",py1:"",class:F([{"bg-active":l(L)===x.item.name}]),style:Le({paddingLeft:`calc(0.5rem + ${x.index*1.5}em)`}),onClick:X[0]||(X[0]=d=>{R.value=!l(R),L.value=x.item.name})},[v("div",gt,[x.item.type==="collection"?(_(),A(D,{key:0,icon:"carbon:chevron-right","mb0.5":"","transform-rotate":l(R)?90:0,transition:""},null,8,["transform-rotate"])):j("",!0)]),v("span",_t,[x.item.type==="collection"?(_(),A(D,{key:0,title:`${x.item.tasks?.length} tasks`,icon:"carbon:folder",mr1:""},null,8,["title"])):(_(),A(D,{key:1,icon:"carbon:play",ml3:"",mr1:""})),P(" "+N(x.item.name),1)])],6),X[1]||(X[1]=v("div",{"x-divider":""},null,-1)),l(R)?Ne(x.$slots,"default",{key:0},()=>[(_(!0),$(B,null,Z(x.item.tasks,d=>(_(),A(O,{key:d.name,item:d,index:x.index+1},null,8,["item","index"]))),128))]):j("",!0)])}}}),bt={flex:"~ gap1","text-sm":""},kt={key:0,op50:""},Ot={op50:""},Nt=ee({__name:"server-tasks",setup(q){const R=H(!1),L=Ae(),x=U(()=>Object.keys(L.value?.tasks??{}).map(r=>({name:r,...L.value.tasks[r],type:"task"}))),X=U(()=>Object.entries(L.value?.scheduledTasks??{}).map(([r,n])=>({cron:r,tasks:n}))),D=re(),{view:O,selectedTask:d,inputDefaults:k}=ue("serverTasks"),o=U(()=>{!D.value&&d.value&&(D.value=d.value.name);const r=x.value.find(n=>n.name===D.value);return D.value!==d.value?.name&&r&&(d.value=r),r}),h=H(""),g=U(()=>new Ve(x.value,{keys:["key","description"],shouldSort:!0})),t=U(()=>h.value?g.value.search(h.value).map(n=>n.item):x.value),e=U(()=>{const r=[],n=(i,u)=>{i.tasks||=[],i.tasks.push(u)},s=(i,u)=>{const m=u?u.tasks?.find(y=>y.name===i):r.find(y=>y.name===i);if(m)return{...m,type:"collection"};const f={name:i,handler:i,description:"",type:"collection",tasks:[]};return u?n(u,f):r.push(f),f};return t.value.forEach(i=>{let u;const m={...i,type:"task"},y=i.name.split(":").concat();y.length>0&&y[y.length-1].includes(".")&&y.pop(),y.forEach(p=>{u=s(p,u)}),u?n(u,m):r.push(m)}),r});function a(){O.value=O.value==="tree"?"list":"tree"}return(r,n)=>{const s=ce,i=He,u=rt,m=je,f=yt,y=We,p=fe,C=de,S=Ye,W=Pe,V=le("tooltip");return _(),$(B,null,[T(m,{"storage-key":"tab-server-tasks"},{left:I(()=>[T(m,{horizontal:"","storage-key":"tab-server-tasks-split"},{left:I(()=>[T(i,{search:l(h),"onUpdate:search":n[1]||(n[1]=E=>K(h)?h.value=E:null),pb2:""},{actions:I(()=>[G(T(s,{"text-lg":"",icon:l(O)==="list"?"i-carbon-list":"i-carbon-tree-view-alt",title:"Toggle view",border:!1,onClick:a},null,8,["icon"]),[[V,"Toggle View"]]),G(T(s,{"text-lg":"",icon:"i-carbon-cics-sit-overrides",title:"Default Inputs",border:!1,onClick:n[0]||(n[0]=E=>R.value=!l(R))},null,512),[[V,"Default Inputs"]])]),default:I(()=>[v("div",bt,[l(h)?(_(),$("span",kt,N(l(t).length)+" matched · ",1)):j("",!0),v("span",Ot,N(l(x)?.length)+" tasks in total",1)])]),_:1},8,["search"]),(_(!0),$(B,null,Z(l(O)==="tree"?l(e):l(t),E=>(_(),A(me,{key:E.name,item:E},null,8,["item"]))),128))]),right:I(()=>[n[6]||(n[6]=v("div",{px4:"",py2:"",border:"b base"}," Cron groups ",-1)),v("div",null,[v("ul",null,[(_(!0),$(B,null,Z(l(X),E=>(_(),$("li",{key:E.cron},[T(u,{collection:E},null,8,["collection"])]))),128))])])]),_:1})]),right:I(()=>[(_(),A(Be,{max:10},[l(o)?(_(),A(f,{key:l(o).name,task:l(o),onOpenDefaultInput:n[2]||(n[2]=E=>R.value=!0)},null,8,["task"])):j("",!0)],1024)),l(o)?j("",!0):(_(),A(p,{key:0},{default:I(()=>[T(y,{px6:"",py2:""},{default:I(()=>n[7]||(n[7]=[v("span",{op75:""},"Select a task to start",-1)])),_:1})]),_:1}))]),_:1}),T(W,{modelValue:l(R),"onUpdate:modelValue":n[4]||(n[4]=E=>K(R)?R.value=E:null),"auto-close":"","max-w-xl":"","min-w-xl":"",onClose:n[5]||(n[5]=E=>R.value=!1)},{default:I(()=>[v("div",null,[n[8]||(n[8]=v("div",{p4:"",border:"b base"},[v("span",{"text-lg":""},"Default Inputs"),v("br"),v("span",{"text-white":"",op50:""},"Merged as default for every task in DevTools")],-1)),T(S,{text:`Query ${l(k).query.length?`(${l(k).query.length})`:""}`,padding:!1,icon:("ServerRouteTabIcons"in r?r.ServerRouteTabIcons:l(he)).query},{default:I(()=>[T(C,{modelValue:l(k).query,"onUpdate:modelValue":n[3]||(n[3]=E=>l(k).query=E),py0:"",default:{active:!0,type:"string"}},null,8,["modelValue"])]),_:1},8,["text","icon"])])]),_:1},8,["modelValue"])],64)}}});export{Nt as default};