shadow-claw 1.43.0 → 1.44.0
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/.well-known/mcp/server-card.json +1 -1
- package/.well-known/mcp.json +1 -1
- package/dist/cli/chunk--nlZNQrZ2.js +1 -0
- package/dist/cli/{chunk-CbhVal4Q.js → chunk-2IASlfOI.js} +1 -1
- package/dist/cli/chunk-2zUw4dTY.js +1 -0
- package/dist/cli/{chunk-C_vLt0YP2.js → chunk-B2WxN9-12.js} +11 -11
- package/dist/cli/{chunk-Cweo3Jpw.js → chunk-B5hVBRV-.js} +1 -1
- package/dist/cli/chunk-B7vuMvBg.js +1 -0
- package/dist/cli/{chunk-C9b5a_Uy.js → chunk-B9Fx2rWZ.js} +1 -1
- package/dist/cli/chunk-BChoeGdY2.js +1 -0
- package/dist/cli/{chunk-CcWCWTJe.js → chunk-BJmbRsHN.js} +1 -1
- package/dist/cli/{chunk-BN0tqRNn.js → chunk-BQyGyg86.js} +1 -1
- package/dist/cli/chunk-B_FQjokZ.js +1 -0
- package/dist/cli/chunk-BaAL1yLC.js +1 -0
- package/dist/cli/{chunk-L61wFp4H2.js → chunk-BaSEVtTB2.js} +1 -1
- package/dist/cli/chunk-BckYclkX2.js +1 -0
- package/dist/cli/chunk-Bh0Uxjld.js +1 -0
- package/dist/cli/{chunk-D57WTK9e2.js → chunk-By9miObI2.js} +2 -2
- package/dist/cli/chunk-C0cwwqX52.js +1 -0
- package/dist/cli/{chunk-DJ1pR9f82.js → chunk-C0vTb5Ur2.js} +1 -1
- package/dist/cli/{chunk-BBCAo_6N2.js → chunk-C3iVPEyi2.js} +1 -1
- package/dist/cli/{chunk-D3NWfUvq2.js → chunk-CJpZQ6NS2.js} +1 -1
- package/dist/cli/{chunk-Dhh0lHO6.js → chunk-CKksk-lA.js} +1 -1
- package/dist/cli/chunk-CKm7-SCu.js +1 -0
- package/dist/cli/{chunk-BPcMKhha2.js → chunk-CLKlXl_32.js} +1 -1
- package/dist/cli/{chunk-rvRQOKXp.js → chunk-CQeDQc3C.js} +1 -1
- package/dist/cli/{chunk-DYGlH-un.js → chunk-CSMegkz6.js} +1 -1
- package/dist/cli/{chunk-B1TEXFG-2.js → chunk-CTnzEqW82.js} +1 -1
- package/dist/cli/chunk-CiHV_7H62.js +1 -0
- package/dist/cli/{chunk-D9F645K62.js → chunk-CimeIb1j2.js} +1 -1
- package/dist/cli/{chunk-D-lQkf5X.js → chunk-CjhfhiNM.js} +1 -1
- package/dist/cli/{chunk-BTe1dZD0.js → chunk-ClBaEe8W.js} +1 -1
- package/dist/cli/{chunk-BmDywCXL.js → chunk-Cvv2Fuue.js} +1 -1
- package/dist/cli/{chunk-DcYfXgpg2.js → chunk-Cx8_qww-2.js} +1 -1
- package/dist/cli/{chunk-CvKmsXS02.js → chunk-D0UlHLhC2.js} +1 -1
- package/dist/cli/chunk-D0jQVYRk.js +5 -0
- package/dist/cli/chunk-D0sHV-Z82.js +1 -0
- package/dist/cli/{chunk-DeMPVxlQ.js → chunk-D2FGpjOO.js} +1 -1
- package/dist/cli/chunk-D3cH54jW.js +1 -0
- package/dist/cli/{chunk-Di4LxQG-2.js → chunk-D9dG7jP92.js} +1 -1
- package/dist/cli/{chunk-qTCLBos1.js → chunk-DKw-oTLT.js} +1 -1
- package/dist/cli/{chunk-BHnjkiBp2.js → chunk-DOkl85Te2.js} +1 -1
- package/dist/cli/{chunk-XS0fMLl1.js → chunk-DPySd-KC.js} +1 -1
- package/dist/cli/{chunk-BkTdHRZ6.js → chunk-DSleWP3c.js} +1 -1
- package/dist/cli/chunk-DjKQO7aV.js +1 -0
- package/dist/cli/{chunk-CA8_jPwF2.js → chunk-Dk750_9R2.js} +11 -11
- package/dist/cli/{chunk-nsFY_QXf.js → chunk-Do2xLVwC.js} +1 -1
- package/dist/cli/{chunk-DcMyZrds.js → chunk-DoVkBeQv.js} +1 -1
- package/dist/cli/chunk-DrB5Gd6y2.js +1 -0
- package/dist/cli/chunk-DwKjgkq92.js +1 -0
- package/dist/cli/{chunk-DJU6hg1K2.js → chunk-DxZ6DcRo2.js} +63 -63
- package/dist/cli/chunk-IGlHHKOH.js +1 -0
- package/dist/cli/{chunk-CpoiOFRV.js → chunk-NclDuGcY.js} +1 -1
- package/dist/cli/{chunk-CeFei3f_2.js → chunk-TO5qzf3J2.js} +303 -303
- package/dist/cli/{chunk-swUMQyE2.js → chunk-TYwbIsK9.js} +9 -9
- package/dist/cli/{chunk-CWs_KY8q.js → chunk-Xz02ooJU.js} +1 -1
- package/dist/cli/{chunk-DfKXmvNq.js → chunk-e4ARaRhY.js} +1 -1
- package/dist/cli/{chunk-DuTr5h_-.js → chunk-g3j2rSPJ.js} +9 -9
- package/dist/cli/{chunk-JMI-k9_C.js → chunk-j0KG-6x9.js} +1 -1
- package/dist/cli/chunk-ud_DUk_f2.js +1 -0
- package/dist/cli/{chunk-BzqpsHxW2.js → chunk-zUKEZHmz2.js} +1 -1
- package/dist/cli/cli.js +2 -2
- package/dist/headless-agent.js +10 -10
- package/dist/public/.well-known/mcp/server-card.json +1 -1
- package/dist/public/.well-known/mcp.json +1 -1
- package/dist/public/docs/example/article/index.html +1 -1
- package/dist/public/docs/publishing/index.html +1 -1
- package/dist/public/docs/skill-creator/index.html +1 -1
- package/dist/public/docs/subsystems/cli.md +4 -0
- package/dist/public/index.html +1 -1
- package/dist/public/main/index.html +1 -1
- package/dist/public/main/memory/index.html +1 -1
- package/dist/public/service-worker.js +1 -1
- package/dist/server.js +761 -761
- package/package.json +1 -1
- package/src/cli/cli.ts +5 -1
- package/src/cli/commands/agent.test.ts +97 -4
- package/src/cli/commands/agent.ts +28 -2
- package/src/db/sqlite/openSqliteDatabase.test.ts +24 -0
- package/src/db/sqlite/openSqliteDatabase.ts +8 -1
- package/dist/cli/chunk-0WvYaMdi.js +0 -1
- package/dist/cli/chunk-BXNdnbwK.js +0 -1
- package/dist/cli/chunk-BlNmgi3c2.js +0 -1
- package/dist/cli/chunk-C7irE8d42.js +0 -1
- package/dist/cli/chunk-Cbbk_aex2.js +0 -1
- package/dist/cli/chunk-CdNTakxH2.js +0 -1
- package/dist/cli/chunk-Cqd6ZDkT.js +0 -1
- package/dist/cli/chunk-CvoMdhST2.js +0 -1
- package/dist/cli/chunk-DCRmnjTH.js +0 -1
- package/dist/cli/chunk-DFLqhyP_.js +0 -5
- package/dist/cli/chunk-DLUNHJGc.js +0 -1
- package/dist/cli/chunk-DfwnnpVo.js +0 -1
- package/dist/cli/chunk-DhJvrfsM.js +0 -1
- package/dist/cli/chunk-DhQQhCTL2.js +0 -1
- package/dist/cli/chunk-Drx4e34U.js +0 -1
- package/dist/cli/chunk-DwEMut0N.js +0 -1
- package/dist/cli/chunk-STsbFGCh2.js +0 -1
- /package/dist/cli/{chunk-Bb_85Mew.js → chunk-Bb_85Mew2.js} +0 -0
- /package/dist/cli/{chunk-CrWRlKmP.js → chunk-CrWRlKmP2.js} +0 -0
- /package/dist/cli/{chunk-D2vZJXHH2.js → chunk-D2vZJXHH.js} +0 -0
- /package/dist/cli/{chunk-D5U9WJ9X.js → chunk-D5U9WJ9X2.js} +0 -0
- /package/dist/cli/{chunk-DV5sRVN1.js → chunk-DV5sRVN12.js} +0 -0
- /package/dist/cli/{chunk-DXSwo4q72.js → chunk-DXSwo4q7.js} +0 -0
- /package/dist/cli/{chunk-Dv5oFrVy2.js → chunk-Dv5oFrVy.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://modelcontextprotocol.io/schemas/server-card/v1.json",
|
|
3
3
|
"name": "shadow-claw",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.44.0",
|
|
5
5
|
"description": "Multi-runtime AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution.",
|
|
6
6
|
"title": "ShadowClaw MCP Server",
|
|
7
7
|
"websiteUrl": "https://xt-ml.github.io/shadow-claw/",
|
package/.well-known/mcp.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://modelcontextprotocol.io/schemas/server-card/v1.json",
|
|
3
3
|
"name": "shadow-claw",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.44.0",
|
|
5
5
|
"description": "Multi-runtime AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution.",
|
|
6
6
|
"title": "ShadowClaw MCP Server",
|
|
7
7
|
"websiteUrl": "https://xt-ml.github.io/shadow-claw/",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./chunk-CTnzEqW82.js";export{e as importRemoteArtifacts};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./chunk-Jiq-cxA5.js";import{
|
|
1
|
+
import{r as e}from"./chunk-Jiq-cxA5.js";import{n as t}from"./chunk-D0jQVYRk.js";import{t as n}from"./chunk-CKksk-lA.js";import r from"process";
|
|
2
2
|
/*! @license DOMPurify 3.4.13 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.13/LICENSE */
|
|
3
3
|
function i(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function a(e){if(Array.isArray(e))return e}function o(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function s(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c(e,t){return a(e)||o(e,t)||l(e,t)||s()}function l(e,t){if(e){if(typeof e==`string`)return i(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}const u=Object.entries,d=Object.setPrototypeOf,f=Object.isFrozen,ee=Object.getPrototypeOf,te=Object.getOwnPropertyDescriptor;let p=Object.freeze,m=Object.seal,h=Object.create,ne=typeof Reflect<`u`&&Reflect,g=ne.apply,_=ne.construct;p||=function(e){return e},m||=function(e){return e},g||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},_||=function(e){return new e(...[...arguments].slice(1))};const v=E(Array.prototype.forEach),re=E(Array.prototype.lastIndexOf),ie=E(Array.prototype.pop),ae=E(Array.prototype.push),oe=E(Array.prototype.splice),y=Array.isArray,se=E(String.prototype.toLowerCase),ce=E(String.prototype.toString),le=E(String.prototype.match),ue=E(String.prototype.replace),de=E(String.prototype.indexOf),fe=E(String.prototype.trim),pe=E(Number.prototype.toString),me=E(Boolean.prototype.toString),b=typeof BigInt>`u`?null:E(BigInt.prototype.toString),x=typeof Symbol>`u`?null:E(Symbol.prototype.toString),S=E(Object.prototype.hasOwnProperty),C=E(Object.prototype.toString),w=E(RegExp.prototype.test),T=D(TypeError);function E(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return g(e,t,n)}}function D(e){return function(){return _(e,[...arguments])}}function O(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:se;if(d&&d(e,null),!y(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(f(t)||(t[r]=e),i=e)}e[i]=!0}return e}function he(e){for(let t=0;t<e.length;t++)S(e,t)||(e[t]=null);return e}function k(e){let t=h(null);for(let r of u(e)){var n=c(r,2);let i=n[0],a=n[1];S(e,i)&&(y(a)?t[i]=he(a):a&&typeof a==`object`&&a.constructor===Object?t[i]=k(a):t[i]=a)}return t}function ge(e){switch(typeof e){case`string`:return e;case`number`:return pe(e);case`boolean`:return me(e);case`bigint`:return b?b(e):`0`;case`symbol`:return x?x(e):`Symbol()`;case`undefined`:return C(e);case`function`:case`object`:{if(e===null)return C(e);let t=e,n=A(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:C(e)}return C(e)}default:return C(e)}}function A(e,t){for(;e!==null;){let n=te(e,t);if(n){if(n.get)return E(n.get);if(typeof n.value==`function`)return E(n.value)}e=ee(e)}function n(){return null}return n}function _e(e){try{return w(e,``),!0}catch{return!1}}const ve=p(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),ye=p(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),be=p([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),xe=p([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Se=p(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Ce=p([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),we=p([`#text`]),Te=p(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Ee=p(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),De=p(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Oe=p([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),ke=m(/{{[\w\W]*|^[\w\W]*}}/g),Ae=m(/<%[\w\W]*|^[\w\W]*%>/g),je=m(/\${[\w\W]*/g),Me=m(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ne=m(/^aria-[\-\w]+$/),Pe=m(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Fe=m(/^(?:\w+script|data):/i),Ie=m(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Le=m(/^html$/i),Re=m(/^[a-z][.\w]*(-[.\w]+)+$/i),ze=m(/<[/\w!]/g),Be=m(/<[/\w]/g),Ve=m(/<\/no(script|embed|frames)/i),He=m(/\/>/i),j={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ue=function(){return typeof window>`u`?null:window},We=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Ge=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},M=function(e,t,n,r){return S(e,t)&&y(e[t])?O(r.base?k(r.base):{},e[t],r.transform):n};function Ke(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ue(),t=e=>Ke(e);if(t.version=`3.4.13`,t.removed=[],!e||!e.document||e.document.nodeType!==j.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,d=e.trustedTypes,f=s.prototype,ee=A(f,`cloneNode`),te=A(f,`remove`),ne=A(f,`nextSibling`),g=A(f,`childNodes`),_=A(f,`parentNode`),pe=A(f,`shadowRoot`),me=A(f,`attributes`),b=o&&o.prototype?A(o.prototype,`nodeType`):null,x=o&&o.prototype?A(o.prototype,`nodeName`):null,C=o&&o.prototype?A(o.prototype,`ownerDocument`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let E,D=``,he,qe=!1,N=0,Je=function(){if(N>0)throw T(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},P=function(e){Je(),N++;try{return E.createHTML(e)}finally{N--}},Ye=function(e){Je(),N++;try{return E.createScriptURL(e)}finally{N--}},Xe=function(){return qe||=(he=We(d,i),!0),he},F=n,Ze=F.implementation,Qe=F.createNodeIterator,$e=F.createDocumentFragment,I=F.getElementsByTagName,et=r.importNode,L=Ge();t.isSupported=typeof u==`function`&&typeof _==`function`&&Ze&&Ze.createHTMLDocument!==void 0;let tt=ke,nt=Ae,rt=je,it=Me,at=Ne,ot=Fe,st=Ie,ct=Re,lt=Pe,R=null,ut=O({},[...ve,...ye,...be,...Se,...we]),z=null,dt=O({},[...Te,...Ee,...De,...Oe]),B=Object.seal(h(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),V=null,ft=null,H=Object.seal(h(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),pt=!0,mt=!0,ht=!1,gt=!0,U=!1,W=!0,G=!1,_t=!1,vt=null,yt=null,bt=!1,xt=!1,St=!1,Ct=!1,wt=!0,Tt=!1,Et=`user-content-`,Dt=!0,Ot=!1,kt={},K=null,At=O({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),jt=null,Mt=O({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Nt=null,Pt=O({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ft=`http://www.w3.org/1998/Math/MathML`,It=`http://www.w3.org/2000/svg`,q=`http://www.w3.org/1999/xhtml`,J=q,Lt=!1,Rt=null,zt=O({},[Ft,It,q],ce),Bt=p([`mi`,`mo`,`mn`,`ms`,`mtext`]),Vt=O({},Bt),Ht=p([`annotation-xml`]),Ut=O({},Ht),Wt=O({},[`title`,`style`,`font`,`a`,`script`]),Gt=null,Kt=[`application/xhtml+xml`,`text/html`],Y=null,X=null,qt=n.createElement(`form`),Jt=function(e){return e instanceof RegExp||e instanceof Function},Yt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(X&&X===e)return;(!e||typeof e!=`object`)&&(e={}),e=k(e),Gt=Kt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Y=Gt===`application/xhtml+xml`?ce:se,R=M(e,`ALLOWED_TAGS`,ut,{transform:Y}),z=M(e,`ALLOWED_ATTR`,dt,{transform:Y}),Rt=M(e,`ALLOWED_NAMESPACES`,zt,{transform:ce}),Nt=M(e,`ADD_URI_SAFE_ATTR`,Pt,{transform:Y,base:Pt}),jt=M(e,`ADD_DATA_URI_TAGS`,Mt,{transform:Y,base:Mt}),K=M(e,`FORBID_CONTENTS`,At,{transform:Y}),V=M(e,`FORBID_TAGS`,k({}),{transform:Y}),ft=M(e,`FORBID_ATTR`,k({}),{transform:Y}),kt=S(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?k(e.USE_PROFILES):e.USE_PROFILES:!1,pt=e.ALLOW_ARIA_ATTR!==!1,mt=e.ALLOW_DATA_ATTR!==!1,ht=e.ALLOW_UNKNOWN_PROTOCOLS||!1,gt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,U=e.SAFE_FOR_TEMPLATES||!1,W=e.SAFE_FOR_XML!==!1,G=e.WHOLE_DOCUMENT||!1,xt=e.RETURN_DOM||!1,St=e.RETURN_DOM_FRAGMENT||!1,Ct=e.RETURN_TRUSTED_TYPE||!1,bt=e.FORCE_BODY||!1,wt=e.SANITIZE_DOM!==!1,Tt=e.SANITIZE_NAMED_PROPS||!1,Dt=e.KEEP_CONTENT!==!1,Ot=e.IN_PLACE||!1,lt=_e(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Pe,J=typeof e.NAMESPACE==`string`?e.NAMESPACE:q,Vt=S(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?k(e.MATHML_TEXT_INTEGRATION_POINTS):O({},Bt),Ut=S(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?k(e.HTML_INTEGRATION_POINTS):O({},Ht);let t=S(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?k(e.CUSTOM_ELEMENT_HANDLING):h(null);if(B=h(null),S(t,`tagNameCheck`)&&Jt(t.tagNameCheck)&&(B.tagNameCheck=t.tagNameCheck),S(t,`attributeNameCheck`)&&Jt(t.attributeNameCheck)&&(B.attributeNameCheck=t.attributeNameCheck),S(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(B.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),m(B),U&&(mt=!1),St&&(xt=!0),kt&&(R=O({},we),z=h(null),kt.html===!0&&(O(R,ve),O(z,Te)),kt.svg===!0&&(O(R,ye),O(z,Ee),O(z,Oe)),kt.svgFilters===!0&&(O(R,be),O(z,Ee),O(z,Oe)),kt.mathMl===!0&&(O(R,Se),O(z,De),O(z,Oe))),H.tagCheck=null,H.attributeCheck=null,S(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?H.tagCheck=e.ADD_TAGS:y(e.ADD_TAGS)&&(R===ut&&(R=k(R)),O(R,e.ADD_TAGS,Y))),S(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?H.attributeCheck=e.ADD_ATTR:y(e.ADD_ATTR)&&(z===dt&&(z=k(z)),O(z,e.ADD_ATTR,Y))),S(e,`ADD_URI_SAFE_ATTR`)&&y(e.ADD_URI_SAFE_ATTR)&&O(Nt,e.ADD_URI_SAFE_ATTR,Y),S(e,`FORBID_CONTENTS`)&&y(e.FORBID_CONTENTS)&&(K===At&&(K=k(K)),O(K,e.FORBID_CONTENTS,Y)),S(e,`ADD_FORBID_CONTENTS`)&&y(e.ADD_FORBID_CONTENTS)&&(K===At&&(K=k(K)),O(K,e.ADD_FORBID_CONTENTS,Y)),Dt&&(R[`#text`]=!0),G&&O(R,[`html`,`head`,`body`]),R.table&&(O(R,[`tbody`]),delete V.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw T(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw T(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=E;E=e.TRUSTED_TYPES_POLICY;try{D=P(``)}catch(e){throw E=t,e}}else e.TRUSTED_TYPES_POLICY===null?(E=void 0,D=``):(E===void 0&&(E=Xe()),E&&typeof D==`string`&&(D=P(``)));p&&p(e),X=e},Xt=O({},[...ye,...be,...xe]),Zt=O({},[...Se,...Ce]),Qt=function(e,t,n){return t.namespaceURI===q?e===`svg`:t.namespaceURI===Ft?e===`svg`&&(n===`annotation-xml`||Vt[n]):!!Xt[e]},$t=function(e,t,n){return t.namespaceURI===q?e===`math`:t.namespaceURI===It?e===`math`&&Ut[n]:!!Zt[e]},en=function(e,t,n){return t.namespaceURI===It&&!Ut[n]||t.namespaceURI===Ft&&!Vt[n]?!1:!Zt[e]&&(Wt[e]||!Xt[e])},tn=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:J,tagName:`template`});let n=se(e.tagName),r=se(t.tagName);return Rt[e.namespaceURI]?e.namespaceURI===It?Qt(n,t,r):e.namespaceURI===Ft?$t(n,t,r):e.namespaceURI===q?en(n,t,r):!!(Gt===`application/xhtml+xml`&&Rt[e.namespaceURI]):!1},Z=function(e){ae(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(te(e),!_(e))throw T(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},nn=function(e){an(e);let t=g(e);if(t){let e=[];v(t,t=>{ae(e,t)}),v(e,e=>{try{te(e)}catch{}})}let n=me(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if(typeof i==`string`)try{e.removeAttribute(i)}catch{}}},Q=function(e,n){try{ae(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{ae(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(xt||St)try{Z(n)}catch{}else try{n.setAttribute(e,``)}catch{}},rn=function(e){let t=me(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;if(!(typeof i!=`string`||z[Y(i)]))try{e.removeAttribute(i)}catch{}}},an=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(b?b(e):e.nodeType)===j.element&&rn(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},on=function(e){if(!W)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=b?b(e):e.nodeType;if(n===j.processingInstruction||n===j.comment&&w(Be,e.data)){try{te(e)}catch{}continue}if(n===j.element){let t=e,n=Y(x?x(e):e.nodeName);try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&n!==`label`&&n!==`output`&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},sn=function(e){let t=null,r=null;if(bt)e=`<remove></remove>`+e;else{let t=le(e,/^[\r\n\t ]+/);r=t&&t[0]}Gt===`application/xhtml+xml`&&J===q&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=E?P(e):e;if(J===q)try{t=new l().parseFromString(i,Gt)}catch{}if(!t||!t.documentElement){t=Ze.createDocument(J,`template`,null);try{t.documentElement.innerHTML=Lt?D:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),J===q?I.call(t,G?`html`:`body`)[0]:G?t.documentElement:a},cn=function(e){let t=C?C(e):e.ownerDocument;return Qe.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ln=function(e){return e=ue(e,tt,` `),e=ue(e,nt,` `),e=ue(e,rt,` `),e},un=function(e){e.normalize();let t=C?C(e):e.ownerDocument,n=Qe.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=ln(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&v(i,e=>{fn(e.content)&&un(e.content)})},dn=function(e){let t=x?x(e):null;return typeof t!=`string`||Y(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==me(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},fn=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===j.documentFragment}catch{return!1}},pn=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function $(e,n,r){e.length!==0&&v(e,e=>{e.call(t,n,r,X)})}let mn=function(e,t){return!!(W&&e.hasChildNodes()&&!pn(e.firstElementChild)&&w(ze,e.textContent)&&w(ze,e.innerHTML)||W&&e.namespaceURI===q&&t===`style`&&pn(e.firstElementChild)||e.nodeType===j.processingInstruction||W&&e.nodeType===j.comment&&w(Be,e.data))},hn=function(e,t,n){if(!V[t]&&bn(t)&&(B.tagNameCheck instanceof RegExp&&w(B.tagNameCheck,t)||B.tagNameCheck instanceof Function&&B.tagNameCheck(t)))return!1;if(Dt&&!K[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?ee(r[a],!0):r[a];t.insertBefore(i,ne(e))}}}return Z(e),!0},gn=function(e,t,n,r){return e.length===0?t:t===n||t===r?k(t):t},_n=function(e,n){if($(L.beforeSanitizeElements,e,null),e!==n&&_(e)===null)return Ot&&an(e),!0;if(dn(e))return Z(e),!0;let r=Y(x?x(e):e.nodeName);if(R=gn(L.uponSanitizeElement,R,ut,vt),$(L.uponSanitizeElement,e,{tagName:r,allowedTags:R}),e!==n&&_(e)===null)return Ot&&an(e),!0;if(mn(e,r))return Z(e),!0;if(V[r]||!(H.tagCheck instanceof Function&&H.tagCheck(r))&&!R[r]){let t=hn(e,r,n);return t===!1&&$(L.afterSanitizeElements,e,null),t}if((b?b(e):e.nodeType)===j.element&&!tn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&w(Ve,e.innerHTML))return Z(e),!0;if(U&&e.nodeType===j.text){let n=ln(e.textContent);e.textContent!==n&&(ae(t.removed,{element:e.cloneNode()}),e.textContent=n)}return $(L.afterSanitizeElements,e,null),!1},vn=function(e,t,r){if(ft[t]||W&&t===`patchsrc`||W&&t===`for`&&e!==`label`&&e!==`output`||wt&&(t===`id`||t===`name`)&&(r in n||r in qt))return!1;let i=z[t]||H.attributeCheck instanceof Function&&H.attributeCheck(t,e);if(!(mt&&w(it,t))&&!(pt&&w(at,t))){if(!i){if(!(bn(e)&&(B.tagNameCheck instanceof RegExp&&w(B.tagNameCheck,e)||B.tagNameCheck instanceof Function&&B.tagNameCheck(e))&&(B.attributeNameCheck instanceof RegExp&&w(B.attributeNameCheck,t)||B.attributeNameCheck instanceof Function&&B.attributeNameCheck(t,e))||t===`is`&&B.allowCustomizedBuiltInElements&&(B.tagNameCheck instanceof RegExp&&w(B.tagNameCheck,r)||B.tagNameCheck instanceof Function&&B.tagNameCheck(r))))return!1}else if(!Nt[t]&&!w(lt,ue(r,st,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&de(r,`data:`)===0&&jt[e])&&!(ht&&!w(ot,ue(r,st,``)))&&r)return!1}return!0},yn=O({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),bn=function(e){return!yn[se(e)]&&w(ct,e)},xn=function(e,t,n,r){if(E&&typeof d==`object`&&typeof d.getAttributeType==`function`&&!n)switch(d.getAttributeType(e,t)){case`TrustedHTML`:return P(r);case`TrustedScriptURL`:return Ye(r)}return r},Sn=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),dn(e)?Z(e):ie(t.removed)}catch{Q(n,e)}},Cn=function(e){$(L.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||dn(e))return;z=gn(L.uponSanitizeAttribute,z,dt,yt);let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:z,forceKeepAttr:void 0},r=t.length,i=Y(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=Y(o),u=c,d=o===`value`?u:fe(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,$(L.uponSanitizeAttribute,e,n),d=n.attrValue,Tt&&(l===`id`||l===`name`)&&de(d,Et)!==0&&(Q(o,e),d=Et+d),W&&w(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){Q(o,e);continue}if(l===`attributename`&&le(d,`href`)){Q(o,e);continue}if(!n.forceKeepAttr){if(!n.keepAttr){Q(o,e);continue}if(!gt&&w(He,d)){Q(o,e);continue}if(U&&(d=ln(d)),!vn(i,l,d)){Q(o,e);continue}d=xn(i,l,s,d),d!==u&&Sn(e,o,s,d)}}$(L.afterSanitizeAttributes,e,null)},wn=function(e){let t=null,n=cn(e);for($(L.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if($(L.uponSanitizeShadowNode,t,null),_n(t,e),Cn(t),fn(t.content)&&wn(t.content),(b?b(t):t.nodeType)===j.element){let e=pe(t);fn(e)&&(Tn(e),wn(e))}$(L.afterSanitizeShadowDOM,e,null)},Tn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){wn(e.shadow);continue}let n=e.node,r=(b?b(n):n.nodeType)===j.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&Y(e)===`template`){let e=n.content;fn(e)&&t.push({node:e,shadow:null})}}if(r){let e=pe(n);fn(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Lt=!e,Lt&&(e=`<!-->`),typeof e!=`string`&&!pn(e)&&(e=ge(e),typeof e!=`string`))throw T(`dirty is not a string, aborting`);if(!t.isSupported)return e;_t?(R=vt,z=yt):Yt(n),(L.uponSanitizeElement.length>0||L.uponSanitizeAttribute.length>0)&&(R=k(R)),L.uponSanitizeAttribute.length>0&&(z=k(z)),t.removed=[];let c=Ot&&typeof e!=`string`&&pn(e);if(c){on(e);let t=x?x(e):e.nodeName;if(typeof t==`string`){let n=Y(t);if(!R[n]||V[n])throw nn(e),T(`root node is forbidden and cannot be sanitized in-place`)}if(dn(e))throw nn(e),T(`root node is clobbered and cannot be sanitized in-place`);try{Tn(e)}catch(t){throw nn(e),t}}else if(pn(e))i=sn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===j.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Tn(a);else{if(!xt&&!U&&!G&&e.indexOf(`<`)===-1)return E&&Ct?P(e):e;if(i=sn(e),!i)return xt?null:Ct?D:``}i&&bt&&Z(i.firstChild);let l=c?e:i;try{let e=cn(l);for(;o=e.nextNode();)_n(o,l),Cn(o),fn(o.content)&&wn(o.content)}catch(n){throw c&&(nn(e),v(t.removed,e=>{e.element&&an(e.element)})),n}if(c)return v(t.removed,e=>{e.element&&an(e.element)}),U&&un(e),e;if(xt){if(U&&un(i),St)for(s=$e.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(z.shadowroot||z.shadowrootmode)&&(s=et.call(r,s,!0)),s}let u=G?i.outerHTML:i.innerHTML;return G&&R[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&w(Le,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-BJmbRsHN.js";export{e as runWebRtcListenCommand};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./chunk-DxIsgrAF.js";import{t}from"./chunk-4s88KT_r.js";import{a as n,i as r,n as i,r as a,t as o}from"./chunk-BQCWtrzh.js";import{c as s,o as c,u as l}from"./chunk-
|
|
1
|
+
import{t as e}from"./chunk-DxIsgrAF.js";import{t}from"./chunk-4s88KT_r.js";import{a as n,i as r,n as i,r as a,t as o}from"./chunk-BQCWtrzh.js";import{c as s,o as c,u as l}from"./chunk-Xz02ooJU.js";import{_ as u,b as d,g as f,l as p,r as m,s as h,y as g}from"./chunk-Jiq-cxA5.js";import{i as _,n as v,r as y}from"./chunk-D0jQVYRk.js";import{n as b,t as x}from"./chunk-DjKQO7aV.js";import{t as S}from"./chunk-CKksk-lA.js";import{t as C}from"./chunk-Do2xLVwC.js";import{A as w,B as T,C as E,D,E as ee,F as O,H as k,I as A,L as te,M as j,N as M,O as ne,P as N,R as P,S as re,T as ie,U as ae,V as oe,W as se,_ as ce,a as le,b as F,c as ue,d as de,f as fe,g as I,h as L,i as pe,j as me,k as he,l as ge,m as _e,o as ve,p as ye,s as be,u as R,v as xe,w as Se,x as Ce,y as we,z as Te}from"./chunk-DxZ6DcRo2.js";import{d as Ee,i as De,l as Oe,n as ke,r as Ae,t as je}from"./chunk-CTnzEqW82.js";import{t as Me}from"./chunk-FEL5dv0w2.js";import{n as Ne,t as Pe}from"./chunk-D9dG7jP92.js";import{createRequire as Fe}from"node:module";import Ie,{constants as Le,existsSync as Re}from"node:fs";import z from"node:path";import{fileURLToPath as ze}from"node:url";import{env as Be}from"node:process";import{exec as Ve,spawn as He}from"node:child_process";import{access as Ue,mkdir as We,readFile as Ge,readdir as Ke,rename as qe,rm as Je,rmdir as Ye,stat as B,unlink as V,writeFile as H}from"node:fs/promises";import{EventEmitter as Xe}from"node:events";import{isIP as Ze}from"node:net";import{runInNewContext as Qe}from"node:vm";import{DatabaseSync as $e}from"node:sqlite";var et=class{kind=`file`;name;_path;constructor(e){this._path=e,this.name=z.basename(e)}async isSameEntry(e){return!e||typeof e!=`object`?!1:e.kind===this.kind&&e._path===this._path}async getFile(){let e=await Ge(this._path);return{size:e.length,type:`application/octet-stream`,async text(){return e.toString(`utf8`)},async arrayBuffer(){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}}}async createWritable(){let e=[],t=this._path,n=async t=>{if(typeof t==`string`)e.push(Buffer.from(t,`utf8`));else if(t instanceof Uint8Array)e.push(Buffer.from(t));else if(t instanceof ArrayBuffer)e.push(Buffer.from(t));else if(t instanceof Blob){if(typeof t.arrayBuffer==`function`){let n=await t.arrayBuffer();e.push(Buffer.from(n))}else if(typeof t.bytes==`function`){let n=await t.bytes();e.push(Buffer.from(n))}else if(typeof t.text==`function`){let n=await t.text();e.push(Buffer.from(n,`utf8`))}else if(t._buffer)e.push(Buffer.from(t._buffer));else if(typeof FileReader<`u`){let n=await new Promise((e,n)=>{let r=new FileReader;r.onload=()=>e(r.result),r.onerror=n,r.readAsArrayBuffer(t)});e.push(Buffer.from(n))}}else t&&typeof t==`object`&&`data`in t?await n(t.data):e.push(Buffer.from(new Uint8Array(t)))};return{write:n,async close(){let n=Buffer.concat(e);await H(t,n)}}}},tt=class e{kind=`directory`;name;_path;_rootPath;constructor(e,t){this._path=z.resolve(e),this._rootPath=t?z.resolve(t):this._path,this.name=z.basename(this._path)||this._path}_resolveChild(e){if(!e||e===`.`||e.includes(`\0`)){let t=Error(`Invalid path name: "${e}"`);throw t.name=`TypeError`,t}let t=z.resolve(this._path,e),n=z.relative(this._path,t),r=z.relative(this._rootPath,t);if(n.startsWith(`..`)||z.isAbsolute(n)||r.startsWith(`..`)||z.isAbsolute(r)){let t=Error(`SecurityError: Path traversal outside workspace root is not allowed: "${e}"`);throw t.name=`SecurityError`,t}return t}async getDirectoryHandle(t,n){let r=this._resolveChild(t);if(n?.create)await We(r,{recursive:!0});else if(!Re(r)){let e=Error(`NotFoundError: ${r} does not exist`);throw e.name=`NotFoundError`,e}if(!(await B(r)).isDirectory()){let e=Error(`TypeMismatchError: "${t}" is a file, not a directory`);throw e.name=`TypeMismatchError`,e}return new e(r,this._rootPath)}async getFileHandle(e,t){let n=this._resolveChild(e);if(t?.create)Re(n)||await H(n,``);else if(!Re(n)){let e=Error(`NotFoundError: ${n} does not exist`);throw e.name=`NotFoundError`,e}if((await B(n)).isDirectory()){let t=Error(`TypeMismatchError: "${e}" is a directory, not a file`);throw t.name=`TypeMismatchError`,t}return new et(n)}async*entries(){let t;try{t=await Ke(this._path)}catch{return}for(let n of t){let t=z.join(this._path,n);try{(await B(t)).isDirectory()?yield[n,new e(t,this._rootPath)]:yield[n,new et(t)]}catch{}}}async isSameEntry(e){return!e||typeof e!=`object`?!1:e.kind===this.kind&&e._path===this._path}async removeEntry(e,t){let n=this._resolveChild(e);if(!Re(n)){let e=Error(`NotFoundError: ${n} does not exist`);throw e.name=`NotFoundError`,e}if((await B(n)).isDirectory())if(t?.recursive)await Je(n,{recursive:!0});else try{await Ye(n)}catch(t){if(t.code===`ENOTEMPTY`){let t=Error(`InvalidModificationError: directory is not empty: "${e}"`);throw t.name=`InvalidModificationError`,t}throw t}else await V(n)}};let nt=null;function rt(){return nt}function it(e){nt=z.resolve(e),l(new tt(e))}globalThis.__setStorageRootFromPath=it,globalThis.__getStorageRootPath=rt;const at=({command:e,stdin:t,timeoutSec:n})=>new Promise(r=>{let i=rt?.()??globalThis.__getStorageRootPath?.()??process.cwd(),a=Ve(e,{timeout:n*1e3,maxBuffer:10*1024*1024,cwd:i},(e,t,n)=>{let i=t||``;n&&(i+=(i?`
|
|
2
2
|
`:``)+n),e&&!i&&(i=e.message),r(i)});t&&a.stdin&&(a.stdin.write(t),a.stdin.end())});M(at),globalThis.__headlessBashExecutor=at;function ot(e,t,n){let r=t.input_tokens||0,i=t.output_tokens||0,a=t.cache_read_input_tokens||0,o=t.cache_creation_input_tokens||0;return{type:`token-usage`,payload:{groupId:e,inputTokens:r,outputTokens:i,cacheReadTokens:a,cacheCreationTokens:o,totalTokens:r+i+a+o,contextLimit:n}}}function U(e,t,n,r){N(Te(e,t,n,r))}async function*st(e,t){let n=e.getReader(),r=new TextDecoder,i=``;try{for(;!t?.aborted;){let{done:e,value:t}=await n.read();if(e)break;i+=r.decode(t,{stream:!0});let a=i.split(`
|
|
3
3
|
|
|
4
4
|
`);i=a.pop()||``;for(let e of a){let t=e.split(`
|
|
@@ -27,7 +27,7 @@ import{t as e}from"./chunk-DxIsgrAF.js";import{t}from"./chunk-4s88KT_r.js";impor
|
|
|
27
27
|
"use strict";
|
|
28
28
|
${e}
|
|
29
29
|
})()`;return{ok:!0,value:await Promise.race([Qe(a,i,{timeout:t}),new Promise((e,n)=>setTimeout(()=>n(Error(`Execution timed out after ${t/1e3}s`)),t))])}}catch(e){return{ok:!1,error:e&&e.message?e.message:String(e)}}};he(Kn),globalThis.__headlessEvalExecutor=Kn;const qn=()=>new t({transport:`webrtc`});j(qn),globalThis.__peerClientFactory=qn;async function Jn(e,t,n,r={}){let i=[],a=[];for(let o of n)try{r.onStep?.(o);let s=Yn(o.input||{},a,n),c=await R(e,o.name,s,t,{isScheduledTask:!r.isManual,isTaskExecution:r.isTaskExecution});a.push(c),o.suppressOutput||i.push(`**Tool \`${o.name}\`**: ${c}`)}catch(e){let t=e.message||String(e);a.push(t),o.suppressOutput||i.push(`**Tool \`${o.name}\` failed**: ${t}`)}return{rawOutputs:a,results:i}}function Yn(e,t,n){if(e&&typeof e==`object`){if(Array.isArray(e))return e.map(e=>Yn(e,t,n));if(`$pipe`in e){let r=e.$pipe,i=``;if(r===`prev`)i=t[t.length-1]??``;else if(typeof r==`number`)i=t[r]??``;else if(typeof r==`string`){for(let e=t.length-1;e>=0;e--)if(n[e]?.name===r){i=t[e];break}}return Xn(i)}let r={};for(let[i,a]of Object.entries(e))r[i]=Yn(a,t,n);return r}return e}function Xn(e){return typeof e==`string`?e:Array.isArray(e)?e.map(e=>e&&typeof e==`object`?`text`in e?String(e.text):`data`in e?String(e.data):JSON.stringify(e):String(e??``)).join(`
|
|
30
|
-
`):e&&typeof e==`object`?e:e??``}let Q=null;const $=(e,t,n,r)=>{try{e.exec(`ALTER TABLE ${t} ADD COLUMN ${n} ${r}`)}catch{}};function
|
|
30
|
+
`):e&&typeof e==`object`?e:e??``}let Q=null,Zn=null;const $=(e,t,n,r)=>{try{e.exec(`ALTER TABLE ${t} ADD COLUMN ${n} ${r}`)}catch{}};function Qn(e=`database/agent.db`){let t=e===`:memory:`?e:z.resolve(e);if(Q&&Zn===t)return Q;$n();let n=new $e(e);return n.exec(`
|
|
31
31
|
CREATE TABLE IF NOT EXISTS messages (
|
|
32
32
|
id TEXT PRIMARY KEY,
|
|
33
33
|
groupId TEXT NOT NULL,
|
|
@@ -43,19 +43,19 @@ import{t as e}from"./chunk-DxIsgrAF.js";import{t}from"./chunk-4s88KT_r.js";impor
|
|
|
43
43
|
freshContext INTEGER,
|
|
44
44
|
subagent INTEGER
|
|
45
45
|
)
|
|
46
|
-
`),
|
|
46
|
+
`),n.exec(`
|
|
47
47
|
CREATE INDEX IF NOT EXISTS messages_by_group_time
|
|
48
48
|
ON messages (groupId, timestamp)
|
|
49
|
-
`),
|
|
49
|
+
`),n.exec(`
|
|
50
50
|
CREATE INDEX IF NOT EXISTS messages_by_group
|
|
51
51
|
ON messages (groupId)
|
|
52
|
-
`),
|
|
52
|
+
`),n.exec(`
|
|
53
53
|
CREATE TABLE IF NOT EXISTS sessions (
|
|
54
54
|
groupId TEXT PRIMARY KEY,
|
|
55
55
|
messages TEXT NOT NULL DEFAULT '[]',
|
|
56
56
|
updatedAt INTEGER NOT NULL DEFAULT 0
|
|
57
57
|
)
|
|
58
|
-
`),
|
|
58
|
+
`),n.exec(`
|
|
59
59
|
CREATE TABLE IF NOT EXISTS tasks (
|
|
60
60
|
id TEXT PRIMARY KEY,
|
|
61
61
|
groupId TEXT NOT NULL,
|
|
@@ -71,21 +71,21 @@ import{t as e}from"./chunk-DxIsgrAF.js";import{t}from"./chunk-4s88KT_r.js";impor
|
|
|
71
71
|
name TEXT,
|
|
72
72
|
task_order INTEGER
|
|
73
73
|
)
|
|
74
|
-
`),
|
|
74
|
+
`),n.exec(`
|
|
75
75
|
CREATE INDEX IF NOT EXISTS tasks_by_group
|
|
76
76
|
ON tasks (groupId)
|
|
77
|
-
`),
|
|
77
|
+
`),n.exec(`
|
|
78
78
|
CREATE INDEX IF NOT EXISTS tasks_by_enabled
|
|
79
79
|
ON tasks (enabled)
|
|
80
|
-
`),
|
|
80
|
+
`),n.exec(`
|
|
81
81
|
CREATE TABLE IF NOT EXISTS config (
|
|
82
82
|
key TEXT PRIMARY KEY,
|
|
83
83
|
value TEXT NOT NULL
|
|
84
84
|
)
|
|
85
|
-
`),
|
|
85
|
+
`),n.exec(`
|
|
86
86
|
CREATE TABLE IF NOT EXISTS pendingShares (
|
|
87
87
|
id TEXT PRIMARY KEY,
|
|
88
88
|
createdAt INTEGER NOT NULL,
|
|
89
89
|
data TEXT
|
|
90
90
|
)
|
|
91
|
-
`),$(
|
|
91
|
+
`),$(n,`tasks`,`type`,`TEXT`),$(n,`tasks`,`freshContext`,`INTEGER`),$(n,`tasks`,`subagent`,`INTEGER`),$(n,`tasks`,`name`,`TEXT`),$(n,`tasks`,`task_order`,`INTEGER`),$(n,`messages`,`freshContext`,`INTEGER`),$(n,`messages`,`subagent`,`INTEGER`),Q=b(n),Zn=t,Q}function $n(){Q&&=(Q.db.close(),null),Zn=null}M(at),Gt(vn),qt(Gn),he(Kn),j(qn);export{o as BROWSER_ONLY_TOOLS,m as CONFIG_KEYS,oe as DEFAULT_BUILTIN_PROFILE,h as DEFAULT_MAX_TOKENS,p as DEFAULT_SERVER_GROUP_ID,tt as NodeFsDirectoryHandle,et as NodeFsFileHandle,Me as TOOL_DEFINITIONS,Z as cleanupAllLlamafileProcesses,$n as closeSqliteDatabase,dn as createTransformersRuntimeService,D as discoverSkills,ye as executeDetectLanguage,_e as executeEmbedText,Ce as executeNativeAiTask,vn as executeNodeTransformersCompletion,L as executeProofreadText,I as executeRewriteText,ce as executeSummarizeText,R as executeTool,Jn as executeToolChain,xe as executeTranslateText,we as executeWriteText,Pe as fetchDiscoveryManifest,i as filterHeadlessTools,f as getAvailableProviders,S as getConfig,Se as getContextLimit,v as getDb,u as getDefaultProvider,g as getModelMaxTokens,d as getProvider,k as getRecentMessages,c as getStorageRoot,Jt as handleInvoke,je as importRemoteArtifacts,ke as importRemoteScript,Ae as importRemoteSkill,De as importRemoteTool,s as invalidateStorageRoot,a as isHeadlessMode,x as isSqliteDatabase,r as isToolHeadlessSafe,Oe as loadDeclarativeTools,ne as loadSkill,at as nativeBashExecutor,Kn as nativeEvalExecutor,qn as nativePeerClientFactory,Qn as openSqliteDatabase,N as post,y as resetDB,Ne as resolveDiscoveryUrl,pe as saveMessage,Ee as setConfig,_ as setDB,M as setHeadlessBashExecutor,he as setHeadlessEvalExecutor,n as setHeadlessMode,F as setNativeAiTaskHandler,j as setPeerClientFactory,A as setPostHandler,l as setStorageRoot,it as setStorageRootFromPath,b as wrapSqliteDatabase};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./chunk-uAI_Zi6n.js";import{existsSync as t}from"node:fs";import n from"node:path";import{pathToFileURL as r}from"node:url";import i from"node:process";const a=e(import.meta.url);let o=null;async function s(){if(o)return o;let e=i.env.NODE_ENV===`test`,s=n.join(a,`dist/headless-agent.js`);if(!e&&t(s))return o=await import(r(s).href),o;try{return o={...await import(`./chunk-
|
|
1
|
+
import{t as e}from"./chunk-uAI_Zi6n.js";import{existsSync as t}from"node:fs";import n from"node:path";import{pathToFileURL as r}from"node:url";import i from"node:process";const a=e(import.meta.url);let o=null;async function s(){if(o)return o;let e=i.env.NODE_ENV===`test`,s=n.join(a,`dist/headless-agent.js`);if(!e&&t(s))return o=await import(r(s).href),o;try{return o={...await import(`./chunk-B2WxN9-12.js`)},o}catch{try{return o={...await import(`./chunk-B2WxN9-12.js`)},o}catch(e){if(t(s))return o={...await import(r(s).href)},o;throw e}}}export{s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./chunk-CKksk-lA.js";export{e as getConfig};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./chunk-
|
|
1
|
+
import{t as e}from"./chunk-DKw-oTLT.js";var t=class e{#e;#t;constructor(e,t){this.#e=e,this.#t=t}static#n=`You are a helpful and accurate translator. Your goal is to translate the given text from the source language to the target language. Preserve the meaning, tone, and any formatting as much as possible. Do not include any explanations or extra text in your response, only the translated text itself. If you are unsure of the translation, provide the most likely one.`;static#r=[{role:`user`,content:`SOURCE: en
|
|
2
2
|
TARGET: de
|
|
3
3
|
TEXT: Good morning, how are you?`},{role:`assistant`,content:`Guten Morgen, wie geht es Ihnen?`},{role:`user`,content:`SOURCE: de
|
|
4
4
|
TARGET: en
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./chunk-DjKQO7aV.js";function t(t,n){let r=null,i;return typeof t==`string`?i=t:(r=t,i=n),r&&e(r)?(r.db.prepare(`DELETE FROM messages WHERE groupId = ?`).run(i),Promise.resolve()):new Promise((e,t)=>{try{let n=r?.transaction(`messages`,`readwrite`);if(!n)return t(Error(`failed to get transaction, cannot clear group messages.`));let a=n.objectStore(`messages`).index(`by-group`).openCursor(i);a.onsuccess=()=>{let t=a.result;t?(t.delete(),t.continue()):e(void 0)},a.onerror=()=>t(a.error)}catch(e){t(e)}})}export{t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as e,n as t,o as n,r}from"./chunk-DB5amaYO.js";import{n as i}from"./chunk-
|
|
1
|
+
import{a as e,n as t,o as n,r}from"./chunk-DB5amaYO.js";import{n as i}from"./chunk-NclDuGcY.js";import a from"node:fs";import o from"node:path";import s from"node:http";import{tmpdir as c}from"node:os";function l(e={}){let t=e.agent!==!1,n;if(e.workspace)n=o.resolve(e.workspace);else{let e=o.join(c(),`shadow-claw`);a.mkdirSync(e,{recursive:!0}),n=a.mkdtempSync(o.join(e,`workspace-`))}let r=e.transfersDir||o.join(n,`transfers`),s={"send-message":async(n,r)=>{let i=n?.text??n?.prompt??n?.message;if(!i||typeof i!=`string`||!i.trim())throw Error(`Missing text or prompt parameter`);let a=r?.remotePeerId||`remote`,o=n.groupId||`peer:${a}`;if(!t)return e.verbose&&console.log(`[webrtc-listen] Message received from ${a} (agent disabled): "${i.trim()}"`),{success:!0,queued:!0,groupId:o,text:`Message received (agent disabled)`};e.verbose&&console.log(`[webrtc-listen] Prompt from ${a}: "${i.length>80?i.slice(0,77)+`...`:i}"`);let s=await(e.runAgent||(async(e,t)=>{let{runAgentRun:n}=await import(`./chunk-D3cH54jW.js`);return n(e,t)}))(i.trim(),{workspace:e.workspace,cacheDir:e.cacheDir,model:e.model,provider:e.provider,apiKey:e.apiKey,systemPrompt:e.systemPrompt,systemPromptFile:e.systemPromptFile,tools:e.tools,allowInternet:e.allowInternet,group:o,quiet:!e.verbose,stream:!1});if(!s?.success)throw Error(s?.error||`Agent execution failed`);return{success:!0,reply:s.response,text:s.response,model:s.model,provider:s.provider,groupId:o}},prompt:async(e,t)=>s[`send-message`](e,t),"send-file":async(n,s)=>{let{fileName:c,data:l,prompt:u,groupId:d}=n||{};if(!c||typeof c!=`string`||!l)throw Error(`Missing fileName or data in send-file args`);let f=i(c);await a.promises.mkdir(r,{recursive:!0});let p=o.join(r,f),m=Buffer.isBuffer(l)?l:Buffer.from(l,`base64`);await a.promises.writeFile(p,m);let h=s?.remotePeerId||`remote`,g=d||`peer:${h}`;e.verbose&&console.log(`[webrtc-listen] Saved file "${f}" (${m.length} bytes) to ${p}`);let _;if(u&&typeof u==`string`&&u.trim()&&t){let t=await(e.runAgent||(async(e,t)=>{let{runAgentRun:n}=await import(`./chunk-D3cH54jW.js`);return n(e,t)}))(`[Attached file: ${f} (${m.length} bytes) saved at ${p}]\n\n${u.trim()}`,{workspace:e.workspace,cacheDir:e.cacheDir,model:e.model,provider:e.provider,apiKey:e.apiKey,systemPrompt:e.systemPrompt,systemPromptFile:e.systemPromptFile,tools:e.tools,allowInternet:e.allowInternet,group:g,quiet:!e.verbose,stream:!1});t?.success&&(_=t.response)}return{success:!0,fileName:f,path:p,size:m.length,reply:_,text:_}},"transfer-file":async(e,t)=>s[`send-file`](e,t),"list-tools":async()=>{try{let{TOOL_DEFINITIONS:e}=await import(`./chunk-C0xoMqcL2.js`);return{tools:e.map(e=>e.name)}}catch{return{tools:[]}}},ping:async t=>({ok:!0,peerId:e.peerId||``,timestamp:Date.now()})};return s}function u(t,n){return new Promise((r,i)=>{let c=e(n);try{a.unlinkSync(c)}catch{}try{a.mkdirSync(o.dirname(c),{recursive:!0})}catch{}let l=s.createServer(async(e,n)=>{if(e.method===`GET`&&e.url===`/ping`){n.writeHead(200,{"Content-Type":`application/json`}),n.end(JSON.stringify({ok:!0,peerId:t.cliPeerId}));return}if(e.method===`GET`&&e.url===`/clients`){let e=Array.from(t._connections.keys()).map(e=>{let n=t._peerCards?.get(e);return{clientId:e,peerId:e,deviceLabel:n?.name||`Browser Peer (${e})`,capabilities:n?.capabilities||[`webrtc`,`peerjs`],version:n?.version||`1.0.0`,transport:`webrtc`,connectedAt:Date.now(),lastSeen:Date.now()}});n.writeHead(200,{"Content-Type":`application/json`}),n.end(JSON.stringify({ok:!0,clients:e}));return}if(e.method===`POST`&&e.url===`/command`){let r=``;e.on(`data`,e=>r+=e),e.on(`end`,async()=>{try{let{targetPeerId:e,action:i,args:a,timeoutMs:o}=JSON.parse(r);if(!e){n.writeHead(400,{"Content-Type":`application/json`}),n.end(JSON.stringify({error:`targetPeerId is required`}));return}let s=t._connections.get(e);if(!s){let r=Array.from(t._connections.keys());n.writeHead(503,{"Content-Type":`application/json`}),n.end(JSON.stringify({error:`No DataChannel open to peer "${e}". Make sure the browser has connected to this listener first.`+(r.length?` Connected peers: ${r.join(`, `)}`:` No peers are currently connected.`)}));return}let c=`${Date.now()}-${Math.random().toString(36).slice(2)}`,l={id:c,type:`command:execute`,payload:{commandId:c,action:i,args:a||{}}},u=await new Promise((e,n)=>{let r=setTimeout(()=>{t._pendingIpc.delete(c),n(Error(`Command "${i}" timed out after ${o||3e4}ms`))},o||3e4);t._pendingIpc.set(c,t=>{clearTimeout(r),e(t)});try{s.send(l)}catch(e){clearTimeout(r),t._pendingIpc.delete(c),n(e)}});n.writeHead(200,{"Content-Type":`application/json`}),n.end(JSON.stringify(u))}catch(e){n.writeHead(500,{"Content-Type":`application/json`}),n.end(JSON.stringify({error:e.message}))}});return}n.writeHead(404),n.end()});l.listen(c,()=>{console.log(`[webrtc-listen] IPC socket: ${c}`),r(l)}),l.on(`error`,i)})}async function d(e={}){let i=e.host||process.env.SHADOWCLAW_HOST||`127.0.0.1`,a=e.port?parseInt(String(e.port),10):parseInt(process.env.SHADOWCLAW_PORT||`8888`,10),o=e.path||`/`,s=!!(e.secure||e.https||[`1`,`true`,`yes`].includes((process.env.SHADOWCLAW_HTTPS||``).toLowerCase().trim())),c=!!(e.insecure===!1||[`0`,`false`,`no`].includes((process.env.SHADOWCLAW_TLS_REJECT_UNAUTHORIZED||``).toLowerCase().trim())),d=e.trustedPeer?Array.isArray(e.trustedPeer)?e.trustedPeer:[e.trustedPeer]:[],f=n(e.peerId,e.cacheDir);console.log(`WebRTC CLI Peer ID : ${f}`),console.log(`Signaling server : ${s?`wss`:`ws`}://${i}:${a}${o}`),s&&!c&&console.log(`TLS verification : disabled (self-signed cert allowed)`),d.length>0?console.log(`Trusted peers : ${d.join(`, `)}`):console.log(`Trusted peers : (any — add --trusted-peer <id> to restrict)`),console.log(``),console.log(`Add this CLI Peer ID as a trusted peer in the browser:`),console.log(` Settings → WebRTC/PeerJS → Trusted Peer IDs → "${f}"`),console.log(``);let p={...l({...e,peerId:f}),...e.handlers||{}},m=new t({host:i,port:a,path:o,secure:s,rejectUnauthorized:c,trustedPeerIds:d,peerId:e.peerId,cacheDir:e.cacheDir,renewPeerId:!!e.renewPeerId,verbose:!!e.verbose,handlers:p}),h=new Map;m._pendingIpc=h;let g=m._setupConnection.bind(m);m._setupConnection=function(e,t){g(e,t),e.on(`data`,e=>{let t=e;if(typeof e==`string`)try{t=JSON.parse(e)}catch{return}if(!(!t||typeof t!=`object`)&&t.type===`command:result`){let e=t.payload||{},n=h.get(e.commandId);n&&(h.delete(e.commandId),n(e))}})};let _=t=>{if(console.log(`
|
|
2
2
|
[webrtc-listen] Shutting down…`),r(e.cacheDir),t)try{t.close()}catch{}m.close(),process.exit(0)};try{await m.start();let t=await u(m,e.cacheDir);process.on(`SIGINT`,()=>_(t)),process.on(`SIGTERM`,()=>_(t)),console.log(`[webrtc-listen] Ready. Run commands with:
|
|
3
3
|
node bin/cli.mjs send --transport webrtc --client <browser-peer-id> "message"`),await new Promise(()=>{})}catch(t){r(e.cacheDir),console.error(`Error starting WebRTC listener: ${t.message}`),process.exitCode=1}}export{d as n,u as r,l as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,i as t,s as n}from"./chunk-
|
|
1
|
+
import{c as e,i as t,s as n}from"./chunk-ClBaEe8W.js";function r(e){return n(e,{replacement:`-`,fallback:`attachment`,stripLeadingDots:!0,collapseReplacement:!0,stripControlChars:!0})}function i(e,t=``,n=Date.now()){let i=r(e),a=t.trim().replace(/[^a-zA-Z0-9._-]+/g,`-`).replace(/^-+|-+$/g,``);return`attachments/${n}-${a?`${a}-`:``}${i}`}async function a(n,a,c=[]){let l=[];for(let u of c){let c=r(u.fileName||``),d=u.path||i(c,u.id),f=u.source,p=t(c,u.mimeType||``),m=u.size;if(f){let r=await o(f);p=t(c,u.mimeType||r.type),m=typeof m==`number`?m:r.size,await e(n,a,d,r)}l.push(s({...u,fileName:c,mimeType:p,size:m,path:d,previewDisposition:u.previewDisposition||(p===`image/png`?`inline`:`file`)}))}return l}async function o(e){if(e.kind===`local-file`)return e.file;if(e.kind===`inline-text`)return new Blob([e.text],{type:e.mimeType||`text/plain`});let t=await fetch(e.url,{headers:e.headers});if(!t.ok)throw Error(`Attachment download failed: HTTP ${t.status} ${t.statusText}`);return await t.blob()}function s(e){let{source:t,...n}=e;return n}export{r as n,a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./chunk-j0KG-6x9.js";export{e as getAgentCore};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./chunk-B5hVBRV-.js";export{e as getAgentCore};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import e from"node:fs";import t from"node:path";import n from"node:process";import r from"node:readline/promises";import i from"node:tty";function a(e,t=1){if(!Number.isFinite(e)||e<=0)return`0 B`;let n=1024,r=t<0?0:t,i=[`B`,`KB`,`MB`,`GB`,`TB`],a=Math.floor(Math.log(e)/Math.log(n)),o=Math.min(a,i.length-1);return`${parseFloat((e/n**o).toFixed(r))} ${i[o]}`}function o(e={}){let{modelId:t=`model`,stream:r=n.stderr,barWidth:i=24,isTTY:o=!!(r&&typeof r==`object`&&r.isTTY),enabled:s=!0}=e;if(!s)return{update:()=>{},finish:()=>{},fail:e=>{r?.write&&r.write(`${e||`✖ Failed to download ${t}.`}\n`)}};let c=[],l=new Map,u=!1;function d(e){let t=Math.round(Math.max(0,Math.min(1,e))*i),n=i-t;return`[`+`=`.repeat(t)+(t<i?`>`:``)+` `.repeat(Math.max(0,n-+(t<i)))+`]`}function f(e,t=0,n=0){let i=l.get(e);return i||(i={lineIndex:c.length,lastPct:-1,lastRenderedTime:0,loaded:t,total:n,isDone:!1},l.set(e,i),c.push(e),o&&c.length>1&&r?.write&&r.write(`
|
|
2
|
-
`)),i}function p(e,t){if(!o||!r?.write)return;let n=l.get(e);if(!n)return;let i=typeof r.columns==`number`&&r.columns>0?r.columns:null,a=i&&t.length>i-1?t.slice(0,i-1):t,s=c.length-1-n.lineIndex;s>0?r.write(`\x1b[${s}A\r\x1b[2K${a}\x1b[${s}B\r`):r.write(`\r\x1b[2K${a}`)}function m(e){if(u||!e)return;let n=e.file||(e.status===`progress_total`?`Total`:t);if(e.status===`initiate`){if(f(n),!o&&r?.write)r.write(`[Download] Starting ${t}${n?` (${n})`:``}...\n`);else if(o){let e=n?` [${n}]`:``;p(n,`Downloading ${t}${e} ${d(0)} 0.0%`)}return}if(e.status===`progress`||e.status===`progress_total`){let i=typeof e.progress==`number`?e.progress:0,s=Math.max(0,Math.min(100,i)),c=s/100,l=Number(e.loaded)||0,u=Number(e.total)||0,m=f(n,l,u),h=Date.now();if(o){if(h-m.lastRenderedTime<30&&s<100&&Math.abs(s-m.lastPct)<.5)return;m.lastRenderedTime=h,m.lastPct=s,m.loaded=l,m.total=u;let e=d(c),r=`${s.toFixed(1)}%`.padStart(6,` `),i=``;u>0?i=` (${a(l)} / ${a(u)})`:l>0&&(i=` (${a(l)})`);let o=n?` [${n}]`:``;p(n,`Downloading ${t}${o} ${e} ${r}${i}`)}else{let e=Math.floor(s/20)*20;if(e>m.lastPct&&(e>0||s===0)){m.lastPct=e;let i=u>0?` (${a(l)} / ${a(u)})`:``;r?.write&&r.write(`[Download] ${t}${n?` [${n}]`:``}: ${e}%${i}\n`)}}return}if(e.status===`done`){let i=l.get(n);if(i)if(i.isDone=!0,o){let e=d(1),r=i.total||i.loaded,o=r>0?` (${a(r)})`:``,s=n?` [${n}]`:``;p(n,`Downloading ${t}${s} ${e} 100.0%${o}`)}else r?.write&&r.write(`[Download] Finished file: ${n}\n`);else!o&&e.file&&r?.write&&r.write(`[Download] Finished file: ${e.file}\n`)}}function h(e){if(u)return;u=!0;let n=`✔ Model ${t} downloaded successfully.`;o&&r?.write?c.length>0?r.write(`\n${e||n}\n`):r.write(`${e||n}\n`):r?.write&&r.write(`${e||n}\n`)}function g(e){if(u)return;u=!0;let n=`✖ Failed to download ${t}.`;o&&r?.write?c.length>0?r.write(`\n${e||n}\n`):r.write(`${e||n}\n`):r?.write&&r.write(`${e||n}\n`)}return{update:m,finish:h,fail:g}}const s=[{id:`onnx-community/gemma-3-1b-it-ONNX-GQA`,name:`Gemma 3 1B GQA (ONNX)`,description:`Google Gemma 3 1B with Grouped Query Attention (Default)`,contextLength:32e3,supportsTools:!0,recommended:!0},{id:`onnx-community/gemma-4-E2B-it-ONNX`,name:`Gemma 4 E2B (ONNX)`,description:`Google Gemma 4 E2B instruction-tuned ONNX model`,contextLength:128e3,supportsTools:!0,recommended:!1},{id:`onnx-community/gemma-4-E4B-it-ONNX`,name:`Gemma 4 E4B (ONNX)`,description:`Google Gemma 4 E4B instruction-tuned ONNX model`,contextLength:128e3,supportsTools:!0,recommended:!1},{id:`onnx-community/Qwen3-0.6B-ONNX`,name:`Qwen 3 0.6B (ONNX)`,description:`Fast, compact, tool-calling supported 0.6B model`,contextLength:32768,supportsTools:!0,recommended:!1}],c=`onnx-community/gemma-3-1b-it-ONNX-GQA`,l=[{id:`mozilla-ai/gemma-4-E2B-it-Q5_K_M.llamafile`,name:`Gemma 4 E2B Q5_K_M (Llamafile)`,description:`Google Gemma 4 E2B instruction-tuned Llamafile (Q5_K_M)`,url:`https://huggingface.co/mozilla-ai/llamafile_0.10/resolve/main/gemma-4-E2B-it-Q5_K_M.llamafile`,fileName:`gemma-4-E2B-it-Q5_K_M.llamafile`,contextLength:128e3,supportsTools:!1},{id:`mozilla-ai/gemma-4-E4B-it-Q5_K_M.llamafile`,name:`Gemma 4 E4B Q5_K_M (Llamafile)`,description:`Google Gemma 4 E4B instruction-tuned Llamafile (Q5_K_M)`,url:`https://huggingface.co/mozilla-ai/llamafile_0.10/resolve/main/gemma-4-E4B-it-Q5_K_M.llamafile`,fileName:`gemma-4-E4B-it-Q5_K_M.llamafile`,contextLength:128e3,supportsTools:!1},{id:`mozilla-ai/Qwen3.5-0.8B-Q8_0.llamafile`,name:`Qwen 3.5 0.8B Q8_0 (Llamafile)`,description:`Alibaba Qwen 3.5 0.8B Llamafile (Q8_0)`,url:`https://huggingface.co/mozilla-ai/llamafile_0.10/resolve/main/Qwen3.5-0.8B-Q8_0.llamafile`,fileName:`Qwen3.5-0.8B-Q8_0.llamafile`,contextLength:32768,supportsTools:!1},{id:`mozilla-ai/Qwen3.5-2B-Q8_0.llamafile`,name:`Qwen 3.5 2B Q8_0 (Llamafile)`,description:`Alibaba Qwen 3.5 2B Llamafile (Q8_0)`,url:`https://huggingface.co/mozilla-ai/llamafile_0.10/resolve/main/Qwen3.5-2B-Q8_0.llamafile`,fileName:`Qwen3.5-2B-Q8_0.llamafile`,contextLength:32768,supportsTools:!1},{id:`mozilla-ai/Qwen3.5-4B-Q5_K_S.llamafile`,name:`Qwen 3.5 4B Q5_K_S (Llamafile)`,description:`Alibaba Qwen 3.5 4B Llamafile (Q5_K_S)`,url:`https://huggingface.co/mozilla-ai/llamafile_0.10/resolve/main/Qwen3.5-4B-Q5_K_S.llamafile`,fileName:`Qwen3.5-4B-Q5_K_S.llamafile`,contextLength:32768,supportsTools:!1},{id:`mozilla-ai/Qwen3.5-9B-Q5_K_S.llamafile`,name:`Qwen 3.5 9B Q5_K_S (Llamafile)`,description:`Alibaba Qwen 3.5 9B Llamafile (Q5_K_S)`,url:`https://huggingface.co/mozilla-ai/llamafile_0.10/resolve/main/Qwen3.5-9B-Q5_K_S.llamafile`,fileName:`Qwen3.5-9B-Q5_K_S.llamafile`,contextLength:32768,supportsTools:!1}];function u(e){return e?t.resolve(e):t.resolve(n.cwd(),`assets/cache/transformers.js`)}function d(e){return e?t.resolve(e,`llamafile`):t.resolve(n.cwd(),`assets/cache/llamafile`)}function f(e){return!e||typeof e!=`string`?!1:e.endsWith(`.llamafile`)||e.includes(`llamafile`)||l.some(n=>n.id===e||n.fileName===e||n.url===e||n.fileName===t.basename(e))}function p(n,r){let i=d(r);if(!e.existsSync(i))return!1;let a=t.basename(n),o=a.endsWith(`.llamafile`)?a:`${a}.llamafile`,s=t.join(i,o);try{if(e.existsSync(s))return e.statSync(s).size>0}catch{}return!1}function m(n,r){if(f(n))return p(n,r);let i=u(r);if(!e.existsSync(i))return!1;let a=[t.join(i,n),t.join(i,`models--${n.replace(/\//g,`--`)}`),t.join(i,n.split(`/`)[1]||n)];for(let t of a)try{if(e.existsSync(t)&&e.readdirSync(t).filter(e=>!e.endsWith(`.part`)&&!e.includes(`.tmp`)).length>0)return!0}catch{}return!1}function h(e){return s.map(t=>({...t,cached:m(t.id,e)}))}function g(e){return l.map(t=>({...t,cached:p(t.fileName,e)}))}async function _(e={}){let t=e.endpoint||`https://huggingface.co/api/models?author=onnx-community&pipeline_tag=text-generation&limit=100`;try{let n=await fetch(t,{headers:{"User-Agent":`ShadowClaw-CLI`},signal:AbortSignal.timeout(e.timeoutMs||8e3)});if(!n.ok)return[];let r=await n.json();if(!Array.isArray(r))return[];let i=r.map(e=>typeof e?.id==`string`?e.id:``).filter(e=>e&&e.toLowerCase().includes(`onnx`));if(e.query){let t=e.query.toLowerCase();i=i.filter(e=>e.toLowerCase().includes(t))}return i.sort().map(t=>({id:t,name:t.replace(/^onnx-community\//,``),cached:m(t,e.cacheDir)}))}catch{return[]}}async function v(r,i={}){let{cacheDir:a,verbose:s=!1,isTTY:c,stream:u=n.stderr,progress:f,noProgress:p,abortSignal:m}=i,h=l.find(e=>e.id===r||e.fileName===r||e.fileName===t.basename(r)||e.url===r),g,_;h?(g=h.url,_=h.fileName):r.startsWith(`http://`)||r.startsWith(`https://`)?(g=r,_=t.basename(new URL(r).pathname)):(_=t.basename(r).endsWith(`.llamafile`)?t.basename(r):`${t.basename(r)}.llamafile`,g=`https://huggingface.co/mozilla-ai/llamafile_0.10/resolve/main/${_}`);let v=d(a);e.mkdirSync(v,{recursive:!0});let y=t.join(v,_),b=t.join(v,`${_}.part`);if(e.existsSync(y))try{if(e.statSync(y).size>0)return{success:!0,modelId:r,path:y}}catch{}let x=0;if(e.existsSync(b))try{let t=e.statSync(b);t.size>0&&(x=t.size)}catch{x=0}let S=o({modelId:_,stream:u,isTTY:c,enabled:f!==!1&&!p});try{s&&u?.write&&u.write(`[Llamafile] Downloading ${g}...\n`);let t={"User-Agent":`ShadowClaw-CLI`,"Accept-Encoding":`identity`};x>0&&(t.Range=`bytes=${x}-`);let n=i.fetch||globalThis.fetch,a=await n(g,{headers:t,redirect:`follow`,signal:m});if(a.status===416&&x>0){try{e.existsSync(b)&&e.unlinkSync(b)}catch{}x=0,delete t.Range,a=await n(g,{headers:t,redirect:`follow`,signal:m})}if(!a.ok&&a.status!==206)throw Error(`Failed to download ${g}: HTTP ${a.status} ${a.statusText}`);let o=a.status===206,c=0,l=0,d;if(o){let t=(a.headers?.get?.(`content-range`))?.match(/\/\s*(\d+)\s*$/),n=parseInt(a.headers?.get?.(`content-length`)||`0`,10);c=t?parseInt(t[1],10):x+n,l=x,d=e.createWriteStream(b,{flags:`a`})}else x=0,c=parseInt(a.headers?.get?.(`content-length`)||`0`,10),l=0,d=e.createWriteStream(b,{flags:`w`});if(l>0&&S.update({status:`progress`,file:_,loaded:l,total:c,progress:c>0?l/c*100:void 0}),a.body){let{Readable:e}=await import(`node:stream`),t;if(typeof e.fromWeb==`function`&&typeof a.body.getReader==`function`)t=e.fromWeb(a.body);else if(typeof a.body[Symbol.asyncIterator]==`function`)t=a.body;else{let e=Buffer.from(await a.arrayBuffer());d.write(e),l+=e.length}if(t)for await(let e of t){let t=Buffer.isBuffer(e)?e:Buffer.from(e);d.write(t),l+=t.length,S.update({status:`progress`,file:_,loaded:l,total:c,progress:c>0?l/c*100:void 0})}}d.end(),await new Promise((e,t)=>{d.on(`finish`,e),d.on(`error`,t)}),e.renameSync(b,y);try{e.chmodSync(y,493)}catch{}return S.finish(),{success:!0,modelId:r,path:y}}catch(e){let t=e instanceof Error?e.message:String(e);return S.fail(`✖ Error downloading ${_}: ${t}`),{success:!1,modelId:r,error:t}}}async function y(e,t={}){if(f(e))return v(e,t);let{verbose:r=!1,isTTY:i,stream:a=n.stderr,service:s,progress:c,noProgress:l}=t,u=s;if(!u){let{getAgentCore:e}=await import(`./chunk-Cqd6ZDkT.js`),t=await e();if(typeof t.createTransformersRuntimeService!=`function`)throw Error(`createTransformersRuntimeService is not available in agent core`);u=t.createTransformersRuntimeService()}let d=o({modelId:e,stream:a,isTTY:i,enabled:c!==!1&&!l});try{return r&&a?.write&&a.write(`[Transformers.js] Prewarming model ${e}...\n`),await u.prewarmModel({modelId:e,verbose:r,cacheDir:t.cacheDir,onProgress:e=>{d.update(e)}}),d.finish(),{success:!0,modelId:e}}catch(t){let n=t instanceof Error?t.message:String(t);return d.fail(`✖ Error downloading ${e}: ${n}`),{success:!1,modelId:e,error:n}}}async function b(a={}){let o=t.resolve(a.contentRoot||n.cwd()),s=t.resolve(a.workspaceDir||o),l=a.cacheDir,u=a.onExit||(e=>n.exit(e)),d=a.stdin||n.stdin,h=a.stdout||n.stderr,g=!1,b=null;if(d===n.stdin&&!n.stdin.isTTY&&!n.env.CI&&(n.stderr.isTTY||n.stdout.isTTY))try{let t=n.platform===`win32`?`CONIN$`:`/dev/tty`;b=e.openSync(t,`r`),d=new i.ReadStream(b),h=n.stderr.isTTY?n.stderr:n.stdout,g=!0}catch{try{let t=n.platform===`win32`?`CONIN$`:`/dev/tty`;d=e.createReadStream(t),h=n.stderr.isTTY?n.stderr:n.stdout,g=!0}catch{}}let x=r.createInterface({input:d,output:h}),S=!1,C=()=>{if(!S){S=!0,h.write(`
|
|
2
|
+
`)),i}function p(e,t){if(!o||!r?.write)return;let n=l.get(e);if(!n)return;let i=typeof r.columns==`number`&&r.columns>0?r.columns:null,a=i&&t.length>i-1?t.slice(0,i-1):t,s=c.length-1-n.lineIndex;s>0?r.write(`\x1b[${s}A\r\x1b[2K${a}\x1b[${s}B\r`):r.write(`\r\x1b[2K${a}`)}function m(e){if(u||!e)return;let n=e.file||(e.status===`progress_total`?`Total`:t);if(e.status===`initiate`){if(f(n),!o&&r?.write)r.write(`[Download] Starting ${t}${n?` (${n})`:``}...\n`);else if(o){let e=n?` [${n}]`:``;p(n,`Downloading ${t}${e} ${d(0)} 0.0%`)}return}if(e.status===`progress`||e.status===`progress_total`){let i=typeof e.progress==`number`?e.progress:0,s=Math.max(0,Math.min(100,i)),c=s/100,l=Number(e.loaded)||0,u=Number(e.total)||0,m=f(n,l,u),h=Date.now();if(o){if(h-m.lastRenderedTime<30&&s<100&&Math.abs(s-m.lastPct)<.5)return;m.lastRenderedTime=h,m.lastPct=s,m.loaded=l,m.total=u;let e=d(c),r=`${s.toFixed(1)}%`.padStart(6,` `),i=``;u>0?i=` (${a(l)} / ${a(u)})`:l>0&&(i=` (${a(l)})`);let o=n?` [${n}]`:``;p(n,`Downloading ${t}${o} ${e} ${r}${i}`)}else{let e=Math.floor(s/20)*20;if(e>m.lastPct&&(e>0||s===0)){m.lastPct=e;let i=u>0?` (${a(l)} / ${a(u)})`:``;r?.write&&r.write(`[Download] ${t}${n?` [${n}]`:``}: ${e}%${i}\n`)}}return}if(e.status===`done`){let i=l.get(n);if(i)if(i.isDone=!0,o){let e=d(1),r=i.total||i.loaded,o=r>0?` (${a(r)})`:``,s=n?` [${n}]`:``;p(n,`Downloading ${t}${s} ${e} 100.0%${o}`)}else r?.write&&r.write(`[Download] Finished file: ${n}\n`);else!o&&e.file&&r?.write&&r.write(`[Download] Finished file: ${e.file}\n`)}}function h(e){if(u)return;u=!0;let n=`✔ Model ${t} downloaded successfully.`;o&&r?.write?c.length>0?r.write(`\n${e||n}\n`):r.write(`${e||n}\n`):r?.write&&r.write(`${e||n}\n`)}function g(e){if(u)return;u=!0;let n=`✖ Failed to download ${t}.`;o&&r?.write?c.length>0?r.write(`\n${e||n}\n`):r.write(`${e||n}\n`):r?.write&&r.write(`${e||n}\n`)}return{update:m,finish:h,fail:g}}const s=[{id:`onnx-community/gemma-3-1b-it-ONNX-GQA`,name:`Gemma 3 1B GQA (ONNX)`,description:`Google Gemma 3 1B with Grouped Query Attention (Default)`,contextLength:32e3,supportsTools:!0,recommended:!0},{id:`onnx-community/gemma-4-E2B-it-ONNX`,name:`Gemma 4 E2B (ONNX)`,description:`Google Gemma 4 E2B instruction-tuned ONNX model`,contextLength:128e3,supportsTools:!0,recommended:!1},{id:`onnx-community/gemma-4-E4B-it-ONNX`,name:`Gemma 4 E4B (ONNX)`,description:`Google Gemma 4 E4B instruction-tuned ONNX model`,contextLength:128e3,supportsTools:!0,recommended:!1},{id:`onnx-community/Qwen3-0.6B-ONNX`,name:`Qwen 3 0.6B (ONNX)`,description:`Fast, compact, tool-calling supported 0.6B model`,contextLength:32768,supportsTools:!0,recommended:!1}],c=`onnx-community/gemma-3-1b-it-ONNX-GQA`,l=[{id:`mozilla-ai/gemma-4-E2B-it-Q5_K_M.llamafile`,name:`Gemma 4 E2B Q5_K_M (Llamafile)`,description:`Google Gemma 4 E2B instruction-tuned Llamafile (Q5_K_M)`,url:`https://huggingface.co/mozilla-ai/llamafile_0.10/resolve/main/gemma-4-E2B-it-Q5_K_M.llamafile`,fileName:`gemma-4-E2B-it-Q5_K_M.llamafile`,contextLength:128e3,supportsTools:!1},{id:`mozilla-ai/gemma-4-E4B-it-Q5_K_M.llamafile`,name:`Gemma 4 E4B Q5_K_M (Llamafile)`,description:`Google Gemma 4 E4B instruction-tuned Llamafile (Q5_K_M)`,url:`https://huggingface.co/mozilla-ai/llamafile_0.10/resolve/main/gemma-4-E4B-it-Q5_K_M.llamafile`,fileName:`gemma-4-E4B-it-Q5_K_M.llamafile`,contextLength:128e3,supportsTools:!1},{id:`mozilla-ai/Qwen3.5-0.8B-Q8_0.llamafile`,name:`Qwen 3.5 0.8B Q8_0 (Llamafile)`,description:`Alibaba Qwen 3.5 0.8B Llamafile (Q8_0)`,url:`https://huggingface.co/mozilla-ai/llamafile_0.10/resolve/main/Qwen3.5-0.8B-Q8_0.llamafile`,fileName:`Qwen3.5-0.8B-Q8_0.llamafile`,contextLength:32768,supportsTools:!1},{id:`mozilla-ai/Qwen3.5-2B-Q8_0.llamafile`,name:`Qwen 3.5 2B Q8_0 (Llamafile)`,description:`Alibaba Qwen 3.5 2B Llamafile (Q8_0)`,url:`https://huggingface.co/mozilla-ai/llamafile_0.10/resolve/main/Qwen3.5-2B-Q8_0.llamafile`,fileName:`Qwen3.5-2B-Q8_0.llamafile`,contextLength:32768,supportsTools:!1},{id:`mozilla-ai/Qwen3.5-4B-Q5_K_S.llamafile`,name:`Qwen 3.5 4B Q5_K_S (Llamafile)`,description:`Alibaba Qwen 3.5 4B Llamafile (Q5_K_S)`,url:`https://huggingface.co/mozilla-ai/llamafile_0.10/resolve/main/Qwen3.5-4B-Q5_K_S.llamafile`,fileName:`Qwen3.5-4B-Q5_K_S.llamafile`,contextLength:32768,supportsTools:!1},{id:`mozilla-ai/Qwen3.5-9B-Q5_K_S.llamafile`,name:`Qwen 3.5 9B Q5_K_S (Llamafile)`,description:`Alibaba Qwen 3.5 9B Llamafile (Q5_K_S)`,url:`https://huggingface.co/mozilla-ai/llamafile_0.10/resolve/main/Qwen3.5-9B-Q5_K_S.llamafile`,fileName:`Qwen3.5-9B-Q5_K_S.llamafile`,contextLength:32768,supportsTools:!1}];function u(e){return e?t.resolve(e):t.resolve(n.cwd(),`assets/cache/transformers.js`)}function d(e){return e?t.resolve(e,`llamafile`):t.resolve(n.cwd(),`assets/cache/llamafile`)}function f(e){return!e||typeof e!=`string`?!1:e.endsWith(`.llamafile`)||e.includes(`llamafile`)||l.some(n=>n.id===e||n.fileName===e||n.url===e||n.fileName===t.basename(e))}function p(n,r){let i=d(r);if(!e.existsSync(i))return!1;let a=t.basename(n),o=a.endsWith(`.llamafile`)?a:`${a}.llamafile`,s=t.join(i,o);try{if(e.existsSync(s))return e.statSync(s).size>0}catch{}return!1}function m(n,r){if(f(n))return p(n,r);let i=u(r);if(!e.existsSync(i))return!1;let a=[t.join(i,n),t.join(i,`models--${n.replace(/\//g,`--`)}`),t.join(i,n.split(`/`)[1]||n)];for(let t of a)try{if(e.existsSync(t)&&e.readdirSync(t).filter(e=>!e.endsWith(`.part`)&&!e.includes(`.tmp`)).length>0)return!0}catch{}return!1}function h(e){return s.map(t=>({...t,cached:m(t.id,e)}))}function g(e){return l.map(t=>({...t,cached:p(t.fileName,e)}))}async function _(e={}){let t=e.endpoint||`https://huggingface.co/api/models?author=onnx-community&pipeline_tag=text-generation&limit=100`;try{let n=await fetch(t,{headers:{"User-Agent":`ShadowClaw-CLI`},signal:AbortSignal.timeout(e.timeoutMs||8e3)});if(!n.ok)return[];let r=await n.json();if(!Array.isArray(r))return[];let i=r.map(e=>typeof e?.id==`string`?e.id:``).filter(e=>e&&e.toLowerCase().includes(`onnx`));if(e.query){let t=e.query.toLowerCase();i=i.filter(e=>e.toLowerCase().includes(t))}return i.sort().map(t=>({id:t,name:t.replace(/^onnx-community\//,``),cached:m(t,e.cacheDir)}))}catch{return[]}}async function v(r,i={}){let{cacheDir:a,verbose:s=!1,isTTY:c,stream:u=n.stderr,progress:f,noProgress:p,abortSignal:m}=i,h=l.find(e=>e.id===r||e.fileName===r||e.fileName===t.basename(r)||e.url===r),g,_;h?(g=h.url,_=h.fileName):r.startsWith(`http://`)||r.startsWith(`https://`)?(g=r,_=t.basename(new URL(r).pathname)):(_=t.basename(r).endsWith(`.llamafile`)?t.basename(r):`${t.basename(r)}.llamafile`,g=`https://huggingface.co/mozilla-ai/llamafile_0.10/resolve/main/${_}`);let v=d(a);e.mkdirSync(v,{recursive:!0});let y=t.join(v,_),b=t.join(v,`${_}.part`);if(e.existsSync(y))try{if(e.statSync(y).size>0)return{success:!0,modelId:r,path:y}}catch{}let x=0;if(e.existsSync(b))try{let t=e.statSync(b);t.size>0&&(x=t.size)}catch{x=0}let S=o({modelId:_,stream:u,isTTY:c,enabled:f!==!1&&!p});try{s&&u?.write&&u.write(`[Llamafile] Downloading ${g}...\n`);let t={"User-Agent":`ShadowClaw-CLI`,"Accept-Encoding":`identity`};x>0&&(t.Range=`bytes=${x}-`);let n=i.fetch||globalThis.fetch,a=await n(g,{headers:t,redirect:`follow`,signal:m});if(a.status===416&&x>0){try{e.existsSync(b)&&e.unlinkSync(b)}catch{}x=0,delete t.Range,a=await n(g,{headers:t,redirect:`follow`,signal:m})}if(!a.ok&&a.status!==206)throw Error(`Failed to download ${g}: HTTP ${a.status} ${a.statusText}`);let o=a.status===206,c=0,l=0,d;if(o){let t=(a.headers?.get?.(`content-range`))?.match(/\/\s*(\d+)\s*$/),n=parseInt(a.headers?.get?.(`content-length`)||`0`,10);c=t?parseInt(t[1],10):x+n,l=x,d=e.createWriteStream(b,{flags:`a`})}else x=0,c=parseInt(a.headers?.get?.(`content-length`)||`0`,10),l=0,d=e.createWriteStream(b,{flags:`w`});if(l>0&&S.update({status:`progress`,file:_,loaded:l,total:c,progress:c>0?l/c*100:void 0}),a.body){let{Readable:e}=await import(`node:stream`),t;if(typeof e.fromWeb==`function`&&typeof a.body.getReader==`function`)t=e.fromWeb(a.body);else if(typeof a.body[Symbol.asyncIterator]==`function`)t=a.body;else{let e=Buffer.from(await a.arrayBuffer());d.write(e),l+=e.length}if(t)for await(let e of t){let t=Buffer.isBuffer(e)?e:Buffer.from(e);d.write(t),l+=t.length,S.update({status:`progress`,file:_,loaded:l,total:c,progress:c>0?l/c*100:void 0})}}d.end(),await new Promise((e,t)=>{d.on(`finish`,e),d.on(`error`,t)}),e.renameSync(b,y);try{e.chmodSync(y,493)}catch{}return S.finish(),{success:!0,modelId:r,path:y}}catch(e){let t=e instanceof Error?e.message:String(e);return S.fail(`✖ Error downloading ${_}: ${t}`),{success:!1,modelId:r,error:t}}}async function y(e,t={}){if(f(e))return v(e,t);let{verbose:r=!1,isTTY:i,stream:a=n.stderr,service:s,progress:c,noProgress:l}=t,u=s;if(!u){let{getAgentCore:e}=await import(`./chunk-BaAL1yLC.js`),t=await e();if(typeof t.createTransformersRuntimeService!=`function`)throw Error(`createTransformersRuntimeService is not available in agent core`);u=t.createTransformersRuntimeService()}let d=o({modelId:e,stream:a,isTTY:i,enabled:c!==!1&&!l});try{return r&&a?.write&&a.write(`[Transformers.js] Prewarming model ${e}...\n`),await u.prewarmModel({modelId:e,verbose:r,cacheDir:t.cacheDir,onProgress:e=>{d.update(e)}}),d.finish(),{success:!0,modelId:e}}catch(t){let n=t instanceof Error?t.message:String(t);return d.fail(`✖ Error downloading ${e}: ${n}`),{success:!1,modelId:e,error:n}}}async function b(a={}){let o=t.resolve(a.contentRoot||n.cwd()),s=t.resolve(a.workspaceDir||o),l=a.cacheDir,u=a.onExit||(e=>n.exit(e)),d=a.stdin||n.stdin,h=a.stdout||n.stderr,g=!1,b=null;if(d===n.stdin&&!n.stdin.isTTY&&!n.env.CI&&(n.stderr.isTTY||n.stdout.isTTY))try{let t=n.platform===`win32`?`CONIN$`:`/dev/tty`;b=e.openSync(t,`r`),d=new i.ReadStream(b),h=n.stderr.isTTY?n.stderr:n.stdout,g=!0}catch{try{let t=n.platform===`win32`?`CONIN$`:`/dev/tty`;d=e.createReadStream(t),h=n.stderr.isTTY?n.stderr:n.stdout,g=!0}catch{}}let x=r.createInterface({input:d,output:h}),S=!1,C=()=>{if(!S){S=!0,h.write(`
|
|
3
3
|
Operation cancelled.
|
|
4
4
|
`);try{x.close()}catch{}u(130)}};x.on(`SIGINT`,C),d&&typeof d.on==`function`&&d!==n.stdin&&d.on(`SIGINT`,C);let w=()=>C();n.on(`SIGINT`,w);let T=e=>{let t=typeof e==`string`?e:e.toString(`binary`);(t.includes(``)||t.includes(``))&&C()};d&&typeof d.on==`function`&&d.on(`data`,T);try{h.write(`
|
|
5
5
|
ShadowClaw CLI Agent — Model Selection:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./chunk-D0jQVYRk.js";function t(t){return e(t,`tasks`,`readonly`,e=>e.getAll()).then(e=>e.map(e=>({...e,enabled:!!e.enabled})))}export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,n as t}from"./chunk-CpukYBmh2.js";import"./chunk-CKTtKg5g2.js";import"./chunk-BDSNQ5RN2.js";import"./chunk-D5-oZBwJ2.js";import"./chunk-WU98h6LV2.js";import{t as n}from"./chunk-BqdBlNeB2.js";import{n as r}from"./chunk-CM3Wphe32.js";import{n as i}from"./chunk-Ceh1EmaK2.js";import{n as ee,r as te}from"./chunk-CMzREth02.js";import{n as a}from"./chunk-WuS6FxYJ2.js";import{n as o}from"./chunk-BSibS-UP2.js";import{t as s}from"./chunk-CsJqx78R2.js";import{n as c}from"./chunk-D2vZJXHH.js";import{n as l}from"./chunk-8ibqxpZe.js";import{n as u}from"./chunk-BdcFlehf.js";import"./chunk-BbpS-dVt.js";import{t as d}from"./chunk-C0X9vvn1.js";import{t as f}from"./chunk-xyH3CrC7.js";import{n as p}from"./chunk-C4Rhej0q.js";import{t as m}from"./chunk-UfE0cnVW.js";import{n as h}from"./chunk-DNVLx9yQ.js";import{n as g}from"./chunk-DHLYAKo9.js";import{n as _,r as v}from"./chunk-DFCQBfpa.js";import{n as y}from"./chunk-DG8IUX4e.js";import{t as b}from"./chunk-BGtNqH44.js";import{n as x}from"./chunk-EymYeDgA.js";import"./chunk-CXo-vnAT.js";import{t as S}from"./chunk-VWDhz2t7.js";import{t as C}from"./chunk-DZQewX_z2.js";import"./chunk-DM0gnIm72.js";import"./chunk-BGeceqqc2.js";import"./chunk-IC92tFkM2.js";import{n as w}from"./chunk-vY9my1592.js";import"./chunk-BKit4qBU2.js";import{t as T}from"./chunk-U9qmJIE02.js";import"./chunk-DCswFaKf2.js";import{r as E}from"./chunk-DnLEebfy2.js";import{n as D}from"./chunk-BEF7I3nl2.js";import{n as O}from"./chunk-CT_5OHPZ2.js";import{n as k}from"./chunk-Dxv5kWua2.js";import{t as A}from"./chunk-Bx1COF_D2.js";import{n as j}from"./chunk-5_W2yDzN2.js";import{n as M}from"./chunk-DfCRRExB2.js";import{n as N}from"./chunk-CE4DzJ7f2.js";import{i as P,n as F,o as I}from"./chunk-Dgfg_DPl2.js";import{t as L}from"./chunk-BCQKXsrv2.js";import{t as R}from"./chunk-BzAUqCQA2.js";import{n as z}from"./chunk-1UAmSdpX2.js";import{t as B}from"./chunk-CV0-VS6z2.js";import{n as V}from"./chunk-B-Y6t6AY2.js";import{n as H}from"./chunk-BmMZ9lDJ2.js";import{n as U,r as W}from"./chunk-Dv5oFrVy.js";import{n as G}from"./chunk-DacX6Hjm.js";import{t as K}from"./chunk-AtotJng0.js";import{t as q}from"./chunk-CeW84Op5.js";import{n as J}from"./chunk-WiHy2T-K.js";import{t as ne}from"./chunk-Ca7P4IL7.js";import{t as Y}from"./chunk-D5mnlEve.js";import{t as X}from"./chunk-9cKL1HMO.js";import{t as Z}from"./chunk-Bo2U7stk.js";import{t as re}from"./chunk-DAjJj7AF.js";import{t as ie}from"./chunk-CQbWKpl5.js";import{n as ae}from"./chunk-j8Hbx-bs.js";import{n as oe}from"./chunk-AVKDR2dx.js";import{t as se}from"./chunk-iR1AGZGi.js";import{t as ce}from"./chunk-BX1Qcy0V.js";import{t as le}from"./chunk-CFKqH_2W.js";import{n as ue}from"./chunk-jhLQ4boT.js";import{t as de}from"./chunk-BH53s7Ns.js";import{n as fe}from"./chunk-Cr04RzyD.js";import{n as pe}from"./chunk-DqgR-tFt.js";import"./chunk-Db9MbB8U.js";import{a as me,n as he,o as ge}from"./chunk-0dwVMU-a.js";import{n as _e}from"./chunk-CCCnHPn5.js";import{n as ve}from"./chunk-BsbJJGhj.js";import{t as ye}from"./chunk-DONGo0Q7.js";import{t as be}from"./chunk-5TfhGCmp.js";import{n as xe}from"./chunk-CzkWjMXt.js";import{t as Q}from"./chunk-D2IrRatU.js";import{t as Se}from"./chunk-CvqvtO-h.js";import{t as Ce}from"./chunk-DqIaE7oc.js";import{t as we}from"./chunk-B2OvszL8.js";import{n as Te}from"./chunk-DOTe8jvc.js";import{n as Ee}from"./chunk-Csvhbj3e.js";import{n as De}from"./chunk-DvAObJVY.js";import{t as Oe}from"./chunk-DcK6zJ0i.js";import{n as ke}from"./chunk-Df86FSvY.js";var Ae=[g,a,Te,Ee,De,Oe,ke,be,u,xe,Q,o,Se,Ce,we,de,fe,pe,ge,he,me,_e,ve,n,ye,ae,l,d,oe,se,ce,le,ue,y,Y,X,Z,c,re,ie,S,i,m,q,h,_,v,e,t,J,ne,W,U,s,te,ee,G,r,p,f,K,L,R,z,b,B,V,H,x,D,O,k,A,j,M,N,P,F,I,C,w,T,E];function je(){return Ae}var $=new Map;for(let e of je())$.set(e.name,new Set(e.flags.map(e=>e.flag)));function Me(e,t,n){let r=$.get(t);if(!(!r||r.size===0))for(let i of n)r.has(i)&&e.hit(`cmd:flag:${t}:${i}`)}export{Me as emitFlagCoverage};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as e,i as t,t as n}from"./chunk-8V8biNmG.js";import{n as r,t as i}from"./chunk-Drx4e34U.js";import a from"process";import{Buffer as o}from"buffer";import{createWriteStream as s}from"fs";import{Readable as c}from"node:stream";import*as l from"path";import*as u from"fs/promises";import{writeFile as d}from"fs/promises";import{finished as f}from"node:stream/promises";var p=n(((e,t)=>{function n(e,t){typeof t==`boolean`&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}t.exports=n,n.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},n.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},n.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(Error(`RetryOperation timeout occurred`)),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n),this._options.unref&&this._timer.unref(),!0},n.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},n.prototype.try=function(e){console.log(`Using RetryOperation.try() is deprecated`),this.attempt(e)},n.prototype.start=function(e){console.log(`Using RetryOperation.start() is deprecated`),this.attempt(e)},n.prototype.start=n.prototype.try,n.prototype.errors=function(){return this._errors},n.prototype.attempts=function(){return this._attempts},n.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var i=this._errors[r],a=i.message,o=(e[a]||0)+1;e[a]=o,o>=n&&(t=i,n=o)}return t}})),m=n((e=>{var t=p();e.operation=function(n){return new t(e.timeouts(n),{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw Error(`minTimeout is greater than maxTimeout`);for(var r=[],i=0;i<t.retries;i++)r.push(this.createTimeout(i,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(i,t)),r.sort(function(e,t){return e-t}),r},e.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,r=Math.round(n*Math.max(t.minTimeout,1)*t.factor**+e);return r=Math.min(r,t.maxTimeout),r},e.wrap=function(t,n,r){if(n instanceof Array&&(r=n,n=null),!r)for(var i in r=[],t)typeof t[i]==`function`&&r.push(i);for(var a=0;a<r.length;a++){var o=r[a],s=t[o];t[o]=function(r){var i=e.operation(n),a=Array.prototype.slice.call(arguments,1),o=a.pop();a.push(function(e){i.retry(e)||(e&&(arguments[0]=i.mainError()),o.apply(this,arguments))}),i.attempt(function(){r.apply(t,a)})}.bind(t,s),t[o].options=n}}})),h=n(((e,t)=>{t.exports=m()})),g=n(((e,t)=>{let n=h(),r=[`Failed to fetch`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`];var i=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=Error(e),this.originalError.stack=this.stack),this.name=`AbortError`,this.message=e}};let a=(e,t,n)=>{let r=n.retries-(t-1);return e.attemptNumber=t,e.retriesLeft=r,e},o=e=>r.includes(e),s=(e,t)=>new Promise((r,s)=>{t={onFailedAttempt:()=>{},retries:10,...t};let c=n.operation(t);c.attempt(async n=>{try{r(await e(n))}catch(e){if(!(e instanceof Error)){s(TypeError(`Non-error was thrown: "${e}". You should only throw errors.`));return}if(e instanceof i)c.stop(),s(e.originalError);else if(e instanceof TypeError&&!o(e.message))c.stop(),s(e);else{a(e,n,t);try{await t.onFailedAttempt(e)}catch(e){s(e);return}c.retry(e)||s(c.mainError())}}})});t.exports=s,t.exports.default=s,t.exports.AbortError=i})),_=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}})),v=n(((e,t)=>{t.exports={name:`gaxios`,version:`7.1.4`,description:`A simple common HTTP client specifically for Google APIs and services.`,main:`build/cjs/src/index.js`,types:`build/cjs/src/index.d.ts`,files:[`build/`],exports:{".":{import:{types:`./build/esm/src/index.d.ts`,default:`./build/esm/src/index.js`},require:{types:`./build/cjs/src/index.d.ts`,default:`./build/cjs/src/index.js`}}},scripts:{lint:`gts check --no-inline-config`,test:`c8 mocha build/esm/test`,"presystem-test":`npm run compile`,"system-test":`mocha build/esm/system-test --timeout 80000`,compile:`tsc -b ./tsconfig.json ./tsconfig.cjs.json && node utils/enable-esm.mjs`,fix:`gts fix`,prepare:`npm run compile`,pretest:`npm run compile`,webpack:`webpack`,"prebrowser-test":`npm run compile`,"browser-test":`node build/browser-test/browser-test-runner.js`,docs:`jsdoc -c .jsdoc.js`,"docs-test":`linkinator docs`,"predocs-test":`npm run docs`,"samples-test":`cd samples/ && npm link ../ && npm test && cd ../`,prelint:`cd samples; npm link ../; npm install`,clean:`gts clean`},repository:{type:`git`,directory:`packages/gaxios`,url:`https://github.com/googleapis/google-cloud-node-core.git`},keywords:[`google`],engines:{node:`>=18`},author:`Google, LLC`,license:`Apache-2.0`,devDependencies:{"@babel/plugin-proposal-private-methods":`^7.18.6`,"@types/cors":`^2.8.6`,"@types/express":`^5.0.0`,"@types/extend":`^3.0.1`,"@types/mocha":`^10.0.10`,"@types/multiparty":`4.2.1`,"@types/mv":`^2.1.0`,"@types/ncp":`^2.0.8`,"@types/node":`^22.13.1`,"@types/sinon":`^17.0.3`,"@types/tmp":`^0.2.6`,assert:`^2.0.0`,browserify:`^17.0.0`,c8:`^10.1.3`,cors:`^2.8.5`,express:`^5.0.0`,gts:`^6.0.2`,"is-docker":`^3.0.0`,jsdoc:`^4.0.4`,"jsdoc-fresh":`^5.0.0`,"jsdoc-region-tag":`^4.0.0`,karma:`^6.0.0`,"karma-chrome-launcher":`^3.0.0`,"karma-coverage":`^2.0.0`,"karma-firefox-launcher":`^2.0.0`,"karma-mocha":`^2.0.0`,"karma-remap-coverage":`^0.1.5`,"karma-sourcemap-loader":`^0.4.0`,"karma-webpack":`^5.0.1`,linkinator:`^6.1.2`,mocha:`^11.1.0`,multiparty:`^4.2.1`,mv:`^2.1.1`,ncp:`^2.0.0`,nock:`^14.0.5`,"null-loader":`^4.0.1`,"pack-n-play":`^4.0.0`,puppeteer:`^24.0.0`,sinon:`^21.0.0`,"stream-browserify":`^3.0.0`,tmp:`0.2.5`,"ts-loader":`^9.5.2`,typescript:`5.8.3`,webpack:`^5.97.1`,"webpack-cli":`^6.0.1`},dependencies:{extend:`^3.0.2`,"https-proxy-agent":`^7.0.1`,"node-fetch":`^3.3.2`},homepage:`https://github.com/googleapis/google-cloud-node-core/tree/main/packages/gaxios`}})),y=n(((e,t)=>{t.exports={pkg:v()}})),b=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.GaxiosError=e.GAXIOS_ERROR_SYMBOL=void 0,e.defaultErrorRedactor=a;let n=t(_()),r=t(y()).default.pkg;e.GAXIOS_ERROR_SYMBOL=Symbol.for(`${r.name}-gaxios-error`),e.GaxiosError=class t extends Error{config;response;code;status;error;[e.GAXIOS_ERROR_SYMBOL]=r.version;static[Symbol.hasInstance](n){return n&&typeof n==`object`&&e.GAXIOS_ERROR_SYMBOL in n&&n[e.GAXIOS_ERROR_SYMBOL]===r.version?!0:Function.prototype[Symbol.hasInstance].call(t,n)}constructor(e,t,r,a){if(super(e,{cause:a}),this.config=t,this.response=r,this.error=a instanceof Error?a:void 0,this.config=(0,n.default)(!0,{},t),this.response&&(this.response.config=(0,n.default)(!0,{},this.response.config)),this.response){try{this.response.data=i(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}a instanceof DOMException?this.code=a.name:a&&typeof a==`object`&&`code`in a&&(typeof a.code==`string`||typeof a.code==`number`)&&(this.code=a.code)}static extractAPIErrorFromResponse(e,t=`The request failed`){let n=t;if(typeof e.data==`string`&&(n=e.data),e.data&&typeof e.data==`object`&&`error`in e.data&&e.data.error&&!e.ok){if(typeof e.data.error==`string`)return{message:e.data.error,code:e.status,status:e.statusText};if(typeof e.data.error==`object`){n=`message`in e.data.error&&typeof e.data.error.message==`string`?e.data.error.message:n;let t=`status`in e.data.error&&typeof e.data.error.status==`string`?e.data.error.status:e.statusText,r=`code`in e.data.error&&typeof e.data.error.code==`number`?e.data.error.code:e.status;if(`errors`in e.data.error&&Array.isArray(e.data.error.errors)){let i=[];for(let t of e.data.error.errors)typeof t==`object`&&`message`in t&&typeof t.message==`string`&&i.push(t.message);return Object.assign({message:i.join(`
|
|
1
|
+
import{a as e,i as t,t as n}from"./chunk-8V8biNmG.js";import{n as r,t as i}from"./chunk-Drx4e34U2.js";import a from"process";import{Buffer as o}from"buffer";import{createWriteStream as s}from"fs";import{Readable as c}from"node:stream";import*as l from"path";import*as u from"fs/promises";import{writeFile as d}from"fs/promises";import{finished as f}from"node:stream/promises";var p=n(((e,t)=>{function n(e,t){typeof t==`boolean`&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}t.exports=n,n.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},n.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},n.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(Error(`RetryOperation timeout occurred`)),!1;this._errors.push(e);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},n),this._options.unref&&this._timer.unref(),!0},n.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},n.prototype.try=function(e){console.log(`Using RetryOperation.try() is deprecated`),this.attempt(e)},n.prototype.start=function(e){console.log(`Using RetryOperation.start() is deprecated`),this.attempt(e)},n.prototype.start=n.prototype.try,n.prototype.errors=function(){return this._errors},n.prototype.attempts=function(){return this._attempts},n.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var i=this._errors[r],a=i.message,o=(e[a]||0)+1;e[a]=o,o>=n&&(t=i,n=o)}return t}})),m=n((e=>{var t=p();e.operation=function(n){return new t(e.timeouts(n),{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw Error(`minTimeout is greater than maxTimeout`);for(var r=[],i=0;i<t.retries;i++)r.push(this.createTimeout(i,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(i,t)),r.sort(function(e,t){return e-t}),r},e.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,r=Math.round(n*Math.max(t.minTimeout,1)*t.factor**+e);return r=Math.min(r,t.maxTimeout),r},e.wrap=function(t,n,r){if(n instanceof Array&&(r=n,n=null),!r)for(var i in r=[],t)typeof t[i]==`function`&&r.push(i);for(var a=0;a<r.length;a++){var o=r[a],s=t[o];t[o]=function(r){var i=e.operation(n),a=Array.prototype.slice.call(arguments,1),o=a.pop();a.push(function(e){i.retry(e)||(e&&(arguments[0]=i.mainError()),o.apply(this,arguments))}),i.attempt(function(){r.apply(t,a)})}.bind(t,s),t[o].options=n}}})),h=n(((e,t)=>{t.exports=m()})),g=n(((e,t)=>{let n=h(),r=[`Failed to fetch`,`NetworkError when attempting to fetch resource.`,`The Internet connection appears to be offline.`,`Network request failed`];var i=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=Error(e),this.originalError.stack=this.stack),this.name=`AbortError`,this.message=e}};let a=(e,t,n)=>{let r=n.retries-(t-1);return e.attemptNumber=t,e.retriesLeft=r,e},o=e=>r.includes(e),s=(e,t)=>new Promise((r,s)=>{t={onFailedAttempt:()=>{},retries:10,...t};let c=n.operation(t);c.attempt(async n=>{try{r(await e(n))}catch(e){if(!(e instanceof Error)){s(TypeError(`Non-error was thrown: "${e}". You should only throw errors.`));return}if(e instanceof i)c.stop(),s(e.originalError);else if(e instanceof TypeError&&!o(e.message))c.stop(),s(e);else{a(e,n,t);try{await t.onFailedAttempt(e)}catch(e){s(e);return}c.retry(e)||s(c.mainError())}}})});t.exports=s,t.exports.default=s,t.exports.AbortError=i})),_=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}})),v=n(((e,t)=>{t.exports={name:`gaxios`,version:`7.1.4`,description:`A simple common HTTP client specifically for Google APIs and services.`,main:`build/cjs/src/index.js`,types:`build/cjs/src/index.d.ts`,files:[`build/`],exports:{".":{import:{types:`./build/esm/src/index.d.ts`,default:`./build/esm/src/index.js`},require:{types:`./build/cjs/src/index.d.ts`,default:`./build/cjs/src/index.js`}}},scripts:{lint:`gts check --no-inline-config`,test:`c8 mocha build/esm/test`,"presystem-test":`npm run compile`,"system-test":`mocha build/esm/system-test --timeout 80000`,compile:`tsc -b ./tsconfig.json ./tsconfig.cjs.json && node utils/enable-esm.mjs`,fix:`gts fix`,prepare:`npm run compile`,pretest:`npm run compile`,webpack:`webpack`,"prebrowser-test":`npm run compile`,"browser-test":`node build/browser-test/browser-test-runner.js`,docs:`jsdoc -c .jsdoc.js`,"docs-test":`linkinator docs`,"predocs-test":`npm run docs`,"samples-test":`cd samples/ && npm link ../ && npm test && cd ../`,prelint:`cd samples; npm link ../; npm install`,clean:`gts clean`},repository:{type:`git`,directory:`packages/gaxios`,url:`https://github.com/googleapis/google-cloud-node-core.git`},keywords:[`google`],engines:{node:`>=18`},author:`Google, LLC`,license:`Apache-2.0`,devDependencies:{"@babel/plugin-proposal-private-methods":`^7.18.6`,"@types/cors":`^2.8.6`,"@types/express":`^5.0.0`,"@types/extend":`^3.0.1`,"@types/mocha":`^10.0.10`,"@types/multiparty":`4.2.1`,"@types/mv":`^2.1.0`,"@types/ncp":`^2.0.8`,"@types/node":`^22.13.1`,"@types/sinon":`^17.0.3`,"@types/tmp":`^0.2.6`,assert:`^2.0.0`,browserify:`^17.0.0`,c8:`^10.1.3`,cors:`^2.8.5`,express:`^5.0.0`,gts:`^6.0.2`,"is-docker":`^3.0.0`,jsdoc:`^4.0.4`,"jsdoc-fresh":`^5.0.0`,"jsdoc-region-tag":`^4.0.0`,karma:`^6.0.0`,"karma-chrome-launcher":`^3.0.0`,"karma-coverage":`^2.0.0`,"karma-firefox-launcher":`^2.0.0`,"karma-mocha":`^2.0.0`,"karma-remap-coverage":`^0.1.5`,"karma-sourcemap-loader":`^0.4.0`,"karma-webpack":`^5.0.1`,linkinator:`^6.1.2`,mocha:`^11.1.0`,multiparty:`^4.2.1`,mv:`^2.1.1`,ncp:`^2.0.0`,nock:`^14.0.5`,"null-loader":`^4.0.1`,"pack-n-play":`^4.0.0`,puppeteer:`^24.0.0`,sinon:`^21.0.0`,"stream-browserify":`^3.0.0`,tmp:`0.2.5`,"ts-loader":`^9.5.2`,typescript:`5.8.3`,webpack:`^5.97.1`,"webpack-cli":`^6.0.1`},dependencies:{extend:`^3.0.2`,"https-proxy-agent":`^7.0.1`,"node-fetch":`^3.3.2`},homepage:`https://github.com/googleapis/google-cloud-node-core/tree/main/packages/gaxios`}})),y=n(((e,t)=>{t.exports={pkg:v()}})),b=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.GaxiosError=e.GAXIOS_ERROR_SYMBOL=void 0,e.defaultErrorRedactor=a;let n=t(_()),r=t(y()).default.pkg;e.GAXIOS_ERROR_SYMBOL=Symbol.for(`${r.name}-gaxios-error`),e.GaxiosError=class t extends Error{config;response;code;status;error;[e.GAXIOS_ERROR_SYMBOL]=r.version;static[Symbol.hasInstance](n){return n&&typeof n==`object`&&e.GAXIOS_ERROR_SYMBOL in n&&n[e.GAXIOS_ERROR_SYMBOL]===r.version?!0:Function.prototype[Symbol.hasInstance].call(t,n)}constructor(e,t,r,a){if(super(e,{cause:a}),this.config=t,this.response=r,this.error=a instanceof Error?a:void 0,this.config=(0,n.default)(!0,{},t),this.response&&(this.response.config=(0,n.default)(!0,{},this.response.config)),this.response){try{this.response.data=i(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}a instanceof DOMException?this.code=a.name:a&&typeof a==`object`&&`code`in a&&(typeof a.code==`string`||typeof a.code==`number`)&&(this.code=a.code)}static extractAPIErrorFromResponse(e,t=`The request failed`){let n=t;if(typeof e.data==`string`&&(n=e.data),e.data&&typeof e.data==`object`&&`error`in e.data&&e.data.error&&!e.ok){if(typeof e.data.error==`string`)return{message:e.data.error,code:e.status,status:e.statusText};if(typeof e.data.error==`object`){n=`message`in e.data.error&&typeof e.data.error.message==`string`?e.data.error.message:n;let t=`status`in e.data.error&&typeof e.data.error.status==`string`?e.data.error.status:e.statusText,r=`code`in e.data.error&&typeof e.data.error.code==`number`?e.data.error.code:e.status;if(`errors`in e.data.error&&Array.isArray(e.data.error.errors)){let i=[];for(let t of e.data.error.errors)typeof t==`object`&&`message`in t&&typeof t.message==`string`&&i.push(t.message);return Object.assign({message:i.join(`
|
|
2
2
|
`)||n,code:r,status:t},e.data.error)}return Object.assign({message:n,code:r,status:t},e.data.error)}}return{message:n,code:e.status,status:e.statusText}}};function i(e,t){switch(e){case`stream`:return t;case`json`:return JSON.parse(JSON.stringify(t));case`arraybuffer`:return JSON.parse(o.from(t).toString(`utf8`));case`blob`:return JSON.parse(t.text());default:return t}}function a(e){let t="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function n(e){e&&e.forEach((n,r)=>{(/^authentication$/i.test(r)||/^authorization$/i.test(r)||/secret/i.test(r))&&e.set(r,t)})}function r(e,n){if(typeof e==`object`&&e&&typeof e[n]==`string`){let r=e[n];(/grant_type=/i.test(r)||/assertion=/i.test(r)||/secret/i.test(r))&&(e[n]=t)}}function i(e){!e||typeof e!=`object`||(e instanceof FormData||e instanceof URLSearchParams||`forEach`in e&&`set`in e?e.forEach((n,r)=>{([`grant_type`,`assertion`].includes(r)||/secret/.test(r))&&e.set(r,t)}):(`grant_type`in e&&(e.grant_type=t),`assertion`in e&&(e.assertion=t),`client_secret`in e&&(e.client_secret=t)))}return e.config&&(n(e.config.headers),r(e.config,`data`),i(e.config.data),r(e.config,`body`),i(e.config.body),e.config.url.searchParams.has(`token`)&&e.config.url.searchParams.set(`token`,t),e.config.url.searchParams.has(`client_secret`)&&e.config.url.searchParams.set(`client_secret`,t)),e.response&&(a({config:e.response.config}),n(e.response.headers),e.response.bodyUsed&&(r(e.response,`data`),i(e.response.data))),e}})),x=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRetryConfig=t;async function t(e){let t=r(e);if(!e||!e.config||!t&&!e.config.retry)return{shouldRetry:!1};if(t||={},t.currentRetryAttempt=t.currentRetryAttempt||0,t.retry=t.retry===void 0||t.retry===null?3:t.retry,t.httpMethodsToRetry=t.httpMethodsToRetry||[`GET`,`HEAD`,`PUT`,`OPTIONS`,`DELETE`],t.noResponseRetries=t.noResponseRetries===void 0||t.noResponseRetries===null?2:t.noResponseRetries,t.retryDelayMultiplier=t.retryDelayMultiplier?t.retryDelayMultiplier:2,t.timeOfFirstRequest=t.timeOfFirstRequest?t.timeOfFirstRequest:Date.now(),t.totalTimeout=t.totalTimeout?t.totalTimeout:2**53-1,t.maxRetryDelay=t.maxRetryDelay?t.maxRetryDelay:2**53-1,t.statusCodesToRetry=t.statusCodesToRetry||[[100,199],[408,408],[429,429],[500,599]],e.config.retryConfig=t,!await(t.shouldRetry||n)(e))return{shouldRetry:!1,config:e.config};let a=i(t);e.config.retryConfig.currentRetryAttempt+=1;let o=t.retryBackoff?t.retryBackoff(e,a):new Promise(e=>{setTimeout(e,a)});return t.onRetryAttempt&&await t.onRetryAttempt(e),await o,{shouldRetry:!0,config:e.config}}function n(e){let t=r(e);if(e.config.signal?.aborted&&e.code!==`TimeoutError`||e.code===`AbortError`||!t||t.retry===0||!e.response&&(t.currentRetryAttempt||0)>=t.noResponseRetries||!t.httpMethodsToRetry||!t.httpMethodsToRetry.includes(e.config.method?.toUpperCase()||`GET`))return!1;if(e.response&&e.response.status){let n=!1;for(let[r,i]of t.statusCodesToRetry){let t=e.response.status;if(t>=r&&t<=i){n=!0;break}}if(!n)return!1}return t.currentRetryAttempt=t.currentRetryAttempt||0,!(t.currentRetryAttempt>=t.retry)}function r(e){if(e&&e.config&&e.config.retryConfig)return e.config.retryConfig}function i(e){let t=(e.currentRetryAttempt?0:e.retryDelay??100)+(e.retryDelayMultiplier**+e.currentRetryAttempt-1)/2*1e3,n=e.totalTimeout-(Date.now()-e.timeOfFirstRequest);return Math.min(t,n,e.maxRetryDelay)}})),S=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GaxiosInterceptorManager=void 0,e.GaxiosInterceptorManager=class extends Set{}})),C=n((n=>{var r=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i;Object.defineProperty(n,"__esModule",{value:!0}),n.Gaxios=void 0;let o=r(_()),s=t(`https`),c=b(),l=x(),u=t(`stream`),d=S(),f=async()=>globalThis.crypto?.randomUUID()||(await import(`crypto`)).randomUUID();var p=class{agentCache=new Map;defaults;interceptors;constructor(e){this.defaults=e||{},this.interceptors={request:new d.GaxiosInterceptorManager,response:new d.GaxiosInterceptorManager}}fetch(...e){let t=e[0],n=e[1],r,a=new Headers;return typeof t==`string`?r=new URL(t):t instanceof URL?r=t:t&&t.url&&(r=new URL(t.url)),t&&typeof t==`object`&&`headers`in t&&i.mergeHeaders(a,t.headers),n&&i.mergeHeaders(a,new Headers(n.headers)),typeof t==`object`&&!(t instanceof URL)?this.request({...n,...t,headers:a,url:r}):this.request({...n,headers:a,url:r})}async request(e={}){let t=await this.#r(e);return t=await this.#t(t),this.#n(this._request(t))}async _defaultAdapter(e){let t=e.fetchImplementation||this.defaults.fetchImplementation||await i.#c(),n={...e};delete n.data;let r=await t(e.url,n),a=await this.getResponseData(e,r);return Object.getOwnPropertyDescriptor(r,`data`)?.configurable||Object.defineProperties(r,{data:{configurable:!0,writable:!0,enumerable:!0,value:a}}),Object.assign(r,{config:e,data:a})}async _request(e){try{let t;if(t=e.adapter?await e.adapter(e,this._defaultAdapter.bind(this)):await this._defaultAdapter(e),!e.validateStatus(t.status)){if(e.responseType===`stream`){let e=[];for await(let n of t.data)e.push(n);t.data=e.toString()}let n=c.GaxiosError.extractAPIErrorFromResponse(t,`Request failed with status code ${t.status}`);throw new c.GaxiosError(n?.message,e,t,n)}return t}catch(t){let n;n=t instanceof c.GaxiosError?t:t instanceof Error?new c.GaxiosError(t.message,e,void 0,t):new c.GaxiosError(`Unexpected Gaxios Error`,e,void 0,t);let{shouldRetry:r,config:i}=await(0,l.getRetryConfig)(n);if(r&&i)return n.config.retryConfig.currentRetryAttempt=i.retryConfig.currentRetryAttempt,e.retryConfig=n.config?.retryConfig,this.#i(e),this._request(e);throw e.errorRedactor&&e.errorRedactor(n),n}}async getResponseData(e,t){if(t.status===204)return``;if(e.maxContentLength&&t.headers.has(`content-length`)&&e.maxContentLength<Number.parseInt(t.headers?.get(`content-length`)||``))throw new c.GaxiosError("Response's `Content-Length` is over the limit.",e,Object.assign(t,{config:e}));switch(e.responseType){case`stream`:return t.body;case`json`:{let e=await t.text();try{return JSON.parse(e)}catch{return e}}case`arraybuffer`:return t.arrayBuffer();case`blob`:return t.blob();case`text`:return t.text();default:return this.getResponseDataFromContentType(t)}}#e(e,t=[]){let n=new URL(e),r=[...t],i=(a.env.NO_PROXY??a.env.no_proxy)?.split(`,`)||[];for(let e of i)r.push(e.trim());for(let e of r)if(e instanceof RegExp){if(e.test(n.toString()))return!1}else if(e instanceof URL){if(e.origin===n.origin)return!1}else if(e.startsWith(`*.`)||e.startsWith(`.`)){let t=e.replace(/^\*\./,`.`);if(n.hostname.endsWith(t))return!1}else if(e===n.origin||e===n.hostname||e===n.href)return!1;return!0}async#t(e){let t=Promise.resolve(e);for(let e of this.interceptors.request.values())e&&(t=t.then(e.resolved,e.rejected));return t}async#n(e){let t=Promise.resolve(e);for(let e of this.interceptors.response.values())e&&(t=t.then(e.resolved,e.rejected));return t}async#r(e){let t=new Headers(this.defaults.headers);i.mergeHeaders(t,e.headers);let n=(0,o.default)(!0,{},this.defaults,e);if(!n.url)throw Error(`URL is required.`);if(n.baseURL&&(n.url=new URL(n.url,n.baseURL)),n.url=new URL(n.url),n.params)if(n.paramsSerializer){let e=n.paramsSerializer(n.params);e.startsWith(`?`)&&(e=e.slice(1));let t=n.url.toString().includes(`?`)?`&`:`?`;n.url=n.url+t+e}else{let e=n.url instanceof URL?n.url:new URL(n.url);for(let[t,r]of new URLSearchParams(n.params))e.searchParams.append(t,r);n.url=e}typeof e.maxContentLength==`number`&&(n.size=e.maxContentLength),typeof e.maxRedirects==`number`&&(n.follow=e.maxRedirects);let r=typeof n.data==`string`||n.data instanceof ArrayBuffer||n.data instanceof Blob||globalThis.File&&n.data instanceof File||n.data instanceof FormData||n.data instanceof u.Readable||n.data instanceof ReadableStream||n.data instanceof String||n.data instanceof URLSearchParams||ArrayBuffer.isView(n.data)||[`Blob`,`File`,`FormData`].includes(n.data?.constructor?.name||``);if(n.multipart?.length){let e=await f();t.set(`content-type`,`multipart/related; boundary=${e}`),n.body=u.Readable.from(this.getMultipartRequest(n.multipart,e))}else r?n.body=n.data:typeof n.data==`object`?t.get(`Content-Type`)===`application/x-www-form-urlencoded`?n.body=n.paramsSerializer?n.paramsSerializer(n.data):new URLSearchParams(n.data):(t.has(`content-type`)||t.set(`content-type`,`application/json`),n.body=JSON.stringify(n.data)):n.data&&(n.body=n.data);n.validateStatus=n.validateStatus||this.validateStatus,n.responseType=n.responseType||`unknown`,!t.has(`accept`)&&n.responseType===`json`&&t.set(`accept`,`application/json`);let l=n.proxy||a?.env?.HTTPS_PROXY||a?.env?.https_proxy||a?.env?.HTTP_PROXY||a?.env?.http_proxy;if(!n.agent)if(l&&this.#e(n.url,n.noProxy)){let e=await i.#s();this.agentCache.has(l)?n.agent=this.agentCache.get(l):(n.agent=new e(l,{cert:n.cert,key:n.key}),this.agentCache.set(l,n.agent))}else n.cert&&n.key&&(this.agentCache.has(n.key)?n.agent=this.agentCache.get(n.key):(n.agent=new s.Agent({cert:n.cert,key:n.key}),this.agentCache.set(n.key,n.agent)));return typeof n.errorRedactor!=`function`&&n.errorRedactor!==!1&&(n.errorRedactor=c.defaultErrorRedactor),n.body&&!(`duplex`in n)&&(n.duplex=`half`),this.#i(n),Object.assign(n,{headers:t,url:n.url instanceof URL?n.url:new URL(n.url)})}#i(e){if(e.timeout){let t=AbortSignal.timeout(e.timeout);e.signal&&!e.signal.aborted?e.signal=AbortSignal.any([e.signal,t]):e.signal=t}}validateStatus(e){return e>=200&&e<300}async getResponseDataFromContentType(e){let t=e.headers.get(`Content-Type`);if(t===null)return e.text();if(t=t.toLowerCase(),t.includes(`application/json`)){let t=await e.text();try{t=JSON.parse(t)}catch{}return t}else if(t.match(/^text\//))return e.text();else return e.blob()}async*getMultipartRequest(e,t){let n=`--${t}--`;for(let n of e)yield`--${t}\r\nContent-Type: ${n.headers.get(`Content-Type`)||`application/octet-stream`}\r\n\r\n`,typeof n.content==`string`?yield n.content:yield*n.content,yield`\r
|
|
3
|
-
`;yield n}static#a;static#o;static async#s(){return this.#a||=(await import(`./chunk-DV5sRVN1.js`).then(t=>e(t.default))).HttpsProxyAgent,this.#a}static async#c(){let e=typeof window<`u`&&!!window;return this.#o||=e?window.fetch:(await import(`./chunk-BgmYA83Z.js`)).default,this.#o}static mergeHeaders(e,...t){e=e instanceof Headers?e:new Headers(e);for(let n of t)(n instanceof Headers?n:new Headers(n)).forEach((t,n)=>{n===`set-cookie`?e.append(n,t):e.set(n,t)});return e}};n.Gaxios=p,i=p})),w=n((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.instance=e.Gaxios=e.GaxiosError=void 0,e.request=a;let r=C();Object.defineProperty(e,"Gaxios",{enumerable:!0,get:function(){return r.Gaxios}});var i=b();Object.defineProperty(e,"GaxiosError",{enumerable:!0,get:function(){return i.GaxiosError}}),n(S(),e),e.instance=new r.Gaxios;async function a(t){return e.instance.request(t)}})),T=n(((e,t)=>{(function(e){var n,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,a=Math.floor,o=`[BigNumber Error] `,s=o+`Number primitive has more than 15 significant digits: `,c=0x5af3107a4000,l=14,u=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,0xe8d4a51000,0x9184e72a000],f=1e7,p=1e9;function m(e){var t,n,S,C=N.prototype={constructor:N,toString:null,valueOf:null},w=new N(1),T=20,E=4,D=-7,O=21,k=-1e7,A=1e7,j=!1,ee=1,te=0,ne={prefix:``,groupSize:3,secondaryGroupSize:0,groupSeparator:`,`,decimalSeparator:`.`,fractionGroupSize:0,fractionGroupSeparator:`\xA0`,suffix:``},M=`0123456789abcdefghijklmnopqrstuvwxyz`,re=!0;function N(e,t){var i,o,c,d,f,p,m,h,g=this;if(!(g instanceof N))return new N(e,t);if(t==null){if(e&&e._isBigNumber===!0){g.s=e.s,!e.c||e.e>A?g.c=g.e=null:e.e<k?g.c=[g.e=0]:(g.e=e.e,g.c=e.c.slice());return}if((p=typeof e==`number`)&&e*0==0){if(g.s=1/e<0?(e=-e,-1):1,e===~~e){for(d=0,f=e;f>=10;f/=10,d++);d>A?g.c=g.e=null:(g.e=d,g.c=[e]);return}h=String(e)}else{if(!r.test(h=String(e)))return S(g,h,p);g.s=h.charCodeAt(0)==45?(h=h.slice(1),-1):1}(d=h.indexOf(`.`))>-1&&(h=h.replace(`.`,``)),(f=h.search(/e/i))>0?(d<0&&(d=f),d+=+h.slice(f+1),h=h.substring(0,f)):d<0&&(d=h.length)}else{if(v(t,2,M.length,`Base`),t==10&&re)return g=new N(e),se(g,T+g.e+1,E);if(h=String(e),p=typeof e==`number`){if(e*0!=0)return S(g,h,p,t);if(g.s=1/e<0?(h=h.slice(1),-1):1,N.DEBUG&&h.replace(/^0\.0*|\./,``).length>15)throw Error(s+e)}else g.s=h.charCodeAt(0)===45?(h=h.slice(1),-1):1;for(i=M.slice(0,t),d=f=0,m=h.length;f<m;f++)if(i.indexOf(o=h.charAt(f))<0){if(o==`.`){if(f>d){d=m;continue}}else if(!c&&(h==h.toUpperCase()&&(h=h.toLowerCase())||h==h.toLowerCase()&&(h=h.toUpperCase()))){c=!0,f=-1,d=0;continue}return S(g,String(e),p,t)}p=!1,h=n(h,t,10,g.s),(d=h.indexOf(`.`))>-1?h=h.replace(`.`,``):d=h.length}for(f=0;h.charCodeAt(f)===48;f++);for(m=h.length;h.charCodeAt(--m)===48;);if(h=h.slice(f,++m)){if(m-=f,p&&N.DEBUG&&m>15&&(e>u||e!==a(e)))throw Error(s+g.s*e);if((d=d-f-1)>A)g.c=g.e=null;else if(d<k)g.c=[g.e=0];else{if(g.e=d,g.c=[],f=(d+1)%l,d<0&&(f+=l),f<m){for(f&&g.c.push(+h.slice(0,f)),m-=l;f<m;)g.c.push(+h.slice(f,f+=l));f=l-(h=h.slice(f)).length}else f-=m;for(;f--;h+=`0`);g.c.push(+h)}}else g.c=[g.e=0]}N.clone=m,N.ROUND_UP=0,N.ROUND_DOWN=1,N.ROUND_CEIL=2,N.ROUND_FLOOR=3,N.ROUND_HALF_UP=4,N.ROUND_HALF_DOWN=5,N.ROUND_HALF_EVEN=6,N.ROUND_HALF_CEIL=7,N.ROUND_HALF_FLOOR=8,N.EUCLID=9,N.config=N.set=function(e){var t,n;if(e!=null)if(typeof e==`object`){if(e.hasOwnProperty(t=`DECIMAL_PLACES`)&&(n=e[t],v(n,0,p,t),T=n),e.hasOwnProperty(t=`ROUNDING_MODE`)&&(n=e[t],v(n,0,8,t),E=n),e.hasOwnProperty(t=`EXPONENTIAL_AT`)&&(n=e[t],n&&n.pop?(v(n[0],-p,0,t),v(n[1],0,p,t),D=n[0],O=n[1]):(v(n,-p,p,t),D=-(O=n<0?-n:n))),e.hasOwnProperty(t=`RANGE`))if(n=e[t],n&&n.pop)v(n[0],-p,-1,t),v(n[1],1,p,t),k=n[0],A=n[1];else if(v(n,-p,p,t),n)k=-(A=n<0?-n:n);else throw Error(o+t+` cannot be zero: `+n);if(e.hasOwnProperty(t=`CRYPTO`))if(n=e[t],n===!!n)if(n)if(typeof crypto<`u`&&crypto&&(crypto.getRandomValues||crypto.randomBytes))j=n;else throw j=!n,Error(o+`crypto unavailable`);else j=n;else throw Error(o+t+` not true or false: `+n);if(e.hasOwnProperty(t=`MODULO_MODE`)&&(n=e[t],v(n,0,9,t),ee=n),e.hasOwnProperty(t=`POW_PRECISION`)&&(n=e[t],v(n,0,p,t),te=n),e.hasOwnProperty(t=`FORMAT`))if(n=e[t],typeof n==`object`)ne=n;else throw Error(o+t+` not an object: `+n);if(e.hasOwnProperty(t=`ALPHABET`))if(n=e[t],typeof n==`string`&&!/^.?$|[+\-.\s]|(.).*\1/.test(n))re=n.slice(0,10)==`0123456789`,M=n;else throw Error(o+t+` invalid: `+n)}else throw Error(o+`Object expected: `+e);return{DECIMAL_PLACES:T,ROUNDING_MODE:E,EXPONENTIAL_AT:[D,O],RANGE:[k,A],CRYPTO:j,MODULO_MODE:ee,POW_PRECISION:te,FORMAT:ne,ALPHABET:M}},N.isBigNumber=function(e){if(!e||e._isBigNumber!==!0)return!1;if(!N.DEBUG)return!0;var t,n,r=e.c,i=e.e,s=e.s;out:if({}.toString.call(r)==`[object Array]`){if((s===1||s===-1)&&i>=-p&&i<=p&&i===a(i)){if(r[0]===0){if(i===0&&r.length===1)return!0;break out}if(t=(i+1)%l,t<1&&(t+=l),String(r[0]).length==t){for(t=0;t<r.length;t++)if(n=r[t],n<0||n>=c||n!==a(n))break out;if(n!==0)return!0}}}else if(r===null&&i===null&&(s===null||s===1||s===-1))return!0;throw Error(o+`Invalid BigNumber: `+e)},N.maximum=N.max=function(){return ae(arguments,-1)},N.minimum=N.min=function(){return ae(arguments,1)},N.random=(function(){var e=9007199254740992,t=Math.random()*e&2097151?function(){return a(Math.random()*e)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(e){var n,r,s,c,u,f=0,m=[],h=new N(w);if(e==null?e=T:v(e,0,p),c=i(e/l),j)if(crypto.getRandomValues){for(n=crypto.getRandomValues(new Uint32Array(c*=2));f<c;)u=n[f]*131072+(n[f+1]>>>11),u>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),n[f]=r[0],n[f+1]=r[1]):(m.push(u%0x5af3107a4000),f+=2);f=c/2}else if(crypto.randomBytes){for(n=crypto.randomBytes(c*=7);f<c;)u=(n[f]&31)*281474976710656+n[f+1]*1099511627776+n[f+2]*4294967296+n[f+3]*16777216+(n[f+4]<<16)+(n[f+5]<<8)+n[f+6],u>=9e15?crypto.randomBytes(7).copy(n,f):(m.push(u%0x5af3107a4000),f+=7);f=c/7}else throw j=!1,Error(o+`crypto unavailable`);if(!j)for(;f<c;)u=t(),u<9e15&&(m[f++]=u%0x5af3107a4000);for(c=m[--f],e%=l,c&&e&&(u=d[l-e],m[f]=a(c/u)*u);m[f]===0;m.pop(),f--);if(f<0)m=[s=0];else{for(s=-1;m[0]===0;m.splice(0,1),s-=l);for(f=1,u=m[0];u>=10;u/=10,f++);f<l&&(s-=l-f)}return h.e=s,h.c=m,h}})(),N.sum=function(){for(var e=1,t=arguments,n=new N(t[0]);e<t.length;)n=n.plus(t[e++]);return n},n=(function(){var e=`0123456789`;function n(e,t,n,r){for(var i,a=[0],o,s=0,c=e.length;s<c;){for(o=a.length;o--;a[o]*=t);for(a[0]+=r.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>n-1&&(a[i+1]??(a[i+1]=0),a[i+1]+=a[i]/n|0,a[i]%=n)}return a.reverse()}return function(r,i,a,o,s){var c,l,u,d,f,p,m,h,_=r.indexOf(`.`),v=T,y=E;for(_>=0&&(d=te,te=0,r=r.replace(`.`,``),h=new N(i),p=h.pow(r.length-_),te=d,h.c=n(x(g(p.c),p.e,`0`),10,a,e),h.e=h.c.length),m=n(r,i,a,s?(c=M,e):(c=e,M)),u=d=m.length;m[--d]==0;m.pop());if(!m[0])return c.charAt(0);if(_<0?--u:(p.c=m,p.e=u,p.s=o,p=t(p,h,v,y,a),m=p.c,f=p.r,u=p.e),l=u+v+1,_=m[l],d=a/2,f=f||l<0||m[l+1]!=null,f=y<4?(_!=null||f)&&(y==0||y==(p.s<0?3:2)):_>d||_==d&&(y==4||f||y==6&&m[l-1]&1||y==(p.s<0?8:7)),l<1||!m[0])r=f?x(c.charAt(1),-v,c.charAt(0)):c.charAt(0);else{if(m.length=l,f)for(--a;++m[--l]>a;)m[l]=0,l||(++u,m=[1].concat(m));for(d=m.length;!m[--d];);for(_=0,r=``;_<=d;r+=c.charAt(m[_++]));r=x(r,u,c.charAt(0))}return r}})(),t=(function(){function e(e,t,n){var r,i,a,o,s=0,c=e.length,l=t%f,u=t/f|0;for(e=e.slice();c--;)a=e[c]%f,o=e[c]/f|0,r=u*a+o*l,i=l*a+r%f*f+s,s=(i/n|0)+(r/f|0)+u*o,e[c]=i%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=+(e[n]<t[n]),e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,i,o,s,u){var d,f,p,m,g,_,v,y,b,x,S,C,w,T,E,D,O,k=r.s==i.s?1:-1,A=r.c,j=i.c;if(!A||!A[0]||!j||!j[0])return new N(!r.s||!i.s||(A?j&&A[0]==j[0]:!j)?NaN:A&&A[0]==0||!j?k*0:k/0);for(y=new N(k),b=y.c=[],f=r.e-i.e,k=o+f+1,u||(u=c,f=h(r.e/l)-h(i.e/l),k=k/l|0),p=0;j[p]==(A[p]||0);p++);if(j[p]>(A[p]||0)&&f--,k<0)b.push(1),m=!0;else{for(T=A.length,D=j.length,p=0,k+=2,g=a(u/(j[0]+1)),g>1&&(j=e(j,g,u),A=e(A,g,u),D=j.length,T=A.length),w=D,x=A.slice(0,D),S=x.length;S<D;x[S++]=0);O=j.slice(),O=[0].concat(O),E=j[0],j[1]>=u/2&&E++;do{if(g=0,d=t(j,x,D,S),d<0){if(C=x[0],D!=S&&(C=C*u+(x[1]||0)),g=a(C/E),g>1)for(g>=u&&(g=u-1),_=e(j,g,u),v=_.length,S=x.length;t(_,x,v,S)==1;)g--,n(_,D<v?O:j,v,u),v=_.length,d=1;else g==0&&(d=g=1),_=j.slice(),v=_.length;if(v<S&&(_=[0].concat(_)),n(x,_,S,u),S=x.length,d==-1)for(;t(j,x,D,S)<1;)g++,n(x,D<S?O:j,S,u),S=x.length}else d===0&&(g++,x=[0]);b[p++]=g,x[0]?x[S++]=A[w]||0:(x=[A[w]],S=1)}while((w++<T||x[0]!=null)&&k--);m=x[0]!=null,b[0]||b.splice(0,1)}if(u==c){for(p=1,k=b[0];k>=10;k/=10,p++);se(y,o+(y.e=p+f*l-1)+1,s,m)}else y.e=f,y.r=+m;return y}})();function ie(e,t,n,r){var i,a,o,s,c;if(n==null?n=E:v(n,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,t==null)c=g(e.c),c=r==1||r==2&&(o<=D||o>=O)?b(c,o):x(c,o,`0`);else if(e=se(new N(e),t,n),a=e.e,c=g(e.c),s=c.length,r==1||r==2&&(t<=a||a<=D)){for(;s<t;c+=`0`,s++);c=b(c,a)}else if(t-=o+(r===2&&a>o),c=x(c,a,`0`),a+1>s){if(--t>0)for(c+=`.`;t--;c+=`0`);}else if(t+=a-s,t>0)for(a+1==s&&(c+=`.`);t--;c+=`0`);return e.s<0&&i?`-`+c:c}function ae(e,t){for(var n,r,i=1,a=new N(e[0]);i<e.length;i++)r=new N(e[i]),(!r.s||(n=_(a,r))===t||n===0&&a.s===t)&&(a=r);return a}function oe(e,t,n){for(var r=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,r++);return(n=r+n*l-1)>A?e.c=e.e=null:n<k?e.c=[e.e=0]:(e.e=n,e.c=t),e}S=(function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,t=/^([^.]+)\.$/,n=/^\.([^.]+)$/,r=/^-?(Infinity|NaN)$/,i=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(a,s,c,l){var u,d=c?s:s.replace(i,``);if(r.test(d))a.s=isNaN(d)?null:d<0?-1:1;else{if(!c&&(d=d.replace(e,function(e,t,n){return u=(n=n.toLowerCase())==`x`?16:n==`b`?2:8,!l||l==u?t:e}),l&&(u=l,d=d.replace(t,`$1`).replace(n,`0.$1`)),s!=d))return new N(d,u);if(N.DEBUG)throw Error(o+`Not a`+(l?` base `+l:``)+` number: `+s);a.s=null}a.c=a.e=null}})();function se(e,t,n,r){var o,s,u,f,p,m,h,g=e.c,_=d;if(g){out:{for(o=1,f=g[0];f>=10;f/=10,o++);if(s=t-o,s<0)s+=l,u=t,p=g[m=0],h=a(p/_[o-u-1]%10);else if(m=i((s+1)/l),m>=g.length)if(r){for(;g.length<=m;g.push(0));p=h=0,o=1,s%=l,u=s-l+1}else break out;else{for(p=f=g[m],o=1;f>=10;f/=10,o++);s%=l,u=s-l+o,h=u<0?0:a(p/_[o-u-1]%10)}if(r=r||t<0||g[m+1]!=null||(u<0?p:p%_[o-u-1]),r=n<4?(h||r)&&(n==0||n==(e.s<0?3:2)):h>5||h==5&&(n==4||r||n==6&&(s>0?u>0?p/_[o-u]:0:g[m-1])%10&1||n==(e.s<0?8:7)),t<1||!g[0])return g.length=0,r?(t-=e.e+1,g[0]=_[(l-t%l)%l],e.e=-t||0):g[0]=e.e=0,e;if(s==0?(g.length=m,f=1,m--):(g.length=m+1,f=_[l-s],g[m]=u>0?a(p/_[o-u]%_[u])*f:0),r)for(;;)if(m==0){for(s=1,u=g[0];u>=10;u/=10,s++);for(u=g[0]+=f,f=1;u>=10;u/=10,f++);s!=f&&(e.e++,g[0]==c&&(g[0]=1));break}else{if(g[m]+=f,g[m]!=c)break;g[m--]=0,f=1}for(s=g.length;g[--s]===0;g.pop());}e.e>A?e.c=e.e=null:e.e<k&&(e.c=[e.e=0])}return e}function P(e){var t,n=e.e;return n===null?e.toString():(t=g(e.c),t=n<=D||n>=O?b(t,n):x(t,n,`0`),e.s<0?`-`+t:t)}return C.absoluteValue=C.abs=function(){var e=new N(this);return e.s<0&&(e.s=1),e},C.comparedTo=function(e,t){return _(this,new N(e,t))},C.decimalPlaces=C.dp=function(e,t){var n,r,i,a=this;if(e!=null)return v(e,0,p),t==null?t=E:v(t,0,8),se(new N(a),e+a.e+1,t);if(!(n=a.c))return null;if(r=((i=n.length-1)-h(this.e/l))*l,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},C.dividedBy=C.div=function(e,n){return t(this,new N(e,n),T,E)},C.dividedToIntegerBy=C.idiv=function(e,n){return t(this,new N(e,n),0,1)},C.exponentiatedBy=C.pow=function(e,t){var n,r,s,c,u,d,f,p,m,h=this;if(e=new N(e),e.c&&!e.isInteger())throw Error(o+`Exponent not an integer: `+P(e));if(t!=null&&(t=new N(t)),d=e.e>14,!h.c||!h.c[0]||h.c[0]==1&&!h.e&&h.c.length==1||!e.c||!e.c[0])return m=new N(P(h)**(d?e.s*(2-y(e)):+P(e))),t?m.mod(t):m;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new N(NaN);r=!f&&h.isInteger()&&t.isInteger(),r&&(h=h.mod(t))}else if(e.e>9&&(h.e>0||h.e<-1||(h.e==0?h.c[0]>1||d&&h.c[1]>=24e7:h.c[0]<8e13||d&&h.c[0]<=9999975e7)))return c=h.s<0&&y(e)?-0:0,h.e>-1&&(c=1/c),new N(f?1/c:c);else te&&(c=i(te/l+2));for(d?(n=new N(.5),f&&(e.s=1),p=y(e)):(s=Math.abs(+P(e)),p=s%2),m=new N(w);;){if(p){if(m=m.times(h),!m.c)break;c?m.c.length>c&&(m.c.length=c):r&&(m=m.mod(t))}if(s){if(s=a(s/2),s===0)break;p=s%2}else if(e=e.times(n),se(e,e.e+1,1),e.e>14)p=y(e);else{if(s=+P(e),s===0)break;p=s%2}h=h.times(h),c?h.c&&h.c.length>c&&(h.c.length=c):r&&(h=h.mod(t))}return r?m:(f&&(m=w.div(m)),t?m.mod(t):c?se(m,te,E,u):m)},C.integerValue=function(e){var t=new N(this);return e==null?e=E:v(e,0,8),se(t,t.e+1,e)},C.isEqualTo=C.eq=function(e,t){return _(this,new N(e,t))===0},C.isFinite=function(){return!!this.c},C.isGreaterThan=C.gt=function(e,t){return _(this,new N(e,t))>0},C.isGreaterThanOrEqualTo=C.gte=function(e,t){return(t=_(this,new N(e,t)))===1||t===0},C.isInteger=function(){return!!this.c&&h(this.e/l)>this.c.length-2},C.isLessThan=C.lt=function(e,t){return _(this,new N(e,t))<0},C.isLessThanOrEqualTo=C.lte=function(e,t){return(t=_(this,new N(e,t)))===-1||t===0},C.isNaN=function(){return!this.s},C.isNegative=function(){return this.s<0},C.isPositive=function(){return this.s>0},C.isZero=function(){return!!this.c&&this.c[0]==0},C.minus=function(e,t){var n,r,i,a,o=this,s=o.s;if(e=new N(e,t),t=e.s,!s||!t)return new N(NaN);if(s!=t)return e.s=-t,o.plus(e);var u=o.e/l,d=e.e/l,f=o.c,p=e.c;if(!u||!d){if(!f||!p)return f?(e.s=-t,e):new N(p?o:NaN);if(!f[0]||!p[0])return p[0]?(e.s=-t,e):new N(f[0]?o:E==3?-0:0)}if(u=h(u),d=h(d),f=f.slice(),s=u-d){for((a=s<0)?(s=-s,i=f):(d=u,i=p),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(r=(a=(s=f.length)<(t=p.length))?s:t,s=t=0;t<r;t++)if(f[t]!=p[t]){a=f[t]<p[t];break}if(a&&(i=f,f=p,p=i,e.s=-e.s),t=(r=p.length)-(n=f.length),t>0)for(;t--;f[n++]=0);for(t=c-1;r>s;){if(f[--r]<p[r]){for(n=r;n&&!f[--n];f[n]=t);--f[n],f[r]+=c}f[r]-=p[r]}for(;f[0]==0;f.splice(0,1),--d);return f[0]?oe(e,f,d):(e.s=E==3?-1:1,e.c=[e.e=0],e)},C.modulo=C.mod=function(e,n){var r,i,a=this;return e=new N(e,n),!a.c||!e.s||e.c&&!e.c[0]?new N(NaN):!e.c||a.c&&!a.c[0]?new N(a):(ee==9?(i=e.s,e.s=1,r=t(a,e,0,3),e.s=i,r.s*=i):r=t(a,e,0,ee),e=a.minus(r.times(e)),!e.c[0]&&ee==1&&(e.s=a.s),e)},C.multipliedBy=C.times=function(e,t){var n,r,i,a,o,s,u,d,p,m,g,_,v,y,b,x=this,S=x.c,C=(e=new N(e,t)).c;if(!S||!C||!S[0]||!C[0])return!x.s||!e.s||S&&!S[0]&&!C||C&&!C[0]&&!S?e.c=e.e=e.s=null:(e.s*=x.s,!S||!C?e.c=e.e=null:(e.c=[0],e.e=0)),e;for(r=h(x.e/l)+h(e.e/l),e.s*=x.s,u=S.length,m=C.length,u<m&&(v=S,S=C,C=v,i=u,u=m,m=i),i=u+m,v=[];i--;v.push(0));for(y=c,b=f,i=m;--i>=0;){for(n=0,g=C[i]%b,_=C[i]/b|0,o=u,a=i+o;a>i;)d=S[--o]%b,p=S[o]/b|0,s=_*d+p*g,d=g*d+s%b*b+v[a]+n,n=(d/y|0)+(s/b|0)+_*p,v[a--]=d%y;v[a]=n}return n?++r:v.splice(0,1),oe(e,v,r)},C.negated=function(){var e=new N(this);return e.s=-e.s||null,e},C.plus=function(e,t){var n,r=this,i=r.s;if(e=new N(e,t),t=e.s,!i||!t)return new N(NaN);if(i!=t)return e.s=-t,r.minus(e);var a=r.e/l,o=e.e/l,s=r.c,u=e.c;if(!a||!o){if(!s||!u)return new N(i/0);if(!s[0]||!u[0])return u[0]?e:new N(s[0]?r:i*0)}if(a=h(a),o=h(o),s=s.slice(),i=a-o){for(i>0?(o=a,n=u):(i=-i,n=s),n.reverse();i--;n.push(0));n.reverse()}for(i=s.length,t=u.length,i-t<0&&(n=u,u=s,s=n,t=i),i=0;t;)i=(s[--t]=s[t]+u[t]+i)/c|0,s[t]=c===s[t]?0:s[t]%c;return i&&(s=[i].concat(s),++o),oe(e,s,o)},C.precision=C.sd=function(e,t){var n,r,i,a=this;if(e!=null&&e!==!!e)return v(e,1,p),t==null?t=E:v(t,0,8),se(new N(a),e,t);if(!(n=a.c))return null;if(i=n.length-1,r=i*l+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return e&&a.e+1>r&&(r=a.e+1),r},C.shiftedBy=function(e){return v(e,-u,u),this.times(`1e`+e)},C.squareRoot=C.sqrt=function(){var e,n,r,i,a,o=this,s=o.c,c=o.s,l=o.e,u=T+4,d=new N(`0.5`);if(c!==1||!s||!s[0])return new N(!c||c<0&&(!s||s[0])?NaN:s?o:1/0);if(c=Math.sqrt(+P(o)),c==0||c==1/0?(n=g(s),(n.length+l)%2==0&&(n+=`0`),c=Math.sqrt(+n),l=h((l+1)/2)-(l<0||l%2),c==1/0?n=`5e`+l:(n=c.toExponential(),n=n.slice(0,n.indexOf(`e`)+1)+l),r=new N(n)):r=new N(c+``),r.c[0]){for(l=r.e,c=l+u,c<3&&(c=0);;)if(a=r,r=d.times(a.plus(t(o,a,u,1))),g(a.c).slice(0,c)===(n=g(r.c)).slice(0,c))if(r.e<l&&--c,n=n.slice(c-3,c+1),n==`9999`||!i&&n==`4999`){if(!i&&(se(a,a.e+T+2,0),a.times(a).eq(o))){r=a;break}u+=4,c+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)==`5`)&&(se(r,r.e+T+2,1),e=!r.times(r).eq(o));break}}return se(r,r.e+T+1,E,e)},C.toExponential=function(e,t){return e!=null&&(v(e,0,p),e++),ie(this,e,t,1)},C.toFixed=function(e,t){return e!=null&&(v(e,0,p),e=e+this.e+1),ie(this,e,t)},C.toFormat=function(e,t,n){var r,i=this;if(n==null)e!=null&&t&&typeof t==`object`?(n=t,t=null):e&&typeof e==`object`?(n=e,e=t=null):n=ne;else if(typeof n!=`object`)throw Error(o+`Argument not an object: `+n);if(r=i.toFixed(e,t),i.c){var a,s=r.split(`.`),c=+n.groupSize,l=+n.secondaryGroupSize,u=n.groupSeparator||``,d=s[0],f=s[1],p=i.s<0,m=p?d.slice(1):d,h=m.length;if(l&&(a=c,c=l,l=a,h-=a),c>0&&h>0){for(a=h%c||c,d=m.substr(0,a);a<h;a+=c)d+=u+m.substr(a,c);l>0&&(d+=u+m.slice(a)),p&&(d=`-`+d)}r=f?d+(n.decimalSeparator||``)+((l=+n.fractionGroupSize)?f.replace(RegExp(`\\d{`+l+`}\\B`,`g`),`$&`+(n.fractionGroupSeparator||``)):f):d}return(n.prefix||``)+r+(n.suffix||``)},C.toFraction=function(e){var n,r,i,a,s,c,u,f,p,m,h,_,v=this,y=v.c;if(e!=null&&(u=new N(e),!u.isInteger()&&(u.c||u.s!==1)||u.lt(w)))throw Error(o+`Argument `+(u.isInteger()?`out of range: `:`not an integer: `)+P(u));if(!y)return new N(v);for(n=new N(w),p=r=new N(w),i=f=new N(w),_=g(y),s=n.e=_.length-v.e-1,n.c[0]=d[(c=s%l)<0?l+c:c],e=!e||u.comparedTo(n)>0?s>0?n:p:u,c=A,A=1/0,u=new N(_),f.c[0]=0;m=t(u,n,0,1),a=r.plus(m.times(i)),a.comparedTo(e)!=1;)r=i,i=a,p=f.plus(m.times(a=p)),f=a,n=u.minus(m.times(a=n)),u=a;return a=t(e.minus(r),i,0,1),f=f.plus(a.times(p)),r=r.plus(a.times(i)),f.s=p.s=v.s,s*=2,h=t(p,i,s,E).minus(v).abs().comparedTo(t(f,r,s,E).minus(v).abs())<1?[p,i]:[f,r],A=c,h},C.toNumber=function(){return+P(this)},C.toPrecision=function(e,t){return e!=null&&v(e,1,p),ie(this,e,t,2)},C.toString=function(e){var t,r=this,i=r.s,a=r.e;return a===null?i?(t=`Infinity`,i<0&&(t=`-`+t)):t=`NaN`:(e==null?t=a<=D||a>=O?b(g(r.c),a):x(g(r.c),a,`0`):e===10&&re?(r=se(new N(r),T+a+1,E),t=x(g(r.c),r.e,`0`)):(v(e,2,M.length,`Base`),t=n(x(g(r.c),a,`0`),10,e,i,!0)),i<0&&r.c[0]&&(t=`-`+t)),t},C.valueOf=C.toJSON=function(){return P(this)},C._isBigNumber=!0,e!=null&&N.set(e),N}function h(e){var t=e|0;return e>0||e===t?t:t-1}function g(e){for(var t,n,r=1,i=e.length,a=e[0]+``;r<i;){for(t=e[r++]+``,n=l-t.length;n--;t=`0`+t);a+=t}for(i=a.length;a.charCodeAt(--i)===48;);return a.slice(0,i+1||1)}function _(e,t){var n,r,i=e.c,a=t.c,o=e.s,s=t.s,c=e.e,l=t.e;if(!o||!s)return null;if(n=i&&!i[0],r=a&&!a[0],n||r)return n?r?0:-s:o;if(o!=s)return o;if(n=o<0,r=c==l,!i||!a)return r?0:!i^n?1:-1;if(!r)return c>l^n?1:-1;for(s=(c=i.length)<(l=a.length)?c:l,o=0;o<s;o++)if(i[o]!=a[o])return i[o]>a[o]^n?1:-1;return c==l?0:c>l^n?1:-1}function v(e,t,n,r){if(e<t||e>n||e!==a(e))throw Error(o+(r||`Argument`)+(typeof e==`number`?e<t||e>n?` out of range: `:` not an integer: `:` not a primitive number: `)+String(e))}function y(e){var t=e.c.length-1;return h(e.e/l)==t&&e.c[t]%2!=0}function b(e,t){return(e.length>1?e.charAt(0)+`.`+e.slice(1):e)+(t<0?`e`:`e+`)+t}function x(e,t,n){var r,i;if(t<0){for(i=n+`.`;++t;i+=n);e=i+e}else if(r=e.length,++t>r){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+`.`+e.slice(t));return e}n=m(),n.default=n.BigNumber=n,typeof define==`function`&&define.amd?define(function(){return n}):t!==void 0&&t.exports?t.exports=n:(e||=typeof self<`u`&&self?self:window,e.BigNumber=n)})(e)})),E=n(((e,t)=>{var n=T(),r=t.exports;(function(){var e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,t,i,a={"\b":`\\b`," ":`\\t`,"\n":`\\n`,"\f":`\\f`,"\r":`\\r`,'"':`\\"`,"\\":`\\\\`},o;function s(t){return e.lastIndex=0,e.test(t)?`"`+t.replace(e,function(e){var t=a[e];return typeof t==`string`?t:`\\u`+(`0000`+e.charCodeAt(0).toString(16)).slice(-4)})+`"`:`"`+t+`"`}function c(e,r){var a,l,u,d,f=t,p,m=r[e],h=m!=null&&(m instanceof n||n.isBigNumber(m));switch(m&&typeof m==`object`&&typeof m.toJSON==`function`&&(m=m.toJSON(e)),typeof o==`function`&&(m=o.call(r,e,m)),typeof m){case`string`:return h?m:s(m);case`number`:return isFinite(m)?String(m):`null`;case`boolean`:case`null`:case`bigint`:return String(m);case`object`:if(!m)return`null`;if(t+=i,p=[],Object.prototype.toString.apply(m)===`[object Array]`){for(d=m.length,a=0;a<d;a+=1)p[a]=c(a,m)||`null`;return u=p.length===0?`[]`:t?`[
|
|
3
|
+
`;yield n}static#a;static#o;static async#s(){return this.#a||=(await import(`./chunk-DV5sRVN12.js`).then(t=>e(t.default))).HttpsProxyAgent,this.#a}static async#c(){let e=typeof window<`u`&&!!window;return this.#o||=e?window.fetch:(await import(`./chunk-BgmYA83Z.js`)).default,this.#o}static mergeHeaders(e,...t){e=e instanceof Headers?e:new Headers(e);for(let n of t)(n instanceof Headers?n:new Headers(n)).forEach((t,n)=>{n===`set-cookie`?e.append(n,t):e.set(n,t)});return e}};n.Gaxios=p,i=p})),w=n((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.instance=e.Gaxios=e.GaxiosError=void 0,e.request=a;let r=C();Object.defineProperty(e,"Gaxios",{enumerable:!0,get:function(){return r.Gaxios}});var i=b();Object.defineProperty(e,"GaxiosError",{enumerable:!0,get:function(){return i.GaxiosError}}),n(S(),e),e.instance=new r.Gaxios;async function a(t){return e.instance.request(t)}})),T=n(((e,t)=>{(function(e){var n,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,a=Math.floor,o=`[BigNumber Error] `,s=o+`Number primitive has more than 15 significant digits: `,c=0x5af3107a4000,l=14,u=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,0xe8d4a51000,0x9184e72a000],f=1e7,p=1e9;function m(e){var t,n,S,C=N.prototype={constructor:N,toString:null,valueOf:null},w=new N(1),T=20,E=4,D=-7,O=21,k=-1e7,A=1e7,j=!1,ee=1,te=0,ne={prefix:``,groupSize:3,secondaryGroupSize:0,groupSeparator:`,`,decimalSeparator:`.`,fractionGroupSize:0,fractionGroupSeparator:`\xA0`,suffix:``},M=`0123456789abcdefghijklmnopqrstuvwxyz`,re=!0;function N(e,t){var i,o,c,d,f,p,m,h,g=this;if(!(g instanceof N))return new N(e,t);if(t==null){if(e&&e._isBigNumber===!0){g.s=e.s,!e.c||e.e>A?g.c=g.e=null:e.e<k?g.c=[g.e=0]:(g.e=e.e,g.c=e.c.slice());return}if((p=typeof e==`number`)&&e*0==0){if(g.s=1/e<0?(e=-e,-1):1,e===~~e){for(d=0,f=e;f>=10;f/=10,d++);d>A?g.c=g.e=null:(g.e=d,g.c=[e]);return}h=String(e)}else{if(!r.test(h=String(e)))return S(g,h,p);g.s=h.charCodeAt(0)==45?(h=h.slice(1),-1):1}(d=h.indexOf(`.`))>-1&&(h=h.replace(`.`,``)),(f=h.search(/e/i))>0?(d<0&&(d=f),d+=+h.slice(f+1),h=h.substring(0,f)):d<0&&(d=h.length)}else{if(v(t,2,M.length,`Base`),t==10&&re)return g=new N(e),se(g,T+g.e+1,E);if(h=String(e),p=typeof e==`number`){if(e*0!=0)return S(g,h,p,t);if(g.s=1/e<0?(h=h.slice(1),-1):1,N.DEBUG&&h.replace(/^0\.0*|\./,``).length>15)throw Error(s+e)}else g.s=h.charCodeAt(0)===45?(h=h.slice(1),-1):1;for(i=M.slice(0,t),d=f=0,m=h.length;f<m;f++)if(i.indexOf(o=h.charAt(f))<0){if(o==`.`){if(f>d){d=m;continue}}else if(!c&&(h==h.toUpperCase()&&(h=h.toLowerCase())||h==h.toLowerCase()&&(h=h.toUpperCase()))){c=!0,f=-1,d=0;continue}return S(g,String(e),p,t)}p=!1,h=n(h,t,10,g.s),(d=h.indexOf(`.`))>-1?h=h.replace(`.`,``):d=h.length}for(f=0;h.charCodeAt(f)===48;f++);for(m=h.length;h.charCodeAt(--m)===48;);if(h=h.slice(f,++m)){if(m-=f,p&&N.DEBUG&&m>15&&(e>u||e!==a(e)))throw Error(s+g.s*e);if((d=d-f-1)>A)g.c=g.e=null;else if(d<k)g.c=[g.e=0];else{if(g.e=d,g.c=[],f=(d+1)%l,d<0&&(f+=l),f<m){for(f&&g.c.push(+h.slice(0,f)),m-=l;f<m;)g.c.push(+h.slice(f,f+=l));f=l-(h=h.slice(f)).length}else f-=m;for(;f--;h+=`0`);g.c.push(+h)}}else g.c=[g.e=0]}N.clone=m,N.ROUND_UP=0,N.ROUND_DOWN=1,N.ROUND_CEIL=2,N.ROUND_FLOOR=3,N.ROUND_HALF_UP=4,N.ROUND_HALF_DOWN=5,N.ROUND_HALF_EVEN=6,N.ROUND_HALF_CEIL=7,N.ROUND_HALF_FLOOR=8,N.EUCLID=9,N.config=N.set=function(e){var t,n;if(e!=null)if(typeof e==`object`){if(e.hasOwnProperty(t=`DECIMAL_PLACES`)&&(n=e[t],v(n,0,p,t),T=n),e.hasOwnProperty(t=`ROUNDING_MODE`)&&(n=e[t],v(n,0,8,t),E=n),e.hasOwnProperty(t=`EXPONENTIAL_AT`)&&(n=e[t],n&&n.pop?(v(n[0],-p,0,t),v(n[1],0,p,t),D=n[0],O=n[1]):(v(n,-p,p,t),D=-(O=n<0?-n:n))),e.hasOwnProperty(t=`RANGE`))if(n=e[t],n&&n.pop)v(n[0],-p,-1,t),v(n[1],1,p,t),k=n[0],A=n[1];else if(v(n,-p,p,t),n)k=-(A=n<0?-n:n);else throw Error(o+t+` cannot be zero: `+n);if(e.hasOwnProperty(t=`CRYPTO`))if(n=e[t],n===!!n)if(n)if(typeof crypto<`u`&&crypto&&(crypto.getRandomValues||crypto.randomBytes))j=n;else throw j=!n,Error(o+`crypto unavailable`);else j=n;else throw Error(o+t+` not true or false: `+n);if(e.hasOwnProperty(t=`MODULO_MODE`)&&(n=e[t],v(n,0,9,t),ee=n),e.hasOwnProperty(t=`POW_PRECISION`)&&(n=e[t],v(n,0,p,t),te=n),e.hasOwnProperty(t=`FORMAT`))if(n=e[t],typeof n==`object`)ne=n;else throw Error(o+t+` not an object: `+n);if(e.hasOwnProperty(t=`ALPHABET`))if(n=e[t],typeof n==`string`&&!/^.?$|[+\-.\s]|(.).*\1/.test(n))re=n.slice(0,10)==`0123456789`,M=n;else throw Error(o+t+` invalid: `+n)}else throw Error(o+`Object expected: `+e);return{DECIMAL_PLACES:T,ROUNDING_MODE:E,EXPONENTIAL_AT:[D,O],RANGE:[k,A],CRYPTO:j,MODULO_MODE:ee,POW_PRECISION:te,FORMAT:ne,ALPHABET:M}},N.isBigNumber=function(e){if(!e||e._isBigNumber!==!0)return!1;if(!N.DEBUG)return!0;var t,n,r=e.c,i=e.e,s=e.s;out:if({}.toString.call(r)==`[object Array]`){if((s===1||s===-1)&&i>=-p&&i<=p&&i===a(i)){if(r[0]===0){if(i===0&&r.length===1)return!0;break out}if(t=(i+1)%l,t<1&&(t+=l),String(r[0]).length==t){for(t=0;t<r.length;t++)if(n=r[t],n<0||n>=c||n!==a(n))break out;if(n!==0)return!0}}}else if(r===null&&i===null&&(s===null||s===1||s===-1))return!0;throw Error(o+`Invalid BigNumber: `+e)},N.maximum=N.max=function(){return ae(arguments,-1)},N.minimum=N.min=function(){return ae(arguments,1)},N.random=(function(){var e=9007199254740992,t=Math.random()*e&2097151?function(){return a(Math.random()*e)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(e){var n,r,s,c,u,f=0,m=[],h=new N(w);if(e==null?e=T:v(e,0,p),c=i(e/l),j)if(crypto.getRandomValues){for(n=crypto.getRandomValues(new Uint32Array(c*=2));f<c;)u=n[f]*131072+(n[f+1]>>>11),u>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),n[f]=r[0],n[f+1]=r[1]):(m.push(u%0x5af3107a4000),f+=2);f=c/2}else if(crypto.randomBytes){for(n=crypto.randomBytes(c*=7);f<c;)u=(n[f]&31)*281474976710656+n[f+1]*1099511627776+n[f+2]*4294967296+n[f+3]*16777216+(n[f+4]<<16)+(n[f+5]<<8)+n[f+6],u>=9e15?crypto.randomBytes(7).copy(n,f):(m.push(u%0x5af3107a4000),f+=7);f=c/7}else throw j=!1,Error(o+`crypto unavailable`);if(!j)for(;f<c;)u=t(),u<9e15&&(m[f++]=u%0x5af3107a4000);for(c=m[--f],e%=l,c&&e&&(u=d[l-e],m[f]=a(c/u)*u);m[f]===0;m.pop(),f--);if(f<0)m=[s=0];else{for(s=-1;m[0]===0;m.splice(0,1),s-=l);for(f=1,u=m[0];u>=10;u/=10,f++);f<l&&(s-=l-f)}return h.e=s,h.c=m,h}})(),N.sum=function(){for(var e=1,t=arguments,n=new N(t[0]);e<t.length;)n=n.plus(t[e++]);return n},n=(function(){var e=`0123456789`;function n(e,t,n,r){for(var i,a=[0],o,s=0,c=e.length;s<c;){for(o=a.length;o--;a[o]*=t);for(a[0]+=r.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>n-1&&(a[i+1]??(a[i+1]=0),a[i+1]+=a[i]/n|0,a[i]%=n)}return a.reverse()}return function(r,i,a,o,s){var c,l,u,d,f,p,m,h,_=r.indexOf(`.`),v=T,y=E;for(_>=0&&(d=te,te=0,r=r.replace(`.`,``),h=new N(i),p=h.pow(r.length-_),te=d,h.c=n(x(g(p.c),p.e,`0`),10,a,e),h.e=h.c.length),m=n(r,i,a,s?(c=M,e):(c=e,M)),u=d=m.length;m[--d]==0;m.pop());if(!m[0])return c.charAt(0);if(_<0?--u:(p.c=m,p.e=u,p.s=o,p=t(p,h,v,y,a),m=p.c,f=p.r,u=p.e),l=u+v+1,_=m[l],d=a/2,f=f||l<0||m[l+1]!=null,f=y<4?(_!=null||f)&&(y==0||y==(p.s<0?3:2)):_>d||_==d&&(y==4||f||y==6&&m[l-1]&1||y==(p.s<0?8:7)),l<1||!m[0])r=f?x(c.charAt(1),-v,c.charAt(0)):c.charAt(0);else{if(m.length=l,f)for(--a;++m[--l]>a;)m[l]=0,l||(++u,m=[1].concat(m));for(d=m.length;!m[--d];);for(_=0,r=``;_<=d;r+=c.charAt(m[_++]));r=x(r,u,c.charAt(0))}return r}})(),t=(function(){function e(e,t,n){var r,i,a,o,s=0,c=e.length,l=t%f,u=t/f|0;for(e=e.slice();c--;)a=e[c]%f,o=e[c]/f|0,r=u*a+o*l,i=l*a+r%f*f+s,s=(i/n|0)+(r/f|0)+u*o,e[c]=i%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=+(e[n]<t[n]),e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(r,i,o,s,u){var d,f,p,m,g,_,v,y,b,x,S,C,w,T,E,D,O,k=r.s==i.s?1:-1,A=r.c,j=i.c;if(!A||!A[0]||!j||!j[0])return new N(!r.s||!i.s||(A?j&&A[0]==j[0]:!j)?NaN:A&&A[0]==0||!j?k*0:k/0);for(y=new N(k),b=y.c=[],f=r.e-i.e,k=o+f+1,u||(u=c,f=h(r.e/l)-h(i.e/l),k=k/l|0),p=0;j[p]==(A[p]||0);p++);if(j[p]>(A[p]||0)&&f--,k<0)b.push(1),m=!0;else{for(T=A.length,D=j.length,p=0,k+=2,g=a(u/(j[0]+1)),g>1&&(j=e(j,g,u),A=e(A,g,u),D=j.length,T=A.length),w=D,x=A.slice(0,D),S=x.length;S<D;x[S++]=0);O=j.slice(),O=[0].concat(O),E=j[0],j[1]>=u/2&&E++;do{if(g=0,d=t(j,x,D,S),d<0){if(C=x[0],D!=S&&(C=C*u+(x[1]||0)),g=a(C/E),g>1)for(g>=u&&(g=u-1),_=e(j,g,u),v=_.length,S=x.length;t(_,x,v,S)==1;)g--,n(_,D<v?O:j,v,u),v=_.length,d=1;else g==0&&(d=g=1),_=j.slice(),v=_.length;if(v<S&&(_=[0].concat(_)),n(x,_,S,u),S=x.length,d==-1)for(;t(j,x,D,S)<1;)g++,n(x,D<S?O:j,S,u),S=x.length}else d===0&&(g++,x=[0]);b[p++]=g,x[0]?x[S++]=A[w]||0:(x=[A[w]],S=1)}while((w++<T||x[0]!=null)&&k--);m=x[0]!=null,b[0]||b.splice(0,1)}if(u==c){for(p=1,k=b[0];k>=10;k/=10,p++);se(y,o+(y.e=p+f*l-1)+1,s,m)}else y.e=f,y.r=+m;return y}})();function ie(e,t,n,r){var i,a,o,s,c;if(n==null?n=E:v(n,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,t==null)c=g(e.c),c=r==1||r==2&&(o<=D||o>=O)?b(c,o):x(c,o,`0`);else if(e=se(new N(e),t,n),a=e.e,c=g(e.c),s=c.length,r==1||r==2&&(t<=a||a<=D)){for(;s<t;c+=`0`,s++);c=b(c,a)}else if(t-=o+(r===2&&a>o),c=x(c,a,`0`),a+1>s){if(--t>0)for(c+=`.`;t--;c+=`0`);}else if(t+=a-s,t>0)for(a+1==s&&(c+=`.`);t--;c+=`0`);return e.s<0&&i?`-`+c:c}function ae(e,t){for(var n,r,i=1,a=new N(e[0]);i<e.length;i++)r=new N(e[i]),(!r.s||(n=_(a,r))===t||n===0&&a.s===t)&&(a=r);return a}function oe(e,t,n){for(var r=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,r++);return(n=r+n*l-1)>A?e.c=e.e=null:n<k?e.c=[e.e=0]:(e.e=n,e.c=t),e}S=(function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,t=/^([^.]+)\.$/,n=/^\.([^.]+)$/,r=/^-?(Infinity|NaN)$/,i=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(a,s,c,l){var u,d=c?s:s.replace(i,``);if(r.test(d))a.s=isNaN(d)?null:d<0?-1:1;else{if(!c&&(d=d.replace(e,function(e,t,n){return u=(n=n.toLowerCase())==`x`?16:n==`b`?2:8,!l||l==u?t:e}),l&&(u=l,d=d.replace(t,`$1`).replace(n,`0.$1`)),s!=d))return new N(d,u);if(N.DEBUG)throw Error(o+`Not a`+(l?` base `+l:``)+` number: `+s);a.s=null}a.c=a.e=null}})();function se(e,t,n,r){var o,s,u,f,p,m,h,g=e.c,_=d;if(g){out:{for(o=1,f=g[0];f>=10;f/=10,o++);if(s=t-o,s<0)s+=l,u=t,p=g[m=0],h=a(p/_[o-u-1]%10);else if(m=i((s+1)/l),m>=g.length)if(r){for(;g.length<=m;g.push(0));p=h=0,o=1,s%=l,u=s-l+1}else break out;else{for(p=f=g[m],o=1;f>=10;f/=10,o++);s%=l,u=s-l+o,h=u<0?0:a(p/_[o-u-1]%10)}if(r=r||t<0||g[m+1]!=null||(u<0?p:p%_[o-u-1]),r=n<4?(h||r)&&(n==0||n==(e.s<0?3:2)):h>5||h==5&&(n==4||r||n==6&&(s>0?u>0?p/_[o-u]:0:g[m-1])%10&1||n==(e.s<0?8:7)),t<1||!g[0])return g.length=0,r?(t-=e.e+1,g[0]=_[(l-t%l)%l],e.e=-t||0):g[0]=e.e=0,e;if(s==0?(g.length=m,f=1,m--):(g.length=m+1,f=_[l-s],g[m]=u>0?a(p/_[o-u]%_[u])*f:0),r)for(;;)if(m==0){for(s=1,u=g[0];u>=10;u/=10,s++);for(u=g[0]+=f,f=1;u>=10;u/=10,f++);s!=f&&(e.e++,g[0]==c&&(g[0]=1));break}else{if(g[m]+=f,g[m]!=c)break;g[m--]=0,f=1}for(s=g.length;g[--s]===0;g.pop());}e.e>A?e.c=e.e=null:e.e<k&&(e.c=[e.e=0])}return e}function P(e){var t,n=e.e;return n===null?e.toString():(t=g(e.c),t=n<=D||n>=O?b(t,n):x(t,n,`0`),e.s<0?`-`+t:t)}return C.absoluteValue=C.abs=function(){var e=new N(this);return e.s<0&&(e.s=1),e},C.comparedTo=function(e,t){return _(this,new N(e,t))},C.decimalPlaces=C.dp=function(e,t){var n,r,i,a=this;if(e!=null)return v(e,0,p),t==null?t=E:v(t,0,8),se(new N(a),e+a.e+1,t);if(!(n=a.c))return null;if(r=((i=n.length-1)-h(this.e/l))*l,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},C.dividedBy=C.div=function(e,n){return t(this,new N(e,n),T,E)},C.dividedToIntegerBy=C.idiv=function(e,n){return t(this,new N(e,n),0,1)},C.exponentiatedBy=C.pow=function(e,t){var n,r,s,c,u,d,f,p,m,h=this;if(e=new N(e),e.c&&!e.isInteger())throw Error(o+`Exponent not an integer: `+P(e));if(t!=null&&(t=new N(t)),d=e.e>14,!h.c||!h.c[0]||h.c[0]==1&&!h.e&&h.c.length==1||!e.c||!e.c[0])return m=new N(P(h)**(d?e.s*(2-y(e)):+P(e))),t?m.mod(t):m;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new N(NaN);r=!f&&h.isInteger()&&t.isInteger(),r&&(h=h.mod(t))}else if(e.e>9&&(h.e>0||h.e<-1||(h.e==0?h.c[0]>1||d&&h.c[1]>=24e7:h.c[0]<8e13||d&&h.c[0]<=9999975e7)))return c=h.s<0&&y(e)?-0:0,h.e>-1&&(c=1/c),new N(f?1/c:c);else te&&(c=i(te/l+2));for(d?(n=new N(.5),f&&(e.s=1),p=y(e)):(s=Math.abs(+P(e)),p=s%2),m=new N(w);;){if(p){if(m=m.times(h),!m.c)break;c?m.c.length>c&&(m.c.length=c):r&&(m=m.mod(t))}if(s){if(s=a(s/2),s===0)break;p=s%2}else if(e=e.times(n),se(e,e.e+1,1),e.e>14)p=y(e);else{if(s=+P(e),s===0)break;p=s%2}h=h.times(h),c?h.c&&h.c.length>c&&(h.c.length=c):r&&(h=h.mod(t))}return r?m:(f&&(m=w.div(m)),t?m.mod(t):c?se(m,te,E,u):m)},C.integerValue=function(e){var t=new N(this);return e==null?e=E:v(e,0,8),se(t,t.e+1,e)},C.isEqualTo=C.eq=function(e,t){return _(this,new N(e,t))===0},C.isFinite=function(){return!!this.c},C.isGreaterThan=C.gt=function(e,t){return _(this,new N(e,t))>0},C.isGreaterThanOrEqualTo=C.gte=function(e,t){return(t=_(this,new N(e,t)))===1||t===0},C.isInteger=function(){return!!this.c&&h(this.e/l)>this.c.length-2},C.isLessThan=C.lt=function(e,t){return _(this,new N(e,t))<0},C.isLessThanOrEqualTo=C.lte=function(e,t){return(t=_(this,new N(e,t)))===-1||t===0},C.isNaN=function(){return!this.s},C.isNegative=function(){return this.s<0},C.isPositive=function(){return this.s>0},C.isZero=function(){return!!this.c&&this.c[0]==0},C.minus=function(e,t){var n,r,i,a,o=this,s=o.s;if(e=new N(e,t),t=e.s,!s||!t)return new N(NaN);if(s!=t)return e.s=-t,o.plus(e);var u=o.e/l,d=e.e/l,f=o.c,p=e.c;if(!u||!d){if(!f||!p)return f?(e.s=-t,e):new N(p?o:NaN);if(!f[0]||!p[0])return p[0]?(e.s=-t,e):new N(f[0]?o:E==3?-0:0)}if(u=h(u),d=h(d),f=f.slice(),s=u-d){for((a=s<0)?(s=-s,i=f):(d=u,i=p),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(r=(a=(s=f.length)<(t=p.length))?s:t,s=t=0;t<r;t++)if(f[t]!=p[t]){a=f[t]<p[t];break}if(a&&(i=f,f=p,p=i,e.s=-e.s),t=(r=p.length)-(n=f.length),t>0)for(;t--;f[n++]=0);for(t=c-1;r>s;){if(f[--r]<p[r]){for(n=r;n&&!f[--n];f[n]=t);--f[n],f[r]+=c}f[r]-=p[r]}for(;f[0]==0;f.splice(0,1),--d);return f[0]?oe(e,f,d):(e.s=E==3?-1:1,e.c=[e.e=0],e)},C.modulo=C.mod=function(e,n){var r,i,a=this;return e=new N(e,n),!a.c||!e.s||e.c&&!e.c[0]?new N(NaN):!e.c||a.c&&!a.c[0]?new N(a):(ee==9?(i=e.s,e.s=1,r=t(a,e,0,3),e.s=i,r.s*=i):r=t(a,e,0,ee),e=a.minus(r.times(e)),!e.c[0]&&ee==1&&(e.s=a.s),e)},C.multipliedBy=C.times=function(e,t){var n,r,i,a,o,s,u,d,p,m,g,_,v,y,b,x=this,S=x.c,C=(e=new N(e,t)).c;if(!S||!C||!S[0]||!C[0])return!x.s||!e.s||S&&!S[0]&&!C||C&&!C[0]&&!S?e.c=e.e=e.s=null:(e.s*=x.s,!S||!C?e.c=e.e=null:(e.c=[0],e.e=0)),e;for(r=h(x.e/l)+h(e.e/l),e.s*=x.s,u=S.length,m=C.length,u<m&&(v=S,S=C,C=v,i=u,u=m,m=i),i=u+m,v=[];i--;v.push(0));for(y=c,b=f,i=m;--i>=0;){for(n=0,g=C[i]%b,_=C[i]/b|0,o=u,a=i+o;a>i;)d=S[--o]%b,p=S[o]/b|0,s=_*d+p*g,d=g*d+s%b*b+v[a]+n,n=(d/y|0)+(s/b|0)+_*p,v[a--]=d%y;v[a]=n}return n?++r:v.splice(0,1),oe(e,v,r)},C.negated=function(){var e=new N(this);return e.s=-e.s||null,e},C.plus=function(e,t){var n,r=this,i=r.s;if(e=new N(e,t),t=e.s,!i||!t)return new N(NaN);if(i!=t)return e.s=-t,r.minus(e);var a=r.e/l,o=e.e/l,s=r.c,u=e.c;if(!a||!o){if(!s||!u)return new N(i/0);if(!s[0]||!u[0])return u[0]?e:new N(s[0]?r:i*0)}if(a=h(a),o=h(o),s=s.slice(),i=a-o){for(i>0?(o=a,n=u):(i=-i,n=s),n.reverse();i--;n.push(0));n.reverse()}for(i=s.length,t=u.length,i-t<0&&(n=u,u=s,s=n,t=i),i=0;t;)i=(s[--t]=s[t]+u[t]+i)/c|0,s[t]=c===s[t]?0:s[t]%c;return i&&(s=[i].concat(s),++o),oe(e,s,o)},C.precision=C.sd=function(e,t){var n,r,i,a=this;if(e!=null&&e!==!!e)return v(e,1,p),t==null?t=E:v(t,0,8),se(new N(a),e,t);if(!(n=a.c))return null;if(i=n.length-1,r=i*l+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return e&&a.e+1>r&&(r=a.e+1),r},C.shiftedBy=function(e){return v(e,-u,u),this.times(`1e`+e)},C.squareRoot=C.sqrt=function(){var e,n,r,i,a,o=this,s=o.c,c=o.s,l=o.e,u=T+4,d=new N(`0.5`);if(c!==1||!s||!s[0])return new N(!c||c<0&&(!s||s[0])?NaN:s?o:1/0);if(c=Math.sqrt(+P(o)),c==0||c==1/0?(n=g(s),(n.length+l)%2==0&&(n+=`0`),c=Math.sqrt(+n),l=h((l+1)/2)-(l<0||l%2),c==1/0?n=`5e`+l:(n=c.toExponential(),n=n.slice(0,n.indexOf(`e`)+1)+l),r=new N(n)):r=new N(c+``),r.c[0]){for(l=r.e,c=l+u,c<3&&(c=0);;)if(a=r,r=d.times(a.plus(t(o,a,u,1))),g(a.c).slice(0,c)===(n=g(r.c)).slice(0,c))if(r.e<l&&--c,n=n.slice(c-3,c+1),n==`9999`||!i&&n==`4999`){if(!i&&(se(a,a.e+T+2,0),a.times(a).eq(o))){r=a;break}u+=4,c+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)==`5`)&&(se(r,r.e+T+2,1),e=!r.times(r).eq(o));break}}return se(r,r.e+T+1,E,e)},C.toExponential=function(e,t){return e!=null&&(v(e,0,p),e++),ie(this,e,t,1)},C.toFixed=function(e,t){return e!=null&&(v(e,0,p),e=e+this.e+1),ie(this,e,t)},C.toFormat=function(e,t,n){var r,i=this;if(n==null)e!=null&&t&&typeof t==`object`?(n=t,t=null):e&&typeof e==`object`?(n=e,e=t=null):n=ne;else if(typeof n!=`object`)throw Error(o+`Argument not an object: `+n);if(r=i.toFixed(e,t),i.c){var a,s=r.split(`.`),c=+n.groupSize,l=+n.secondaryGroupSize,u=n.groupSeparator||``,d=s[0],f=s[1],p=i.s<0,m=p?d.slice(1):d,h=m.length;if(l&&(a=c,c=l,l=a,h-=a),c>0&&h>0){for(a=h%c||c,d=m.substr(0,a);a<h;a+=c)d+=u+m.substr(a,c);l>0&&(d+=u+m.slice(a)),p&&(d=`-`+d)}r=f?d+(n.decimalSeparator||``)+((l=+n.fractionGroupSize)?f.replace(RegExp(`\\d{`+l+`}\\B`,`g`),`$&`+(n.fractionGroupSeparator||``)):f):d}return(n.prefix||``)+r+(n.suffix||``)},C.toFraction=function(e){var n,r,i,a,s,c,u,f,p,m,h,_,v=this,y=v.c;if(e!=null&&(u=new N(e),!u.isInteger()&&(u.c||u.s!==1)||u.lt(w)))throw Error(o+`Argument `+(u.isInteger()?`out of range: `:`not an integer: `)+P(u));if(!y)return new N(v);for(n=new N(w),p=r=new N(w),i=f=new N(w),_=g(y),s=n.e=_.length-v.e-1,n.c[0]=d[(c=s%l)<0?l+c:c],e=!e||u.comparedTo(n)>0?s>0?n:p:u,c=A,A=1/0,u=new N(_),f.c[0]=0;m=t(u,n,0,1),a=r.plus(m.times(i)),a.comparedTo(e)!=1;)r=i,i=a,p=f.plus(m.times(a=p)),f=a,n=u.minus(m.times(a=n)),u=a;return a=t(e.minus(r),i,0,1),f=f.plus(a.times(p)),r=r.plus(a.times(i)),f.s=p.s=v.s,s*=2,h=t(p,i,s,E).minus(v).abs().comparedTo(t(f,r,s,E).minus(v).abs())<1?[p,i]:[f,r],A=c,h},C.toNumber=function(){return+P(this)},C.toPrecision=function(e,t){return e!=null&&v(e,1,p),ie(this,e,t,2)},C.toString=function(e){var t,r=this,i=r.s,a=r.e;return a===null?i?(t=`Infinity`,i<0&&(t=`-`+t)):t=`NaN`:(e==null?t=a<=D||a>=O?b(g(r.c),a):x(g(r.c),a,`0`):e===10&&re?(r=se(new N(r),T+a+1,E),t=x(g(r.c),r.e,`0`)):(v(e,2,M.length,`Base`),t=n(x(g(r.c),a,`0`),10,e,i,!0)),i<0&&r.c[0]&&(t=`-`+t)),t},C.valueOf=C.toJSON=function(){return P(this)},C._isBigNumber=!0,e!=null&&N.set(e),N}function h(e){var t=e|0;return e>0||e===t?t:t-1}function g(e){for(var t,n,r=1,i=e.length,a=e[0]+``;r<i;){for(t=e[r++]+``,n=l-t.length;n--;t=`0`+t);a+=t}for(i=a.length;a.charCodeAt(--i)===48;);return a.slice(0,i+1||1)}function _(e,t){var n,r,i=e.c,a=t.c,o=e.s,s=t.s,c=e.e,l=t.e;if(!o||!s)return null;if(n=i&&!i[0],r=a&&!a[0],n||r)return n?r?0:-s:o;if(o!=s)return o;if(n=o<0,r=c==l,!i||!a)return r?0:!i^n?1:-1;if(!r)return c>l^n?1:-1;for(s=(c=i.length)<(l=a.length)?c:l,o=0;o<s;o++)if(i[o]!=a[o])return i[o]>a[o]^n?1:-1;return c==l?0:c>l^n?1:-1}function v(e,t,n,r){if(e<t||e>n||e!==a(e))throw Error(o+(r||`Argument`)+(typeof e==`number`?e<t||e>n?` out of range: `:` not an integer: `:` not a primitive number: `)+String(e))}function y(e){var t=e.c.length-1;return h(e.e/l)==t&&e.c[t]%2!=0}function b(e,t){return(e.length>1?e.charAt(0)+`.`+e.slice(1):e)+(t<0?`e`:`e+`)+t}function x(e,t,n){var r,i;if(t<0){for(i=n+`.`;++t;i+=n);e=i+e}else if(r=e.length,++t>r){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+`.`+e.slice(t));return e}n=m(),n.default=n.BigNumber=n,typeof define==`function`&&define.amd?define(function(){return n}):t!==void 0&&t.exports?t.exports=n:(e||=typeof self<`u`&&self?self:window,e.BigNumber=n)})(e)})),E=n(((e,t)=>{var n=T(),r=t.exports;(function(){var e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,t,i,a={"\b":`\\b`," ":`\\t`,"\n":`\\n`,"\f":`\\f`,"\r":`\\r`,'"':`\\"`,"\\":`\\\\`},o;function s(t){return e.lastIndex=0,e.test(t)?`"`+t.replace(e,function(e){var t=a[e];return typeof t==`string`?t:`\\u`+(`0000`+e.charCodeAt(0).toString(16)).slice(-4)})+`"`:`"`+t+`"`}function c(e,r){var a,l,u,d,f=t,p,m=r[e],h=m!=null&&(m instanceof n||n.isBigNumber(m));switch(m&&typeof m==`object`&&typeof m.toJSON==`function`&&(m=m.toJSON(e)),typeof o==`function`&&(m=o.call(r,e,m)),typeof m){case`string`:return h?m:s(m);case`number`:return isFinite(m)?String(m):`null`;case`boolean`:case`null`:case`bigint`:return String(m);case`object`:if(!m)return`null`;if(t+=i,p=[],Object.prototype.toString.apply(m)===`[object Array]`){for(d=m.length,a=0;a<d;a+=1)p[a]=c(a,m)||`null`;return u=p.length===0?`[]`:t?`[
|
|
4
4
|
`+t+p.join(`,
|
|
5
5
|
`+t)+`
|
|
6
6
|
`+f+`]`:`[`+p.join(`,`)+`]`,t=f,u}if(o&&typeof o==`object`)for(d=o.length,a=0;a<d;a+=1)typeof o[a]==`string`&&(l=o[a],u=c(l,m),u&&p.push(s(l)+(t?`: `:`:`)+u));else Object.keys(m).forEach(function(e){var n=c(e,m);n&&p.push(s(e)+(t?`: `:`:`)+n)});return u=p.length===0?`{}`:t?`{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./chunk-D9dG7jP92.js";export{e as fetchDiscoveryManifest};
|