@agentlang/lstudio 0.4.3 → 0.4.6

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.
Files changed (35) hide show
  1. package/assets/{_commonjs-dynamic-modules-B7n8ZNar.js → _commonjs-dynamic-modules-DkOKMH7F.js} +1 -1
  2. package/assets/{fs-ChhVtk1t.js → fs-Dc1AXE1h.js} +1 -1
  3. package/assets/index-B5cYUcHg.js +1 -0
  4. package/assets/{index-BHDiPh0o.js → index-BFv-M3PX.js} +1 -1
  5. package/assets/index-BXMy9UIl.js +1 -0
  6. package/assets/index-BitrXVkV.js +1 -0
  7. package/assets/{index-CyvIs3-e.js → index-BsMGh1HZ.js} +1 -1
  8. package/assets/{index-D4z_hbl0-DmHSo54Y.js → index-D4z_hbl0-Bi2lyYpC.js} +1 -1
  9. package/assets/index-D5i6vPoY.js +1 -0
  10. package/assets/{index-LKjSxjRA-C7aA0iuy.js → index-DTNuphFO-Bf5Ad1xs.js} +8 -8
  11. package/assets/index-DYeSZrx6.css +1 -0
  12. package/assets/index-DYmn2gQ6-CnjFa625.js +1 -0
  13. package/assets/{index-C2HY8erm.js → index-DbVrN0uV.js} +1 -1
  14. package/assets/{index-COgCIiI2.js → index-IWX-nwYi.js} +1335 -858
  15. package/assets/index.browser-D5Xow_MQ.js +6 -0
  16. package/assets/{loadCognitoIdentity-Bzy5QwC3.js → loadCognitoIdentity-DytZoWyS.js} +1 -1
  17. package/assets/loadSts-C6zXLlvL.js +1 -0
  18. package/assets/{normalizeProvider-BrOPyH3l.js → normalizeProvider-CtDY37Q6.js} +1 -1
  19. package/assets/{replService-I2k8pNsF.js → replService-jI2rdTkj.js} +1 -1
  20. package/assets/resolveDefaultsModeConfig-Bx7XDpng.js +15 -0
  21. package/assets/{util-DFW6B0xP.js → util-BYzfkJTL.js} +2 -2
  22. package/assets/{winston-1qzyIKCb-DXWSfIDX.js → winston-1qzyIKCb-DGNx4OWn.js} +1 -1
  23. package/assets/{winston-C6UE2bNp.js → winston-BpiA2JJl.js} +1 -1
  24. package/assets/{winston-CtxF18qc-fKA71K9u.js → winston-CtxF18qc-itw4XSal.js} +1 -1
  25. package/assets/{winston-6q4HtYRM.js → winston-D4mJsFB6.js} +2 -2
  26. package/index.html +3 -3
  27. package/package.json +1 -1
  28. package/assets/index-3_2F9LQx.js +0 -1
  29. package/assets/index-BVSKv1jw-BvgeZRdK.js +0 -1
  30. package/assets/index-CuvfCO6A.js +0 -1
  31. package/assets/index-DUt_LuNz.js +0 -1
  32. package/assets/index-OdGGJiBD.css +0 -1
  33. package/assets/index.browser-D_cb-Dkf.js +0 -6
  34. package/assets/loadSts-DRBqs5CO.js +0 -1
  35. package/assets/resolveDefaultsModeConfig-_DjURcTg.js +0 -15
@@ -1 +1 @@
1
- import{d as B}from"./__vite-browser-external-DLjrMatA.js";import{a as N}from"./_commonjsHelpers-D6-XlEtG.js";const R=N(B);var C={},m;function j(){if(m)return C;m=1,C.byteLength=p,C.toByteArray=y,C.fromByteArray=g;for(var n=[],a=[],A=typeof Uint8Array<"u"?Uint8Array:Array,x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,c=x.length;i<c;++i)n[i]=x[i],a[x.charCodeAt(i)]=i;a[45]=62,a[95]=63;function t(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var o=r.indexOf("=");o===-1&&(o=e);var f=o===e?0:4-o%4;return[o,f]}function p(r){var e=t(r),o=e[0],f=e[1];return(o+f)*3/4-f}function l(r,e,o){return(e+o)*3/4-o}function y(r){var e,o=t(r),f=o[0],d=o[1],s=new A(l(r,f,d)),u=0,w=d>0?f-4:f,F;for(F=0;F<w;F+=4)e=a[r.charCodeAt(F)]<<18|a[r.charCodeAt(F+1)]<<12|a[r.charCodeAt(F+2)]<<6|a[r.charCodeAt(F+3)],s[u++]=e>>16&255,s[u++]=e>>8&255,s[u++]=e&255;return d===2&&(e=a[r.charCodeAt(F)]<<2|a[r.charCodeAt(F+1)]>>4,s[u++]=e&255),d===1&&(e=a[r.charCodeAt(F)]<<10|a[r.charCodeAt(F+1)]<<4|a[r.charCodeAt(F+2)]>>2,s[u++]=e>>8&255,s[u++]=e&255),s}function h(r){return n[r>>18&63]+n[r>>12&63]+n[r>>6&63]+n[r&63]}function v(r,e,o){for(var f,d=[],s=e;s<o;s+=3)f=(r[s]<<16&16711680)+(r[s+1]<<8&65280)+(r[s+2]&255),d.push(h(f));return d.join("")}function g(r){for(var e,o=r.length,f=o%3,d=[],s=16383,u=0,w=o-f;u<w;u+=s)d.push(v(r,u,u+s>w?w:u+s));return f===1?(e=r[o-1],d.push(n[e>>2]+n[e<<4&63]+"==")):f===2&&(e=(r[o-2]<<8)+r[o-1],d.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),d.join("")}return C}var M={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var q;function J(){return q||(q=1,M.read=function(n,a,A,x,i){var c,t,p=i*8-x-1,l=(1<<p)-1,y=l>>1,h=-7,v=A?i-1:0,g=A?-1:1,r=n[a+v];for(v+=g,c=r&(1<<-h)-1,r>>=-h,h+=p;h>0;c=c*256+n[a+v],v+=g,h-=8);for(t=c&(1<<-h)-1,c>>=-h,h+=x;h>0;t=t*256+n[a+v],v+=g,h-=8);if(c===0)c=1-y;else{if(c===l)return t?NaN:(r?-1:1)*(1/0);t=t+Math.pow(2,x),c=c-y}return(r?-1:1)*t*Math.pow(2,c-x)},M.write=function(n,a,A,x,i,c){var t,p,l,y=c*8-i-1,h=(1<<y)-1,v=h>>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,r=x?0:c-1,e=x?1:-1,o=a<0||a===0&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(p=isNaN(a)?1:0,t=h):(t=Math.floor(Math.log(a)/Math.LN2),a*(l=Math.pow(2,-t))<1&&(t--,l*=2),t+v>=1?a+=g/l:a+=g*Math.pow(2,1-v),a*l>=2&&(t++,l/=2),t+v>=h?(p=0,t=h):t+v>=1?(p=(a*l-1)*Math.pow(2,i),t=t+v):(p=a*Math.pow(2,v-1)*Math.pow(2,i),t=0));i>=8;n[A+r]=p&255,r+=e,p/=256,i-=8);for(t=t<<i|p,y+=i;y>0;n[A+r]=t&255,r+=e,t/=256,y-=8);n[A+r-e]|=o*128}),M}function L(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}export{j as a,J as b,L as c,R as r};
1
+ import{d as B}from"./__vite-browser-external-DLjrMatA.js";import{a as N}from"./_commonjsHelpers-D6-XlEtG.js";const R=N(B);var C={},m;function j(){if(m)return C;m=1,C.byteLength=p,C.toByteArray=y,C.fromByteArray=g;for(var n=[],a=[],A=typeof Uint8Array<"u"?Uint8Array:Array,x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,c=x.length;i<c;++i)n[i]=x[i],a[x.charCodeAt(i)]=i;a[45]=62,a[95]=63;function t(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var o=r.indexOf("=");o===-1&&(o=e);var f=o===e?0:4-o%4;return[o,f]}function p(r){var e=t(r),o=e[0],f=e[1];return(o+f)*3/4-f}function l(r,e,o){return(e+o)*3/4-o}function y(r){var e,o=t(r),f=o[0],d=o[1],s=new A(l(r,f,d)),u=0,w=d>0?f-4:f,F;for(F=0;F<w;F+=4)e=a[r.charCodeAt(F)]<<18|a[r.charCodeAt(F+1)]<<12|a[r.charCodeAt(F+2)]<<6|a[r.charCodeAt(F+3)],s[u++]=e>>16&255,s[u++]=e>>8&255,s[u++]=e&255;return d===2&&(e=a[r.charCodeAt(F)]<<2|a[r.charCodeAt(F+1)]>>4,s[u++]=e&255),d===1&&(e=a[r.charCodeAt(F)]<<10|a[r.charCodeAt(F+1)]<<4|a[r.charCodeAt(F+2)]>>2,s[u++]=e>>8&255,s[u++]=e&255),s}function h(r){return n[r>>18&63]+n[r>>12&63]+n[r>>6&63]+n[r&63]}function v(r,e,o){for(var f,d=[],s=e;s<o;s+=3)f=(r[s]<<16&16711680)+(r[s+1]<<8&65280)+(r[s+2]&255),d.push(h(f));return d.join("")}function g(r){for(var e,o=r.length,f=o%3,d=[],s=16383,u=0,w=o-f;u<w;u+=s)d.push(v(r,u,u+s>w?w:u+s));return f===1?(e=r[o-1],d.push(n[e>>2]+n[e<<4&63]+"==")):f===2&&(e=(r[o-2]<<8)+r[o-1],d.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),d.join("")}return C}var M={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var q;function J(){return q||(q=1,M.read=function(n,a,A,x,i){var c,t,p=i*8-x-1,l=(1<<p)-1,y=l>>1,h=-7,v=A?i-1:0,g=A?-1:1,r=n[a+v];for(v+=g,c=r&(1<<-h)-1,r>>=-h,h+=p;h>0;c=c*256+n[a+v],v+=g,h-=8);for(t=c&(1<<-h)-1,c>>=-h,h+=x;h>0;t=t*256+n[a+v],v+=g,h-=8);if(c===0)c=1-y;else{if(c===l)return t?NaN:(r?-1:1)*(1/0);t=t+Math.pow(2,x),c=c-y}return(r?-1:1)*t*Math.pow(2,c-x)},M.write=function(n,a,A,x,i,c){var t,p,l,y=c*8-i-1,h=(1<<y)-1,v=h>>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,r=x?0:c-1,e=x?1:-1,o=a<0||a===0&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(p=isNaN(a)?1:0,t=h):(t=Math.floor(Math.log(a)/Math.LN2),a*(l=Math.pow(2,-t))<1&&(t--,l*=2),t+v>=1?a+=g/l:a+=g*Math.pow(2,1-v),a*l>=2&&(t++,l/=2),t+v>=h?(p=0,t=h):t+v>=1?(p=(a*l-1)*Math.pow(2,i),t=t+v):(p=a*Math.pow(2,v-1)*Math.pow(2,i),t=0));i>=8;n[A+r]=p&255,r+=e,p/=256,i-=8);for(t=t<<i|p,y+=i;y>0;n[A+r]=t&255,r+=e,t/=256,y-=8);n[A+r-e]|=o*128}),M}function L(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}export{j as a,R as b,L as c,J as r};
@@ -1 +1 @@
1
- import{E as I}from"./index-COgCIiI2.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-ChvoNxcO.js";import"./preload-helper-BlTxHScW.js";import"./__vite-browser-external-DLjrMatA.js";import"./inherits_browser-nmOknR35-Bp0mvRSL.js";import"./index-6mKfgpcs-DsgiI2lM.js";import"./_commonjsHelpers-B4e78b8K-W3E8ocG7.js";import"./index-DsIu-45t-Bejjlpz4.js";import"./index-DSosZ5sh-Ceejs_jv.js";import"./index-69shuAsh-DF18H7zf.js";import"./index-BJBOx-Z---hbiLl7B.js";import"./index.browser-BHPvGrwi-6Mh8eUw-.js";import"./_commonjs-dynamic-modules-BpilXLfW-DfYEAvWy.js";import"./_commonjs-dynamic-modules-B7n8ZNar.js";var S=Object.defineProperty,A=(r,e,n)=>e in r?S(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,g=(r,e,n)=>A(r,typeof e!="symbol"?e+"":e,n);function x(r,e){for(var n=0;n<e.length;n++){const o=e[n];if(typeof o!="string"&&!Array.isArray(o)){for(const t in o)if(t!=="default"&&!(t in r)){const i=Object.getOwnPropertyDescriptor(o,t);i&&Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:()=>o[t]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}function v(r){return{isFile:()=>r.isFile(),isDirectory:()=>r.isDirectory(),isSymbolicLink:()=>r.isSymbolicLink(),size:r.size,mtime:r.mtime}}class j{async readFile(e){return(void 0)(e,"utf8")}async readFileBuffer(e){return(void 0)(e)}async writeFile(e,n){const o=(void 0)(e);return await this.ensureDir(o),(void 0)(e,n)}async exists(e){try{return await(void 0)(e),!0}catch{return!1}}async mkdir(e){try{await(void 0)(e)}catch(n){if(n&&typeof n=="object"&&"code"in n&&n.code!=="EEXIST")throw n}}async readdir(e){return(void 0)(e)}async stat(e){const n=await(void 0)(e);return v(n)}async lstat(e){const n=await(void 0)(e);return v(n)}async unlink(e){return(void 0)(e)}async rmdir(e){return(void 0)(e)}async copyFile(e,n){const o=(void 0)(n);return await this.ensureDir(o),(void 0)(e,n)}async moveFile(e,n){const o=(void 0)(n);return await this.ensureDir(o),(void 0)(e,n)}async ensureDir(e){try{await(void 0)(e,{recursive:!0})}catch(n){if(n&&typeof n=="object"&&"code"in n&&n.code!=="EEXIST")throw n}}async removeDir(e){return(void 0)(e,{recursive:!0,force:!0})}async readDirectory(e){return(void 0)(e)}async writeFileSystemFromTree(e,n,o){for(const t of e){const i=(void 0)(n,t.path);if(t.type==="directory")await this.ensureDir(i),t.children&&await this.writeFileSystemFromTree(t.children,n,o);else{const s=await o(t.path);await this.writeFile(i,s)}}}}function T(){return new j}function E(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var F,z;function $(){if(z)return F;z=1;function r(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function e(t,i){for(var s="",c=0,u=-1,a=0,f,l=0;l<=t.length;++l){if(l<t.length)f=t.charCodeAt(l);else{if(f===47)break;f=47}if(f===47){if(!(u===l-1||a===1))if(u!==l-1&&a===2){if(s.length<2||c!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var d=s.lastIndexOf("/");if(d!==s.length-1){d===-1?(s="",c=0):(s=s.slice(0,d),c=s.length-1-s.lastIndexOf("/")),u=l,a=0;continue}}else if(s.length===2||s.length===1){s="",c=0,u=l,a=0;continue}}i&&(s.length>0?s+="/..":s="..",c=2)}else s.length>0?s+="/"+t.slice(u+1,l):s=t.slice(u+1,l),c=l-u-1;u=l,a=0}else f===46&&a!==-1?++a:a=-1}return s}function n(t,i){var s=i.dir||i.root,c=i.base||(i.name||"")+(i.ext||"");return s?s===i.root?s+c:s+t+c:c}var o={resolve:function(){for(var t="",i=!1,s,c=arguments.length-1;c>=-1&&!i;c--){var u;c>=0?u=arguments[c]:(s===void 0&&(s=process.cwd()),u=s),r(u),u.length!==0&&(t=u+"/"+t,i=u.charCodeAt(0)===47)}return t=e(t,!i),i?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(r(t),t.length===0)return".";var i=t.charCodeAt(0)===47,s=t.charCodeAt(t.length-1)===47;return t=e(t,!i),t.length===0&&!i&&(t="."),t.length>0&&s&&(t+="/"),i?"/"+t:t},isAbsolute:function(t){return r(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,i=0;i<arguments.length;++i){var s=arguments[i];r(s),s.length>0&&(t===void 0?t=s:t+="/"+s)}return t===void 0?".":o.normalize(t)},relative:function(t,i){if(r(t),r(i),t===i||(t=o.resolve(t),i=o.resolve(i),t===i))return"";for(var s=1;s<t.length&&t.charCodeAt(s)===47;++s);for(var c=t.length,u=c-s,a=1;a<i.length&&i.charCodeAt(a)===47;++a);for(var f=i.length,l=f-a,d=u<l?u:l,y=-1,h=0;h<=d;++h){if(h===d){if(l>d){if(i.charCodeAt(a+h)===47)return i.slice(a+h+1);if(h===0)return i.slice(a+h)}else u>d&&(t.charCodeAt(s+h)===47?y=h:h===0&&(y=0));break}var b=t.charCodeAt(s+h),k=i.charCodeAt(a+h);if(b!==k)break;b===47&&(y=h)}var m="";for(h=s+y+1;h<=c;++h)(h===c||t.charCodeAt(h)===47)&&(m.length===0?m+="..":m+="/..");return m.length>0?m+i.slice(a+y):(a+=y,i.charCodeAt(a)===47&&++a,i.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(r(t),t.length===0)return".";for(var i=t.charCodeAt(0),s=i===47,c=-1,u=!0,a=t.length-1;a>=1;--a)if(i=t.charCodeAt(a),i===47){if(!u){c=a;break}}else u=!1;return c===-1?s?"/":".":s&&c===1?"//":t.slice(0,c)},basename:function(t,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');r(t);var s=0,c=-1,u=!0,a;if(i!==void 0&&i.length>0&&i.length<=t.length){if(i.length===t.length&&i===t)return"";var f=i.length-1,l=-1;for(a=t.length-1;a>=0;--a){var d=t.charCodeAt(a);if(d===47){if(!u){s=a+1;break}}else l===-1&&(u=!1,l=a+1),f>=0&&(d===i.charCodeAt(f)?--f===-1&&(c=a):(f=-1,c=l))}return s===c?c=l:c===-1&&(c=t.length),t.slice(s,c)}else{for(a=t.length-1;a>=0;--a)if(t.charCodeAt(a)===47){if(!u){s=a+1;break}}else c===-1&&(u=!1,c=a+1);return c===-1?"":t.slice(s,c)}},extname:function(t){r(t);for(var i=-1,s=0,c=-1,u=!0,a=0,f=t.length-1;f>=0;--f){var l=t.charCodeAt(f);if(l===47){if(!u){s=f+1;break}continue}c===-1&&(u=!1,c=f+1),l===46?i===-1?i=f:a!==1&&(a=1):i!==-1&&(a=-1)}return i===-1||c===-1||a===0||a===1&&i===c-1&&i===s+1?"":t.slice(i,c)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return n("/",t)},parse:function(t){r(t);var i={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return i;var s=t.charCodeAt(0),c=s===47,u;c?(i.root="/",u=1):u=0;for(var a=-1,f=0,l=-1,d=!0,y=t.length-1,h=0;y>=u;--y){if(s=t.charCodeAt(y),s===47){if(!d){f=y+1;break}continue}l===-1&&(d=!1,l=y+1),s===46?a===-1?a=y:h!==1&&(h=1):a!==-1&&(h=-1)}return a===-1||l===-1||h===0||h===1&&a===l-1&&a===f+1?l!==-1&&(f===0&&c?i.base=i.name=t.slice(1,l):i.base=i.name=t.slice(f,l)):(f===0&&c?(i.name=t.slice(1,a),i.base=t.slice(1,l)):(i.name=t.slice(f,a),i.base=t.slice(f,l)),i.ext=t.slice(a,l)),f>0?i.dir=t.slice(0,f-1):c&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};return o.posix=o,F=o,F}var D=$();const O=E(D),L=x({__proto__:null,default:O},[D]);function C(r){if(r&&typeof r=="object"){const e=r,n=typeof e.isFile=="function"?e.isFile():typeof e.isFile=="boolean"?e.isFile:e.type==="file"||!e.type&&!e.isDirectory,o=typeof e.isDirectory=="function"?e.isDirectory():typeof e.isDirectory=="boolean"?e.isDirectory:e.type==="dir"||e.type==="directory",t=typeof e.size=="number"?e.size:0;let i;return e.mtime instanceof Date?i=e.mtime:typeof e.mtime=="number"?i=new Date(e.mtime):typeof e.mtimeMs=="number"?i=new Date(e.mtimeMs):i=new Date,{isFile:()=>n,isDirectory:()=>o,isSymbolicLink:()=>!1,size:t,mtime:i}}return{isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1,size:0,mtime:new Date}}class P{constructor(){g(this,"fs"),g(this,"initialized",!1),g(this,"path",L)}async initialize(e={}){if(this.initialized)return;const n=e.name||"fs",o=new I(n,{wipe:e.wipe});this.fs=o.promises,this.initialized=!0}ensureInitialized(){if(!this.initialized)throw new Error("LightningFileSystem is not initialized. Call initialize() first.")}async readFile(e){return this.ensureInitialized(),(await this.fs.readFile(e,{encoding:"utf8"})).toString()}async readFileBuffer(e){return this.ensureInitialized(),this.fs.readFile(e)}async writeFile(e,n){this.ensureInitialized();const o=e.substring(0,e.lastIndexOf("/"));return o&&await this.ensureDir(o),this.fs.writeFile(e,n)}async exists(e){this.ensureInitialized();try{return await this.fs.stat(e),!0}catch{return!1}}async mkdir(e,n){this.ensureInitialized();try{return await this.fs.mkdir(e,n)}catch(o){if(o&&typeof o=="object"&&"code"in o&&o.code!=="EEXIST")throw o}}async readdir(e){return this.ensureInitialized(),this.fs.readdir(e)}async stat(e){this.ensureInitialized();const n=await this.fs.stat(e);return C(n)}async lstat(e){this.ensureInitialized();const n=await this.fs.stat(e);return C(n)}async unlink(e){return this.ensureInitialized(),this.fs.unlink(e)}async rmdir(e){return this.ensureInitialized(),this.fs.rmdir(e)}async copyFile(e,n){this.ensureInitialized();const o=n.substring(0,n.lastIndexOf("/"));o&&await this.ensureDir(o);const t=await this.readFileBuffer(e);return this.writeFile(n,t)}async moveFile(e,n){this.ensureInitialized();const o=n.substring(0,n.lastIndexOf("/"));o&&await this.ensureDir(o),await this.copyFile(e,n),await this.unlink(e)}async ensureDir(e){if(this.ensureInitialized(),!await this.exists(e))try{await this.fs.mkdir(e,{recursive:!0})}catch(n){if(n&&typeof n=="object"&&"code"in n&&n.code!=="EEXIST")throw n}}async removeDir(e){if(this.ensureInitialized(),!await this.exists(e))return;if((await this.stat(e)).isFile())return this.unlink(e);const n=await this.readdir(e);for(const o of n){const t=`${e}/${o}`;await this.removeDir(t)}return this.rmdir(e)}async readDirectory(e){return this.ensureInitialized(),this.fs.readdir(e)}async writeFileSystemFromTree(e,n,o){for(const t of e){const i=this.path.join(n,t.path);if(t.type==="directory")await this.mkdir(i,{recursive:!0}),t.children&&await this.writeFileSystemFromTree(t.children,n,o);else{const s=await o(t.path);await this.writeFile(i,s)}}}}async function _(r){const e=new P;return await e.initialize(r),e}function B(){return"http://localhost:4000"}const p=B();function w(r){let e=r.replace(/^\/+/,"");const n=e.split("/");return n.length>1&&(e=n.slice(1).join("/")),e}function R(){return{async readFile(r){const e=w(r),n=await fetch(`${p}/file?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Failed to read file ${r}: ${n.statusText}`);const{content:o}=await n.json();return o},async readFileBuffer(r){const e=await this.readFile(r);return Buffer.from(e,"utf-8")},async writeFile(r,e){const n=w(r),o=typeof e=="string"?e:e.toString("utf-8"),t=await fetch(`${p}/file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n,content:o})});if(!t.ok)throw new Error(`Failed to write file ${r}: ${t.statusText}`)},async exists(r){const e=w(r);try{return(await fetch(`${p}/stat?path=${encodeURIComponent(e)}`)).ok}catch{return!1}},async mkdir(r){},async readdir(r){const e=w(r),n=await fetch(`${p}/files?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Failed to read directory ${r}: ${n.statusText}`);return(await n.json()).map(o=>o.name)},async stat(r){const e=w(r),n=await fetch(`${p}/stat?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Failed to stat ${r}: ${n.statusText}`);const{type:o,size:t,mtime:i}=await n.json();return{isFile:()=>o==="file",isDirectory:()=>o==="directory",isSymbolicLink:()=>!1,size:t,mtime:new Date(i)}},async lstat(r){return this.stat(r)},async unlink(r){throw new Error("File deletion not supported in CLI mode")},async rmdir(r){throw new Error("Directory deletion not supported in CLI mode")},async copyFile(r,e){const n=await this.readFile(r);await this.writeFile(e,n)},async moveFile(r,e){await this.copyFile(r,e)},async ensureDir(r){},async removeDir(r){throw new Error("Directory deletion not supported in CLI mode")},async readDirectory(r){return this.readdir(r)},async writeFileSystemFromTree(r,e,n){console.debug("writeFileSystemFromTree called - no-op in CLI mode")}}}async function te(r){return typeof window>"u"?T():r!=null&&r.useCliBackend?R():_(r)}export{R as createCliFS,te as createFS,_ as createLightningFS,T as createNodeFS};
1
+ import{E as I}from"./index-IWX-nwYi.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-ChvoNxcO.js";import"./preload-helper-BlTxHScW.js";import"./__vite-browser-external-DLjrMatA.js";import"./inherits_browser-nmOknR35-Bp0mvRSL.js";import"./index-6mKfgpcs-DsgiI2lM.js";import"./_commonjsHelpers-B4e78b8K-W3E8ocG7.js";import"./index-DsIu-45t-Bejjlpz4.js";import"./index-DSosZ5sh-Ceejs_jv.js";import"./index-69shuAsh-DF18H7zf.js";import"./index-BJBOx-Z---hbiLl7B.js";import"./index.browser-BHPvGrwi-6Mh8eUw-.js";import"./_commonjs-dynamic-modules-BpilXLfW-DfYEAvWy.js";import"./_commonjs-dynamic-modules-DkOKMH7F.js";var S=Object.defineProperty,A=(r,e,n)=>e in r?S(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,g=(r,e,n)=>A(r,typeof e!="symbol"?e+"":e,n);function x(r,e){for(var n=0;n<e.length;n++){const o=e[n];if(typeof o!="string"&&!Array.isArray(o)){for(const t in o)if(t!=="default"&&!(t in r)){const i=Object.getOwnPropertyDescriptor(o,t);i&&Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:()=>o[t]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}function v(r){return{isFile:()=>r.isFile(),isDirectory:()=>r.isDirectory(),isSymbolicLink:()=>r.isSymbolicLink(),size:r.size,mtime:r.mtime}}class j{async readFile(e){return(void 0)(e,"utf8")}async readFileBuffer(e){return(void 0)(e)}async writeFile(e,n){const o=(void 0)(e);return await this.ensureDir(o),(void 0)(e,n)}async exists(e){try{return await(void 0)(e),!0}catch{return!1}}async mkdir(e){try{await(void 0)(e)}catch(n){if(n&&typeof n=="object"&&"code"in n&&n.code!=="EEXIST")throw n}}async readdir(e){return(void 0)(e)}async stat(e){const n=await(void 0)(e);return v(n)}async lstat(e){const n=await(void 0)(e);return v(n)}async unlink(e){return(void 0)(e)}async rmdir(e){return(void 0)(e)}async copyFile(e,n){const o=(void 0)(n);return await this.ensureDir(o),(void 0)(e,n)}async moveFile(e,n){const o=(void 0)(n);return await this.ensureDir(o),(void 0)(e,n)}async ensureDir(e){try{await(void 0)(e,{recursive:!0})}catch(n){if(n&&typeof n=="object"&&"code"in n&&n.code!=="EEXIST")throw n}}async removeDir(e){return(void 0)(e,{recursive:!0,force:!0})}async readDirectory(e){return(void 0)(e)}async writeFileSystemFromTree(e,n,o){for(const t of e){const i=(void 0)(n,t.path);if(t.type==="directory")await this.ensureDir(i),t.children&&await this.writeFileSystemFromTree(t.children,n,o);else{const s=await o(t.path);await this.writeFile(i,s)}}}}function T(){return new j}function E(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var F,z;function $(){if(z)return F;z=1;function r(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function e(t,i){for(var s="",c=0,u=-1,a=0,f,l=0;l<=t.length;++l){if(l<t.length)f=t.charCodeAt(l);else{if(f===47)break;f=47}if(f===47){if(!(u===l-1||a===1))if(u!==l-1&&a===2){if(s.length<2||c!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var d=s.lastIndexOf("/");if(d!==s.length-1){d===-1?(s="",c=0):(s=s.slice(0,d),c=s.length-1-s.lastIndexOf("/")),u=l,a=0;continue}}else if(s.length===2||s.length===1){s="",c=0,u=l,a=0;continue}}i&&(s.length>0?s+="/..":s="..",c=2)}else s.length>0?s+="/"+t.slice(u+1,l):s=t.slice(u+1,l),c=l-u-1;u=l,a=0}else f===46&&a!==-1?++a:a=-1}return s}function n(t,i){var s=i.dir||i.root,c=i.base||(i.name||"")+(i.ext||"");return s?s===i.root?s+c:s+t+c:c}var o={resolve:function(){for(var t="",i=!1,s,c=arguments.length-1;c>=-1&&!i;c--){var u;c>=0?u=arguments[c]:(s===void 0&&(s=process.cwd()),u=s),r(u),u.length!==0&&(t=u+"/"+t,i=u.charCodeAt(0)===47)}return t=e(t,!i),i?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(r(t),t.length===0)return".";var i=t.charCodeAt(0)===47,s=t.charCodeAt(t.length-1)===47;return t=e(t,!i),t.length===0&&!i&&(t="."),t.length>0&&s&&(t+="/"),i?"/"+t:t},isAbsolute:function(t){return r(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,i=0;i<arguments.length;++i){var s=arguments[i];r(s),s.length>0&&(t===void 0?t=s:t+="/"+s)}return t===void 0?".":o.normalize(t)},relative:function(t,i){if(r(t),r(i),t===i||(t=o.resolve(t),i=o.resolve(i),t===i))return"";for(var s=1;s<t.length&&t.charCodeAt(s)===47;++s);for(var c=t.length,u=c-s,a=1;a<i.length&&i.charCodeAt(a)===47;++a);for(var f=i.length,l=f-a,d=u<l?u:l,y=-1,h=0;h<=d;++h){if(h===d){if(l>d){if(i.charCodeAt(a+h)===47)return i.slice(a+h+1);if(h===0)return i.slice(a+h)}else u>d&&(t.charCodeAt(s+h)===47?y=h:h===0&&(y=0));break}var b=t.charCodeAt(s+h),k=i.charCodeAt(a+h);if(b!==k)break;b===47&&(y=h)}var m="";for(h=s+y+1;h<=c;++h)(h===c||t.charCodeAt(h)===47)&&(m.length===0?m+="..":m+="/..");return m.length>0?m+i.slice(a+y):(a+=y,i.charCodeAt(a)===47&&++a,i.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(r(t),t.length===0)return".";for(var i=t.charCodeAt(0),s=i===47,c=-1,u=!0,a=t.length-1;a>=1;--a)if(i=t.charCodeAt(a),i===47){if(!u){c=a;break}}else u=!1;return c===-1?s?"/":".":s&&c===1?"//":t.slice(0,c)},basename:function(t,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');r(t);var s=0,c=-1,u=!0,a;if(i!==void 0&&i.length>0&&i.length<=t.length){if(i.length===t.length&&i===t)return"";var f=i.length-1,l=-1;for(a=t.length-1;a>=0;--a){var d=t.charCodeAt(a);if(d===47){if(!u){s=a+1;break}}else l===-1&&(u=!1,l=a+1),f>=0&&(d===i.charCodeAt(f)?--f===-1&&(c=a):(f=-1,c=l))}return s===c?c=l:c===-1&&(c=t.length),t.slice(s,c)}else{for(a=t.length-1;a>=0;--a)if(t.charCodeAt(a)===47){if(!u){s=a+1;break}}else c===-1&&(u=!1,c=a+1);return c===-1?"":t.slice(s,c)}},extname:function(t){r(t);for(var i=-1,s=0,c=-1,u=!0,a=0,f=t.length-1;f>=0;--f){var l=t.charCodeAt(f);if(l===47){if(!u){s=f+1;break}continue}c===-1&&(u=!1,c=f+1),l===46?i===-1?i=f:a!==1&&(a=1):i!==-1&&(a=-1)}return i===-1||c===-1||a===0||a===1&&i===c-1&&i===s+1?"":t.slice(i,c)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return n("/",t)},parse:function(t){r(t);var i={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return i;var s=t.charCodeAt(0),c=s===47,u;c?(i.root="/",u=1):u=0;for(var a=-1,f=0,l=-1,d=!0,y=t.length-1,h=0;y>=u;--y){if(s=t.charCodeAt(y),s===47){if(!d){f=y+1;break}continue}l===-1&&(d=!1,l=y+1),s===46?a===-1?a=y:h!==1&&(h=1):a!==-1&&(h=-1)}return a===-1||l===-1||h===0||h===1&&a===l-1&&a===f+1?l!==-1&&(f===0&&c?i.base=i.name=t.slice(1,l):i.base=i.name=t.slice(f,l)):(f===0&&c?(i.name=t.slice(1,a),i.base=t.slice(1,l)):(i.name=t.slice(f,a),i.base=t.slice(f,l)),i.ext=t.slice(a,l)),f>0?i.dir=t.slice(0,f-1):c&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};return o.posix=o,F=o,F}var D=$();const O=E(D),L=x({__proto__:null,default:O},[D]);function C(r){if(r&&typeof r=="object"){const e=r,n=typeof e.isFile=="function"?e.isFile():typeof e.isFile=="boolean"?e.isFile:e.type==="file"||!e.type&&!e.isDirectory,o=typeof e.isDirectory=="function"?e.isDirectory():typeof e.isDirectory=="boolean"?e.isDirectory:e.type==="dir"||e.type==="directory",t=typeof e.size=="number"?e.size:0;let i;return e.mtime instanceof Date?i=e.mtime:typeof e.mtime=="number"?i=new Date(e.mtime):typeof e.mtimeMs=="number"?i=new Date(e.mtimeMs):i=new Date,{isFile:()=>n,isDirectory:()=>o,isSymbolicLink:()=>!1,size:t,mtime:i}}return{isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1,size:0,mtime:new Date}}class P{constructor(){g(this,"fs"),g(this,"initialized",!1),g(this,"path",L)}async initialize(e={}){if(this.initialized)return;const n=e.name||"fs",o=new I(n,{wipe:e.wipe});this.fs=o.promises,this.initialized=!0}ensureInitialized(){if(!this.initialized)throw new Error("LightningFileSystem is not initialized. Call initialize() first.")}async readFile(e){return this.ensureInitialized(),(await this.fs.readFile(e,{encoding:"utf8"})).toString()}async readFileBuffer(e){return this.ensureInitialized(),this.fs.readFile(e)}async writeFile(e,n){this.ensureInitialized();const o=e.substring(0,e.lastIndexOf("/"));return o&&await this.ensureDir(o),this.fs.writeFile(e,n)}async exists(e){this.ensureInitialized();try{return await this.fs.stat(e),!0}catch{return!1}}async mkdir(e,n){this.ensureInitialized();try{return await this.fs.mkdir(e,n)}catch(o){if(o&&typeof o=="object"&&"code"in o&&o.code!=="EEXIST")throw o}}async readdir(e){return this.ensureInitialized(),this.fs.readdir(e)}async stat(e){this.ensureInitialized();const n=await this.fs.stat(e);return C(n)}async lstat(e){this.ensureInitialized();const n=await this.fs.stat(e);return C(n)}async unlink(e){return this.ensureInitialized(),this.fs.unlink(e)}async rmdir(e){return this.ensureInitialized(),this.fs.rmdir(e)}async copyFile(e,n){this.ensureInitialized();const o=n.substring(0,n.lastIndexOf("/"));o&&await this.ensureDir(o);const t=await this.readFileBuffer(e);return this.writeFile(n,t)}async moveFile(e,n){this.ensureInitialized();const o=n.substring(0,n.lastIndexOf("/"));o&&await this.ensureDir(o),await this.copyFile(e,n),await this.unlink(e)}async ensureDir(e){if(this.ensureInitialized(),!await this.exists(e))try{await this.fs.mkdir(e,{recursive:!0})}catch(n){if(n&&typeof n=="object"&&"code"in n&&n.code!=="EEXIST")throw n}}async removeDir(e){if(this.ensureInitialized(),!await this.exists(e))return;if((await this.stat(e)).isFile())return this.unlink(e);const n=await this.readdir(e);for(const o of n){const t=`${e}/${o}`;await this.removeDir(t)}return this.rmdir(e)}async readDirectory(e){return this.ensureInitialized(),this.fs.readdir(e)}async writeFileSystemFromTree(e,n,o){for(const t of e){const i=this.path.join(n,t.path);if(t.type==="directory")await this.mkdir(i,{recursive:!0}),t.children&&await this.writeFileSystemFromTree(t.children,n,o);else{const s=await o(t.path);await this.writeFile(i,s)}}}}async function _(r){const e=new P;return await e.initialize(r),e}function B(){return"http://localhost:4000"}const p=B();function w(r){let e=r.replace(/^\/+/,"");const n=e.split("/");return n.length>1&&(e=n.slice(1).join("/")),e}function R(){return{async readFile(r){const e=w(r),n=await fetch(`${p}/file?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Failed to read file ${r}: ${n.statusText}`);const{content:o}=await n.json();return o},async readFileBuffer(r){const e=await this.readFile(r);return Buffer.from(e,"utf-8")},async writeFile(r,e){const n=w(r),o=typeof e=="string"?e:e.toString("utf-8"),t=await fetch(`${p}/file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n,content:o})});if(!t.ok)throw new Error(`Failed to write file ${r}: ${t.statusText}`)},async exists(r){const e=w(r);try{return(await fetch(`${p}/stat?path=${encodeURIComponent(e)}`)).ok}catch{return!1}},async mkdir(r){},async readdir(r){const e=w(r),n=await fetch(`${p}/files?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Failed to read directory ${r}: ${n.statusText}`);return(await n.json()).map(o=>o.name)},async stat(r){const e=w(r),n=await fetch(`${p}/stat?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Failed to stat ${r}: ${n.statusText}`);const{type:o,size:t,mtime:i}=await n.json();return{isFile:()=>o==="file",isDirectory:()=>o==="directory",isSymbolicLink:()=>!1,size:t,mtime:new Date(i)}},async lstat(r){return this.stat(r)},async unlink(r){throw new Error("File deletion not supported in CLI mode")},async rmdir(r){throw new Error("Directory deletion not supported in CLI mode")},async copyFile(r,e){const n=await this.readFile(r);await this.writeFile(e,n)},async moveFile(r,e){await this.copyFile(r,e)},async ensureDir(r){},async removeDir(r){throw new Error("Directory deletion not supported in CLI mode")},async readDirectory(r){return this.readdir(r)},async writeFileSystemFromTree(r,e,n){console.debug("writeFileSystemFromTree called - no-op in CLI mode")}}}async function te(r){return typeof window>"u"?T():r!=null&&r.useCliBackend?R():_(r)}export{R as createCliFS,te as createFS,_ as createLightningFS,T as createNodeFS};
@@ -0,0 +1 @@
1
+ import{f as x,b as H,H as k,n as y,c as ee,t as te,h as se}from"./normalizeProvider-CtDY37Q6.js";import{Y as re,N as S,h as W,L as ie,f as G,i as ne,a as oe,c as ae,S as $,m as ce,d as ue,b as de,T as N,e as I,v as le,R as ge,j as fe,g as P}from"./resolveDefaultsModeConfig-Bx7XDpng.js";function U(s){return encodeURIComponent(s).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}const R="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",M="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",O="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",K="(\\d?\\d)",Q="(\\d{4})",me=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),pe=new RegExp(`^${R}, ${K} ${M} ${Q} ${O} GMT$`),he=new RegExp(`^${R}, ${K}-${M}-(\\d\\d) ${O} GMT$`),we=new RegExp(`^${R} ${M} ( [1-9]|\\d\\d) ${O} ${Q}$`),Se=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ye=s=>{if(s==null)return;let e=NaN;if(typeof s=="number")e=s;else if(typeof s=="string"){if(!/^-?\d*\.?\d+$/.test(s))throw new TypeError("parseEpochTimestamp - numeric string invalid.");e=Number.parseFloat(s)}else typeof s=="object"&&s.tag===1&&(e=s.value);if(isNaN(e)||Math.abs(e)===1/0)throw new TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(e*1e3))},Ee=s=>{if(s==null)return;if(typeof s!="string")throw new TypeError("RFC3339 timestamps must be strings");const e=me.exec(s);if(!e)throw new TypeError(`Invalid RFC3339 timestamp format ${s}`);const[,t,r,i,n,o,a,,u,c]=e;w(r,1,12),w(i,1,31),w(n,0,23),w(o,0,59),w(a,0,60);const d=new Date(Date.UTC(Number(t),Number(r)-1,Number(i),Number(n),Number(o),Number(a),Number(u)?Math.round(parseFloat(`0.${u}`)*1e3):0));if(d.setUTCFullYear(Number(t)),c.toUpperCase()!="Z"){const[,l,g,f]=/([+-])(\d\d):(\d\d)/.exec(c)||[void 0,"+",0,0],m=l==="-"?1:-1;d.setTime(d.getTime()+m*(Number(g)*60*60*1e3+Number(f)*60*1e3))}return d},be=s=>{if(s==null)return;if(typeof s!="string")throw new TypeError("RFC7231 timestamps must be strings.");let e,t,r,i,n,o,a,u;if((u=pe.exec(s))?[,e,t,r,i,n,o,a]=u:(u=he.exec(s))?([,e,t,r,i,n,o,a]=u,r=(Number(r)+1900).toString()):(u=we.exec(s))&&([,t,e,i,n,o,a,r]=u),r&&o){const c=Date.UTC(Number(r),Se.indexOf(t),Number(e),Number(i),Number(n),Number(o),a?Math.round(parseFloat(`0.${a}`)*1e3):0);w(e,1,31),w(i,0,23),w(n,0,59),w(o,0,60);const d=new Date(c);return d.setUTCFullYear(Number(r)),d}throw new TypeError(`Invalid RFC7231 date-time value ${s}.`)};function w(s,e,t){const r=Number(s);if(r<e||r>t)throw new Error(`Value ${r} out of range [${e}, ${t}]`)}const Ce=s=>{const e=s.length,t=[];let r=!1,i,n=0;for(let o=0;o<e;++o){const a=s[o];switch(a){case'"':i!=="\\"&&(r=!r);break;case",":r||(t.push(s.slice(n,o)),n=o+1);break}i=a}return t.push(s.slice(n)),t.map(o=>{o=o.trim();const a=o.length;return a<2?o:(o[0]==='"'&&o[a-1]==='"'&&(o=o.slice(1,a-1)),o.replace(/\\"/g,'"'))})};class Ae extends re{settings;constructor(e){super(),this.settings=e}read(e,t){const r=S.of(e);if(r.isListSchema())return Ce(t).map(i=>this.read(r.getValueSchema(),i));if(r.isBlobSchema())return(this.serdeContext?.base64Decoder??x)(t);if(r.isTimestampSchema())switch(W(r,this.settings)){case 5:return Ee(t);case 6:return be(t);case 7:return ye(t);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",t),new Date(t)}if(r.isStringSchema()){const i=r.getMergedTraits().mediaType;let n=t;if(i)return r.getMergedTraits().httpHeader&&(n=this.base64ToUtf8(n)),(i==="application/json"||i.endsWith("+json"))&&(n=ie.from(n)),n}return r.isNumericSchema()?Number(t):r.isBigIntegerSchema()?BigInt(t):r.isBigDecimalSchema()?new G(t,"bigDecimal"):r.isBooleanSchema()?String(t).toLowerCase()==="true":t}base64ToUtf8(e){return(this.serdeContext?.utf8Encoder??H)((this.serdeContext?.base64Decoder??x)(e))}}const q=s=>{const e="#text";for(const t in s)s.hasOwnProperty(t)&&s[t][e]!==void 0?s[t]=s[t][e]:typeof s[t]=="object"&&s[t]!==null&&(s[t]=q(s[t]));return s};function ot(s){return s}const Te=s=>e=>async t=>{if(!k.isInstance(t.request))return e(t);const{request:r}=t,{handlerProtocol:i=""}=s.requestHandler.metadata||{};if(i.indexOf("h2")>=0&&!r.headers[":authority"])delete r.headers.host,r.headers[":authority"]=r.hostname+(r.port?":"+r.port:"");else if(!r.headers.host){let n=r.hostname;r.port!=null&&(n+=`:${r.port}`),r.headers.host=n}return e(t)},Ne={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},at=s=>({applyToStack:e=>{e.add(Te(s),Ne)}}),ke=()=>(s,e)=>async t=>{try{const r=await s(t),{clientName:i,commandName:n,logger:o,dynamoDbDocumentClientOptions:a={}}=e,{overrideInputFilterSensitiveLog:u,overrideOutputFilterSensitiveLog:c}=a,d=u??e.inputFilterSensitiveLog,l=c??e.outputFilterSensitiveLog,{$metadata:g,...f}=r.output;return o?.info?.({clientName:i,commandName:n,input:d(t.input),output:l(f),metadata:g}),r}catch(r){const{clientName:i,commandName:n,logger:o,dynamoDbDocumentClientOptions:a={}}=e,{overrideInputFilterSensitiveLog:u}=a,c=u??e.inputFilterSensitiveLog;throw o?.error?.({clientName:i,commandName:n,input:c(t.input),error:r,metadata:r.$metadata}),r}},Re={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},ct=s=>({applyToStack:e=>{e.add(ke(),Re)}}),Me={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},Oe=()=>s=>async e=>s(e),ut=s=>({applyToStack:e=>{e.add(Oe(),Me)}}),De=void 0;function _e(s){return s===void 0?!0:typeof s=="string"&&s.length<=50}function dt(s){const e=y(s.userAgentAppId??De),{customUserAgent:t}=s;return Object.assign(s,{customUserAgent:typeof t=="string"?[[t]]:t,userAgentAppId:async()=>{const r=await e();if(!_e(r)){const i=s.logger?.constructor?.name==="NoOpLogger"||!s.logger?console:s.logger;typeof r!="string"?i?.warn("userAgentAppId must be a string or undefined."):r.length>50&&i?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return r}})}const X=(s,e=!1)=>{if(e){for(const t of s.split("."))if(!X(t))return!1;return!0}return!(!ne(s)||s.length<3||s.length>63||s!==s.toLowerCase()||oe(s))},F=":",xe="/",$e=s=>{const e=s.split(F);if(e.length<6)return null;const[t,r,i,n,o,...a]=e;if(t!=="arn"||r===""||i===""||a.join(F)==="")return null;const u=a.map(c=>c.split(xe)).flat();return{partition:r,service:i,region:n,accountId:o,resourceId:u}},Ie=[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"AWS European Sovereign Cloud (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}],Pe={partitions:Ie};let Ue=Pe;const Fe=s=>{const{partitions:e}=Ue;for(const r of e){const{regions:i,outputs:n}=r;for(const[o,a]of Object.entries(i))if(o===s)return{...n,...a}}for(const r of e){const{regionRegex:i,outputs:n}=r;if(new RegExp(i).test(s))return{...n}}const t=e.find(r=>r.id==="aws");if(!t)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...t.outputs}},ze={isVirtualHostableS3Bucket:X,parseArn:$e,partition:Fe};ae.aws=ze;function Le(s,e,t){return s.$source||(s.$source={}),s.$source[e]=t,s}function h(s,e,t){s.__aws_sdk_context?s.__aws_sdk_context.features||(s.__aws_sdk_context.features={}):s.__aws_sdk_context={features:{}},s.__aws_sdk_context.features[e]=t}const z=s=>ee.isInstance(s)?s.headers?.date??s.headers?.Date:void 0,J=s=>new Date(Date.now()+s),ve=(s,e)=>Math.abs(J(e).getTime()-s)>=3e5,L=(s,e)=>{const t=Date.parse(s);return ve(t,e)?t-Date.now():e},E=(s,e)=>{if(!e)throw new Error(`Property \`${s}\` is not resolved for AWS SDK SigV4Auth`);return e},Ve=async s=>{const e=E("context",s.context),t=E("config",s.config),r=e.endpointV2?.properties?.authSchemes?.[0],n=await E("signer",t.signer)(r),o=s?.signingRegion,a=s?.signingRegionSet,u=s?.signingName;return{config:t,signer:n,signingRegion:o,signingRegionSet:a,signingName:u}};class lt{async sign(e,t,r){if(!k.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const i=await Ve(r),{config:n,signer:o}=i;let{signingRegion:a,signingName:u}=i;const c=r.context;if(c?.authSchemes?.length??!1){const[l,g]=c.authSchemes;l?.name==="sigv4a"&&g?.name==="sigv4"&&(a=g?.signingRegion??a,u=g?.signingName??u)}return await o.sign(e,{signingDate:J(n.systemClockOffset),signingRegion:a,signingService:u})}errorHandler(e){return t=>{const r=t.ServerTime??z(t.$response);if(r){const i=E("config",e.config),n=i.systemClockOffset;i.systemClockOffset=L(r,i.systemClockOffset),i.systemClockOffset!==n&&t.$metadata&&(t.$metadata.clockSkewCorrected=!0)}throw t}}successHandler(e,t){const r=z(e);if(r){const i=E("config",t.config);i.systemClockOffset=L(r,i.systemClockOffset)}}}const gt=s=>{let e=s.credentials,t=!!s.credentials,r;Object.defineProperty(s,"credentials",{set(c){c&&c!==e&&c!==r&&(t=!0),e=c;const d=je(s,{credentials:e,credentialDefaultProvider:s.credentialDefaultProvider}),l=Be(s,d);if(t&&!l.attributed){const g=typeof e=="object"&&e!==null;r=async f=>{const p=await l(f);return g&&(!p.$source||Object.keys(p.$source).length===0)?Le(p,"CREDENTIALS_CODE","e"):p},r.memoized=l.memoized,r.configBound=l.configBound,r.attributed=!0}else r=l},get(){return r},enumerable:!0,configurable:!0}),s.credentials=e;const{signingEscapePath:i=!0,systemClockOffset:n=s.systemClockOffset||0,sha256:o}=s;let a;return s.signer?a=y(s.signer):s.regionInfoProvider?a=()=>y(s.region)().then(async c=>[await s.regionInfoProvider(c,{useFipsEndpoint:await s.useFipsEndpoint(),useDualstackEndpoint:await s.useDualstackEndpoint()})||{},c]).then(([c,d])=>{const{signingRegion:l,signingService:g}=c;s.signingRegion=s.signingRegion||l||d,s.signingName=s.signingName||g||s.serviceId;const f={...s,credentials:s.credentials,region:s.signingRegion,service:s.signingName,sha256:o,uriEscapePath:i},m=s.signerConstructor||$;return new m(f)}):a=async c=>{c=Object.assign({},{name:"sigv4",signingName:s.signingName||s.defaultSigningName,signingRegion:await y(s.region)(),properties:{}},c);const d=c.signingRegion,l=c.signingName;s.signingRegion=s.signingRegion||d,s.signingName=s.signingName||l||s.serviceId;const g={...s,credentials:s.credentials,region:s.signingRegion,service:s.signingName,sha256:o,uriEscapePath:i},f=s.signerConstructor||$;return new f(g)},Object.assign(s,{systemClockOffset:n,signingEscapePath:i,signer:a})};function je(s,{credentials:e,credentialDefaultProvider:t}){let r;return e?e?.memoized?r=e:r=ce(e,de,ue):t?r=y(t(Object.assign({},s,{parentClientConfig:s}))):r=async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},r.memoized=!0,r}function Be(s,e){if(e.configBound)return e;const t=async r=>e({...r,callerClientConfig:s});return t.memoized=e.memoized,t.configBound=!0,t}class He{queryCompat;constructor(e=!1){this.queryCompat=e}resolveRestContentType(e,t){const r=t.getMemberSchemas(),i=Object.values(r).find(n=>!!n.getMergedTraits().httpPayload);if(i){const n=i.getMergedTraits().mediaType;return n||(i.isStringSchema()?"text/plain":i.isBlobSchema()?"application/octet-stream":e)}else if(!t.isUnitSchema()&&Object.values(r).find(o=>{const{httpQuery:a,httpQueryParams:u,httpHeader:c,httpLabel:d,httpPrefixHeaders:l}=o.getMergedTraits();return!a&&!u&&!c&&!d&&l===void 0}))return e}async getErrorSchemaOrThrowBaseException(e,t,r,i,n,o){let a=t,u=e;e.includes("#")&&([a,u]=e.split("#"));const c={$metadata:n,$fault:r.statusCode<500?"client":"server"},d=N.for(a);try{return{errorSchema:o?.(d,u)??d.getSchema(e),errorMetadata:c}}catch{i.message=i.message??i.Message??"UnknownError";const g=N.for("smithy.ts.sdk.synthetic."+a),f=g.getBaseException();if(f){const m=g.getErrorCtor(f)??Error;throw this.decorateServiceException(Object.assign(new m({name:u}),c),i)}throw this.decorateServiceException(Object.assign(new Error(u),c),i)}}decorateServiceException(e,t={}){if(this.queryCompat){const r=e.Message??t.Message,i=I(e,t);r&&(i.message=r),i.Error={...i.Error,Type:i.Error.Type,Code:i.Error.Code,Message:i.Error.message??i.Error.Message??r};const n=i.$metadata.requestId;return n&&(i.RequestId=n),i}return I(e,t)}setQueryCompatError(e,t){const r=t.headers?.["x-amzn-query-error"];if(e!==void 0&&r!=null){const[i,n]=r.split(";"),o=Object.entries(e),a={Code:i,Type:n};Object.assign(e,a);for(const[u,c]of o)a[u==="message"?"Message":u]=c;delete a.__type,e.Error=a}}queryCompatOutput(e,t){e.Error&&(t.Error=e.Error),e.Type&&(t.Type=e.Type),e.Code&&(t.Code=e.Code)}findQueryCompatibleError(e,t){try{return e.getSchema(t)}catch{return e.find(i=>S.of(i).getMergedTraits().awsQueryError?.[0]===t)}}}class Y{serdeContext;setSerdeContext(e){this.serdeContext=e}}function*We(s,e){if(s.isUnitSchema())return;const t=s.getSchema();for(let r=0;r<t[4].length;++r){const i=t[4][r],n=t[5][r],o=new S([n,0],i);!(i in e)&&!o.isIdempotencyToken()||(yield[i,o])}}class Ge{from;to;keys;constructor(e,t){this.from=e,this.to=t,this.keys=new Set(Object.keys(this.from).filter(r=>r!=="__type"))}mark(e){this.keys.delete(e)}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){const e=this.keys.values().next().value,t=this.from[e];this.to.$unknown=[e,t]}}}let C;function Ke(s){C||(C=new DOMParser);const e=C.parseFromString(s,"application/xml");if(e.getElementsByTagName("parsererror").length>0)throw new Error("DOMParser XML parsing error.");const t=r=>{if(r.nodeType===Node.TEXT_NODE&&r.textContent?.trim())return r.textContent;if(r.nodeType===Node.ELEMENT_NODE){const i=r;if(i.attributes.length===0&&i.childNodes.length===0)return"";const n={},o=Array.from(i.attributes);for(const u of o)n[`${u.name}`]=u.value;const a=Array.from(i.childNodes);for(const u of a){const c=t(u);if(c!=null){const d=u.nodeName;if(a.length===1&&o.length===0&&d==="#text")return c;n[d]?Array.isArray(n[d])?n[d].push(c):n[d]=[n[d],c]:n[d]=c}else if(a.length===1&&o.length===0)return i.textContent}return n}return null};return{[e.documentElement.nodeName]:t(e.documentElement)}}class Qe extends Y{settings;stringDeserializer;constructor(e){super(),this.settings=e,this.stringDeserializer=new Ae(e)}setSerdeContext(e){this.serdeContext=e,this.stringDeserializer.setSerdeContext(e)}read(e,t,r){const i=S.of(e),n=i.getMemberSchemas();if(i.isStructSchema()&&i.isMemberSchema()&&!!Object.values(n).find(c=>!!c.getMemberTraits().eventPayload)){const c={},d=Object.keys(n)[0];return n[d].isBlobSchema()?c[d]=t:c[d]=this.read(n[d],t),c}const a=(this.serdeContext?.utf8Encoder??H)(t),u=this.parseXml(a);return this.readSchema(e,r?u[r]:u)}readSchema(e,t){const r=S.of(e);if(r.isUnitSchema())return;const i=r.getMergedTraits();if(r.isListSchema()&&!Array.isArray(t))return this.readSchema(r,[t]);if(t==null)return t;if(typeof t=="object"){const n=!!i.sparse,o=!!i.xmlFlattened;if(r.isListSchema()){const u=r.getValueSchema(),c=[],d=u.getMergedTraits().xmlName??"member",l=o?t:(t[0]??t)[d],g=Array.isArray(l)?l:[l];for(const f of g)(f!=null||n)&&c.push(this.readSchema(u,f));return c}const a={};if(r.isMapSchema()){const u=r.getKeySchema(),c=r.getValueSchema();let d;o?d=Array.isArray(t)?t:[t]:d=Array.isArray(t.entry)?t.entry:[t.entry];const l=u.getMergedTraits().xmlName??"key",g=c.getMergedTraits().xmlName??"value";for(const f of d){const m=f[l],p=f[g];(p!=null||n)&&(a[m]=this.readSchema(c,p))}return a}if(r.isStructSchema()){const u=r.isUnionSchema();let c;u&&(c=new Ge(t,a));for(const[d,l]of r.structIterator()){const g=l.getMergedTraits(),f=g.httpPayload?g.xmlName??l.getName():l.getMemberTraits().xmlName??d;u&&c.mark(f),t[f]!=null&&(a[d]=this.readSchema(l,t[f]))}return u&&c.writeUnknown(),a}if(r.isDocumentSchema())return t;throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${r.getName(!0)}`)}return r.isListSchema()?[]:r.isMapSchema()||r.isStructSchema()?{}:this.stringDeserializer.read(r,t)}parseXml(e){if(e.length){let t;try{t=Ke(e)}catch(o){throw o&&typeof o=="object"&&Object.defineProperty(o,"$responseBodyText",{value:e}),o}const r="#text",i=Object.keys(t)[0],n=t[i];return n[r]&&(n[i]=n[r],delete n[r]),q(n)}return{}}}class qe extends Y{settings;buffer;constructor(e){super(),this.settings=e}write(e,t,r=""){this.buffer===void 0&&(this.buffer="");const i=S.of(e);if(r&&!r.endsWith(".")&&(r+="."),i.isBlobSchema())(typeof t=="string"||t instanceof Uint8Array)&&(this.writeKey(r),this.writeValue((this.serdeContext?.base64Encoder??te)(t)));else if(i.isBooleanSchema()||i.isNumericSchema()||i.isStringSchema())t!=null?(this.writeKey(r),this.writeValue(String(t))):i.isIdempotencyToken()&&(this.writeKey(r),this.writeValue(le()));else if(i.isBigIntegerSchema())t!=null&&(this.writeKey(r),this.writeValue(String(t)));else if(i.isBigDecimalSchema())t!=null&&(this.writeKey(r),this.writeValue(t instanceof G?t.string:String(t)));else if(i.isTimestampSchema()){if(t instanceof Date)switch(this.writeKey(r),W(i,this.settings)){case 5:this.writeValue(t.toISOString().replace(".000Z","Z"));break;case 6:this.writeValue(se(t));break;case 7:this.writeValue(String(t.getTime()/1e3));break}}else if(i.isDocumentSchema())Array.isArray(t)?this.write(79,t,r):t instanceof Date?this.write(4,t,r):t instanceof Uint8Array?this.write(21,t,r):t&&typeof t=="object"?this.write(143,t,r):(this.writeKey(r),this.writeValue(String(t)));else if(i.isListSchema()){if(Array.isArray(t))if(t.length===0)this.settings.serializeEmptyLists&&(this.writeKey(r),this.writeValue(""));else{const n=i.getValueSchema(),o=this.settings.flattenLists||i.getMergedTraits().xmlFlattened;let a=1;for(const u of t){if(u==null)continue;const c=this.getKey("member",n.getMergedTraits().xmlName),d=o?`${r}${a}`:`${r}${c}.${a}`;this.write(n,u,d),++a}}}else if(i.isMapSchema()){if(t&&typeof t=="object"){const n=i.getKeySchema(),o=i.getValueSchema(),a=i.getMergedTraits().xmlFlattened;let u=1;for(const[c,d]of Object.entries(t)){if(d==null)continue;const l=this.getKey("key",n.getMergedTraits().xmlName),g=a?`${r}${u}.${l}`:`${r}entry.${u}.${l}`,f=this.getKey("value",o.getMergedTraits().xmlName),m=a?`${r}${u}.${f}`:`${r}entry.${u}.${f}`;this.write(n,c,g),this.write(o,d,m),++u}}}else if(i.isStructSchema()){if(t&&typeof t=="object"){let n=!1;for(const[o,a]of We(i,t)){if(t[o]==null&&!a.isIdempotencyToken())continue;const u=this.getKey(o,a.getMergedTraits().xmlName),c=`${r}${u}`;this.write(a,t[o],c),n=!0}if(!n&&i.isUnionSchema()){const{$unknown:o}=t;if(Array.isArray(o)){const[a,u]=o,c=`${r}${a}`;this.write(15,u,c)}}}}else if(!i.isUnitSchema())throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${i.getName(!0)}`)}flush(){if(this.buffer===void 0)throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.");const e=this.buffer;return delete this.buffer,e}getKey(e,t){const r=t??e;return this.settings.capitalizeKeys?r[0].toUpperCase()+r.slice(1):r}writeKey(e){e.endsWith(".")&&(e=e.slice(0,e.length-1)),this.buffer+=`&${U(e)}=`}writeValue(e){this.buffer+=U(e)}}class ft extends ge{options;serializer;deserializer;mixin=new He;constructor(e){super({defaultNamespace:e.defaultNamespace}),this.options=e;const t={timestampFormat:{useTrait:!0,default:5},httpBindings:!1,xmlNamespace:e.xmlNamespace,serviceNamespace:e.defaultNamespace,serializeEmptyLists:!0};this.serializer=new qe(t),this.deserializer=new Qe(t)}getShapeId(){return"aws.protocols#awsQuery"}setSerdeContext(e){this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e)}getPayloadCodec(){throw new Error("AWSQuery protocol has no payload codec.")}async serializeRequest(e,t,r){const i=await super.serializeRequest(e,t,r);i.path.endsWith("/")||(i.path+="/"),Object.assign(i.headers,{"content-type":"application/x-www-form-urlencoded"}),(fe(e.input)==="unit"||!i.body)&&(i.body="");const n=e.name.split("#")[1]??e.name;return i.body=`Action=${n}&Version=${this.options.version}`+i.body,i.body.endsWith("&")&&(i.body=i.body.slice(-1)),i}async deserializeResponse(e,t,r){const i=this.deserializer,n=S.of(e.output),o={};if(r.statusCode>=300){const l=await P(r.body,t);l.byteLength>0&&Object.assign(o,await i.read(15,l)),await this.handleError(e,t,r,o,this.deserializeMetadata(r))}for(const l in r.headers){const g=r.headers[l];delete r.headers[l],r.headers[l.toLowerCase()]=g}const a=e.name.split("#")[1]??e.name,u=n.isStructSchema()&&this.useNestedResult()?a+"Result":void 0,c=await P(r.body,t);return c.byteLength>0&&Object.assign(o,await i.read(n,c,u)),{$metadata:this.deserializeMetadata(r),...o}}useNestedResult(){return!0}async handleError(e,t,r,i,n){const o=this.loadQueryErrorCode(r,i)??"Unknown",a=this.loadQueryError(i),u=this.loadQueryErrorMessage(i);a.message=u,a.Error={Type:a.Type,Code:a.Code,Message:u};const{errorSchema:c,errorMetadata:d}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,r,a,n,this.mixin.findQueryCompatibleError),l=S.of(c),g=N.for(c[1]).getErrorCtor(c)??Error,f=new g(u),m={Type:a.Error.Type,Code:a.Error.Code,Error:a.Error};for(const[p,D]of l.structIterator()){const _=D.getMergedTraits().xmlName??p,Z=a[_]??i[_];m[p]=this.deserializer.readSchema(D,Z)}throw this.mixin.decorateServiceException(Object.assign(f,d,{$fault:l.getMergedTraits().error,message:u},m),i)}loadQueryErrorCode(e,t){const r=(t.Errors?.[0]?.Error??t.Errors?.Error??t.Error)?.Code;if(r!==void 0)return r;if(e.statusCode==404)return"NotFound"}loadQueryError(e){return e.Errors?.[0]?.Error??e.Errors?.Error??e.Error}loadQueryErrorMessage(e){const t=this.loadQueryError(e);return t?.message??t?.Message??e.message??e.Message??"Unknown"}getDefaultContentType(){return"application/x-www-form-urlencoded"}}const Xe=/\d{12}\.ddb/;async function Je(s,e,t){if(t.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor"&&h(s,"PROTOCOL_RPC_V2_CBOR","M"),typeof e.retryStrategy=="function"){const n=await e.retryStrategy();typeof n.acquireInitialRetryToken=="function"?n.constructor?.name?.includes("Adaptive")?h(s,"RETRY_MODE_ADAPTIVE","F"):h(s,"RETRY_MODE_STANDARD","E"):h(s,"RETRY_MODE_LEGACY","D")}if(typeof e.accountIdEndpointMode=="function"){const n=s.endpointV2;switch(String(n?.url?.hostname).match(Xe)&&h(s,"ACCOUNT_ID_ENDPOINT","O"),await e.accountIdEndpointMode?.()){case"disabled":h(s,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":h(s,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":h(s,"ACCOUNT_ID_MODE_REQUIRED","R");break}}const i=s.__smithy_context?.selectedHttpAuthScheme?.identity;if(i?.$source){const n=i;n.accountId&&h(s,"RESOLVED_ACCOUNT_ID","T");for(const[o,a]of Object.entries(n.$source??{}))h(s,o,a)}}const v="user-agent",A="x-amz-user-agent",V=" ",T="/",Ye=/[^!$%&'*+\-.^_`|~\w]/g,Ze=/[^!$%&'*+\-.^_`|~\w#]/g,j="-",et=1024;function tt(s){let e="";for(const t in s){const r=s[t];if(e.length+r.length+1<=et){e.length?e+=","+r:e+=r;continue}break}return e}const st=s=>(e,t)=>async r=>{const{request:i}=r;if(!k.isInstance(i))return e(r);const{headers:n}=i,o=t?.userAgent?.map(b)||[],a=(await s.defaultUserAgentProvider()).map(b);await Je(t,s,r);const u=t;a.push(`m/${tt(Object.assign({},t.__smithy_context?.features,u.__aws_sdk_context?.features))}`);const c=s?.customUserAgent?.map(b)||[],d=await s.userAgentAppId();d&&a.push(b(["app",`${d}`]));const l=[].concat([...a,...o,...c]).join(V),g=[...a.filter(f=>f.startsWith("aws-sdk-")),...c].join(V);return s.runtime!=="browser"?(g&&(n[A]=n[A]?`${n[v]} ${g}`:g),n[v]=l):n[A]=l,e({...r,request:i})},b=s=>{const e=s[0].split(T).map(o=>o.replace(Ye,j)).join(T),t=s[1]?.replace(Ze,j),r=e.indexOf(T),i=e.substring(0,r);let n=e.substring(r+1);return i==="api"&&(n=n.toLowerCase()),[i,n,t].filter(o=>o&&o.length>0).reduce((o,a,u)=>{switch(u){case 0:return a;case 1:return`${o}/${a}`;default:return`${o}#${a}`}},"")},rt={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},mt=s=>({applyToStack:e=>{e.add(st(s),rt)}}),pt=({serviceId:s,clientVersion:e})=>async t=>{const r=typeof window<"u"?window.navigator:void 0,i=r?.userAgent??"",n=r?.userAgentData?.platform??B.os(i)??"other",o=void 0,a=r?.userAgentData?.brands??[],u=a[a.length-1],c=u?.brand??B.browser(i)??"unknown",d=u?.version??"unknown",l=[["aws-sdk-js",e],["ua","2.1"],[`os/${n}`,o],["lang/js"],["md/browser",`${c}_${d}`]];s&&l.push([`api/${s}`,e]);const g=await t?.userAgentAppId?.();return g&&l.push([`app/${g}`]),l},B={os(s){if(/iPhone|iPad|iPod/.test(s))return"iOS";if(/Macintosh|Mac OS X/.test(s))return"macOS";if(/Windows NT/.test(s))return"Windows";if(/Android/.test(s))return"Android";if(/Linux/.test(s))return"Linux"},browser(s){if(/EdgiOS|EdgA|Edg\//.test(s))return"Microsoft Edge";if(/Firefox\//.test(s))return"Firefox";if(/Chrome\//.test(s))return"Chrome";if(/Safari\//.test(s))return"Safari"}},ht=s=>({setRegion(e){s.region=e},region(){return s.region}}),wt=s=>({region:s.region()});export{ft as A,ze as a,lt as b,pt as c,wt as d,dt as e,mt as f,ht as g,at as h,ct as i,ut as j,ot as k,gt as r,Le as s};
@@ -1,4 +1,4 @@
1
- import{c as We,a as Oe}from"./_commonjsHelpers-D6-XlEtG.js";import{a as Ot,b as Nt,c as Kt,r as kt}from"./_commonjs-dynamic-modules-B7n8ZNar.js";import"./__vite-browser-external-DLjrMatA.js";/*!
1
+ import{c as We,a as Oe}from"./_commonjsHelpers-D6-XlEtG.js";import{a as Ot,r as Nt,c as Kt,b as kt}from"./_commonjs-dynamic-modules-DkOKMH7F.js";import"./__vite-browser-external-DLjrMatA.js";/*!
2
2
  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */var Vn=(function(){function o(r){var e=r||{},a=e.ValidationData,s=e.Username,f=e.Password,u=e.AuthParameters,l=e.ClientMetadata;this.validationData=a||{},this.authParameters=u||{},this.clientMetadata=l||{},this.username=s,this.password=f}var t=o.prototype;return t.getUsername=function(){return this.username},t.getPassword=function(){return this.password},t.getValidationData=function(){return this.validationData},t.getAuthParameters=function(){return this.authParameters},t.getClientMetadata=function(){return this.clientMetadata},o})(),Ae={},Ue,Je;function qt(){if(Je)return Ue;Je=1;var o={}.toString;return Ue=Array.isArray||function(t){return o.call(t)=="[object Array]"},Ue}/*!
@@ -0,0 +1 @@
1
+ import{g as N}from"./_commonjsHelpers-D6-XlEtG.js";import{b}from"./_commonjs-dynamic-modules-DkOKMH7F.js";var p,S;function w(){if(S)return p;S=1;const u=b;class i{constructor(e,t){typeof e=="string"?this.#r(e):t!==void 0?this.#t(e,t):this.#e(e)}toPostgres(){const e=this.values,t=this.indices.map((s,n)=>u.format("%i:%f",s+1,e[n])).join(",");return u.format("{%s}/%d",t,this.dimensions)}toString(){return this.toPostgres()}toArray(){const e=Array(this.dimensions).fill(0);for(const[t,s]of this.indices.entries())e[s]=this.values[t];return e}#r(e){const t=e.split("/",2);this.dimensions=parseInt(t[1]),this.indices=[],this.values=[];const s=t[0].slice(1,-1).split(",");for(const n of s){const c=n.split(":",2);this.indices.push(parseInt(c[0])-1),this.values.push(parseFloat(c[1]))}}#e(e){this.dimensions=e.length,this.indices=[],this.values=[];for(const[t,s]of e.entries()){const n=Number(s);n!=0&&(this.indices.push(Number(t)),this.values.push(n))}}#t(e,t){this.dimensions=Number(t),this.indices=[],this.values=[];const s=e instanceof Map?e.entries():Object.entries(e);for(const[n,c]of s){const l=Number(c);l!=0&&(this.indices.push(Number(n)),this.values.push(l))}}}return p={SparseVector:i},p}var h,q;function A(){if(q)return h;q=1;const u=b,{SparseVector:i}=w();function f(r){return r===null?null:r.substring(1,r.length-1).split(",").map(o=>parseFloat(o))}function e(r){return Array.isArray(r)?JSON.stringify(r.map(o=>Number(o))):r}const t=f,s=e;function n(r){return r===null?null:new i(r)}function c(r){return r instanceof i?r.toPostgres():r}function l(r){if(r===null)return null;if(r[0]=="[")return f(r);if(r[0]=="{")return n(r);throw new Error("invalid text representation")}function g(r){if(r===null)return null;if(Array.isArray(r))return e(r);if(r instanceof i)return c(r);throw new Error("expected array or sparse vector")}function a(r,o){if(o==null)return r;if(!Number.isInteger(o))throw new Error("expected integer");return u.format("%s(%d)",r,o)}function d(r){return a("vector",r)}function v(r){return a("halfvec",r)}function T(r){return a("bit",r)}function x(r){return a("sparsevec",r)}return h={fromSql:l,toSql:g,vectorFromSql:f,vectorToSql:e,halfvecFromSql:t,halfvecToSql:s,sparsevecFromSql:n,sparsevecToSql:c,sqlType:d,vectorType:d,halfvecType:v,bitType:T,sparsevecType:x,SparseVector:i},h}var m,y;function F(){if(y)return m;y=1;const{fromSql:u,toSql:i,SparseVector:f}=A();return m={fromSql:u,toSql:i,SparseVector:f},m}var V=F();const j=N(V),_=Object.freeze(Object.defineProperty({__proto__:null,default:j},Symbol.toStringTag,{value:"Module"}));export{_ as i};
@@ -0,0 +1 @@
1
+ import{b as z,i as x}from"./normalizeProvider-CtDY37Q6.js";class T{marshaller;serializer;deserializer;serdeContext;defaultContentType;constructor({marshaller:a,serializer:n,deserializer:o,serdeContext:m,defaultContentType:y}){this.marshaller=a,this.serializer=n,this.deserializer=o,this.serdeContext=m,this.defaultContentType=y}async serializeEventStream({eventStream:a,requestSchema:n,initialRequest:o}){const m=this.marshaller,y=n.getEventStreamMember(),p=n.getMemberSchema(y),d=this.serializer,f=this.defaultContentType,h=Symbol("initialRequestMarker"),S={async*[Symbol.asyncIterator](){if(o){const r={":event-type":{type:"string",value:"initial-request"},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:f}};d.write(n,o);const t=d.flush();yield{[h]:!0,headers:r,body:t}}for await(const r of a)yield r}};return m.serialize(S,r=>{if(r[h])return{headers:r.headers,body:r.body};const t=Object.keys(r).find(s=>s!=="__type")??"",{additionalHeaders:e,body:i,eventType:l,explicitPayloadContentType:c}=this.writeEventBody(t,p,r);return{headers:{":event-type":{type:"string",value:l},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:c??f},...e},body:i}})}async deserializeEventStream({response:a,responseSchema:n,initialResponseContainer:o}){const m=this.marshaller,y=n.getEventStreamMember(),d=n.getMemberSchema(y).getMemberSchemas(),f=Symbol("initialResponseMarker"),h=m.deserialize(a.body,async t=>{const e=Object.keys(t).find(l=>l!=="__type")??"",i=t[e].body;if(e==="initial-response"){const l=await this.deserializer.read(n,i);return delete l[y],{[f]:!0,...l}}else if(e in d){const l=d[e];if(l.isStructSchema()){const c={};let u=!1;for(const[s,g]of l.structIterator()){const{eventHeader:v,eventPayload:w}=g.getMergedTraits();if(u=u||!!(v||w),w)g.isBlobSchema()?c[s]=i:g.isStringSchema()?c[s]=(this.serdeContext?.utf8Encoder??z)(i):g.isStructSchema()&&(c[s]=await this.deserializer.read(g,i));else if(v){const b=t[e].headers[s]?.value;b!=null&&(g.isNumericSchema()?b&&typeof b=="object"&&"bytes"in b?c[s]=BigInt(b.toString()):c[s]=Number(b):c[s]=b)}}if(u)return{[e]:c};if(i.byteLength===0)return{[e]:{}}}return{[e]:await this.deserializer.read(l,i)}}else return{$unknown:t}}),S=h[Symbol.asyncIterator](),r=await S.next();if(r.done)return h;if(r.value?.[f]){if(!n)throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");for(const[t,e]of Object.entries(r.value))o[t]=e}return{async*[Symbol.asyncIterator](){for(r?.value?.[f]||(yield r.value);;){const{done:t,value:e}=await S.next();if(t)break;yield e}}}}writeEventBody(a,n,o){const m=this.serializer;let y=a,p=null,d;const f=n.getSchema()[4].includes(a),h={};if(f){const t=n.getMemberSchema(a);if(t.isStructSchema()){for(const[e,i]of t.structIterator()){const{eventHeader:l,eventPayload:c}=i.getMergedTraits();if(c)p=e;else if(l){const u=o[a][e];let s="binary";i.isNumericSchema()?(-2)**31<=u&&u<=2**31-1?s="integer":s="long":i.isTimestampSchema()?s="timestamp":i.isStringSchema()?s="string":i.isBooleanSchema()&&(s="boolean"),u!=null&&(h[e]={type:s,value:u},delete o[a][e])}}if(p!==null){const e=t.getMemberSchema(p);e.isBlobSchema()?d="application/octet-stream":e.isStringSchema()&&(d="text/plain"),m.write(e,o[a][p])}else m.write(t,o[a])}else throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union.")}else{const[t,e]=o[a];y=t,m.write(15,e)}const S=m.flush();return{body:typeof S=="string"?(this.serdeContext?.utf8Decoder??x)(S):S,eventType:y,explicitPayloadContentType:d,additionalHeaders:h}}}export{T as EventStreamSerde};