Anvil/sb-manager/chunk-VFHDXWEA.js

407 lines
831 KiB
JavaScript
Raw Normal View History

2024-02-23 14:08:28 +01:00
import{ActionBar,ScrollArea,SyntaxHighlighter2,createCopyToClipboardFunction}from"./chunk-LVLAH4SI.js";import{WithToolTipState,auto}from"./chunk-CXYKRFSY.js";import{Global,ThemeProvider,color,create,createGlobal,deprecate,ensure,ignoreSsrWarning,isPropValid,keyframes,logger,newStyled,once,pretty,require_ReactPropTypesSecret,require_checkPropTypes,require_has,require_object_assign,require_react,require_react_dom,scope,typography,useTheme,withTheme}from"./chunk-4IYAVH3S.js";import{__commonJS,__esm,__export,__toCommonJS,__toESM,require_memoizerific}from"./chunk-ZEU7PDD3.js";var require_shams=__commonJS({"../../node_modules/has-symbols/shams.js"(exports,module){"use strict";module.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var obj={},sym=Symbol("test"),symObj=Object(sym);if(typeof sym=="string"||Object.prototype.toString.call(sym)!=="[object Symbol]"||Object.prototype.toString.call(symObj)!=="[object Symbol]")return!1;var symVal=42;obj[sym]=symVal;for(sym in obj)return!1;if(typeof Object.keys=="function"&&Object.keys(obj).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(obj).length!==0)return!1;var syms=Object.getOwnPropertySymbols(obj);if(syms.length!==1||syms[0]!==sym||!Object.prototype.propertyIsEnumerable.call(obj,sym))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var descriptor=Object.getOwnPropertyDescriptor(obj,sym);if(descriptor.value!==symVal||descriptor.enumerable!==!0)return!1}return!0}}});var require_has_symbols=__commonJS({"../../node_modules/has-symbols/index.js"(exports,module){"use strict";var origSymbol=typeof Symbol<"u"&&Symbol,hasSymbolSham=require_shams();module.exports=function(){return typeof origSymbol!="function"||typeof Symbol!="function"||typeof origSymbol("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:hasSymbolSham()}}});var require_has_proto=__commonJS({"../../node_modules/has-proto/index.js"(exports,module){"use strict";var test={foo:{}},$Object=Object;module.exports=function(){return{__proto__:test}.foo===test.foo&&!({__proto__:null}instanceof $Object)}}});var require_implementation=__commonJS({"../../node_modules/function-bind/implementation.js"(exports,module){"use strict";var ERROR_MESSAGE="Function.prototype.bind called on incompatible ",toStr=Object.prototype.toString,max=Math.max,funcType="[object Function]",concatty=function(a2,b3){for(var arr=[],i3=0;i3<a2.length;i3+=1)arr[i3]=a2[i3];for(var j2=0;j2<b3.length;j2+=1)arr[j2+a2.length]=b3[j2];return arr},slicy=function(arrLike,offset){for(var arr=[],i3=offset||0,j2=0;i3<arrLike.length;i3+=1,j2+=1)arr[j2]=arrLike[i3];return arr},joiny=function(arr,joiner){for(var str="",i3=0;i3<arr.length;i3+=1)str+=arr[i3],i3+1<arr.length&&(str+=joiner);return str};module.exports=function(that){var target=this;if(typeof target!="function"||toStr.apply(target)!==funcType)throw new TypeError(ERROR_MESSAGE+target);for(var args2=slicy(arguments,1),bound,binder=function(){if(this instanceof bound){var result2=target.apply(this,concatty(args2,arguments));return Object(result2)===result2?result2:this}return target.apply(that,concatty(args2,arguments))},boundLength=max(0,target.length-args2.length),boundArgs=[],i3=0;i3<boundLength;i3++)boundArgs[i3]="$"+i3;if(bound=Function("binder","return function ("+joiny(boundArgs,",")+"){ return binder.apply(this,arguments); }")(binder),target.prototype){var Empty=function(){};Empty.prototype=target.prototype,bound.prototype=new Empty,Empty.prototype=null}return bound}}});var require_function_bind=__commonJS({"../../node_modules/function-bind/index.js"(exports,module){"use strict";var implementation=require_implementation();module.exports=Function.prototype.bind||implementation}});var require_src=__commonJS({"../../node_modules/has/src/index.js"(exports,module){"use strict";var hasOwnProperty6={}.hasOwnProperty,call=Function.prototype.call;module.exports=call.bind?call.bind(hasOwnProperty6):function(O2,P3){return call.call(hasOwnProperty6,O2,P3)}}});var require
2024-02-08 10:52:22 +01:00
`)>=0)return!1;return!0}function getIndent(opts,depth){var baseIndent;if(opts.indent===" ")baseIndent=" ";else if(typeof opts.indent=="number"&&opts.indent>0)baseIndent=$join.call(Array(opts.indent+1)," ");else return null;return{base:baseIndent,prev:$join.call(Array(depth+1),baseIndent)}}function indentedJoin(xs,indent){if(xs.length===0)return"";var lineJoiner=`
`+indent.prev+indent.base;return lineJoiner+$join.call(xs,","+lineJoiner)+`
`+indent.prev}function arrObjKeys(obj,inspect){var isArr=isArray2(obj),xs=[];if(isArr){xs.length=obj.length;for(var i3=0;i3<obj.length;i3++)xs[i3]=has3(obj,i3)?inspect(obj[i3],obj):""}var syms=typeof gOPS=="function"?gOPS(obj):[],symMap;if(hasShammedSymbols){symMap={};for(var k2=0;k2<syms.length;k2++)symMap["$"+syms[k2]]=syms[k2]}for(var key2 in obj)has3(obj,key2)&&(isArr&&String(Number(key2))===key2&&key2<obj.length||hasShammedSymbols&&symMap["$"+key2]instanceof Symbol||($test.call(/[^\w$]/,key2)?xs.push(inspect(key2,obj)+": "+inspect(obj[key2],obj)):xs.push(key2+": "+inspect(obj[key2],obj))));if(typeof gOPS=="function")for(var j2=0;j2<syms.length;j2++)isEnumerable.call(obj,syms[j2])&&xs.push("["+inspect(syms[j2])+"]: "+inspect(obj[syms[j2]],obj));return xs}}});var require_side_channel=__commonJS({"../../node_modules/side-channel/index.js"(exports,module){"use strict";var GetIntrinsic=require_get_intrinsic(),callBound=require_callBound(),inspect=require_object_inspect(),$TypeError=GetIntrinsic("%TypeError%"),$WeakMap=GetIntrinsic("%WeakMap%",!0),$Map=GetIntrinsic("%Map%",!0),$weakMapGet=callBound("WeakMap.prototype.get",!0),$weakMapSet=callBound("WeakMap.prototype.set",!0),$weakMapHas=callBound("WeakMap.prototype.has",!0),$mapGet=callBound("Map.prototype.get",!0),$mapSet=callBound("Map.prototype.set",!0),$mapHas=callBound("Map.prototype.has",!0),listGetNode=function(list,key2){for(var prev=list,curr;(curr=prev.next)!==null;prev=curr)if(curr.key===key2)return prev.next=curr.next,curr.next=list.next,list.next=curr,curr},listGet=function(objects,key2){var node=listGetNode(objects,key2);return node&&node.value},listSet=function(objects,key2,value2){var node=listGetNode(objects,key2);node?node.value=value2:objects.next={key:key2,next:objects.next,value:value2}},listHas=function(objects,key2){return!!listGetNode(objects,key2)};module.exports=function(){var $wm,$m,$o,channel={assert:function(key2){if(!channel.has(key2))throw new $TypeError("Side channel does not contain "+inspect(key2))},get:function(key2){if($WeakMap&&key2&&(typeof key2=="object"||typeof key2=="function")){if($wm)return $weakMapGet($wm,key2)}else if($Map){if($m)return $mapGet($m,key2)}else if($o)return listGet($o,key2)},has:function(key2){if($WeakMap&&key2&&(typeof key2=="object"||typeof key2=="function")){if($wm)return $weakMapHas($wm,key2)}else if($Map){if($m)return $mapHas($m,key2)}else if($o)return listHas($o,key2);return!1},set:function(key2,value2){$WeakMap&&key2&&(typeof key2=="object"||typeof key2=="function")?($wm||($wm=new $WeakMap),$weakMapSet($wm,key2,value2)):$Map?($m||($m=new $Map),$mapSet($m,key2,value2)):($o||($o={key:{},next:null}),listSet($o,key2,value2))}};return channel}}});var require_formats=__commonJS({"../../node_modules/qs/lib/formats.js"(exports,module){"use strict";var replace=String.prototype.replace,percentTwenties=/%20/g,Format={RFC1738:"RFC1738",RFC3986:"RFC3986"};module.exports={default:Format.RFC3986,formatters:{RFC1738:function(value2){return replace.call(value2,percentTwenties,"+")},RFC3986:function(value2){return String(value2)}},RFC1738:Format.RFC1738,RFC3986:Format.RFC3986}}});var require_utils=__commonJS({"../../node_modules/qs/lib/utils.js"(exports,module){"use strict";var formats=require_formats(),has3=Object.prototype.hasOwnProperty,isArray2=Array.isArray,hexTable=function(){for(var array=[],i3=0;i3<256;++i3)array.push("%"+((i3<16?"0":"")+i3.toString(16)).toUpperCase());return array}(),compactQueue=function(queue){for(;queue.length>1;){var item=queue.pop(),obj=item.obj[item.prop];if(isArray2(obj)){for(var compacted=[],j2=0;j2<obj.length;++j2)typeof obj[j2]<"u"&&compacted.push(obj[j2]);item.obj[item.prop]=compacted}}},arrayToObject=function(source2,options3){for(var obj=options3&&options3.plainObjects?Object.create(null):{},i3=0;i3<source2.length;++i3)typeof source2[i3]<"u"&&(obj[i3]=source2[i3]);return obj},merge=function merge2(target,source2,options3){if(!source2)return target;if(typeof source2!="object"){if(isArray2(target))target.push(source2);else if(target&&typeof target=="object")(options3&&(options3.plainObje
Valid keys: `+JSON.stringify(Object.keys(shapeTypes),null," "));var error=checker(propValue,key2,componentName,location3,propFullName+"."+key2,ReactPropTypesSecret);if(error)return error}return null}return createChainableTypeChecker(validate)}function isNode(propValue){switch(typeof propValue){case"number":case"string":case"undefined":return!0;case"boolean":return!propValue;case"object":if(Array.isArray(propValue))return propValue.every(isNode);if(propValue===null||isValidElement2(propValue))return!0;var iteratorFn=getIteratorFn(propValue);if(iteratorFn){var iterator=iteratorFn.call(propValue),step;if(iteratorFn!==propValue.entries){for(;!(step=iterator.next()).done;)if(!isNode(step.value))return!1}else for(;!(step=iterator.next()).done;){var entry=step.value;if(entry&&!isNode(entry[1]))return!1}}else return!1;return!0;default:return!1}}function isSymbol3(propType,propValue){return propType==="symbol"?!0:propValue?propValue["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&propValue instanceof Symbol:!1}function getPropType(propValue){var propType=typeof propValue;return Array.isArray(propValue)?"array":propValue instanceof RegExp?"object":isSymbol3(propType,propValue)?"symbol":propType}function getPreciseType(propValue){if(typeof propValue>"u"||propValue===null)return""+propValue;var propType=getPropType(propValue);if(propType==="object"){if(propValue instanceof Date)return"date";if(propValue instanceof RegExp)return"regexp"}return propType}function getPostfixForTypeWarning(value2){var type=getPreciseType(value2);switch(type){case"array":case"object":return"an "+type;case"boolean":case"date":case"regexp":return"a "+type;default:return type}}function getClassName(propValue){return!propValue.constructor||!propValue.constructor.name?ANONYMOUS:propValue.constructor.name}return ReactPropTypes.checkPropTypes=checkPropTypes,ReactPropTypes.resetWarningCache=checkPropTypes.resetWarningCache,ReactPropTypes.PropTypes=ReactPropTypes,ReactPropTypes}}});var require_prop_types=__commonJS({"../../node_modules/prop-types/index.js"(exports,module){ReactIs=require_react_is(),throwOnDirectAccess=!0,module.exports=require_factoryWithTypeCheckers()(ReactIs.isElement,throwOnDirectAccess);var ReactIs,throwOnDirectAccess}});var require_react_fast_compare=__commonJS({"../../node_modules/react-fast-compare/index.js"(exports,module){var hasElementType=typeof Element<"u",hasMap=typeof Map=="function",hasSet=typeof Set=="function",hasArrayBuffer=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function equal(a2,b3){if(a2===b3)return!0;if(a2&&b3&&typeof a2=="object"&&typeof b3=="object"){if(a2.constructor!==b3.constructor)return!1;var length,i3,keys2;if(Array.isArray(a2)){if(length=a2.length,length!=b3.length)return!1;for(i3=length;i3--!==0;)if(!equal(a2[i3],b3[i3]))return!1;return!0}var it;if(hasMap&&a2 instanceof Map&&b3 instanceof Map){if(a2.size!==b3.size)return!1;for(it=a2.entries();!(i3=it.next()).done;)if(!b3.has(i3.value[0]))return!1;for(it=a2.entries();!(i3=it.next()).done;)if(!equal(i3.value[1],b3.get(i3.value[0])))return!1;return!0}if(hasSet&&a2 instanceof Set&&b3 instanceof Set){if(a2.size!==b3.size)return!1;for(it=a2.entries();!(i3=it.next()).done;)if(!b3.has(i3.value[0]))return!1;return!0}if(hasArrayBuffer&&ArrayBuffer.isView(a2)&&ArrayBuffer.isView(b3)){if(length=a2.length,length!=b3.length)return!1;for(i3=length;i3--!==0;)if(a2[i3]!==b3[i3])return!1;return!0}if(a2.constructor===RegExp)return a2.source===b3.source&&a2.flags===b3.flags;if(a2.valueOf!==Object.prototype.valueOf&&typeof a2.valueOf=="function"&&typeof b3.valueOf=="function")return a2.valueOf()===b3.valueOf();if(a2.toString!==Object.prototype.toString&&typeof a2.toString=="function"&&typeof b3.toString=="function")return a2.toString()===b3.toString();if(keys2=Object.keys(a2),length=keys2.length,length!==Object.keys(b3).length)return!1;for(i3=length;i3--!==0;)if(!Object.prototype.hasOwnProperty.call(b3,keys2[i3]))return!1;if(hasElementType&&a2 instanceof Element)return!1;for(i3=length;i3--!==0;)if(!((keys2[i3]==="_owner"||keys2[i3]==="__v"||keys2[i3]==="__o")&&a2.
`,styleEl.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
`,doc.getElementsByTagName("head")[0].appendChild(styleEl)),doc.body&&addClassName(doc.body,"react-draggable-transparent-selection")}function removeUserSelectStyles(doc){if(doc)try{if(doc.body&&removeClassName(doc.body,"react-draggable-transparent-selection"),doc.selection)doc.selection.empty();else{let selection=(doc.defaultView||window).getSelection();selection&&selection.type!=="Caret"&&selection.removeAllRanges()}}catch{}}function addClassName(el,className){el.classList?el.classList.add(className):el.className.match(new RegExp("(?:^|\\s)".concat(className,"(?!\\S)")))||(el.className+=" ".concat(className))}function removeClassName(el,className){el.classList?el.classList.remove(className):el.className=el.className.replace(new RegExp("(?:^|\\s)".concat(className,"(?!\\S)"),"g"),"")}}});var require_positionFns=__commonJS({"../../node_modules/react-draggable/build/cjs/utils/positionFns.js"(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.canDragX=canDragX;exports.canDragY=canDragY;exports.createCoreData=createCoreData;exports.createDraggableData=createDraggableData;exports.getBoundPosition=getBoundPosition;exports.getControlPosition=getControlPosition;exports.snapToGrid=snapToGrid;var _shims=require_shims(),_domFns=require_domFns();function getBoundPosition(draggable,x3,y2){if(!draggable.props.bounds)return[x3,y2];let{bounds}=draggable.props;bounds=typeof bounds=="string"?bounds:cloneBounds(bounds);let node=findDOMNode2(draggable);if(typeof bounds=="string"){let{ownerDocument}=node,ownerWindow=ownerDocument.defaultView,boundNode;if(bounds==="parent"?boundNode=node.parentNode:boundNode=ownerDocument.querySelector(bounds),!(boundNode instanceof ownerWindow.HTMLElement))throw new Error('Bounds selector "'+bounds+'" could not find an element.');let boundNodeEl=boundNode,nodeStyle=ownerWindow.getComputedStyle(node),boundNodeStyle=ownerWindow.getComputedStyle(boundNodeEl);bounds={left:-node.offsetLeft+(0,_shims.int)(boundNodeStyle.paddingLeft)+(0,_shims.int)(nodeStyle.marginLeft),top:-node.offsetTop+(0,_shims.int)(boundNodeStyle.paddingTop)+(0,_shims.int)(nodeStyle.marginTop),right:(0,_domFns.innerWidth)(boundNodeEl)-(0,_domFns.outerWidth)(node)-node.offsetLeft+(0,_shims.int)(boundNodeStyle.paddingRight)-(0,_shims.int)(nodeStyle.marginRight),bottom:(0,_domFns.innerHeight)(boundNodeEl)-(0,_domFns.outerHeight)(node)-node.offsetTop+(0,_shims.int)(boundNodeStyle.paddingBottom)-(0,_shims.int)(nodeStyle.marginBottom)}}return(0,_shims.isNum)(bounds.right)&&(x3=Math.min(x3,bounds.right)),(0,_shims.isNum)(bounds.bottom)&&(y2=Math.min(y2,bounds.bottom)),(0,_shims.isNum)(bounds.left)&&(x3=Math.max(x3,bounds.left)),(0,_shims.isNum)(bounds.top)&&(y2=Math.max(y2,bounds.top)),[x3,y2]}function snapToGrid(grid,pendingX,pendingY){let x3=Math.round(pendingX/grid[0])*grid[0],y2=Math.round(pendingY/grid[1])*grid[1];return[x3,y2]}function canDragX(draggable){return draggable.props.axis==="both"||draggable.props.axis==="x"}function canDragY(draggable){return draggable.props.axis==="both"||draggable.props.axis==="y"}function getControlPosition(e3,touchIdentifier,draggableCore){let touchObj=typeof touchIdentifier=="number"?(0,_domFns.getTouch)(e3,touchIdentifier):null;if(typeof touchIdentifier=="number"&&!touchObj)return null;let node=findDOMNode2(draggableCore),offsetParent=draggableCore.props.offsetParent||node.offsetParent||node.ownerDocument.body;return(0,_domFns.offsetXYFromParent)(touchObj||e3,offsetParent,draggableCore.props.scale)}function createCoreData(draggable,x3,y2){let isStart=!(0,_shims.isNum)(draggable.lastX),node=findDOMNode2(draggable);return isStart?{node,deltaX:0,deltaY:0,lastX:x3,lastY:y2,x:x3,y:y2}:{node,deltaX:x3-draggable.lastX,deltaY:y2-draggable.lastY,lastX:draggable.lastX,lastY:draggable.lastY,x:x3,y:y2}}function createDraggableData(draggable,coreData){let scale=draggable.props.scale;return{node:coreData.node,x:draggable.state.x+coreData.deltaX/scale,y:draggable.state.y+coreData.deltaY/scale,deltaX:coreData.deltaX/scale,deltaY:coreData.deltaY/scale,lastX:draggable.state.x,lastY:draggable.
Search pattern: "`.concat(e5,'"'));var r6=this._prepareSearchers(e5),n4=r6.tokenSearchers,o3=r6.fullSearcher,i4=this._search(n4,o3);return this._computeScore(i4),this.options.shouldSort&&this._sort(i4),t5.limit&&typeof t5.limit=="number"&&(i4=i4.slice(0,t5.limit)),this._format(i4)}},{key:"_prepareSearchers",value:function(){var e5=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t5=[];if(this.options.tokenize)for(var r6=e5.split(this.options.tokenSeparator),n4=0,o3=r6.length;n4<o3;n4+=1)t5.push(new i3(r6[n4],this.options));return{tokenSearchers:t5,fullSearcher:new i3(e5,this.options)}}},{key:"_search",value:function(){var e5=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t5=arguments.length>1?arguments[1]:void 0,r6=this.list,n4={},o3=[];if(typeof r6[0]=="string"){for(var i4=0,a4=r6.length;i4<a4;i4+=1)this._analyze({key:"",value:r6[i4],record:i4,index:i4},{resultMap:n4,results:o3,tokenSearchers:e5,fullSearcher:t5});return o3}for(var s3=0,c4=r6.length;s3<c4;s3+=1)for(var h4=r6[s3],l2=0,u2=this._keyNames.length;l2<u2;l2+=1){var f4=this._keyNames[l2];this._analyze({key:f4,value:this.options.getFn(h4,f4),record:h4,index:s3},{resultMap:n4,results:o3,tokenSearchers:e5,fullSearcher:t5})}return o3}},{key:"_analyze",value:function(e5,t5){var r6=this,n4=e5.key,o3=e5.arrayIndex,i4=o3===void 0?-1:o3,a4=e5.value,s3=e5.record,h4=e5.index,l2=t5.tokenSearchers,u2=l2===void 0?[]:l2,f4=t5.fullSearcher,v3=t5.resultMap,p2=v3===void 0?{}:v3,d2=t5.results,g2=d2===void 0?[]:d2;(function e6(t6,o4,i5,a5){if(o4!=null){if(typeof o4=="string"){var s4=!1,h5=-1,l3=0;r6._log(`
Key: `.concat(n4===""?"--":n4));var v4=f4.search(o4);if(r6._log('Full text: "'.concat(o4,'", score: ').concat(v4.score)),r6.options.tokenize){for(var d3=o4.split(r6.options.tokenSeparator),y2=d3.length,m2=[],k2=0,b3=u2.length;k2<b3;k2+=1){var S2=u2[k2];r6._log(`
Pattern: "`.concat(S2.pattern,'"'));for(var x3=!1,M2=0;M2<y2;M2+=1){var _2=d3[M2],w3=S2.search(_2),L3={};w3.isMatch?(L3[_2]=w3.score,s4=!0,x3=!0,m2.push(w3.score)):(L3[_2]=1,r6.options.matchAllTokens||m2.push(1)),r6._log('Token: "'.concat(_2,'", score: ').concat(L3[_2]))}x3&&(l3+=1)}h5=m2[0];for(var A3=m2.length,O2=1;O2<A3;O2+=1)h5+=m2[O2];h5/=A3,r6._log("Token score average:",h5)}var C3=v4.score;h5>-1&&(C3=(C3+h5)/2),r6._log("Score average:",C3);var j2=!r6.options.tokenize||!r6.options.matchAllTokens||l3>=u2.length;if(r6._log(`
Check Matches: `.concat(j2)),(s4||v4.isMatch)&&j2){var P3={key:n4,arrayIndex:t6,value:o4,score:C3};r6.options.includeMatches&&(P3.matchedIndices=v4.matchedIndices);var I3=p2[a5];I3?I3.output.push(P3):(p2[a5]={item:i5,output:[P3]},g2.push(p2[a5]))}}else if(c3(o4))for(var F2=0,T2=o4.length;F2<T2;F2+=1)e6(F2,o4[F2],i5,a5)}})(i4,a4,s3,h4)}},{key:"_computeScore",value:function(e5){this._log(`
Computing score:
`);for(var t5=this._keyWeights,r6=!!Object.keys(t5).length,n4=0,o3=e5.length;n4<o3;n4+=1){for(var i4=e5[n4],a4=i4.output,s3=a4.length,c4=1,h4=0;h4<s3;h4+=1){var l2=a4[h4],u2=l2.key,f4=r6?t5[u2]:1,v3=l2.score===0&&t5&&t5[u2]>0?Number.EPSILON:l2.score;c4*=Math.pow(v3,f4)}i4.score=c4,this._log(i4)}}},{key:"_sort",value:function(e5){this._log(`
Sorting....`),e5.sort(this.options.sortFn)}},{key:"_format",value:function(e5){var t5=[];if(this.options.verbose){var r6=[];this._log(`
Output:
`,JSON.stringify(e5,function(e6,t6){if(n3(t6)==="object"&&t6!==null){if(r6.indexOf(t6)!==-1)return;r6.push(t6)}return t6},2)),r6=null}var o3=[];this.options.includeMatches&&o3.push(function(e6,t6){var r7=e6.output;t6.matches=[];for(var n4=0,o4=r7.length;n4<o4;n4+=1){var i5=r7[n4];if(i5.matchedIndices.length!==0){var a5={indices:i5.matchedIndices,value:i5.value};i5.key&&(a5.key=i5.key),i5.hasOwnProperty("arrayIndex")&&i5.arrayIndex>-1&&(a5.arrayIndex=i5.arrayIndex),t6.matches.push(a5)}}}),this.options.includeScore&&o3.push(function(e6,t6){t6.score=e6.score});for(var i4=0,a4=e5.length;i4<a4;i4+=1){var s3=e5[i4];if(this.options.id&&(s3.item=this.options.getFn(s3.item,this.options.id)[0]),o3.length){for(var c4={item:s3.item},h4=0,l2=o3.length;h4<l2;h4+=1)o3[h4](s3,c4);t5.push(c4)}else t5.push(s3.item)}return t5}},{key:"_log",value:function(){var e5;this.options.verbose&&(e5=console).log.apply(e5,arguments)}}])&&o2(t4.prototype,r5),a3&&o2(t4,a3),e4}();e3.exports=h3},function(e3,t3,r4){function n3(e4,t4){for(var r5=0;r5<t4.length;r5++){var n4=t4[r5];n4.enumerable=n4.enumerable||!1,n4.configurable=!0,"value"in n4&&(n4.writable=!0),Object.defineProperty(e4,n4.key,n4)}}var o2=r4(2),i3=r4(3),a2=r4(6),s2=function(){function e4(t5,r6){var n4=r6.location,o3=n4===void 0?0:n4,i4=r6.distance,s4=i4===void 0?100:i4,c3=r6.threshold,h3=c3===void 0?.6:c3,l2=r6.maxPatternLength,u2=l2===void 0?32:l2,f4=r6.isCaseSensitive,v3=f4!==void 0&&f4,p2=r6.tokenSeparator,d2=p2===void 0?/ +/g:p2,g2=r6.findAllMatches,y2=g2!==void 0&&g2,m2=r6.minMatchCharLength,k2=m2===void 0?1:m2,b3=r6.includeMatches,S2=b3!==void 0&&b3;(function(e5,t6){if(!(e5 instanceof t6))throw new TypeError("Cannot call a class as a function")})(this,e4),this.options={location:o3,distance:s4,threshold:h3,maxPatternLength:u2,isCaseSensitive:v3,tokenSeparator:d2,findAllMatches:y2,includeMatches:S2,minMatchCharLength:k2},this.pattern=v3?t5:t5.toLowerCase(),this.pattern.length<=u2&&(this.patternAlphabet=a2(this.pattern))}var t4,r5,s3;return t4=e4,(r5=[{key:"search",value:function(e5){var t5=this.options,r6=t5.isCaseSensitive,n4=t5.includeMatches;if(r6||(e5=e5.toLowerCase()),this.pattern===e5){var a3={isMatch:!0,score:0};return n4&&(a3.matchedIndices=[[0,e5.length-1]]),a3}var s4=this.options,c3=s4.maxPatternLength,h3=s4.tokenSeparator;if(this.pattern.length>c3)return o2(e5,this.pattern,h3);var l2=this.options,u2=l2.location,f4=l2.distance,v3=l2.threshold,p2=l2.findAllMatches,d2=l2.minMatchCharLength;return i3(e5,this.pattern,this.patternAlphabet,{location:u2,distance:f4,threshold:v3,findAllMatches:p2,minMatchCharLength:d2,includeMatches:n4})}}])&&n3(t4.prototype,r5),s3&&n3(t4,s3),e4}();e3.exports=s2},function(e3,t3){var r4=/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;e3.exports=function(e4,t4){var n3=arguments.length>2&&arguments[2]!==void 0?arguments[2]:/ +/g,o2=new RegExp(t4.replace(r4,"\\$&").replace(n3,"|")),i3=e4.match(o2),a2=!!i3,s2=[];if(a2)for(var c3=0,h3=i3.length;c3<h3;c3+=1){var l2=i3[c3];s2.push([e4.indexOf(l2),l2.length-1])}return{score:a2?.5:1,isMatch:a2,matchedIndices:s2}}},function(e3,t3,r4){var n3=r4(4),o2=r4(5);e3.exports=function(e4,t4,r5,i3){for(var a2=i3.location,s2=a2===void 0?0:a2,c3=i3.distance,h3=c3===void 0?100:c3,l2=i3.threshold,u2=l2===void 0?.6:l2,f4=i3.findAllMatches,v3=f4!==void 0&&f4,p2=i3.minMatchCharLength,d2=p2===void 0?1:p2,g2=i3.includeMatches,y2=g2!==void 0&&g2,m2=s2,k2=e4.length,b3=u2,S2=e4.indexOf(t4,m2),x3=t4.length,M2=[],_2=0;_2<k2;_2+=1)M2[_2]=0;if(S2!==-1){var w3=n3(t4,{errors:0,currentLocation:S2,expectedLocation:m2,distance:h3});if(b3=Math.min(w3,b3),(S2=e4.lastIndexOf(t4,m2+x3))!==-1){var L3=n3(t4,{errors:0,currentLocation:S2,expectedLocation:m2,distance:h3});b3=Math.min(L3,b3)}}S2=-1;for(var A3=[],O2=1,C3=x3+k2,j2=1<<(x3<=31?x3-1:30),P3=0;P3<x3;P3+=1){for(var I3=0,F2=C3;I3<F2;)n3(t4,{errors:P3,currentLocation:m2+F2,expectedLocation:m2,distance:h3})<=b3?I3=F2:C3=F2,F2=Math.floor((C3-I3)/2+I3);C3=F2;var T2=Math.max(1,m2-F2+1),N3=v3?k2:Math.min(m2+F2,k2)+x3,z2=Array(N3+2);z2[N3+1]=(1<<P3)-1;for(var E3=N3;E3>=T2;E3-=1){var W2=E3-1,K2=r5[e4.charAt(W2)];i
[ ]{`+Math.min.apply(Math,indentLengths)+"}","g");strings=strings.map(function(str){return str.replace(pattern_1,`
`)})}strings[0]=strings[0].replace(/^\r?\n/,"");var string=strings[0];return values.forEach(function(value2,i3){var endentations=string.match(/(?:^|\n)( *)$/),endentation=endentations?endentations[1]:"",indentedValue=value2;typeof value2=="string"&&value2.includes(`
`)&&(indentedValue=String(value2).split(`
`).map(function(str,i22){return i22===0?str:""+endentation+str}).join(`
`)),string+=indentedValue+strings[i3+1]}),string}var splitPathRegex=/\/([^/]+)\/(?:(.*)_)?([^/]+)?/,parsePath=(0,import_memoizerific.default)(1e3)(path=>{let result2={viewMode:void 0,storyId:void 0,refId:void 0};if(path){let[,viewMode,refId,storyId]=path.toLowerCase().match(splitPathRegex)||[];viewMode&&Object.assign(result2,{viewMode,storyId,refId})}return result2}),DEEPLY_EQUAL=Symbol("Deeply equal"),deepDiff=(value2,update2)=>{if(typeof value2!=typeof update2)return update2;if(dequal(value2,update2))return DEEPLY_EQUAL;if(Array.isArray(value2)&&Array.isArray(update2)){let res=update2.reduce((acc,upd,index2)=>{let diff=deepDiff(value2[index2],upd);return diff!==DEEPLY_EQUAL&&(acc[index2]=diff),acc},new Array(update2.length));return update2.length>=value2.length?res:res.concat(new Array(value2.length-update2.length).fill(void 0))}return(0,import_isPlainObject.default)(value2)&&(0,import_isPlainObject.default)(update2)?Object.keys({...value2,...update2}).reduce((acc,key2)=>{let diff=deepDiff(value2?.[key2],update2?.[key2]);return diff===DEEPLY_EQUAL?acc:Object.assign(acc,{[key2]:diff})},{}):update2},VALIDATION_REGEXP=/^[a-zA-Z0-9 _-]*$/,NUMBER_REGEXP=/^-?[0-9]+(\.[0-9]+)?$/,HEX_REGEXP=/^#([a-f0-9]{3,4}|[a-f0-9]{6}|[a-f0-9]{8})$/i,COLOR_REGEXP=/^(rgba?|hsla?)\(([0-9]{1,3}),\s?([0-9]{1,3})%?,\s?([0-9]{1,3})%?,?\s?([0-9](\.[0-9]{1,2})?)?\)$/i,validateArgs=(key2="",value2)=>key2===null||key2===""||!VALIDATION_REGEXP.test(key2)?!1:value2==null||value2 instanceof Date||typeof value2=="number"||typeof value2=="boolean"?!0:typeof value2=="string"?VALIDATION_REGEXP.test(value2)||NUMBER_REGEXP.test(value2)||HEX_REGEXP.test(value2)||COLOR_REGEXP.test(value2):Array.isArray(value2)?value2.every(v3=>validateArgs(key2,v3)):(0,import_isPlainObject.default)(value2)?Object.entries(value2).every(([k2,v3])=>validateArgs(k2,v3)):!1,encodeSpecialValues=value2=>value2===void 0?"!undefined":value2===null?"!null":typeof value2=="string"?HEX_REGEXP.test(value2)?`!hex(${value2.slice(1)})`:COLOR_REGEXP.test(value2)?`!${value2.replace(/[\s%]/g,"")}`:value2:typeof value2=="boolean"?`!${value2}`:Array.isArray(value2)?value2.map(encodeSpecialValues):(0,import_isPlainObject.default)(value2)?Object.entries(value2).reduce((acc,[key2,val])=>Object.assign(acc,{[key2]:encodeSpecialValues(val)}),{}):value2,QS_OPTIONS={encode:!1,delimiter:";",allowDots:!0,format:"RFC1738",serializeDate:date=>`!date(${date.toISOString()})`},buildArgsParam=(initialArgs,args2)=>{let update2=deepDiff(initialArgs,args2);if(!update2||update2===DEEPLY_EQUAL)return"";let object=Object.entries(update2).reduce((acc,[key2,value2])=>validateArgs(key2,value2)?Object.assign(acc,{[key2]:value2}):(once.warn(dedent`
Omitted potentially unsafe URL args.
More info: https://storybook.js.org/docs/react/writing-stories/args#setting-args-through-the-url
`),acc),{});return import_qs.default.stringify(encodeSpecialValues(object),QS_OPTIONS).replace(/ /g,"+").split(";").map(part=>part.replace("=",":")).join(";")},queryFromString=(0,import_memoizerific.default)(1e3)(s2=>s2!==void 0?import_qs.default.parse(s2,{ignoreQueryPrefix:!0}):{}),queryFromLocation=location3=>queryFromString(location3.search),stringifyQuery=query=>import_qs.default.stringify(query,{addQueryPrefix:!0,encode:!1}),getMatch=(0,import_memoizerific.default)(1e3)((current,target,startsWith=!0)=>{if(startsWith){if(typeof target!="string")throw new Error("startsWith only works with string targets");return current&&current.startsWith(target)?{path:current}:null}let currentIsTarget=typeof target=="string"&&current===target,matchTarget=current&&target&&current.match(target);return currentIsTarget||matchTarget?{path:current}:null});var import_react=__toESM(require_react(),1),scope2=(()=>{let win;return typeof window<"u"?win=window:typeof globalThis<"u"?win=globalThis:typeof global<"u"?win=global:typeof self<"u"?win=self:win={},win})();function _extends(){return _extends=Object.assign?Object.assign.bind():function(target){for(var i3=1;i3<arguments.length;i3++){var source2=arguments[i3];for(var key2 in source2)Object.prototype.hasOwnProperty.call(source2,key2)&&(target[key2]=source2[key2])}return target},_extends.apply(this,arguments)}var Action;(function(Action22){Action22.Pop="POP",Action22.Push="PUSH",Action22.Replace="REPLACE"})(Action||(Action={}));var readOnly=function(obj){return Object.freeze(obj)};function warning(cond,message){if(!cond){typeof console<"u"&&console.warn(message);try{throw new Error(message)}catch{}}}var BeforeUnloadEventType="beforeunload",PopStateEventType="popstate";function createBrowserHistory(options3){options3===void 0&&(options3={});var _options=options3,_options$window=_options.window,window2=_options$window===void 0?document.defaultView:_options$window,globalHistory=window2.history;function getIndexAndLocation(){var _window$location=window2.location,pathname=_window$location.pathname,search=_window$location.search,hash=_window$location.hash,state=globalHistory.state||{};return[state.idx,readOnly({pathname,search,hash,state:state.usr||null,key:state.key||"default"})]}var blockedPopTx=null;function handlePop(){if(blockedPopTx)blockers.call(blockedPopTx),blockedPopTx=null;else{var nextAction=Action.Pop,_getIndexAndLocation=getIndexAndLocation(),nextIndex=_getIndexAndLocation[0],nextLocation=_getIndexAndLocation[1];if(blockers.length)if(nextIndex!=null){var delta=index2-nextIndex;delta&&(blockedPopTx={action:nextAction,location:nextLocation,retry:function(){go(delta*-1)}},go(delta))}else warning(!1,"You are trying to block a POP navigation to a location that was not created by the history library. The block will fail silently in production, but in general you should do all navigation with the history library (instead of using window.history.pushState directly) to avoid this situation.");else applyTx(nextAction)}}window2.addEventListener(PopStateEventType,handlePop);var action=Action.Pop,_getIndexAndLocation2=getIndexAndLocation(),index2=_getIndexAndLocation2[0],location3=_getIndexAndLocation2[1],listeners=createEvents(),blockers=createEvents();index2==null&&(index2=0,globalHistory.replaceState(_extends({},globalHistory.state,{idx:index2}),""));function createHref(to){return typeof to=="string"?to:createPath(to)}function getNextLocation(to,state){return state===void 0&&(state=null),readOnly(_extends({pathname:location3.pathname,hash:"",search:""},typeof to=="string"?parsePath2(to):to,{state,key:createKey()}))}function getHistoryStateAndUrl(nextLocation,index22){return[{usr:nextLocation.state,key:nextLocation.key,idx:index22},createHref(nextLocation)]}function allowTx(action2,location22,retry){return!blockers.length||(blockers.call({action:action2,location:location22,retry}),!1)}function applyTx(nextAction){action=nextAction;var _getIndexAndLocation3=getIndexAndLocation();index2=_getIndexAndLocation3[0],location3=_getIndexAndLocation3[1],listeners.call({action,location:location3})}fu
`&&inQuoteChar!=="`")&&(inQuoteChar=null),inRegexLiteral&&(code[i3]==="/"&&code[i3-1]!=="\\"||code[i3]===`
`)&&(inRegexLiteral=!1),inBlockComment&&code[i3-1]==="/"&&code[i3-2]==="*"&&(inBlockComment=!1),inLineComment&&code[i3]===`
`&&(inLineComment=!1)),!inBlockComment&&!inLineComment&&(newCode+=code[i3]);else newCode=code;return newCode},cleanCode=(0,import_memoizerific2.default)(1e4)(code=>removeCodeComments(code).replace(/\n\s*/g,"").trim()),convertShorthandMethods=function(key2,stringified){let fnHead=stringified.slice(0,stringified.indexOf("{")),fnBody=stringified.slice(stringified.indexOf("{"));if(fnHead.includes("=>")||fnHead.includes("function"))return stringified;let modifiedHead=fnHead;return modifiedHead=modifiedHead.replace(key2,"function"),modifiedHead+fnBody},dateFormat=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$/,isJSON=input=>input.match(/^[\[\{\"\}].*[\]\}\"]$/);function convertUnconventionalData(data){if(!isObject3(data))return data;let result2=data,wasMutated=!1;return typeof Event<"u"&&data instanceof Event&&(result2=extractEventHiddenProperties(result2),wasMutated=!0),result2=Object.keys(result2).reduce((acc,key2)=>{try{result2[key2]&&result2[key2].toJSON,acc[key2]=result2[key2]}catch{wasMutated=!0}return acc},{}),wasMutated?result2:data}var replacer=function(options22){let objects,map2,stack,keys2;return function(key2,value2){try{if(key2==="")return keys2=[],objects=new Map([[value2,"[]"]]),map2=new Map,stack=[],value2;let origin=map2.get(this)||this;for(;stack.length&&origin!==stack[0];)stack.shift(),keys2.pop();if(typeof value2=="boolean")return value2;if(value2===void 0)return options22.allowUndefined?"_undefined_":void 0;if(value2===null)return null;if(typeof value2=="number")return value2===-1/0?"_-Infinity_":value2===1/0?"_Infinity_":Number.isNaN(value2)?"_NaN_":value2;if(typeof value2=="bigint")return`_bigint_${value2.toString()}`;if(typeof value2=="string")return dateFormat.test(value2)?options22.allowDate?`_date_${value2}`:void 0:value2;if((0,import_is_regex.default)(value2))return options22.allowRegExp?`_regexp_${value2.flags}|${value2.source}`:void 0;if((0,import_is_function.default)(value2)){if(!options22.allowFunction)return;let{name:name2}=value2,stringified=value2.toString();return stringified.match(/(\[native code\]|WEBPACK_IMPORTED_MODULE|__webpack_exports__|__webpack_require__)/)?`_function_${name2}|${(()=>{}).toString()}`:`_function_${name2}|${cleanCode(convertShorthandMethods(key2,stringified))}`}if((0,import_is_symbol.default)(value2)){if(!options22.allowSymbol)return;let globalRegistryKey=Symbol.keyFor(value2);return globalRegistryKey!==void 0?`_gsymbol_${globalRegistryKey}`:`_symbol_${value2.toString().slice(7,-1)}`}if(stack.length>=options22.maxDepth)return Array.isArray(value2)?`[Array(${value2.length})]`:"[Object]";if(value2===this)return`_duplicate_${JSON.stringify(keys2)}`;if(value2 instanceof Error&&options22.allowError)return{__isConvertedError__:!0,errorProperties:{...value2.cause?{cause:value2.cause}:{},...value2,name:value2.name,message:value2.message,stack:value2.stack,"_constructor-name_":value2.constructor.name}};if(value2.constructor&&value2.constructor.name&&value2.constructor.name!=="Object"&&!Array.isArray(value2)&&!options22.allowClass)return;let found=objects.get(value2);if(!found){let converted=Array.isArray(value2)?value2:convertUnconventionalData(value2);if(value2.constructor&&value2.constructor.name&&value2.constructor.name!=="Object"&&!Array.isArray(value2)&&options22.allowClass)try{Object.assign(converted,{"_constructor-name_":value2.constructor.name})}catch{}return keys2.push(key2),stack.unshift(converted),objects.set(value2,JSON.stringify(keys2)),value2!==converted&&map2.set(value2,converted),converted}return`_duplicate_${found}`}catch{return}}},reviver2=function reviver(options){let refs=[],root;return function revive(key,value){if(key===""&&(root=value,refs.forEach(({target,container,replacement})=>{let replacementArr=isJSON(replacement)?JSON.parse(replacement):replacement.split(".");replacementArr.length===0?container[target]=root:container[target]=get_default(root,replacementArr)})),key==="_constructor-name_")return value;if(isObject3(value)&&value.__isConvertedError__){let{message,...properties}=value.errorProperties,error=new Error(message);return Object.assign(er
[ ]{`+Math.min.apply(Math,indentLengths)+"}","g");strings=strings.map(function(str){return str.replace(pattern_1,`
`)})}strings[0]=strings[0].replace(/^\r?\n/,"");var string=strings[0];return values.forEach(function(value2,i3){var endentations=string.match(/(?:^|\n)( *)$/),endentation=endentations?endentations[1]:"",indentedValue=value2;typeof value2=="string"&&value2.includes(`
`)&&(indentedValue=String(value2).split(`
`).map(function(str,i4){return i4===0?str:""+endentation+str}).join(`
2024-02-23 14:08:28 +01:00
`)),string+=indentedValue+strings[i3+1]}),string}var import_memoizerific3=__toESM(require_memoizerific(),1),import_countBy=__toESM(require_countBy(),1),import_mapValues=__toESM(require_mapValues(),1),import_pick=__toESM(require_pick(),1);var has2=Object.prototype.hasOwnProperty;function find2(iter,tar,key2){for(key2 of iter.keys())if(dequal2(key2,tar))return key2}function dequal2(foo,bar){var ctor,len,tmp;if(foo===bar)return!0;if(foo&&bar&&(ctor=foo.constructor)===bar.constructor){if(ctor===Date)return foo.getTime()===bar.getTime();if(ctor===RegExp)return foo.toString()===bar.toString();if(ctor===Array){if((len=foo.length)===bar.length)for(;len--&&dequal2(foo[len],bar[len]););return len===-1}if(ctor===Set){if(foo.size!==bar.size)return!1;for(len of foo)if(tmp=len,tmp&&typeof tmp=="object"&&(tmp=find2(bar,tmp),!tmp)||!bar.has(tmp))return!1;return!0}if(ctor===Map){if(foo.size!==bar.size)return!1;for(len of foo)if(tmp=len[0],tmp&&typeof tmp=="object"&&(tmp=find2(bar,tmp),!tmp)||!dequal2(len[1],bar.get(tmp)))return!1;return!0}if(ctor===ArrayBuffer)foo=new Uint8Array(foo),bar=new Uint8Array(bar);else if(ctor===DataView){if((len=foo.byteLength)===bar.byteLength)for(;len--&&foo.getInt8(len)===bar.getInt8(len););return len===-1}if(ArrayBuffer.isView(foo)){if((len=foo.byteLength)===bar.byteLength)for(;len--&&foo[len]===bar[len];);return len===-1}if(!ctor||typeof foo=="object"){len=0;for(ctor in foo)if(has2.call(foo,ctor)&&++len&&!has2.call(bar,ctor)||!(ctor in bar)||!dequal2(foo[ctor],bar[ctor]))return!1;return Object.keys(bar).length===len}}return foo!==foo&&bar!==bar}var dist_exports4={};__export(dist_exports4,{Channel:()=>Channel,PostMessageTransport:()=>PostMessageTransport,WebsocketTransport:()=>WebsocketTransport,createBrowserChannel:()=>createBrowserChannel,createPostMessageChannel:()=>createChannel,createWebSocketChannel:()=>createChannel2,default:()=>src_default2});var isMulti=args2=>args2.transports!==void 0,generateRandomId=()=>Math.random().toString(16).slice(2),Channel=class{constructor(input={}){this.sender=generateRandomId(),this.events={},this.data={},this.transports=[],this.isAsync=input.async||!1,isMulti(input)?(this.transports=input.transports||[],this.transports.forEach(t3=>{t3.setHandler(event=>this.handleEvent(event))})):this.transports=input.transport?[input.transport]:[],this.transports.forEach(t3=>{t3.setHandler(event=>this.handleEvent(event))})}get hasTransport(){return this.transports.length>0}addListener(eventName,listener){this.events[eventName]=this.events[eventName]||[],this.events[eventName].push(listener)}emit(eventName,...args2){let event={type:eventName,args:args2,from:this.sender},options3={};args2.length>=1&&args2[0]&&args2[0].options&&(options3=args2[0].options);let handler=()=>{this.transports.forEach(t3=>{t3.send(event,options3)}),this.handleEvent(event)};this.isAsync?setImmediate(handler):handler()}last(eventName){return this.data[eventName]}eventNames(){return Object.keys(this.events)}listenerCount(eventName){let listeners=this.listeners(eventName);return listeners?listeners.length:0}listeners(eventName){return this.events[eventName]||void 0}once(eventName,listener){let onceListener=this.onceListener(eventName,listener);this.addListener(eventName,onceListener)}removeAllListeners(eventName){eventName?this.events[eventName]&&delete this.events[eventName]:this.events={}}removeListener(eventName,listener){let listeners=this.listeners(eventName);listeners&&(this.events[eventName]=listeners.filter(l2=>l2!==listener))}on(eventName,listener){this.addListener(eventName,listener)}off(eventName,listener){this.removeListener(eventName,listener)}handleEvent(event){let listeners=this.listeners(event.type);listeners&&listeners.length&&listeners.forEach(fn=>{fn.apply(event,event.args)}),this.data[event.type]=event.args}onceListener(eventName,listener){let onceListener=(...args2)=>(this.removeListener(eventName,onceListener),listener(...args2));return onceListener}};var import_qs2=__toESM(require_lib(),1);var isProduction=!1,prefix="Invariant failed";function invariant2(condition,message){if(!condition){
2024-02-08 10:52:22 +01:00
Invalid part '${name2}', leading to id === parentId ('${id}'), inside title '${title}'
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
`);return list.push(id),list},[]);return paths.forEach((id,idx)=>{let childId=paths[idx+1]||item.id;root4.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(i3=>i3.type!=="root"&&!i3.parent).reduce(addItem,{});return Object.values(storiesHashOutOfOrder).filter(i3=>i3.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?.type==="story"&&oldEntry.prepared?[id,{...oldEntry,...newEntry,prepared:!0}]:[id,newEntry]})):newHash,getComponentLookupList=(0,import_memoizerific3.default)(1)(hash=>Object.entries(hash).reduce((acc,i3)=>{let value2=i3[1];return value2.type==="component"&&acc.push([...value2.children]),acc},[])),getStoriesLookupList=(0,import_memoizerific3.default)(1)(hash=>Object.keys(hash).filter(k2=>["story","docs"].includes(hash[k2].type))),{location:location2,fetch}=scope,findFilename=/(\/((?:[^\/]+?)\.[^\/]+?)|\/)$/,getSourceType=(source2,refId)=>{let{origin:localOrigin,pathname:localPathname}=location2,{origin:sourceOrigin,pathname:sourcePathname}=new URL(source2),localFull=`${localOrigin+localPathname}`.replace(findFilename,""),sourceFull=`${sourceOrigin+sourcePathname}`.replace(findFilename,"");return localFull===sourceFull?["local",sourceFull]:refId||source2?["external",sourceFull]:[null,null]},defaultStoryMapper=(b3,a2)=>({...a2,kind:a2.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,options3)=>{let{storyMapper}=options3;return storyMapper?Object.entries(input).reduce((acc,[id,item])=>({...acc,[id]:storyMapper(ref,item)}),{}):input},init6=({store:store22,provider,singleStory,docsOptions={}},{runCheck=!0}={})=>{let api={findRef:source2=>{let refs22=api.getRefs();return Object.values(refs22).find(({url})=>url.match(source2))},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},store22.setState({refs:updated})},checkRef:async ref=>{let{id,url,version:version2,type}=ref,isPublic=type==="server-checked",loadedData={},query=version2?`?version=${version2
Error: Loading of ref failed
at fetch (lib/api/src/modules/refs.ts)
URL: ${urlParseResult.url}
We weren't able to load the above URL,
it's possible a CORS error happened.
Please check your dev-tools network tab.
2024-02-23 14:08:28 +01:00
`});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:refs22={}}=store22.getState();return refs22},setRef:(id,{storyIndex,setStoriesData,...rest},ready=!1)=>{if(singleStory)return;let{storyMapper=defaultStoryMapper}=provider.getConfig(),ref=api.getRefs()[id],index2;setStoriesData?index2=transformSetStoriesStoryDataToStoriesHash(map(setStoriesData,ref,{storyMapper}),{provider,docsOptions,filters:{},status:{}}):storyIndex&&(index2=transformStoryIndexToStoriesHash(storyIndex,{provider,docsOptions,filters:{},status:{}})),index2&&(index2=addRefIds(index2,ref)),api.updateRef(id,{index:index2,...rest})},updateRef:(id,data)=>{let{[id]:ref,...updated}=api.getRefs();updated[id]={...ref,...data};let ordered=Object.keys(initialState).reduce((obj,key2)=>(obj[key2]=updated[key2],obj),{});store22.setState({refs:ordered})}},refs2=!singleStory&&scope.REFS||{},initialState=refs2;return runCheck&&Object.entries(refs2).forEach(([id,ref])=>{api.checkRef({...ref,stories:{}})}),{api,state:{refs:initialState}}},getEventMetadata=(context,fullAPI)=>{let{source:source2,refId,type}=context,[sourceType,sourceLocation]=getSourceType(source2,refId),ref=refId&&fullAPI.getRefs()[refId]?fullAPI.getRefs()[refId]:fullAPI.findRef(sourceLocation),meta={source:source2,sourceType,sourceLocation,refId,ref,type};switch(!0){case typeof refId=="string":case sourceType==="local":case sourceType==="external":return meta;default:return logger.warn(`Received a ${type} frame that was not configured as a ref`),null}},{FEATURES,fetch:fetch2}=scope,STORY_INDEX_PATH="./index.json",removedOptions=["enableShortcuts","theme","showRoots"];function removeRemovedOptions(options3){if(!options3||typeof options3=="string")return options3;let result2={...options3};return removedOptions.forEach(option=>{option in result2&&delete result2[option]}),result2}var init7=({fullAPI,store:store22,navigate,provider,storyId:initialStoryId,viewMode:initialViewMode,docsOptions={}})=>{let api={storyId:N,getData:(storyId,refId)=>{let result2=api.resolveStory(storyId,refId);if(result2?.type==="story"||result2?.type==="docs")return result2},isPrepared:(storyId,refId)=>{let data=api.getData(storyId,refId);return data?data.type==="story"?data.prepared:!0:!1},resolveStory:(storyId,refId)=>{let{refs:refs2,index:index2}=store22.getState();return refId&&!refs2[refId]?null:refId?refs2[refId].index?refs2[refId].index[storyId]:void 0:index2?index2[storyId]:void 0},getCurrentStoryData:()=>{let{storyId,refId}=store22.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?.type)){let{parameters}=data;if(parameters)return parameterName?parameters[parameterName]:parameters}return null},getCurrentParameter:parameterName=>{let{storyId,refId}=store22.getState();return api.getParameters({storyId,refId},parameterName)||void 0},jumpToComponent:direction=>{let{index:index2,storyId,refs:refs2,refId}=store22.getState();if(!api.getData(storyId,refId))return;let hash=refId?refs2[refId].index||{}:index2,result2=api.findSiblingStoryId(storyId,hash,direction,!0);result2&&api.selectStory(result2,void 0,{ref:refId})},jumpToStory:direction=>{let{index:index2,storyId,refs:refs2,refId}=store22.getState(),story=api.getData(storyId,refId);if(!story)return;let hash=story.refId?refs2[story.refId].index:index2,result2=api.findSiblingStoryId(storyId,hash,direction,!1);result2&&api.selectStory(result2,void 0,{ref:refId})},selectFirstStory:()=>{let{index:index2}=store22.getState(),firstStory=Object.keys(index2).find(id=>index2[id].type==="story");if(firstStory){api.selectStory(firstStory);return}navigate("/")},selectStory:(titleOrId=void 0,name2=void 0,options3={})=>{let{ref}=options3,{storyId,index:index2,refs:refs2}=store22.
2024-02-08 10:52:22 +01:00
${this.documentation.map(doc=>` - ${doc}`).join(`
`)}`),`${this.template()}${page!=null?`
More info: ${page}
2024-02-23 14:08:28 +01:00
`:""}`}};var Category=(Category2=>(Category2.MANAGER_UNCAUGHT="MANAGER_UNCAUGHT",Category2.MANAGER_UI="MANAGER_UI",Category2.MANAGER_API="MANAGER_API",Category2.MANAGER_CLIENT_LOGGER="MANAGER_CLIENT-LOGGER",Category2.MANAGER_CHANNELS="MANAGER_CHANNELS",Category2.MANAGER_CORE_EVENTS="MANAGER_CORE-EVENTS",Category2.MANAGER_ROUTER="MANAGER_ROUTER",Category2.MANAGER_THEMING="MANAGER_THEMING",Category2))(Category||{}),ProviderDoesNotExtendBaseProviderError=class extends StorybookError{constructor(){super(...arguments),this.category="MANAGER_UI",this.code=1}template(){return"The Provider passed into Storybook's UI is not extended from the base Provider. Please check your Provider implementation."}},UncaughtManagerError=class extends StorybookError{constructor(data){super(data.error.message),this.data=data,this.category="MANAGER_UNCAUGHT",this.code=1,this.stack=data.error.stack}template(){return this.message}};var import_react3=__toESM(require_react()),import_prop_types=__toESM(require_prop_types()),import_react_fast_compare=__toESM(require_react_fast_compare()),import_invariant=__toESM(require_browser()),import_shallowequal=__toESM(require_shallowequal());function a(){return a=Object.assign||function(t3){for(var e3=1;e3<arguments.length;e3++){var r4=arguments[e3];for(var n3 in r4)Object.prototype.hasOwnProperty.call(r4,n3)&&(t3[n3]=r4[n3])}return t3},a.apply(this,arguments)}function s(t3,e3){t3.prototype=Object.create(e3.prototype),t3.prototype.constructor=t3,c2(t3,e3)}function c2(t3,e3){return c2=Object.setPrototypeOf||function(t4,e4){return t4.__proto__=e4,t4},c2(t3,e3)}function u(t3,e3){if(t3==null)return{};var r4,n3,i3={},o2=Object.keys(t3);for(n3=0;n3<o2.length;n3++)e3.indexOf(r4=o2[n3])>=0||(i3[r4]=t3[r4]);return i3}var l={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title",FRAGMENT:"Symbol(react.fragment)"},p={rel:["amphtml","canonical","alternate"]},f3={type:["application/ld+json"]},d={charset:"",name:["robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},h2=Object.keys(l).map(function(t3){return l[t3]}),m={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},y=Object.keys(m).reduce(function(t3,e3){return t3[m[e3]]=e3,t3},{}),T=function(t3,e3){for(var r4=t3.length-1;r4>=0;r4-=1){var n3=t3[r4];if(Object.prototype.hasOwnProperty.call(n3,e3))return n3[e3]}return null},g=function(t3){var e3=T(t3,l.TITLE),r4=T(t3,"titleTemplate");if(Array.isArray(e3)&&(e3=e3.join("")),r4&&e3)return r4.replace(/%s/g,function(){return e3});var n3=T(t3,"defaultTitle");return e3||n3||void 0},b2=function(t3){return T(t3,"onChangeClientState")||function(){}},v2=function(t3,e3){return e3.filter(function(e4){return e4[t3]!==void 0}).map(function(e4){return e4[t3]}).reduce(function(t4,e4){return a({},t4,e4)},{})},A=function(t3,e3){return e3.filter(function(t4){return t4[l.BASE]!==void 0}).map(function(t4){return t4[l.BASE]}).reverse().reduce(function(e4,r4){if(!e4.length)for(var n3=Object.keys(r4),i3=0;i3<n3.length;i3+=1){var o2=n3[i3].toLowerCase();if(t3.indexOf(o2)!==-1&&r4[o2])return e4.concat(r4)}return e4},[])},C2=function(t3,e3,r4){var n3={};return r4.filter(function(e4){return!!Array.isArray(e4[t3])||(e4[t3]!==void 0&&console&&typeof console.warn=="function"&&console.warn("Helmet: "+t3+' should be of type "Array". Instead found type "'+typeof e4[t3]+'"'),!1)}).map(function(e4){return e4[t3]}).reverse().reduce(function(t4,r5){var i3={};r5.filter(function(t5){for(var r6,o3=Object.keys(t5),a2=0;a2<o3.length;a2+=1){var s3=o3[a2],c4=s3.toLowerCase();e3.indexOf(c4)===-1||r6==="rel"&&t5[r6].toLowerCase()==="canonical"||c4==="rel"&&t5[c4].toLowerCase()==="stylesheet"||(r6=c4),e3.indexOf(s3)===-1||s3!=="innerHTML"&&s3!=="cssText"&&s3!=="itemprop"||(r6=s3)}if(!r6||!t5[r6
2024-02-08 10:52:22 +01:00
`,2:`Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).
`,3:`Passed an incorrect argument to a color function, please pass a string representation of a color.
`,4:`Couldn't generate valid rgb string from %s, it returned %s.
`,5:`Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.
`,6:`Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).
`,7:`Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).
`,8:`Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.
`,9:`Please provide a number of steps to the modularScale helper.
`,10:`Please pass a number or one of the predefined scales to the modularScale helper as the ratio.
`,11:`Invalid value passed as base to modularScale, expected number or em string but got "%s"
`,12:`Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.
`,13:`Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.
`,14:`Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.
`,15:`Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.
`,16:`You must provide a template to this method.
`,17:`You passed an unsupported selector state to this method.
`,18:`minScreen and maxScreen must be provided as stringified numbers with the same units.
`,19:`fromSize and toSize must be provided as stringified numbers with the same units.
`,20:`expects either an array of objects or a single object with the properties prop, fromSize, and toSize.
`,21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:`fontFace expects a name of a font-family.
`,24:`fontFace expects either the path to the font file(s) or a name of a local copy.
`,25:`fontFace expects localFonts to be an array.
`,26:`fontFace expects fileFormats to be an array.
`,27:`radialGradient requries at least 2 color-stops to properly render.
`,28:`Please supply a filename to retinaImage() as the first argument.
`,29:`Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.
`,30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:`The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation
`,32:`To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])
To pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')
`,33:`The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation
`,34:`borderRadius expects a radius value as a string or number as the second argument.
`,35:`borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.
`,36:`Property must be a string value.
`,37:`Syntax Error at %s.
`,38:`Formula contains a function that needs parentheses at %s.
`,39:`Formula is missing closing parenthesis at %s.
`,40:`Formula has too many closing parentheses at %s.
`,41:`All values in a formula must have the same unit or be unitless.
`,42:`Please provide a number of steps to the modularScale helper.
`,43:`Please pass a number or one of the predefined scales to the modularScale helper as the ratio.
`,44:`Invalid value passed as base to modularScale, expected number or em/rem string but got %s.
`,45:`Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.
`,46:`Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.
`,47:`minScreen and maxScreen must be provided as stringified numbers with the same units.
`,48:`fromSize and toSize must be provided as stringified numbers with the same units.
`,49:`Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.
`,50:`Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.
`,51:`Expects the first argument object to have the properties prop, fromSize, and toSize.
`,52:`fontFace expects either the path to the font file(s) or a name of a local copy.
`,53:`fontFace expects localFonts to be an array.
`,54:`fontFace expects fileFormats to be an array.
`,55:`fontFace expects a name of a font-family.
`,56:`linearGradient requries at least 2 color-stops to properly render.
`,57:`radialGradient requries at least 2 color-stops to properly render.
`,58:`Please supply a filename to retinaImage() as the first argument.
`,59:`Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.
`,60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:`Property must be a string value.
`,62:`borderRadius expects a radius value as a string or number as the second argument.
`,63:`borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.
`,64:`The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.
`,65:`To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').
`,66:`The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.
`,67:`You must provide a template to this method.
`,68:`You passed an unsupported selector state to this method.
`,69:`Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.
`,70:`Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.
`,71:`Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.
`,72:`Passed invalid base value %s to %s(), please pass a value like "12px" or 12.
`,73:`Please provide a valid CSS variable.
`,74:`CSS variable not found and no default was provided.
`,75:`important requires a valid style object, got a %s instead.
`,76:`fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.
`,77:`remToPx expects a value in "rem" but you provided it in "%s".
`,78:`base must be set in "px" or "%" but you set it in "%s".
`};function format(){for(var _len=arguments.length,args2=new Array(_len),_key=0;_key<_len;_key++)args2[_key]=arguments[_key];var a2=args2[0],b3=[],c3;for(c3=1;c3<args2.length;c3+=1)b3.push(args2[c3]);return b3.forEach(function(d2){a2=a2.replace(/%[a-z]/,d2)}),a2}var PolishedError=function(_Error){_inheritsLoose(PolishedError22,_Error);function PolishedError22(code){for(var _this,_len2=arguments.length,args2=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++)args2[_key2-1]=arguments[_key2];return _this=_Error.call(this,format.apply(void 0,[ERRORS[code]].concat(args2)))||this,_assertThisInitialized(_this)}return PolishedError22}(_wrapNativeSuper(Error));function colorToInt(color2){return Math.round(color2*255)}function convertToInt(red,green,blue){return colorToInt(red)+","+colorToInt(green)+","+colorToInt(blue)}function hslToRgb(hue,saturation,lightness,convert){if(convert===void 0&&(convert=convertToInt),saturation===0)return convert(lightness,lightness,lightness);var huePrime=(hue%360+360)%360/60,chroma=(1-Math.abs(2*lightness-1))*saturation,secondComponent=chroma*(1-Math.abs(huePrime%2-1)),red=0,green=0,blue=0;huePrime>=0&&huePrime<1?(red=chroma,green=secondComponent):huePrime>=1&&huePrime<2?(red=secondComponent,green=chroma):huePrime>=2&&huePrime<3?(green=chroma,blue=secondComponent):huePrime>=3&&huePrime<4?(green=secondComponent,blue=chroma):huePrime>=4&&huePrime<5?(red=secondComponent,blue=chroma):huePrime>=5&&huePrime<6&&(red=chroma,blue=secondComponent);var lightnessModification=lightness-chroma/2,finalRed=red+lightnessModification,finalGreen=green+lightnessModification,finalBlue=blue+lightnessModification;return convert(finalRed,finalGreen,finalBlue)}var namedColorMap={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",
display: inline-block;
shape-rendering: inherit;
vertical-align: middle;
fill: currentColor;
path {
fill: currentColor;
}
2024-02-23 14:08:28 +01:00
`,Icons=({icon,useSymbol,...props})=>import_react6.default.createElement(Svg,{viewBox:"0 0 14 14",width:"14px",height:"14px",...props},useSymbol?import_react6.default.createElement("use",{xlinkHref:`#icon--${icon}`}):icons[icon]),Symbols=(0,import_react6.memo)(function({icons:keys2=Object.keys(icons)}){return import_react6.default.createElement(Svg,{viewBox:"0 0 14 14",style:{position:"absolute",width:0,height:0},"data-chromatic":"ignore"},keys2.map(key2=>import_react6.default.createElement("symbol",{id:`icon--${key2}`,key:key2},icons[key2])))}),LEFT_BUTTON=0,isPlainLeftClick=e3=>e3.button===LEFT_BUTTON&&!e3.altKey&&!e3.ctrlKey&&!e3.metaKey&&!e3.shiftKey,cancelled=(e3,cb)=>{isPlainLeftClick(e3)&&(e3.preventDefault(),cb(e3))},LinkInner=newStyled.span(({withArrow})=>withArrow?{"> svg:last-of-type":{height:"0.7em",width:"0.7em",marginRight:0,marginLeft:"0.25em",bottom:"auto",verticalAlign:"inherit"}}:{},({containsIcon})=>containsIcon?{svg:{height:"1em",width:"1em",verticalAlign:"middle",position:"relative",bottom:0,marginRight:0}}:{}),A22=newStyled.a(({theme})=>({display:"inline-block",transition:"all 150ms ease-out",textDecoration:"none",color:theme.color.secondary,"&:hover, &:focus":{cursor:"pointer",color:curriedDarken$1(.07,theme.color.secondary),"svg path:not([fill])":{fill:curriedDarken$1(.07,theme.color.secondary)}},"&:active":{color:curriedDarken$1(.1,theme.color.secondary),"svg path:not([fill])":{fill:curriedDarken$1(.1,theme.color.secondary)}},svg:{display:"inline-block",height:"1em",width:"1em",verticalAlign:"text-top",position:"relative",bottom:"-0.125em",marginRight:"0.4em","& path":{fill:theme.color.secondary}}}),({theme,secondary,tertiary})=>{let colors;return secondary&&(colors=[theme.textMutedColor,theme.color.dark,theme.color.darker]),tertiary&&(colors=[theme.color.dark,theme.color.darkest,theme.textMutedColor]),colors?{color:colors[0],"svg path:not([fill])":{fill:colors[0]},"&:hover":{color:colors[1],"svg path:not([fill])":{fill:colors[1]}},"&:active":{color:colors[2],"svg path:not([fill])":{fill:colors[2]}}}:{}},({nochrome})=>nochrome?{color:"inherit","&:hover, &:active":{color:"inherit",textDecoration:"underline"}}:{},({theme,inverse})=>inverse?{color:theme.color.lightest,":not([fill])":{fill:theme.color.lightest},"&:hover":{color:theme.color.lighter,"svg path:not([fill])":{fill:theme.color.lighter}},"&:active":{color:theme.color.light,"svg path:not([fill])":{fill:theme.color.light}}}:{},({isButton})=>isButton?{border:0,borderRadius:0,background:"none",padding:0,fontSize:"inherit"}:{}),Link22=({cancel,children,onClick,withArrow,containsIcon,className,...rest})=>import_react6.default.createElement(A22,{...rest,onClick:onClick&&cancel?e3=>cancelled(e3,onClick):onClick,className},import_react6.default.createElement(LinkInner,{withArrow,containsIcon},children,withArrow&&import_react6.default.createElement(Icons,{icon:"arrowright"})));Link22.defaultProps={cancel:!0,className:void 0,style:void 0,onClick:void 0,withArrow:!1,containsIcon:!1};var DocumentWrapper=newStyled.div(({theme})=>({fontSize:`${theme.typography.size.s2}px`,lineHeight:"1.6",h1:{fontSize:`${theme.typography.size.l1}px`,fontWeight:theme.typography.weight.bold},h2:{fontSize:`${theme.typography.size.m2}px`,borderBottom:`1px solid ${theme.appBorderColor}`},h3:{fontSize:`${theme.typography.size.m1}px`},h4:{fontSize:`${theme.typography.size.s3}px`},h5:{fontSize:`${theme.typography.size.s2}px`},h6:{fontSize:`${theme.typography.size.s2}px`,color:theme.color.dark},"pre:not(.prismjs)":{background:"transparent",border:"none",borderRadius:0,padding:0,margin:0},"pre pre, pre.prismjs":{padding:15,margin:0,whiteSpace:"pre-wrap",color:"inherit",fontSize:"13px",lineHeight:"19px"},"pre pre code, pre.prismjs code":{color:"inherit",fontSize:"inherit"},"pre code":{margin:0,padding:0,whiteSpace:"pre",border:"none",background:"transparent"},"pre code, pre tt":{backgroundColor:"transparent",border:"none"},"body > *:first-of-type":{marginTop:"0 !important"},"body > *:last-child":{marginBottom:"0 !important"},a:{color:theme.color.secondary,textDecoration:"none"},"a.
2024-02-08 10:52:22 +01:00
2024-02-23 14:08:28 +01:00
${input}`);let match=input.match(firstLineRegex);if(!match)return import_react6.default.createElement(import_react6.Fragment,null,input);let[,type,name2]=match,rawLines=input.split(/\n/).slice(1),[,...lines]=rawLines.map(line=>{let result2=line.match(linesRegexChromium)||line.match(linesRegexFirefox)||line.match(linesRegexSafari);return result2?{name:(result2[1]||"").replace("/<",""),location:result2[2].replace(document24.location.origin,"")}:null}).filter(Boolean);return import_react6.default.createElement(import_react6.Fragment,null,import_react6.default.createElement("span",null,type),": ",import_react6.default.createElement(ErrorName,null,name2),import_react6.default.createElement("br",null),lines.map((l2,i3)=>l2.name?import_react6.default.createElement(import_react6.Fragment,{key:i3}," ","at ",import_react6.default.createElement(ErrorImportant,null,l2.name)," (",import_react6.default.createElement(ErrorDetail,null,l2.location),")",import_react6.default.createElement("br",null)):import_react6.default.createElement(import_react6.Fragment,{key:i3}," ","at ",import_react6.default.createElement(ErrorDetail,null,l2.location),import_react6.default.createElement("br",null))))},ButtonWrapper=newStyled.button(({small,theme})=>({border:0,borderRadius:"3em",cursor:"pointer",display:"inline-block",overflow:"hidden",padding:small?"8px 16px":"13px 20px",position:"relative",textAlign:"center",textDecoration:"none",transitionProperty:"background, box-shadow",transitionDuration:"150ms",transitionTimingFunction:"ease-out",verticalAlign:"top",whiteSpace:"nowrap",userSelect:"none",opacity:1,margin:0,background:"transparent",fontSize:`${small?theme.typography.size.s1:theme.typography.size.s2-1}px`,fontWeight:theme.typography.weight.bold,lineHeight:"1",svg:{display:"inline-block",height:small?12:14,width:small?12:14,verticalAlign:"top",marginRight:small?4:6,marginTop:small?0:-1,marginBottom:small?0:-1,pointerEvents:"none",path:{fill:"currentColor"}}}),({disabled})=>disabled?{cursor:"not-allowed !important",opacity:.5,"&:hover":{transform:"none"}}:{},({containsIcon,small})=>containsIcon?{svg:{display:"block",margin:0},...small?{padding:10}:{padding:13}}:{},({theme,primary,secondary,gray})=>{let color2;return gray?color2=theme.color.mediumlight:secondary?color2=theme.color.secondary:primary&&(color2=theme.color.primary),color2?{background:color2,color:gray?theme.color.darkest:theme.color.lightest,"&:hover":{background:curriedDarken$1(.05,color2)},"&:active":{boxShadow:"rgba(0, 0, 0, 0.1) 0 0 0 3em inset"},"&:focus":{boxShadow:`${rgba(color2,1)} 0 1px 9px 2px`,outline:"none"},"&:focus:hover":{boxShadow:`${rgba(color2,.2)} 0 8px 18px 0px`}}:{}},({theme,tertiary,inForm,small})=>tertiary?{background:theme.button.background,color:theme.input.color,boxShadow:`${theme.button.border} 0 0 0 1px inset`,borderRadius:theme.input.borderRadius,...inForm&&small?{padding:"10px 16px"}:{},"&:hover":{background:theme.base==="light"?curriedDarken$1(.02,theme.button.background):curriedLighten$1(.03,theme.button.background),...inForm?{}:{boxShadow:"rgba(0,0,0,.2) 0 2px 6px 0, rgba(0,0,0,.1) 0 0 0 1px inset"}},"&:active":{background:theme.button.background},"&:focus":{boxShadow:`${rgba(theme.color.secondary,1)} 0 0 0 1px inset`,outline:"none"}}:{},({theme,outline})=>outline?{boxShadow:`${curriedTransparentize$1(.8,theme.color.defaultText)} 0 0 0 1px inset`,color:curriedTransparentize$1(.3,theme.color.defaultText),background:"transparent","&:hover, &:focus":{boxShadow:`${curriedTransparentize$1(.5,theme.color.defaultText)} 0 0 0 1px inset`,outline:"none"},"&:active":{boxShadow:`${curriedTransparentize$1(.5,theme.color.defaultText)} 0 0 0 2px inset`,color:curriedTransparentize$1(0,theme.color.defaultText)}}:{},({theme,outline,primary})=>{let color2=theme.color.primary;return outline&&primary?{boxShadow:`${color2} 0 0 0 1px inset`,color:color2,"svg path:not([fill])":{fill:color2},"&:hover":{boxShadow:`${color2} 0 0 0 1px inset`,background:"transparent"},"&:active":{background:color2,boxShadow:`${color2} 0 0 0 1px inset`,color:theme.color.tertiary},"&:focus":{boxS
2024-02-08 10:52:22 +01:00
color: ${preActive||active?theme.color.secondary:theme.color.mediumdark};
&:hover {
color: ${theme.color.secondary};
.addon-collapsible-icon {
color: ${theme.color.secondary};
}
}
`);function useList(list){let tabBarRef=(0,import_react6.useRef)(),addonsRef=(0,import_react6.useRef)(),tabRefs=(0,import_react6.useRef)(new Map),{width:tabBarWidth=1}=useResizeObserver({ref:tabBarRef}),[visibleList,setVisibleList]=(0,import_react6.useState)(list),[invisibleList,setInvisibleList]=(0,import_react6.useState)([]),previousList=(0,import_react6.useRef)(list),AddonTab=(0,import_react6.useCallback)(({menuName,actions})=>{let isAddonsActive=invisibleList.some(({active})=>active),[isTooltipVisible,setTooltipVisible]=(0,import_react6.useState)(!1);return import_react6.default.createElement(import_react6.default.Fragment,null,import_react6.default.createElement(WithToolTipState,{interactive:!0,visible:isTooltipVisible,onVisibleChange:setTooltipVisible,placement:"bottom",delayHide:100,tooltip:import_react6.default.createElement(TooltipLinkList,{links:invisibleList.map(({title,id,color:color2,active})=>({id,title,color:color2,active,onClick:e3=>{e3.preventDefault(),actions.onSelect(id)}}))})},import_react6.default.createElement(AddonButton,{ref:addonsRef,active:isAddonsActive,preActive:isTooltipVisible,style:{visibility:invisibleList.length?"visible":"hidden"},"aria-hidden":!invisibleList.length,className:"tabbutton",type:"button",role:"tab"},menuName,import_react6.default.createElement(CollapseIcon,{className:"addon-collapsible-icon",isActive:isAddonsActive||isTooltipVisible}))),invisibleList.map(({title,id,color:color2},index2)=>{let indexId=`index-${index2}`;return import_react6.default.createElement(TabButton,{id:`tabbutton-${L(id)??indexId}`,style:{visibility:"hidden"},"aria-hidden":!0,tabIndex:-1,ref:ref=>{tabRefs.current.set(id,ref)},className:"tabbutton",type:"button",key:id,textColor:color2,role:"tab"},title)}))},[invisibleList]),setTabLists=(0,import_react6.useCallback)(()=>{if(!tabBarRef.current||!addonsRef.current)return;let{x:x3,width}=tabBarRef.current.getBoundingClientRect(),{width:widthAddonsTab}=addonsRef.current.getBoundingClientRect(),rightBorder=invisibleList.length?x3+width-widthAddonsTab:x3+width,newVisibleList=[],widthSum=0,newInvisibleList=list.filter(item=>{let{id}=item,tabButton=tabRefs.current.get(id),{width:tabWidth=0}=tabButton?.getBoundingClientRect()||{},crossBorder=x3+widthSum+tabWidth>rightBorder;return(!crossBorder||!tabButton)&&newVisibleList.push(item),widthSum+=tabWidth,crossBorder});(newVisibleList.length!==visibleList.length||previousList.current!==list)&&(setVisibleList(newVisibleList),setInvisibleList(newInvisibleList),previousList.current=list)},[invisibleList.length,list,visibleList]);return(0,import_react6.useLayoutEffect)(setTabLists,[setTabLists,tabBarWidth]),{tabRefs,addonsRef,tabBarRef,visibleList,invisibleList,AddonTab}}var ignoreSsrWarning2="/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */",Wrapper2=newStyled.div(({theme,bordered})=>bordered?{backgroundClip:"padding-box",border:`1px solid ${theme.appBorderColor}`,borderRadius:theme.appBorderRadius,overflow:"hidden",boxSizing:"border-box"}:{},({absolute})=>absolute?{width:"100%",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column"}:{display:"block"}),TabBar=newStyled.div({overflow:"hidden","&:first-of-type":{marginLeft:-3},whiteSpace:"nowrap",flexGrow:1});TabBar.displayName="TabBar";var Content=newStyled.div({display:"block",position:"relative"},({theme})=>({fontSize:theme.typography.size.s2-1,background:theme.background.content}),({bordered,theme})=>bordered?{borderRadius:`0 0 ${theme.appBorderRadius-1}px ${theme.appBorderRadius-1}px`}:{},({absolute,bordered})=>absolute?{height:`calc(100% - ${bordered?42:40}px)`,position:"absolute",left:0+(bordered?1:0),right:0+(bordered?1:0),bottom:0+(bordered?1:0),top:40+(bordered?1:0),overflow:"auto",[`& > *:first-child${ignoreSsrWarning2}`]:{position:"absolute",left:0+(bordered?1:0),right:0+(bordered?1:0),bottom:0+(bordered?1:0),top:0+(bordered?1:0),height:`calc(100% - ${bordered?2:0}px)`,overflow:"auto"}}:{}),TabWrapper=({active,render,children})=>import_react6.default.createElement(Visu
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
`,LoaderWrapper=newStyled.div(({size=32})=>({borderRadius:"50%",cursor:"progress",display:"inline-block",overflow:"hidden",position:"absolute",transition:"all 200ms ease-out",verticalAlign:"top",top:"50%",left:"50%",marginTop:-(size/2),marginLeft:-(size/2),height:size,width:size,zIndex:4,borderWidth:2,borderStyle:"solid",borderColor:"rgba(97, 97, 97, 0.29)",borderTopColor:"rgb(100,100,100)",animation:`${rotate360} 0.7s linear infinite`,mixBlendMode:"difference"})),ProgressWrapper=newStyled.div({position:"absolute",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"}),ProgressTrack=newStyled.div(({theme})=>({position:"relative",width:"80%",marginBottom:"0.75rem",maxWidth:300,height:5,borderRadius:5,background:curriedTransparentize$1(.8,theme.color.secondary),overflow:"hidden",cursor:"progress"})),ProgressBar=newStyled.div(({theme})=>({position:"absolute",top:0,left:0,height:"100%",background:theme.color.secondary})),ProgressMessage=newStyled.div(({theme})=>({minHeight:"2em",fontSize:`${theme.typography.size.s1}px`,color:theme.barTextColor})),ErrorIcon=newStyled(Icons)(({theme})=>({width:20,height:20,marginBottom:"0.5rem",color:theme.textMutedColor})),ellipsis=keyframes`
from { content: "..." }
33% { content: "." }
66% { content: ".." }
to { content: "..." }
`,Ellipsis=newStyled.span({"&::after":{content:"'...'",animation:`${ellipsis} 1s linear infinite`,animationDelay:"1s",display:"inline-block",width:"1em",height:"auto"}}),Loader=({progress,error,size,...props})=>{if(error)return import_react6.default.createElement(ProgressWrapper,{"aria-label":error.toString(),"aria-live":"polite",role:"status",...props},import_react6.default.createElement(ErrorIcon,{icon:"lightningoff"}),import_react6.default.createElement(ProgressMessage,null,error.message));if(progress){let{value:value2,modules}=progress,{message}=progress;return modules&&(message+=` ${modules.complete} / ${modules.total} modules`),import_react6.default.createElement(ProgressWrapper,{"aria-label":"Content is loading...","aria-live":"polite","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":value2*100,"aria-valuetext":message,role:"progressbar",...props},import_react6.default.createElement(ProgressTrack,null,import_react6.default.createElement(ProgressBar,{style:{width:`${value2*100}%`}})),import_react6.default.createElement(ProgressMessage,null,message,value2<1&&import_react6.default.createElement(Ellipsis,{key:message})))}return import_react6.default.createElement(LoaderWrapper,{"aria-label":"Content is loading...","aria-live":"polite",role:"status",size,...props})};function parseQuery(queryString){let query={},pairs=queryString.split("&");for(let i3=0;i3<pairs.length;i3++){let pair=pairs[i3].split("=");query[decodeURIComponent(pair[0])]=decodeURIComponent(pair[1]||"")}return query}var getStoryHref=(baseUrl,storyId,additionalParams={})=>{let[url,paramsStr]=baseUrl.split("?"),params=paramsStr?{...parseQuery(paramsStr),...additionalParams,id:storyId}:{...additionalParams,id:storyId};return`${url}?${Object.entries(params).map(item=>`${item[0]}=${item[1]}`).join("&")}`},Code2=newStyled.pre`
line-height: 18px;
padding: 11px 1rem;
white-space: pre-wrap;
background: rgba(0, 0, 0, 0.05);
color: ${color.darkest};
border-radius: 3px;
margin: 1rem 0;
width: 100%;
display: block;
overflow: hidden;
font-family: ${typography.fonts.mono};
font-size: ${typography.size.s2-1}px;
2024-02-23 14:08:28 +01:00
`,ClipboardCode=({code,...props})=>import_react6.default.createElement(Code2,{id:"clipboard-code",...props},code),components2=components,resetComponents={};Object.keys(components).forEach(key2=>{resetComponents[key2]=(0,import_react6.forwardRef)((props,ref)=>(0,import_react6.createElement)(key2,{...props,ref}))});var import_react7=__toESM(require_react());var Root=newStyled.div({position:"fixed",left:0,top:0,width:"100vw",height:"100vh",overflow:"hidden"});var{SIDEBAR,CANVAS,ADDONS}=ActiveTabs2,Pane=newStyled.div({transition:"transform .2s ease",position:"absolute",top:0,height:"100%",overflow:"auto"},({theme})=>({background:theme.background.content,"&:nth-of-type(1)":{borderRight:`1px solid ${theme.appBorderColor}`},"&:nth-of-type(3)":{borderLeft:`1px solid ${theme.appBorderColor}`}}),({index:index2})=>{switch(index2){case 0:return{width:"80vw",transform:"translateX(-80vw)",left:0};case 1:return{width:"100%",transform:"translateX(0) scale(1)",left:0};case 2:return{width:"80vw",transform:"translateX(80vw)",right:0};default:return{}}},({active,index:index2})=>{switch(!0){case(index2===0&&active===SIDEBAR):return{transform:"translateX(-0px)"};case(index2===1&&active===SIDEBAR):return{transform:"translateX(40vw) translateY(-42.5vh) translateY(40px) scale(0.2)"};case(index2===1&&active===ADDONS):return{transform:"translateX(-40vw) translateY(-42.5vh) translateY(40px) scale(0.2)"};case(index2===2&&active===ADDONS):return{transform:"translateX(0px)"};default:return{}}}),Panels=import_react7.default.memo(({children,active,isFullscreen})=>import_react7.default.createElement(PanelsContainer,{isFullscreen},import_react7.Children.toArray(children).map((item,index2)=>import_react7.default.createElement(Pane,{key:index2,index:index2,active},item))));Panels.displayName="Panels";var PanelsContainer=newStyled.div({position:"fixed",top:0,left:0,width:"100vw"},({isFullscreen})=>({height:isFullscreen?"100vh":"calc(100% - 40px)"})),Bar2=newStyled.nav({position:"fixed",bottom:0,left:0,width:"100vw",height:40,display:"flex",boxShadow:"0 1px 5px 0 rgba(0, 0, 0, 0.1)","& > *":{flex:1}},({theme})=>({background:theme.barBg})),Mobile=({Sidebar:Sidebar5,Preview:Preview4,Panel:Panel3,Notifications,pages,viewMode,options:options3})=>{let[{active},setState]=(0,import_react7.useState)({active:options3.isFullscreen?CANVAS:options3.initialActive||SIDEBAR}),api=useStorybookApi(),handleCanvasClick=(0,import_react7.useCallback)(()=>{setState({active:CANVAS});let id=api.retrieveSelection();id?api.selectStory(id):api.selectFirstStory()},[]),handleSideBarClick=(0,import_react7.useCallback)(()=>{setState({active:SIDEBAR});let id=api.retrieveSelection();id?api.selectStory(id):api.selectFirstStory()},[]);return import_react7.default.createElement(Root,null,import_react7.default.createElement(Notifications,{placement:{position:"fixed",bottom:60,left:20,right:20}}),import_react7.default.createElement(Panels,{active,isFullscreen:options3.isFullscreen},import_react7.default.createElement(Sidebar5,null),import_react7.default.createElement("div",null,import_react7.default.createElement("div",{hidden:viewMode!=="docs"&&viewMode!=="story"},import_react7.default.createElement(Preview4,{showToolbar:options3.showToolbar,id:"main",viewMode})),pages.map(({id,render:Content3})=>import_react7.default.createElement(import_react7.Fragment,{key:id},import_react7.default.createElement(Content3,null)))),import_react7.default.createElement(Panel3,{hidden:viewMode!=="story"})),!options3.isFullscreen&&import_react7.default.createElement(Bar2,null,import_react7.default.createElement(TabButton,{onClick:handleSideBarClick,active:active===SIDEBAR},"Sidebar"),import_react7.default.createElement(TabButton,{onClick:handleCanvasClick,active:active===CANVAS&&(viewMode==="docs"||viewMode==="story")},"Canvas"),import_react7.default.createElement(Location,null,({path})=>import_react7.default.createElement(import_react7.default.Fragment,null,pages.map(({id,title,url})=>import_react7.default.createElement(TabButton,{key:id,onClick:()=>{setState({active:CANVAS}),api.navigateUrl(url,{plain:!1})},acti
2024-02-08 10:52:22 +01:00
`,2:`Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).
`,3:`Passed an incorrect argument to a color function, please pass a string representation of a color.
`,4:`Couldn't generate valid rgb string from %s, it returned %s.
`,5:`Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.
`,6:`Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).
`,7:`Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).
`,8:`Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.
`,9:`Please provide a number of steps to the modularScale helper.
`,10:`Please pass a number or one of the predefined scales to the modularScale helper as the ratio.
`,11:`Invalid value passed as base to modularScale, expected number or em string but got "%s"
`,12:`Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.
`,13:`Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.
`,14:`Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.
`,15:`Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.
`,16:`You must provide a template to this method.
`,17:`You passed an unsupported selector state to this method.
`,18:`minScreen and maxScreen must be provided as stringified numbers with the same units.
`,19:`fromSize and toSize must be provided as stringified numbers with the same units.
`,20:`expects either an array of objects or a single object with the properties prop, fromSize, and toSize.
`,21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:`fontFace expects a name of a font-family.
`,24:`fontFace expects either the path to the font file(s) or a name of a local copy.
`,25:`fontFace expects localFonts to be an array.
`,26:`fontFace expects fileFormats to be an array.
`,27:`radialGradient requries at least 2 color-stops to properly render.
`,28:`Please supply a filename to retinaImage() as the first argument.
`,29:`Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.
`,30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:`The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation
`,32:`To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])
To pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')
`,33:`The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation
`,34:`borderRadius expects a radius value as a string or number as the second argument.
`,35:`borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.
`,36:`Property must be a string value.
`,37:`Syntax Error at %s.
`,38:`Formula contains a function that needs parentheses at %s.
`,39:`Formula is missing closing parenthesis at %s.
`,40:`Formula has too many closing parentheses at %s.
`,41:`All values in a formula must have the same unit or be unitless.
`,42:`Please provide a number of steps to the modularScale helper.
`,43:`Please pass a number or one of the predefined scales to the modularScale helper as the ratio.
`,44:`Invalid value passed as base to modularScale, expected number or em/rem string but got %s.
`,45:`Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.
`,46:`Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.
`,47:`minScreen and maxScreen must be provided as stringified numbers with the same units.
`,48:`fromSize and toSize must be provided as stringified numbers with the same units.
`,49:`Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.
`,50:`Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.
`,51:`Expects the first argument object to have the properties prop, fromSize, and toSize.
`,52:`fontFace expects either the path to the font file(s) or a name of a local copy.
`,53:`fontFace expects localFonts to be an array.
`,54:`fontFace expects fileFormats to be an array.
`,55:`fontFace expects a name of a font-family.
`,56:`linearGradient requries at least 2 color-stops to properly render.
`,57:`radialGradient requries at least 2 color-stops to properly render.
`,58:`Please supply a filename to retinaImage() as the first argument.
`,59:`Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.
`,60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:`Property must be a string value.
`,62:`borderRadius expects a radius value as a string or number as the second argument.
`,63:`borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.
`,64:`The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.
`,65:`To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').
`,66:`The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.
`,67:`You must provide a template to this method.
`,68:`You passed an unsupported selector state to this method.
`,69:`Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.
`,70:`Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.
`,71:`Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.
`,72:`Passed invalid base value %s to %s(), please pass a value like "12px" or 12.
`,73:`Please provide a valid CSS variable.
`,74:`CSS variable not found and no default was provided.
`,75:`important requires a valid style object, got a %s instead.
`,76:`fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.
`,77:`remToPx expects a value in "rem" but you provided it in "%s".
`,78:`base must be set in "px" or "%" but you set it in "%s".
`};function format2(){for(var _len=arguments.length,args2=new Array(_len),_key=0;_key<_len;_key++)args2[_key]=arguments[_key];var a2=args2[0],b3=[],c3;for(c3=1;c3<args2.length;c3+=1)b3.push(args2[c3]);return b3.forEach(function(d2){a2=a2.replace(/%[a-z]/,d2)}),a2}var PolishedError2=function(_Error){_inheritsLoose2(PolishedError3,_Error);function PolishedError3(code){for(var _this,_len2=arguments.length,args2=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++)args2[_key2-1]=arguments[_key2];return _this=_Error.call(this,format2.apply(void 0,[ERRORS2[code]].concat(args2)))||this,_assertThisInitialized2(_this)}return PolishedError3}(_wrapNativeSuper2(Error));function colorToInt2(color2){return Math.round(color2*255)}function convertToInt2(red,green,blue){return colorToInt2(red)+","+colorToInt2(green)+","+colorToInt2(blue)}function hslToRgb2(hue,saturation,lightness,convert){if(convert===void 0&&(convert=convertToInt2),saturation===0)return convert(lightness,lightness,lightness);var huePrime=(hue%360+360)%360/60,chroma=(1-Math.abs(2*lightness-1))*saturation,secondComponent=chroma*(1-Math.abs(huePrime%2-1)),red=0,green=0,blue=0;huePrime>=0&&huePrime<1?(red=chroma,green=secondComponent):huePrime>=1&&huePrime<2?(red=secondComponent,green=chroma):huePrime>=2&&huePrime<3?(green=chroma,blue=secondComponent):huePrime>=3&&huePrime<4?(green=secondComponent,blue=chroma):huePrime>=4&&huePrime<5?(red=secondComponent,blue=chroma):huePrime>=5&&huePrime<6&&(red=chroma,blue=secondComponent);var lightnessModification=lightness-chroma/2,finalRed=red+lightnessModification,finalGreen=green+lightnessModification,finalBlue=blue+lightnessModification;return convert(finalRed,finalGreen,finalBlue)}var namedColorMap2={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salm
padding: 0;
vertical-align: middle;
& + & {
margin-left: 6px;
}
`),Shortcut=({keys:keys2})=>import_react29.default.createElement(import_react29.default.Fragment,null,import_react29.default.createElement(Key,null,keys2.map((key2,index2)=>import_react29.default.createElement(KeyChild,{key:key2},shortcutToHumanString([key2]))))),useMenu=(state,api,showToolbar,isFullscreen,showPanel,showNav,enableShortcuts)=>{let theme=useTheme(),shortcutKeys=api.getShortcutKeys(),about=(0,import_react29.useMemo)(()=>({id:"about",title:"About your Storybook",onClick:()=>api.navigateToSettingsPage("/settings/about")}),[api]),whatsNewNotificationsEnabled=state.whatsNewData?.status==="SUCCESS"&&!state.disableWhatsNewNotifications,isWhatsNewUnread=api.isWhatsNewUnread(),whatsNew=(0,import_react29.useMemo)(()=>({id:"whats-new",title:"What's new?",onClick:()=>api.navigateToSettingsPage("/settings/whats-new"),right:whatsNewNotificationsEnabled&&isWhatsNewUnread&&import_react29.default.createElement(Badge,{status:"positive"},"Check it out")}),[api,whatsNewNotificationsEnabled,isWhatsNewUnread]),shortcuts=(0,import_react29.useMemo)(()=>({id:"shortcuts",title:"Keyboard shortcuts",onClick:()=>api.navigateToSettingsPage("/settings/shortcuts"),right:enableShortcuts?import_react29.default.createElement(Shortcut,{keys:shortcutKeys.shortcutsPage}):null,style:{borderBottom:`4px solid ${theme.appBorderColor}`}}),[api,enableShortcuts,shortcutKeys.shortcutsPage,theme.appBorderColor]),sidebarToggle=(0,import_react29.useMemo)(()=>({id:"S",title:"Show sidebar",onClick:()=>api.toggleNav(),active:showNav,right:enableShortcuts?import_react29.default.createElement(Shortcut,{keys:shortcutKeys.toggleNav}):null,left:showNav?import_react29.default.createElement(Icons,{icon:"check"}):null}),[api,enableShortcuts,shortcutKeys,showNav]),toolbarToogle=(0,import_react29.useMemo)(()=>({id:"T",title:"Show toolbar",onClick:()=>api.toggleToolbar(),active:showToolbar,right:enableShortcuts?import_react29.default.createElement(Shortcut,{keys:shortcutKeys.toolbar}):null,left:showToolbar?import_react29.default.createElement(Icons,{icon:"check"}):null}),[api,enableShortcuts,shortcutKeys,showToolbar]),addonsToggle=(0,import_react29.useMemo)(()=>({id:"A",title:"Show addons",onClick:()=>api.togglePanel(),active:showPanel,right:enableShortcuts?import_react29.default.createElement(Shortcut,{keys:shortcutKeys.togglePanel}):null,left:showPanel?import_react29.default.createElement(Icons,{icon:"check"}):null}),[api,enableShortcuts,shortcutKeys,showPanel]),addonsOrientationToggle=(0,import_react29.useMemo)(()=>({id:"D",title:"Change addons orientation",onClick:()=>api.togglePanelPosition(),right:enableShortcuts?import_react29.default.createElement(Shortcut,{keys:shortcutKeys.panelPosition}):null}),[api,enableShortcuts,shortcutKeys]),fullscreenToggle=(0,import_react29.useMemo)(()=>({id:"F",title:"Go full screen",onClick:()=>api.toggleFullscreen(),active:isFullscreen,right:enableShortcuts?import_react29.default.createElement(Shortcut,{keys:shortcutKeys.fullScreen}):null,left:isFullscreen?import_react29.default.createElement(Icons,{icon:"check"}):null}),[api,enableShortcuts,shortcutKeys,isFullscreen]),searchToggle=(0,import_react29.useMemo)(()=>({id:"/",title:"Search",onClick:()=>api.focusOnUIElement(focusableUIElements2.storySearchField),right:enableShortcuts?import_react29.default.createElement(Shortcut,{keys:shortcutKeys.search}):null}),[api,enableShortcuts,shortcutKeys]),up=(0,import_react29.useMemo)(()=>({id:"up",title:"Previous component",onClick:()=>api.jumpToComponent(-1),right:enableShortcuts?import_react29.default.createElement(Shortcut,{keys:shortcutKeys.prevComponent}):null}),[api,enableShortcuts,shortcutKeys]),down=(0,import_react29.useMemo)(()=>({id:"down",title:"Next component",onClick:()=>api.jumpToComponent(1),right:enableShortcuts?import_react29.default.createElement(Shortcut,{keys:shortcutKeys.nextComponent}):null}),[api,enableShortcuts,shortcutKeys]),prev=(0,import_react29.useMemo)(()=>({id:"prev",title:"Previous story",onClick:()=>api.jumpToStory(-1),right:enableShortcuts?import_react29.default.createElement(Shortcut,{keys:shortcutKeys.prevS
0%,100% { opacity: 0; }
50% { opacity: 1; }
`,SuccessIcon=newStyled(Icons)(({valid,theme})=>valid==="valid"?{color:theme.color.positive,animation:`${Fade} 2s ease forwards`}:{opacity:0},{alignSelf:"center",display:"flex",marginLeft:10,height:14,width:14}),Container6=newStyled.div(({theme})=>({fontSize:theme.typography.size.s2,padding:"3rem 20px",maxWidth:600,margin:"0 auto"})),shortcutLabels={fullScreen:"Go full screen",togglePanel:"Toggle addons",panelPosition:"Toggle addons orientation",toggleNav:"Toggle sidebar",toolbar:"Toggle canvas toolbar",search:"Focus search",focusNav:"Focus sidebar",focusIframe:"Focus canvas",focusPanel:"Focus addons",prevComponent:"Previous component",nextComponent:"Next component",prevStory:"Previous story",nextStory:"Next story",shortcutsPage:"Go to shortcuts page",aboutPage:"Go to about page",collapseAll:"Collapse all items on sidebar",expandAll:"Expand all items on sidebar",remount:"Remount component"},fixedShortcuts=["escape"];function toShortcutState(shortcutKeys){return Object.entries(shortcutKeys).reduce((acc,[feature,shortcut])=>fixedShortcuts.includes(feature)?acc:{...acc,[feature]:{shortcut,error:!1}},{})}var ShortcutsScreen=class extends import_react55.Component{constructor(props){super(props);this.onKeyDown=e3=>{let{activeFeature,shortcutKeys}=this.state;if(e3.key==="Backspace")return this.restoreDefault();let shortcut=eventToShortcut(e3);if(!shortcut)return!1;let error=!!Object.entries(shortcutKeys).find(([feature,{shortcut:existingShortcut}])=>feature!==activeFeature&&existingShortcut&&shortcutMatchesShortcut(shortcut,existingShortcut));return this.setState({shortcutKeys:{...shortcutKeys,[activeFeature]:{shortcut,error}}})};this.onFocus=focusedInput=>()=>{let{shortcutKeys}=this.state;this.setState({activeFeature:focusedInput,shortcutKeys:{...shortcutKeys,[focusedInput]:{shortcut:null,error:!1}}})};this.onBlur=async()=>{let{shortcutKeys,activeFeature}=this.state;if(shortcutKeys[activeFeature]){let{shortcut,error}=shortcutKeys[activeFeature];return!shortcut||error?this.restoreDefault():this.saveShortcut()}return!1};this.saveShortcut=async()=>{let{activeFeature,shortcutKeys}=this.state,{setShortcut}=this.props;await setShortcut(activeFeature,shortcutKeys[activeFeature].shortcut),this.setState({successField:activeFeature})};this.restoreDefaults=async()=>{let{restoreAllDefaultShortcuts}=this.props,defaultShortcuts2=await restoreAllDefaultShortcuts();return this.setState({shortcutKeys:toShortcutState(defaultShortcuts2)})};this.restoreDefault=async()=>{let{activeFeature,shortcutKeys}=this.state,{restoreDefaultShortcut}=this.props,defaultShortcut=await restoreDefaultShortcut(activeFeature);return this.setState({shortcutKeys:{...shortcutKeys,...toShortcutState({[activeFeature]:defaultShortcut})}})};this.displaySuccessMessage=activeElement=>{let{successField,shortcutKeys}=this.state;return activeElement===successField&&shortcutKeys[activeElement].error===!1?"valid":void 0};this.displayError=activeElement=>{let{activeFeature,shortcutKeys}=this.state;return activeElement===activeFeature&&shortcutKeys[activeElement].error===!0?"error":void 0};this.renderKeyInput=()=>{let{shortcutKeys,addonsShortcutLabels}=this.state;return Object.entries(shortcutKeys).map(([feature,{shortcut}])=>import_react55.default.createElement(Row,{key:feature},import_react55.default.createElement(Description,null,shortcutLabels[feature]||addonsShortcutLabels[feature]),import_react55.default.createElement(TextInput,{spellCheck:"false",valid:this.displayError(feature),className:"modalInput",onBlur:this.onBlur,onFocus:this.onFocus(feature),onKeyDown:this.onKeyDown,value:shortcut?shortcutToHumanString(shortcut):"",placeholder:"Type keys",readOnly:!0}),import_react55.default.createElement(SuccessIcon,{valid:this.displaySuccessMessage(feature),icon:"check"})))};this.renderKeyForm=()=>import_react55.default.createElement(GridWrapper,null,import_react55.default.createElement(GridHeaderRow,null,import_react55.default.createElement(HeaderItem,null,"Commands"),import_react55.default.createElement(HeaderItem,null,"Shortcut")),this.renderKeyInput());this.state={activeFeatur