index.js 106 KB

123456789101112131415
  1. var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __commonJS=(cb,mod)=>function(){return mod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var require_constants=__commonJS({"../../node_modules/semver/internal/constants.js"(exports,module2){var SEMVER_SPEC_VERSION="2.0.0",MAX_SAFE_INTEGER=Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH=16,MAX_SAFE_BUILD_LENGTH=256-6,RELEASE_TYPES=["major","premajor","minor","preminor","patch","prepatch","prerelease"];module2.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH,MAX_SAFE_BUILD_LENGTH,MAX_SAFE_INTEGER,RELEASE_TYPES,SEMVER_SPEC_VERSION,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}});var require_debug=__commonJS({"../../node_modules/semver/internal/debug.js"(exports,module2){var debug=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...args)=>console.error("SEMVER",...args):()=>{};module2.exports=debug}});var require_re=__commonJS({"../../node_modules/semver/internal/re.js"(exports,module2){var{MAX_SAFE_COMPONENT_LENGTH,MAX_SAFE_BUILD_LENGTH,MAX_LENGTH}=require_constants(),debug=require_debug();exports=module2.exports={};var re=exports.re=[],safeRe=exports.safeRe=[],src=exports.src=[],t=exports.t={},R=0,LETTERDASHNUMBER="[a-zA-Z0-9-]",safeRegexReplacements=[["\\s",1],["\\d",MAX_LENGTH],[LETTERDASHNUMBER,MAX_SAFE_BUILD_LENGTH]],makeSafeRegex=value=>{for(let[token,max]of safeRegexReplacements)value=value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);return value},createToken=(name,value,isGlobal)=>{let safe=makeSafeRegex(value),index=R++;debug(name,index,value),t[name]=index,src[index]=value,re[index]=new RegExp(value,isGlobal?"g":void 0),safeRe[index]=new RegExp(safe,isGlobal?"g":void 0)};createToken("NUMERICIDENTIFIER","0|[1-9]\\d*");createToken("NUMERICIDENTIFIERLOOSE","\\d+");createToken("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);createToken("MAINVERSION",`(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);createToken("MAINVERSIONLOOSE",`(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);createToken("PRERELEASEIDENTIFIER",`(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);createToken("PRERELEASEIDENTIFIERLOOSE",`(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);createToken("PRERELEASE",`(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);createToken("PRERELEASELOOSE",`(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);createToken("BUILDIDENTIFIER",`${LETTERDASHNUMBER}+`);createToken("BUILD",`(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);createToken("FULLPLAIN",`v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);createToken("FULL",`^${src[t.FULLPLAIN]}$`);createToken("LOOSEPLAIN",`[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);createToken("LOOSE",`^${src[t.LOOSEPLAIN]}$`);createToken("GTLT","((?:<|>)?=?)");createToken("XRANGEIDENTIFIERLOOSE",`${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);createToken("XRANGEIDENTIFIER",`${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);createToken("XRANGEPLAIN",`[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);createToken("XRANGEPLAINLOOSE",`[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);createToken("XRANGE",`^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);createToken("XRANGELOOSE",`^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);createToken("COERCE",`(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:$|[^\\d])`);createToken("COERCERTL",src[t.COERCE],!0);createToken("LONETILDE","(?:~>?)");createToken("TILDETRIM",`(\\s*)${src[t.LONETILDE]}\\s+`,!0);exports.tildeTrimReplace="$1~";createToken("TILDE",`^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);createToken("TILDELOOSE",`^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);createToken("LONECARET","(?:\\^)");createToken("CARETTRIM",`(\\s*)${src[t.LONECARET]}\\s+`,!0);exports.caretTrimReplace="$1^";createToken("CARET",`^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);createToken("CARETLOOSE",`^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);createToken("COMPARATORLOOSE",`^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);createToken("COMPARATOR",`^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);createToken("COMPARATORTRIM",`(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`,!0);exports.comparatorTrimReplace="$1$2$3";createToken("HYPHENRANGE",`^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);createToken("HYPHENRANGELOOSE",`^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);createToken("STAR","(<|>)?=?\\s*\\*");createToken("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");createToken("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}});var require_parse_options=__commonJS({"../../node_modules/semver/internal/parse-options.js"(exports,module2){var looseOption=Object.freeze({loose:!0}),emptyOpts=Object.freeze({}),parseOptions=options=>options?typeof options!="object"?looseOption:options:emptyOpts;module2.exports=parseOptions}});var require_identifiers=__commonJS({"../../node_modules/semver/internal/identifiers.js"(exports,module2){var numeric=/^[0-9]+$/,compareIdentifiers=(a,b)=>{let anum=numeric.test(a),bnum=numeric.test(b);return anum&&bnum&&(a=+a,b=+b),a===b?0:anum&&!bnum?-1:bnum&&!anum?1:a<b?-1:1},rcompareIdentifiers=(a,b)=>compareIdentifiers(b,a);module2.exports={compareIdentifiers,rcompareIdentifiers}}});var require_semver=__commonJS({"../../node_modules/semver/classes/semver.js"(exports,module2){var debug=require_debug(),{MAX_LENGTH,MAX_SAFE_INTEGER}=require_constants(),{safeRe:re,t}=require_re(),parseOptions=require_parse_options(),{compareIdentifiers}=require_identifiers(),SemVer=class _SemVer{constructor(version2,options){if(options=parseOptions(options),version2 instanceof _SemVer){if(version2.loose===!!options.loose&&version2.includePrerelease===!!options.includePrerelease)return version2;version2=version2.version}else if(typeof version2!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version2}".`);if(version2.length>MAX_LENGTH)throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);debug("SemVer",version2,options),this.options=options,this.loose=!!options.loose,this.includePrerelease=!!options.includePrerelease;let m=version2.trim().match(options.loose?re[t.LOOSE]:re[t.FULL]);if(!m)throw new TypeError(`Invalid Version: ${version2}`);if(this.raw=version2,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>MAX_SAFE_INTEGER||this.major<0)throw new TypeError("Invalid major version");if(this.minor>MAX_SAFE_INTEGER||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>MAX_SAFE_INTEGER||this.patch<0)throw new TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(id=>{if(/^[0-9]+$/.test(id)){let num=+id;if(num>=0&&num<MAX_SAFE_INTEGER)return num}return id}):this.prerelease=[],this.build=m[5]?m[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(other){if(debug("SemVer.compare",this.version,this.options,other),!(other instanceof _SemVer)){if(typeof other=="string"&&other===this.version)return 0;other=new _SemVer(other,this.options)}return other.version===this.version?0:this.compareMain(other)||this.comparePre(other)}compareMain(other){return other instanceof _SemVer||(other=new _SemVer(other,this.options)),compareIdentifiers(this.major,other.major)||compareIdentifiers(this.minor,other.minor)||compareIdentifiers(this.patch,other.patch)}comparePre(other){if(other instanceof _SemVer||(other=new _SemVer(other,this.options)),this.prerelease.length&&!other.prerelease.length)return-1;if(!this.prerelease.length&&other.prerelease.length)return 1;if(!this.prerelease.length&&!other.prerelease.length)return 0;let i=0;do{let a=this.prerelease[i],b=other.prerelease[i];if(debug("prerelease compare",i,a,b),a===void 0&&b===void 0)return 0;if(b===void 0)return 1;if(a===void 0)return-1;if(a===b)continue;return compareIdentifiers(a,b)}while(++i)}compareBuild(other){other instanceof _SemVer||(other=new _SemVer(other,this.options));let i=0;do{let a=this.build[i],b=other.build[i];if(debug("prerelease compare",i,a,b),a===void 0&&b===void 0)return 0;if(b===void 0)return 1;if(a===void 0)return-1;if(a===b)continue;return compareIdentifiers(a,b)}while(++i)}inc(release,identifier,identifierBase){switch(release){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",identifier,identifierBase);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",identifier,identifierBase);break;case"prepatch":this.prerelease.length=0,this.inc("patch",identifier,identifierBase),this.inc("pre",identifier,identifierBase);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",identifier,identifierBase),this.inc("pre",identifier,identifierBase);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let base=Number(identifierBase)?1:0;if(!identifier&&identifierBase===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[base];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(identifier===this.prerelease.join(".")&&identifierBase===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(base)}}if(identifier){let prerelease=[identifier,base];identifierBase===!1&&(prerelease=[identifier]),compareIdentifiers(this.prerelease[0],identifier)===0?isNaN(this.prerelease[1])&&(this.prerelease=prerelease):this.prerelease=prerelease}break}default:throw new Error(`invalid increment argument: ${release}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};module2.exports=SemVer}});var require_parse=__commonJS({"../../node_modules/semver/functions/parse.js"(exports,module2){var SemVer=require_semver(),parse2=(version2,options,throwErrors=!1)=>{if(version2 instanceof SemVer)return version2;try{return new SemVer(version2,options)}catch(er){if(!throwErrors)return null;throw er}};module2.exports=parse2}});var require_valid=__commonJS({"../../node_modules/semver/functions/valid.js"(exports,module2){var parse2=require_parse(),valid=(version2,options)=>{let v=parse2(version2,options);return v?v.version:null};module2.exports=valid}});var require_clean=__commonJS({"../../node_modules/semver/functions/clean.js"(exports,module2){var parse2=require_parse(),clean=(version2,options)=>{let s=parse2(version2.trim().replace(/^[=v]+/,""),options);return s?s.version:null};module2.exports=clean}});var require_inc=__commonJS({"../../node_modules/semver/functions/inc.js"(exports,module2){var SemVer=require_semver(),inc=(version2,release,options,identifier,identifierBase)=>{typeof options=="string"&&(identifierBase=identifier,identifier=options,options=void 0);try{return new SemVer(version2 instanceof SemVer?version2.version:version2,options).inc(release,identifier,identifierBase).version}catch{return null}};module2.exports=inc}});var require_diff=__commonJS({"../../node_modules/semver/functions/diff.js"(exports,module2){var parse2=require_parse(),diff=(version1,version2)=>{let v1=parse2(version1,null,!0),v2=parse2(version2,null,!0),comparison=v1.compare(v2);if(comparison===0)return null;let v1Higher=comparison>0,highVersion=v1Higher?v1:v2,lowVersion=v1Higher?v2:v1,highHasPre=!!highVersion.prerelease.length;if(!!lowVersion.prerelease.length&&!highHasPre)return!lowVersion.patch&&!lowVersion.minor?"major":highVersion.patch?"patch":highVersion.minor?"minor":"major";let prefix=highHasPre?"pre":"";return v1.major!==v2.major?prefix+"major":v1.minor!==v2.minor?prefix+"minor":v1.patch!==v2.patch?prefix+"patch":"prerelease"};module2.exports=diff}});var require_major=__commonJS({"../../node_modules/semver/functions/major.js"(exports,module2){var SemVer=require_semver(),major=(a,loose)=>new SemVer(a,loose).major;module2.exports=major}});var require_minor=__commonJS({"../../node_modules/semver/functions/minor.js"(exports,module2){var SemVer=require_semver(),minor=(a,loose)=>new SemVer(a,loose).minor;module2.exports=minor}});var require_patch=__commonJS({"../../node_modules/semver/functions/patch.js"(exports,module2){var SemVer=require_semver(),patch=(a,loose)=>new SemVer(a,loose).patch;module2.exports=patch}});var require_prerelease=__commonJS({"../../node_modules/semver/functions/prerelease.js"(exports,module2){var parse2=require_parse(),prerelease=(version2,options)=>{let parsed=parse2(version2,options);return parsed&&parsed.prerelease.length?parsed.prerelease:null};module2.exports=prerelease}});var require_compare=__commonJS({"../../node_modules/semver/functions/compare.js"(exports,module2){var SemVer=require_semver(),compare=(a,b,loose)=>new SemVer(a,loose).compare(new SemVer(b,loose));module2.exports=compare}});var require_rcompare=__commonJS({"../../node_modules/semver/functions/rcompare.js"(exports,module2){var compare=require_compare(),rcompare=(a,b,loose)=>compare(b,a,loose);module2.exports=rcompare}});var require_compare_loose=__commonJS({"../../node_modules/semver/functions/compare-loose.js"(exports,module2){var compare=require_compare(),compareLoose=(a,b)=>compare(a,b,!0);module2.exports=compareLoose}});var require_compare_build=__commonJS({"../../node_modules/semver/functions/compare-build.js"(exports,module2){var SemVer=require_semver(),compareBuild=(a,b,loose)=>{let versionA=new SemVer(a,loose),versionB=new SemVer(b,loose);return versionA.compare(versionB)||versionA.compareBuild(versionB)};module2.exports=compareBuild}});var require_sort=__commonJS({"../../node_modules/semver/functions/sort.js"(exports,module2){var compareBuild=require_compare_build(),sort=(list,loose)=>list.sort((a,b)=>compareBuild(a,b,loose));module2.exports=sort}});var require_rsort=__commonJS({"../../node_modules/semver/functions/rsort.js"(exports,module2){var compareBuild=require_compare_build(),rsort=(list,loose)=>list.sort((a,b)=>compareBuild(b,a,loose));module2.exports=rsort}});var require_gt=__commonJS({"../../node_modules/semver/functions/gt.js"(exports,module2){var compare=require_compare(),gt=(a,b,loose)=>compare(a,b,loose)>0;module2.exports=gt}});var require_lt=__commonJS({"../../node_modules/semver/functions/lt.js"(exports,module2){var compare=require_compare(),lt=(a,b,loose)=>compare(a,b,loose)<0;module2.exports=lt}});var require_eq=__commonJS({"../../node_modules/semver/functions/eq.js"(exports,module2){var compare=require_compare(),eq=(a,b,loose)=>compare(a,b,loose)===0;module2.exports=eq}});var require_neq=__commonJS({"../../node_modules/semver/functions/neq.js"(exports,module2){var compare=require_compare(),neq=(a,b,loose)=>compare(a,b,loose)!==0;module2.exports=neq}});var require_gte=__commonJS({"../../node_modules/semver/functions/gte.js"(exports,module2){var compare=require_compare(),gte=(a,b,loose)=>compare(a,b,loose)>=0;module2.exports=gte}});var require_lte=__commonJS({"../../node_modules/semver/functions/lte.js"(exports,module2){var compare=require_compare(),lte=(a,b,loose)=>compare(a,b,loose)<=0;module2.exports=lte}});var require_cmp=__commonJS({"../../node_modules/semver/functions/cmp.js"(exports,module2){var eq=require_eq(),neq=require_neq(),gt=require_gt(),gte=require_gte(),lt=require_lt(),lte=require_lte(),cmp=(a,op,b,loose)=>{switch(op){case"===":return typeof a=="object"&&(a=a.version),typeof b=="object"&&(b=b.version),a===b;case"!==":return typeof a=="object"&&(a=a.version),typeof b=="object"&&(b=b.version),a!==b;case"":case"=":case"==":return eq(a,b,loose);case"!=":return neq(a,b,loose);case">":return gt(a,b,loose);case">=":return gte(a,b,loose);case"<":return lt(a,b,loose);case"<=":return lte(a,b,loose);default:throw new TypeError(`Invalid operator: ${op}`)}};module2.exports=cmp}});var require_coerce=__commonJS({"../../node_modules/semver/functions/coerce.js"(exports,module2){var SemVer=require_semver(),parse2=require_parse(),{safeRe:re,t}=require_re(),coerce=(version2,options)=>{if(version2 instanceof SemVer)return version2;if(typeof version2=="number"&&(version2=String(version2)),typeof version2!="string")return null;options=options||{};let match=null;if(!options.rtl)match=version2.match(re[t.COERCE]);else{let next;for(;(next=re[t.COERCERTL].exec(version2))&&(!match||match.index+match[0].length!==version2.length);)(!match||next.index+next[0].length!==match.index+match[0].length)&&(match=next),re[t.COERCERTL].lastIndex=next.index+next[1].length+next[2].length;re[t.COERCERTL].lastIndex=-1}return match===null?null:parse2(`${match[2]}.${match[3]||"0"}.${match[4]||"0"}`,options)};module2.exports=coerce}});var require_iterator=__commonJS({"../../node_modules/yallist/iterator.js"(exports,module2){"use strict";module2.exports=function(Yallist){Yallist.prototype[Symbol.iterator]=function*(){for(let walker=this.head;walker;walker=walker.next)yield walker.value}}}});var require_yallist=__commonJS({"../../node_modules/yallist/yallist.js"(exports,module2){"use strict";module2.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(list){var self=this;if(self instanceof Yallist||(self=new Yallist),self.tail=null,self.head=null,self.length=0,list&&typeof list.forEach=="function")list.forEach(function(item){self.push(item)});else if(arguments.length>0)for(var i=0,l=arguments.length;i<l;i++)self.push(arguments[i]);return self}Yallist.prototype.removeNode=function(node){if(node.list!==this)throw new Error("removing node which does not belong to this list");var next=node.next,prev=node.prev;return next&&(next.prev=prev),prev&&(prev.next=next),node===this.head&&(this.head=next),node===this.tail&&(this.tail=prev),node.list.length--,node.next=null,node.prev=null,node.list=null,next};Yallist.prototype.unshiftNode=function(node){if(node!==this.head){node.list&&node.list.removeNode(node);var head=this.head;node.list=this,node.next=head,head&&(head.prev=node),this.head=node,this.tail||(this.tail=node),this.length++}};Yallist.prototype.pushNode=function(node){if(node!==this.tail){node.list&&node.list.removeNode(node);var tail=this.tail;node.list=this,node.prev=tail,tail&&(tail.next=node),this.tail=node,this.head||(this.head=node),this.length++}};Yallist.prototype.push=function(){for(var i=0,l=arguments.length;i<l;i++)push(this,arguments[i]);return this.length};Yallist.prototype.unshift=function(){for(var i=0,l=arguments.length;i<l;i++)unshift(this,arguments[i]);return this.length};Yallist.prototype.pop=function(){if(this.tail){var res=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,res}};Yallist.prototype.shift=function(){if(this.head){var res=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,res}};Yallist.prototype.forEach=function(fn,thisp){thisp=thisp||this;for(var walker=this.head,i=0;walker!==null;i++)fn.call(thisp,walker.value,i,this),walker=walker.next};Yallist.prototype.forEachReverse=function(fn,thisp){thisp=thisp||this;for(var walker=this.tail,i=this.length-1;walker!==null;i--)fn.call(thisp,walker.value,i,this),walker=walker.prev};Yallist.prototype.get=function(n){for(var i=0,walker=this.head;walker!==null&&i<n;i++)walker=walker.next;if(i===n&&walker!==null)return walker.value};Yallist.prototype.getReverse=function(n){for(var i=0,walker=this.tail;walker!==null&&i<n;i++)walker=walker.prev;if(i===n&&walker!==null)return walker.value};Yallist.prototype.map=function(fn,thisp){thisp=thisp||this;for(var res=new Yallist,walker=this.head;walker!==null;)res.push(fn.call(thisp,walker.value,this)),walker=walker.next;return res};Yallist.prototype.mapReverse=function(fn,thisp){thisp=thisp||this;for(var res=new Yallist,walker=this.tail;walker!==null;)res.push(fn.call(thisp,walker.value,this)),walker=walker.prev;return res};Yallist.prototype.reduce=function(fn,initial){var acc,walker=this.head;if(arguments.length>1)acc=initial;else if(this.head)walker=this.head.next,acc=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;walker!==null;i++)acc=fn(acc,walker.value,i),walker=walker.next;return acc};Yallist.prototype.reduceReverse=function(fn,initial){var acc,walker=this.tail;if(arguments.length>1)acc=initial;else if(this.tail)walker=this.tail.prev,acc=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;walker!==null;i--)acc=fn(acc,walker.value,i),walker=walker.prev;return acc};Yallist.prototype.toArray=function(){for(var arr=new Array(this.length),i=0,walker=this.head;walker!==null;i++)arr[i]=walker.value,walker=walker.next;return arr};Yallist.prototype.toArrayReverse=function(){for(var arr=new Array(this.length),i=0,walker=this.tail;walker!==null;i++)arr[i]=walker.value,walker=walker.prev;return arr};Yallist.prototype.slice=function(from,to){to=to||this.length,to<0&&(to+=this.length),from=from||0,from<0&&(from+=this.length);var ret=new Yallist;if(to<from||to<0)return ret;from<0&&(from=0),to>this.length&&(to=this.length);for(var i=0,walker=this.head;walker!==null&&i<from;i++)walker=walker.next;for(;walker!==null&&i<to;i++,walker=walker.next)ret.push(walker.value);return ret};Yallist.prototype.sliceReverse=function(from,to){to=to||this.length,to<0&&(to+=this.length),from=from||0,from<0&&(from+=this.length);var ret=new Yallist;if(to<from||to<0)return ret;from<0&&(from=0),to>this.length&&(to=this.length);for(var i=this.length,walker=this.tail;walker!==null&&i>to;i--)walker=walker.prev;for(;walker!==null&&i>from;i--,walker=walker.prev)ret.push(walker.value);return ret};Yallist.prototype.splice=function(start,deleteCount,...nodes){start>this.length&&(start=this.length-1),start<0&&(start=this.length+start);for(var i=0,walker=this.head;walker!==null&&i<start;i++)walker=walker.next;for(var ret=[],i=0;walker&&i<deleteCount;i++)ret.push(walker.value),walker=this.removeNode(walker);walker===null&&(walker=this.tail),walker!==this.head&&walker!==this.tail&&(walker=walker.prev);for(var i=0;i<nodes.length;i++)walker=insert(this,walker,nodes[i]);return ret};Yallist.prototype.reverse=function(){for(var head=this.head,tail=this.tail,walker=head;walker!==null;walker=walker.prev){var p=walker.prev;walker.prev=walker.next,walker.next=p}return this.head=tail,this.tail=head,this};function insert(self,node,value){var inserted=node===self.head?new Node(value,null,node,self):new Node(value,node,node.next,self);return inserted.next===null&&(self.tail=inserted),inserted.prev===null&&(self.head=inserted),self.length++,inserted}function push(self,item){self.tail=new Node(item,self.tail,null,self),self.head||(self.head=self.tail),self.length++}function unshift(self,item){self.head=new Node(item,null,self.head,self),self.tail||(self.tail=self.head),self.length++}function Node(value,prev,next,list){if(!(this instanceof Node))return new Node(value,prev,next,list);this.list=list,this.value=value,prev?(prev.next=this,this.prev=prev):this.prev=null,next?(next.prev=this,this.next=next):this.next=null}try{require_iterator()(Yallist)}catch{}}});var require_lru_cache=__commonJS({"../../node_modules/semver/node_modules/lru-cache/index.js"(exports,module2){"use strict";var Yallist=require_yallist(),MAX=Symbol("max"),LENGTH=Symbol("length"),LENGTH_CALCULATOR=Symbol("lengthCalculator"),ALLOW_STALE=Symbol("allowStale"),MAX_AGE=Symbol("maxAge"),DISPOSE=Symbol("dispose"),NO_DISPOSE_ON_SET=Symbol("noDisposeOnSet"),LRU_LIST=Symbol("lruList"),CACHE=Symbol("cache"),UPDATE_AGE_ON_GET=Symbol("updateAgeOnGet"),naiveLength=()=>1,LRUCache=class{constructor(options){if(typeof options=="number"&&(options={max:options}),options||(options={}),options.max&&(typeof options.max!="number"||options.max<0))throw new TypeError("max must be a non-negative number");let max=this[MAX]=options.max||1/0,lc=options.length||naiveLength;if(this[LENGTH_CALCULATOR]=typeof lc!="function"?naiveLength:lc,this[ALLOW_STALE]=options.stale||!1,options.maxAge&&typeof options.maxAge!="number")throw new TypeError("maxAge must be a number");this[MAX_AGE]=options.maxAge||0,this[DISPOSE]=options.dispose,this[NO_DISPOSE_ON_SET]=options.noDisposeOnSet||!1,this[UPDATE_AGE_ON_GET]=options.updateAgeOnGet||!1,this.reset()}set max(mL){if(typeof mL!="number"||mL<0)throw new TypeError("max must be a non-negative number");this[MAX]=mL||1/0,trim(this)}get max(){return this[MAX]}set allowStale(allowStale){this[ALLOW_STALE]=!!allowStale}get allowStale(){return this[ALLOW_STALE]}set maxAge(mA){if(typeof mA!="number")throw new TypeError("maxAge must be a non-negative number");this[MAX_AGE]=mA,trim(this)}get maxAge(){return this[MAX_AGE]}set lengthCalculator(lC){typeof lC!="function"&&(lC=naiveLength),lC!==this[LENGTH_CALCULATOR]&&(this[LENGTH_CALCULATOR]=lC,this[LENGTH]=0,this[LRU_LIST].forEach(hit=>{hit.length=this[LENGTH_CALCULATOR](hit.value,hit.key),this[LENGTH]+=hit.length})),trim(this)}get lengthCalculator(){return this[LENGTH_CALCULATOR]}get length(){return this[LENGTH]}get itemCount(){return this[LRU_LIST].length}rforEach(fn,thisp){thisp=thisp||this;for(let walker=this[LRU_LIST].tail;walker!==null;){let prev=walker.prev;forEachStep(this,fn,walker,thisp),walker=prev}}forEach(fn,thisp){thisp=thisp||this;for(let walker=this[LRU_LIST].head;walker!==null;){let next=walker.next;forEachStep(this,fn,walker,thisp),walker=next}}keys(){return this[LRU_LIST].toArray().map(k=>k.key)}values(){return this[LRU_LIST].toArray().map(k=>k.value)}reset(){this[DISPOSE]&&this[LRU_LIST]&&this[LRU_LIST].length&&this[LRU_LIST].forEach(hit=>this[DISPOSE](hit.key,hit.value)),this[CACHE]=new Map,this[LRU_LIST]=new Yallist,this[LENGTH]=0}dump(){return this[LRU_LIST].map(hit=>isStale(this,hit)?!1:{k:hit.key,v:hit.value,e:hit.now+(hit.maxAge||0)}).toArray().filter(h=>h)}dumpLru(){return this[LRU_LIST]}set(key,value,maxAge){if(maxAge=maxAge||this[MAX_AGE],maxAge&&typeof maxAge!="number")throw new TypeError("maxAge must be a number");let now=maxAge?Date.now():0,len=this[LENGTH_CALCULATOR](value,key);if(this[CACHE].has(key)){if(len>this[MAX])return del(this,this[CACHE].get(key)),!1;let item=this[CACHE].get(key).value;return this[DISPOSE]&&(this[NO_DISPOSE_ON_SET]||this[DISPOSE](key,item.value)),item.now=now,item.maxAge=maxAge,item.value=value,this[LENGTH]+=len-item.length,item.length=len,this.get(key),trim(this),!0}let hit=new Entry(key,value,len,now,maxAge);return hit.length>this[MAX]?(this[DISPOSE]&&this[DISPOSE](key,value),!1):(this[LENGTH]+=hit.length,this[LRU_LIST].unshift(hit),this[CACHE].set(key,this[LRU_LIST].head),trim(this),!0)}has(key){if(!this[CACHE].has(key))return!1;let hit=this[CACHE].get(key).value;return!isStale(this,hit)}get(key){return get2(this,key,!0)}peek(key){return get2(this,key,!1)}pop(){let node=this[LRU_LIST].tail;return node?(del(this,node),node.value):null}del(key){del(this,this[CACHE].get(key))}load(arr){this.reset();let now=Date.now();for(let l=arr.length-1;l>=0;l--){let hit=arr[l],expiresAt=hit.e||0;if(expiresAt===0)this.set(hit.k,hit.v);else{let maxAge=expiresAt-now;maxAge>0&&this.set(hit.k,hit.v,maxAge)}}}prune(){this[CACHE].forEach((value,key)=>get2(this,key,!1))}},get2=(self,key,doUse)=>{let node=self[CACHE].get(key);if(node){let hit=node.value;if(isStale(self,hit)){if(del(self,node),!self[ALLOW_STALE])return}else doUse&&(self[UPDATE_AGE_ON_GET]&&(node.value.now=Date.now()),self[LRU_LIST].unshiftNode(node));return hit.value}},isStale=(self,hit)=>{if(!hit||!hit.maxAge&&!self[MAX_AGE])return!1;let diff=Date.now()-hit.now;return hit.maxAge?diff>hit.maxAge:self[MAX_AGE]&&diff>self[MAX_AGE]},trim=self=>{if(self[LENGTH]>self[MAX])for(let walker=self[LRU_LIST].tail;self[LENGTH]>self[MAX]&&walker!==null;){let prev=walker.prev;del(self,walker),walker=prev}},del=(self,node)=>{if(node){let hit=node.value;self[DISPOSE]&&self[DISPOSE](hit.key,hit.value),self[LENGTH]-=hit.length,self[CACHE].delete(hit.key),self[LRU_LIST].removeNode(node)}},Entry=class{constructor(key,value,length,now,maxAge){this.key=key,this.value=value,this.length=length,this.now=now,this.maxAge=maxAge||0}},forEachStep=(self,fn,node,thisp)=>{let hit=node.value;isStale(self,hit)&&(del(self,node),self[ALLOW_STALE]||(hit=void 0)),hit&&fn.call(thisp,hit.value,hit.key,self)};module2.exports=LRUCache}});var require_range=__commonJS({"../../node_modules/semver/classes/range.js"(exports,module2){var Range=class _Range{constructor(range,options){if(options=parseOptions(options),range instanceof _Range)return range.loose===!!options.loose&&range.includePrerelease===!!options.includePrerelease?range:new _Range(range.raw,options);if(range instanceof Comparator)return this.raw=range.value,this.set=[[range]],this.format(),this;if(this.options=options,this.loose=!!options.loose,this.includePrerelease=!!options.includePrerelease,this.raw=range.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(c=>c.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let first=this.set[0];if(this.set=this.set.filter(c=>!isNullSet(c[0])),this.set.length===0)this.set=[first];else if(this.set.length>1){for(let c of this.set)if(c.length===1&&isAny(c[0])){this.set=[c];break}}}this.format()}format(){return this.range=this.set.map(comps=>comps.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(range){let memoKey=((this.options.includePrerelease&&FLAG_INCLUDE_PRERELEASE)|(this.options.loose&&FLAG_LOOSE))+":"+range,cached=cache.get(memoKey);if(cached)return cached;let loose=this.options.loose,hr=loose?re[t.HYPHENRANGELOOSE]:re[t.HYPHENRANGE];range=range.replace(hr,hyphenReplace(this.options.includePrerelease)),debug("hyphen replace",range),range=range.replace(re[t.COMPARATORTRIM],comparatorTrimReplace),debug("comparator trim",range),range=range.replace(re[t.TILDETRIM],tildeTrimReplace),debug("tilde trim",range),range=range.replace(re[t.CARETTRIM],caretTrimReplace),debug("caret trim",range);let rangeList=range.split(" ").map(comp=>parseComparator(comp,this.options)).join(" ").split(/\s+/).map(comp=>replaceGTE0(comp,this.options));loose&&(rangeList=rangeList.filter(comp=>(debug("loose invalid filter",comp,this.options),!!comp.match(re[t.COMPARATORLOOSE])))),debug("range list",rangeList);let rangeMap=new Map,comparators=rangeList.map(comp=>new Comparator(comp,this.options));for(let comp of comparators){if(isNullSet(comp))return[comp];rangeMap.set(comp.value,comp)}rangeMap.size>1&&rangeMap.has("")&&rangeMap.delete("");let result=[...rangeMap.values()];return cache.set(memoKey,result),result}intersects(range,options){if(!(range instanceof _Range))throw new TypeError("a Range is required");return this.set.some(thisComparators=>isSatisfiable(thisComparators,options)&&range.set.some(rangeComparators=>isSatisfiable(rangeComparators,options)&&thisComparators.every(thisComparator=>rangeComparators.every(rangeComparator=>thisComparator.intersects(rangeComparator,options)))))}test(version2){if(!version2)return!1;if(typeof version2=="string")try{version2=new SemVer(version2,this.options)}catch{return!1}for(let i=0;i<this.set.length;i++)if(testSet(this.set[i],version2,this.options))return!0;return!1}};module2.exports=Range;var LRU=require_lru_cache(),cache=new LRU({max:1e3}),parseOptions=require_parse_options(),Comparator=require_comparator(),debug=require_debug(),SemVer=require_semver(),{safeRe:re,t,comparatorTrimReplace,tildeTrimReplace,caretTrimReplace}=require_re(),{FLAG_INCLUDE_PRERELEASE,FLAG_LOOSE}=require_constants(),isNullSet=c=>c.value==="<0.0.0-0",isAny=c=>c.value==="",isSatisfiable=(comparators,options)=>{let result=!0,remainingComparators=comparators.slice(),testComparator=remainingComparators.pop();for(;result&&remainingComparators.length;)result=remainingComparators.every(otherComparator=>testComparator.intersects(otherComparator,options)),testComparator=remainingComparators.pop();return result},parseComparator=(comp,options)=>(debug("comp",comp,options),comp=replaceCarets(comp,options),debug("caret",comp),comp=replaceTildes(comp,options),debug("tildes",comp),comp=replaceXRanges(comp,options),debug("xrange",comp),comp=replaceStars(comp,options),debug("stars",comp),comp),isX=id=>!id||id.toLowerCase()==="x"||id==="*",replaceTildes=(comp,options)=>comp.trim().split(/\s+/).map(c=>replaceTilde(c,options)).join(" "),replaceTilde=(comp,options)=>{let r=options.loose?re[t.TILDELOOSE]:re[t.TILDE];return comp.replace(r,(_,M,m,p,pr)=>{debug("tilde",comp,_,M,m,p,pr);let ret;return isX(M)?ret="":isX(m)?ret=`>=${M}.0.0 <${+M+1}.0.0-0`:isX(p)?ret=`>=${M}.${m}.0 <${M}.${+m+1}.0-0`:pr?(debug("replaceTilde pr",pr),ret=`>=${M}.${m}.${p}-${pr} <${M}.${+m+1}.0-0`):ret=`>=${M}.${m}.${p} <${M}.${+m+1}.0-0`,debug("tilde return",ret),ret})},replaceCarets=(comp,options)=>comp.trim().split(/\s+/).map(c=>replaceCaret(c,options)).join(" "),replaceCaret=(comp,options)=>{debug("caret",comp,options);let r=options.loose?re[t.CARETLOOSE]:re[t.CARET],z=options.includePrerelease?"-0":"";return comp.replace(r,(_,M,m,p,pr)=>{debug("caret",comp,_,M,m,p,pr);let ret;return isX(M)?ret="":isX(m)?ret=`>=${M}.0.0${z} <${+M+1}.0.0-0`:isX(p)?M==="0"?ret=`>=${M}.${m}.0${z} <${M}.${+m+1}.0-0`:ret=`>=${M}.${m}.0${z} <${+M+1}.0.0-0`:pr?(debug("replaceCaret pr",pr),M==="0"?m==="0"?ret=`>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p+1}-0`:ret=`>=${M}.${m}.${p}-${pr} <${M}.${+m+1}.0-0`:ret=`>=${M}.${m}.${p}-${pr} <${+M+1}.0.0-0`):(debug("no pr"),M==="0"?m==="0"?ret=`>=${M}.${m}.${p}${z} <${M}.${m}.${+p+1}-0`:ret=`>=${M}.${m}.${p}${z} <${M}.${+m+1}.0-0`:ret=`>=${M}.${m}.${p} <${+M+1}.0.0-0`),debug("caret return",ret),ret})},replaceXRanges=(comp,options)=>(debug("replaceXRanges",comp,options),comp.split(/\s+/).map(c=>replaceXRange(c,options)).join(" ")),replaceXRange=(comp,options)=>{comp=comp.trim();let r=options.loose?re[t.XRANGELOOSE]:re[t.XRANGE];return comp.replace(r,(ret,gtlt,M,m,p,pr)=>{debug("xRange",comp,ret,gtlt,M,m,p,pr);let xM=isX(M),xm=xM||isX(m),xp=xm||isX(p),anyX=xp;return gtlt==="="&&anyX&&(gtlt=""),pr=options.includePrerelease?"-0":"",xM?gtlt===">"||gtlt==="<"?ret="<0.0.0-0":ret="*":gtlt&&anyX?(xm&&(m=0),p=0,gtlt===">"?(gtlt=">=",xm?(M=+M+1,m=0,p=0):(m=+m+1,p=0)):gtlt==="<="&&(gtlt="<",xm?M=+M+1:m=+m+1),gtlt==="<"&&(pr="-0"),ret=`${gtlt+M}.${m}.${p}${pr}`):xm?ret=`>=${M}.0.0${pr} <${+M+1}.0.0-0`:xp&&(ret=`>=${M}.${m}.0${pr} <${M}.${+m+1}.0-0`),debug("xRange return",ret),ret})},replaceStars=(comp,options)=>(debug("replaceStars",comp,options),comp.trim().replace(re[t.STAR],"")),replaceGTE0=(comp,options)=>(debug("replaceGTE0",comp,options),comp.trim().replace(re[options.includePrerelease?t.GTE0PRE:t.GTE0],"")),hyphenReplace=incPr=>($0,from,fM,fm,fp,fpr,fb,to,tM,tm,tp,tpr,tb)=>(isX(fM)?from="":isX(fm)?from=`>=${fM}.0.0${incPr?"-0":""}`:isX(fp)?from=`>=${fM}.${fm}.0${incPr?"-0":""}`:fpr?from=`>=${from}`:from=`>=${from}${incPr?"-0":""}`,isX(tM)?to="":isX(tm)?to=`<${+tM+1}.0.0-0`:isX(tp)?to=`<${tM}.${+tm+1}.0-0`:tpr?to=`<=${tM}.${tm}.${tp}-${tpr}`:incPr?to=`<${tM}.${tm}.${+tp+1}-0`:to=`<=${to}`,`${from} ${to}`.trim()),testSet=(set2,version2,options)=>{for(let i=0;i<set2.length;i++)if(!set2[i].test(version2))return!1;if(version2.prerelease.length&&!options.includePrerelease){for(let i=0;i<set2.length;i++)if(debug(set2[i].semver),set2[i].semver!==Comparator.ANY&&set2[i].semver.prerelease.length>0){let allowed=set2[i].semver;if(allowed.major===version2.major&&allowed.minor===version2.minor&&allowed.patch===version2.patch)return!0}return!1}return!0}}});var require_comparator=__commonJS({"../../node_modules/semver/classes/comparator.js"(exports,module2){var ANY=Symbol("SemVer ANY"),Comparator=class _Comparator{static get ANY(){return ANY}constructor(comp,options){if(options=parseOptions(options),comp instanceof _Comparator){if(comp.loose===!!options.loose)return comp;comp=comp.value}comp=comp.trim().split(/\s+/).join(" "),debug("comparator",comp,options),this.options=options,this.loose=!!options.loose,this.parse(comp),this.semver===ANY?this.value="":this.value=this.operator+this.semver.version,debug("comp",this)}parse(comp){let r=this.options.loose?re[t.COMPARATORLOOSE]:re[t.COMPARATOR],m=comp.match(r);if(!m)throw new TypeError(`Invalid comparator: ${comp}`);this.operator=m[1]!==void 0?m[1]:"",this.operator==="="&&(this.operator=""),m[2]?this.semver=new SemVer(m[2],this.options.loose):this.semver=ANY}toString(){return this.value}test(version2){if(debug("Comparator.test",version2,this.options.loose),this.semver===ANY||version2===ANY)return!0;if(typeof version2=="string")try{version2=new SemVer(version2,this.options)}catch{return!1}return cmp(version2,this.operator,this.semver,this.options)}intersects(comp,options){if(!(comp instanceof _Comparator))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Range(comp.value,options).test(this.value):comp.operator===""?comp.value===""?!0:new Range(this.value,options).test(comp.semver):(options=parseOptions(options),options.includePrerelease&&(this.value==="<0.0.0-0"||comp.value==="<0.0.0-0")||!options.includePrerelease&&(this.value.startsWith("<0.0.0")||comp.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&comp.operator.startsWith(">")||this.operator.startsWith("<")&&comp.operator.startsWith("<")||this.semver.version===comp.semver.version&&this.operator.includes("=")&&comp.operator.includes("=")||cmp(this.semver,"<",comp.semver,options)&&this.operator.startsWith(">")&&comp.operator.startsWith("<")||cmp(this.semver,">",comp.semver,options)&&this.operator.startsWith("<")&&comp.operator.startsWith(">")))}};module2.exports=Comparator;var parseOptions=require_parse_options(),{safeRe:re,t}=require_re(),cmp=require_cmp(),debug=require_debug(),SemVer=require_semver(),Range=require_range()}});var require_satisfies=__commonJS({"../../node_modules/semver/functions/satisfies.js"(exports,module2){var Range=require_range(),satisfies=(version2,range,options)=>{try{range=new Range(range,options)}catch{return!1}return range.test(version2)};module2.exports=satisfies}});var require_to_comparators=__commonJS({"../../node_modules/semver/ranges/to-comparators.js"(exports,module2){var Range=require_range(),toComparators=(range,options)=>new Range(range,options).set.map(comp=>comp.map(c=>c.value).join(" ").trim().split(" "));module2.exports=toComparators}});var require_max_satisfying=__commonJS({"../../node_modules/semver/ranges/max-satisfying.js"(exports,module2){var SemVer=require_semver(),Range=require_range(),maxSatisfying=(versions,range,options)=>{let max=null,maxSV=null,rangeObj=null;try{rangeObj=new Range(range,options)}catch{return null}return versions.forEach(v=>{rangeObj.test(v)&&(!max||maxSV.compare(v)===-1)&&(max=v,maxSV=new SemVer(max,options))}),max};module2.exports=maxSatisfying}});var require_min_satisfying=__commonJS({"../../node_modules/semver/ranges/min-satisfying.js"(exports,module2){var SemVer=require_semver(),Range=require_range(),minSatisfying=(versions,range,options)=>{let min=null,minSV=null,rangeObj=null;try{rangeObj=new Range(range,options)}catch{return null}return versions.forEach(v=>{rangeObj.test(v)&&(!min||minSV.compare(v)===1)&&(min=v,minSV=new SemVer(min,options))}),min};module2.exports=minSatisfying}});var require_min_version=__commonJS({"../../node_modules/semver/ranges/min-version.js"(exports,module2){var SemVer=require_semver(),Range=require_range(),gt=require_gt(),minVersion=(range,loose)=>{range=new Range(range,loose);let minver=new SemVer("0.0.0");if(range.test(minver)||(minver=new SemVer("0.0.0-0"),range.test(minver)))return minver;minver=null;for(let i=0;i<range.set.length;++i){let comparators=range.set[i],setMin=null;comparators.forEach(comparator=>{let compver=new SemVer(comparator.semver.version);switch(comparator.operator){case">":compver.prerelease.length===0?compver.patch++:compver.prerelease.push(0),compver.raw=compver.format();case"":case">=":(!setMin||gt(compver,setMin))&&(setMin=compver);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${comparator.operator}`)}}),setMin&&(!minver||gt(minver,setMin))&&(minver=setMin)}return minver&&range.test(minver)?minver:null};module2.exports=minVersion}});var require_valid2=__commonJS({"../../node_modules/semver/ranges/valid.js"(exports,module2){var Range=require_range(),validRange=(range,options)=>{try{return new Range(range,options).range||"*"}catch{return null}};module2.exports=validRange}});var require_outside=__commonJS({"../../node_modules/semver/ranges/outside.js"(exports,module2){var SemVer=require_semver(),Comparator=require_comparator(),{ANY}=Comparator,Range=require_range(),satisfies=require_satisfies(),gt=require_gt(),lt=require_lt(),lte=require_lte(),gte=require_gte(),outside=(version2,range,hilo,options)=>{version2=new SemVer(version2,options),range=new Range(range,options);let gtfn,ltefn,ltfn,comp,ecomp;switch(hilo){case">":gtfn=gt,ltefn=lte,ltfn=lt,comp=">",ecomp=">=";break;case"<":gtfn=lt,ltefn=gte,ltfn=gt,comp="<",ecomp="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(satisfies(version2,range,options))return!1;for(let i=0;i<range.set.length;++i){let comparators=range.set[i],high=null,low=null;if(comparators.forEach(comparator=>{comparator.semver===ANY&&(comparator=new Comparator(">=0.0.0")),high=high||comparator,low=low||comparator,gtfn(comparator.semver,high.semver,options)?high=comparator:ltfn(comparator.semver,low.semver,options)&&(low=comparator)}),high.operator===comp||high.operator===ecomp||(!low.operator||low.operator===comp)&&ltefn(version2,low.semver))return!1;if(low.operator===ecomp&&ltfn(version2,low.semver))return!1}return!0};module2.exports=outside}});var require_gtr=__commonJS({"../../node_modules/semver/ranges/gtr.js"(exports,module2){var outside=require_outside(),gtr=(version2,range,options)=>outside(version2,range,">",options);module2.exports=gtr}});var require_ltr=__commonJS({"../../node_modules/semver/ranges/ltr.js"(exports,module2){var outside=require_outside(),ltr=(version2,range,options)=>outside(version2,range,"<",options);module2.exports=ltr}});var require_intersects=__commonJS({"../../node_modules/semver/ranges/intersects.js"(exports,module2){var Range=require_range(),intersects=(r1,r2,options)=>(r1=new Range(r1,options),r2=new Range(r2,options),r1.intersects(r2,options));module2.exports=intersects}});var require_simplify=__commonJS({"../../node_modules/semver/ranges/simplify.js"(exports,module2){var satisfies=require_satisfies(),compare=require_compare();module2.exports=(versions,range,options)=>{let set2=[],first=null,prev=null,v=versions.sort((a,b)=>compare(a,b,options));for(let version2 of v)satisfies(version2,range,options)?(prev=version2,first||(first=version2)):(prev&&set2.push([first,prev]),prev=null,first=null);first&&set2.push([first,null]);let ranges=[];for(let[min,max]of set2)min===max?ranges.push(min):!max&&min===v[0]?ranges.push("*"):max?min===v[0]?ranges.push(`<=${max}`):ranges.push(`${min} - ${max}`):ranges.push(`>=${min}`);let simplified=ranges.join(" || "),original=typeof range.raw=="string"?range.raw:String(range);return simplified.length<original.length?simplified:range}}});var require_subset=__commonJS({"../../node_modules/semver/ranges/subset.js"(exports,module2){var Range=require_range(),Comparator=require_comparator(),{ANY}=Comparator,satisfies=require_satisfies(),compare=require_compare(),subset=(sub,dom,options={})=>{if(sub===dom)return!0;sub=new Range(sub,options),dom=new Range(dom,options);let sawNonNull=!1;OUTER:for(let simpleSub of sub.set){for(let simpleDom of dom.set){let isSub=simpleSubset(simpleSub,simpleDom,options);if(sawNonNull=sawNonNull||isSub!==null,isSub)continue OUTER}if(sawNonNull)return!1}return!0},minimumVersionWithPreRelease=[new Comparator(">=0.0.0-0")],minimumVersion=[new Comparator(">=0.0.0")],simpleSubset=(sub,dom,options)=>{if(sub===dom)return!0;if(sub.length===1&&sub[0].semver===ANY){if(dom.length===1&&dom[0].semver===ANY)return!0;options.includePrerelease?sub=minimumVersionWithPreRelease:sub=minimumVersion}if(dom.length===1&&dom[0].semver===ANY){if(options.includePrerelease)return!0;dom=minimumVersion}let eqSet=new Set,gt,lt;for(let c of sub)c.operator===">"||c.operator===">="?gt=higherGT(gt,c,options):c.operator==="<"||c.operator==="<="?lt=lowerLT(lt,c,options):eqSet.add(c.semver);if(eqSet.size>1)return null;let gtltComp;if(gt&&lt){if(gtltComp=compare(gt.semver,lt.semver,options),gtltComp>0)return null;if(gtltComp===0&&(gt.operator!==">="||lt.operator!=="<="))return null}for(let eq of eqSet){if(gt&&!satisfies(eq,String(gt),options)||lt&&!satisfies(eq,String(lt),options))return null;for(let c of dom)if(!satisfies(eq,String(c),options))return!1;return!0}let higher,lower,hasDomLT,hasDomGT,needDomLTPre=lt&&!options.includePrerelease&&lt.semver.prerelease.length?lt.semver:!1,needDomGTPre=gt&&!options.includePrerelease&&gt.semver.prerelease.length?gt.semver:!1;needDomLTPre&&needDomLTPre.prerelease.length===1&&lt.operator==="<"&&needDomLTPre.prerelease[0]===0&&(needDomLTPre=!1);for(let c of dom){if(hasDomGT=hasDomGT||c.operator===">"||c.operator===">=",hasDomLT=hasDomLT||c.operator==="<"||c.operator==="<=",gt){if(needDomGTPre&&c.semver.prerelease&&c.semver.prerelease.length&&c.semver.major===needDomGTPre.major&&c.semver.minor===needDomGTPre.minor&&c.semver.patch===needDomGTPre.patch&&(needDomGTPre=!1),c.operator===">"||c.operator===">="){if(higher=higherGT(gt,c,options),higher===c&&higher!==gt)return!1}else if(gt.operator===">="&&!satisfies(gt.semver,String(c),options))return!1}if(lt){if(needDomLTPre&&c.semver.prerelease&&c.semver.prerelease.length&&c.semver.major===needDomLTPre.major&&c.semver.minor===needDomLTPre.minor&&c.semver.patch===needDomLTPre.patch&&(needDomLTPre=!1),c.operator==="<"||c.operator==="<="){if(lower=lowerLT(lt,c,options),lower===c&&lower!==lt)return!1}else if(lt.operator==="<="&&!satisfies(lt.semver,String(c),options))return!1}if(!c.operator&&(lt||gt)&&gtltComp!==0)return!1}return!(gt&&hasDomLT&&!lt&&gtltComp!==0||lt&&hasDomGT&&!gt&&gtltComp!==0||needDomGTPre||needDomLTPre)},higherGT=(a,b,options)=>{if(!a)return b;let comp=compare(a.semver,b.semver,options);return comp>0?a:comp<0||b.operator===">"&&a.operator===">="?b:a},lowerLT=(a,b,options)=>{if(!a)return b;let comp=compare(a.semver,b.semver,options);return comp<0?a:comp>0||b.operator==="<"&&a.operator==="<="?b:a};module2.exports=subset}});var require_semver2=__commonJS({"../../node_modules/semver/index.js"(exports,module2){var internalRe=require_re(),constants=require_constants(),SemVer=require_semver(),identifiers=require_identifiers(),parse2=require_parse(),valid=require_valid(),clean=require_clean(),inc=require_inc(),diff=require_diff(),major=require_major(),minor=require_minor(),patch=require_patch(),prerelease=require_prerelease(),compare=require_compare(),rcompare=require_rcompare(),compareLoose=require_compare_loose(),compareBuild=require_compare_build(),sort=require_sort(),rsort=require_rsort(),gt=require_gt(),lt=require_lt(),eq=require_eq(),neq=require_neq(),gte=require_gte(),lte=require_lte(),cmp=require_cmp(),coerce=require_coerce(),Comparator=require_comparator(),Range=require_range(),satisfies=require_satisfies(),toComparators=require_to_comparators(),maxSatisfying=require_max_satisfying(),minSatisfying=require_min_satisfying(),minVersion=require_min_version(),validRange=require_valid2(),outside=require_outside(),gtr=require_gtr(),ltr=require_ltr(),intersects=require_intersects(),simplifyRange=require_simplify(),subset=require_subset();module2.exports={parse:parse2,valid,clean,inc,diff,major,minor,patch,prerelease,compare,rcompare,compareLoose,compareBuild,sort,rsort,gt,lt,eq,neq,gte,lte,cmp,coerce,Comparator,Range,satisfies,toComparators,maxSatisfying,minSatisfying,minVersion,validRange,outside,gtr,ltr,intersects,simplifyRange,subset,SemVer,re:internalRe.re,src:internalRe.src,tokens:internalRe.t,SEMVER_SPEC_VERSION:constants.SEMVER_SPEC_VERSION,RELEASE_TYPES:constants.RELEASE_TYPES,compareIdentifiers:identifiers.compareIdentifiers,rcompareIdentifiers:identifiers.rcompareIdentifiers}}});var src_exports={};__export(src_exports,{ActiveTabs:()=>ActiveTabs2,Consumer:()=>ManagerConsumer,ManagerContext:()=>ManagerContext,Provider:()=>ManagerProvider,addons:()=>addons,combineParameters:()=>combineParameters,controlOrMetaKey:()=>controlOrMetaKey,controlOrMetaSymbol:()=>controlOrMetaSymbol,eventMatchesShortcut:()=>eventMatchesShortcut,eventToShortcut:()=>eventToShortcut,isMacLike:()=>isMacLike,isShortcutTaken:()=>isShortcutTaken,keyToSymbol:()=>keyToSymbol,merge:()=>merge_default,mockChannel:()=>mockChannel,optionOrAltSymbol:()=>optionOrAltSymbol,shortcutMatchesShortcut:()=>shortcutMatchesShortcut,shortcutToHumanString:()=>shortcutToHumanString,types:()=>typesX,useAddonState:()=>useAddonState,useArgTypes:()=>useArgTypes,useArgs:()=>useArgs,useChannel:()=>useChannel,useGlobalTypes:()=>useGlobalTypes,useGlobals:()=>useGlobals,useParameter:()=>useParameter,useSharedState:()=>useSharedState,useStoryPrepared:()=>useStoryPrepared,useStorybookApi:()=>useStorybookApi,useStorybookState:()=>useStorybookState});module.exports=__toCommonJS(src_exports);var import_react2=__toESM(require("react")),import_mergeWith2=__toESM(require("lodash/mergeWith.js")),import_core_events9=require("@storybook/core-events"),import_client_logger6=require("@storybook/client-logger");var import_react=require("react"),createContext=({api,state})=>(0,import_react.createContext)({api,state});var import_store2=__toESM(require("store2"));var import_telejson=require("telejson"),store_setup_default=_=>{_.fn("set",function(key,data){return _.set(this._area,this._in(key),(0,import_telejson.stringify)(data,{maxDepth:50}))}),_.fn("get",function(key,alt){let value=_.get(this._area,this._in(key));return value!==null?(0,import_telejson.parse)(value):alt||value})};store_setup_default(import_store2.default._);var STORAGE_KEY="@storybook/manager/store";function get(storage){return storage.get(STORAGE_KEY)||{}}function set(storage,value){return storage.set(STORAGE_KEY,value)}function update(storage,patch){let previous=get(storage);return set(storage,{...previous,...patch})}var Store=class{constructor({setState,getState}){this.upstreamSetState=setState,this.upstreamGetState=getState}getInitialState(base){return{...base,...get(import_store2.default.local),...get(import_store2.default.session)}}getState(){return this.upstreamGetState()}async setState(inputPatch,cbOrOptions,inputOptions){let callback,options;typeof cbOrOptions=="function"?(callback=cbOrOptions,options=inputOptions):options=cbOrOptions;let{persistence="none"}=options||{},patch={},delta={};typeof inputPatch=="function"?patch=state=>(delta=inputPatch(state),delta):(patch=inputPatch,delta=patch);let newState=await new Promise(resolve=>{this.upstreamSetState(patch,resolve)});if(persistence!=="none"){let storage=persistence==="session"?import_store2.default.session:import_store2.default.local;await update(storage,delta)}return callback&&callback(newState),newState}};var import_mergeWith=__toESM(require("lodash/mergeWith.js")),import_isEqual=__toESM(require("lodash/isEqual.js")),import_client_logger=require("@storybook/client-logger"),merge_default=(a,b)=>(0,import_mergeWith.default)({},a,b,(objValue,srcValue)=>{if(Array.isArray(srcValue)&&Array.isArray(objValue))return srcValue.forEach(s=>{objValue.find(o=>o===s||(0,import_isEqual.default)(o,s))||objValue.push(s)}),objValue;if(Array.isArray(objValue))return import_client_logger.logger.log(["the types mismatch, picking",objValue]),objValue});var main=(...additions)=>additions.reduce((acc,item)=>merge_default(acc,item),{}),initial_state_default=main;var provider_exports={};__export(provider_exports,{init:()=>init});var init=({provider,fullAPI})=>({api:provider.renderPreview?{renderPreview:provider.renderPreview}:{},state:{},init:()=>{provider.handleAPI(fullAPI)}});var addons_exports={};__export(addons_exports,{ensurePanel:()=>ensurePanel,init:()=>init2});var import_types=require("@storybook/types");function ensurePanel(panels,selectedPanel,currentPanel){let keys2=Object.keys(panels);return keys2.indexOf(selectedPanel)>=0?selectedPanel:keys2.length?keys2[0]:currentPanel}var init2=({provider,store:store2,fullAPI})=>{let api={getElements:type=>provider.getElements(type),getPanels:()=>api.getElements(import_types.Addon_TypesEnum.PANEL),getStoryPanels:()=>{let allPanels=api.getElements(import_types.Addon_TypesEnum.PANEL),{storyId}=store2.getState(),story=fullAPI.getData(storyId);if(!allPanels||!story||story.type!=="story")return allPanels;let{parameters}=story,filteredPanels={};return Object.entries(allPanels).forEach(([id,panel])=>{let{paramKey}=panel;paramKey&&parameters&&parameters[paramKey]&&parameters[paramKey].disable||(filteredPanels[id]=panel)}),filteredPanels},getSelectedPanel:()=>{let{selectedPanel}=store2.getState();return ensurePanel(api.getElements(import_types.Addon_TypesEnum.PANEL),selectedPanel,selectedPanel)},setSelectedPanel:panelName=>{store2.setState({selectedPanel:panelName},{persistence:"session"})},setAddonState(addonId,newStateOrMerger,options){let nextState,{addons:existing}=store2.getState();return typeof newStateOrMerger=="function"?nextState=newStateOrMerger(api.getAddonState(addonId)):nextState=newStateOrMerger,store2.setState({addons:{...existing,[addonId]:nextState}},options).then(()=>api.getAddonState(addonId))},getAddonState:addonId=>store2.getState().addons[addonId]||(globalThis==null?void 0:globalThis.STORYBOOK_ADDON_STATE[addonId])};return{api,state:{selectedPanel:ensurePanel(api.getElements(import_types.Addon_TypesEnum.PANEL),store2.getState().selectedPanel),addons:{}}}};var channel_exports={};__export(channel_exports,{init:()=>init3});var import_core_events=require("@storybook/core-events"),init3=({provider})=>{let api={getChannel:()=>provider.channel,on:(type,handler)=>(provider.channel.on(type,handler),()=>provider.channel.off(type,handler)),off:(type,handler)=>provider.channel.off(type,handler),once:(type,handler)=>provider.channel.once(type,handler),emit:(type,data,...args)=>{var _a;(_a=data==null?void 0:data.options)!=null&&_a.target&&data.options.target!=="storybook-preview-iframe"&&!data.options.target.startsWith("storybook-ref-")&&(data.options.target=data.options.target!=="storybook_internal"?`storybook-ref-${data.options.target}`:"storybook-preview-iframe"),provider.channel.emit(type,data,...args)},collapseAll:()=>{api.emit(import_core_events.STORIES_COLLAPSE_ALL,{})},expandAll:()=>{api.emit(import_core_events.STORIES_EXPAND_ALL)}};return{api,state:{}}};var notifications_exports={};__export(notifications_exports,{init:()=>init4});var init4=({store:store2})=>{let api={addNotification:notification=>{api.clearNotification(notification.id);let{notifications}=store2.getState();store2.setState({notifications:[...notifications,notification]})},clearNotification:id=>{let{notifications}=store2.getState();store2.setState({notifications:notifications.filter(n=>n.id!==id)});let notification=notifications.find(n=>n.id===id);notification&&notification.onClear&&notification.onClear({dismissed:!1})}};return{api,state:{notifications:[]}}};var settings_exports={};__export(settings_exports,{init:()=>init5});var init5=({store:store2,navigate,fullAPI})=>{let isSettingsScreenActive=()=>{let{path}=fullAPI.getUrlState();return!!(path||"").match(/^\/settings/)};return{state:{settings:{lastTrackedStoryId:null}},api:{closeSettings:()=>{let{settings:{lastTrackedStoryId}}=store2.getState();lastTrackedStoryId?fullAPI.selectStory(lastTrackedStoryId):fullAPI.selectFirstStory()},changeSettingsTab:path=>{navigate(`/settings/${path}`)},isSettingsScreenActive,navigateToSettingsPage:async path=>{if(!isSettingsScreenActive()){let{settings,storyId}=store2.getState();await store2.setState({settings:{...settings,lastTrackedStoryId:storyId}})}navigate(path)},retrieveSelection(){let{settings}=store2.getState();return settings.lastTrackedStoryId},storeSelection:async()=>{let{storyId,settings}=store2.getState();await store2.setState({settings:{...settings,lastTrackedStoryId:storyId}})}}}};var stories_exports={};__export(stories_exports,{init:()=>init7});var import_global2=require("@storybook/global"),import_csf2=require("@storybook/csf"),import_core_events2=require("@storybook/core-events"),import_client_logger3=require("@storybook/client-logger");var import_client_logger2=require("@storybook/client-logger");var refs_exports={};__export(refs_exports,{defaultStoryMapper:()=>defaultStoryMapper,getSourceType:()=>getSourceType,init:()=>init6});var import_global=require("@storybook/global"),import_ts_dedent2=require("ts-dedent");var import_memoizerific=__toESM(require("memoizerific")),import_ts_dedent=require("ts-dedent"),import_countBy=__toESM(require("lodash/countBy.js")),import_mapValues=__toESM(require("lodash/mapValues.js")),import_csf=require("@storybook/csf");var TITLE_PATH_SEPARATOR=/\s*\/\s*/,denormalizeStoryParameters=({globalParameters,kindParameters,stories})=>(0,import_mapValues.default)(stories,storyData=>({...storyData,parameters:combineParameters(globalParameters,kindParameters[storyData.kind],storyData.parameters)})),transformSetStoriesStoryDataToStoriesHash=(data,options)=>transformStoryIndexToStoriesHash(transformSetStoriesStoryDataToPreparedStoryIndex(data),options),transformSetStoriesStoryDataToPreparedStoryIndex=stories=>({v:4,entries:Object.entries(stories).reduce((acc,[id,story])=>{if(!story)return acc;let{docsOnly,fileName,...parameters}=story.parameters,base={title:story.kind,id,name:story.name,importPath:fileName};if(docsOnly)acc[id]={type:"docs",tags:["stories-mdx"],storiesImports:[],...base};else{let{argTypes,args,initialArgs}=story;acc[id]={type:"story",...base,parameters,argTypes,args,initialArgs}}return acc},{})}),transformStoryIndexV2toV3=index=>({v:3,stories:Object.values(index.stories).reduce((acc,entry)=>(acc[entry.id]={...entry,title:entry.kind,name:entry.name||entry.story,importPath:entry.parameters.fileName||""},acc),{})}),transformStoryIndexV3toV4=index=>{let countByTitle=(0,import_countBy.default)(Object.values(index.stories),"title");return{v:4,entries:Object.values(index.stories).reduce((acc,entry)=>{var _a;let type="story";return((_a=entry.parameters)!=null&&_a.docsOnly||entry.name==="Page"&&countByTitle[entry.title]===1)&&(type="docs"),acc[entry.id]={type,...type==="docs"&&{tags:["stories-mdx"],storiesImports:[]},...entry},delete acc[entry.id].story,delete acc[entry.id].kind,acc},{})}},transformStoryIndexToStoriesHash=(input,{provider,docsOptions,filters,status})=>{if(!input.v)throw new Error("Composition: Missing stories.json version");let index=input;index=index.v===2?transformStoryIndexV2toV3(index):index,index=index.v===3?transformStoryIndexV3toV4(index):index,index=index;let entryValues=Object.values(index.entries).filter(entry=>{let result=!0;return Object.values(filters).forEach(filter=>{result!==!1&&(result=filter({...entry,status:status[entry.id]}))}),result}),{sidebar={}}=provider.getConfig(),{showRoots,collapsedRoots=[],renderLabel}=sidebar,setShowRoots=typeof showRoots<"u",storiesHashOutOfOrder=entryValues.reduce((acc,item)=>{if(docsOptions.docsMode&&item.type!=="docs")return acc;let{title}=item,groups=title.trim().split(TITLE_PATH_SEPARATOR),root=(!setShowRoots||showRoots)&&groups.length>1?[groups.shift()]:[],names=[...root,...groups],paths=names.reduce((list,name,idx)=>{let parent=idx>0&&list[idx-1],id=(0,import_csf.sanitize)(parent?`${parent}-${name}`:name);if(parent===id)throw new Error(import_ts_dedent.dedent`
  2. Invalid part '${name}', leading to id === parentId ('${id}'), inside title '${title}'
  3. Did you create a path that uses the separator char accidentally, such as 'Vue <docs/>' where '/' is a separator char? See https://github.com/storybookjs/storybook/issues/6128
  4. `);return list.push(id),list},[]);return paths.forEach((id,idx)=>{let childId=paths[idx+1]||item.id;root.length&&idx===0?acc[id]=merge_default(acc[id]||{},{type:"root",id,name:names[idx],depth:idx,renderLabel,startCollapsed:collapsedRoots.includes(id),children:[childId],isRoot:!0,isComponent:!1,isLeaf:!1}):(!acc[id]||acc[id].type==="component")&&idx===paths.length-1?acc[id]=merge_default(acc[id]||{},{type:"component",id,name:names[idx],parent:paths[idx-1],depth:idx,renderLabel,...childId&&{children:[childId]},isRoot:!1,isComponent:!0,isLeaf:!1}):acc[id]=merge_default(acc[id]||{},{type:"group",id,name:names[idx],parent:paths[idx-1],depth:idx,renderLabel,...childId&&{children:[childId]},isRoot:!1,isComponent:!1,isLeaf:!1})}),acc[item.id]={type:"story",...item,depth:paths.length,parent:paths[paths.length-1],renderLabel,prepared:!!item.parameters,kind:item.title,isRoot:!1,isComponent:!1,isLeaf:!0},acc},{});function addItem(acc,item){return acc[item.id]||(acc[item.id]=item,(item.type==="root"||item.type==="group"||item.type==="component")&&item.children.forEach(childId=>addItem(acc,storiesHashOutOfOrder[childId]))),acc}let orphanHash=Object.values(storiesHashOutOfOrder).filter(i=>i.type!=="root"&&!i.parent).reduce(addItem,{});return Object.values(storiesHashOutOfOrder).filter(i=>i.type==="root").reduce(addItem,orphanHash)},addPreparedStories=(newHash,oldHash)=>oldHash?Object.fromEntries(Object.entries(newHash).map(([id,newEntry])=>{let oldEntry=oldHash[id];return newEntry.type==="story"&&(oldEntry==null?void 0:oldEntry.type)==="story"&&oldEntry.prepared?[id,{...oldEntry,...newEntry,prepared:!0}]:[id,newEntry]})):newHash,getComponentLookupList=(0,import_memoizerific.default)(1)(hash=>Object.entries(hash).reduce((acc,i)=>{let value=i[1];return value.type==="component"&&acc.push([...value.children]),acc},[])),getStoriesLookupList=(0,import_memoizerific.default)(1)(hash=>Object.keys(hash).filter(k=>["story","docs"].includes(hash[k].type)));var{location,fetch}=import_global.global,findFilename=/(\/((?:[^\/]+?)\.[^\/]+?)|\/)$/,getSourceType=(source,refId)=>{let{origin:localOrigin,pathname:localPathname}=location,{origin:sourceOrigin,pathname:sourcePathname}=new URL(source),localFull=`${localOrigin+localPathname}`.replace(findFilename,""),sourceFull=`${sourceOrigin+sourcePathname}`.replace(findFilename,"");return localFull===sourceFull?["local",sourceFull]:refId||source?["external",sourceFull]:[null,null]},defaultStoryMapper=(b,a)=>({...a,kind:a.kind.replace("|","/")}),addRefIds=(input,ref)=>Object.entries(input).reduce((acc,[id,item])=>({...acc,[id]:{...item,refId:ref.id}}),{});async function handleRequest(request){if(!request)return{};try{let response=await request;if(response===!1||response===!0)throw new Error("Unexpected boolean response");if(!response.ok)throw new Error(`Unexpected response not OK: ${response.statusText}`);let json=await response.json();return json.entries||json.stories?{storyIndex:json}:json}catch(err){return{indexError:err}}}var parseUrl=url=>{let credentialsRegex=/https?:\/\/(.+:.+)@/,cleanUrl=url,authorization,[,credentials]=url.match(credentialsRegex)||[];return credentials&&(cleanUrl=url.replace(`${credentials}@`,""),authorization=btoa(`${credentials}`)),{url:cleanUrl,authorization}},map=(input,ref,options)=>{let{storyMapper}=options;return storyMapper?Object.entries(input).reduce((acc,[id,item])=>({...acc,[id]:storyMapper(ref,item)}),{}):input},init6=({store:store2,provider,singleStory,docsOptions={}},{runCheck=!0}={})=>{let api={findRef:source=>{let refs2=api.getRefs();return Object.values(refs2).find(({url})=>url.match(source))},changeRefVersion:(id,url)=>{let{versions,title}=api.getRefs()[id],ref={id,url,versions,title,index:{},expanded:!0};api.setRef(id,{...ref,type:"unknown"},!1),api.checkRef(ref)},changeRefState:(id,previewInitialized)=>{let{[id]:ref,...updated}=api.getRefs();updated[id]={...ref,previewInitialized},store2.setState({refs:updated})},checkRef:async ref=>{let{id,url,version:version2,type}=ref,isPublic=type==="server-checked",loadedData={},query=version2?`?version=${version2}`:"",credentials=isPublic?"omit":"include",urlParseResult=parseUrl(url),headers={Accept:"application/json"};urlParseResult.authorization&&Object.assign(headers,{Authorization:`Basic ${urlParseResult.authorization}`});let[indexResult,storiesResult]=await Promise.all(["index.json","stories.json"].map(async file=>handleRequest(fetch(`${urlParseResult.url}/${file}${query}`,{headers,credentials}))));if(!indexResult.indexError||!storiesResult.indexError){let metadata=await handleRequest(fetch(`${urlParseResult.url}/metadata.json${query}`,{headers,credentials,cache:"no-cache"}).catch(()=>!1));Object.assign(loadedData,{...indexResult.indexError?storiesResult:indexResult,...!metadata.indexError&&metadata})}else isPublic||(loadedData.indexError={message:import_ts_dedent2.dedent`
  5. Error: Loading of ref failed
  6. at fetch (lib/api/src/modules/refs.ts)
  7. URL: ${urlParseResult.url}
  8. We weren't able to load the above URL,
  9. it's possible a CORS error happened.
  10. Please check your dev-tools network tab.
  11. `});let versions=ref.versions&&Object.keys(ref.versions).length?ref.versions:loadedData.versions;await api.setRef(id,{id,url:urlParseResult.url,...loadedData,...versions?{versions}:{},type:loadedData.storyIndex?"lazy":"auto-inject"})},getRefs:()=>{let{refs:refs2={}}=store2.getState();return refs2},setRef:(id,{storyIndex,setStoriesData,...rest},ready=!1)=>{if(singleStory)return;let{storyMapper=defaultStoryMapper}=provider.getConfig(),ref=api.getRefs()[id],index;setStoriesData?index=transformSetStoriesStoryDataToStoriesHash(map(setStoriesData,ref,{storyMapper}),{provider,docsOptions,filters:{},status:{}}):storyIndex&&(index=transformStoryIndexToStoriesHash(storyIndex,{provider,docsOptions,filters:{},status:{}})),index&&(index=addRefIds(index,ref)),api.updateRef(id,{index,...rest})},updateRef:(id,data)=>{let{[id]:ref,...updated}=api.getRefs();updated[id]={...ref,...data};let ordered=Object.keys(initialState).reduce((obj,key)=>(obj[key]=updated[key],obj),{});store2.setState({refs:ordered})}},refs=!singleStory&&import_global.global.REFS||{},initialState=refs;return runCheck&&Object.entries(refs).forEach(([id,ref])=>{api.checkRef({...ref,stories:{}})}),{api,state:{refs:initialState}}};var getEventMetadata=(context,fullAPI)=>{let{source,refId,type}=context,[sourceType,sourceLocation]=getSourceType(source,refId),ref=refId&&fullAPI.getRefs()[refId]?fullAPI.getRefs()[refId]:fullAPI.findRef(sourceLocation),meta={source,sourceType,sourceLocation,refId,ref,type};switch(!0){case typeof refId=="string":case sourceType==="local":case sourceType==="external":return meta;default:return import_client_logger2.logger.warn(`Received a ${type} frame that was not configured as a ref`),null}};var{FEATURES,fetch:fetch2}=import_global2.global,STORY_INDEX_PATH="./index.json",removedOptions=["enableShortcuts","theme","showRoots"];function removeRemovedOptions(options){if(!options||typeof options=="string")return options;let result={...options};return removedOptions.forEach(option=>{option in result&&delete result[option]}),result}var init7=({fullAPI,store:store2,navigate,provider,storyId:initialStoryId,viewMode:initialViewMode,docsOptions={}})=>{var _a;let api={storyId:import_csf2.toId,getData:(storyId,refId)=>{let result=api.resolveStory(storyId,refId);if((result==null?void 0:result.type)==="story"||(result==null?void 0:result.type)==="docs")return result},isPrepared:(storyId,refId)=>{let data=api.getData(storyId,refId);return data?data.type==="story"?data.prepared:!0:!1},resolveStory:(storyId,refId)=>{let{refs,index}=store2.getState();return refId&&!refs[refId]?null:refId?refs[refId].index?refs[refId].index[storyId]:void 0:index?index[storyId]:void 0},getCurrentStoryData:()=>{let{storyId,refId}=store2.getState();return api.getData(storyId,refId)},getParameters:(storyIdOrCombo,parameterName)=>{let{storyId,refId}=typeof storyIdOrCombo=="string"?{storyId:storyIdOrCombo,refId:void 0}:storyIdOrCombo,data=api.getData(storyId,refId);if(["story","docs"].includes(data==null?void 0:data.type)){let{parameters}=data;if(parameters)return parameterName?parameters[parameterName]:parameters}return null},getCurrentParameter:parameterName=>{let{storyId,refId}=store2.getState();return api.getParameters({storyId,refId},parameterName)||void 0},jumpToComponent:direction=>{let{index,storyId,refs,refId}=store2.getState();if(!api.getData(storyId,refId))return;let hash=refId?refs[refId].index||{}:index,result=api.findSiblingStoryId(storyId,hash,direction,!0);result&&api.selectStory(result,void 0,{ref:refId})},jumpToStory:direction=>{let{index,storyId,refs,refId}=store2.getState(),story=api.getData(storyId,refId);if(!story)return;let hash=story.refId?refs[story.refId].index:index,result=api.findSiblingStoryId(storyId,hash,direction,!1);result&&api.selectStory(result,void 0,{ref:refId})},selectFirstStory:()=>{let{index}=store2.getState(),firstStory=Object.keys(index).find(id=>index[id].type==="story");if(firstStory){api.selectStory(firstStory);return}navigate("/")},selectStory:(titleOrId=void 0,name=void 0,options={})=>{let{ref}=options,{storyId,index,refs}=store2.getState(),hash=ref?refs[ref].index:index,kindSlug=storyId==null?void 0:storyId.split("--",2)[0];if(name)if(titleOrId){let id=ref?`${ref}_${(0,import_csf2.toId)(titleOrId,name)}`:(0,import_csf2.toId)(titleOrId,name);if(hash[id])api.selectStory(id,void 0,options);else{let entry=hash[(0,import_csf2.sanitize)(titleOrId)];if((entry==null?void 0:entry.type)==="component"){let foundId=entry.children.find(childId=>hash[childId].name===name);foundId&&api.selectStory(foundId,void 0,options)}}}else{let id=(0,import_csf2.toId)(kindSlug,name);api.selectStory(id,void 0,options)}else{let entry=titleOrId?hash[titleOrId]||hash[(0,import_csf2.sanitize)(titleOrId)]:hash[kindSlug];if(!entry)throw new Error(`Unknown id or title: '${titleOrId}'`);store2.setState({settings:{...store2.getState().settings,lastTrackedStoryId:entry.id}});let leafEntry=api.findLeafEntry(hash,entry.id),fullId=leafEntry.refId?`${leafEntry.refId}_${leafEntry.id}`:leafEntry.id;navigate(`/${leafEntry.type}/${fullId}`)}},findLeafEntry(index,storyId){let entry=index[storyId];if(entry.type==="docs"||entry.type==="story")return entry;let childStoryId=entry.children[0];return api.findLeafEntry(index,childStoryId)},findLeafStoryId(index,storyId){var _a2;return(_a2=api.findLeafEntry(index,storyId))==null?void 0:_a2.id},findSiblingStoryId(storyId,index,direction,toSiblingGroup){if(toSiblingGroup){let lookupList2=getComponentLookupList(index),position2=lookupList2.findIndex(i=>i.includes(storyId));return position2===lookupList2.length-1&&direction>0||position2===0&&direction<0?void 0:lookupList2[position2+direction]?lookupList2[position2+direction][0]:void 0}let lookupList=getStoriesLookupList(index),position=lookupList.indexOf(storyId);if(!(position===lookupList.length-1&&direction>0)&&!(position===0&&direction<0))return lookupList[position+direction]},updateStoryArgs:(story,updatedArgs)=>{let{id:storyId,refId}=story;provider.channel.emit(import_core_events2.UPDATE_STORY_ARGS,{storyId,updatedArgs,options:{target:refId}})},resetStoryArgs:(story,argNames)=>{let{id:storyId,refId}=story;provider.channel.emit(import_core_events2.RESET_STORY_ARGS,{storyId,argNames,options:{target:refId}})},fetchIndex:async()=>{try{let result=await fetch2(STORY_INDEX_PATH);if(result.status!==200)throw new Error(await result.text());let storyIndex=await result.json();if(storyIndex.v<3){import_client_logger3.logger.warn(`Skipping story index with version v${storyIndex.v}, awaiting SET_STORIES.`);return}await api.setIndex(storyIndex)}catch(err){await store2.setState({indexError:err})}},setIndex:async input=>{let{index:oldHash,status,filters}=store2.getState(),newHash=transformStoryIndexToStoriesHash(input,{provider,docsOptions,status,filters}),output=addPreparedStories(newHash,oldHash);await store2.setState({internal_index:input,index:output,indexError:void 0})},updateStory:async(storyId,update2,ref)=>{if(ref){let{id:refId,index}=ref;index[storyId]={...index[storyId],...update2},await fullAPI.updateRef(refId,{index})}else{let{index}=store2.getState();index[storyId]={...index[storyId],...update2},await store2.setState({index})}},updateDocs:async(docsId,update2,ref)=>{if(ref){let{id:refId,index}=ref;index[docsId]={...index[docsId],...update2},await fullAPI.updateRef(refId,{index})}else{let{index}=store2.getState();index[docsId]={...index[docsId],...update2},await store2.setState({index})}},setPreviewInitialized:async ref=>{ref?fullAPI.updateRef(ref.id,{previewInitialized:!0}):store2.setState({previewInitialized:!0})},experimental_updateStatus:async(id,input)=>{let{status,internal_index:index}=store2.getState(),newStatus={...status},update2=typeof input=="function"?input(status):input;Object.keys(update2).length!==0&&(Object.entries(update2).forEach(([storyId,value])=>{newStatus[storyId]={...newStatus[storyId]||{}},value===null?delete newStatus[storyId][id]:newStatus[storyId][id]=value,Object.keys(newStatus[storyId]).length===0&&delete newStatus[storyId]}),await store2.setState({status:newStatus},{persistence:"session"}),index&&await api.setIndex(index))},experimental_setFilter:async(id,filterFunction)=>{let{internal_index:index}=store2.getState();await store2.setState({filters:{...store2.getState().filters,[id]:filterFunction}}),await api.setIndex(index)}};provider.channel.on(import_core_events2.STORY_SPECIFIED,function({storyId,viewMode}){let{sourceType}=getEventMetadata(this,fullAPI);if(sourceType==="local"){let state=store2.getState(),isCanvasRoute=state.path==="/"||state.viewMode==="story"||state.viewMode==="docs",stateHasSelection=state.viewMode&&state.storyId,stateSelectionDifferent=state.viewMode!==viewMode||state.storyId!==storyId,{type}=state.index[state.storyId]||{};isCanvasRoute&&(stateHasSelection&&stateSelectionDifferent&&!(type==="root"||type==="component"||type==="group")?provider.channel.emit(import_core_events2.SET_CURRENT_STORY,{storyId:state.storyId,viewMode:state.viewMode}):stateSelectionDifferent&&navigate(`/${viewMode}/${storyId}`))}}),provider.channel.on(import_core_events2.CURRENT_STORY_WAS_SET,function(){let{ref}=getEventMetadata(this,fullAPI);api.setPreviewInitialized(ref)}),provider.channel.on(import_core_events2.STORY_CHANGED,function(){let{sourceType}=getEventMetadata(this,fullAPI);if(sourceType==="local"){let options=api.getCurrentParameter("options");options&&fullAPI.setOptions(removeRemovedOptions(options))}}),provider.channel.on(import_core_events2.STORY_PREPARED,function({id,...update2}){let{ref,sourceType}=getEventMetadata(this,fullAPI);if(api.updateStory(id,{...update2,prepared:!0},ref),!ref&&!store2.getState().hasCalledSetOptions){let{options}=update2.parameters;fullAPI.setOptions(removeRemovedOptions(options)),store2.setState({hasCalledSetOptions:!0})}if(sourceType==="local"){let{storyId,index,refId}=store2.getState(),toBePreloaded=Array.from(new Set([api.findSiblingStoryId(storyId,index,1,!0),api.findSiblingStoryId(storyId,index,-1,!0)])).filter(Boolean);provider.channel.emit(import_core_events2.PRELOAD_ENTRIES,{ids:toBePreloaded,options:{target:refId}})}}),provider.channel.on(import_core_events2.DOCS_PREPARED,function({id,...update2}){let{ref}=getEventMetadata(this,fullAPI);api.updateStory(id,{...update2,prepared:!0},ref)}),provider.channel.on(import_core_events2.SET_INDEX,function(index){let{ref}=getEventMetadata(this,fullAPI);if(ref)fullAPI.setRef(ref.id,{...ref,storyIndex:index},!0);else{api.setIndex(index);let options=api.getCurrentParameter("options");fullAPI.setOptions(removeRemovedOptions(options))}}),provider.channel.on(import_core_events2.SET_STORIES,function(data){let{ref}=getEventMetadata(this,fullAPI),setStoriesData=data.v?denormalizeStoryParameters(data):data.stories;if(ref)fullAPI.setRef(ref.id,{...ref,setStoriesData},!0);else throw new Error("Cannot call SET_STORIES for local frame")}),provider.channel.on(import_core_events2.SELECT_STORY,function({kind,title=kind,story,name=story,storyId,...rest}){let{ref}=getEventMetadata(this,fullAPI);ref?fullAPI.selectStory(storyId||title,name,{...rest,ref:ref.id}):fullAPI.selectStory(storyId||title,name,rest)}),provider.channel.on(import_core_events2.STORY_ARGS_UPDATED,function({storyId,args}){let{ref}=getEventMetadata(this,fullAPI);api.updateStory(storyId,{args},ref)}),provider.channel.on(import_core_events2.CONFIG_ERROR,function(err){let{ref}=getEventMetadata(this,fullAPI);api.setPreviewInitialized(ref)}),provider.channel.on(import_core_events2.STORY_MISSING,function(err){let{ref}=getEventMetadata(this,fullAPI);api.setPreviewInitialized(ref)}),provider.channel.on(import_core_events2.SET_CONFIG,()=>{var _a2,_b;let config2=provider.getConfig();(_a2=config2==null?void 0:config2.sidebar)!=null&&_a2.filters&&store2.setState({filters:{...store2.getState().filters,...(_b=config2==null?void 0:config2.sidebar)==null?void 0:_b.filters}})});let config=provider.getConfig();return{api,state:{storyId:initialStoryId,viewMode:initialViewMode,hasCalledSetOptions:!1,previewInitialized:!1,status:{},filters:((_a=config==null?void 0:config.sidebar)==null?void 0:_a.filters)||{}},init:async()=>{FEATURES!=null&&FEATURES.storyStoreV7&&(provider.channel.on(import_core_events2.STORY_INDEX_INVALIDATED,()=>api.fetchIndex()),await api.fetchIndex())}}};var layout_exports={};__export(layout_exports,{ActiveTabs:()=>ActiveTabs,focusableUIElements:()=>focusableUIElements,init:()=>init8});var import_global3=require("@storybook/global"),import_pick=__toESM(require("lodash/pick.js")),import_dequal=require("dequal"),import_create=require("@storybook/theming/create"),import_core_events3=require("@storybook/core-events");var{document}=import_global3.global,ActiveTabs={SIDEBAR:"sidebar",CANVAS:"canvas",ADDONS:"addons"},defaultState={ui:{enableShortcuts:!0},layout:{initialActive:ActiveTabs.CANVAS,showToolbar:!0,isFullscreen:!1,showPanel:!0,showNav:!0,panelPosition:"bottom",showTabs:!0},selectedPanel:void 0,theme:(0,import_create.create)()},focusableUIElements={storySearchField:"storybook-explorer-searchfield",storyListMenu:"storybook-explorer-menu",storyPanelRoot:"storybook-panel-root"},init8=({store:store2,provider,singleStory,fullAPI})=>{let api={toggleFullscreen(toggled){return store2.setState(state=>{let{showNav}=state.layout,value=typeof toggled=="boolean"?toggled:!state.layout.isFullscreen,shouldShowNav=showNav===!1&&value===!1;return{layout:{...state.layout,isFullscreen:value,showNav:!singleStory&&shouldShowNav?!0:showNav}}},{persistence:"session"})},togglePanel(toggled){return store2.setState(state=>{let{showNav,isFullscreen}=state.layout,value=typeof toggled<"u"?toggled:!state.layout.showPanel,shouldToggleFullScreen=showNav===!1&&value===!1;return{layout:{...state.layout,showPanel:value,isFullscreen:shouldToggleFullScreen?!0:isFullscreen}}},{persistence:"session"})},togglePanelPosition(position){return typeof position<"u"?store2.setState(state=>({layout:{...state.layout,panelPosition:position}}),{persistence:"permanent"}):store2.setState(state=>({layout:{...state.layout,panelPosition:state.layout.panelPosition==="right"?"bottom":"right"}}),{persistence:"permanent"})},toggleNav(toggled){return store2.setState(state=>{if(singleStory)return{layout:state.layout};let{showPanel,isFullscreen}=state.layout,showNav=typeof toggled<"u"?toggled:!state.layout.showNav,shouldToggleFullScreen=showPanel===!1&&showNav===!1;return{layout:{...state.layout,showNav,isFullscreen:shouldToggleFullScreen?!0:!showNav&&isFullscreen}}},{persistence:"session"})},toggleToolbar(toggled){return store2.setState(state=>{let value=typeof toggled<"u"?toggled:!state.layout.showToolbar;return{layout:{...state.layout,showToolbar:value}}},{persistence:"session"})},resetLayout(){return store2.setState(state=>({layout:{...state.layout,showNav:!1,showPanel:!1,isFullscreen:!1}}),{persistence:"session"})},focusOnUIElement(elementId,select){if(!elementId)return;let element=document.getElementById(elementId);element&&(element.focus(),select&&element.select())},getInitialOptions(){let{theme,selectedPanel,...options}=provider.getConfig();return{...defaultState,layout:{...defaultState.layout,...(0,import_pick.default)(options,Object.keys(defaultState.layout)),...singleStory&&{showNav:!1}},ui:{...defaultState.ui,...(0,import_pick.default)(options,Object.keys(defaultState.ui))},selectedPanel:selectedPanel||defaultState.selectedPanel,theme:theme||defaultState.theme}},setOptions:options=>{let{layout,ui,selectedPanel,theme}=store2.getState();if(options){let updatedLayout={...layout,...options.layout,...(0,import_pick.default)(options,Object.keys(layout)),...singleStory&&{showNav:!1}},updatedUi={...ui,...options.ui,...(0,import_pick.default)(options,Object.keys(ui))},updatedTheme={...theme,...options.theme},modification={};(0,import_dequal.dequal)(ui,updatedUi)||(modification.ui=updatedUi),(0,import_dequal.dequal)(layout,updatedLayout)||(modification.layout=updatedLayout),options.selectedPanel&&!(0,import_dequal.dequal)(selectedPanel,options.selectedPanel)&&(modification.selectedPanel=options.selectedPanel),Object.keys(modification).length&&store2.setState(modification,{persistence:"permanent"}),(0,import_dequal.dequal)(theme,updatedTheme)||store2.setState({theme:updatedTheme})}}},persisted=(0,import_pick.default)(store2.getState(),"layout","selectedPanel");return{api,state:merge_default(api.getInitialOptions(),persisted),init:()=>{api.setOptions(merge_default(api.getInitialOptions(),persisted)),provider.channel.on(import_core_events3.SET_CONFIG,()=>{api.setOptions(merge_default(api.getInitialOptions(),persisted))})}}};var shortcuts_exports={};__export(shortcuts_exports,{controlOrMetaKey:()=>controlOrMetaKey2,defaultShortcuts:()=>defaultShortcuts,init:()=>init9,isMacLike:()=>isMacLike2,keys:()=>keys});var import_global5=require("@storybook/global"),import_core_events4=require("@storybook/core-events");var import_global4=require("@storybook/global"),{navigator}=import_global4.global,isMacLike=()=>navigator&&navigator.platform?!!navigator.platform.match(/(Mac|iPhone|iPod|iPad)/i):!1,controlOrMetaSymbol=()=>isMacLike()?"\u2318":"ctrl",controlOrMetaKey=()=>isMacLike()?"meta":"control",optionOrAltSymbol=()=>isMacLike()?"\u2325":"alt",isShortcutTaken=(arr1,arr2)=>JSON.stringify(arr1)===JSON.stringify(arr2),eventToShortcut=e=>{var _a;if(["Meta","Alt","Control","Shift"].includes(e.key))return null;let keys2=[];if(e.altKey&&keys2.push("alt"),e.ctrlKey&&keys2.push("control"),e.metaKey&&keys2.push("meta"),e.shiftKey&&keys2.push("shift"),e.key&&e.key.length===1&&e.key!==" "){let key=e.key.toUpperCase(),code=(_a=e.code)==null?void 0:_a.toUpperCase().replace("KEY","").replace("DIGIT","");code&&code.length===1&&code!==key?keys2.push([key,code]):keys2.push(key)}return e.key===" "&&keys2.push("space"),e.key==="Escape"&&keys2.push("escape"),e.key==="ArrowRight"&&keys2.push("ArrowRight"),e.key==="ArrowDown"&&keys2.push("ArrowDown"),e.key==="ArrowUp"&&keys2.push("ArrowUp"),e.key==="ArrowLeft"&&keys2.push("ArrowLeft"),keys2.length>0?keys2:null},shortcutMatchesShortcut=(inputShortcut,shortcut)=>!inputShortcut||!shortcut||(inputShortcut.join("").startsWith("shift/")&&inputShortcut.shift(),inputShortcut.length!==shortcut.length)?!1:!inputShortcut.find((input,i)=>Array.isArray(input)?!input.includes(shortcut[i]):input!==shortcut[i]),eventMatchesShortcut=(e,shortcut)=>shortcutMatchesShortcut(eventToShortcut(e),shortcut),keyToSymbol=key=>key==="alt"?optionOrAltSymbol():key==="control"?"\u2303":key==="meta"?"\u2318":key==="shift"?"\u21E7\u200B":key==="Enter"||key==="Backspace"||key==="Esc"||key==="escape"?"":key===" "?"SPACE":key==="ArrowUp"?"\u2191":key==="ArrowDown"?"\u2193":key==="ArrowLeft"?"\u2190":key==="ArrowRight"?"\u2192":key.toUpperCase(),shortcutToHumanString=shortcut=>shortcut.map(keyToSymbol).join(" ");var{navigator:navigator2,document:document2}=import_global5.global,isMacLike2=()=>navigator2&&navigator2.platform?!!navigator2.platform.match(/(Mac|iPhone|iPod|iPad)/i):!1,controlOrMetaKey2=()=>isMacLike2()?"meta":"control";function keys(o){return Object.keys(o)}var defaultShortcuts=Object.freeze({fullScreen:["F"],togglePanel:["A"],panelPosition:["D"],toggleNav:["S"],toolbar:["T"],search:["/"],focusNav:["1"],focusIframe:["2"],focusPanel:["3"],prevComponent:["alt","ArrowUp"],nextComponent:["alt","ArrowDown"],prevStory:["alt","ArrowLeft"],nextStory:["alt","ArrowRight"],shortcutsPage:[controlOrMetaKey2(),"shift",","],aboutPage:[","],escape:["escape"],collapseAll:[controlOrMetaKey2(),"shift","ArrowUp"],expandAll:[controlOrMetaKey2(),"shift","ArrowDown"],remount:["alt","R"]}),addonsShortcuts={};function focusInInput(event){let target=event.target;return/input|textarea/i.test(target.tagName)||target.getAttribute("contenteditable")!==null}var init9=({store:store2,fullAPI,provider})=>{let api={getShortcutKeys(){return store2.getState().shortcuts},getDefaultShortcuts(){return{...defaultShortcuts,...api.getAddonsShortcutDefaults()}},getAddonsShortcuts(){return addonsShortcuts},getAddonsShortcutLabels(){let labels={};return Object.entries(api.getAddonsShortcuts()).forEach(([actionName,{label}])=>{labels[actionName]=label}),labels},getAddonsShortcutDefaults(){let defaults={};return Object.entries(api.getAddonsShortcuts()).forEach(([actionName,{defaultShortcut}])=>{defaults[actionName]=defaultShortcut}),defaults},async setShortcuts(shortcuts){return await store2.setState({shortcuts},{persistence:"permanent"}),shortcuts},async restoreAllDefaultShortcuts(){return api.setShortcuts(api.getDefaultShortcuts())},async setShortcut(action,value){let shortcuts=api.getShortcutKeys();return await api.setShortcuts({...shortcuts,[action]:value}),value},async setAddonShortcut(addon,shortcut){let shortcuts=api.getShortcutKeys();return await api.setShortcuts({...shortcuts,[`${addon}-${shortcut.actionName}`]:shortcut.defaultShortcut}),addonsShortcuts[`${addon}-${shortcut.actionName}`]=shortcut,shortcut},async restoreDefaultShortcut(action){let defaultShortcut=api.getDefaultShortcuts()[action];return api.setShortcut(action,defaultShortcut)},handleKeydownEvent(event){let shortcut=eventToShortcut(event),shortcuts=api.getShortcutKeys(),matchedFeature=keys(shortcuts).find(feature=>shortcutMatchesShortcut(shortcut,shortcuts[feature]));matchedFeature&&api.handleShortcutFeature(matchedFeature,event)},handleShortcutFeature(feature,event){let{layout:{isFullscreen,showNav,showPanel},ui:{enableShortcuts},storyId}=store2.getState();if(enableShortcuts)switch(event!=null&&event.preventDefault&&event.preventDefault(),feature){case"escape":{isFullscreen?fullAPI.toggleFullscreen():showNav||fullAPI.toggleNav();break}case"focusNav":{isFullscreen&&fullAPI.toggleFullscreen(),showNav||fullAPI.toggleNav(),fullAPI.focusOnUIElement(focusableUIElements.storyListMenu);break}case"search":{isFullscreen&&fullAPI.toggleFullscreen(),showNav||fullAPI.toggleNav(),setTimeout(()=>{fullAPI.focusOnUIElement(focusableUIElements.storySearchField,!0)},0);break}case"focusIframe":{let element=document2.getElementById("storybook-preview-iframe");if(element)try{element.contentWindow.focus()}catch{}break}case"focusPanel":{isFullscreen&&fullAPI.toggleFullscreen(),showPanel||fullAPI.togglePanel(),fullAPI.focusOnUIElement(focusableUIElements.storyPanelRoot);break}case"nextStory":{fullAPI.jumpToStory(1);break}case"prevStory":{fullAPI.jumpToStory(-1);break}case"nextComponent":{fullAPI.jumpToComponent(1);break}case"prevComponent":{fullAPI.jumpToComponent(-1);break}case"fullScreen":{fullAPI.toggleFullscreen();break}case"togglePanel":{isFullscreen&&(fullAPI.toggleFullscreen(),fullAPI.resetLayout()),fullAPI.togglePanel();break}case"toggleNav":{isFullscreen&&(fullAPI.toggleFullscreen(),fullAPI.resetLayout()),fullAPI.toggleNav();break}case"toolbar":{fullAPI.toggleToolbar();break}case"panelPosition":{isFullscreen&&fullAPI.toggleFullscreen(),showPanel||fullAPI.togglePanel(),fullAPI.togglePanelPosition();break}case"aboutPage":{fullAPI.navigate("/settings/about");break}case"shortcutsPage":{fullAPI.navigate("/settings/shortcuts");break}case"collapseAll":{fullAPI.collapseAll();break}case"expandAll":{fullAPI.expandAll();break}case"remount":{fullAPI.emit(import_core_events4.FORCE_REMOUNT,{storyId});break}default:addonsShortcuts[feature].action();break}}},{shortcuts:persistedShortcuts=defaultShortcuts}=store2.getState(),state={shortcuts:keys(defaultShortcuts).reduce((acc,key)=>({...acc,[key]:persistedShortcuts[key]||defaultShortcuts[key]}),defaultShortcuts)};return{api,state,init:()=>{document2.addEventListener("keydown",event=>{focusInInput(event)||api.handleKeydownEvent(event)}),provider.channel.on(import_core_events4.PREVIEW_KEYDOWN,data=>{api.handleKeydownEvent(data.event)})}}};var url_exports={};__export(url_exports,{init:()=>init10});var import_core_events5=require("@storybook/core-events"),import_router=require("@storybook/router"),import_dequal2=require("dequal"),import_global6=require("@storybook/global"),{window:globalWindow}=import_global6.global,parseBoolean=value=>{if(value==="true"||value==="1")return!0;if(value==="false"||value==="0")return!1},prevParams,initialUrlSupport=({state:{location:location2,path,viewMode,storyId:storyIdFromUrl},singleStory})=>{let{full,panel,nav,shortcuts,addonPanel,tabs,path:queryPath,...otherParams}=(0,import_router.queryFromLocation)(location2),layout={isFullscreen:parseBoolean(full),showNav:!singleStory&&parseBoolean(nav),showPanel:parseBoolean(panel),panelPosition:["right","bottom"].includes(panel)?panel:void 0,showTabs:parseBoolean(tabs)},ui={enableShortcuts:parseBoolean(shortcuts)},selectedPanel=addonPanel||void 0,storyId=storyIdFromUrl,customQueryParams=(0,import_dequal2.dequal)(prevParams,otherParams)?prevParams:otherParams;return prevParams=customQueryParams,{viewMode,layout,ui,selectedPanel,location:location2,path,customQueryParams,storyId}},init10=moduleArgs=>{let{store:store2,navigate,provider,fullAPI}=moduleArgs,navigateTo=(path,queryParams={},options={})=>{let params=Object.entries(queryParams).filter(([,v])=>v).sort(([a],[b])=>a<b?-1:1).map(([k,v])=>`${k}=${v}`),to=[path,...params].join("&");return navigate(to,options)},api={getQueryParam(key){let{customQueryParams}=store2.getState();return customQueryParams?customQueryParams[key]:void 0},getUrlState(){let{path,customQueryParams,storyId,url,viewMode}=store2.getState();return{path,queryParams:customQueryParams,storyId,url,viewMode}},setQueryParams(input){let{customQueryParams}=store2.getState(),queryParams={},update2={...customQueryParams,...Object.entries(input).reduce((acc,[key,value])=>(value!==null&&(acc[key]=value),acc),queryParams)};(0,import_dequal2.dequal)(customQueryParams,update2)||(store2.setState({customQueryParams:update2}),provider.channel.emit(import_core_events5.UPDATE_QUERY_PARAMS,update2))},navigateUrl(url,options){navigate(url,{plain:!0,...options})}},updateArgsParam=()=>{let{path,queryParams,viewMode}=api.getUrlState();if(viewMode!=="story")return;let currentStory=fullAPI.getCurrentStoryData();if((currentStory==null?void 0:currentStory.type)!=="story")return;let{args,initialArgs}=currentStory,argsString=(0,import_router.buildArgsParam)(initialArgs,args);navigateTo(path,{...queryParams,args:argsString},{replace:!0}),api.setQueryParams({args:argsString})};provider.channel.on(import_core_events5.SET_CURRENT_STORY,()=>updateArgsParam());let handleOrId;return provider.channel.on(import_core_events5.STORY_ARGS_UPDATED,()=>{"requestIdleCallback"in globalWindow?(handleOrId&&globalWindow.cancelIdleCallback(handleOrId),handleOrId=globalWindow.requestIdleCallback(updateArgsParam,{timeout:1e3})):(handleOrId&&clearTimeout(handleOrId),setTimeout(updateArgsParam,100))}),provider.channel.on(import_core_events5.GLOBALS_UPDATED,({globals,initialGlobals})=>{let{path,queryParams}=api.getUrlState(),globalsString=(0,import_router.buildArgsParam)(initialGlobals,globals);navigateTo(path,{...queryParams,globals:globalsString},{replace:!0}),api.setQueryParams({globals:globalsString})}),provider.channel.on(import_core_events5.NAVIGATE_URL,(url,options)=>{api.navigateUrl(url,options)}),{api,state:initialUrlSupport(moduleArgs)}};var versions_exports={};__export(versions_exports,{init:()=>init11});var import_global7=require("@storybook/global"),import_semver=__toESM(require_semver2()),import_memoizerific2=__toESM(require("memoizerific"));var version="7.6.17";var{VERSIONCHECK}=import_global7.global,getVersionCheckData=(0,import_memoizerific2.default)(1)(()=>{try{return{...JSON.parse(VERSIONCHECK).data||{}}}catch{return{}}}),init11=({store:store2})=>{let{dismissedVersionNotification}=store2.getState(),state={versions:{current:{version},...getVersionCheckData()},dismissedVersionNotification},api={getCurrentVersion:()=>{let{versions:{current}}=store2.getState();return current},getLatestVersion:()=>{let{versions:{latest,next,current}}=store2.getState();return current&&import_semver.default.prerelease(current.version)&&next?latest&&import_semver.default.gt(latest.version,next.version)?latest:next:latest},versionUpdateAvailable:()=>{let latest=api.getLatestVersion(),current=api.getCurrentVersion();if(latest){if(!latest.version||!current.version)return!0;let actualCurrent=!!import_semver.default.prerelease(current.version)?`${import_semver.default.major(current.version)}.${import_semver.default.minor(current.version)}.${import_semver.default.patch(current.version)}`:current.version,diff=import_semver.default.diff(actualCurrent,latest.version);return import_semver.default.gt(latest.version,actualCurrent)&&diff!=="patch"&&!diff.includes("pre")}return!1}};return{init:async()=>{let{versions={}}=store2.getState(),{latest,next}=getVersionCheckData();await store2.setState({versions:{...versions,latest,next}})},state,api}};var whatsnew_exports={};__export(whatsnew_exports,{init:()=>init12});var import_global8=require("@storybook/global"),import_core_events6=require("@storybook/core-events"),WHATS_NEW_NOTIFICATION_ID="whats-new",init12=({fullAPI,store:store2,provider})=>{let state={whatsNewData:void 0};function setWhatsNewState(newState){store2.setState({whatsNewData:newState}),state.whatsNewData=newState}let api={isWhatsNewUnread(){var _a;return((_a=state.whatsNewData)==null?void 0:_a.status)==="SUCCESS"&&!state.whatsNewData.postIsRead},whatsNewHasBeenRead(){var _a;((_a=state.whatsNewData)==null?void 0:_a.status)==="SUCCESS"&&(setWhatsNewCache({lastReadPost:state.whatsNewData.url}),setWhatsNewState({...state.whatsNewData,postIsRead:!0}),fullAPI.clearNotification(WHATS_NEW_NOTIFICATION_ID))},toggleWhatsNewNotifications(){var _a;((_a=state.whatsNewData)==null?void 0:_a.status)==="SUCCESS"&&(setWhatsNewState({...state.whatsNewData,disableWhatsNewNotifications:!state.whatsNewData.disableWhatsNewNotifications}),provider.channel.emit(import_core_events6.TOGGLE_WHATS_NEW_NOTIFICATIONS,{disableWhatsNewNotifications:state.whatsNewData.disableWhatsNewNotifications}))}};function getLatestWhatsNewPost(){return provider.channel.emit(import_core_events6.REQUEST_WHATS_NEW_DATA),new Promise(resolve=>provider.channel.once(import_core_events6.RESULT_WHATS_NEW_DATA,({data})=>resolve(data)))}function setWhatsNewCache(cache){provider.channel.emit(import_core_events6.SET_WHATS_NEW_CACHE,cache)}return{init:async()=>{var _a;if(import_global8.global.CONFIG_TYPE!=="DEVELOPMENT")return;let whatsNewData=await getLatestWhatsNewPost();setWhatsNewState(whatsNewData);let urlState=fullAPI.getUrlState();!((urlState==null?void 0:urlState.path)==="/onboarding"||((_a=urlState.queryParams)==null?void 0:_a.onboarding)==="true")&&whatsNewData.status==="SUCCESS"&&!whatsNewData.disableWhatsNewNotifications&&whatsNewData.showNotification&&fullAPI.addNotification({id:WHATS_NEW_NOTIFICATION_ID,link:"/settings/whats-new",content:{headline:whatsNewData.excerpt,subHeadline:"Click to learn what's new in Storybook"},icon:{name:"hearthollow"},onClear({dismissed}){dismissed&&setWhatsNewCache({lastDismissedPost:whatsNewData.url})}})},state,api}};var globals_exports={};__export(globals_exports,{init:()=>init13});var import_core_events7=require("@storybook/core-events"),import_client_logger4=require("@storybook/client-logger"),import_dequal3=require("dequal");var init13=({store:store2,fullAPI,provider})=>{let api={getGlobals(){return store2.getState().globals},getGlobalTypes(){return store2.getState().globalTypes},updateGlobals(newGlobals){provider.channel.emit(import_core_events7.UPDATE_GLOBALS,{globals:newGlobals,options:{target:"storybook-preview-iframe"}})}},state={globals:{},globalTypes:{}},updateGlobals=globals=>{var _a;let currentGlobals=(_a=store2.getState())==null?void 0:_a.globals;(0,import_dequal3.dequal)(globals,currentGlobals)||store2.setState({globals})};return provider.channel.on(import_core_events7.GLOBALS_UPDATED,function({globals}){let{ref}=getEventMetadata(this,fullAPI);ref?import_client_logger4.logger.warn("received a GLOBALS_UPDATED from a non-local ref. This is not currently supported."):updateGlobals(globals)}),provider.channel.on(import_core_events7.SET_GLOBALS,function({globals,globalTypes}){var _a;let{ref}=getEventMetadata(this,fullAPI),currentGlobals=(_a=store2.getState())==null?void 0:_a.globals;ref?Object.keys(globals).length>0&&import_client_logger4.logger.warn("received globals from a non-local ref. This is not currently supported."):store2.setState({globals,globalTypes}),currentGlobals&&Object.keys(currentGlobals).length!==0&&!(0,import_dequal3.dequal)(globals,currentGlobals)&&api.updateGlobals(currentGlobals)}),{api,state}};var import_global9=require("@storybook/global"),import_core_events8=require("@storybook/core-events"),import_types2=require("@storybook/types"),import_client_logger5=require("@storybook/client-logger");var import_channels=require("@storybook/channels");function mockChannel(){let transport={setHandler:()=>{},send:()=>{}};return new import_channels.Channel({transport})}var AddonStore=class{constructor(){this.loaders={};this.elements={};this.config={};this.getChannel=()=>(this.channel||this.setChannel(mockChannel()),this.channel);this.getServerChannel=()=>{if(!this.serverChannel)throw new Error("Accessing non-existent serverChannel");return this.serverChannel};this.ready=()=>this.promise;this.hasChannel=()=>!!this.channel;this.hasServerChannel=()=>!!this.serverChannel;this.setChannel=channel=>{this.channel=channel,this.resolve()};this.setServerChannel=channel=>{this.serverChannel=channel};this.addPanel=(id,options)=>{this.add(id,{type:import_types2.Addon_TypesEnum.PANEL,...options})};this.setConfig=value=>{Object.assign(this.config,value),this.hasChannel()?this.getChannel().emit(import_core_events8.SET_CONFIG,this.config):this.ready().then(channel=>{channel.emit(import_core_events8.SET_CONFIG,this.config)})};this.getConfig=()=>this.config;this.register=(id,callback)=>{this.loaders[id]&&import_client_logger5.logger.warn(`${id} was loaded twice, this could have bad side-effects`),this.loaders[id]=callback};this.loadAddons=api=>{Object.values(this.loaders).forEach(value=>value(api))};this.promise=new Promise(res=>{this.resolve=()=>res(this.getChannel())})}getElements(type){return this.elements[type]||(this.elements[type]={}),this.elements[type]}add(id,addon){let{type}=addon,collection=this.getElements(type);collection[id]={id,...addon}}},KEY="__STORYBOOK_ADDONS_MANAGER";function getAddonsStore(){return import_global9.global[KEY]||(import_global9.global[KEY]=new AddonStore),import_global9.global[KEY]}var addons=getAddonsStore();var{ActiveTabs:ActiveTabs2}=layout_exports;var ManagerContext=createContext({api:void 0,state:initial_state_default({})}),combineParameters=(...parameterSets)=>(0,import_mergeWith2.default)({},...parameterSets,(objValue,srcValue)=>{if(Array.isArray(srcValue))return srcValue}),ManagerProvider=class extends import_react2.Component{constructor(props){super(props);this.api={};this.initModules=()=>{this.modules.forEach(module2=>{"init"in module2&&module2.init()})};let{location:location2,path,refId,viewMode=props.docsOptions.docsMode?"docs":props.viewMode,singleStory,storyId,docsOptions,navigate}=props,store2=new Store({getState:()=>this.state,setState:(stateChange,callback)=>this.setState(stateChange,callback)}),routeData={location:location2,path,viewMode,singleStory,storyId,refId},optionsData={docsOptions};this.state=store2.getInitialState(initial_state_default({...routeData,...optionsData}));let apiData={navigate,store:store2,provider:props.provider};this.modules=[provider_exports,channel_exports,addons_exports,layout_exports,notifications_exports,settings_exports,shortcuts_exports,stories_exports,refs_exports,globals_exports,url_exports,versions_exports,whatsnew_exports].map(m=>m.init({...routeData,...optionsData,...apiData,state:this.state,fullAPI:this.api}));let state=initial_state_default(this.state,...this.modules.map(m=>m.state)),api=Object.assign(this.api,{navigate},...this.modules.map(m=>m.api));this.state=state,this.api=api}static getDerivedStateFromProps(props,state){return state.path!==props.path?{...state,location:props.location,path:props.path,refId:props.refId,viewMode:props.viewMode,storyId:props.storyId}:null}shouldComponentUpdate(nextProps,nextState){let prevState=this.state,prevProps=this.props;return prevState!==nextState||prevProps.path!==nextProps.path}render(){let{children}=this.props,value={state:this.state,api:this.api};return import_react2.default.createElement(EffectOnMount,{effect:this.initModules},import_react2.default.createElement(ManagerContext.Provider,{value},import_react2.default.createElement(ManagerConsumer,null,children)))}};ManagerProvider.displayName="Manager";var EffectOnMount=({children,effect})=>(import_react2.default.useEffect(effect,[]),children),defaultFilter=c=>c;function ManagerConsumer({filter=defaultFilter,children}){let c=(0,import_react2.useContext)(ManagerContext),renderer=(0,import_react2.useRef)(children),filterer=(0,import_react2.useRef)(filter);if(typeof renderer.current!="function")return import_react2.default.createElement(import_react2.Fragment,null,renderer.current);let data=filterer.current(c),l=(0,import_react2.useMemo)(()=>[...Object.entries(data).reduce((acc,keyval)=>acc.concat(keyval),[])],[c.state]);return(0,import_react2.useMemo)(()=>{let Child=renderer.current;return import_react2.default.createElement(Child,{...data})},l)}function useStorybookState(){let{state}=(0,import_react2.useContext)(ManagerContext);return{...state,get storiesHash(){return(0,import_client_logger6.deprecate)("state.storiesHash is deprecated, please use state.index"),this.index||{}},get storiesConfigured(){return(0,import_client_logger6.deprecate)("state.storiesConfigured is deprecated, please use state.previewInitialized"),this.previewInitialized},get storiesFailed(){return(0,import_client_logger6.deprecate)("state.storiesFailed is deprecated, please use state.indexError"),this.indexError}}}function useStorybookApi(){let{api}=(0,import_react2.useContext)(ManagerContext);return api}function orDefault(fromStore,defaultState2){return typeof fromStore>"u"?defaultState2:fromStore}var useChannel=(eventMap,deps=[])=>{let api=useStorybookApi();return(0,import_react2.useEffect)(()=>(Object.entries(eventMap).forEach(([type,listener])=>api.on(type,listener)),()=>{Object.entries(eventMap).forEach(([type,listener])=>api.off(type,listener))}),deps),api.emit};function useStoryPrepared(storyId){return useStorybookApi().isPrepared(storyId)}function useParameter(parameterKey,defaultValue){let result=useStorybookApi().getCurrentParameter(parameterKey);return orDefault(result,defaultValue)}globalThis.STORYBOOK_ADDON_STATE={};var{STORYBOOK_ADDON_STATE}=globalThis;function useSharedState(stateId,defaultState2){let api=useStorybookApi(),existingState=api.getAddonState(stateId)||STORYBOOK_ADDON_STATE[stateId],state=orDefault(existingState,STORYBOOK_ADDON_STATE[stateId]?STORYBOOK_ADDON_STATE[stateId]:defaultState2),quicksync=!1;state===defaultState2&&defaultState2!==void 0&&(STORYBOOK_ADDON_STATE[stateId]=defaultState2,quicksync=!0),(0,import_react2.useEffect)(()=>{quicksync&&api.setAddonState(stateId,defaultState2)},[quicksync]);let setState=async(s,options)=>{let result=await api.setAddonState(stateId,s,options);return STORYBOOK_ADDON_STATE[stateId]=result,result},allListeners=(0,import_react2.useMemo)(()=>{let stateChangeHandlers={[`${import_core_events9.SHARED_STATE_CHANGED}-client-${stateId}`]:setState,[`${import_core_events9.SHARED_STATE_SET}-client-${stateId}`]:setState},stateInitializationHandlers={[import_core_events9.SET_STORIES]:async()=>{let currentState=api.getAddonState(stateId);currentState?(STORYBOOK_ADDON_STATE[stateId]=currentState,api.emit(`${import_core_events9.SHARED_STATE_SET}-manager-${stateId}`,currentState)):STORYBOOK_ADDON_STATE[stateId]?(await setState(STORYBOOK_ADDON_STATE[stateId]),api.emit(`${import_core_events9.SHARED_STATE_SET}-manager-${stateId}`,STORYBOOK_ADDON_STATE[stateId])):defaultState2!==void 0&&(await setState(defaultState2),STORYBOOK_ADDON_STATE[stateId]=defaultState2,api.emit(`${import_core_events9.SHARED_STATE_SET}-manager-${stateId}`,defaultState2))},[import_core_events9.STORY_CHANGED]:()=>{let currentState=api.getAddonState(stateId);currentState!==void 0&&api.emit(`${import_core_events9.SHARED_STATE_SET}-manager-${stateId}`,currentState)}};return{...stateChangeHandlers,...stateInitializationHandlers}},[stateId]),emit=useChannel(allListeners);return[state,async(newStateOrMerger,options)=>{let result=await setState(newStateOrMerger,options);emit(`${import_core_events9.SHARED_STATE_CHANGED}-manager-${stateId}`,result)}]}function useAddonState(addonId,defaultState2){return useSharedState(addonId,defaultState2)}function useArgs(){let{getCurrentStoryData,updateStoryArgs,resetStoryArgs}=useStorybookApi(),data=getCurrentStoryData(),args=(data==null?void 0:data.type)==="story"?data.args:{},updateArgs=(0,import_react2.useCallback)(newArgs=>updateStoryArgs(data,newArgs),[data,updateStoryArgs]),resetArgs=(0,import_react2.useCallback)(argNames=>resetStoryArgs(data,argNames),[data,resetStoryArgs]);return[args,updateArgs,resetArgs]}function useGlobals(){let api=useStorybookApi();return[api.getGlobals(),api.updateGlobals]}function useGlobalTypes(){return useStorybookApi().getGlobalTypes()}function useCurrentStory(){let{getCurrentStoryData}=useStorybookApi();return getCurrentStoryData()}function useArgTypes(){let current=useCurrentStory();return(current==null?void 0:current.type)==="story"&&current.argTypes||{}}var typesX=import_types2.Addon_TypesEnum;0&&(module.exports={ActiveTabs,Consumer,ManagerContext,Provider,addons,combineParameters,controlOrMetaKey,controlOrMetaSymbol,eventMatchesShortcut,eventToShortcut,isMacLike,isShortcutTaken,keyToSymbol,merge,mockChannel,optionOrAltSymbol,shortcutMatchesShortcut,shortcutToHumanString,types,useAddonState,useArgTypes,useArgs,useChannel,useGlobalTypes,useGlobals,useParameter,useSharedState,useStoryPrepared,useStorybookApi,useStorybookState});