@shipstatic/ship 0.6.0 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.d.ts CHANGED
@@ -426,13 +426,14 @@ declare const JUNK_DIRECTORIES: readonly ["__MACOSX", ".Trashes", ".fseventsd",
426
426
  *
427
427
  * A path is filtered out if any of these conditions are met:
428
428
  * 1. The basename is identified as junk by the 'junk' package (e.g., .DS_Store, Thumbs.db)
429
- * 2. Any path segment (file or directory) starts with a dot (e.g., .env, .git, .gitattributes)
429
+ * 2. Any path segment starts with a dot (e.g., .env, .git, .htaccess)
430
+ * Exception: `.well-known` at root is allowed (RFC 8615 — ACME, security.txt, app links)
430
431
  * 3. Any path segment exceeds 255 characters (filesystem limit)
431
432
  * 4. Any directory segment in the path matches an entry in JUNK_DIRECTORIES (case-insensitive)
432
433
  *
433
434
  * All path separators are normalized to forward slashes for consistent cross-platform behavior.
434
435
  *
435
- * Note: Dot files are filtered for security - they typically contain sensitive configuration
436
+ * Dot files are filtered for security they typically contain sensitive configuration
436
437
  * (.env, .git) or are not meant to be served publicly. This matches server-side filtering.
437
438
  *
438
439
  * @param filePaths - An array of file path strings to filter
@@ -536,6 +537,22 @@ declare function getENV(): ExecutionEnvironment;
536
537
  * Format file size to human-readable string
537
538
  */
538
539
  declare function formatFileSize(bytes: number, decimals?: number): string;
540
+ /**
541
+ * Validate filename for deployment safety
542
+ * Rejects filenames that would cause issues in URLs, filesystems, or shells
543
+ *
544
+ * Rejected patterns:
545
+ * - URL-unsafe: ?, &, #, %, <, >, [, ], {, }, |, \, ^, ~, `
546
+ * - Path traversal: .. (already checked separately)
547
+ * - Shell dangerous: ; $ ( ) ' " *
548
+ * - Control characters: \0, \r, \n, \t
549
+ * - Reserved names: CON, PRN, AUX, NUL, COM1-9, LPT1-9 (Windows)
550
+ * - Leading/trailing dots or spaces
551
+ */
552
+ declare function validateFileName(filename: string): {
553
+ valid: boolean;
554
+ reason?: string;
555
+ };
539
556
  /**
540
557
  * Validate files against configuration limits with severity-based reporting
541
558
  *
@@ -593,6 +610,16 @@ declare function allValidFilesReady<T extends ValidatableFile>(files: T[]): bool
593
610
  * @throws {ShipError} If the path contains unsafe patterns
594
611
  */
595
612
  declare function validateDeployPath(deployPath: string, sourceIdentifier: string): void;
613
+ /**
614
+ * Validate a deploy file's name and extension.
615
+ * Rejects unsafe filenames (shell/URL-dangerous chars, reserved names)
616
+ * and blocked file extensions (.exe, .msi, .dll, etc.).
617
+ *
618
+ * @param deployPath - The deployment path to validate
619
+ * @param sourceIdentifier - Human-readable identifier for error messages
620
+ * @throws {ShipError} If the filename is unsafe or extension is blocked
621
+ */
622
+ declare function validateDeployFile(deployPath: string, sourceIdentifier: string): void;
596
623
 
597
624
  /**
598
625
  * @file Platform configuration management for the Ship SDK.
@@ -615,8 +642,8 @@ declare function getCurrentConfig(): ConfigResponse;
615
642
  *
616
643
  * Pipeline order matches Node.js (node-files.ts) for consistency:
617
644
  * 1. Extract paths → 2. Filter junk → 3. Optimize paths →
618
- * 4. Security validate → 5. Skip empties → 6. Size validate →
619
- * 7. Calculate MD5 → 8. Count validate
645
+ * 4. Security validate → 5. Skip empties → 6. Name & extension validate →
646
+ * 7. Size validate → 8. Calculate MD5 → 9. Count validate
620
647
  */
621
648
 
622
649
  /**
@@ -663,4 +690,4 @@ declare class Ship extends Ship$1 {
663
690
  protected getDeployBodyCreator(): DeployBodyCreator;
664
691
  }
665
692
 
666
- export { type ApiDeployOptions, ApiHttp, type ApiHttpOptions, type DeployBody, type DeployBodyCreator, type DeployFile, type DeploymentOptions, type DeploymentResourceContext, type DomainSetResult, type ExecutionEnvironment, JUNK_DIRECTORIES, type MD5Result, type ResourceContext, Ship, type ShipClientOptions, type ShipEvents, __setTestEnvironment, allValidFilesReady, calculateMD5, createAccountResource, createDeploymentResource, createDomainResource, createTokenResource, Ship as default, filterJunk, formatFileSize, getCurrentConfig, getENV, getValidFiles, mergeDeployOptions, optimizeDeployPaths, pluralize, processFilesForBrowser, resolveConfig, setConfig as setPlatformConfig, validateDeployPath, validateFiles };
693
+ export { type ApiDeployOptions, ApiHttp, type ApiHttpOptions, type DeployBody, type DeployBodyCreator, type DeployFile, type DeploymentOptions, type DeploymentResourceContext, type DomainSetResult, type ExecutionEnvironment, JUNK_DIRECTORIES, type MD5Result, type ResourceContext, Ship, type ShipClientOptions, type ShipEvents, __setTestEnvironment, allValidFilesReady, calculateMD5, createAccountResource, createDeploymentResource, createDomainResource, createTokenResource, Ship as default, filterJunk, formatFileSize, getCurrentConfig, getENV, getValidFiles, mergeDeployOptions, optimizeDeployPaths, pluralize, processFilesForBrowser, resolveConfig, setConfig as setPlatformConfig, validateDeployFile, validateDeployPath, validateFileName, validateFiles };
package/dist/browser.js CHANGED
@@ -1,2 +1,2 @@
1
- var Le=Object.create;var _=Object.defineProperty;var Be=Object.getOwnPropertyDescriptor;var Ue=Object.getOwnPropertyNames;var Me=Object.getPrototypeOf,ke=Object.prototype.hasOwnProperty;var ze=(i,e,n)=>e in i?_(i,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[e]=n;var C=(i,e)=>()=>(i&&(e=i(i=0)),e);var le=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),Ke=(i,e)=>{for(var n in e)_(i,n,{get:e[n],enumerable:!0})},Ve=(i,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of Ue(e))!ke.call(i,u)&&u!==n&&_(i,u,{get:()=>e[u],enumerable:!(a=Be(e,u))||a.enumerable});return i};var q=(i,e,n)=>(n=i!=null?Le(Me(i)):{},Ve(e||!i||!i.__esModule?_(n,"default",{value:i,enumerable:!0}):n,i));var $=(i,e,n)=>ze(i,typeof e!="symbol"?e+"":e,n);function W(i){return i!==null&&typeof i=="object"&&"name"in i&&i.name==="ShipError"&&"status"in i}function fe(i){let e=i.lastIndexOf(".");if(e===-1||e===i.length-1)return!1;let n=i.slice(e+1).toLowerCase();return He.has(n)}function pt(i){if(!i.startsWith(T))throw d.validation(`API key must start with "${T}"`);if(i.length!==ue)throw d.validation(`API key must be ${ue} characters total (${T} + ${j} hex chars)`);let e=i.slice(T.length);if(!/^[a-f0-9]{64}$/i.test(e))throw d.validation(`API key must contain ${j} hexadecimal characters after "${T}" prefix`)}function lt(i){if(!i.startsWith(I))throw d.validation(`Deploy token must start with "${I}"`);if(i.length!==ce)throw d.validation(`Deploy token must be ${ce} characters total (${I} + ${Y} hex chars)`);let e=i.slice(I.length);if(!/^[a-f0-9]{64}$/i.test(e))throw d.validation(`Deploy token must contain ${Y} hexadecimal characters after "${I}" prefix`)}function ut(i){try{let e=new URL(i);if(!["http:","https:"].includes(e.protocol))throw d.validation("API URL must use http:// or https:// protocol");if(e.pathname!=="/"&&e.pathname!=="")throw d.validation("API URL must not contain a path");if(e.search||e.hash)throw d.validation("API URL must not contain query parameters or fragments")}catch(e){throw W(e)?e:d.validation("API URL must be a valid URL")}}function ct(i){return/^[a-z]+-[a-z]+-[a-z0-9]{7}$/i.test(i)}function he(i,e){return i.endsWith(`.${e}`)}function ft(i,e){return!he(i,e)}function ht(i,e){return he(i,e)?i.slice(0,-(e.length+1)):null}function dt(i,e){return`https://${i}.${e||"shipstatic.com"}`}function mt(i){return`https://${i}`}function Dt(i){return!i||i.length===0?null:JSON.stringify(i)}function At(i){if(!i)return[];try{let e=JSON.parse(i);return Array.isArray(e)?e:[]}catch{return[]}}var rt,it,ot,A,G,d,He,T,j,ue,st,I,Y,ce,at,J,N,E,yt,gt,w=C(()=>{"use strict";rt={PENDING:"pending",SUCCESS:"success",FAILED:"failed",DELETING:"deleting"},it={PENDING:"pending",PARTIAL:"partial",SUCCESS:"success",PAUSED:"paused"},ot={FREE:"free",STANDARD:"standard",SPONSORED:"sponsored",ENTERPRISE:"enterprise",SUSPENDED:"suspended",TERMINATING:"terminating",TERMINATED:"terminated"};(function(i){i.Validation="validation_failed",i.NotFound="not_found",i.RateLimit="rate_limit_exceeded",i.Authentication="authentication_failed",i.Business="business_logic_error",i.Api="internal_server_error",i.Network="network_error",i.Cancelled="operation_cancelled",i.File="file_error",i.Config="config_error"})(A||(A={}));G={client:new Set([A.Business,A.Config,A.File,A.Validation]),network:new Set([A.Network]),auth:new Set([A.Authentication])},d=class i extends Error{constructor(n,a,u,f){super(a);$(this,"type");$(this,"status");$(this,"details");this.type=n,this.status=u,this.details=f,this.name="ShipError"}toResponse(){let n=this.type===A.Authentication&&this.details?.internal?void 0:this.details;return{error:this.type,message:this.message,status:this.status,details:n}}static fromResponse(n){return new i(n.error,n.message,n.status,n.details)}static validation(n,a){return new i(A.Validation,n,400,a)}static notFound(n,a){let u=a?`${n} ${a} not found`:`${n} not found`;return new i(A.NotFound,u,404)}static rateLimit(n="Too many requests"){return new i(A.RateLimit,n,429)}static authentication(n="Authentication required",a){return new i(A.Authentication,n,401,a)}static business(n,a=400){return new i(A.Business,n,a)}static network(n,a){return new i(A.Network,n,void 0,{cause:a})}static cancelled(n){return new i(A.Cancelled,n)}static file(n,a){return new i(A.File,n,void 0,{filePath:a})}static config(n,a){return new i(A.Config,n,void 0,a)}static api(n,a=500){return new i(A.Api,n,a)}static database(n,a=500){return new i(A.Api,n,a)}static storage(n,a=500){return new i(A.Api,n,a)}get filePath(){return this.details?.filePath}isClientError(){return G.client.has(this.type)}isNetworkError(){return G.network.has(this.type)}isAuthError(){return G.auth.has(this.type)}isValidationError(){return this.type===A.Validation}isFileError(){return this.type===A.File}isConfigError(){return this.type===A.Config}isType(n){return this.type===n}};He=new Set(["exe","msi","dll","scr","bat","cmd","com","pif","app","deb","rpm","pkg","mpkg","dmg","iso","img","cab","cpl","chm","ps1","vbs","vbe","ws","wsf","wsc","wsh","reg","jar","jnlp","apk","crx","lnk","inf","hta"]);T="ship-",j=64,ue=T.length+j,st=4,I="token-",Y=64,ce=I.length+Y,at={JWT:"jwt",API_KEY:"apiKey",TOKEN:"token",WEBHOOK:"webhook",SYSTEM:"system"},J="ship.json";N="https://api.shipstatic.com",E={PENDING:"pending",PROCESSING_ERROR:"processing_error",EXCLUDED:"excluded",VALIDATION_FAILED:"validation_failed",READY:"ready"};yt={MIN_LENGTH:3,MAX_LENGTH:25,MAX_COUNT:10,SEPARATORS:"._-"},gt=/^[a-z0-9]+(?:[._-][a-z0-9]+)*$/});function Q(i){X=i}function F(){if(X===null)throw d.config("Platform configuration not initialized. The SDK must fetch configuration from the API before performing operations.");return X}var X,P=C(()=>{"use strict";w();X=null});function Ft(i){Z=i}function Ge(){return typeof process<"u"&&process.versions&&process.versions.node?"node":typeof window<"u"||typeof self<"u"?"browser":"unknown"}function U(){return Z||Ge()}var Z,M=C(()=>{"use strict";Z=null});var De=le((ye,ge)=>{"use strict";(function(i){if(typeof ye=="object")ge.exports=i();else if(typeof define=="function"&&define.amd)define(i);else{var e;try{e=window}catch{e=self}e.SparkMD5=i()}})(function(i){"use strict";var e=function(l,p){return l+p&4294967295},n=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function a(l,p,r,t,s,o){return p=e(e(p,l),e(t,o)),e(p<<s|p>>>32-s,r)}function u(l,p){var r=l[0],t=l[1],s=l[2],o=l[3];r+=(t&s|~t&o)+p[0]-680876936|0,r=(r<<7|r>>>25)+t|0,o+=(r&t|~r&s)+p[1]-389564586|0,o=(o<<12|o>>>20)+r|0,s+=(o&r|~o&t)+p[2]+606105819|0,s=(s<<17|s>>>15)+o|0,t+=(s&o|~s&r)+p[3]-1044525330|0,t=(t<<22|t>>>10)+s|0,r+=(t&s|~t&o)+p[4]-176418897|0,r=(r<<7|r>>>25)+t|0,o+=(r&t|~r&s)+p[5]+1200080426|0,o=(o<<12|o>>>20)+r|0,s+=(o&r|~o&t)+p[6]-1473231341|0,s=(s<<17|s>>>15)+o|0,t+=(s&o|~s&r)+p[7]-45705983|0,t=(t<<22|t>>>10)+s|0,r+=(t&s|~t&o)+p[8]+1770035416|0,r=(r<<7|r>>>25)+t|0,o+=(r&t|~r&s)+p[9]-1958414417|0,o=(o<<12|o>>>20)+r|0,s+=(o&r|~o&t)+p[10]-42063|0,s=(s<<17|s>>>15)+o|0,t+=(s&o|~s&r)+p[11]-1990404162|0,t=(t<<22|t>>>10)+s|0,r+=(t&s|~t&o)+p[12]+1804603682|0,r=(r<<7|r>>>25)+t|0,o+=(r&t|~r&s)+p[13]-40341101|0,o=(o<<12|o>>>20)+r|0,s+=(o&r|~o&t)+p[14]-1502002290|0,s=(s<<17|s>>>15)+o|0,t+=(s&o|~s&r)+p[15]+1236535329|0,t=(t<<22|t>>>10)+s|0,r+=(t&o|s&~o)+p[1]-165796510|0,r=(r<<5|r>>>27)+t|0,o+=(r&s|t&~s)+p[6]-1069501632|0,o=(o<<9|o>>>23)+r|0,s+=(o&t|r&~t)+p[11]+643717713|0,s=(s<<14|s>>>18)+o|0,t+=(s&r|o&~r)+p[0]-373897302|0,t=(t<<20|t>>>12)+s|0,r+=(t&o|s&~o)+p[5]-701558691|0,r=(r<<5|r>>>27)+t|0,o+=(r&s|t&~s)+p[10]+38016083|0,o=(o<<9|o>>>23)+r|0,s+=(o&t|r&~t)+p[15]-660478335|0,s=(s<<14|s>>>18)+o|0,t+=(s&r|o&~r)+p[4]-405537848|0,t=(t<<20|t>>>12)+s|0,r+=(t&o|s&~o)+p[9]+568446438|0,r=(r<<5|r>>>27)+t|0,o+=(r&s|t&~s)+p[14]-1019803690|0,o=(o<<9|o>>>23)+r|0,s+=(o&t|r&~t)+p[3]-187363961|0,s=(s<<14|s>>>18)+o|0,t+=(s&r|o&~r)+p[8]+1163531501|0,t=(t<<20|t>>>12)+s|0,r+=(t&o|s&~o)+p[13]-1444681467|0,r=(r<<5|r>>>27)+t|0,o+=(r&s|t&~s)+p[2]-51403784|0,o=(o<<9|o>>>23)+r|0,s+=(o&t|r&~t)+p[7]+1735328473|0,s=(s<<14|s>>>18)+o|0,t+=(s&r|o&~r)+p[12]-1926607734|0,t=(t<<20|t>>>12)+s|0,r+=(t^s^o)+p[5]-378558|0,r=(r<<4|r>>>28)+t|0,o+=(r^t^s)+p[8]-2022574463|0,o=(o<<11|o>>>21)+r|0,s+=(o^r^t)+p[11]+1839030562|0,s=(s<<16|s>>>16)+o|0,t+=(s^o^r)+p[14]-35309556|0,t=(t<<23|t>>>9)+s|0,r+=(t^s^o)+p[1]-1530992060|0,r=(r<<4|r>>>28)+t|0,o+=(r^t^s)+p[4]+1272893353|0,o=(o<<11|o>>>21)+r|0,s+=(o^r^t)+p[7]-155497632|0,s=(s<<16|s>>>16)+o|0,t+=(s^o^r)+p[10]-1094730640|0,t=(t<<23|t>>>9)+s|0,r+=(t^s^o)+p[13]+681279174|0,r=(r<<4|r>>>28)+t|0,o+=(r^t^s)+p[0]-358537222|0,o=(o<<11|o>>>21)+r|0,s+=(o^r^t)+p[3]-722521979|0,s=(s<<16|s>>>16)+o|0,t+=(s^o^r)+p[6]+76029189|0,t=(t<<23|t>>>9)+s|0,r+=(t^s^o)+p[9]-640364487|0,r=(r<<4|r>>>28)+t|0,o+=(r^t^s)+p[12]-421815835|0,o=(o<<11|o>>>21)+r|0,s+=(o^r^t)+p[15]+530742520|0,s=(s<<16|s>>>16)+o|0,t+=(s^o^r)+p[2]-995338651|0,t=(t<<23|t>>>9)+s|0,r+=(s^(t|~o))+p[0]-198630844|0,r=(r<<6|r>>>26)+t|0,o+=(t^(r|~s))+p[7]+1126891415|0,o=(o<<10|o>>>22)+r|0,s+=(r^(o|~t))+p[14]-1416354905|0,s=(s<<15|s>>>17)+o|0,t+=(o^(s|~r))+p[5]-57434055|0,t=(t<<21|t>>>11)+s|0,r+=(s^(t|~o))+p[12]+1700485571|0,r=(r<<6|r>>>26)+t|0,o+=(t^(r|~s))+p[3]-1894986606|0,o=(o<<10|o>>>22)+r|0,s+=(r^(o|~t))+p[10]-1051523|0,s=(s<<15|s>>>17)+o|0,t+=(o^(s|~r))+p[1]-2054922799|0,t=(t<<21|t>>>11)+s|0,r+=(s^(t|~o))+p[8]+1873313359|0,r=(r<<6|r>>>26)+t|0,o+=(t^(r|~s))+p[15]-30611744|0,o=(o<<10|o>>>22)+r|0,s+=(r^(o|~t))+p[6]-1560198380|0,s=(s<<15|s>>>17)+o|0,t+=(o^(s|~r))+p[13]+1309151649|0,t=(t<<21|t>>>11)+s|0,r+=(s^(t|~o))+p[4]-145523070|0,r=(r<<6|r>>>26)+t|0,o+=(t^(r|~s))+p[11]-1120210379|0,o=(o<<10|o>>>22)+r|0,s+=(r^(o|~t))+p[2]+718787259|0,s=(s<<15|s>>>17)+o|0,t+=(o^(s|~r))+p[9]-343485551|0,t=(t<<21|t>>>11)+s|0,l[0]=r+l[0]|0,l[1]=t+l[1]|0,l[2]=s+l[2]|0,l[3]=o+l[3]|0}function f(l){var p=[],r;for(r=0;r<64;r+=4)p[r>>2]=l.charCodeAt(r)+(l.charCodeAt(r+1)<<8)+(l.charCodeAt(r+2)<<16)+(l.charCodeAt(r+3)<<24);return p}function h(l){var p=[],r;for(r=0;r<64;r+=4)p[r>>2]=l[r]+(l[r+1]<<8)+(l[r+2]<<16)+(l[r+3]<<24);return p}function g(l){var p=l.length,r=[1732584193,-271733879,-1732584194,271733878],t,s,o,v,x,b;for(t=64;t<=p;t+=64)u(r,f(l.substring(t-64,t)));for(l=l.substring(t-64),s=l.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<s;t+=1)o[t>>2]|=l.charCodeAt(t)<<(t%4<<3);if(o[t>>2]|=128<<(t%4<<3),t>55)for(u(r,o),t=0;t<16;t+=1)o[t]=0;return v=p*8,v=v.toString(16).match(/(.*?)(.{0,8})$/),x=parseInt(v[2],16),b=parseInt(v[1],16)||0,o[14]=x,o[15]=b,u(r,o),r}function c(l){var p=l.length,r=[1732584193,-271733879,-1732584194,271733878],t,s,o,v,x,b;for(t=64;t<=p;t+=64)u(r,h(l.subarray(t-64,t)));for(l=t-64<p?l.subarray(t-64):new Uint8Array(0),s=l.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<s;t+=1)o[t>>2]|=l[t]<<(t%4<<3);if(o[t>>2]|=128<<(t%4<<3),t>55)for(u(r,o),t=0;t<16;t+=1)o[t]=0;return v=p*8,v=v.toString(16).match(/(.*?)(.{0,8})$/),x=parseInt(v[2],16),b=parseInt(v[1],16)||0,o[14]=x,o[15]=b,u(r,o),r}function y(l){var p="",r;for(r=0;r<4;r+=1)p+=n[l>>r*8+4&15]+n[l>>r*8&15];return p}function m(l){var p;for(p=0;p<l.length;p+=1)l[p]=y(l[p]);return l.join("")}m(g("hello"))!=="5d41402abc4b2a76b9719d911017c592"&&(e=function(l,p){var r=(l&65535)+(p&65535),t=(l>>16)+(p>>16)+(r>>16);return t<<16|r&65535}),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&(function(){function l(p,r){return p=p|0||0,p<0?Math.max(p+r,0):Math.min(p,r)}ArrayBuffer.prototype.slice=function(p,r){var t=this.byteLength,s=l(p,t),o=t,v,x,b,pe;return r!==i&&(o=l(r,t)),s>o?new ArrayBuffer(0):(v=o-s,x=new ArrayBuffer(v),b=new Uint8Array(x),pe=new Uint8Array(this,s,v),b.set(pe),x)}})();function R(l){return/[\u0080-\uFFFF]/.test(l)&&(l=unescape(encodeURIComponent(l))),l}function H(l,p){var r=l.length,t=new ArrayBuffer(r),s=new Uint8Array(t),o;for(o=0;o<r;o+=1)s[o]=l.charCodeAt(o);return p?s:t}function $e(l){return String.fromCharCode.apply(null,new Uint8Array(l))}function Ne(l,p,r){var t=new Uint8Array(l.byteLength+p.byteLength);return t.set(new Uint8Array(l)),t.set(new Uint8Array(p),l.byteLength),r?t:t.buffer}function O(l){var p=[],r=l.length,t;for(t=0;t<r-1;t+=2)p.push(parseInt(l.substr(t,2),16));return String.fromCharCode.apply(String,p)}function D(){this.reset()}return D.prototype.append=function(l){return this.appendBinary(R(l)),this},D.prototype.appendBinary=function(l){this._buff+=l,this._length+=l.length;var p=this._buff.length,r;for(r=64;r<=p;r+=64)u(this._hash,f(this._buff.substring(r-64,r)));return this._buff=this._buff.substring(r-64),this},D.prototype.end=function(l){var p=this._buff,r=p.length,t,s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],o;for(t=0;t<r;t+=1)s[t>>2]|=p.charCodeAt(t)<<(t%4<<3);return this._finish(s,r),o=m(this._hash),l&&(o=O(o)),this.reset(),o},D.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},D.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},D.prototype.setState=function(l){return this._buff=l.buff,this._length=l.length,this._hash=l.hash,this},D.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},D.prototype._finish=function(l,p){var r=p,t,s,o;if(l[r>>2]|=128<<(r%4<<3),r>55)for(u(this._hash,l),r=0;r<16;r+=1)l[r]=0;t=this._length*8,t=t.toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(t[2],16),o=parseInt(t[1],16)||0,l[14]=s,l[15]=o,u(this._hash,l)},D.hash=function(l,p){return D.hashBinary(R(l),p)},D.hashBinary=function(l,p){var r=g(l),t=m(r);return p?O(t):t},D.ArrayBuffer=function(){this.reset()},D.ArrayBuffer.prototype.append=function(l){var p=Ne(this._buff.buffer,l,!0),r=p.length,t;for(this._length+=l.byteLength,t=64;t<=r;t+=64)u(this._hash,h(p.subarray(t-64,t)));return this._buff=t-64<r?new Uint8Array(p.buffer.slice(t-64)):new Uint8Array(0),this},D.ArrayBuffer.prototype.end=function(l){var p=this._buff,r=p.length,t=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],s,o;for(s=0;s<r;s+=1)t[s>>2]|=p[s]<<(s%4<<3);return this._finish(t,r),o=m(this._hash),l&&(o=O(o)),this.reset(),o},D.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},D.ArrayBuffer.prototype.getState=function(){var l=D.prototype.getState.call(this);return l.buff=$e(l.buff),l},D.ArrayBuffer.prototype.setState=function(l){return l.buff=H(l.buff,!0),D.prototype.setState.call(this,l)},D.ArrayBuffer.prototype.destroy=D.prototype.destroy,D.ArrayBuffer.prototype._finish=D.prototype._finish,D.ArrayBuffer.hash=function(l,p){var r=c(new Uint8Array(l)),t=m(r);return p?O(t):t},D})});var ee=le((Ot,Ae)=>{"use strict";Ae.exports={}});async function je(i){let e=(await Promise.resolve().then(()=>q(De(),1))).default;return new Promise((n,a)=>{let f=Math.ceil(i.size/2097152),h=0,g=new e.ArrayBuffer,c=new FileReader,y=()=>{let m=h*2097152,R=Math.min(m+2097152,i.size);c.readAsArrayBuffer(i.slice(m,R))};c.onload=m=>{let R=m.target?.result;if(!R){a(d.business("Failed to read file chunk"));return}g.append(R),h++,h<f?y():n({md5:g.end()})},c.onerror=()=>{a(d.business("Failed to calculate MD5: FileReader error"))},y()})}async function Ye(i){let e=await Promise.resolve().then(()=>q(ee(),1));if(Buffer.isBuffer(i)){let a=e.createHash("md5");return a.update(i),{md5:a.digest("hex")}}let n=await Promise.resolve().then(()=>q(ee(),1));return new Promise((a,u)=>{let f=e.createHash("md5"),h=n.createReadStream(i);h.on("error",g=>u(d.business(`Failed to read file for MD5: ${g.message}`))),h.on("data",g=>f.update(g)),h.on("end",()=>a({md5:f.digest("hex")}))})}async function k(i){let e=U();if(e==="browser"){if(!(i instanceof Blob))throw d.business("Invalid input for browser MD5 calculation: Expected Blob or File.");return je(i)}if(e==="node"){if(!(Buffer.isBuffer(i)||typeof i=="string"))throw d.business("Invalid input for Node.js MD5 calculation: Expected Buffer or file path string.");return Ye(i)}throw d.business("Unknown or unsupported execution environment for MD5 calculation.")}var z=C(()=>{"use strict";M();w()});function xe(i){return Xe.test(i)}var Je,Xe,be=C(()=>{"use strict";Je=["^npm-debug\\.log$","^\\..*\\.swp$","^\\.DS_Store$","^\\.AppleDouble$","^\\.LSOverride$","^Icon\\r$","^\\._.*","^\\.Spotlight-V100(?:$|\\/)","\\.Trashes","^__MACOSX$","~$","^Thumbs\\.db$","^ehthumbs\\.db$","^[Dd]esktop\\.ini$","@eaDir$"],Xe=new RegExp(Je.join("|"))});function Te(i){return!i||i.length===0?[]:i.filter(e=>{if(!e)return!1;let n=e.replace(/\\/g,"/").split("/").filter(Boolean);if(n.length===0)return!0;let a=n[n.length-1];if(xe(a))return!1;for(let f of n)if(f.startsWith(".")||f.length>255)return!1;let u=n.slice(0,-1);for(let f of u)if(Qe.some(h=>f.toLowerCase()===h.toLowerCase()))return!1;return!0})}var Qe,te=C(()=>{"use strict";be();Qe=["__MACOSX",".Trashes",".fseventsd",".Spotlight-V100"]});function V(i){return i.replace(/\\/g,"/").replace(/\/+/g,"/").replace(/^\/+/,"")}var Ie=C(()=>{"use strict"});function Fe(i,e={}){if(e.flatten===!1)return i.map(a=>({path:V(a),name:ne(a)}));let n=Ze(i);return i.map(a=>{let u=V(a);if(n){let f=n.endsWith("/")?n:`${n}/`;u.startsWith(f)&&(u=u.substring(f.length))}return u||(u=ne(a)),{path:u,name:ne(a)}})}function Ze(i){if(!i.length)return"";let n=i.map(f=>V(f)).map(f=>f.split("/")),a=[],u=Math.min(...n.map(f=>f.length));for(let f=0;f<u-1;f++){let h=n[0][f];if(n.every(g=>g[f]===h))a.push(h);else break}return a.join("/")}function ne(i){return i.split(/[/\\]/).pop()||i}var re=C(()=>{"use strict";Ie()});function Pe(i,e){if(i.includes("\0")||i.includes("/../")||i.startsWith("../")||i.endsWith("/.."))throw d.business(`Security error: Unsafe file path "${i}" for file: ${e}`)}var oe=C(()=>{"use strict";w()});var _e={};Ke(_e,{processFilesForBrowser:()=>Oe});async function Oe(i,e={}){if(U()!=="browser")throw d.business("processFilesForBrowser can only be called in a browser environment.");let n=i.map(y=>y.webkitRelativePath||y.name),a=new Set(Te(n)),u=[];for(let y=0;y<i.length;y++)a.has(n[y])&&u.push({file:i[y],rawPath:n[y]});if(u.length===0)return[];let f=Fe(u.map(y=>y.rawPath),{flatten:e.pathDetect!==!1}),h=F(),g=[],c=0;for(let y=0;y<u.length;y++){let{file:m}=u[y],R=f[y].path;if(Pe(R,m.name),m.size===0)continue;if(m.size>h.maxFileSize)throw d.business(`File ${m.name} is too large. Maximum allowed size is ${h.maxFileSize/(1024*1024)}MB.`);if(c+=m.size,c>h.maxTotalSize)throw d.business(`Total deploy size is too large. Maximum allowed is ${h.maxTotalSize/(1024*1024)}MB.`);let{md5:H}=await k(m);g.push({path:R,content:m,size:m.size,md5:H})}if(g.length>h.maxFilesCount)throw d.business(`Too many files to deploy. Maximum allowed is ${h.maxFilesCount} files.`);return g}var se=C(()=>{"use strict";z();w();M();te();re();oe();P()});w();var L=class{constructor(){this.handlers=new Map}on(e,n){this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(n)}off(e,n){let a=this.handlers.get(e);a&&(a.delete(n),a.size===0&&this.handlers.delete(e))}emit(e,...n){let a=this.handlers.get(e);if(!a)return;let u=Array.from(a);for(let f of u)try{f(...n)}catch(h){a.delete(f),e!=="error"&&setTimeout(()=>{h instanceof Error?this.emit("error",h,String(e)):this.emit("error",new Error(String(h)),String(e))},0)}}transfer(e){this.handlers.forEach((n,a)=>{n.forEach(u=>{e.on(a,u)})})}clear(){this.handlers.clear()}};var S={DEPLOYMENTS:"/deployments",DOMAINS:"/domains",TOKENS:"/tokens",ACCOUNT:"/account",CONFIG:"/config",PING:"/ping",SPA_CHECK:"/spa-check"},qe=3e4,B=class extends L{constructor(e){super(),this.apiUrl=e.apiUrl||N,this.getAuthHeadersCallback=e.getAuthHeaders,this.timeout=e.timeout??qe,this.createDeployBody=e.createDeployBody}transferEventsTo(e){this.transfer(e)}async executeRequest(e,n,a){let u=this.mergeHeaders(n.headers),{signal:f,cleanup:h}=this.createTimeoutSignal(n.signal),g={...n,headers:u,credentials:u.Authorization?void 0:"include",signal:f};this.emit("request",e,g);try{let c=await fetch(e,g);return h(),c.ok||await this.handleResponseError(c,a),this.emit("response",this.safeClone(c),e),{data:await this.parseResponse(this.safeClone(c)),status:c.status}}catch(c){h();let y=c instanceof Error?c:new Error(String(c));this.emit("error",y,e),this.handleFetchError(c,a)}}async request(e,n,a){let{data:u}=await this.executeRequest(e,n,a);return u}async requestWithStatus(e,n,a){return this.executeRequest(e,n,a)}mergeHeaders(e={}){return{...e,...this.getAuthHeadersCallback()}}createTimeoutSignal(e){let n=new AbortController,a=setTimeout(()=>n.abort(),this.timeout);if(e){let u=()=>n.abort();e.addEventListener("abort",u),e.aborted&&n.abort()}return{signal:n.signal,cleanup:()=>clearTimeout(a)}}safeClone(e){try{return e.clone()}catch{return e}}async parseResponse(e){if(!(e.headers.get("Content-Length")==="0"||e.status===204))return e.json()}async handleResponseError(e,n){let a={};try{if(e.headers.get("content-type")?.includes("application/json")){let h=await e.json();if(h&&typeof h=="object"){let g=h;typeof g.message=="string"&&(a.message=g.message),typeof g.error=="string"&&(a.error=g.error)}}else a={message:await e.text()}}catch{a={message:"Failed to parse error response"}}let u=a.message||a.error||`${n} failed`;throw e.status===401?d.authentication(u):d.api(u,e.status)}handleFetchError(e,n){throw W(e)?e:e instanceof Error&&e.name==="AbortError"?d.cancelled(`${n} was cancelled`):e instanceof TypeError&&e.message.includes("fetch")?d.network(`${n} failed: ${e.message}`,e):e instanceof Error?d.business(`${n} failed: ${e.message}`):d.business(`${n} failed: Unknown error`)}async deploy(e,n={}){if(!e.length)throw d.business("No files to deploy");for(let h of e)if(!h.md5)throw d.file(`MD5 checksum missing for file: ${h.path}`,h.path);let{body:a,headers:u}=await this.createDeployBody(e,n.labels,n.via),f={};return n.deployToken?f.Authorization=`Bearer ${n.deployToken}`:n.apiKey&&(f.Authorization=`Bearer ${n.apiKey}`),n.caller&&(f["X-Caller"]=n.caller),this.request(`${n.apiUrl||this.apiUrl}${S.DEPLOYMENTS}`,{method:"POST",body:a,headers:{...u,...f},signal:n.signal||null},"Deploy")}async listDeployments(){return this.request(`${this.apiUrl}${S.DEPLOYMENTS}`,{method:"GET"},"List deployments")}async getDeployment(e){return this.request(`${this.apiUrl}${S.DEPLOYMENTS}/${encodeURIComponent(e)}`,{method:"GET"},"Get deployment")}async updateDeploymentLabels(e,n){return this.request(`${this.apiUrl}${S.DEPLOYMENTS}/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({labels:n})},"Update deployment labels")}async removeDeployment(e){await this.request(`${this.apiUrl}${S.DEPLOYMENTS}/${encodeURIComponent(e)}`,{method:"DELETE"},"Remove deployment")}async setDomain(e,n,a){let u={};n&&(u.deployment=n),a!==void 0&&(u.labels=a);let{data:f,status:h}=await this.requestWithStatus(`${this.apiUrl}${S.DOMAINS}/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)},"Set domain");return{...f,isCreate:h===201}}async listDomains(){return this.request(`${this.apiUrl}${S.DOMAINS}`,{method:"GET"},"List domains")}async getDomain(e){return this.request(`${this.apiUrl}${S.DOMAINS}/${encodeURIComponent(e)}`,{method:"GET"},"Get domain")}async removeDomain(e){await this.request(`${this.apiUrl}${S.DOMAINS}/${encodeURIComponent(e)}`,{method:"DELETE"},"Remove domain")}async verifyDomain(e){return this.request(`${this.apiUrl}${S.DOMAINS}/${encodeURIComponent(e)}/verify`,{method:"POST"},"Verify domain")}async getDomainDns(e){return this.request(`${this.apiUrl}${S.DOMAINS}/${encodeURIComponent(e)}/dns`,{method:"GET"},"Get domain DNS")}async getDomainRecords(e){return this.request(`${this.apiUrl}${S.DOMAINS}/${encodeURIComponent(e)}/records`,{method:"GET"},"Get domain records")}async getDomainShare(e){return this.request(`${this.apiUrl}${S.DOMAINS}/${encodeURIComponent(e)}/share`,{method:"GET"},"Get domain share")}async validateDomain(e){return this.request(`${this.apiUrl}${S.DOMAINS}/validate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({domain:e})},"Validate domain")}async createToken(e,n){let a={};return e!==void 0&&(a.ttl=e),n!==void 0&&(a.labels=n),this.request(`${this.apiUrl}${S.TOKENS}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)},"Create token")}async listTokens(){return this.request(`${this.apiUrl}${S.TOKENS}`,{method:"GET"},"List tokens")}async removeToken(e){await this.request(`${this.apiUrl}${S.TOKENS}/${encodeURIComponent(e)}`,{method:"DELETE"},"Remove token")}async getAccount(){return this.request(`${this.apiUrl}${S.ACCOUNT}`,{method:"GET"},"Get account")}async getConfig(){return this.request(`${this.apiUrl}${S.CONFIG}`,{method:"GET"},"Get config")}async ping(){return(await this.request(`${this.apiUrl}${S.PING}`,{method:"GET"},"Ping"))?.success||!1}async checkSPA(e){let n=e.find(h=>h.path==="index.html"||h.path==="/index.html");if(!n||n.size>100*1024)return!1;let a;if(typeof Buffer<"u"&&Buffer.isBuffer(n.content))a=n.content.toString("utf-8");else if(typeof Blob<"u"&&n.content instanceof Blob)a=await n.content.text();else if(typeof File<"u"&&n.content instanceof File)a=await n.content.text();else return!1;let u={files:e.map(h=>h.path),index:a};return(await this.request(`${this.apiUrl}${S.SPA_CHECK}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)},"SPA check")).isSPA}};w();P();w();w();function de(i={},e={}){let n={apiUrl:i.apiUrl||e.apiUrl||N,apiKey:i.apiKey!==void 0?i.apiKey:e.apiKey,deployToken:i.deployToken!==void 0?i.deployToken:e.deployToken},a={apiUrl:n.apiUrl};return n.apiKey!==void 0&&(a.apiKey=n.apiKey),n.deployToken!==void 0&&(a.deployToken=n.deployToken),a}function me(i,e){let n={...i};return n.apiUrl===void 0&&e.apiUrl!==void 0&&(n.apiUrl=e.apiUrl),n.apiKey===void 0&&e.apiKey!==void 0&&(n.apiKey=e.apiKey),n.deployToken===void 0&&e.deployToken!==void 0&&(n.deployToken=e.deployToken),n.timeout===void 0&&e.timeout!==void 0&&(n.timeout=e.timeout),n.maxConcurrency===void 0&&e.maxConcurrency!==void 0&&(n.maxConcurrency=e.maxConcurrency),n.onProgress===void 0&&e.onProgress!==void 0&&(n.onProgress=e.onProgress),n.caller===void 0&&e.caller!==void 0&&(n.caller=e.caller),n}w();z();async function We(){let e=JSON.stringify({rewrites:[{source:"/(.*)",destination:"/index.html"}]},null,2),n;typeof Buffer<"u"?n=Buffer.from(e,"utf-8"):n=new Blob([e],{type:"application/json"});let{md5:a}=await k(n);return{path:J,content:n,size:e.length,md5:a}}async function Se(i,e,n){if(n.spaDetect===!1||i.some(a=>a.path===J))return i;try{if(await e.checkSPA(i)){let u=await We();return[...i,u]}}catch{}return i}function Ee(i){let{getApi:e,ensureInit:n,processInput:a,clientDefaults:u,hasAuth:f}=i;return{create:async(h,g={})=>{await n();let c=u?me(g,u):g;if(f&&!f()&&!c.deployToken&&!c.apiKey)throw d.authentication("Authentication credentials are required for deployment. Please call setDeployToken() or setApiKey() first, or pass credentials in the deployment options.");if(!a)throw d.config("processInput function is not provided.");let y=e(),m=await a(h,c);return m=await Se(m,y,c),y.deploy(m,c)},list:async()=>(await n(),e().listDeployments()),get:async h=>(await n(),e().getDeployment(h)),set:async(h,g)=>(await n(),e().updateDeploymentLabels(h,g.labels)),remove:async h=>{await n(),await e().removeDeployment(h)}}}function ve(i){let{getApi:e,ensureInit:n}=i;return{set:async(a,u={})=>(await n(),e().setDomain(a,u.deployment,u.labels)),list:async()=>(await n(),e().listDomains()),get:async a=>(await n(),e().getDomain(a)),remove:async a=>{await n(),await e().removeDomain(a)},verify:async a=>(await n(),e().verifyDomain(a)),validate:async a=>(await n(),e().validateDomain(a)),dns:async a=>(await n(),e().getDomainDns(a)),records:async a=>(await n(),e().getDomainRecords(a)),share:async a=>(await n(),e().getDomainShare(a))}}function we(i){let{getApi:e,ensureInit:n}=i;return{get:async()=>(await n(),e().getAccount())}}function Re(i){let{getApi:e,ensureInit:n}=i;return{create:async(a={})=>(await n(),e().createToken(a.ttl,a.labels)),list:async()=>(await n(),e().listTokens()),remove:async a=>{await n(),await e().removeToken(a)}}}var K=class{constructor(e={}){this.initPromise=null;this._config=null;this.auth=null;this.clientOptions=e,e.deployToken?this.auth={type:"token",value:e.deployToken}:e.apiKey&&(this.auth={type:"apiKey",value:e.apiKey}),this.authHeadersCallback=()=>this.getAuthHeaders();let n=this.resolveInitialConfig(e);this.http=new B({...e,...n,getAuthHeaders:this.authHeadersCallback,createDeployBody:this.getDeployBodyCreator()});let a={getApi:()=>this.http,ensureInit:()=>this.ensureInitialized()};this._deployments=Ee({...a,processInput:(u,f)=>this.processInput(u,f),clientDefaults:this.clientOptions,hasAuth:()=>this.hasAuth()}),this._domains=ve(a),this._account=we(a),this._tokens=Re(a)}async ensureInitialized(){return this.initPromise||(this.initPromise=this.loadFullConfig()),this.initPromise}async ping(){return await this.ensureInitialized(),this.http.ping()}async deploy(e,n){return this.deployments.create(e,n)}async whoami(){return this.account.get()}get deployments(){return this._deployments}get domains(){return this._domains}get account(){return this._account}get tokens(){return this._tokens}async getConfig(){return this._config?this._config:(await this.ensureInitialized(),this._config=F(),this._config)}on(e,n){this.http.on(e,n)}off(e,n){this.http.off(e,n)}replaceHttpClient(e){if(this.http?.transferEventsTo)try{this.http.transferEventsTo(e)}catch(n){console.warn("Event transfer failed during client replacement:",n)}this.http=e}setDeployToken(e){if(!e||typeof e!="string")throw d.business("Invalid deploy token provided. Deploy token must be a non-empty string.");this.auth={type:"token",value:e}}setApiKey(e){if(!e||typeof e!="string")throw d.business("Invalid API key provided. API key must be a non-empty string.");this.auth={type:"apiKey",value:e}}getAuthHeaders(){return this.auth?{Authorization:`Bearer ${this.auth.value}`}:{}}hasAuth(){return this.clientOptions.useCredentials?!0:this.auth!==null}};P();w();w();async function Ce(i,e,n){let a=new FormData,u=[];for(let f of i){if(!(f.content instanceof File||f.content instanceof Blob))throw d.file(`Unsupported file.content type for browser: ${f.path}`,f.path);if(!f.md5)throw d.file(`File missing md5 checksum: ${f.path}`,f.path);let h=new File([f.content],f.path,{type:"application/octet-stream"});a.append("files[]",h),u.push(f.md5)}return a.append("checksums",JSON.stringify(u)),e&&e.length>0&&a.append("labels",JSON.stringify(e)),n&&a.append("via",n),{body:a,headers:{}}}z();function Jt(i,e,n,a=!0){let u=i===1?e:n;return a?`${i} ${u}`:u}te();re();M();w();function ie(i,e=1){if(i===0)return"0 Bytes";let n=1024,a=["Bytes","KB","MB","GB"],u=Math.floor(Math.log(i)/Math.log(n));return parseFloat((i/Math.pow(n,u)).toFixed(e))+" "+a[u]}function et(i){if(/[?&#%<>\[\]{}|\\^~`;$()'"*\r\n\t]/.test(i))return{valid:!1,reason:"File name contains unsafe characters"};if(i.startsWith(" ")||i.endsWith(" "))return{valid:!1,reason:"File name cannot start/end with spaces"};if(i.endsWith("."))return{valid:!1,reason:"File name cannot end with dots"};let n=/^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(\.|$)/i,a=i.split("/").pop()||i;return n.test(a)?{valid:!1,reason:"File name uses a reserved system name"}:i.includes("..")?{valid:!1,reason:"File name contains path traversal pattern"}:{valid:!0}}function sn(i,e){let n=[],a=[],u=[];if(i.length===0){let c={file:"(no files)",message:"At least one file must be provided"};return n.push(c),{files:[],validFiles:[],errors:n,warnings:[],canDeploy:!1}}if(i.length>e.maxFilesCount){let c={file:`(${i.length} files)`,message:`File count (${i.length}) exceeds limit of ${e.maxFilesCount}`};return n.push(c),{files:i.map(y=>({...y,status:E.VALIDATION_FAILED,statusMessage:c.message})),validFiles:[],errors:n,warnings:[],canDeploy:!1}}let f=0;for(let c of i){let y=E.READY,m="Ready for upload",R=c.name?et(c.name):{valid:!1,reason:"File name cannot be empty"};if(c.status===E.PROCESSING_ERROR)y=E.VALIDATION_FAILED,m=c.statusMessage||"File failed during processing",n.push({file:c.name,message:m});else if(c.size===0){y=E.EXCLUDED,m="File is empty (0 bytes) and cannot be deployed due to storage limitations",a.push({file:c.name,message:m}),u.push({...c,status:y,statusMessage:m});continue}else c.size<0?(y=E.VALIDATION_FAILED,m="File size must be positive",n.push({file:c.name,message:m})):!c.name||c.name.trim().length===0?(y=E.VALIDATION_FAILED,m="File name cannot be empty",n.push({file:c.name||"(empty)",message:m})):c.name.includes("\0")?(y=E.VALIDATION_FAILED,m="File name contains invalid characters (null byte)",n.push({file:c.name,message:m})):R.valid?fe(c.name)?(y=E.VALIDATION_FAILED,m=`File extension not allowed: "${c.name}"`,n.push({file:c.name,message:m})):c.size>e.maxFileSize?(y=E.VALIDATION_FAILED,m=`File size (${ie(c.size)}) exceeds limit of ${ie(e.maxFileSize)}`,n.push({file:c.name,message:m})):(f+=c.size,f>e.maxTotalSize&&(y=E.VALIDATION_FAILED,m=`Total size would exceed limit of ${ie(e.maxTotalSize)}`,n.push({file:c.name,message:m}))):(y=E.VALIDATION_FAILED,m=R.reason||"Invalid file name",n.push({file:c.name,message:m}));u.push({...c,status:y,statusMessage:m})}n.length>0&&(u=u.map(c=>c.status===E.EXCLUDED?c:{...c,status:E.VALIDATION_FAILED,statusMessage:c.status===E.VALIDATION_FAILED?c.statusMessage:"Deployment failed due to validation errors in bundle"}));let h=n.length===0?u.filter(c=>c.status===E.READY):[],g=n.length===0;return{files:u,validFiles:h,errors:n,warnings:a,canDeploy:g}}function tt(i){return i.filter(e=>e.status===E.READY)}function an(i){return tt(i).length>0}oe();w();P();se();var ae=class extends K{constructor(e={}){super(e)}resolveInitialConfig(e){return de(e,{})}async loadFullConfig(){try{let e=await this.http.getConfig();Q(e)}catch(e){throw this.initPromise=null,e}}async processInput(e,n){if(!this.isFileArray(e))throw d.business("Invalid input type for browser environment. Expected File[].");if(e.length===0)throw d.business("No files to deploy.");let{processFilesForBrowser:a}=await Promise.resolve().then(()=>(se(),_e));return a(e,n)}isFileArray(e){return Array.isArray(e)&&e.every(n=>n instanceof File)}getDeployBodyCreator(){return Ce}},Bn=ae;export{j as API_KEY_HEX_LENGTH,st as API_KEY_HINT_LENGTH,T as API_KEY_PREFIX,ue as API_KEY_TOTAL_LENGTH,ot as AccountPlan,B as ApiHttp,at as AuthMethod,He as BLOCKED_EXTENSIONS,N as DEFAULT_API,J as DEPLOYMENT_CONFIG_FILENAME,Y as DEPLOY_TOKEN_HEX_LENGTH,I as DEPLOY_TOKEN_PREFIX,ce as DEPLOY_TOKEN_TOTAL_LENGTH,rt as DeploymentStatus,it as DomainStatus,A as ErrorType,E as FILE_VALIDATION_STATUS,E as FileValidationStatus,Qe as JUNK_DIRECTORIES,yt as LABEL_CONSTRAINTS,gt as LABEL_PATTERN,ae as Ship,d as ShipError,Ft as __setTestEnvironment,an as allValidFilesReady,k as calculateMD5,we as createAccountResource,Ee as createDeploymentResource,ve as createDomainResource,Re as createTokenResource,Bn as default,At as deserializeLabels,ht as extractSubdomain,Te as filterJunk,ie as formatFileSize,dt as generateDeploymentUrl,mt as generateDomainUrl,F as getCurrentConfig,U as getENV,tt as getValidFiles,fe as isBlockedExtension,ft as isCustomDomain,ct as isDeployment,he as isPlatformDomain,W as isShipError,me as mergeDeployOptions,Fe as optimizeDeployPaths,Jt as pluralize,Oe as processFilesForBrowser,de as resolveConfig,Dt as serializeLabels,Q as setPlatformConfig,pt as validateApiKey,ut as validateApiUrl,Pe as validateDeployPath,lt as validateDeployToken,sn as validateFiles};
1
+ var Me=Object.create;var _=Object.defineProperty;var ke=Object.getOwnPropertyDescriptor;var ze=Object.getOwnPropertyNames;var Ke=Object.getPrototypeOf,Ve=Object.prototype.hasOwnProperty;var He=(i,e,t)=>e in i?_(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var R=(i,e)=>()=>(i&&(e=i(i=0)),e);var fe=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),qe=(i,e)=>{for(var t in e)_(i,t,{get:e[t],enumerable:!0})},Ge=(i,e,t,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of ze(e))!Ve.call(i,u)&&u!==t&&_(i,u,{get:()=>e[u],enumerable:!(a=ke(e,u))||a.enumerable});return i};var G=(i,e,t)=>(t=i!=null?Me(Ke(i)):{},Ge(e||!i||!i.__esModule?_(t,"default",{value:i,enumerable:!0}):t,i));var $=(i,e,t)=>He(i,typeof e!="symbol"?e+"":e,t);function J(i){return i!==null&&typeof i=="object"&&"name"in i&&i.name==="ShipError"&&"status"in i}function N(i){let e=i.lastIndexOf(".");if(e===-1||e===i.length-1)return!1;let t=i.slice(e+1).toLowerCase();return je.has(t)}function ut(i){if(!i.startsWith(T))throw d.validation(`API key must start with "${T}"`);if(i.length!==he)throw d.validation(`API key must be ${he} characters total (${T} + ${Y} hex chars)`);let e=i.slice(T.length);if(!/^[a-f0-9]{64}$/i.test(e))throw d.validation(`API key must contain ${Y} hexadecimal characters after "${T}" prefix`)}function ct(i){if(!i.startsWith(I))throw d.validation(`Deploy token must start with "${I}"`);if(i.length!==de)throw d.validation(`Deploy token must be ${de} characters total (${I} + ${W} hex chars)`);let e=i.slice(I.length);if(!/^[a-f0-9]{64}$/i.test(e))throw d.validation(`Deploy token must contain ${W} hexadecimal characters after "${I}" prefix`)}function ft(i){try{let e=new URL(i);if(!["http:","https:"].includes(e.protocol))throw d.validation("API URL must use http:// or https:// protocol");if(e.pathname!=="/"&&e.pathname!=="")throw d.validation("API URL must not contain a path");if(e.search||e.hash)throw d.validation("API URL must not contain query parameters or fragments")}catch(e){throw J(e)?e:d.validation("API URL must be a valid URL")}}function ht(i){return/^[a-z]+-[a-z]+-[a-z0-9]{7}$/i.test(i)}function me(i,e){return i.endsWith(`.${e}`)}function dt(i,e){return!me(i,e)}function mt(i,e){return me(i,e)?i.slice(0,-(e.length+1)):null}function yt(i,e){return`https://${i}.${e||"shipstatic.com"}`}function gt(i){return`https://${i}`}function St(i){return!i||i.length===0?null:JSON.stringify(i)}function vt(i){if(!i)return[];try{let e=JSON.parse(i);return Array.isArray(e)?e:[]}catch{return[]}}var ot,st,at,A,j,d,je,T,Y,he,lt,I,W,de,pt,X,L,v,Dt,At,x=R(()=>{"use strict";ot={PENDING:"pending",SUCCESS:"success",FAILED:"failed",DELETING:"deleting"},st={PENDING:"pending",PARTIAL:"partial",SUCCESS:"success",PAUSED:"paused"},at={FREE:"free",STANDARD:"standard",SPONSORED:"sponsored",ENTERPRISE:"enterprise",SUSPENDED:"suspended",TERMINATING:"terminating",TERMINATED:"terminated"};(function(i){i.Validation="validation_failed",i.NotFound="not_found",i.RateLimit="rate_limit_exceeded",i.Authentication="authentication_failed",i.Business="business_logic_error",i.Api="internal_server_error",i.Network="network_error",i.Cancelled="operation_cancelled",i.File="file_error",i.Config="config_error"})(A||(A={}));j={client:new Set([A.Business,A.Config,A.File,A.Validation]),network:new Set([A.Network]),auth:new Set([A.Authentication])},d=class i extends Error{constructor(t,a,u,c){super(a);$(this,"type");$(this,"status");$(this,"details");this.type=t,this.status=u,this.details=c,this.name="ShipError"}toResponse(){let t=this.type===A.Authentication&&this.details?.internal?void 0:this.details;return{error:this.type,message:this.message,status:this.status,details:t}}static fromResponse(t){return new i(t.error,t.message,t.status,t.details)}static validation(t,a){return new i(A.Validation,t,400,a)}static notFound(t,a){let u=a?`${t} ${a} not found`:`${t} not found`;return new i(A.NotFound,u,404)}static rateLimit(t="Too many requests"){return new i(A.RateLimit,t,429)}static authentication(t="Authentication required",a){return new i(A.Authentication,t,401,a)}static business(t,a=400){return new i(A.Business,t,a)}static network(t,a){return new i(A.Network,t,void 0,{cause:a})}static cancelled(t){return new i(A.Cancelled,t)}static file(t,a){return new i(A.File,t,void 0,{filePath:a})}static config(t,a){return new i(A.Config,t,void 0,a)}static api(t,a=500){return new i(A.Api,t,a)}static database(t,a=500){return new i(A.Api,t,a)}static storage(t,a=500){return new i(A.Api,t,a)}get filePath(){return this.details?.filePath}isClientError(){return j.client.has(this.type)}isNetworkError(){return j.network.has(this.type)}isAuthError(){return j.auth.has(this.type)}isValidationError(){return this.type===A.Validation}isFileError(){return this.type===A.File}isConfigError(){return this.type===A.Config}isType(t){return this.type===t}};je=new Set(["exe","msi","dll","scr","bat","cmd","com","pif","app","deb","rpm","pkg","mpkg","dmg","iso","img","cab","cpl","chm","ps1","vbs","vbe","ws","wsf","wsc","wsh","reg","jar","jnlp","apk","crx","lnk","inf","hta"]);T="ship-",Y=64,he=T.length+Y,lt=4,I="token-",W=64,de=I.length+W,pt={JWT:"jwt",API_KEY:"apiKey",TOKEN:"token",WEBHOOK:"webhook",SYSTEM:"system"},X="ship.json";L="https://api.shipstatic.com",v={PENDING:"pending",PROCESSING_ERROR:"processing_error",EXCLUDED:"excluded",VALIDATION_FAILED:"validation_failed",READY:"ready"};Dt={MIN_LENGTH:3,MAX_LENGTH:25,MAX_COUNT:10,SEPARATORS:"._-"},At=/^[a-z0-9]+(?:[._-][a-z0-9]+)*$/});function Z(i){Q=i}function F(){if(Q===null)throw d.config("Platform configuration not initialized. The SDK must fetch configuration from the API before performing operations.");return Q}var Q,P=R(()=>{"use strict";x();Q=null});function Ot(i){ee=i}function We(){return typeof process<"u"&&process.versions&&process.versions.node?"node":typeof window<"u"||typeof self<"u"?"browser":"unknown"}function M(){return ee||We()}var ee,k=R(()=>{"use strict";ee=null});var Se=fe((De,Ae)=>{"use strict";(function(i){if(typeof De=="object")Ae.exports=i();else if(typeof define=="function"&&define.amd)define(i);else{var e;try{e=window}catch{e=self}e.SparkMD5=i()}})(function(i){"use strict";var e=function(p,l){return p+l&4294967295},t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function a(p,l,r,n,s,o){return l=e(e(l,p),e(n,o)),e(l<<s|l>>>32-s,r)}function u(p,l){var r=p[0],n=p[1],s=p[2],o=p[3];r+=(n&s|~n&o)+l[0]-680876936|0,r=(r<<7|r>>>25)+n|0,o+=(r&n|~r&s)+l[1]-389564586|0,o=(o<<12|o>>>20)+r|0,s+=(o&r|~o&n)+l[2]+606105819|0,s=(s<<17|s>>>15)+o|0,n+=(s&o|~s&r)+l[3]-1044525330|0,n=(n<<22|n>>>10)+s|0,r+=(n&s|~n&o)+l[4]-176418897|0,r=(r<<7|r>>>25)+n|0,o+=(r&n|~r&s)+l[5]+1200080426|0,o=(o<<12|o>>>20)+r|0,s+=(o&r|~o&n)+l[6]-1473231341|0,s=(s<<17|s>>>15)+o|0,n+=(s&o|~s&r)+l[7]-45705983|0,n=(n<<22|n>>>10)+s|0,r+=(n&s|~n&o)+l[8]+1770035416|0,r=(r<<7|r>>>25)+n|0,o+=(r&n|~r&s)+l[9]-1958414417|0,o=(o<<12|o>>>20)+r|0,s+=(o&r|~o&n)+l[10]-42063|0,s=(s<<17|s>>>15)+o|0,n+=(s&o|~s&r)+l[11]-1990404162|0,n=(n<<22|n>>>10)+s|0,r+=(n&s|~n&o)+l[12]+1804603682|0,r=(r<<7|r>>>25)+n|0,o+=(r&n|~r&s)+l[13]-40341101|0,o=(o<<12|o>>>20)+r|0,s+=(o&r|~o&n)+l[14]-1502002290|0,s=(s<<17|s>>>15)+o|0,n+=(s&o|~s&r)+l[15]+1236535329|0,n=(n<<22|n>>>10)+s|0,r+=(n&o|s&~o)+l[1]-165796510|0,r=(r<<5|r>>>27)+n|0,o+=(r&s|n&~s)+l[6]-1069501632|0,o=(o<<9|o>>>23)+r|0,s+=(o&n|r&~n)+l[11]+643717713|0,s=(s<<14|s>>>18)+o|0,n+=(s&r|o&~r)+l[0]-373897302|0,n=(n<<20|n>>>12)+s|0,r+=(n&o|s&~o)+l[5]-701558691|0,r=(r<<5|r>>>27)+n|0,o+=(r&s|n&~s)+l[10]+38016083|0,o=(o<<9|o>>>23)+r|0,s+=(o&n|r&~n)+l[15]-660478335|0,s=(s<<14|s>>>18)+o|0,n+=(s&r|o&~r)+l[4]-405537848|0,n=(n<<20|n>>>12)+s|0,r+=(n&o|s&~o)+l[9]+568446438|0,r=(r<<5|r>>>27)+n|0,o+=(r&s|n&~s)+l[14]-1019803690|0,o=(o<<9|o>>>23)+r|0,s+=(o&n|r&~n)+l[3]-187363961|0,s=(s<<14|s>>>18)+o|0,n+=(s&r|o&~r)+l[8]+1163531501|0,n=(n<<20|n>>>12)+s|0,r+=(n&o|s&~o)+l[13]-1444681467|0,r=(r<<5|r>>>27)+n|0,o+=(r&s|n&~s)+l[2]-51403784|0,o=(o<<9|o>>>23)+r|0,s+=(o&n|r&~n)+l[7]+1735328473|0,s=(s<<14|s>>>18)+o|0,n+=(s&r|o&~r)+l[12]-1926607734|0,n=(n<<20|n>>>12)+s|0,r+=(n^s^o)+l[5]-378558|0,r=(r<<4|r>>>28)+n|0,o+=(r^n^s)+l[8]-2022574463|0,o=(o<<11|o>>>21)+r|0,s+=(o^r^n)+l[11]+1839030562|0,s=(s<<16|s>>>16)+o|0,n+=(s^o^r)+l[14]-35309556|0,n=(n<<23|n>>>9)+s|0,r+=(n^s^o)+l[1]-1530992060|0,r=(r<<4|r>>>28)+n|0,o+=(r^n^s)+l[4]+1272893353|0,o=(o<<11|o>>>21)+r|0,s+=(o^r^n)+l[7]-155497632|0,s=(s<<16|s>>>16)+o|0,n+=(s^o^r)+l[10]-1094730640|0,n=(n<<23|n>>>9)+s|0,r+=(n^s^o)+l[13]+681279174|0,r=(r<<4|r>>>28)+n|0,o+=(r^n^s)+l[0]-358537222|0,o=(o<<11|o>>>21)+r|0,s+=(o^r^n)+l[3]-722521979|0,s=(s<<16|s>>>16)+o|0,n+=(s^o^r)+l[6]+76029189|0,n=(n<<23|n>>>9)+s|0,r+=(n^s^o)+l[9]-640364487|0,r=(r<<4|r>>>28)+n|0,o+=(r^n^s)+l[12]-421815835|0,o=(o<<11|o>>>21)+r|0,s+=(o^r^n)+l[15]+530742520|0,s=(s<<16|s>>>16)+o|0,n+=(s^o^r)+l[2]-995338651|0,n=(n<<23|n>>>9)+s|0,r+=(s^(n|~o))+l[0]-198630844|0,r=(r<<6|r>>>26)+n|0,o+=(n^(r|~s))+l[7]+1126891415|0,o=(o<<10|o>>>22)+r|0,s+=(r^(o|~n))+l[14]-1416354905|0,s=(s<<15|s>>>17)+o|0,n+=(o^(s|~r))+l[5]-57434055|0,n=(n<<21|n>>>11)+s|0,r+=(s^(n|~o))+l[12]+1700485571|0,r=(r<<6|r>>>26)+n|0,o+=(n^(r|~s))+l[3]-1894986606|0,o=(o<<10|o>>>22)+r|0,s+=(r^(o|~n))+l[10]-1051523|0,s=(s<<15|s>>>17)+o|0,n+=(o^(s|~r))+l[1]-2054922799|0,n=(n<<21|n>>>11)+s|0,r+=(s^(n|~o))+l[8]+1873313359|0,r=(r<<6|r>>>26)+n|0,o+=(n^(r|~s))+l[15]-30611744|0,o=(o<<10|o>>>22)+r|0,s+=(r^(o|~n))+l[6]-1560198380|0,s=(s<<15|s>>>17)+o|0,n+=(o^(s|~r))+l[13]+1309151649|0,n=(n<<21|n>>>11)+s|0,r+=(s^(n|~o))+l[4]-145523070|0,r=(r<<6|r>>>26)+n|0,o+=(n^(r|~s))+l[11]-1120210379|0,o=(o<<10|o>>>22)+r|0,s+=(r^(o|~n))+l[2]+718787259|0,s=(s<<15|s>>>17)+o|0,n+=(o^(s|~r))+l[9]-343485551|0,n=(n<<21|n>>>11)+s|0,p[0]=r+p[0]|0,p[1]=n+p[1]|0,p[2]=s+p[2]|0,p[3]=o+p[3]|0}function c(p){var l=[],r;for(r=0;r<64;r+=4)l[r>>2]=p.charCodeAt(r)+(p.charCodeAt(r+1)<<8)+(p.charCodeAt(r+2)<<16)+(p.charCodeAt(r+3)<<24);return l}function h(p){var l=[],r;for(r=0;r<64;r+=4)l[r>>2]=p[r]+(p[r+1]<<8)+(p[r+2]<<16)+(p[r+3]<<24);return l}function g(p){var l=p.length,r=[1732584193,-271733879,-1732584194,271733878],n,s,o,E,C,b;for(n=64;n<=l;n+=64)u(r,c(p.substring(n-64,n)));for(p=p.substring(n-64),s=p.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0;n<s;n+=1)o[n>>2]|=p.charCodeAt(n)<<(n%4<<3);if(o[n>>2]|=128<<(n%4<<3),n>55)for(u(r,o),n=0;n<16;n+=1)o[n]=0;return E=l*8,E=E.toString(16).match(/(.*?)(.{0,8})$/),C=parseInt(E[2],16),b=parseInt(E[1],16)||0,o[14]=C,o[15]=b,u(r,o),r}function f(p){var l=p.length,r=[1732584193,-271733879,-1732584194,271733878],n,s,o,E,C,b;for(n=64;n<=l;n+=64)u(r,h(p.subarray(n-64,n)));for(p=n-64<l?p.subarray(n-64):new Uint8Array(0),s=p.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0;n<s;n+=1)o[n>>2]|=p[n]<<(n%4<<3);if(o[n>>2]|=128<<(n%4<<3),n>55)for(u(r,o),n=0;n<16;n+=1)o[n]=0;return E=l*8,E=E.toString(16).match(/(.*?)(.{0,8})$/),C=parseInt(E[2],16),b=parseInt(E[1],16)||0,o[14]=C,o[15]=b,u(r,o),r}function y(p){var l="",r;for(r=0;r<4;r+=1)l+=t[p>>r*8+4&15]+t[p>>r*8&15];return l}function m(p){var l;for(l=0;l<p.length;l+=1)p[l]=y(p[l]);return p.join("")}m(g("hello"))!=="5d41402abc4b2a76b9719d911017c592"&&(e=function(p,l){var r=(p&65535)+(l&65535),n=(p>>16)+(l>>16)+(r>>16);return n<<16|r&65535}),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&(function(){function p(l,r){return l=l|0||0,l<0?Math.max(l+r,0):Math.min(l,r)}ArrayBuffer.prototype.slice=function(l,r){var n=this.byteLength,s=p(l,n),o=n,E,C,b,ce;return r!==i&&(o=p(r,n)),s>o?new ArrayBuffer(0):(E=o-s,C=new ArrayBuffer(E),b=new Uint8Array(C),ce=new Uint8Array(this,s,E),b.set(ce),C)}})();function w(p){return/[\u0080-\uFFFF]/.test(p)&&(p=unescape(encodeURIComponent(p))),p}function q(p,l){var r=p.length,n=new ArrayBuffer(r),s=new Uint8Array(n),o;for(o=0;o<r;o+=1)s[o]=p.charCodeAt(o);return l?s:n}function Be(p){return String.fromCharCode.apply(null,new Uint8Array(p))}function Ue(p,l,r){var n=new Uint8Array(p.byteLength+l.byteLength);return n.set(new Uint8Array(p)),n.set(new Uint8Array(l),p.byteLength),r?n:n.buffer}function O(p){var l=[],r=p.length,n;for(n=0;n<r-1;n+=2)l.push(parseInt(p.substr(n,2),16));return String.fromCharCode.apply(String,l)}function D(){this.reset()}return D.prototype.append=function(p){return this.appendBinary(w(p)),this},D.prototype.appendBinary=function(p){this._buff+=p,this._length+=p.length;var l=this._buff.length,r;for(r=64;r<=l;r+=64)u(this._hash,c(this._buff.substring(r-64,r)));return this._buff=this._buff.substring(r-64),this},D.prototype.end=function(p){var l=this._buff,r=l.length,n,s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],o;for(n=0;n<r;n+=1)s[n>>2]|=l.charCodeAt(n)<<(n%4<<3);return this._finish(s,r),o=m(this._hash),p&&(o=O(o)),this.reset(),o},D.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},D.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},D.prototype.setState=function(p){return this._buff=p.buff,this._length=p.length,this._hash=p.hash,this},D.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},D.prototype._finish=function(p,l){var r=l,n,s,o;if(p[r>>2]|=128<<(r%4<<3),r>55)for(u(this._hash,p),r=0;r<16;r+=1)p[r]=0;n=this._length*8,n=n.toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(n[2],16),o=parseInt(n[1],16)||0,p[14]=s,p[15]=o,u(this._hash,p)},D.hash=function(p,l){return D.hashBinary(w(p),l)},D.hashBinary=function(p,l){var r=g(p),n=m(r);return l?O(n):n},D.ArrayBuffer=function(){this.reset()},D.ArrayBuffer.prototype.append=function(p){var l=Ue(this._buff.buffer,p,!0),r=l.length,n;for(this._length+=p.byteLength,n=64;n<=r;n+=64)u(this._hash,h(l.subarray(n-64,n)));return this._buff=n-64<r?new Uint8Array(l.buffer.slice(n-64)):new Uint8Array(0),this},D.ArrayBuffer.prototype.end=function(p){var l=this._buff,r=l.length,n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],s,o;for(s=0;s<r;s+=1)n[s>>2]|=l[s]<<(s%4<<3);return this._finish(n,r),o=m(this._hash),p&&(o=O(o)),this.reset(),o},D.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},D.ArrayBuffer.prototype.getState=function(){var p=D.prototype.getState.call(this);return p.buff=Be(p.buff),p},D.ArrayBuffer.prototype.setState=function(p){return p.buff=q(p.buff,!0),D.prototype.setState.call(this,p)},D.ArrayBuffer.prototype.destroy=D.prototype.destroy,D.ArrayBuffer.prototype._finish=D.prototype._finish,D.ArrayBuffer.hash=function(p,l){var r=f(new Uint8Array(p)),n=m(r);return l?O(n):n},D})});var te=fe(($t,ve)=>{"use strict";ve.exports={}});async function Je(i){let e=(await Promise.resolve().then(()=>G(Se(),1))).default;return new Promise((t,a)=>{let c=Math.ceil(i.size/2097152),h=0,g=new e.ArrayBuffer,f=new FileReader,y=()=>{let m=h*2097152,w=Math.min(m+2097152,i.size);f.readAsArrayBuffer(i.slice(m,w))};f.onload=m=>{let w=m.target?.result;if(!w){a(d.business("Failed to read file chunk"));return}g.append(w),h++,h<c?y():t({md5:g.end()})},f.onerror=()=>{a(d.business("Failed to calculate MD5: FileReader error"))},y()})}async function Xe(i){let e=await Promise.resolve().then(()=>G(te(),1));if(Buffer.isBuffer(i)){let a=e.createHash("md5");return a.update(i),{md5:a.digest("hex")}}let t=await Promise.resolve().then(()=>G(te(),1));return new Promise((a,u)=>{let c=e.createHash("md5"),h=t.createReadStream(i);h.on("error",g=>u(d.business(`Failed to read file for MD5: ${g.message}`))),h.on("data",g=>c.update(g)),h.on("end",()=>a({md5:c.digest("hex")}))})}async function z(i){let e=M();if(e==="browser"){if(!(i instanceof Blob))throw d.business("Invalid input for browser MD5 calculation: Expected Blob or File.");return Je(i)}if(e==="node"){if(!(Buffer.isBuffer(i)||typeof i=="string"))throw d.business("Invalid input for Node.js MD5 calculation: Expected Buffer or file path string.");return Xe(i)}throw d.business("Unknown or unsupported execution environment for MD5 calculation.")}var K=R(()=>{"use strict";k();x()});function Te(i){return et.test(i)}var Ze,et,Ie=R(()=>{"use strict";Ze=["^npm-debug\\.log$","^\\..*\\.swp$","^\\.DS_Store$","^\\.AppleDouble$","^\\.LSOverride$","^Icon\\r$","^\\._.*","^\\.Spotlight-V100(?:$|\\/)","\\.Trashes","^__MACOSX$","~$","^Thumbs\\.db$","^ehthumbs\\.db$","^[Dd]esktop\\.ini$","@eaDir$"],et=new RegExp(Ze.join("|"))});function Fe(i){return!i||i.length===0?[]:i.filter(e=>{if(!e)return!1;let t=e.replace(/\\/g,"/").split("/").filter(Boolean);if(t.length===0)return!0;let a=t[t.length-1];if(Te(a))return!1;for(let c=0;c<t.length;c++){let h=t[c];if(!(h===".well-known"&&c===0)&&(h.startsWith(".")||h.length>255))return!1}let u=t.slice(0,-1);for(let c of u)if(tt.some(h=>c.toLowerCase()===h.toLowerCase()))return!1;return!0})}var tt,ne=R(()=>{"use strict";Ie();tt=["__MACOSX",".Trashes",".fseventsd",".Spotlight-V100"]});function H(i){return i.replace(/\\/g,"/").replace(/\/+/g,"/").replace(/^\/+/,"")}var Pe=R(()=>{"use strict"});function Oe(i,e={}){if(e.flatten===!1)return i.map(a=>({path:H(a),name:re(a)}));let t=nt(i);return i.map(a=>{let u=H(a);if(t){let c=t.endsWith("/")?t:`${t}/`;u.startsWith(c)&&(u=u.substring(c.length))}return u||(u=re(a)),{path:u,name:re(a)}})}function nt(i){if(!i.length)return"";let t=i.map(c=>H(c)).map(c=>c.split("/")),a=[],u=Math.min(...t.map(c=>c.length));for(let c=0;c<u-1;c++){let h=t[0][c];if(t.every(g=>g[c]===h))a.push(h);else break}return a.join("/")}function re(i){return i.split(/[/\\]/).pop()||i}var ie=R(()=>{"use strict";Pe()});function oe(i,e=1){if(i===0)return"0 Bytes";let t=1024,a=["Bytes","KB","MB","GB"],u=Math.floor(Math.log(i)/Math.log(t));return parseFloat((i/Math.pow(t,u)).toFixed(e))+" "+a[u]}function se(i){if(/[?&#%<>\[\]{}|\\^~`;$()'"*\r\n\t]/.test(i))return{valid:!1,reason:"File name contains unsafe characters"};if(i.startsWith(" ")||i.endsWith(" "))return{valid:!1,reason:"File name cannot start/end with spaces"};if(i.endsWith("."))return{valid:!1,reason:"File name cannot end with dots"};let t=/^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(\.|$)/i,a=i.split("/").pop()||i;return t.test(a)?{valid:!1,reason:"File name uses a reserved system name"}:i.includes("..")?{valid:!1,reason:"File name contains path traversal pattern"}:{valid:!0}}function ln(i,e){let t=[],a=[],u=[];if(i.length===0){let f={file:"(no files)",message:"At least one file must be provided"};return t.push(f),{files:[],validFiles:[],errors:t,warnings:[],canDeploy:!1}}if(i.length>e.maxFilesCount){let f={file:`(${i.length} files)`,message:`File count (${i.length}) exceeds limit of ${e.maxFilesCount}`};return t.push(f),{files:i.map(y=>({...y,status:v.VALIDATION_FAILED,statusMessage:f.message})),validFiles:[],errors:t,warnings:[],canDeploy:!1}}let c=0;for(let f of i){let y=v.READY,m="Ready for upload",w=f.name?se(f.name):{valid:!1,reason:"File name cannot be empty"};if(f.status===v.PROCESSING_ERROR)y=v.VALIDATION_FAILED,m=f.statusMessage||"File failed during processing",t.push({file:f.name,message:m});else if(f.size===0){y=v.EXCLUDED,m="File is empty (0 bytes) and cannot be deployed due to storage limitations",a.push({file:f.name,message:m}),u.push({...f,status:y,statusMessage:m});continue}else f.size<0?(y=v.VALIDATION_FAILED,m="File size must be positive",t.push({file:f.name,message:m})):!f.name||f.name.trim().length===0?(y=v.VALIDATION_FAILED,m="File name cannot be empty",t.push({file:f.name||"(empty)",message:m})):f.name.includes("\0")?(y=v.VALIDATION_FAILED,m="File name contains invalid characters (null byte)",t.push({file:f.name,message:m})):w.valid?N(f.name)?(y=v.VALIDATION_FAILED,m=`File extension not allowed: "${f.name}"`,t.push({file:f.name,message:m})):f.size>e.maxFileSize?(y=v.VALIDATION_FAILED,m=`File size (${oe(f.size)}) exceeds limit of ${oe(e.maxFileSize)}`,t.push({file:f.name,message:m})):(c+=f.size,c>e.maxTotalSize&&(y=v.VALIDATION_FAILED,m=`Total size would exceed limit of ${oe(e.maxTotalSize)}`,t.push({file:f.name,message:m}))):(y=v.VALIDATION_FAILED,m=w.reason||"Invalid file name",t.push({file:f.name,message:m}));u.push({...f,status:y,statusMessage:m})}t.length>0&&(u=u.map(f=>f.status===v.EXCLUDED?f:{...f,status:v.VALIDATION_FAILED,statusMessage:f.status===v.VALIDATION_FAILED?f.statusMessage:"Deployment failed due to validation errors in bundle"}));let h=t.length===0?u.filter(f=>f.status===v.READY):[],g=t.length===0;return{files:u,validFiles:h,errors:t,warnings:a,canDeploy:g}}function rt(i){return i.filter(e=>e.status===v.READY)}function pn(i){return rt(i).length>0}var ae=R(()=>{"use strict";x()});function _e(i,e){if(i.includes("\0")||i.includes("/../")||i.startsWith("../")||i.endsWith("/.."))throw d.business(`Security error: Unsafe file path "${i}" for file: ${e}`)}function $e(i,e){let t=se(i);if(!t.valid)throw d.business(t.reason||"Invalid file name");if(N(i))throw d.business(`File extension not allowed: "${e}"`)}var le=R(()=>{"use strict";x();ae()});var Le={};qe(Le,{processFilesForBrowser:()=>Ne});async function Ne(i,e={}){if(M()!=="browser")throw d.business("processFilesForBrowser can only be called in a browser environment.");let t=i.map(y=>y.webkitRelativePath||y.name),a=new Set(Fe(t)),u=[];for(let y=0;y<i.length;y++)a.has(t[y])&&u.push({file:i[y],rawPath:t[y]});if(u.length===0)return[];let c=Oe(u.map(y=>y.rawPath),{flatten:e.pathDetect!==!1}),h=F(),g=[],f=0;for(let y=0;y<u.length;y++){let{file:m}=u[y],w=c[y].path;if(_e(w,m.name),m.size===0)continue;if($e(w,m.name),m.size>h.maxFileSize)throw d.business(`File ${m.name} is too large. Maximum allowed size is ${h.maxFileSize/(1024*1024)}MB.`);if(f+=m.size,f>h.maxTotalSize)throw d.business(`Total deploy size is too large. Maximum allowed is ${h.maxTotalSize/(1024*1024)}MB.`);let{md5:q}=await z(m);g.push({path:w,content:m,size:m.size,md5:q})}if(g.length>h.maxFilesCount)throw d.business(`Too many files to deploy. Maximum allowed is ${h.maxFilesCount} files.`);return g}var pe=R(()=>{"use strict";K();x();k();ne();ie();le();P()});x();var B=class{constructor(){this.handlers=new Map}on(e,t){this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(t)}off(e,t){let a=this.handlers.get(e);a&&(a.delete(t),a.size===0&&this.handlers.delete(e))}emit(e,...t){let a=this.handlers.get(e);if(!a)return;let u=Array.from(a);for(let c of u)try{c(...t)}catch(h){a.delete(c),e!=="error"&&setTimeout(()=>{h instanceof Error?this.emit("error",h,String(e)):this.emit("error",new Error(String(h)),String(e))},0)}}transfer(e){this.handlers.forEach((t,a)=>{t.forEach(u=>{e.on(a,u)})})}clear(){this.handlers.clear()}};var S={DEPLOYMENTS:"/deployments",DOMAINS:"/domains",TOKENS:"/tokens",ACCOUNT:"/account",CONFIG:"/config",PING:"/ping",SPA_CHECK:"/spa-check"},Ye=3e4,U=class extends B{constructor(e){super(),this.apiUrl=e.apiUrl||L,this.getAuthHeadersCallback=e.getAuthHeaders,this.timeout=e.timeout??Ye,this.createDeployBody=e.createDeployBody}transferEventsTo(e){this.transfer(e)}async executeRequest(e,t,a){let u=this.mergeHeaders(t.headers),{signal:c,cleanup:h}=this.createTimeoutSignal(t.signal),g={...t,headers:u,credentials:u.Authorization?void 0:"include",signal:c};this.emit("request",e,g);try{let f=await fetch(e,g);return h(),f.ok||await this.handleResponseError(f,a),this.emit("response",this.safeClone(f),e),{data:await this.parseResponse(this.safeClone(f)),status:f.status}}catch(f){h();let y=f instanceof Error?f:new Error(String(f));this.emit("error",y,e),this.handleFetchError(f,a)}}async request(e,t,a){let{data:u}=await this.executeRequest(e,t,a);return u}async requestWithStatus(e,t,a){return this.executeRequest(e,t,a)}mergeHeaders(e={}){return{...e,...this.getAuthHeadersCallback()}}createTimeoutSignal(e){let t=new AbortController,a=setTimeout(()=>t.abort(),this.timeout);if(e){let u=()=>t.abort();e.addEventListener("abort",u),e.aborted&&t.abort()}return{signal:t.signal,cleanup:()=>clearTimeout(a)}}safeClone(e){try{return e.clone()}catch{return e}}async parseResponse(e){if(!(e.headers.get("Content-Length")==="0"||e.status===204))return e.json()}async handleResponseError(e,t){let a={};try{if(e.headers.get("content-type")?.includes("application/json")){let h=await e.json();if(h&&typeof h=="object"){let g=h;typeof g.message=="string"&&(a.message=g.message),typeof g.error=="string"&&(a.error=g.error)}}else a={message:await e.text()}}catch{a={message:"Failed to parse error response"}}let u=a.message||a.error||`${t} failed`;throw e.status===401?d.authentication(u):d.api(u,e.status)}handleFetchError(e,t){throw J(e)?e:e instanceof Error&&e.name==="AbortError"?d.cancelled(`${t} was cancelled`):e instanceof TypeError&&e.message.includes("fetch")?d.network(`${t} failed: ${e.message}`,e):e instanceof Error?d.business(`${t} failed: ${e.message}`):d.business(`${t} failed: Unknown error`)}async deploy(e,t={}){if(!e.length)throw d.business("No files to deploy");for(let h of e)if(!h.md5)throw d.file(`MD5 checksum missing for file: ${h.path}`,h.path);let{body:a,headers:u}=await this.createDeployBody(e,t.labels,t.via),c={};return t.deployToken?c.Authorization=`Bearer ${t.deployToken}`:t.apiKey&&(c.Authorization=`Bearer ${t.apiKey}`),t.caller&&(c["X-Caller"]=t.caller),this.request(`${t.apiUrl||this.apiUrl}${S.DEPLOYMENTS}`,{method:"POST",body:a,headers:{...u,...c},signal:t.signal||null},"Deploy")}async listDeployments(){return this.request(`${this.apiUrl}${S.DEPLOYMENTS}`,{method:"GET"},"List deployments")}async getDeployment(e){return this.request(`${this.apiUrl}${S.DEPLOYMENTS}/${encodeURIComponent(e)}`,{method:"GET"},"Get deployment")}async updateDeploymentLabels(e,t){return this.request(`${this.apiUrl}${S.DEPLOYMENTS}/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({labels:t})},"Update deployment labels")}async removeDeployment(e){await this.request(`${this.apiUrl}${S.DEPLOYMENTS}/${encodeURIComponent(e)}`,{method:"DELETE"},"Remove deployment")}async setDomain(e,t,a){let u={};t&&(u.deployment=t),a!==void 0&&(u.labels=a);let{data:c,status:h}=await this.requestWithStatus(`${this.apiUrl}${S.DOMAINS}/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)},"Set domain");return{...c,isCreate:h===201}}async listDomains(){return this.request(`${this.apiUrl}${S.DOMAINS}`,{method:"GET"},"List domains")}async getDomain(e){return this.request(`${this.apiUrl}${S.DOMAINS}/${encodeURIComponent(e)}`,{method:"GET"},"Get domain")}async removeDomain(e){await this.request(`${this.apiUrl}${S.DOMAINS}/${encodeURIComponent(e)}`,{method:"DELETE"},"Remove domain")}async verifyDomain(e){return this.request(`${this.apiUrl}${S.DOMAINS}/${encodeURIComponent(e)}/verify`,{method:"POST"},"Verify domain")}async getDomainDns(e){return this.request(`${this.apiUrl}${S.DOMAINS}/${encodeURIComponent(e)}/dns`,{method:"GET"},"Get domain DNS")}async getDomainRecords(e){return this.request(`${this.apiUrl}${S.DOMAINS}/${encodeURIComponent(e)}/records`,{method:"GET"},"Get domain records")}async getDomainShare(e){return this.request(`${this.apiUrl}${S.DOMAINS}/${encodeURIComponent(e)}/share`,{method:"GET"},"Get domain share")}async validateDomain(e){return this.request(`${this.apiUrl}${S.DOMAINS}/validate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({domain:e})},"Validate domain")}async createToken(e,t){let a={};return e!==void 0&&(a.ttl=e),t!==void 0&&(a.labels=t),this.request(`${this.apiUrl}${S.TOKENS}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)},"Create token")}async listTokens(){return this.request(`${this.apiUrl}${S.TOKENS}`,{method:"GET"},"List tokens")}async removeToken(e){await this.request(`${this.apiUrl}${S.TOKENS}/${encodeURIComponent(e)}`,{method:"DELETE"},"Remove token")}async getAccount(){return this.request(`${this.apiUrl}${S.ACCOUNT}`,{method:"GET"},"Get account")}async getConfig(){return this.request(`${this.apiUrl}${S.CONFIG}`,{method:"GET"},"Get config")}async ping(){return(await this.request(`${this.apiUrl}${S.PING}`,{method:"GET"},"Ping"))?.success||!1}async checkSPA(e){let t=e.find(h=>h.path==="index.html"||h.path==="/index.html");if(!t||t.size>100*1024)return!1;let a;if(typeof Buffer<"u"&&Buffer.isBuffer(t.content))a=t.content.toString("utf-8");else if(typeof Blob<"u"&&t.content instanceof Blob)a=await t.content.text();else if(typeof File<"u"&&t.content instanceof File)a=await t.content.text();else return!1;let u={files:e.map(h=>h.path),index:a};return(await this.request(`${this.apiUrl}${S.SPA_CHECK}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)},"SPA check")).isSPA}};x();P();x();x();function ye(i={},e={}){let t={apiUrl:i.apiUrl||e.apiUrl||L,apiKey:i.apiKey!==void 0?i.apiKey:e.apiKey,deployToken:i.deployToken!==void 0?i.deployToken:e.deployToken},a={apiUrl:t.apiUrl};return t.apiKey!==void 0&&(a.apiKey=t.apiKey),t.deployToken!==void 0&&(a.deployToken=t.deployToken),a}function ge(i,e){let t={...i};return t.apiUrl===void 0&&e.apiUrl!==void 0&&(t.apiUrl=e.apiUrl),t.apiKey===void 0&&e.apiKey!==void 0&&(t.apiKey=e.apiKey),t.deployToken===void 0&&e.deployToken!==void 0&&(t.deployToken=e.deployToken),t.timeout===void 0&&e.timeout!==void 0&&(t.timeout=e.timeout),t.maxConcurrency===void 0&&e.maxConcurrency!==void 0&&(t.maxConcurrency=e.maxConcurrency),t.onProgress===void 0&&e.onProgress!==void 0&&(t.onProgress=e.onProgress),t.caller===void 0&&e.caller!==void 0&&(t.caller=e.caller),t}x();K();async function Qe(){let e=JSON.stringify({rewrites:[{source:"/(.*)",destination:"/index.html"}]},null,2),t;typeof Buffer<"u"?t=Buffer.from(e,"utf-8"):t=new Blob([e],{type:"application/json"});let{md5:a}=await z(t);return{path:X,content:t,size:e.length,md5:a}}async function Ee(i,e,t){if(t.spaDetect===!1||i.some(a=>a.path===X))return i;try{if(await e.checkSPA(i)){let u=await Qe();return[...i,u]}}catch{}return i}function we(i){let{getApi:e,ensureInit:t,processInput:a,clientDefaults:u,hasAuth:c}=i;return{create:async(h,g={})=>{await t();let f=u?ge(g,u):g;if(c&&!c()&&!f.deployToken&&!f.apiKey)throw d.authentication("Authentication credentials are required for deployment. Please call setDeployToken() or setApiKey() first, or pass credentials in the deployment options.");if(!a)throw d.config("processInput function is not provided.");let y=e(),m=await a(h,f);return m=await Ee(m,y,f),y.deploy(m,f)},list:async()=>(await t(),e().listDeployments()),get:async h=>(await t(),e().getDeployment(h)),set:async(h,g)=>(await t(),e().updateDeploymentLabels(h,g.labels)),remove:async h=>{await t(),await e().removeDeployment(h)}}}function xe(i){let{getApi:e,ensureInit:t}=i;return{set:async(a,u={})=>(await t(),e().setDomain(a,u.deployment,u.labels)),list:async()=>(await t(),e().listDomains()),get:async a=>(await t(),e().getDomain(a)),remove:async a=>{await t(),await e().removeDomain(a)},verify:async a=>(await t(),e().verifyDomain(a)),validate:async a=>(await t(),e().validateDomain(a)),dns:async a=>(await t(),e().getDomainDns(a)),records:async a=>(await t(),e().getDomainRecords(a)),share:async a=>(await t(),e().getDomainShare(a))}}function Re(i){let{getApi:e,ensureInit:t}=i;return{get:async()=>(await t(),e().getAccount())}}function Ce(i){let{getApi:e,ensureInit:t}=i;return{create:async(a={})=>(await t(),e().createToken(a.ttl,a.labels)),list:async()=>(await t(),e().listTokens()),remove:async a=>{await t(),await e().removeToken(a)}}}var V=class{constructor(e={}){this.initPromise=null;this._config=null;this.auth=null;this.clientOptions=e,e.deployToken?this.auth={type:"token",value:e.deployToken}:e.apiKey&&(this.auth={type:"apiKey",value:e.apiKey}),this.authHeadersCallback=()=>this.getAuthHeaders();let t=this.resolveInitialConfig(e);this.http=new U({...e,...t,getAuthHeaders:this.authHeadersCallback,createDeployBody:this.getDeployBodyCreator()});let a={getApi:()=>this.http,ensureInit:()=>this.ensureInitialized()};this._deployments=we({...a,processInput:(u,c)=>this.processInput(u,c),clientDefaults:this.clientOptions,hasAuth:()=>this.hasAuth()}),this._domains=xe(a),this._account=Re(a),this._tokens=Ce(a)}async ensureInitialized(){return this.initPromise||(this.initPromise=this.loadFullConfig()),this.initPromise}async ping(){return await this.ensureInitialized(),this.http.ping()}async deploy(e,t){return this.deployments.create(e,t)}async whoami(){return this.account.get()}get deployments(){return this._deployments}get domains(){return this._domains}get account(){return this._account}get tokens(){return this._tokens}async getConfig(){return this._config?this._config:(await this.ensureInitialized(),this._config=F(),this._config)}on(e,t){this.http.on(e,t)}off(e,t){this.http.off(e,t)}replaceHttpClient(e){if(this.http?.transferEventsTo)try{this.http.transferEventsTo(e)}catch(t){console.warn("Event transfer failed during client replacement:",t)}this.http=e}setDeployToken(e){if(!e||typeof e!="string")throw d.business("Invalid deploy token provided. Deploy token must be a non-empty string.");this.auth={type:"token",value:e}}setApiKey(e){if(!e||typeof e!="string")throw d.business("Invalid API key provided. API key must be a non-empty string.");this.auth={type:"apiKey",value:e}}getAuthHeaders(){return this.auth?{Authorization:`Bearer ${this.auth.value}`}:{}}hasAuth(){return this.clientOptions.useCredentials?!0:this.auth!==null}};P();x();x();async function be(i,e,t){let a=new FormData,u=[];for(let c of i){if(!(c.content instanceof File||c.content instanceof Blob))throw d.file(`Unsupported file.content type for browser: ${c.path}`,c.path);if(!c.md5)throw d.file(`File missing md5 checksum: ${c.path}`,c.path);let h=new File([c.content],c.path,{type:"application/octet-stream"});a.append("files[]",h),u.push(c.md5)}return a.append("checksums",JSON.stringify(u)),e&&e.length>0&&a.append("labels",JSON.stringify(e)),t&&a.append("via",t),{body:a,headers:{}}}K();function Qt(i,e,t,a=!0){let u=i===1?e:t;return a?`${i} ${u}`:u}ne();ie();k();ae();le();x();P();pe();var ue=class extends V{constructor(e={}){super(e)}resolveInitialConfig(e){return ye(e,{})}async loadFullConfig(){try{let e=await this.http.getConfig();Z(e)}catch(e){throw this.initPromise=null,e}}async processInput(e,t){if(!this.isFileArray(e))throw d.business("Invalid input type for browser environment. Expected File[].");if(e.length===0)throw d.business("No files to deploy.");let{processFilesForBrowser:a}=await Promise.resolve().then(()=>(pe(),Le));return a(e,t)}isFileArray(e){return Array.isArray(e)&&e.every(t=>t instanceof File)}getDeployBodyCreator(){return be}},kn=ue;export{Y as API_KEY_HEX_LENGTH,lt as API_KEY_HINT_LENGTH,T as API_KEY_PREFIX,he as API_KEY_TOTAL_LENGTH,at as AccountPlan,U as ApiHttp,pt as AuthMethod,je as BLOCKED_EXTENSIONS,L as DEFAULT_API,X as DEPLOYMENT_CONFIG_FILENAME,W as DEPLOY_TOKEN_HEX_LENGTH,I as DEPLOY_TOKEN_PREFIX,de as DEPLOY_TOKEN_TOTAL_LENGTH,ot as DeploymentStatus,st as DomainStatus,A as ErrorType,v as FILE_VALIDATION_STATUS,v as FileValidationStatus,tt as JUNK_DIRECTORIES,Dt as LABEL_CONSTRAINTS,At as LABEL_PATTERN,ue as Ship,d as ShipError,Ot as __setTestEnvironment,pn as allValidFilesReady,z as calculateMD5,Re as createAccountResource,we as createDeploymentResource,xe as createDomainResource,Ce as createTokenResource,kn as default,vt as deserializeLabels,mt as extractSubdomain,Fe as filterJunk,oe as formatFileSize,yt as generateDeploymentUrl,gt as generateDomainUrl,F as getCurrentConfig,M as getENV,rt as getValidFiles,N as isBlockedExtension,dt as isCustomDomain,ht as isDeployment,me as isPlatformDomain,J as isShipError,ge as mergeDeployOptions,Oe as optimizeDeployPaths,Qt as pluralize,Ne as processFilesForBrowser,ye as resolveConfig,St as serializeLabels,Z as setPlatformConfig,ut as validateApiKey,ft as validateApiUrl,$e as validateDeployFile,_e as validateDeployPath,ct as validateDeployToken,se as validateFileName,ln as validateFiles};
2
2
  //# sourceMappingURL=browser.js.map