@shlinkio/shlink-frontend-kit 0.4.2 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.d.ts +11 -9
- package/dist/index.js +182 -1360
- package/dist/index.umd.cjs +1 -4
- package/package.json +21 -19
package/dist/index.umd.cjs
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
(function(p,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("react/jsx-runtime"),require("@fortawesome/free-solid-svg-icons"),require("@fortawesome/react-fontawesome"),require("reactstrap"),require("react"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@fortawesome/free-solid-svg-icons","@fortawesome/react-fontawesome","reactstrap","react","react-router-dom"],u):(p=typeof globalThis<"u"?globalThis:p||self,u(p["shlink-frontend-kit"]={},p.jsxRuntime,p.freeSolidSvgIcons,p.reactFontawesome,p.reactstrap,p.react,p.reactRouterDom))})(this,function(p,u,te,ue,S,A,je){"use strict";function Je(r){var e,t,n="";if(typeof r=="string"||typeof r=="number")n+=r;else if(typeof r=="object")if(Array.isArray(r)){var a=r.length;for(e=0;e<a;e++)r[e]&&(t=Je(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function _(){for(var r,e,t=0,n="",a=arguments.length;t<a;t++)(r=arguments[t])&&(e=Je(r))&&(n&&(n+=" "),n+=e);return n}const Br=r=>({error:"border-danger",default:""})[r],Gr=r=>({error:"text-danger",default:"text-muted"})[r],Hr=({className:r,children:e,loading:t=!1,type:n="default",fullWidth:a=!1})=>{const o=_({"col-md-12":a,"col-md-10 offset-md-1":!a});return u.jsx(S.Row,{className:_("g-0",r),children:u.jsx("div",{className:o,children:u.jsx(S.Card,{className:Br(n),body:!0,children:u.jsxs("h3",{className:_("text-center mb-0",Gr(n)),children:[t&&u.jsx(ue.FontAwesomeIcon,{icon:te.faCircleNotch,spin:!0}),t&&u.jsx("span",{className:"ms-2",children:e??"Loading..."}),!t&&e]})})})})},Ye=({title:r,children:e,bodyClassName:t,...n})=>u.jsxs(S.Card,{...n,children:[r&&u.jsx(S.CardHeader,{role:"heading","aria-level":4,children:r}),u.jsx(S.CardBody,{className:t,children:e})]}),Wr=({children:r,type:e,className:t,small:n=!1})=>u.jsx(S.Row,{className:t,children:u.jsx("div",{className:_({"col-md-10 offset-md-1":!n,"col-12":n}),children:u.jsx(Ye,{role:"document",className:_("text-center",{"bg-main":e==="success","bg-danger":e==="error","bg-warning":e==="warning","text-white":e!=="warning"}),bodyClassName:_({"p-2":n}),children:r})})});let se;const qr=new Uint8Array(16);function Qr(){if(!se&&(se=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!se))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return se(qr)}const O=[];for(let r=0;r<256;++r)O.push((r+256).toString(16).slice(1));function Vr(r,e=0){return O[r[e+0]]+O[r[e+1]]+O[r[e+2]]+O[r[e+3]]+"-"+O[r[e+4]]+O[r[e+5]]+"-"+O[r[e+6]]+O[r[e+7]]+"-"+O[r[e+8]]+O[r[e+9]]+"-"+O[r[e+10]]+O[r[e+11]]+O[r[e+12]]+O[r[e+13]]+O[r[e+14]]+O[r[e+15]]}const Ke={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function zr(r,e,t){if(Ke.randomUUID&&!e&&!r)return Ke.randomUUID();r=r||{};const n=r.random||(r.rng||Qr)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){t=t||0;for(let a=0;a<16;++a)e[t+a]=n[a];return e}return Vr(n)}function jr(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Jr(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var a=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return r[n]}})}),t}var Yr=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;e[t]=a;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(e,t);if(l.value!==a||l.enumerable!==!0)return!1}return!0},Xe=typeof Symbol<"u"&&Symbol,Kr=Yr,Xr=function(){return typeof Xe!="function"||typeof Symbol!="function"||typeof Xe("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Kr()},Ze={foo:{}},Zr=Object,et=function(){return{__proto__:Ze}.foo===Ze.foo&&!({__proto__:null}instanceof Zr)},rt="Function.prototype.bind called on incompatible ",Ae=Array.prototype.slice,tt=Object.prototype.toString,nt="[object Function]",ot=function(e){var t=this;if(typeof t!="function"||tt.call(t)!==nt)throw new TypeError(rt+t);for(var n=Ae.call(arguments,1),a,o=function(){if(this instanceof a){var s=t.apply(this,n.concat(Ae.call(arguments)));return Object(s)===s?s:this}else return t.apply(e,n.concat(Ae.call(arguments)))},l=Math.max(0,t.length-n.length),i=[],c=0;c<l;c++)i.push("$"+c);if(a=Function("binder","return function ("+i.join(",")+"){ return binder.apply(this,arguments); }")(o),t.prototype){var f=function(){};f.prototype=t.prototype,a.prototype=new f,f.prototype=null}return a},at=ot,Pe=Function.prototype.bind||at,it=Pe,lt=it.call(Function.call,Object.prototype.hasOwnProperty),d,q=SyntaxError,er=Function,Q=TypeError,Ee=function(r){try{return er('"use strict"; return ('+r+").constructor;")()}catch{}},B=Object.getOwnPropertyDescriptor;if(B)try{B({},"")}catch{B=null}var Ie=function(){throw new Q},ct=B?function(){try{return arguments.callee,Ie}catch{try{return B(arguments,"callee").get}catch{return Ie}}}():Ie,V=Xr(),ft=et(),b=Object.getPrototypeOf||(ft?function(r){return r.__proto__}:null),z={},ut=typeof Uint8Array>"u"||!b?d:b(Uint8Array),G={"%AggregateError%":typeof AggregateError>"u"?d:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?d:ArrayBuffer,"%ArrayIteratorPrototype%":V&&b?b([][Symbol.iterator]()):d,"%AsyncFromSyncIteratorPrototype%":d,"%AsyncFunction%":z,"%AsyncGenerator%":z,"%AsyncGeneratorFunction%":z,"%AsyncIteratorPrototype%":z,"%Atomics%":typeof Atomics>"u"?d:Atomics,"%BigInt%":typeof BigInt>"u"?d:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?d:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?d:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?d:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?d:Float32Array,"%Float64Array%":typeof Float64Array>"u"?d:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?d:FinalizationRegistry,"%Function%":er,"%GeneratorFunction%":z,"%Int8Array%":typeof Int8Array>"u"?d:Int8Array,"%Int16Array%":typeof Int16Array>"u"?d:Int16Array,"%Int32Array%":typeof Int32Array>"u"?d:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":V&&b?b(b([][Symbol.iterator]())):d,"%JSON%":typeof JSON=="object"?JSON:d,"%Map%":typeof Map>"u"?d:Map,"%MapIteratorPrototype%":typeof Map>"u"||!V||!b?d:b(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?d:Promise,"%Proxy%":typeof Proxy>"u"?d:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?d:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?d:Set,"%SetIteratorPrototype%":typeof Set>"u"||!V||!b?d:b(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?d:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":V&&b?b(""[Symbol.iterator]()):d,"%Symbol%":V?Symbol:d,"%SyntaxError%":q,"%ThrowTypeError%":ct,"%TypedArray%":ut,"%TypeError%":Q,"%Uint8Array%":typeof Uint8Array>"u"?d:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?d:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?d:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?d:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?d:WeakMap,"%WeakRef%":typeof WeakRef>"u"?d:WeakRef,"%WeakSet%":typeof WeakSet>"u"?d:WeakSet};if(b)try{null.error}catch(r){var st=b(b(r));G["%Error.prototype%"]=st}var pt=function r(e){var t;if(e==="%AsyncFunction%")t=Ee("async function () {}");else if(e==="%GeneratorFunction%")t=Ee("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=Ee("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var a=r("%AsyncGenerator%");a&&b&&(t=b(a.prototype))}return G[e]=t,t},rr={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ne=Pe,pe=lt,yt=ne.call(Function.call,Array.prototype.concat),dt=ne.call(Function.apply,Array.prototype.splice),tr=ne.call(Function.call,String.prototype.replace),ye=ne.call(Function.call,String.prototype.slice),vt=ne.call(Function.call,RegExp.prototype.exec),mt=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ht=/\\(\\)?/g,gt=function(e){var t=ye(e,0,1),n=ye(e,-1);if(t==="%"&&n!=="%")throw new q("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new q("invalid intrinsic syntax, expected opening `%`");var a=[];return tr(e,mt,function(o,l,i,c){a[a.length]=i?tr(c,ht,"$1"):l||o}),a},St=function(e,t){var n=e,a;if(pe(rr,n)&&(a=rr[n],n="%"+a[0]+"%"),pe(G,n)){var o=G[n];if(o===z&&(o=pt(n)),typeof o>"u"&&!t)throw new Q("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:a,name:n,value:o}}throw new q("intrinsic "+e+" does not exist!")},_e=function(e,t){if(typeof e!="string"||e.length===0)throw new Q("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Q('"allowMissing" argument must be a boolean');if(vt(/^%?[^%]*%?$/,e)===null)throw new q("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=gt(e),a=n.length>0?n[0]:"",o=St("%"+a+"%",t),l=o.name,i=o.value,c=!1,f=o.alias;f&&(a=f[0],dt(n,yt([0,1],f)));for(var s=1,m=!0;s<n.length;s+=1){var y=n[s],g=ye(y,0,1),v=ye(y,-1);if((g==='"'||g==="'"||g==="`"||v==='"'||v==="'"||v==="`")&&g!==v)throw new q("property names with quotes must have matching quotes");if((y==="constructor"||!m)&&(c=!0),a+="."+y,l="%"+a+"%",pe(G,l))i=G[l];else if(i!=null){if(!(y in i)){if(!t)throw new Q("base intrinsic for "+e+" exists, but the property is not available.");return}if(B&&s+1>=n.length){var I=B(i,y);m=!!I,m&&"get"in I&&!("originalValue"in I.get)?i=I.get:i=i[y]}else m=pe(i,y),i=i[y];m&&!c&&(G[l]=i)}}return i},nr={exports:{}};(function(r){var e=Pe,t=_e,n=t("%Function.prototype.apply%"),a=t("%Function.prototype.call%"),o=t("%Reflect.apply%",!0)||e.call(a,n),l=t("%Object.getOwnPropertyDescriptor%",!0),i=t("%Object.defineProperty%",!0),c=t("%Math.max%");if(i)try{i({},"a",{value:1})}catch{i=null}r.exports=function(m){var y=o(e,a,arguments);if(l&&i){var g=l(y,"length");g.configurable&&i(y,"length",{value:1+c(0,m.length-(arguments.length-1))})}return y};var f=function(){return o(e,n,arguments)};i?i(r.exports,"apply",{value:f}):r.exports.apply=f})(nr);var bt=nr.exports,or=_e,ar=bt,wt=ar(or("String.prototype.indexOf")),Ot=function(e,t){var n=or(e,!!t);return typeof n=="function"&&wt(e,".prototype.")>-1?ar(n):n};const At=Jr(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Ne=typeof Map=="function"&&Map.prototype,Fe=Object.getOwnPropertyDescriptor&&Ne?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,de=Ne&&Fe&&typeof Fe.get=="function"?Fe.get:null,ir=Ne&&Map.prototype.forEach,Ce=typeof Set=="function"&&Set.prototype,Te=Object.getOwnPropertyDescriptor&&Ce?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ve=Ce&&Te&&typeof Te.get=="function"?Te.get:null,lr=Ce&&Set.prototype.forEach,Pt=typeof WeakMap=="function"&&WeakMap.prototype,oe=Pt?WeakMap.prototype.has:null,Et=typeof WeakSet=="function"&&WeakSet.prototype,ae=Et?WeakSet.prototype.has:null,It=typeof WeakRef=="function"&&WeakRef.prototype,cr=It?WeakRef.prototype.deref:null,_t=Boolean.prototype.valueOf,Nt=Object.prototype.toString,Ft=Function.prototype.toString,Ct=String.prototype.match,$e=String.prototype.slice,M=String.prototype.replace,Tt=String.prototype.toUpperCase,fr=String.prototype.toLowerCase,ur=RegExp.prototype.test,sr=Array.prototype.concat,F=Array.prototype.join,$t=Array.prototype.slice,pr=Math.floor,De=typeof BigInt=="function"?BigInt.prototype.valueOf:null,xe=Object.getOwnPropertySymbols,Me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,j=typeof Symbol=="function"&&typeof Symbol.iterator=="object",P=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===j||"symbol")?Symbol.toStringTag:null,yr=Object.prototype.propertyIsEnumerable,dr=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function vr(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||ur.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-pr(-r):pr(r);if(n!==r){var a=String(n),o=$e.call(e,a.length+1);return M.call(a,t,"$&_")+"."+M.call(M.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return M.call(e,t,"$&_")}var ke=At,mr=ke.custom,hr=br(mr)?mr:null,Dt=function r(e,t,n,a){var o=t||{};if(k(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(k(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=k(o,"customInspect")?o.customInspect:!0;if(typeof l!="boolean"&&l!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(k(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(k(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var i=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Or(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return i?vr(e,c):c}if(typeof e=="bigint"){var f=String(e)+"n";return i?vr(e,f):f}var s=typeof o.depth>"u"?5:o.depth;if(typeof n>"u"&&(n=0),n>=s&&s>0&&typeof e=="object")return Re(e)?"[Array]":"[Object]";var m=Kt(o,n);if(typeof a>"u")a=[];else if(wr(a,e)>=0)return"[Circular]";function y(x,ee,Oe){if(ee&&(a=$t.call(a),a.push(ee)),Oe){var re={depth:o.depth};return k(o,"quoteStyle")&&(re.quoteStyle=o.quoteStyle),r(x,re,n+1,a)}return r(x,o,n+1,a)}if(typeof e=="function"&&!Sr(e)){var g=Ht(e),v=me(e,y);return"[Function"+(g?": "+g:" (anonymous)")+"]"+(v.length>0?" { "+F.call(v,", ")+" }":"")}if(br(e)){var I=j?M.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Me.call(e);return typeof e=="object"&&!j?ie(I):I}if(jt(e)){for(var $="<"+fr.call(String(e.nodeName)),h=e.attributes||[],D=0;D<h.length;D++)$+=" "+h[D].name+"="+gr(xt(h[D].value),"double",o);return $+=">",e.childNodes&&e.childNodes.length&&($+="..."),$+="</"+fr.call(String(e.nodeName))+">",$}if(Re(e)){if(e.length===0)return"[]";var L=me(e,y);return m&&!Yt(L)?"["+Ue(L,m)+"]":"[ "+F.call(L,", ")+" ]"}if(kt(e)){var K=me(e,y);return!("cause"in Error.prototype)&&"cause"in e&&!yr.call(e,"cause")?"{ ["+String(e)+"] "+F.call(sr.call("[cause]: "+y(e.cause),K),", ")+" }":K.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+F.call(K,", ")+" }"}if(typeof e=="object"&&l){if(hr&&typeof e[hr]=="function"&&ke)return ke(e,{depth:s-n});if(l!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Wt(e)){var ce=[];return ir&&ir.call(e,function(x,ee){ce.push(y(ee,e,!0)+" => "+y(x,e))}),Ar("Map",de.call(e),ce,m)}if(Vt(e)){var we=[];return lr&&lr.call(e,function(x){we.push(y(x,e))}),Ar("Set",ve.call(e),we,m)}if(qt(e))return Le("WeakMap");if(zt(e))return Le("WeakSet");if(Qt(e))return Le("WeakRef");if(Lt(e))return ie(y(Number(e)));if(Bt(e))return ie(y(De.call(e)));if(Ut(e))return ie(_t.call(e));if(Rt(e))return ie(y(String(e)));if(!Mt(e)&&!Sr(e)){var W=me(e,y),U=dr?dr(e)===Object.prototype:e instanceof Object||e.constructor===Object,X=e instanceof Object?"":"null prototype",Z=!U&&P&&Object(e)===e&&P in e?$e.call(R(e),8,-1):X?"Object":"",fe=U||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",N=fe+(Z||X?"["+F.call(sr.call([],Z||[],X||[]),": ")+"] ":"");return W.length===0?N+"{}":m?N+"{"+Ue(W,m)+"}":N+"{ "+F.call(W,", ")+" }"}return String(e)};function gr(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function xt(r){return M.call(String(r),/"/g,""")}function Re(r){return R(r)==="[object Array]"&&(!P||!(typeof r=="object"&&P in r))}function Mt(r){return R(r)==="[object Date]"&&(!P||!(typeof r=="object"&&P in r))}function Sr(r){return R(r)==="[object RegExp]"&&(!P||!(typeof r=="object"&&P in r))}function kt(r){return R(r)==="[object Error]"&&(!P||!(typeof r=="object"&&P in r))}function Rt(r){return R(r)==="[object String]"&&(!P||!(typeof r=="object"&&P in r))}function Lt(r){return R(r)==="[object Number]"&&(!P||!(typeof r=="object"&&P in r))}function Ut(r){return R(r)==="[object Boolean]"&&(!P||!(typeof r=="object"&&P in r))}function br(r){if(j)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!Me)return!1;try{return Me.call(r),!0}catch{}return!1}function Bt(r){if(!r||typeof r!="object"||!De)return!1;try{return De.call(r),!0}catch{}return!1}var Gt=Object.prototype.hasOwnProperty||function(r){return r in this};function k(r,e){return Gt.call(r,e)}function R(r){return Nt.call(r)}function Ht(r){if(r.name)return r.name;var e=Ct.call(Ft.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function wr(r,e){if(r.indexOf)return r.indexOf(e);for(var t=0,n=r.length;t<n;t++)if(r[t]===e)return t;return-1}function Wt(r){if(!de||!r||typeof r!="object")return!1;try{de.call(r);try{ve.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function qt(r){if(!oe||!r||typeof r!="object")return!1;try{oe.call(r,oe);try{ae.call(r,ae)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function Qt(r){if(!cr||!r||typeof r!="object")return!1;try{return cr.call(r),!0}catch{}return!1}function Vt(r){if(!ve||!r||typeof r!="object")return!1;try{ve.call(r);try{de.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function zt(r){if(!ae||!r||typeof r!="object")return!1;try{ae.call(r,ae);try{oe.call(r,oe)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function jt(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function Or(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return Or($e.call(r,0,e.maxStringLength),e)+n}var a=M.call(M.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Jt);return gr(a,"single",e)}function Jt(r){var e=r.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+Tt.call(e.toString(16))}function ie(r){return"Object("+r+")"}function Le(r){return r+" { ? }"}function Ar(r,e,t,n){var a=n?Ue(t,n):F.call(t,", ");return r+" ("+e+") {"+a+"}"}function Yt(r){for(var e=0;e<r.length;e++)if(wr(r[e],`
|
|
2
|
-
`)>=0)return!1;return!0}function Kt(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=F.call(Array(r.indent+1)," ");else return null;return{base:t,prev:F.call(Array(e+1),t)}}function Ue(r,e){if(r.length===0)return"";var t=`
|
|
3
|
-
`+e.prev+e.base;return t+F.call(r,","+t)+`
|
|
4
|
-
`+e.prev}function me(r,e){var t=Re(r),n=[];if(t){n.length=r.length;for(var a=0;a<r.length;a++)n[a]=k(r,a)?e(r[a],r):""}var o=typeof xe=="function"?xe(r):[],l;if(j){l={};for(var i=0;i<o.length;i++)l["$"+o[i]]=o[i]}for(var c in r)k(r,c)&&(t&&String(Number(c))===c&&c<r.length||j&&l["$"+c]instanceof Symbol||(ur.call(/[^\w$]/,c)?n.push(e(c,r)+": "+e(r[c],r)):n.push(c+": "+e(r[c],r))));if(typeof xe=="function")for(var f=0;f<o.length;f++)yr.call(r,o[f])&&n.push("["+e(o[f])+"]: "+e(r[o[f]],r));return n}var Be=_e,J=Ot,Xt=Dt,Zt=Be("%TypeError%"),he=Be("%WeakMap%",!0),ge=Be("%Map%",!0),en=J("WeakMap.prototype.get",!0),rn=J("WeakMap.prototype.set",!0),tn=J("WeakMap.prototype.has",!0),nn=J("Map.prototype.get",!0),on=J("Map.prototype.set",!0),an=J("Map.prototype.has",!0),Ge=function(r,e){for(var t=r,n;(n=t.next)!==null;t=n)if(n.key===e)return t.next=n.next,n.next=r.next,r.next=n,n},ln=function(r,e){var t=Ge(r,e);return t&&t.value},cn=function(r,e,t){var n=Ge(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},fn=function(r,e){return!!Ge(r,e)},un=function(){var e,t,n,a={assert:function(o){if(!a.has(o))throw new Zt("Side channel does not contain "+Xt(o))},get:function(o){if(he&&o&&(typeof o=="object"||typeof o=="function")){if(e)return en(e,o)}else if(ge){if(t)return nn(t,o)}else if(n)return ln(n,o)},has:function(o){if(he&&o&&(typeof o=="object"||typeof o=="function")){if(e)return tn(e,o)}else if(ge){if(t)return an(t,o)}else if(n)return fn(n,o);return!1},set:function(o,l){he&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new he),rn(e,o,l)):ge?(t||(t=new ge),on(t,o,l)):(n||(n={key:{},next:null}),cn(n,o,l))}};return a},sn=String.prototype.replace,pn=/%20/g,He={RFC1738:"RFC1738",RFC3986:"RFC3986"},We={default:He.RFC3986,formatters:{RFC1738:function(r){return sn.call(r,pn,"+")},RFC3986:function(r){return String(r)}},RFC1738:He.RFC1738,RFC3986:He.RFC3986},yn=We,qe=Object.prototype.hasOwnProperty,H=Array.isArray,C=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),dn=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(H(n)){for(var a=[],o=0;o<n.length;++o)typeof n[o]<"u"&&a.push(n[o]);t.obj[t.prop]=a}}},Pr=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},a=0;a<e.length;++a)typeof e[a]<"u"&&(n[a]=e[a]);return n},vn=function r(e,t,n){if(!t)return e;if(typeof t!="object"){if(H(e))e.push(t);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!qe.call(Object.prototype,t))&&(e[t]=!0);else return[e,t];return e}if(!e||typeof e!="object")return[e].concat(t);var a=e;return H(e)&&!H(t)&&(a=Pr(e,n)),H(e)&&H(t)?(t.forEach(function(o,l){if(qe.call(e,l)){var i=e[l];i&&typeof i=="object"&&o&&typeof o=="object"?e[l]=r(i,o,n):e.push(o)}else e[l]=o}),e):Object.keys(t).reduce(function(o,l){var i=t[l];return qe.call(o,l)?o[l]=r(o[l],i,n):o[l]=i,o},a)},mn=function(e,t){return Object.keys(t).reduce(function(n,a){return n[a]=t[a],n},e)},hn=function(r,e,t){var n=r.replace(/\+/g," ");if(t==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},gn=function(e,t,n,a,o){if(e.length===0)return e;var l=e;if(typeof e=="symbol"?l=Symbol.prototype.toString.call(e):typeof e!="string"&&(l=String(e)),n==="iso-8859-1")return escape(l).replace(/%u[0-9a-f]{4}/gi,function(s){return"%26%23"+parseInt(s.slice(2),16)+"%3B"});for(var i="",c=0;c<l.length;++c){var f=l.charCodeAt(c);if(f===45||f===46||f===95||f===126||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||o===yn.RFC1738&&(f===40||f===41)){i+=l.charAt(c);continue}if(f<128){i=i+C[f];continue}if(f<2048){i=i+(C[192|f>>6]+C[128|f&63]);continue}if(f<55296||f>=57344){i=i+(C[224|f>>12]+C[128|f>>6&63]+C[128|f&63]);continue}c+=1,f=65536+((f&1023)<<10|l.charCodeAt(c)&1023),i+=C[240|f>>18]+C[128|f>>12&63]+C[128|f>>6&63]+C[128|f&63]}return i},Sn=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],a=0;a<t.length;++a)for(var o=t[a],l=o.obj[o.prop],i=Object.keys(l),c=0;c<i.length;++c){var f=i[c],s=l[f];typeof s=="object"&&s!==null&&n.indexOf(s)===-1&&(t.push({obj:l,prop:f}),n.push(s))}return dn(t),e},bn=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},wn=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},On=function(e,t){return[].concat(e,t)},An=function(e,t){if(H(e)){for(var n=[],a=0;a<e.length;a+=1)n.push(t(e[a]));return n}return t(e)},Er={arrayToObject:Pr,assign:mn,combine:On,compact:Sn,decode:hn,encode:gn,isBuffer:wn,isRegExp:bn,maybeMap:An,merge:vn},Ir=un,Se=Er,le=We,Pn=Object.prototype.hasOwnProperty,_r={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},T=Array.isArray,En=Array.prototype.push,Nr=function(r,e){En.apply(r,T(e)?e:[e])},In=Date.prototype.toISOString,Fr=le.default,E={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Se.encode,encodeValuesOnly:!1,format:Fr,formatter:le.formatters[Fr],indices:!1,serializeDate:function(e){return In.call(e)},skipNulls:!1,strictNullHandling:!1},_n=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Qe={},Nn=function r(e,t,n,a,o,l,i,c,f,s,m,y,g,v,I,$){for(var h=e,D=$,L=0,K=!1;(D=D.get(Qe))!==void 0&&!K;){var ce=D.get(e);if(L+=1,typeof ce<"u"){if(ce===L)throw new RangeError("Cyclic object value");K=!0}typeof D.get(Qe)>"u"&&(L=0)}if(typeof c=="function"?h=c(t,h):h instanceof Date?h=m(h):n==="comma"&&T(h)&&(h=Se.maybeMap(h,function(re){return re instanceof Date?m(re):re})),h===null){if(o)return i&&!v?i(t,E.encoder,I,"key",y):t;h=""}if(_n(h)||Se.isBuffer(h)){if(i){var we=v?t:i(t,E.encoder,I,"key",y);return[g(we)+"="+g(i(h,E.encoder,I,"value",y))]}return[g(t)+"="+g(String(h))]}var W=[];if(typeof h>"u")return W;var U;if(n==="comma"&&T(h))v&&i&&(h=Se.maybeMap(h,i)),U=[{value:h.length>0?h.join(",")||null:void 0}];else if(T(c))U=c;else{var X=Object.keys(h);U=f?X.sort(f):X}for(var Z=a&&T(h)&&h.length===1?t+"[]":t,fe=0;fe<U.length;++fe){var N=U[fe],x=typeof N=="object"&&typeof N.value<"u"?N.value:h[N];if(!(l&&x===null)){var ee=T(h)?typeof n=="function"?n(Z,N):Z:Z+(s?"."+N:"["+N+"]");$.set(e,L);var Oe=Ir();Oe.set(Qe,$),Nr(W,r(x,ee,n,a,o,l,n==="comma"&&v&&T(h)?null:i,c,f,s,m,y,g,v,I,Oe))}}return W},Fn=function(e){if(!e)return E;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||E.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=le.default;if(typeof e.format<"u"){if(!Pn.call(le.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var a=le.formatters[n],o=E.filter;return(typeof e.filter=="function"||T(e.filter))&&(o=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:E.addQueryPrefix,allowDots:typeof e.allowDots>"u"?E.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:E.charsetSentinel,delimiter:typeof e.delimiter>"u"?E.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:E.encode,encoder:typeof e.encoder=="function"?e.encoder:E.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:E.encodeValuesOnly,filter:o,format:n,formatter:a,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:E.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:E.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:E.strictNullHandling}},Cn=function(r,e){var t=r,n=Fn(e),a,o;typeof n.filter=="function"?(o=n.filter,t=o("",t)):T(n.filter)&&(o=n.filter,a=o);var l=[];if(typeof t!="object"||t===null)return"";var i;e&&e.arrayFormat in _r?i=e.arrayFormat:e&&"indices"in e?i=e.indices?"indices":"repeat":i="indices";var c=_r[i];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var f=c==="comma"&&e&&e.commaRoundTrip;a||(a=Object.keys(t)),n.sort&&a.sort(n.sort);for(var s=Ir(),m=0;m<a.length;++m){var y=a[m];n.skipNulls&&t[y]===null||Nr(l,Nn(t[y],y,c,f,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,s))}var g=l.join(n.delimiter),v=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?v+="utf8=%26%2310003%3B&":v+="utf8=%E2%9C%93&"),g.length>0?v+g:""},Y=Er,Ve=Object.prototype.hasOwnProperty,Tn=Array.isArray,w={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Y.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},$n=function(r){return r.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},Cr=function(r,e){return r&&typeof r=="string"&&e.comma&&r.indexOf(",")>-1?r.split(","):r},Dn="utf8=%26%2310003%3B",xn="utf8=%E2%9C%93",Mn=function(e,t){var n={__proto__:null},a=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=t.parameterLimit===1/0?void 0:t.parameterLimit,l=a.split(t.delimiter,o),i=-1,c,f=t.charset;if(t.charsetSentinel)for(c=0;c<l.length;++c)l[c].indexOf("utf8=")===0&&(l[c]===xn?f="utf-8":l[c]===Dn&&(f="iso-8859-1"),i=c,c=l.length);for(c=0;c<l.length;++c)if(c!==i){var s=l[c],m=s.indexOf("]="),y=m===-1?s.indexOf("="):m+1,g,v;y===-1?(g=t.decoder(s,w.decoder,f,"key"),v=t.strictNullHandling?null:""):(g=t.decoder(s.slice(0,y),w.decoder,f,"key"),v=Y.maybeMap(Cr(s.slice(y+1),t),function(I){return t.decoder(I,w.decoder,f,"value")})),v&&t.interpretNumericEntities&&f==="iso-8859-1"&&(v=$n(v)),s.indexOf("[]=")>-1&&(v=Tn(v)?[v]:v),Ve.call(n,g)?n[g]=Y.combine(n[g],v):n[g]=v}return n},kn=function(r,e,t,n){for(var a=n?e:Cr(e,t),o=r.length-1;o>=0;--o){var l,i=r[o];if(i==="[]"&&t.parseArrays)l=[].concat(a);else{l=t.plainObjects?Object.create(null):{};var c=i.charAt(0)==="["&&i.charAt(i.length-1)==="]"?i.slice(1,-1):i,f=parseInt(c,10);!t.parseArrays&&c===""?l={0:a}:!isNaN(f)&&i!==c&&String(f)===c&&f>=0&&t.parseArrays&&f<=t.arrayLimit?(l=[],l[f]=a):c!=="__proto__"&&(l[c]=a)}a=l}return a},Rn=function(e,t,n,a){if(e){var o=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,l=/(\[[^[\]]*])/,i=/(\[[^[\]]*])/g,c=n.depth>0&&l.exec(o),f=c?o.slice(0,c.index):o,s=[];if(f){if(!n.plainObjects&&Ve.call(Object.prototype,f)&&!n.allowPrototypes)return;s.push(f)}for(var m=0;n.depth>0&&(c=i.exec(o))!==null&&m<n.depth;){if(m+=1,!n.plainObjects&&Ve.call(Object.prototype,c[1].slice(1,-1))&&!n.allowPrototypes)return;s.push(c[1])}return c&&s.push("["+o.slice(c.index)+"]"),kn(s,t,n,a)}},Ln=function(e){if(!e)return w;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=typeof e.charset>"u"?w.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?w.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:w.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:w.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:w.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:w.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:w.comma,decoder:typeof e.decoder=="function"?e.decoder:w.decoder,delimiter:typeof e.delimiter=="string"||Y.isRegExp(e.delimiter)?e.delimiter:w.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:w.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:w.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:w.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:w.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:w.strictNullHandling}},Un=function(r,e){var t=Ln(e);if(r===""||r===null||typeof r>"u")return t.plainObjects?Object.create(null):{};for(var n=typeof r=="string"?Mn(r,t):r,a=t.plainObjects?Object.create(null):{},o=Object.keys(n),l=0;l<o.length;++l){var i=o[l],c=Rn(i,n[i],t,typeof r=="string");a=Y.merge(a,c,t)}return t.allowSparse===!0?a:Y.compact(a)},Bn=Cn,Gn=Un,Hn=We,Wn={formats:Hn,parse:Gn,stringify:Bn};const Tr=jr(Wn),$r=r=>Tr.parse(r,{ignoreQueryPrefix:!0}),qn=r=>Tr.stringify(r,{arrayFormat:"brackets"}),Dr=(r=!1)=>{const[e,t]=A.useState(r),n=A.useCallback(()=>t(l=>!l),[]),a=A.useCallback(()=>t(!0),[]),o=A.useCallback(()=>t(!1),[]);return[e,n,a,o]},Qn=(r=!1,e=2e3,t=window.setTimeout,n=window.clearTimeout)=>{const[a,o]=A.useState(r),l=A.useRef(r),i=A.useRef(),c=A.useCallback(()=>{o(!l.current),i.current&&n(i.current),i.current=t(()=>o(l.current),e)},[n,e,t]);return[a,c]},ze=()=>{const{current:r}=A.useRef(`dom-${zr()}`);return r},Vn=()=>A.useRef(null),zn=()=>{const{search:r}=je.useLocation();return A.useMemo(()=>$r(r),[r])},xr=({checked:r=!1,onChange:e,className:t,children:n,type:a,inline:o=!1})=>{const l=ze(),i=s=>e==null?void 0:e(s.target.checked,s),c={"form-switch":a==="switch","form-checkbox":a==="checkbox"},f=o?{display:"inline-block"}:{};return u.jsxs("span",{className:_("form-check",c,t),style:f,children:[u.jsx("input",{type:"checkbox",className:"form-check-input",id:l,checked:r,onChange:i}),u.jsx("label",{className:"form-check-label",htmlFor:l,children:n})]})},jn=r=>u.jsx(xr,{type:"checkbox",...r}),Jn=r=>u.jsx(xr,{type:"switch",...r}),Mr=({children:r,label:e,className:t="",labelClassName:n="",noMargin:a=!1,id:o})=>u.jsxs("div",{className:`${t} ${a?"":"mb-3"}`,children:[u.jsx("label",{className:`form-label ${n}`,htmlFor:o,children:e}),r]}),Yn=({children:r,value:e,onChange:t,type:n,required:a,placeholder:o,className:l,labelClassName:i})=>{const c=ze();return u.jsx(Mr,{label:u.jsxs(u.Fragment,{children:[r,":"]}),className:l,labelClassName:i,id:c,children:u.jsx("input",{id:c,className:"form-control",type:n??"text",value:e,required:a??!0,placeholder:o,onChange:f=>t(f.target.value)})})},Kn=500;let be;const kr=()=>{be&&clearTimeout(be),be=null},Xn=({onChange:r,className:e,large:t=!0,noBorder:n=!1,initialValue:a="",setTimeout_:o=setTimeout})=>{const[l,i]=A.useState(a),c=(f,s=Kn)=>{i(f),kr(),be=o(()=>{r(f),kr()},s)};return u.jsxs("div",{className:_("search-field",e),children:[u.jsx("input",{type:"text",className:_("form-control search-field__input",{"form-control-lg":t,"search-field__input--no-border":n}),placeholder:"Search...",value:l,onChange:f=>c(f.target.value)}),u.jsx(ue.FontAwesomeIcon,{icon:te.faSearch,className:"search-field__icon"}),u.jsx("button",{"aria-label":"Clear search",type:"button",className:"close search-field__close btn-close",hidden:l==="",id:"search-field__close",onClick:()=>c("",0)})]})},Rr=({text:r,disabled:e=!1,className:t,children:n,dropdownClassName:a,noCaret:o,end:l=!1,minWidth:i,inline:c,size:f,...s})=>{const[m,y]=Dr(),g=_("dropdown-btn__toggle",t,{"btn-block":!c,"dropdown-btn__toggle--with-caret":!o}),v={minWidth:i&&`${i}px`};return u.jsxs(S.Dropdown,{isOpen:m,toggle:y,disabled:e,className:a,children:[u.jsx(S.DropdownToggle,{size:f,caret:!o,className:g,color:"primary",...s,children:r}),u.jsx(S.DropdownMenu,{className:"w-100",end:l,style:v,children:n})]})},Zn=({children:r,minWidth:e,label:t="Options"})=>u.jsx(Rr,{text:u.jsx(ue.FontAwesomeIcon,{className:"px-1",icon:te.faEllipsisV}),"aria-label":t,size:"sm",minWidth:e,end:!0,noCaret:!0,inline:!0,children:r}),Lr=({children:r,...e})=>u.jsx(S.NavItem,{children:u.jsx(S.NavLink,{className:"nav-pills__nav-link",tag:je.NavLink,...e,children:r})}),eo=({children:r,fill:e=!1,className:t=""})=>u.jsx(S.Card,{className:`nav-pills__nav p-0 overflow-hidden ${t}`,body:!0,children:u.jsx(S.Nav,{pills:!0,fill:e,children:A.Children.map(r,n=>{if(!A.isValidElement(n)||n.type!==Lr)throw new Error("Only NavPillItem children are allowed inside NavPills.");return n})})}),Ur=(r,e,t)=>r!==e?"ASC":t?{ASC:"DESC",DESC:void 0}[t]:"ASC",ro=(r,{field:e,dir:t})=>!e||!t?r:r.sort((n,a)=>{const o=t==="ASC"?1:-1,l=t==="ASC"?-1:1;return n[e]>a[e]?o:l}),to=r=>r.dir?`${r.field}-${r.dir}`:void 0,no=r=>{const[e,t]=r.split("-");return{field:e,dir:t}},oo=r=>{const[e,t]=A.useState(r),n=A.useCallback((a,o)=>t({field:a,dir:o}),[]);return[e,n]};function ao({items:r,order:e,onChange:t,isButton:n=!0,right:a=!1,prefixed:o=!0}){const l=i=>()=>{const c=Ur(i,e.field,e.dir);t(c?i:void 0,c)};return u.jsxs(S.UncontrolledDropdown,{children:[u.jsxs(S.DropdownToggle,{caret:!0,color:n?"primary":"link",className:_({"dropdown-btn__toggle btn-block pe-4 overflow-hidden":n,"btn-sm p-0":!n}),children:[!n&&u.jsx(u.Fragment,{children:"Order by"}),n&&!e.field&&u.jsx("i",{children:"Order by..."}),n&&e.field&&u.jsxs(u.Fragment,{children:[o&&"Order by: ",r[e.field]," - ",u.jsx("small",{children:e.dir??"DESC"})]})]}),u.jsxs(S.DropdownMenu,{end:a,className:_("w-100",{"ordering-dropdown__menu--link":!n}),children:[Object.entries(r).map(([i,c])=>u.jsxs(S.DropdownItem,{active:e.field===i,onClick:l(i),children:[c,e.field===i&&u.jsx(ue.FontAwesomeIcon,{icon:e.dir==="ASC"?te.faSortAmountUp:te.faSortAmountDown,className:"ordering-dropdown__sort-icon"})]},i)),u.jsx(S.DropdownItem,{divider:!0}),u.jsx(S.DropdownItem,{disabled:!e.field,onClick:()=>t(),children:u.jsx("i",{children:"Clear selection"})})]})]})}const io="#4696e5",lo="rgba(70, 150, 229, 0.4)",co="#f77f28",fo="rgba(247, 127, 40, 0.4)",uo="white",so="#161b22",po=r=>{var e;return(e=document.querySelector("html"))==null?void 0:e.setAttribute("data-theme",r)},yo=()=>{var r;return((r=document.querySelector("html"))==null?void 0:r.getAttribute("data-theme"))==="dark"},vo=(r=window.matchMedia.bind(window))=>r("(prefers-color-scheme: dark)").matches?"dark":"light";p.Checkbox=jn,p.DropdownBtn=Rr,p.HIGHLIGHTED_COLOR=co,p.HIGHLIGHTED_COLOR_ALPHA=fo,p.InputFormGroup=Yn,p.LabeledFormGroup=Mr,p.MAIN_COLOR=io,p.MAIN_COLOR_ALPHA=lo,p.Message=Hr,p.NavPillItem=Lr,p.NavPills=eo,p.OrderingDropdown=ao,p.PRIMARY_DARK_COLOR=so,p.PRIMARY_LIGHT_COLOR=uo,p.Result=Wr,p.RowDropdownBtn=Zn,p.SearchField=Xn,p.SimpleCard=Ye,p.ToggleSwitch=Jn,p.changeThemeInMarkup=po,p.determineOrderDir=Ur,p.getSystemPreferredTheme=vo,p.isDarkThemeEnabled=yo,p.orderToString=to,p.parseQuery=$r,p.sortList=ro,p.stringToOrder=no,p.stringifyQuery=qn,p.useDomId=ze,p.useElementRef=Vn,p.useOrder=oo,p.useParsedQuery=zn,p.useTimeoutToggle=Qn,p.useToggle=Dr,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(n,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("react/jsx-runtime"),require("@fortawesome/free-solid-svg-icons"),require("@fortawesome/react-fontawesome"),require("clsx"),require("reactstrap"),require("react"),require("react-router-dom"),require("uuid"),require("qs")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@fortawesome/free-solid-svg-icons","@fortawesome/react-fontawesome","clsx","reactstrap","react","react-router-dom","uuid","qs"],s):(n=typeof globalThis<"u"?globalThis:n||self,s(n["shlink-frontend-kit"]={},n.jsxRuntime,n.freeSolidSvgIcons,n.reactFontawesome,n.clsx,n.reactstrap,n.react,n.reactRouterDom,n.uuid,n.qs))})(this,function(n,s,w,C,f,d,h,T,S,N){"use strict";const F=e=>({error:"border-danger",default:""})[e],H=e=>({error:"text-danger",default:"text-muted"})[e],E=({className:e,children:r,loading:o=!1,type:l="default",fullWidth:c=!1})=>{const a=f.clsx({"col-md-12":c,"col-md-10 offset-md-1":!c});return s.jsx(d.Row,{className:f.clsx("g-0",e),children:s.jsx("div",{className:a,children:s.jsx(d.Card,{className:F(l),body:!0,children:s.jsxs("h3",{className:f.clsx("text-center mb-0",H(l)),children:[o&&s.jsx(C.FontAwesomeIcon,{icon:w.faCircleNotch,spin:!0}),o&&s.jsx("span",{className:"ms-2",children:r??"Loading..."}),!o&&r]})})})})},O=({title:e,children:r,bodyClassName:o,...l})=>s.jsxs(d.Card,{...l,children:[e&&s.jsx(d.CardHeader,{role:"heading","aria-level":4,children:e}),s.jsx(d.CardBody,{className:o,children:r})]}),P=({children:e,type:r,className:o,small:l=!1})=>s.jsx(d.Row,{className:o,children:s.jsx("div",{className:f.clsx({"col-md-10 offset-md-1":!l,"col-12":l}),children:s.jsx(O,{role:"document",className:f.clsx("text-center",{"bg-main":r==="success","bg-danger":r==="error","bg-warning":r==="warning","text-white":r!=="warning"}),bodyClassName:f.clsx({"p-2":l}),children:e})})}),k=e=>N.parse(e,{ignoreQueryPrefix:!0}),M=e=>N.stringify(e,{arrayFormat:"brackets"}),A=(e=!1)=>{const[r,o]=h.useState(e),l=h.useCallback(()=>o(i=>!i),[]),c=h.useCallback(()=>o(!0),[]),a=h.useCallback(()=>o(!1),[]);return[r,l,c,a]},q=(e=!1,r=2e3,o=window.setTimeout,l=window.clearTimeout)=>{const[c,a]=h.useState(e),i=h.useRef(e),t=h.useRef(),u=h.useCallback(()=>{a(!i.current),t.current&&l(t.current),t.current=o(()=>a(i.current),r)},[l,r,o]);return[c,u]},_=()=>{const{current:e}=h.useRef(`dom-${S.v4()}`);return e},G=()=>h.useRef(null),$=()=>{const{search:e}=T.useLocation();return h.useMemo(()=>k(e),[e])},I=({checked:e=!1,onChange:r,className:o,children:l,type:c,inline:a=!1})=>{const i=_(),t=g=>r==null?void 0:r(g.target.checked,g),u={"form-switch":c==="switch","form-checkbox":c==="checkbox"},m=a?{display:"inline-block"}:{};return s.jsxs("span",{className:f.clsx("form-check",u,o),style:m,children:[s.jsx("input",{type:"checkbox",className:"form-check-input",id:i,checked:e,onChange:t}),s.jsx("label",{className:"form-check-label",htmlFor:i,children:l})]})},Q=e=>s.jsx(I,{type:"checkbox",...e}),j=e=>s.jsx(I,{type:"switch",...e}),L=({children:e,label:r,className:o="",labelClassName:l="",noMargin:c=!1,id:a})=>s.jsxs("div",{className:`${o} ${c?"":"mb-3"}`,children:[s.jsx("label",{className:`form-label ${l}`,htmlFor:a,children:r}),e]}),U=({children:e,value:r,onChange:o,type:l,required:c,placeholder:a,className:i,labelClassName:t})=>{const u=_();return s.jsx(L,{label:s.jsxs(s.Fragment,{children:[e,":"]}),className:i,labelClassName:t,id:u,children:s.jsx("input",{id:u,className:"form-control",type:l??"text",value:r,required:c??!0,placeholder:a,onChange:m=>o(m.target.value)})})};let b;const p=()=>{b&&clearTimeout(b),b=null},V=({onChange:e,className:r,large:o=!0,noBorder:l=!1,initialValue:c="",setTimeout_:a=setTimeout})=>{const[i,t]=h.useState(c),u=(m,g=500)=>{t(m),p(),b=a(()=>{e(m),p()},g)};return s.jsxs("div",{className:f.clsx("search-field",r),children:[s.jsx("input",{type:"text",className:f.clsx("form-control search-field__input",{"form-control-lg":o,"search-field__input--no-border":l}),placeholder:"Search...",value:i,onChange:m=>u(m.target.value)}),s.jsx(C.FontAwesomeIcon,{icon:w.faSearch,className:"search-field__icon"}),s.jsx("button",{"aria-label":"Clear search",type:"button",className:"close search-field__close btn-close",hidden:i==="",id:"search-field__close",onClick:()=>u("",0)})]})},y=({text:e,disabled:r=!1,className:o,children:l,dropdownClassName:c,noCaret:a,end:i=!1,minWidth:t,inline:u,size:m,...g})=>{const[ce,ae]=A(),te=f.clsx("dropdown-btn__toggle",o,{"btn-block":!u,"dropdown-btn__toggle--with-caret":!a}),de={minWidth:t&&`${t}px`};return s.jsxs(d.Dropdown,{isOpen:ce,toggle:ae,disabled:r,className:c,children:[s.jsx(d.DropdownToggle,{size:m,caret:!a,className:te,color:"primary",...g,children:e}),s.jsx(d.DropdownMenu,{className:"w-100",end:i,style:de,children:l})]})},Y=({children:e,minWidth:r,label:o="Options"})=>s.jsx(y,{text:s.jsx(C.FontAwesomeIcon,{className:"px-1",icon:w.faEllipsisV}),"aria-label":o,size:"sm",minWidth:r,end:!0,noCaret:!0,inline:!0,children:e}),D=({children:e,...r})=>s.jsx(d.NavItem,{children:s.jsx(d.NavLink,{className:"nav-pills__nav-link",tag:T.NavLink,...r,children:e})}),z=({children:e,fill:r=!1,className:o=""})=>s.jsx(d.Card,{className:`nav-pills__nav p-0 overflow-hidden ${o}`,body:!0,children:s.jsx(d.Nav,{pills:!0,fill:r,children:h.Children.map(e,l=>{if(!h.isValidElement(l)||l.type!==D)throw new Error("Only NavPillItem children are allowed inside NavPills.");return l})})}),v=(e,r,o)=>e!==r?"ASC":o?{ASC:"DESC",DESC:void 0}[o]:"ASC",B=(e,{field:r,dir:o})=>!r||!o?e:e.sort((l,c)=>{const a=o==="ASC"?1:-1,i=o==="ASC"?-1:1;return l[r]>c[r]?a:i}),J=e=>e.dir?`${e.field}-${e.dir}`:void 0,X=e=>{const[r,o]=e.split("-");return{field:r,dir:o}},Z=e=>{const[r,o]=h.useState(e),l=h.useCallback((c,a)=>o({field:c,dir:a}),[]);return[r,l]};function W({items:e,order:r,onChange:o,isButton:l=!0,right:c=!1,prefixed:a=!0}){const i=t=>()=>{const u=v(t,r.field,r.dir);o(u?t:void 0,u)};return s.jsxs(d.UncontrolledDropdown,{children:[s.jsxs(d.DropdownToggle,{caret:!0,color:l?"primary":"link",className:f.clsx({"dropdown-btn__toggle btn-block pe-4 overflow-hidden":l,"btn-sm p-0":!l}),children:[!l&&s.jsx(s.Fragment,{children:"Order by"}),l&&!r.field&&s.jsx("i",{children:"Order by..."}),l&&r.field&&s.jsxs(s.Fragment,{children:[a&&"Order by: ",e[r.field]," - ",s.jsx("small",{children:r.dir??"DESC"})]})]}),s.jsxs(d.DropdownMenu,{end:c,className:f.clsx("w-100",{"ordering-dropdown__menu--link":!l}),children:[Object.entries(e).map(([t,u])=>s.jsxs(d.DropdownItem,{active:r.field===t,onClick:i(t),children:[u,r.field===t&&s.jsx(C.FontAwesomeIcon,{icon:r.dir==="ASC"?w.faSortAmountUp:w.faSortAmountDown,className:"ordering-dropdown__sort-icon"})]},t)),s.jsx(d.DropdownItem,{divider:!0}),s.jsx(d.DropdownItem,{disabled:!r.field,onClick:()=>o(),children:s.jsx("i",{children:"Clear selection"})})]})]})}const K="#4696e5",x="rgba(70, 150, 229, 0.4)",R="#f77f28",ee="rgba(247, 127, 40, 0.4)",re="white",se="#161b22",ne=e=>{var r;return(r=document.querySelector("html"))==null?void 0:r.setAttribute("data-theme",e)},oe=()=>{var e;return((e=document.querySelector("html"))==null?void 0:e.getAttribute("data-theme"))==="dark"},le=(e=window.matchMedia.bind(window))=>e("(prefers-color-scheme: dark)").matches?"dark":"light";n.Checkbox=Q,n.DropdownBtn=y,n.HIGHLIGHTED_COLOR=R,n.HIGHLIGHTED_COLOR_ALPHA=ee,n.InputFormGroup=U,n.LabeledFormGroup=L,n.MAIN_COLOR=K,n.MAIN_COLOR_ALPHA=x,n.Message=E,n.NavPillItem=D,n.NavPills=z,n.OrderingDropdown=W,n.PRIMARY_DARK_COLOR=se,n.PRIMARY_LIGHT_COLOR=re,n.Result=P,n.RowDropdownBtn=Y,n.SearchField=V,n.SimpleCard=O,n.ToggleSwitch=j,n.changeThemeInMarkup=ne,n.determineOrderDir=v,n.getSystemPreferredTheme=le,n.isDarkThemeEnabled=oe,n.orderToString=J,n.parseQuery=k,n.sortList=B,n.stringToOrder=X,n.stringifyQuery=M,n.useDomId=_,n.useElementRef=G,n.useOrder=Z,n.useParsedQuery=$,n.useTimeoutToggle=q,n.useToggle=A,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"clsx": "^2.1.0",
|
|
35
|
-
"qs": "^6.
|
|
35
|
+
"qs": "^6.12.1",
|
|
36
36
|
"uuid": "^9.0.1"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
@@ -45,30 +45,32 @@
|
|
|
45
45
|
"reactstrap": "^9.2.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@shlinkio/eslint-config-js-coding-standard": "~2.
|
|
48
|
+
"@shlinkio/eslint-config-js-coding-standard": "~2.4.1",
|
|
49
49
|
"@shlinkio/stylelint-config-css-coding-standard": "~1.1.1",
|
|
50
|
-
"@testing-library/jest-dom": "^6.2
|
|
51
|
-
"@testing-library/react": "^
|
|
50
|
+
"@testing-library/jest-dom": "^6.4.2",
|
|
51
|
+
"@testing-library/react": "^15.0.1",
|
|
52
52
|
"@testing-library/user-event": "^14.5.2",
|
|
53
|
-
"@total-typescript/shoehorn": "^0.1.
|
|
54
|
-
"@types/qs": "^6.9.
|
|
55
|
-
"@types/react": "^18.2.
|
|
56
|
-
"@types/react-dom": "^18.2.
|
|
57
|
-
"@types/uuid": "^9.0.
|
|
53
|
+
"@total-typescript/shoehorn": "^0.1.2",
|
|
54
|
+
"@types/qs": "^6.9.14",
|
|
55
|
+
"@types/react": "^18.2.77",
|
|
56
|
+
"@types/react-dom": "^18.2.25",
|
|
57
|
+
"@types/uuid": "^9.0.8",
|
|
58
|
+
"@typescript-eslint/eslint-plugin": "^7.5.0",
|
|
59
|
+
"@typescript-eslint/parser": "^7.5.0",
|
|
58
60
|
"@vitejs/plugin-react": "^4.2.1",
|
|
59
|
-
"@vitest/coverage-v8": "^1.
|
|
60
|
-
"axe-core": "^4.
|
|
61
|
+
"@vitest/coverage-v8": "^1.5.0",
|
|
62
|
+
"axe-core": "^4.9.0",
|
|
61
63
|
"bootstrap": "5.2.3",
|
|
62
|
-
"eslint": "^8.
|
|
64
|
+
"eslint": "^8.57.0",
|
|
63
65
|
"history": "^5.3.0",
|
|
64
|
-
"jsdom": "^
|
|
66
|
+
"jsdom": "^24.0.0",
|
|
65
67
|
"resize-observer-polyfill": "^1.5.1",
|
|
66
|
-
"sass": "^1.
|
|
68
|
+
"sass": "^1.75.0",
|
|
67
69
|
"stylelint": "^15.11.0",
|
|
68
|
-
"typescript": "^5.
|
|
69
|
-
"vite": "^5.
|
|
70
|
-
"vite-plugin-dts": "^3.
|
|
71
|
-
"vitest": "^1.2.
|
|
70
|
+
"typescript": "^5.4.5",
|
|
71
|
+
"vite": "^5.2.8",
|
|
72
|
+
"vite-plugin-dts": "^3.8.2",
|
|
73
|
+
"vitest": "^1.2.2"
|
|
72
74
|
},
|
|
73
75
|
"browserslist": [
|
|
74
76
|
">0.2%",
|
|
@@ -76,5 +78,5 @@
|
|
|
76
78
|
"not ie <= 11",
|
|
77
79
|
"not op_mini all"
|
|
78
80
|
],
|
|
79
|
-
"version": "0.
|
|
81
|
+
"version": "0.5.1"
|
|
80
82
|
}
|