@shipstatic/ship 2.2.0-beta.6 → 2.2.0-beta.7

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/README.md CHANGED
@@ -295,12 +295,17 @@ const deployment = await ship.deploy([
295
295
  ### Events
296
296
 
297
297
  ```javascript
298
- ship.on('request', (url, init) => {});
299
- ship.on('response', (response, url) => {});
300
- ship.on('error', (error, url) => {});
298
+ ship.on('request', (url, init) => {}); // once per attempt
299
+ ship.on('retry', (error, url, attempt) => {}); // an attempt failed, another is coming
300
+ ship.on('response', (response, url) => {}); // the call succeeded
301
+ ship.on('error', (error, url) => {}); // the call failed, terminally
301
302
  ship.off('request', handler);
302
303
  ```
303
304
 
305
+ One call emits `retry* (error | response)` — every failure is announced, and
306
+ the event name says whether it ended the call. `attempt` counts from 1, so it
307
+ names both the attempt that failed and which retry is happening.
308
+
304
309
  ### Custom fetch
305
310
 
306
311
  Pass `fetch` to override the transport function used for every API call. Defaults to `globalThis.fetch`. Useful for wrapping requests with tracing, retries, or request signing, and for injecting a Cloudflare service-binding `Fetcher` from a Worker so calls reach a sibling Worker in-process instead of through the public hostname.
@@ -335,9 +340,10 @@ try {
335
340
  } catch (error) {
336
341
  if (isShipError(error)) {
337
342
  error.isAuthError(); // semantic category
338
- error.isNetworkError(); // semantic category
343
+ error.isNetworkError(); // semantic category — nothing was exchanged
339
344
  error.isClientError(); // semantic category (Business | Config | File | Validation)
340
345
  error.type === ErrorType.Validation; // specific-type check
346
+ error.type === ErrorType.Timeout; // a deadline expired — inside isNetworkError()
341
347
  error.status === 429; // status check
342
348
  }
343
349
  }
@@ -5,7 +5,7 @@ Their copyright notices travel with that copy, and are reproduced here in
5
5
  full. This file is GENERATED from the build's own metafile — edit the
6
6
  bundle, not this list.
7
7
 
8
- ## @shipstatic/types 2.7.0-beta.2
8
+ ## @shipstatic/types 2.7.0-beta.3
9
9
 
10
10
  License: MIT
11
11
 
package/dist/browser.d.ts CHANGED
@@ -725,6 +725,23 @@ declare const ErrorType: {
725
725
  readonly Maintenance: "maintenance";
726
726
  /** Network/connection error. Client-side only — set by HTTP clients on fetch failure; never produced server-side. */
727
727
  readonly Network: "network_error";
728
+ /**
729
+ * A deadline expired before the exchange completed. Client-side only — set
730
+ * by HTTP clients when a timeout signal fires; never produced server-side.
731
+ *
732
+ * A member of the NETWORK category rather than a sibling of it:
733
+ * `isNetworkError()` answers "nothing was exchanged", which is true of a
734
+ * deadline exactly as it is of a refused connection, so every consumer that
735
+ * retries, declines to report, or declines to relay a wire message on that
736
+ * category is already right about a timeout. The distinct TYPE exists for
737
+ * the one decision the category cannot make — what to SAY. "Check your
738
+ * internet connection" is the wrong sentence for a five-minute deploy
739
+ * ceiling, and a surface can only tell the two apart by type.
740
+ *
741
+ * The same relationship every comparable SDK ships:
742
+ * `APIConnectionTimeoutError extends APIConnectionError`.
743
+ */
744
+ readonly Timeout: "timeout_error";
728
745
  /** Operation was cancelled. Client-side only — set on `AbortSignal` abort; never produced server-side. */
729
746
  readonly Cancelled: "operation_cancelled";
730
747
  /** File operation error. Client-side only — set by SDK during local file processing; never produced server-side. */
@@ -769,7 +786,7 @@ declare class ShipError extends Error {
769
786
  * on the client). Falls back to status-derived (401 → Authentication,
770
787
  * 403 → Forbidden, 429 → RateLimit, else → Api) for non-API responses
771
788
  * (CDN errors, intermediaries) or malformed bodies. Client-only types
772
- * (`Network`, `Cancelled`, `File`, `Config`) are filtered out of the
789
+ * (`Network`, `Timeout`, `Cancelled`, `File`, `Config`) are filtered out of the
773
790
  * trusted set — a misbehaving server claiming one of those is ignored.
774
791
  *
775
792
  * `operationName` (e.g. `"Get account"`) is used to compose the fallback
@@ -789,8 +806,9 @@ declare class ShipError extends Error {
789
806
  * Routing:
790
807
  * - Already a `ShipError` → returned as-is (caller's intent preserved)
791
808
  * - `AbortError` → `ShipError.cancelled(...)` — someone stopped it on purpose
792
- * - `TimeoutError` → `ShipError.network(...)` — a deadline expired, so
793
- * nothing was exchanged; the message names the timeout
809
+ * - `TimeoutError` → `ShipError.timeout(...)` — a deadline expired; the
810
+ * message names the timeout, and the type is in the network CATEGORY
811
+ * because nothing was exchanged
794
812
  * - A transport failure → `ShipError.network(...)` — see `isTransportFailure`
795
813
  * for what each runtime offers as evidence
796
814
  * - Any other `Error` → `ShipError(Api, ...)` (no HTTP status — fetch never reached the server)
@@ -837,6 +855,14 @@ declare class ShipError extends Error {
837
855
  static authentication(message?: string, details?: unknown): ShipError;
838
856
  static business(message: string, status?: number, details?: unknown): ShipError;
839
857
  static network(message: string, details?: unknown): ShipError;
858
+ /**
859
+ * A deadline expired before the exchange completed.
860
+ *
861
+ * Statusless like its four client-only siblings: no exchange completed, so
862
+ * there is no HTTP status to report. `isNetworkError()` is true — see
863
+ * `ErrorType.Timeout` for why the category is shared and the type is not.
864
+ */
865
+ static timeout(message: string, details?: unknown): ShipError;
840
866
  static cancelled(message: string, details?: unknown): ShipError;
841
867
  static file(message: string, details?: unknown): ShipError;
842
868
  static config(message: string, details?: unknown): ShipError;
@@ -1964,17 +1990,45 @@ interface ShipClientOptions {
1964
1990
  deployEndpoint?: string | undefined;
1965
1991
  }
1966
1992
  /**
1967
- * Event map for Ship SDK events
1968
- * Core events for observability: request, response, error
1993
+ * Event map for Ship SDK events.
1994
+ *
1995
+ * **Every failure is visible, and the event NAME says whether it ended the
1996
+ * call.** One call emits `retry* (error | response)` — so the stream is
1997
+ * unambiguous at every prefix, and a consumer never has to wait to find out
1998
+ * what it is watching.
1999
+ *
2000
+ * `request` counts what went out; `retry` counts what failed and will be
2001
+ * tried again; `error` and `response` are the two terminal answers, exactly
2002
+ * one of which arrives.
1969
2003
  */
1970
2004
  interface ShipEvents {
1971
- /** Emitted before each API request */
2005
+ /** Emitted before each API request — once per ATTEMPT, so it counts what actually went out. */
1972
2006
  request: [url: string, init: RequestInit];
1973
- /** Emitted after successful API response */
2007
+ /** Emitted after successful API response — once, on the attempt that worked. */
1974
2008
  response: [response: Response, url: string];
1975
2009
  /**
1976
- * Emitted when something fails. TWO populations arrive here, which is why
1977
- * the type is `Error` and not `ShipError`:
2010
+ * Emitted when an attempt failed and the client is going to try again.
2011
+ * Carries the same normalized `ShipError` the terminal `error` would, plus
2012
+ * `attempt` — the number of the attempt that just failed, counting from 1,
2013
+ * which matches the arithmetic the docs use ("two retries by default, so
2014
+ * three attempts"). Under that numbering the value reads both ways at once:
2015
+ * attempt N failing IS retry N, so `retry 1 of ${maxRetries}` needs no
2016
+ * adjustment.
2017
+ *
2018
+ * This event exists so `error` can keep meaning what it always meant. When
2019
+ * retries landed, `error` fired per attempt — honest about what happened,
2020
+ * but it silently redefined the event: a consumer seeing `error, error,
2021
+ * response` could not tell "failed, retrying" from "failed, terminally" at
2022
+ * any prefix, and counting `error`s no longer counted failed calls. Two
2023
+ * names, two meanings, and nothing lost: every failure is still announced.
2024
+ *
2025
+ * A failure the loop will NOT retry is terminal and emits `error` directly,
2026
+ * never this. So is an abort that lands mid-backoff.
2027
+ */
2028
+ retry: [error: Error, url: string, attempt: number];
2029
+ /**
2030
+ * Emitted when the CALL failed — terminally, exactly once. TWO populations
2031
+ * arrive here, which is why the type is `Error` and not `ShipError`:
1978
2032
  *
1979
2033
  * - a failed request — always a `ShipError` (`executeRequest` normalizes
1980
2034
  * every failure through `ShipError.fromFetchError` before emitting), so
@@ -2052,9 +2106,16 @@ declare class ApiHttp extends SimpleEvents {
2052
2106
  * for headers, the timeout signal, the events and error normalization — so
2053
2107
  * an attempt is a whole request and nothing has to be undone between two.
2054
2108
  *
2055
- * **Events stay honest across attempts**: `request` and `error` fire per
2056
- * attempt, so a consumer counting requests sees what actually went out;
2057
- * `response` fires once, on the one that worked.
2109
+ * **Every failure is visible, and the event NAME says whether it ended the
2110
+ * call.** One call emits `retry* (error | response)`: `request` fires per
2111
+ * attempt, so a consumer counting requests sees what actually went out; a
2112
+ * failure that will be tried again is a `retry`; `error` and `response` are
2113
+ * the two terminal answers, exactly one of which arrives.
2114
+ *
2115
+ * The failure events are emitted HERE rather than in `attemptOnce`, and
2116
+ * that placement is the whole mechanism: terminality is a property of the
2117
+ * loop — of `isRetryable` and the attempt budget — so it is knowable only
2118
+ * at the one point that owns both. An attempt cannot name its own failure.
2058
2119
  *
2059
2120
  * **The caller's `timeout` governs an ATTEMPT, not the wall clock.** Each
2060
2121
  * attempt is an honest request and deserves the ceiling the caller named;
@@ -2073,7 +2134,12 @@ declare class ApiHttp extends SimpleEvents {
2073
2134
  /** Did this request carry the header that makes a repeat safe? */
2074
2135
  private hasIdempotencyKey;
2075
2136
  /**
2076
- * One attempt: headers, timeout signal, events, and error normalization.
2137
+ * One attempt: headers, timeout signal, the `request`/`response` events, and
2138
+ * error normalization.
2139
+ *
2140
+ * It does NOT emit a failure event. An attempt cannot know whether its own
2141
+ * failure ended the call — that is `executeRequest`'s question — so it
2142
+ * normalizes and throws, and the loop names what happened.
2077
2143
  */
2078
2144
  private attemptOnce;
2079
2145
  /**
package/dist/browser.js CHANGED
@@ -1,2 +1,2 @@
1
- var Ze=Object.create;var H=Object.defineProperty;var et=Object.getOwnPropertyDescriptor;var tt=Object.getOwnPropertyNames;var nt=Object.getPrototypeOf,rt=Object.prototype.hasOwnProperty;var it=(t,n,e)=>n in t?H(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var w=(t,n)=>()=>(t&&(n=t(t=0)),n);var ge=(t,n)=>()=>(n||t((n={exports:{}}).exports,n),n.exports),st=(t,n)=>{for(var e in n)H(t,e,{get:n[e],enumerable:!0})},ot=(t,n,e,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of tt(n))!rt.call(t,l)&&l!==e&&H(t,l,{get:()=>n[l],enumerable:!(o=et(n,l))||o.enumerable});return t};var k=(t,n,e)=>(e=t!=null?Ze(nt(t)):{},ot(n||!t||!t.__esModule?H(e,"default",{value:t,enumerable:!0}):e,t));var G=(t,n,e)=>it(t,typeof n!="symbol"?n+"":n,e);function Gt(t){if(!t||typeof t!="string")return;let n=t.trim().toLowerCase();return Object.values(at).includes(n)?n:void 0}function Ae(t){if(t==null)return;if(typeof t!="string")throw m.validation("Idempotency key must be a string.");let n=t.trim();if(!n)throw m.validation("Idempotency key must not be empty.");if(n.length>U.MAX_LENGTH)throw m.validation(`Idempotency key must be at most ${U.MAX_LENGTH} characters.`);return n}function ct(t){let n=t.code;return n==="ERR_INVALID_URL"?!1:typeof n=="string"?!0:t instanceof TypeError?!/\burl\b/i.test(t.message):!1}function De(t){return t!==null&&typeof t=="object"&&"name"in t&&t.name==="ShipError"&&"status"in t}function ft(t){let n=t.replace(/\\/g,"/").split("/").pop()??"",e=n.lastIndexOf(".");return e<=0||e===n.length-1?null:n.slice(e+1).toLowerCase()}function Te(t,n){let e=ft(t);return e===null?!1:Array.isArray(n)?n.includes(e):n.has(e)}function Se(t){return mt.test(t)}function K(t){return t.replace(/\\/g,"/").split("/").filter(Boolean).some(e=>ht.has(e))}function yt(t){return t.startsWith(Re.PREFIX)?O.API_KEY:t.startsWith(be.PREFIX)?O.DEPLOY_TOKEN:O.OPAQUE}function we(t){let n=t.charCodeAt(0)===65279?t.slice(1):t,e;try{e=JSON.parse(n)}catch(o){throw m.config(`invalid JSON format in config: ${o.message}`,{filePath:v})}if(e===null||typeof e!="object"||Array.isArray(e))throw m.config(`${v} must contain a JSON object`,{filePath:v})}function Le(t,n,e){if(!t.startsWith(n.PREFIX))throw m.validation(`${e} must start with "${n.PREFIX}"`);if(t.length!==n.TOTAL_LENGTH)throw m.validation(`${e} must be ${n.TOTAL_LENGTH} characters total (${n.PREFIX} + ${n.HEX_LENGTH} hex chars)`);let o=t.slice(n.PREFIX.length);if(!new RegExp(`^[a-f0-9]{${n.HEX_LENGTH}}$`,"i").test(o))throw m.validation(`${e} must contain ${n.HEX_LENGTH} hexadecimal characters after "${n.PREFIX}" prefix`)}function gt(t){Le(t,Re,"API key")}function Et(t){Le(t,be,"Deploy token")}function te(t){switch(yt(t)){case O.API_KEY:gt(t);return;case O.DEPLOY_TOKEN:Et(t);return;case O.OPAQUE:if(!t)throw m.validation("Token must be a non-empty string")}}function Pe(t){if(!t||t.length>$.MAX_LENGTH||!$.PATTERN.test(t))throw m.validation(`Caller must be 1-${$.MAX_LENGTH} characters: letters, digits, dots, underscores, or hyphens`)}function jt(t){try{let n=new URL(t);if(!["http:","https:"].includes(n.protocol))throw m.validation("API URL must use http:// or https:// protocol");if(n.pathname!=="/"&&n.pathname!=="")throw m.validation("API URL must not contain a path");if(n.search||n.hash)throw m.validation("API URL must not contain query parameters or fragments")}catch(n){throw De(n)?n:m.validation("API URL must be a valid URL")}}function qt(t){return/^[a-z]+-[a-z]+-[a-z0-9]{7}(\.[a-z0-9.-]+)?$/i.test(t)}function _e(t,n){return t.endsWith(`.${n}`)}function Qt(t,n){return!_e(t,n)}function Zt(t,n){return _e(t,n)?t.slice(0,-(n.length+1)):null}function en(t){return`https://${t}`}function tn(t){return`https://${t}`}function nn(t){return!t||t.length===0?null:JSON.stringify(t)}function rn(t){if(!t)return[];try{let n=JSON.parse(t);return Array.isArray(n)?n:[]}catch{return[]}}function re(t){if(t==null)return;if(typeof t!="string")throw m.validation("Password must be a string");let n=t.trim();if(n.length<z.MIN_LENGTH||n.length>z.MAX_LENGTH)throw m.validation(`Password must be between ${z.MIN_LENGTH} and ${z.MAX_LENGTH} characters`);return n}var Ht,at,kt,U,zt,T,P,A,lt,ee,pt,ut,m,dt,Kt,mt,ht,Vt,Ee,Re,be,$,O,Yt,v,Ie,V,ne,Xt,Wt,Jt,b,N,ve,z,R=w(()=>{"use strict";Ht={PENDING:"pending",SUCCESS:"success",FAILED:"failed",DELETING:"deleting"},at={WEB:"web",SDK:"sdk",CLI:"cli",MCP:"mcp",GIT:"git",N8N:"n8n",GPT:"gpt",VSC:"vsc"},kt={PENDING:"pending",PARTIAL:"partial",SUCCESS:"success",PAUSED:"paused"},U={HEADER:"Idempotency-Key",MAX_LENGTH:256,WINDOW_SECONDS:1440*60};zt={FREE:"free",STANDARD:"standard",SPONSORED:"sponsored",ENTERPRISE:"enterprise",SUSPENDED:"suspended",TERMINATING:"terminating",TERMINATED:"terminated"},T={DEPLOYMENTS:"/deployments",DEPLOYMENT:t=>`/deployments/${t}`,DEPLOYMENT_CONFIG:t=>`/deployments/${t}/config`,DOMAINS:"/domains",DOMAIN:t=>`/domains/${t}`,DOMAIN_VERIFY:t=>`/domains/${t}/verify`,DOMAIN_DNS:t=>`/domains/${t}/dns`,DOMAIN_RECORDS:t=>`/domains/${t}/records`,DOMAIN_SHARE:t=>`/domains/${t}/share`,DOMAIN_PROPAGATION:t=>`/domains/${t}/propagation`,DOMAINS_VALIDATE:"/domains/validate",TOKENS:"/tokens",TOKEN:t=>`/tokens/${t}`,ACCOUNT:"/account",ACCOUNT_KEY:"/account/key",ACCOUNT_CLAIM:"/account/claim",ACTIVITIES:"/activities",LABELS:"/labels",LIMITS:"/limits",PING:"/ping",SETUP:"/setup",SPA_CHECK:"/spa-check",UPLOAD:"/upload"},P={FILES:"files[]",CHECKSUMS:"checksums",LABELS:"labels",VIA:"via",PASSWORD:"password",BUILD:"build",PRERENDER:"prerender",SPA:"spa",CAPTCHA:"captcha"},A={Validation:"validation_failed",NotFound:"not_found",Forbidden:"forbidden",RateLimit:"rate_limit_exceeded",Authentication:"authentication_failed",Business:"business_logic_error",Api:"internal_server_error",Maintenance:"maintenance",Network:"network_error",Cancelled:"operation_cancelled",File:"file_error",Config:"config_error"},lt=new Set([A.Network,A.Cancelled,A.File,A.Config]),ee={client:new Set([A.Business,A.Cancelled,A.Config,A.File,A.Forbidden,A.NotFound,A.RateLimit,A.Validation]),network:new Set([A.Network]),auth:new Set([A.Authentication])},pt=new Set(Object.values(A).filter(t=>!lt.has(t))),ut=200;m=class t extends Error{constructor(e,o,l,c){super(o);G(this,"type");G(this,"status");G(this,"details");this.type=e,this.status=l,this.details=c,this.name="ShipError"}toResponse(){let e=this.details,o=this.type===A.Authentication&&e?.internal?void 0:this.details;return{error:this.type,message:this.message,status:this.status,details:o}}static async fromHttpResponse(e,o){let l,c,d;try{if(e.headers.get("content-type")?.includes("application/json")){let y=await e.json();if(y&&typeof y=="object"){let E=y;typeof E.message=="string"?l=E.message:typeof E.error=="string"&&(l=E.error),c=E.details,typeof E.error=="string"&&pt.has(E.error)&&(d=E.error)}}else{let y=(await e.text()).trim();y&&!y.startsWith("<")&&y.length<=ut&&(l=y)}}catch{}let h=e.headers.get("retry-after");if(h!==null){let g=h.trim(),y=/^\d+$/.test(g)?Number(g):Math.ceil((Date.parse(g)-Date.now())/1e3);if(Number.isFinite(y)&&y>=0){let E=c&&typeof c=="object"?c:{};E.retryAfter===void 0&&(c={...E,retryAfter:y})}}l=l||`${o||"Request"} failed with status ${e.status}`;let f=d??(e.status===401?A.Authentication:e.status===403?A.Forbidden:e.status===429?A.RateLimit:A.Api);return new t(f,l,e.status,c)}static fromFetchError(e,o){if(De(e))return e;let l=o||"Request",c=e?.name;return c==="AbortError"?t.cancelled(`${l} was cancelled`):c==="TimeoutError"?t.network(`${l} timed out`,{cause:e}):e instanceof Error?ct(e)?t.network(`${l} failed: ${e.message}`,{cause:e}):new t(A.Api,`${l} failed: ${e.message}`):new t(A.Api,`${l} failed: Unknown error`)}static validation(e,o){return new t(A.Validation,e,400,o)}static notFound(e,o){let l=o?`${e} ${o} not found`:`${e} not found`;return new t(A.NotFound,l,404)}static forbidden(e,o){return new t(A.Forbidden,e,403,o)}static rateLimit(e="Too many requests",o){return new t(A.RateLimit,e,429,o)}static authentication(e="Authentication required",o){return new t(A.Authentication,e,401,o)}static business(e,o=400,l){return new t(A.Business,e,o,l)}static network(e,o){return new t(A.Network,e,void 0,o)}static cancelled(e,o){return new t(A.Cancelled,e,void 0,o)}static file(e,o){return new t(A.File,e,void 0,o)}static config(e,o){return new t(A.Config,e,void 0,o)}static api(e,o=500,l){return new t(A.Api,e,o,l)}static maintenance(e,o){return new t(A.Maintenance,e,503,o)}isClientError(){return ee.client.has(this.type)?!0:this.status!==void 0&&this.status>=400&&this.status<500}isNetworkError(){return ee.network.has(this.type)}isAuthError(){return ee.auth.has(this.type)}isType(e){return this.type===e}};dt=["html","htm","xhtml","xml","txt","md","markdown","pdf","csv","json","jsonc","webmanifest","map","toml","yaml","yml","rss","atom","css","scss","sass","less","js","mjs","cjs","jsx","ts","tsx","wasm","vue","svelte","png","jpg","jpeg","gif","webp","avif","svg","ico","bmp","tif","tiff","heic","heif","woff","woff2","ttf","otf","eot","mp3","wav","ogg","oga","opus","m4a","aac","flac","weba","mp4","webm","ogv","mov","m4v","avi","glb","gltf","usdz","vtt","srt","zip"],Kt=dt.map(t=>`.${t}`).join(","),mt=/[\x00-\x1f\x7f#?%\\<>"]/;ht=new Set(["node_modules","package.json"]);Vt="/auth",Ee={SESSION:"session",API_KEY:"apiKey",TOKEN:"token",AGENT:"agent",OAUTH:"oauth",WEBHOOK:"webhook",SYSTEM:"system"},Re={PREFIX:"ship-",HEX_LENGTH:32,TOTAL_LENGTH:37,HINT_LENGTH:4},be={PREFIX:"deploy-",HEX_LENGTH:32,TOTAL_LENGTH:39},$={HEADER:"X-Caller",MAX_LENGTH:128,PATTERN:/^[a-zA-Z0-9._-]+$/},O={API_KEY:Ee.API_KEY,DEPLOY_TOKEN:Ee.TOKEN,OPAQUE:"opaque"};Yt={ACCOUNT_READ:"account:read",DEPLOYMENTS_READ:"deployments:read",DEPLOYMENTS_WRITE:"deployments:write",DOMAINS_READ:"domains:read",DOMAINS_WRITE:"domains:write"},v="ship.json",Ie={rewrites:[{source:"/(.*)",destination:"/index.html"}]},V={INDEX_FILE:"index.html",MAX_INDEX_BYTES:100*1024};ne="https://api.shipstatic.com",Xt={TOKEN:"SHIP_TOKEN",API_URL:"SHIP_API_URL"},Wt="https://my.shipstatic.com/api-key",Jt=4320*60,b={PENDING:"pending",PROCESSING_ERROR:"processing_error",EXCLUDED:"excluded",VALIDATION_FAILED:"validation_failed",READY:"ready"};N={MIN_LENGTH:3,MAX_LENGTH:25,MAX_COUNT:10,SEPARATORS:"._-"},ve=/^[a-z0-9]+(?:[._-][a-z0-9]+)*$/;z={MIN_LENGTH:6,MAX_LENGTH:128}});var Ce=ge((Fe,Oe)=>{"use strict";(function(t){if(typeof Fe=="object")Oe.exports=t();else if(typeof define=="function"&&define.amd)define(t);else{var n;try{n=window}catch{n=self}n.SparkMD5=t()}})(function(t){"use strict";var n=function(u,p){return u+p&4294967295},e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function o(u,p,i,r,a,s){return p=n(n(p,u),n(r,s)),n(p<<a|p>>>32-a,i)}function l(u,p){var i=u[0],r=u[1],a=u[2],s=u[3];i+=(r&a|~r&s)+p[0]-680876936|0,i=(i<<7|i>>>25)+r|0,s+=(i&r|~i&a)+p[1]-389564586|0,s=(s<<12|s>>>20)+i|0,a+=(s&i|~s&r)+p[2]+606105819|0,a=(a<<17|a>>>15)+s|0,r+=(a&s|~a&i)+p[3]-1044525330|0,r=(r<<22|r>>>10)+a|0,i+=(r&a|~r&s)+p[4]-176418897|0,i=(i<<7|i>>>25)+r|0,s+=(i&r|~i&a)+p[5]+1200080426|0,s=(s<<12|s>>>20)+i|0,a+=(s&i|~s&r)+p[6]-1473231341|0,a=(a<<17|a>>>15)+s|0,r+=(a&s|~a&i)+p[7]-45705983|0,r=(r<<22|r>>>10)+a|0,i+=(r&a|~r&s)+p[8]+1770035416|0,i=(i<<7|i>>>25)+r|0,s+=(i&r|~i&a)+p[9]-1958414417|0,s=(s<<12|s>>>20)+i|0,a+=(s&i|~s&r)+p[10]-42063|0,a=(a<<17|a>>>15)+s|0,r+=(a&s|~a&i)+p[11]-1990404162|0,r=(r<<22|r>>>10)+a|0,i+=(r&a|~r&s)+p[12]+1804603682|0,i=(i<<7|i>>>25)+r|0,s+=(i&r|~i&a)+p[13]-40341101|0,s=(s<<12|s>>>20)+i|0,a+=(s&i|~s&r)+p[14]-1502002290|0,a=(a<<17|a>>>15)+s|0,r+=(a&s|~a&i)+p[15]+1236535329|0,r=(r<<22|r>>>10)+a|0,i+=(r&s|a&~s)+p[1]-165796510|0,i=(i<<5|i>>>27)+r|0,s+=(i&a|r&~a)+p[6]-1069501632|0,s=(s<<9|s>>>23)+i|0,a+=(s&r|i&~r)+p[11]+643717713|0,a=(a<<14|a>>>18)+s|0,r+=(a&i|s&~i)+p[0]-373897302|0,r=(r<<20|r>>>12)+a|0,i+=(r&s|a&~s)+p[5]-701558691|0,i=(i<<5|i>>>27)+r|0,s+=(i&a|r&~a)+p[10]+38016083|0,s=(s<<9|s>>>23)+i|0,a+=(s&r|i&~r)+p[15]-660478335|0,a=(a<<14|a>>>18)+s|0,r+=(a&i|s&~i)+p[4]-405537848|0,r=(r<<20|r>>>12)+a|0,i+=(r&s|a&~s)+p[9]+568446438|0,i=(i<<5|i>>>27)+r|0,s+=(i&a|r&~a)+p[14]-1019803690|0,s=(s<<9|s>>>23)+i|0,a+=(s&r|i&~r)+p[3]-187363961|0,a=(a<<14|a>>>18)+s|0,r+=(a&i|s&~i)+p[8]+1163531501|0,r=(r<<20|r>>>12)+a|0,i+=(r&s|a&~s)+p[13]-1444681467|0,i=(i<<5|i>>>27)+r|0,s+=(i&a|r&~a)+p[2]-51403784|0,s=(s<<9|s>>>23)+i|0,a+=(s&r|i&~r)+p[7]+1735328473|0,a=(a<<14|a>>>18)+s|0,r+=(a&i|s&~i)+p[12]-1926607734|0,r=(r<<20|r>>>12)+a|0,i+=(r^a^s)+p[5]-378558|0,i=(i<<4|i>>>28)+r|0,s+=(i^r^a)+p[8]-2022574463|0,s=(s<<11|s>>>21)+i|0,a+=(s^i^r)+p[11]+1839030562|0,a=(a<<16|a>>>16)+s|0,r+=(a^s^i)+p[14]-35309556|0,r=(r<<23|r>>>9)+a|0,i+=(r^a^s)+p[1]-1530992060|0,i=(i<<4|i>>>28)+r|0,s+=(i^r^a)+p[4]+1272893353|0,s=(s<<11|s>>>21)+i|0,a+=(s^i^r)+p[7]-155497632|0,a=(a<<16|a>>>16)+s|0,r+=(a^s^i)+p[10]-1094730640|0,r=(r<<23|r>>>9)+a|0,i+=(r^a^s)+p[13]+681279174|0,i=(i<<4|i>>>28)+r|0,s+=(i^r^a)+p[0]-358537222|0,s=(s<<11|s>>>21)+i|0,a+=(s^i^r)+p[3]-722521979|0,a=(a<<16|a>>>16)+s|0,r+=(a^s^i)+p[6]+76029189|0,r=(r<<23|r>>>9)+a|0,i+=(r^a^s)+p[9]-640364487|0,i=(i<<4|i>>>28)+r|0,s+=(i^r^a)+p[12]-421815835|0,s=(s<<11|s>>>21)+i|0,a+=(s^i^r)+p[15]+530742520|0,a=(a<<16|a>>>16)+s|0,r+=(a^s^i)+p[2]-995338651|0,r=(r<<23|r>>>9)+a|0,i+=(a^(r|~s))+p[0]-198630844|0,i=(i<<6|i>>>26)+r|0,s+=(r^(i|~a))+p[7]+1126891415|0,s=(s<<10|s>>>22)+i|0,a+=(i^(s|~r))+p[14]-1416354905|0,a=(a<<15|a>>>17)+s|0,r+=(s^(a|~i))+p[5]-57434055|0,r=(r<<21|r>>>11)+a|0,i+=(a^(r|~s))+p[12]+1700485571|0,i=(i<<6|i>>>26)+r|0,s+=(r^(i|~a))+p[3]-1894986606|0,s=(s<<10|s>>>22)+i|0,a+=(i^(s|~r))+p[10]-1051523|0,a=(a<<15|a>>>17)+s|0,r+=(s^(a|~i))+p[1]-2054922799|0,r=(r<<21|r>>>11)+a|0,i+=(a^(r|~s))+p[8]+1873313359|0,i=(i<<6|i>>>26)+r|0,s+=(r^(i|~a))+p[15]-30611744|0,s=(s<<10|s>>>22)+i|0,a+=(i^(s|~r))+p[6]-1560198380|0,a=(a<<15|a>>>17)+s|0,r+=(s^(a|~i))+p[13]+1309151649|0,r=(r<<21|r>>>11)+a|0,i+=(a^(r|~s))+p[4]-145523070|0,i=(i<<6|i>>>26)+r|0,s+=(r^(i|~a))+p[11]-1120210379|0,s=(s<<10|s>>>22)+i|0,a+=(i^(s|~r))+p[2]+718787259|0,a=(a<<15|a>>>17)+s|0,r+=(s^(a|~i))+p[9]-343485551|0,r=(r<<21|r>>>11)+a|0,u[0]=i+u[0]|0,u[1]=r+u[1]|0,u[2]=a+u[2]|0,u[3]=s+u[3]|0}function c(u){var p=[],i;for(i=0;i<64;i+=4)p[i>>2]=u.charCodeAt(i)+(u.charCodeAt(i+1)<<8)+(u.charCodeAt(i+2)<<16)+(u.charCodeAt(i+3)<<24);return p}function d(u){var p=[],i;for(i=0;i<64;i+=4)p[i>>2]=u[i]+(u[i+1]<<8)+(u[i+2]<<16)+(u[i+3]<<24);return p}function h(u){var p=u.length,i=[1732584193,-271733879,-1732584194,271733878],r,a,s,I,_,x;for(r=64;r<=p;r+=64)l(i,c(u.substring(r-64,r)));for(u=u.substring(r-64),a=u.length,s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=0;r<a;r+=1)s[r>>2]|=u.charCodeAt(r)<<(r%4<<3);if(s[r>>2]|=128<<(r%4<<3),r>55)for(l(i,s),r=0;r<16;r+=1)s[r]=0;return I=p*8,I=I.toString(16).match(/(.*?)(.{0,8})$/),_=parseInt(I[2],16),x=parseInt(I[1],16)||0,s[14]=_,s[15]=x,l(i,s),i}function f(u){var p=u.length,i=[1732584193,-271733879,-1732584194,271733878],r,a,s,I,_,x;for(r=64;r<=p;r+=64)l(i,d(u.subarray(r-64,r)));for(u=r-64<p?u.subarray(r-64):new Uint8Array(0),a=u.length,s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=0;r<a;r+=1)s[r>>2]|=u[r]<<(r%4<<3);if(s[r>>2]|=128<<(r%4<<3),r>55)for(l(i,s),r=0;r<16;r+=1)s[r]=0;return I=p*8,I=I.toString(16).match(/(.*?)(.{0,8})$/),_=parseInt(I[2],16),x=parseInt(I[1],16)||0,s[14]=_,s[15]=x,l(i,s),i}function g(u){var p="",i;for(i=0;i<4;i+=1)p+=e[u>>i*8+4&15]+e[u>>i*8&15];return p}function y(u){var p;for(p=0;p<u.length;p+=1)u[p]=g(u[p]);return u.join("")}y(h("hello"))!=="5d41402abc4b2a76b9719d911017c592"&&(n=function(u,p){var i=(u&65535)+(p&65535),r=(u>>16)+(p>>16)+(i>>16);return r<<16|i&65535}),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&(function(){function u(p,i){return p=p|0||0,p<0?Math.max(p+i,0):Math.min(p,i)}ArrayBuffer.prototype.slice=function(p,i){var r=this.byteLength,a=u(p,r),s=r,I,_,x,ye;return i!==t&&(s=u(i,r)),a>s?new ArrayBuffer(0):(I=s-a,_=new ArrayBuffer(I),x=new Uint8Array(_),ye=new Uint8Array(this,a,I),x.set(ye),_)}})();function E(u){return/[\u0080-\uFFFF]/.test(u)&&(u=unescape(encodeURIComponent(u))),u}function S(u,p){var i=u.length,r=new ArrayBuffer(i),a=new Uint8Array(r),s;for(s=0;s<i;s+=1)a[s]=u.charCodeAt(s);return p?a:r}function L(u){return String.fromCharCode.apply(null,new Uint8Array(u))}function C(u,p,i){var r=new Uint8Array(u.byteLength+p.byteLength);return r.set(new Uint8Array(u)),r.set(new Uint8Array(p),u.byteLength),i?r:r.buffer}function F(u){var p=[],i=u.length,r;for(r=0;r<i-1;r+=2)p.push(parseInt(u.substr(r,2),16));return String.fromCharCode.apply(String,p)}function D(){this.reset()}return D.prototype.append=function(u){return this.appendBinary(E(u)),this},D.prototype.appendBinary=function(u){this._buff+=u,this._length+=u.length;var p=this._buff.length,i;for(i=64;i<=p;i+=64)l(this._hash,c(this._buff.substring(i-64,i)));return this._buff=this._buff.substring(i-64),this},D.prototype.end=function(u){var p=this._buff,i=p.length,r,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],s;for(r=0;r<i;r+=1)a[r>>2]|=p.charCodeAt(r)<<(r%4<<3);return this._finish(a,i),s=y(this._hash),u&&(s=F(s)),this.reset(),s},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(u){return this._buff=u.buff,this._length=u.length,this._hash=u.hash,this},D.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},D.prototype._finish=function(u,p){var i=p,r,a,s;if(u[i>>2]|=128<<(i%4<<3),i>55)for(l(this._hash,u),i=0;i<16;i+=1)u[i]=0;r=this._length*8,r=r.toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(r[2],16),s=parseInt(r[1],16)||0,u[14]=a,u[15]=s,l(this._hash,u)},D.hash=function(u,p){return D.hashBinary(E(u),p)},D.hashBinary=function(u,p){var i=h(u),r=y(i);return p?F(r):r},D.ArrayBuffer=function(){this.reset()},D.ArrayBuffer.prototype.append=function(u){var p=C(this._buff.buffer,u,!0),i=p.length,r;for(this._length+=u.byteLength,r=64;r<=i;r+=64)l(this._hash,d(p.subarray(r-64,r)));return this._buff=r-64<i?new Uint8Array(p.buffer.slice(r-64)):new Uint8Array(0),this},D.ArrayBuffer.prototype.end=function(u){var p=this._buff,i=p.length,r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a,s;for(a=0;a<i;a+=1)r[a>>2]|=p[a]<<(a%4<<3);return this._finish(r,i),s=y(this._hash),u&&(s=F(s)),this.reset(),s},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 u=D.prototype.getState.call(this);return u.buff=L(u.buff),u},D.ArrayBuffer.prototype.setState=function(u){return u.buff=S(u.buff,!0),D.prototype.setState.call(this,u)},D.ArrayBuffer.prototype.destroy=D.prototype.destroy,D.ArrayBuffer.prototype._finish=D.prototype._finish,D.ArrayBuffer.hash=function(u,p){var i=f(new Uint8Array(u)),r=y(i);return p?F(r):r},D})});var q=ge((hn,$e)=>{"use strict";$e.exports={}});async function Pt(t){let n=(await Promise.resolve().then(()=>k(Ce(),1))).default,e=new n.ArrayBuffer,o=2097152;for(let l=0;l<t.size;l+=o){let c=Math.min(l+o,t.size);e.append(await t.slice(l,c).arrayBuffer())}return{md5:e.end()}}async function _t(t){let{createHash:n}=await Promise.resolve().then(()=>k(q(),1)),e=n("md5");return e.update(t),{md5:e.digest("hex")}}async function vt(t){let{createHash:n}=await Promise.resolve().then(()=>k(q(),1)),{createReadStream:e}=await Promise.resolve().then(()=>k(q(),1));return new Promise((o,l)=>{let c=n("md5"),d=e(t);d.on("error",h=>l(m.file(`Failed to read file for MD5: ${h.message}`,{filePath:t}))),d.on("data",h=>c.update(h)),d.on("end",()=>o({md5:c.digest("hex")}))})}async function B(t){if(t instanceof Blob)return Pt(t);if(typeof Buffer<"u"&&Buffer.isBuffer(t))return _t(t);if(typeof t=="string")return vt(t);throw m.business("Invalid input for MD5 calculation")}var X=w(()=>{"use strict";R()});function J(t){return t.replace(/\\/g,"/").replace(/\/+/g,"/").replace(/^\/+/,"")}var ze=w(()=>{"use strict"});function Ke(t,n={}){if(n.flatten===!1)return t.map(o=>({path:J(o),name:se(o)}));let e=Nt(t);return t.map(o=>{let l=J(o);if(e){let c=e.endsWith("/")?e:`${e}/`;l.startsWith(c)&&(l=l.substring(c.length))}return l||(l=se(o)),{path:l,name:se(o)}})}function Nt(t){if(!t.length)return"";let e=t.map(c=>J(c)).map(c=>c.split("/")),o=[],l=Math.min(...e.map(c=>c.length));for(let c=0;c<l-1;c++){let d=e[0][c];if(e.every(h=>h[c]===d))o.push(d);else break}return o.join("/")}function se(t){return t.split(/[/\\]/).pop()||t}var oe=w(()=>{"use strict";ze()});function Cn(t){ae=t}function Ft(){return typeof process<"u"&&process.versions&&process.versions.node?"node":typeof window<"u"||typeof self<"u"?"browser":"unknown"}function Ve(){return ae||Ft()}var ae,le=w(()=>{"use strict";ae=null});function Z(t,n){return Ot.find(e=>e.broken(t,n))}var Ot,ue=w(()=>{"use strict";R();ce();Ot=[{name:"name",broken:({path:t})=>!pe(t).valid,sentence:({path:t})=>pe(t).reason??"Invalid file name"},{name:"extension",broken:({path:t},n)=>Te(t,n.blockedExtensions??[]),sentence:({path:t})=>`File extension not allowed: "${t}"`},{name:"fileSize",broken:({size:t},n)=>t>n.maxFileSize,sentence:({path:t},n)=>`File "${t}" too large. Maximum ${Q(n.maxFileSize)} allowed`},{name:"totalSize",broken:({totalSize:t},n)=>t>n.maxTotalSize,sentence:({totalSize:t},n)=>`Total upload size too large. ${Q(t)} exceeds maximum of ${Q(n.maxTotalSize)}`}]});function Q(t,n=1){if(t===0)return"0 Bytes";let e=1024,o=["Bytes","KB","MB","GB"],l=Math.floor(Math.log(t)/Math.log(e));return`${parseFloat((t/e**l).toFixed(n))} ${o[l]}`}function pe(t){if(Se(t))return{valid:!1,reason:"File name contains unsafe characters"};if(t.startsWith(" ")||t.endsWith(" "))return{valid:!1,reason:"File name cannot start/end with spaces"};if(t.endsWith("."))return{valid:!1,reason:"File name cannot end with dots"};let n=/^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(\.|$)/i,e=t.split("/").pop()||t;return n.test(e)?{valid:!1,reason:"File name uses a reserved system name"}:t.includes("..")?{valid:!1,reason:"File name contains path traversal pattern"}:{valid:!0}}function Gn(t,n){let e=[],o=[],l=[];if(t.length===0){let f={file:"(no files)",message:"At least one file must be provided"};return e.push(f),{files:[],validFiles:[],errors:e,warnings:[],canDeploy:!1}}for(let f of t)if(K(f.name))return e.push({file:f.name,message:"Unbuilt project detected \u2014 deploy your build output (dist/, build/, out/), not the project folder"}),{files:t.map(g=>({...g,status:b.VALIDATION_FAILED,statusMessage:"Unbuilt project detected"})),validFiles:[],errors:e,warnings:[],canDeploy:!1};if(t.length>n.maxFilesCount){let f={file:`(${t.length} files)`,message:`File count (${t.length}) exceeds limit of ${n.maxFilesCount}`};return e.push(f),{files:t.map(g=>({...g,status:b.VALIDATION_FAILED,statusMessage:f.message})),validFiles:[],errors:e,warnings:[],canDeploy:!1}}let c=0;for(let f of t){let g=b.READY,y="Ready for upload";if(f.status===b.PROCESSING_ERROR)g=b.VALIDATION_FAILED,y=f.statusMessage||"File failed during processing",e.push({file:f.name,message:y});else if(f.size===0){g=b.EXCLUDED,y="File is empty (0 bytes) and cannot be deployed due to storage limitations",o.push({file:f.name,message:y}),l.push({...f,status:g,statusMessage:y});continue}else if(f.size<0)g=b.VALIDATION_FAILED,y="File size must be positive",e.push({file:f.name,message:y});else if(!f.name||f.name.trim().length===0)g=b.VALIDATION_FAILED,y="File name cannot be empty",e.push({file:f.name||"(empty)",message:y});else if(f.name.includes("\0"))g=b.VALIDATION_FAILED,y="File name contains invalid characters (null byte)",e.push({file:f.name,message:y});else{let E={path:f.name,size:f.size,totalSize:c+f.size},S=Z(E,n);S?(g=b.VALIDATION_FAILED,y=S.sentence(E,n),e.push({file:S.name==="totalSize"?`(${t.length} files)`:f.name,message:y})):c=E.totalSize}l.push({...f,status:g,statusMessage:y})}e.length>0&&(l=l.map(f=>f.status===b.EXCLUDED?f:{...f,status:b.VALIDATION_FAILED,statusMessage:f.status===b.VALIDATION_FAILED?f.statusMessage:"Deployment failed due to validation errors in bundle"}));let d=e.length===0?l.filter(f=>f.status===b.READY):[],h=e.length===0;return{files:l,validFiles:d,errors:e,warnings:o,canDeploy:h}}function Ct(t){return t.filter(n=>n.status===b.READY)}function zn(t){return Ct(t).length>0}var ce=w(()=>{"use strict";R();ue()});function Ye(t){return Ut.test(t)}var $t,Ut,je=w(()=>{"use strict";$t=["^npm-debug\\.log$","^\\..*\\.swp$","^\\.DS_Store$","^\\.AppleDouble$","^\\.LSOverride$","^Icon\\r$","^\\._.*","^\\.Spotlight-V100(?:$|\\/)","\\.Trashes","^__MACOSX$","~$","^Thumbs\\.db$","^ehthumbs\\.db$","^[Dd]esktop\\.ini$","@eaDir$"],Ut=new RegExp($t.join("|"))});function qe(t,n){if(!t||t.length===0)return[];if(!n?.allowUnbuilt&&t.find(o=>o&&K(o)))throw m.business("Unbuilt project detected \u2014 deploy your build output (dist/, build/, out/), not the project folder");return t.filter(e=>{if(!e)return!1;let o=e.replace(/\\/g,"/").split("/").filter(Boolean);if(o.length===0)return!0;let l=o[o.length-1];if(Ye(l))return!1;for(let d of o)if(d!==".well-known"&&(d.startsWith(".")||d.length>255))return!1;let c=o.slice(0,-1);for(let d of c)if(Mt.some(h=>d.toLowerCase()===h.toLowerCase()))return!1;return!0})}var Mt,fe=w(()=>{"use strict";R();je();Mt=["__MACOSX",".Trashes",".fseventsd",".Spotlight-V100"]});function Xe(t,n){if(t.includes("\0")||t.includes("/../")||t.startsWith("../")||t.endsWith("/.."))throw m.business(`Security error: Unsafe file path "${t}" for file: ${n}`)}function We(t,n){let e=Z(t,n);if(e)throw m.business(e.sentence(t,n))}var de=w(()=>{"use strict";R();ue()});var Qe={};st(Qe,{processFilesForBrowser:()=>Je});async function Je(t,n={},e){if(Ve()!=="browser")throw m.business("processFilesForBrowser can only be called in a browser environment.");let o=t.map(E=>E.webkitRelativePath||E.name),l=n.build||n.prerender,c=Ke(o,{flatten:n.pathDetect!==!1}),d=c.map(E=>E.path),h=new Set(qe(d,{allowUnbuilt:l})),f=[];for(let E=0;E<t.length;E++)h.has(d[E])&&f.push({file:t[E],deployPath:c[E].path});if(f.length===0)return[];if(l){let E=[];for(let S=0;S<f.length;S++){let{file:L,deployPath:C}=f[S];if(L.size===0)continue;let{md5:F}=await B(L);E.push({path:C,content:L,size:L.size,md5:F})}return E}if(!e)throw m.config("Platform limits not provided. processFilesForBrowser requires the limits argument for deploy-mode validation \u2014 pass `ship.getLimits()` result.");let g=[],y=0;for(let E=0;E<f.length;E++){let{file:S,deployPath:L}=f[E];if(Xe(L,S.name),S.size===0)continue;y+=S.size,We({path:L,size:S.size,totalSize:y},e);let{md5:C}=await B(S);g.push({path:L,content:S,size:S.size,md5:C})}if(g.length>e.maxFilesCount)throw m.business(`Too many files to deploy. Maximum allowed is ${e.maxFilesCount} files.`);return g}var me=w(()=>{"use strict";R();oe();le();fe();X();de()});R();R();R();var Y=class{constructor(){this.handlers=new Map}on(n,e){this.handlers.has(n)||this.handlers.set(n,new Set),this.handlers.get(n)?.add(e)}off(n,e){let o=this.handlers.get(n);o&&(o.delete(e),o.size===0&&this.handlers.delete(n))}emit(n,...e){let o=this.handlers.get(n);if(!o)return;let l=Array.from(o);for(let c of l)try{c(...e)}catch(d){o.delete(c),n!=="error"&&setTimeout(()=>{let h=d instanceof Error?d:new Error(String(d));this.emit("error",h,String(n))},0)}}};R();R();function M(t){if(t==null)return;if(t.length===0)return t;if(t.length>N.MAX_COUNT)throw m.validation(`Maximum ${N.MAX_COUNT} labels allowed`);let n=t.map((o,l)=>{if(typeof o!="string")throw m.validation(`Label at index ${l} must be a string`);let c=o.trim().toLowerCase();if(c.length<N.MIN_LENGTH)throw m.validation(`Labels must be at least ${N.MIN_LENGTH} characters long`);if(c.length>N.MAX_LENGTH)throw m.validation(`Labels must be no more than ${N.MAX_LENGTH} characters long`);if(!ve.test(c))throw m.validation(`Labels must start and end with alphanumeric characters, with optional separators (${N.SEPARATORS}) between segments`);return c}),e=[...new Set(n)];if(e.length!==n.length)throw m.validation("Duplicate labels are not allowed");return e}async function xe(t){let n=t.find(l=>l.path===v||l.path===`/${v}`);if(!n)return;let e=n.content,o=typeof e.text=="function"?await e.text():n.content.toString("utf8");we(o)}var At=3e4,Dt=2,Tt=300,St=2e3,Rt=new Set([500,502,503,504]);function bt(t,n){return new Promise((e,o)=>{if(n?.aborted){o(n.reason);return}let l=()=>{clearTimeout(d),n?.removeEventListener("abort",c)},c=()=>{l(),o(n?.reason)},d=setTimeout(()=>{l(),e()},t);n?.addEventListener("abort",c)})}var Ne=3e5,It=3e5,wt=Ne+It,Lt="sdk";function ie(t){let n=new URLSearchParams;t?.limit!==void 0&&n.set("limit",String(t.limit)),t?.cursor!==void 0&&n.set("cursor",t.cursor);let e=n.toString();return e?`?${e}`:""}var j=class extends Y{constructor(e){super();this.globalHeaders={};this.apiUrl=e.apiUrl||ne,this.getAuthHeadersCallback=e.getAuthHeaders,this.session=e.session??!1,this.caller=e.caller,this.timeout=e.timeout??At,this.maxRetries=Math.max(0,e.maxRetries??Dt),this.deployTimeout=e.timeout??Ne,this.deployBuildTimeout=e.timeout??wt,this.fetch=e.fetch??globalThis.fetch.bind(globalThis),this.createDeployBody=e.createDeployBody,this.deployEndpoint=e.deployEndpoint||T.DEPLOYMENTS}setGlobalHeaders(e){this.globalHeaders=e}async executeRequest(e,o,l,c=this.timeout){for(let d=0;;d++)try{return await this.attemptOnce(e,o,l,c)}catch(h){let f=m.fromFetchError(h,l);if(d>=this.maxRetries||!this.isRetryable(f,o))throw f;let g=Math.min(St,Tt*2**d);try{await bt(Math.random()*g,o.signal)}catch(y){let E=m.fromFetchError(y,l);throw this.emit("error",E,e),E}}}isRetryable(e,o){if(o.signal?.aborted||e.isType(A.Maintenance)||e.isType(A.Cancelled)||!(e.isNetworkError()||e.status!==void 0&&Rt.has(e.status)))return!1;let c=(o.method??"GET").toUpperCase();return c==="GET"||c==="HEAD"?!0:c==="PUT"||c==="DELETE"?!1:this.hasIdempotencyKey(o.headers)}hasIdempotencyKey(e){if(!e)return!1;let o=U.HEADER.toLowerCase(),l=!1,c=d=>{d.toLowerCase()===o&&(l=!0)};if(e instanceof Headers)e.forEach((d,h)=>{c(h)});else if(Array.isArray(e))for(let[d]of e)c(d);else for(let d of Object.keys(e))c(d);return l}async attemptOnce(e,o,l,c=this.timeout){let d=()=>{};try{let h=await this.mergeHeaders(o.headers),f=this.createTimeoutSignal(o.signal,c);d=f.cleanup;let g={...o,headers:h,credentials:this.session&&!h.Authorization?"include":void 0,signal:f.signal};this.emit("request",e,g);let y=await this.fetch(e,g);if(d(),!y.ok)throw await m.fromHttpResponse(y,l);return this.emit("response",this.safeClone(y),e),{data:await this.parseResponse(this.safeClone(y)),status:y.status}}catch(h){d();let f=m.fromFetchError(h,l);throw this.emit("error",f,e),f}}async request(e,o,l,c){let{data:d}=await this.executeRequest(e,o,l,c);return d}async requestWithStatus(e,o,l){return this.executeRequest(e,o,l)}async mergeHeaders(e={}){return{...this.globalHeaders,...this.caller?{[$.HEADER]:this.caller}:{},...await this.getAuthHeadersCallback(),...e}}createTimeoutSignal(e,o=this.timeout){let l=new AbortController,c=setTimeout(()=>l.abort(new DOMException(`Timed out after ${o}ms`,"TimeoutError")),o),d=e?()=>l.abort(e.reason):void 0;return e&&d&&(e.addEventListener("abort",d),e.aborted&&l.abort(e.reason)),{signal:l.signal,cleanup:()=>{clearTimeout(c),e&&d&&e.removeEventListener("abort",d)}}}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 deploy(e,o={}){if(!e.length)throw m.business("No files to deploy");for(let g of e)if(!g.md5)throw m.file(`MD5 checksum missing for file: ${g.path}`,{filePath:g.path});re(o.password);let l=Ae(o.idempotencyKey),c=M(o.labels);await xe(e);let d=o.build||o.prerender||o.spa?{build:o.build,prerender:o.prerender,spa:o.spa}:void 0,{body:h,headers:f}=await this.createDeployBody(e,{labels:c,via:o.via??Lt,password:o.password,flags:d,captcha:o.captcha});return this.request(`${this.apiUrl}${this.deployEndpoint}`,{method:"POST",body:h,headers:l?{...f,[U.HEADER]:l}:f,signal:o.signal||null},"Deploy",o.build||o.prerender?this.deployBuildTimeout:this.deployTimeout)}async listDeployments(e){return this.request(`${this.apiUrl}${T.DEPLOYMENTS}${ie(e)}`,{method:"GET"},"List deployments")}async getDeployment(e){return this.request(`${this.apiUrl}${T.DEPLOYMENT(encodeURIComponent(e))}`,{method:"GET"},"Get deployment")}async updateDeploymentLabels(e,o){let l=M(o);return this.request(`${this.apiUrl}${T.DEPLOYMENT(encodeURIComponent(e))}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({labels:l})},"Update deployment labels")}async deleteDeployment(e){return this.request(`${this.apiUrl}${T.DEPLOYMENT(encodeURIComponent(e))}`,{method:"DELETE"},"Delete deployment")}async setDomain(e,o,l){let c=M(l),d={};o&&(d.deployment=o),c!==void 0&&(d.labels=c);let{data:h,status:f}=await this.requestWithStatus(`${this.apiUrl}${T.DOMAIN(encodeURIComponent(e))}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)},"Set domain");return{...h,isCreate:f===201}}async listDomains(e){return this.request(`${this.apiUrl}${T.DOMAINS}${ie(e)}`,{method:"GET"},"List domains")}async getDomain(e){return this.request(`${this.apiUrl}${T.DOMAIN(encodeURIComponent(e))}`,{method:"GET"},"Get domain")}async deleteDomain(e){return this.request(`${this.apiUrl}${T.DOMAIN(encodeURIComponent(e))}`,{method:"DELETE"},"Delete domain")}async verifyDomain(e){return this.request(`${this.apiUrl}${T.DOMAIN_VERIFY(encodeURIComponent(e))}`,{method:"POST"},"Verify domain")}async getDomainDns(e){return this.request(`${this.apiUrl}${T.DOMAIN_DNS(encodeURIComponent(e))}`,{method:"GET"},"Get domain DNS")}async getDomainRecords(e){return this.request(`${this.apiUrl}${T.DOMAIN_RECORDS(encodeURIComponent(e))}`,{method:"GET"},"Get domain records")}async getDomainShare(e){return this.request(`${this.apiUrl}${T.DOMAIN_SHARE(encodeURIComponent(e))}`,{method:"GET"},"Get domain share")}async validateDomain(e){return this.request(`${this.apiUrl}${T.DOMAINS_VALIDATE}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({domain:e})},"Validate domain")}async createToken(e,o){let l=M(o),c={};return e!==void 0&&(c.ttl=e),l!==void 0&&(c.labels=l),this.request(`${this.apiUrl}${T.TOKENS}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)},"Create token")}async listTokens(e){return this.request(`${this.apiUrl}${T.TOKENS}${ie(e)}`,{method:"GET"},"List tokens")}async deleteToken(e){return this.request(`${this.apiUrl}${T.TOKEN(encodeURIComponent(e))}`,{method:"DELETE"},"Delete token")}async getToken(e){return this.request(`${this.apiUrl}${T.TOKEN(encodeURIComponent(e))}`,{method:"GET"},"Get token")}async getAccount(){return this.request(`${this.apiUrl}${T.ACCOUNT}`,{method:"GET"},"Get account")}async getLimits(){return this.request(`${this.apiUrl}${T.LIMITS}`,{method:"GET"},"Get limits")}async ping(){return this.request(`${this.apiUrl}${T.PING}`,{method:"GET"},"Ping")}async checkSPA(e,o={}){let l=e.find(f=>f.path===V.INDEX_FILE||f.path===`/${V.INDEX_FILE}`);if(!l||l.size>V.MAX_INDEX_BYTES)return!1;let c;if(typeof Buffer<"u"&&Buffer.isBuffer(l.content))c=l.content.toString("utf-8");else if(typeof Blob<"u"&&l.content instanceof Blob)c=await l.content.text();else if(typeof File<"u"&&l.content instanceof File)c=await l.content.text();else return!1;let d={files:e.map(f=>f.path),index:c};return(await this.request(`${this.apiUrl}${T.SPA_CHECK}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)},"SPA check")).isSPA}};R();R();X();async function xt(){let t=JSON.stringify(Ie,null,2),n;typeof Buffer<"u"?n=Buffer.from(t,"utf-8"):n=new Blob([t],{type:"application/json"});let{md5:e}=await B(n);return{path:v,content:n,size:t.length,md5:e}}async function Ue(t,n,e){if(e.spaDetect===!1||e.spa||e.build||e.prerender||t.some(o=>o.path===v))return t;try{if(await n.checkSPA(t,e)){let l=await xt();return[...t,l]}}catch{}return t}function Me(t){let{getApi:n,ensureInit:e,processInput:o}=t;return{upload:async(l,c={})=>{if(await e(),!o)throw m.config("processInput function is not provided.");let d=n(),h=await o(l,c);return h=await Ue(h,d,c),d.deploy(h,c)},list:async l=>(await e(),n().listDeployments(l)),get:async l=>(await e(),n().getDeployment(l)),set:async(l,c)=>(await e(),n().updateDeploymentLabels(l,c.labels)),delete:async l=>(await e(),n().deleteDeployment(l))}}function Be(t){let{getApi:n,ensureInit:e}=t;return{set:async(o,l={})=>(await e(),n().setDomain(o,l.deployment,l.labels)),list:async o=>(await e(),n().listDomains(o)),get:async o=>(await e(),n().getDomain(o)),delete:async o=>(await e(),n().deleteDomain(o)),verify:async o=>(await e(),n().verifyDomain(o)),validate:async o=>(await e(),n().validateDomain(o)),dns:async o=>(await e(),n().getDomainDns(o)),records:async o=>(await e(),n().getDomainRecords(o)),share:async o=>(await e(),n().getDomainShare(o))}}function He(t){let{getApi:n,ensureInit:e}=t;return{get:async()=>(await e(),n().getAccount())}}function ke(t){let{getApi:n,ensureInit:e}=t;return{create:async(o={})=>(await e(),n().createToken(o.ttl,o.labels)),list:async o=>(await e(),n().listTokens(o)),get:async o=>(await e(),n().getToken(o)),delete:async o=>(await e(),n().deleteToken(o))}}var W=class{constructor(n={}){this.initPromise=null;this.platformLimits=null;this.credential=null;if(n={...n,apiUrl:n.apiUrl||void 0,token:n.token||void 0,caller:n.caller||void 0},this.clientOptions=n,n.caller!==void 0&&Pe(n.caller),n.token&&n.session)throw m.config("Provide either `token` or `session`, not both.");typeof n.token=="string"?(te(n.token),this.credential=n.token):n.token&&(this.credential=n.token),this.http=new j({...n,getAuthHeaders:()=>this.getAuthHeaders(),createDeployBody:this.getDeployBodyCreator()});let e={getApi:()=>this.http,ensureInit:()=>this.ensureInitialized()};this.deployments=Me({...e,processInput:(o,l)=>this.processInput(o,l)}),this.domains=Be(e),this.account=He(e),this.tokens=ke(e)}async ensureInitialized(){return this.initPromise||(this.initPromise=this.fetchPlatformLimits()),this.initPromise}async fetchPlatformLimits(){try{this.platformLimits=await this.http.getLimits()}catch(n){throw this.initPromise=null,n}}async ping(){return await this.ensureInitialized(),this.http.ping()}async deploy(n,e){return this.deployments.upload(n,e)}async whoami(){return this.account.get()}async getLimits(){return this.platformLimits?this.platformLimits:(await this.ensureInitialized(),this.platformLimits)}on(n,e){this.http.on(n,e)}off(n,e){this.http.off(n,e)}setHeaders(n){this.http.setGlobalHeaders(n)}clearHeaders(){this.http.setGlobalHeaders({})}setToken(n){if(this.clientOptions.session)throw m.config("Provide either `token` or `session`, not both.");if(typeof n=="string"){if(!n)throw m.business("Invalid token provided. Token must be a non-empty string.");te(n),this.credential=n;return}if(typeof n!="function")throw m.business("Invalid token provided. Token must be a non-empty string or a provider function.");this.credential=n}async getAuthHeaders(){if(this.credential===null)return{};let n=typeof this.credential=="function"?await this.credential():this.credential;if(!n)throw m.authentication("Token provider returned no token.");if(typeof n!="string")throw m.authentication("Token provider returned a non-string value.");return{Authorization:`Bearer ${n}`}}};R();async function Ge(t,n={}){let{labels:e,via:o,password:l,flags:c,captcha:d}=n,h=new FormData,f=[];for(let g of t){if(!(g.content instanceof File||g.content instanceof Blob))throw m.file(`Unsupported file.content type for browser: ${g.path}`,{filePath:g.path});if(!g.md5)throw m.file(`File missing md5 checksum: ${g.path}`,{filePath:g.path});let y=new File([g.content],g.path,{type:"application/octet-stream"});h.append(P.FILES,y),f.push(g.md5)}return h.append(P.CHECKSUMS,JSON.stringify(f)),e&&e.length>0&&h.append(P.LABELS,JSON.stringify(e)),o&&h.append(P.VIA,o),l&&h.append(P.PASSWORD,l),c?.build&&h.append(P.BUILD,"true"),c?.prerender&&h.append(P.PRERENDER,"true"),c?.spa&&h.append(P.SPA,"true"),d&&h.append(P.CAPTCHA,d),{body:h,headers:{}}}R();R();oe();le();ce();fe();X();de();function Qn(t,n,e,o=!0){let l=t===1?n:e;return o?`${t} ${l}`:l}me();var he=class extends W{async deploy(n,e){return super.deploy(n,e)}async processInput(n,e){if(!Array.isArray(n)||!n.every(l=>l instanceof File))throw m.business("Invalid input type for browser environment. Expected File[].");if(n.length===0)throw m.business("No files to deploy.");let{processFilesForBrowser:o}=await Promise.resolve().then(()=>(me(),Qe));return o(n,e,this.platformLimits??void 0)}getDeployBodyCreator(){return Ge}},Sr=he;export{Re as API_KEY,T as API_PATHS,Vt as AUTH_BASE_PATH,zt as AccountPlan,j as ApiHttp,Ee as AuthMethod,$ as CALLER,ne as DEFAULT_API,v as DEPLOYMENT_CONFIG_FILENAME,P as DEPLOY_FIELDS,be as DEPLOY_TOKEN,Ht as DeploymentStatus,at as DeploymentVia,kt as DomainStatus,A as ErrorType,b as FILE_VALIDATION_STATUS,b as FileValidationStatus,U as IDEMPOTENCY_KEY_CONSTRAINTS,Mt as JUNK_DIRECTORIES,N as LABEL_CONSTRAINTS,ve as LABEL_PATTERN,Wt as MY_API_KEY_URL,Yt as OAuthScope,z as PASSWORD_CONSTRAINTS,Jt as PUBLIC_DEPLOYMENT_TTL_SECONDS,Xt as SHIP_ENV,V as SPA_CHECK_CONSTRAINTS,Ie as SPA_DEFAULT_CONFIG,he as Ship,m as ShipError,O as TokenKind,ht as UNBUILT_PROJECT_MARKERS,mt as UNSAFE_FILENAME_CHARS,Kt as WEB_FILE_ACCEPT,Cn as __setTestEnvironment,zn as allValidFilesReady,we as assertShipJsonSyntax,B as calculateMD5,yt as classifyToken,He as createAccountResource,Me as createDeploymentResource,Be as createDomainResource,ke as createTokenResource,Sr as default,rn as deserializeLabels,Zt as extractSubdomain,qe as filterJunk,Q as formatFileSize,en as generateDeploymentUrl,tn as generateDomainUrl,Ve as getENV,Ct as getValidFiles,K as hasUnbuiltMarker,Se as hasUnsafeChars,Te as isBlockedExtension,Qt as isCustomDomain,qt as isDeployment,_e as isPlatformDomain,De as isShipError,Gt as normalizeVia,Ke as optimizeDeployPaths,Qn as pluralize,Je as processFilesForBrowser,nn as serializeLabels,gt as validateApiKey,jt as validateApiUrl,Pe as validateCaller,We as validateDeployFile,Xe as validateDeployPath,Et as validateDeployToken,pe as validateFileName,Gn as validateFiles,Ae as validateIdempotencyKey,re as validatePassword,te as validateToken};
1
+ var Ze=Object.create;var H=Object.defineProperty;var et=Object.getOwnPropertyDescriptor;var tt=Object.getOwnPropertyNames;var nt=Object.getPrototypeOf,rt=Object.prototype.hasOwnProperty;var it=(t,n,e)=>n in t?H(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var w=(t,n)=>()=>(t&&(n=t(t=0)),n);var ge=(t,n)=>()=>(n||t((n={exports:{}}).exports,n),n.exports),st=(t,n)=>{for(var e in n)H(t,e,{get:n[e],enumerable:!0})},ot=(t,n,e,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of tt(n))!rt.call(t,l)&&l!==e&&H(t,l,{get:()=>n[l],enumerable:!(o=et(n,l))||o.enumerable});return t};var G=(t,n,e)=>(e=t!=null?Ze(nt(t)):{},ot(n||!t||!t.__esModule?H(e,"default",{value:t,enumerable:!0}):e,t));var k=(t,n,e)=>it(t,typeof n!="symbol"?n+"":n,e);function kt(t){if(!t||typeof t!="string")return;let n=t.trim().toLowerCase();return Object.values(at).includes(n)?n:void 0}function Ae(t){if(t==null)return;if(typeof t!="string")throw m.validation("Idempotency key must be a string.");let n=t.trim();if(!n)throw m.validation("Idempotency key must not be empty.");if(n.length>U.MAX_LENGTH)throw m.validation(`Idempotency key must be at most ${U.MAX_LENGTH} characters.`);return n}function ct(t){let n=t.code;return n==="ERR_INVALID_URL"?!1:typeof n=="string"?!0:t instanceof TypeError?!/\burl\b/i.test(t.message):!1}function De(t){return t!==null&&typeof t=="object"&&"name"in t&&t.name==="ShipError"&&"status"in t}function ft(t){let n=t.replace(/\\/g,"/").split("/").pop()??"",e=n.lastIndexOf(".");return e<=0||e===n.length-1?null:n.slice(e+1).toLowerCase()}function Te(t,n){let e=ft(t);return e===null?!1:Array.isArray(n)?n.includes(e):n.has(e)}function Se(t){return mt.test(t)}function K(t){return t.replace(/\\/g,"/").split("/").filter(Boolean).some(e=>ht.has(e))}function yt(t){return t.startsWith(Re.PREFIX)?O.API_KEY:t.startsWith(be.PREFIX)?O.DEPLOY_TOKEN:O.OPAQUE}function we(t){let n=t.charCodeAt(0)===65279?t.slice(1):t,e;try{e=JSON.parse(n)}catch(o){throw m.config(`invalid JSON format in config: ${o.message}`,{filePath:v})}if(e===null||typeof e!="object"||Array.isArray(e))throw m.config(`${v} must contain a JSON object`,{filePath:v})}function Le(t,n,e){if(!t.startsWith(n.PREFIX))throw m.validation(`${e} must start with "${n.PREFIX}"`);if(t.length!==n.TOTAL_LENGTH)throw m.validation(`${e} must be ${n.TOTAL_LENGTH} characters total (${n.PREFIX} + ${n.HEX_LENGTH} hex chars)`);let o=t.slice(n.PREFIX.length);if(!new RegExp(`^[a-f0-9]{${n.HEX_LENGTH}}$`,"i").test(o))throw m.validation(`${e} must contain ${n.HEX_LENGTH} hexadecimal characters after "${n.PREFIX}" prefix`)}function gt(t){Le(t,Re,"API key")}function Et(t){Le(t,be,"Deploy token")}function te(t){switch(yt(t)){case O.API_KEY:gt(t);return;case O.DEPLOY_TOKEN:Et(t);return;case O.OPAQUE:if(!t)throw m.validation("Token must be a non-empty string")}}function Pe(t){if(!t||t.length>$.MAX_LENGTH||!$.PATTERN.test(t))throw m.validation(`Caller must be 1-${$.MAX_LENGTH} characters: letters, digits, dots, underscores, or hyphens`)}function jt(t){try{let n=new URL(t);if(!["http:","https:"].includes(n.protocol))throw m.validation("API URL must use http:// or https:// protocol");if(n.pathname!=="/"&&n.pathname!=="")throw m.validation("API URL must not contain a path");if(n.search||n.hash)throw m.validation("API URL must not contain query parameters or fragments")}catch(n){throw De(n)?n:m.validation("API URL must be a valid URL")}}function qt(t){return/^[a-z]+-[a-z]+-[a-z0-9]{7}(\.[a-z0-9.-]+)?$/i.test(t)}function _e(t,n){return t.endsWith(`.${n}`)}function Qt(t,n){return!_e(t,n)}function Zt(t,n){return _e(t,n)?t.slice(0,-(n.length+1)):null}function en(t){return`https://${t}`}function tn(t){return`https://${t}`}function nn(t){return!t||t.length===0?null:JSON.stringify(t)}function rn(t){if(!t)return[];try{let n=JSON.parse(t);return Array.isArray(n)?n:[]}catch{return[]}}function re(t){if(t==null)return;if(typeof t!="string")throw m.validation("Password must be a string");let n=t.trim();if(n.length<z.MIN_LENGTH||n.length>z.MAX_LENGTH)throw m.validation(`Password must be between ${z.MIN_LENGTH} and ${z.MAX_LENGTH} characters`);return n}var Ht,at,Gt,U,zt,T,P,E,lt,ee,pt,ut,m,dt,Kt,mt,ht,Vt,Ee,Re,be,$,O,Yt,v,Ie,V,ne,Xt,Wt,Jt,b,N,ve,z,R=w(()=>{"use strict";Ht={PENDING:"pending",SUCCESS:"success",FAILED:"failed",DELETING:"deleting"},at={WEB:"web",SDK:"sdk",CLI:"cli",MCP:"mcp",GIT:"git",N8N:"n8n",GPT:"gpt",VSC:"vsc"},Gt={PENDING:"pending",PARTIAL:"partial",SUCCESS:"success",PAUSED:"paused"},U={HEADER:"Idempotency-Key",MAX_LENGTH:256,WINDOW_SECONDS:1440*60};zt={FREE:"free",STANDARD:"standard",SPONSORED:"sponsored",ENTERPRISE:"enterprise",SUSPENDED:"suspended",TERMINATING:"terminating",TERMINATED:"terminated"},T={DEPLOYMENTS:"/deployments",DEPLOYMENT:t=>`/deployments/${t}`,DEPLOYMENT_CONFIG:t=>`/deployments/${t}/config`,DOMAINS:"/domains",DOMAIN:t=>`/domains/${t}`,DOMAIN_VERIFY:t=>`/domains/${t}/verify`,DOMAIN_DNS:t=>`/domains/${t}/dns`,DOMAIN_RECORDS:t=>`/domains/${t}/records`,DOMAIN_SHARE:t=>`/domains/${t}/share`,DOMAIN_PROPAGATION:t=>`/domains/${t}/propagation`,DOMAINS_VALIDATE:"/domains/validate",TOKENS:"/tokens",TOKEN:t=>`/tokens/${t}`,ACCOUNT:"/account",ACCOUNT_KEY:"/account/key",ACCOUNT_CLAIM:"/account/claim",ACTIVITIES:"/activities",LABELS:"/labels",LIMITS:"/limits",PING:"/ping",SETUP:"/setup",SPA_CHECK:"/spa-check",UPLOAD:"/upload"},P={FILES:"files[]",CHECKSUMS:"checksums",LABELS:"labels",VIA:"via",PASSWORD:"password",BUILD:"build",PRERENDER:"prerender",SPA:"spa",CAPTCHA:"captcha"},E={Validation:"validation_failed",NotFound:"not_found",Forbidden:"forbidden",RateLimit:"rate_limit_exceeded",Authentication:"authentication_failed",Business:"business_logic_error",Api:"internal_server_error",Maintenance:"maintenance",Network:"network_error",Timeout:"timeout_error",Cancelled:"operation_cancelled",File:"file_error",Config:"config_error"},lt=new Set([E.Network,E.Timeout,E.Cancelled,E.File,E.Config]),ee={client:new Set([E.Business,E.Cancelled,E.Config,E.File,E.Forbidden,E.NotFound,E.RateLimit,E.Validation]),network:new Set([E.Network,E.Timeout]),auth:new Set([E.Authentication])},pt=new Set(Object.values(E).filter(t=>!lt.has(t))),ut=200;m=class t extends Error{constructor(e,o,l,c){super(o);k(this,"type");k(this,"status");k(this,"details");this.type=e,this.status=l,this.details=c,this.name="ShipError"}toResponse(){let e=this.details,o=this.type===E.Authentication&&e?.internal?void 0:this.details;return{error:this.type,message:this.message,status:this.status,details:o}}static async fromHttpResponse(e,o){let l,c,f;try{if(e.headers.get("content-type")?.includes("application/json")){let y=await e.json();if(y&&typeof y=="object"){let A=y;typeof A.message=="string"?l=A.message:typeof A.error=="string"&&(l=A.error),c=A.details,typeof A.error=="string"&&pt.has(A.error)&&(f=A.error)}}else{let y=(await e.text()).trim();y&&!y.startsWith("<")&&y.length<=ut&&(l=y)}}catch{}let h=e.headers.get("retry-after");if(h!==null){let g=h.trim(),y=/^\d+$/.test(g)?Number(g):Math.ceil((Date.parse(g)-Date.now())/1e3);if(Number.isFinite(y)&&y>=0){let A=c&&typeof c=="object"?c:{};A.retryAfter===void 0&&(c={...A,retryAfter:y})}}l=l||`${o||"Request"} failed with status ${e.status}`;let d=f??(e.status===401?E.Authentication:e.status===403?E.Forbidden:e.status===429?E.RateLimit:E.Api);return new t(d,l,e.status,c)}static fromFetchError(e,o){if(De(e))return e;let l=o||"Request",c=e?.name;return c==="AbortError"?t.cancelled(`${l} was cancelled`):c==="TimeoutError"?t.timeout(`${l} timed out`,{cause:e}):e instanceof Error?ct(e)?t.network(`${l} failed: ${e.message}`,{cause:e}):new t(E.Api,`${l} failed: ${e.message}`):new t(E.Api,`${l} failed: Unknown error`)}static validation(e,o){return new t(E.Validation,e,400,o)}static notFound(e,o){let l=o?`${e} ${o} not found`:`${e} not found`;return new t(E.NotFound,l,404)}static forbidden(e,o){return new t(E.Forbidden,e,403,o)}static rateLimit(e="Too many requests",o){return new t(E.RateLimit,e,429,o)}static authentication(e="Authentication required",o){return new t(E.Authentication,e,401,o)}static business(e,o=400,l){return new t(E.Business,e,o,l)}static network(e,o){return new t(E.Network,e,void 0,o)}static timeout(e,o){return new t(E.Timeout,e,void 0,o)}static cancelled(e,o){return new t(E.Cancelled,e,void 0,o)}static file(e,o){return new t(E.File,e,void 0,o)}static config(e,o){return new t(E.Config,e,void 0,o)}static api(e,o=500,l){return new t(E.Api,e,o,l)}static maintenance(e,o){return new t(E.Maintenance,e,503,o)}isClientError(){return ee.client.has(this.type)?!0:this.status!==void 0&&this.status>=400&&this.status<500}isNetworkError(){return ee.network.has(this.type)}isAuthError(){return ee.auth.has(this.type)}isType(e){return this.type===e}};dt=["html","htm","xhtml","xml","txt","md","markdown","pdf","csv","json","jsonc","webmanifest","map","toml","yaml","yml","rss","atom","css","scss","sass","less","js","mjs","cjs","jsx","ts","tsx","wasm","vue","svelte","png","jpg","jpeg","gif","webp","avif","svg","ico","bmp","tif","tiff","heic","heif","woff","woff2","ttf","otf","eot","mp3","wav","ogg","oga","opus","m4a","aac","flac","weba","mp4","webm","ogv","mov","m4v","avi","glb","gltf","usdz","vtt","srt","zip"],Kt=dt.map(t=>`.${t}`).join(","),mt=/[\x00-\x1f\x7f#?%\\<>"]/;ht=new Set(["node_modules","package.json"]);Vt="/auth",Ee={SESSION:"session",API_KEY:"apiKey",TOKEN:"token",AGENT:"agent",OAUTH:"oauth",WEBHOOK:"webhook",SYSTEM:"system"},Re={PREFIX:"ship-",HEX_LENGTH:32,TOTAL_LENGTH:37,HINT_LENGTH:4},be={PREFIX:"deploy-",HEX_LENGTH:32,TOTAL_LENGTH:39},$={HEADER:"X-Caller",MAX_LENGTH:128,PATTERN:/^[a-zA-Z0-9._-]+$/},O={API_KEY:Ee.API_KEY,DEPLOY_TOKEN:Ee.TOKEN,OPAQUE:"opaque"};Yt={ACCOUNT_READ:"account:read",DEPLOYMENTS_READ:"deployments:read",DEPLOYMENTS_WRITE:"deployments:write",DOMAINS_READ:"domains:read",DOMAINS_WRITE:"domains:write"},v="ship.json",Ie={rewrites:[{source:"/(.*)",destination:"/index.html"}]},V={INDEX_FILE:"index.html",MAX_INDEX_BYTES:100*1024};ne="https://api.shipstatic.com",Xt={TOKEN:"SHIP_TOKEN",API_URL:"SHIP_API_URL"},Wt="https://my.shipstatic.com/api-key",Jt=4320*60,b={PENDING:"pending",PROCESSING_ERROR:"processing_error",EXCLUDED:"excluded",VALIDATION_FAILED:"validation_failed",READY:"ready"};N={MIN_LENGTH:3,MAX_LENGTH:25,MAX_COUNT:10,SEPARATORS:"._-"},ve=/^[a-z0-9]+(?:[._-][a-z0-9]+)*$/;z={MIN_LENGTH:6,MAX_LENGTH:128}});var Ce=ge((Fe,Oe)=>{"use strict";(function(t){if(typeof Fe=="object")Oe.exports=t();else if(typeof define=="function"&&define.amd)define(t);else{var n;try{n=window}catch{n=self}n.SparkMD5=t()}})(function(t){"use strict";var n=function(u,p){return u+p&4294967295},e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function o(u,p,i,r,a,s){return p=n(n(p,u),n(r,s)),n(p<<a|p>>>32-a,i)}function l(u,p){var i=u[0],r=u[1],a=u[2],s=u[3];i+=(r&a|~r&s)+p[0]-680876936|0,i=(i<<7|i>>>25)+r|0,s+=(i&r|~i&a)+p[1]-389564586|0,s=(s<<12|s>>>20)+i|0,a+=(s&i|~s&r)+p[2]+606105819|0,a=(a<<17|a>>>15)+s|0,r+=(a&s|~a&i)+p[3]-1044525330|0,r=(r<<22|r>>>10)+a|0,i+=(r&a|~r&s)+p[4]-176418897|0,i=(i<<7|i>>>25)+r|0,s+=(i&r|~i&a)+p[5]+1200080426|0,s=(s<<12|s>>>20)+i|0,a+=(s&i|~s&r)+p[6]-1473231341|0,a=(a<<17|a>>>15)+s|0,r+=(a&s|~a&i)+p[7]-45705983|0,r=(r<<22|r>>>10)+a|0,i+=(r&a|~r&s)+p[8]+1770035416|0,i=(i<<7|i>>>25)+r|0,s+=(i&r|~i&a)+p[9]-1958414417|0,s=(s<<12|s>>>20)+i|0,a+=(s&i|~s&r)+p[10]-42063|0,a=(a<<17|a>>>15)+s|0,r+=(a&s|~a&i)+p[11]-1990404162|0,r=(r<<22|r>>>10)+a|0,i+=(r&a|~r&s)+p[12]+1804603682|0,i=(i<<7|i>>>25)+r|0,s+=(i&r|~i&a)+p[13]-40341101|0,s=(s<<12|s>>>20)+i|0,a+=(s&i|~s&r)+p[14]-1502002290|0,a=(a<<17|a>>>15)+s|0,r+=(a&s|~a&i)+p[15]+1236535329|0,r=(r<<22|r>>>10)+a|0,i+=(r&s|a&~s)+p[1]-165796510|0,i=(i<<5|i>>>27)+r|0,s+=(i&a|r&~a)+p[6]-1069501632|0,s=(s<<9|s>>>23)+i|0,a+=(s&r|i&~r)+p[11]+643717713|0,a=(a<<14|a>>>18)+s|0,r+=(a&i|s&~i)+p[0]-373897302|0,r=(r<<20|r>>>12)+a|0,i+=(r&s|a&~s)+p[5]-701558691|0,i=(i<<5|i>>>27)+r|0,s+=(i&a|r&~a)+p[10]+38016083|0,s=(s<<9|s>>>23)+i|0,a+=(s&r|i&~r)+p[15]-660478335|0,a=(a<<14|a>>>18)+s|0,r+=(a&i|s&~i)+p[4]-405537848|0,r=(r<<20|r>>>12)+a|0,i+=(r&s|a&~s)+p[9]+568446438|0,i=(i<<5|i>>>27)+r|0,s+=(i&a|r&~a)+p[14]-1019803690|0,s=(s<<9|s>>>23)+i|0,a+=(s&r|i&~r)+p[3]-187363961|0,a=(a<<14|a>>>18)+s|0,r+=(a&i|s&~i)+p[8]+1163531501|0,r=(r<<20|r>>>12)+a|0,i+=(r&s|a&~s)+p[13]-1444681467|0,i=(i<<5|i>>>27)+r|0,s+=(i&a|r&~a)+p[2]-51403784|0,s=(s<<9|s>>>23)+i|0,a+=(s&r|i&~r)+p[7]+1735328473|0,a=(a<<14|a>>>18)+s|0,r+=(a&i|s&~i)+p[12]-1926607734|0,r=(r<<20|r>>>12)+a|0,i+=(r^a^s)+p[5]-378558|0,i=(i<<4|i>>>28)+r|0,s+=(i^r^a)+p[8]-2022574463|0,s=(s<<11|s>>>21)+i|0,a+=(s^i^r)+p[11]+1839030562|0,a=(a<<16|a>>>16)+s|0,r+=(a^s^i)+p[14]-35309556|0,r=(r<<23|r>>>9)+a|0,i+=(r^a^s)+p[1]-1530992060|0,i=(i<<4|i>>>28)+r|0,s+=(i^r^a)+p[4]+1272893353|0,s=(s<<11|s>>>21)+i|0,a+=(s^i^r)+p[7]-155497632|0,a=(a<<16|a>>>16)+s|0,r+=(a^s^i)+p[10]-1094730640|0,r=(r<<23|r>>>9)+a|0,i+=(r^a^s)+p[13]+681279174|0,i=(i<<4|i>>>28)+r|0,s+=(i^r^a)+p[0]-358537222|0,s=(s<<11|s>>>21)+i|0,a+=(s^i^r)+p[3]-722521979|0,a=(a<<16|a>>>16)+s|0,r+=(a^s^i)+p[6]+76029189|0,r=(r<<23|r>>>9)+a|0,i+=(r^a^s)+p[9]-640364487|0,i=(i<<4|i>>>28)+r|0,s+=(i^r^a)+p[12]-421815835|0,s=(s<<11|s>>>21)+i|0,a+=(s^i^r)+p[15]+530742520|0,a=(a<<16|a>>>16)+s|0,r+=(a^s^i)+p[2]-995338651|0,r=(r<<23|r>>>9)+a|0,i+=(a^(r|~s))+p[0]-198630844|0,i=(i<<6|i>>>26)+r|0,s+=(r^(i|~a))+p[7]+1126891415|0,s=(s<<10|s>>>22)+i|0,a+=(i^(s|~r))+p[14]-1416354905|0,a=(a<<15|a>>>17)+s|0,r+=(s^(a|~i))+p[5]-57434055|0,r=(r<<21|r>>>11)+a|0,i+=(a^(r|~s))+p[12]+1700485571|0,i=(i<<6|i>>>26)+r|0,s+=(r^(i|~a))+p[3]-1894986606|0,s=(s<<10|s>>>22)+i|0,a+=(i^(s|~r))+p[10]-1051523|0,a=(a<<15|a>>>17)+s|0,r+=(s^(a|~i))+p[1]-2054922799|0,r=(r<<21|r>>>11)+a|0,i+=(a^(r|~s))+p[8]+1873313359|0,i=(i<<6|i>>>26)+r|0,s+=(r^(i|~a))+p[15]-30611744|0,s=(s<<10|s>>>22)+i|0,a+=(i^(s|~r))+p[6]-1560198380|0,a=(a<<15|a>>>17)+s|0,r+=(s^(a|~i))+p[13]+1309151649|0,r=(r<<21|r>>>11)+a|0,i+=(a^(r|~s))+p[4]-145523070|0,i=(i<<6|i>>>26)+r|0,s+=(r^(i|~a))+p[11]-1120210379|0,s=(s<<10|s>>>22)+i|0,a+=(i^(s|~r))+p[2]+718787259|0,a=(a<<15|a>>>17)+s|0,r+=(s^(a|~i))+p[9]-343485551|0,r=(r<<21|r>>>11)+a|0,u[0]=i+u[0]|0,u[1]=r+u[1]|0,u[2]=a+u[2]|0,u[3]=s+u[3]|0}function c(u){var p=[],i;for(i=0;i<64;i+=4)p[i>>2]=u.charCodeAt(i)+(u.charCodeAt(i+1)<<8)+(u.charCodeAt(i+2)<<16)+(u.charCodeAt(i+3)<<24);return p}function f(u){var p=[],i;for(i=0;i<64;i+=4)p[i>>2]=u[i]+(u[i+1]<<8)+(u[i+2]<<16)+(u[i+3]<<24);return p}function h(u){var p=u.length,i=[1732584193,-271733879,-1732584194,271733878],r,a,s,I,_,x;for(r=64;r<=p;r+=64)l(i,c(u.substring(r-64,r)));for(u=u.substring(r-64),a=u.length,s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=0;r<a;r+=1)s[r>>2]|=u.charCodeAt(r)<<(r%4<<3);if(s[r>>2]|=128<<(r%4<<3),r>55)for(l(i,s),r=0;r<16;r+=1)s[r]=0;return I=p*8,I=I.toString(16).match(/(.*?)(.{0,8})$/),_=parseInt(I[2],16),x=parseInt(I[1],16)||0,s[14]=_,s[15]=x,l(i,s),i}function d(u){var p=u.length,i=[1732584193,-271733879,-1732584194,271733878],r,a,s,I,_,x;for(r=64;r<=p;r+=64)l(i,f(u.subarray(r-64,r)));for(u=r-64<p?u.subarray(r-64):new Uint8Array(0),a=u.length,s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=0;r<a;r+=1)s[r>>2]|=u[r]<<(r%4<<3);if(s[r>>2]|=128<<(r%4<<3),r>55)for(l(i,s),r=0;r<16;r+=1)s[r]=0;return I=p*8,I=I.toString(16).match(/(.*?)(.{0,8})$/),_=parseInt(I[2],16),x=parseInt(I[1],16)||0,s[14]=_,s[15]=x,l(i,s),i}function g(u){var p="",i;for(i=0;i<4;i+=1)p+=e[u>>i*8+4&15]+e[u>>i*8&15];return p}function y(u){var p;for(p=0;p<u.length;p+=1)u[p]=g(u[p]);return u.join("")}y(h("hello"))!=="5d41402abc4b2a76b9719d911017c592"&&(n=function(u,p){var i=(u&65535)+(p&65535),r=(u>>16)+(p>>16)+(i>>16);return r<<16|i&65535}),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&(function(){function u(p,i){return p=p|0||0,p<0?Math.max(p+i,0):Math.min(p,i)}ArrayBuffer.prototype.slice=function(p,i){var r=this.byteLength,a=u(p,r),s=r,I,_,x,ye;return i!==t&&(s=u(i,r)),a>s?new ArrayBuffer(0):(I=s-a,_=new ArrayBuffer(I),x=new Uint8Array(_),ye=new Uint8Array(this,a,I),x.set(ye),_)}})();function A(u){return/[\u0080-\uFFFF]/.test(u)&&(u=unescape(encodeURIComponent(u))),u}function S(u,p){var i=u.length,r=new ArrayBuffer(i),a=new Uint8Array(r),s;for(s=0;s<i;s+=1)a[s]=u.charCodeAt(s);return p?a:r}function L(u){return String.fromCharCode.apply(null,new Uint8Array(u))}function C(u,p,i){var r=new Uint8Array(u.byteLength+p.byteLength);return r.set(new Uint8Array(u)),r.set(new Uint8Array(p),u.byteLength),i?r:r.buffer}function F(u){var p=[],i=u.length,r;for(r=0;r<i-1;r+=2)p.push(parseInt(u.substr(r,2),16));return String.fromCharCode.apply(String,p)}function D(){this.reset()}return D.prototype.append=function(u){return this.appendBinary(A(u)),this},D.prototype.appendBinary=function(u){this._buff+=u,this._length+=u.length;var p=this._buff.length,i;for(i=64;i<=p;i+=64)l(this._hash,c(this._buff.substring(i-64,i)));return this._buff=this._buff.substring(i-64),this},D.prototype.end=function(u){var p=this._buff,i=p.length,r,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],s;for(r=0;r<i;r+=1)a[r>>2]|=p.charCodeAt(r)<<(r%4<<3);return this._finish(a,i),s=y(this._hash),u&&(s=F(s)),this.reset(),s},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(u){return this._buff=u.buff,this._length=u.length,this._hash=u.hash,this},D.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},D.prototype._finish=function(u,p){var i=p,r,a,s;if(u[i>>2]|=128<<(i%4<<3),i>55)for(l(this._hash,u),i=0;i<16;i+=1)u[i]=0;r=this._length*8,r=r.toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(r[2],16),s=parseInt(r[1],16)||0,u[14]=a,u[15]=s,l(this._hash,u)},D.hash=function(u,p){return D.hashBinary(A(u),p)},D.hashBinary=function(u,p){var i=h(u),r=y(i);return p?F(r):r},D.ArrayBuffer=function(){this.reset()},D.ArrayBuffer.prototype.append=function(u){var p=C(this._buff.buffer,u,!0),i=p.length,r;for(this._length+=u.byteLength,r=64;r<=i;r+=64)l(this._hash,f(p.subarray(r-64,r)));return this._buff=r-64<i?new Uint8Array(p.buffer.slice(r-64)):new Uint8Array(0),this},D.ArrayBuffer.prototype.end=function(u){var p=this._buff,i=p.length,r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a,s;for(a=0;a<i;a+=1)r[a>>2]|=p[a]<<(a%4<<3);return this._finish(r,i),s=y(this._hash),u&&(s=F(s)),this.reset(),s},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 u=D.prototype.getState.call(this);return u.buff=L(u.buff),u},D.ArrayBuffer.prototype.setState=function(u){return u.buff=S(u.buff,!0),D.prototype.setState.call(this,u)},D.ArrayBuffer.prototype.destroy=D.prototype.destroy,D.ArrayBuffer.prototype._finish=D.prototype._finish,D.ArrayBuffer.hash=function(u,p){var i=d(new Uint8Array(u)),r=y(i);return p?F(r):r},D})});var q=ge((hn,$e)=>{"use strict";$e.exports={}});async function Pt(t){let n=(await Promise.resolve().then(()=>G(Ce(),1))).default,e=new n.ArrayBuffer,o=2097152;for(let l=0;l<t.size;l+=o){let c=Math.min(l+o,t.size);e.append(await t.slice(l,c).arrayBuffer())}return{md5:e.end()}}async function _t(t){let{createHash:n}=await Promise.resolve().then(()=>G(q(),1)),e=n("md5");return e.update(t),{md5:e.digest("hex")}}async function vt(t){let{createHash:n}=await Promise.resolve().then(()=>G(q(),1)),{createReadStream:e}=await Promise.resolve().then(()=>G(q(),1));return new Promise((o,l)=>{let c=n("md5"),f=e(t);f.on("error",h=>l(m.file(`Failed to read file for MD5: ${h.message}`,{filePath:t}))),f.on("data",h=>c.update(h)),f.on("end",()=>o({md5:c.digest("hex")}))})}async function B(t){if(t instanceof Blob)return Pt(t);if(typeof Buffer<"u"&&Buffer.isBuffer(t))return _t(t);if(typeof t=="string")return vt(t);throw m.business("Invalid input for MD5 calculation")}var X=w(()=>{"use strict";R()});function J(t){return t.replace(/\\/g,"/").replace(/\/+/g,"/").replace(/^\/+/,"")}var ze=w(()=>{"use strict"});function Ke(t,n={}){if(n.flatten===!1)return t.map(o=>({path:J(o),name:se(o)}));let e=Nt(t);return t.map(o=>{let l=J(o);if(e){let c=e.endsWith("/")?e:`${e}/`;l.startsWith(c)&&(l=l.substring(c.length))}return l||(l=se(o)),{path:l,name:se(o)}})}function Nt(t){if(!t.length)return"";let e=t.map(c=>J(c)).map(c=>c.split("/")),o=[],l=Math.min(...e.map(c=>c.length));for(let c=0;c<l-1;c++){let f=e[0][c];if(e.every(h=>h[c]===f))o.push(f);else break}return o.join("/")}function se(t){return t.split(/[/\\]/).pop()||t}var oe=w(()=>{"use strict";ze()});function Cn(t){ae=t}function Ft(){return typeof process<"u"&&process.versions&&process.versions.node?"node":typeof window<"u"||typeof self<"u"?"browser":"unknown"}function Ve(){return ae||Ft()}var ae,le=w(()=>{"use strict";ae=null});function Z(t,n){return Ot.find(e=>e.broken(t,n))}var Ot,ue=w(()=>{"use strict";R();ce();Ot=[{name:"name",broken:({path:t})=>!pe(t).valid,sentence:({path:t})=>pe(t).reason??"Invalid file name"},{name:"extension",broken:({path:t},n)=>Te(t,n.blockedExtensions??[]),sentence:({path:t})=>`File extension not allowed: "${t}"`},{name:"fileSize",broken:({size:t},n)=>t>n.maxFileSize,sentence:({path:t},n)=>`File "${t}" too large. Maximum ${Q(n.maxFileSize)} allowed`},{name:"totalSize",broken:({totalSize:t},n)=>t>n.maxTotalSize,sentence:({totalSize:t},n)=>`Total upload size too large. ${Q(t)} exceeds maximum of ${Q(n.maxTotalSize)}`}]});function Q(t,n=1){if(t===0)return"0 Bytes";let e=1024,o=["Bytes","KB","MB","GB"],l=Math.floor(Math.log(t)/Math.log(e));return`${parseFloat((t/e**l).toFixed(n))} ${o[l]}`}function pe(t){if(Se(t))return{valid:!1,reason:"File name contains unsafe characters"};if(t.startsWith(" ")||t.endsWith(" "))return{valid:!1,reason:"File name cannot start/end with spaces"};if(t.endsWith("."))return{valid:!1,reason:"File name cannot end with dots"};let n=/^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(\.|$)/i,e=t.split("/").pop()||t;return n.test(e)?{valid:!1,reason:"File name uses a reserved system name"}:t.includes("..")?{valid:!1,reason:"File name contains path traversal pattern"}:{valid:!0}}function kn(t,n){let e=[],o=[],l=[];if(t.length===0){let d={file:"(no files)",message:"At least one file must be provided"};return e.push(d),{files:[],validFiles:[],errors:e,warnings:[],canDeploy:!1}}for(let d of t)if(K(d.name))return e.push({file:d.name,message:"Unbuilt project detected \u2014 deploy your build output (dist/, build/, out/), not the project folder"}),{files:t.map(g=>({...g,status:b.VALIDATION_FAILED,statusMessage:"Unbuilt project detected"})),validFiles:[],errors:e,warnings:[],canDeploy:!1};if(t.length>n.maxFilesCount){let d={file:`(${t.length} files)`,message:`File count (${t.length}) exceeds limit of ${n.maxFilesCount}`};return e.push(d),{files:t.map(g=>({...g,status:b.VALIDATION_FAILED,statusMessage:d.message})),validFiles:[],errors:e,warnings:[],canDeploy:!1}}let c=0;for(let d of t){let g=b.READY,y="Ready for upload";if(d.status===b.PROCESSING_ERROR)g=b.VALIDATION_FAILED,y=d.statusMessage||"File failed during processing",e.push({file:d.name,message:y});else if(d.size===0){g=b.EXCLUDED,y="File is empty (0 bytes) and cannot be deployed due to storage limitations",o.push({file:d.name,message:y}),l.push({...d,status:g,statusMessage:y});continue}else if(d.size<0)g=b.VALIDATION_FAILED,y="File size must be positive",e.push({file:d.name,message:y});else if(!d.name||d.name.trim().length===0)g=b.VALIDATION_FAILED,y="File name cannot be empty",e.push({file:d.name||"(empty)",message:y});else if(d.name.includes("\0"))g=b.VALIDATION_FAILED,y="File name contains invalid characters (null byte)",e.push({file:d.name,message:y});else{let A={path:d.name,size:d.size,totalSize:c+d.size},S=Z(A,n);S?(g=b.VALIDATION_FAILED,y=S.sentence(A,n),e.push({file:S.name==="totalSize"?`(${t.length} files)`:d.name,message:y})):c=A.totalSize}l.push({...d,status:g,statusMessage:y})}e.length>0&&(l=l.map(d=>d.status===b.EXCLUDED?d:{...d,status:b.VALIDATION_FAILED,statusMessage:d.status===b.VALIDATION_FAILED?d.statusMessage:"Deployment failed due to validation errors in bundle"}));let f=e.length===0?l.filter(d=>d.status===b.READY):[],h=e.length===0;return{files:l,validFiles:f,errors:e,warnings:o,canDeploy:h}}function Ct(t){return t.filter(n=>n.status===b.READY)}function zn(t){return Ct(t).length>0}var ce=w(()=>{"use strict";R();ue()});function Ye(t){return Ut.test(t)}var $t,Ut,je=w(()=>{"use strict";$t=["^npm-debug\\.log$","^\\..*\\.swp$","^\\.DS_Store$","^\\.AppleDouble$","^\\.LSOverride$","^Icon\\r$","^\\._.*","^\\.Spotlight-V100(?:$|\\/)","\\.Trashes","^__MACOSX$","~$","^Thumbs\\.db$","^ehthumbs\\.db$","^[Dd]esktop\\.ini$","@eaDir$"],Ut=new RegExp($t.join("|"))});function qe(t,n){if(!t||t.length===0)return[];if(!n?.allowUnbuilt&&t.find(o=>o&&K(o)))throw m.business("Unbuilt project detected \u2014 deploy your build output (dist/, build/, out/), not the project folder");return t.filter(e=>{if(!e)return!1;let o=e.replace(/\\/g,"/").split("/").filter(Boolean);if(o.length===0)return!0;let l=o[o.length-1];if(Ye(l))return!1;for(let f of o)if(f!==".well-known"&&(f.startsWith(".")||f.length>255))return!1;let c=o.slice(0,-1);for(let f of c)if(Mt.some(h=>f.toLowerCase()===h.toLowerCase()))return!1;return!0})}var Mt,fe=w(()=>{"use strict";R();je();Mt=["__MACOSX",".Trashes",".fseventsd",".Spotlight-V100"]});function Xe(t,n){if(t.includes("\0")||t.includes("/../")||t.startsWith("../")||t.endsWith("/.."))throw m.business(`Security error: Unsafe file path "${t}" for file: ${n}`)}function We(t,n){let e=Z(t,n);if(e)throw m.business(e.sentence(t,n))}var de=w(()=>{"use strict";R();ue()});var Qe={};st(Qe,{processFilesForBrowser:()=>Je});async function Je(t,n={},e){if(Ve()!=="browser")throw m.business("processFilesForBrowser can only be called in a browser environment.");let o=t.map(A=>A.webkitRelativePath||A.name),l=n.build||n.prerender,c=Ke(o,{flatten:n.pathDetect!==!1}),f=c.map(A=>A.path),h=new Set(qe(f,{allowUnbuilt:l})),d=[];for(let A=0;A<t.length;A++)h.has(f[A])&&d.push({file:t[A],deployPath:c[A].path});if(d.length===0)return[];if(l){let A=[];for(let S=0;S<d.length;S++){let{file:L,deployPath:C}=d[S];if(L.size===0)continue;let{md5:F}=await B(L);A.push({path:C,content:L,size:L.size,md5:F})}return A}if(!e)throw m.config("Platform limits not provided. processFilesForBrowser requires the limits argument for deploy-mode validation \u2014 pass `ship.getLimits()` result.");let g=[],y=0;for(let A=0;A<d.length;A++){let{file:S,deployPath:L}=d[A];if(Xe(L,S.name),S.size===0)continue;y+=S.size,We({path:L,size:S.size,totalSize:y},e);let{md5:C}=await B(S);g.push({path:L,content:S,size:S.size,md5:C})}if(g.length>e.maxFilesCount)throw m.business(`Too many files to deploy. Maximum allowed is ${e.maxFilesCount} files.`);return g}var me=w(()=>{"use strict";R();oe();le();fe();X();de()});R();R();R();var Y=class{constructor(){this.handlers=new Map}on(n,e){this.handlers.has(n)||this.handlers.set(n,new Set),this.handlers.get(n)?.add(e)}off(n,e){let o=this.handlers.get(n);o&&(o.delete(e),o.size===0&&this.handlers.delete(n))}emit(n,...e){let o=this.handlers.get(n);if(!o)return;let l=Array.from(o);for(let c of l)try{c(...e)}catch(f){o.delete(c),n!=="error"&&setTimeout(()=>{let h=f instanceof Error?f:new Error(String(f));this.emit("error",h,String(n))},0)}}};R();R();function M(t){if(t==null)return;if(t.length===0)return t;if(t.length>N.MAX_COUNT)throw m.validation(`Maximum ${N.MAX_COUNT} labels allowed`);let n=t.map((o,l)=>{if(typeof o!="string")throw m.validation(`Label at index ${l} must be a string`);let c=o.trim().toLowerCase();if(c.length<N.MIN_LENGTH)throw m.validation(`Labels must be at least ${N.MIN_LENGTH} characters long`);if(c.length>N.MAX_LENGTH)throw m.validation(`Labels must be no more than ${N.MAX_LENGTH} characters long`);if(!ve.test(c))throw m.validation(`Labels must start and end with alphanumeric characters, with optional separators (${N.SEPARATORS}) between segments`);return c}),e=[...new Set(n)];if(e.length!==n.length)throw m.validation("Duplicate labels are not allowed");return e}async function xe(t){let n=t.find(l=>l.path===v||l.path===`/${v}`);if(!n)return;let e=n.content,o=typeof e.text=="function"?await e.text():n.content.toString("utf8");we(o)}var At=3e4,Dt=2,Tt=300,St=2e3,Rt=new Set([500,502,503,504]);function bt(t,n){return new Promise((e,o)=>{if(n?.aborted){o(n.reason);return}let l=()=>{clearTimeout(f),n?.removeEventListener("abort",c)},c=()=>{l(),o(n?.reason)},f=setTimeout(()=>{l(),e()},t);n?.addEventListener("abort",c)})}var Ne=3e5,It=3e5,wt=Ne+It,Lt="sdk";function ie(t){let n=new URLSearchParams;t?.limit!==void 0&&n.set("limit",String(t.limit)),t?.cursor!==void 0&&n.set("cursor",t.cursor);let e=n.toString();return e?`?${e}`:""}var j=class extends Y{constructor(e){super();this.globalHeaders={};this.apiUrl=e.apiUrl||ne,this.getAuthHeadersCallback=e.getAuthHeaders,this.session=e.session??!1,this.caller=e.caller,this.timeout=e.timeout??At,this.maxRetries=Math.max(0,e.maxRetries??Dt),this.deployTimeout=e.timeout??Ne,this.deployBuildTimeout=e.timeout??wt,this.fetch=e.fetch??globalThis.fetch.bind(globalThis),this.createDeployBody=e.createDeployBody,this.deployEndpoint=e.deployEndpoint||T.DEPLOYMENTS}setGlobalHeaders(e){this.globalHeaders=e}async executeRequest(e,o,l,c=this.timeout){for(let f=0;;f++)try{return await this.attemptOnce(e,o,l,c)}catch(h){let d=m.fromFetchError(h,l);if(f>=this.maxRetries||!this.isRetryable(d,o))throw this.emit("error",d,e),d;this.emit("retry",d,e,f+1);let g=Math.min(St,Tt*2**f);try{await bt(Math.random()*g,o.signal)}catch(y){let A=m.fromFetchError(y,l);throw this.emit("error",A,e),A}}}isRetryable(e,o){if(o.signal?.aborted||e.isType(E.Maintenance)||e.isType(E.Cancelled)||!(e.isNetworkError()||e.status!==void 0&&Rt.has(e.status)))return!1;let c=(o.method??"GET").toUpperCase();return c==="GET"||c==="HEAD"?!0:c==="PUT"||c==="DELETE"?!1:this.hasIdempotencyKey(o.headers)}hasIdempotencyKey(e){if(!e)return!1;let o=U.HEADER.toLowerCase(),l=!1,c=f=>{f.toLowerCase()===o&&(l=!0)};if(e instanceof Headers)e.forEach((f,h)=>{c(h)});else if(Array.isArray(e))for(let[f]of e)c(f);else for(let f of Object.keys(e))c(f);return l}async attemptOnce(e,o,l,c=this.timeout){let f=()=>{};try{let h=await this.mergeHeaders(o.headers),d=this.createTimeoutSignal(o.signal,c);f=d.cleanup;let g={...o,headers:h,credentials:this.session&&!h.Authorization?"include":void 0,signal:d.signal};this.emit("request",e,g);let y=await this.fetch(e,g);if(f(),!y.ok)throw await m.fromHttpResponse(y,l);return this.emit("response",this.safeClone(y),e),{data:await this.parseResponse(this.safeClone(y)),status:y.status}}catch(h){throw f(),m.fromFetchError(h,l)}}async request(e,o,l,c){let{data:f}=await this.executeRequest(e,o,l,c);return f}async requestWithStatus(e,o,l){return this.executeRequest(e,o,l)}async mergeHeaders(e={}){return{...this.globalHeaders,...this.caller?{[$.HEADER]:this.caller}:{},...await this.getAuthHeadersCallback(),...e}}createTimeoutSignal(e,o=this.timeout){let l=new AbortController,c=setTimeout(()=>l.abort(new DOMException(`Timed out after ${o}ms`,"TimeoutError")),o),f=e?()=>l.abort(e.reason):void 0;return e&&f&&(e.addEventListener("abort",f),e.aborted&&l.abort(e.reason)),{signal:l.signal,cleanup:()=>{clearTimeout(c),e&&f&&e.removeEventListener("abort",f)}}}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 deploy(e,o={}){if(!e.length)throw m.business("No files to deploy");for(let g of e)if(!g.md5)throw m.file(`MD5 checksum missing for file: ${g.path}`,{filePath:g.path});re(o.password);let l=Ae(o.idempotencyKey),c=M(o.labels);await xe(e);let f=o.build||o.prerender||o.spa?{build:o.build,prerender:o.prerender,spa:o.spa}:void 0,{body:h,headers:d}=await this.createDeployBody(e,{labels:c,via:o.via??Lt,password:o.password,flags:f,captcha:o.captcha});return this.request(`${this.apiUrl}${this.deployEndpoint}`,{method:"POST",body:h,headers:l?{...d,[U.HEADER]:l}:d,signal:o.signal||null},"Deploy",o.build||o.prerender?this.deployBuildTimeout:this.deployTimeout)}async listDeployments(e){return this.request(`${this.apiUrl}${T.DEPLOYMENTS}${ie(e)}`,{method:"GET"},"List deployments")}async getDeployment(e){return this.request(`${this.apiUrl}${T.DEPLOYMENT(encodeURIComponent(e))}`,{method:"GET"},"Get deployment")}async updateDeploymentLabels(e,o){let l=M(o);return this.request(`${this.apiUrl}${T.DEPLOYMENT(encodeURIComponent(e))}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({labels:l})},"Update deployment labels")}async deleteDeployment(e){return this.request(`${this.apiUrl}${T.DEPLOYMENT(encodeURIComponent(e))}`,{method:"DELETE"},"Delete deployment")}async setDomain(e,o,l){let c=M(l),f={};o&&(f.deployment=o),c!==void 0&&(f.labels=c);let{data:h,status:d}=await this.requestWithStatus(`${this.apiUrl}${T.DOMAIN(encodeURIComponent(e))}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)},"Set domain");return{...h,isCreate:d===201}}async listDomains(e){return this.request(`${this.apiUrl}${T.DOMAINS}${ie(e)}`,{method:"GET"},"List domains")}async getDomain(e){return this.request(`${this.apiUrl}${T.DOMAIN(encodeURIComponent(e))}`,{method:"GET"},"Get domain")}async deleteDomain(e){return this.request(`${this.apiUrl}${T.DOMAIN(encodeURIComponent(e))}`,{method:"DELETE"},"Delete domain")}async verifyDomain(e){return this.request(`${this.apiUrl}${T.DOMAIN_VERIFY(encodeURIComponent(e))}`,{method:"POST"},"Verify domain")}async getDomainDns(e){return this.request(`${this.apiUrl}${T.DOMAIN_DNS(encodeURIComponent(e))}`,{method:"GET"},"Get domain DNS")}async getDomainRecords(e){return this.request(`${this.apiUrl}${T.DOMAIN_RECORDS(encodeURIComponent(e))}`,{method:"GET"},"Get domain records")}async getDomainShare(e){return this.request(`${this.apiUrl}${T.DOMAIN_SHARE(encodeURIComponent(e))}`,{method:"GET"},"Get domain share")}async validateDomain(e){return this.request(`${this.apiUrl}${T.DOMAINS_VALIDATE}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({domain:e})},"Validate domain")}async createToken(e,o){let l=M(o),c={};return e!==void 0&&(c.ttl=e),l!==void 0&&(c.labels=l),this.request(`${this.apiUrl}${T.TOKENS}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)},"Create token")}async listTokens(e){return this.request(`${this.apiUrl}${T.TOKENS}${ie(e)}`,{method:"GET"},"List tokens")}async deleteToken(e){return this.request(`${this.apiUrl}${T.TOKEN(encodeURIComponent(e))}`,{method:"DELETE"},"Delete token")}async getToken(e){return this.request(`${this.apiUrl}${T.TOKEN(encodeURIComponent(e))}`,{method:"GET"},"Get token")}async getAccount(){return this.request(`${this.apiUrl}${T.ACCOUNT}`,{method:"GET"},"Get account")}async getLimits(){return this.request(`${this.apiUrl}${T.LIMITS}`,{method:"GET"},"Get limits")}async ping(){return this.request(`${this.apiUrl}${T.PING}`,{method:"GET"},"Ping")}async checkSPA(e,o={}){let l=e.find(d=>d.path===V.INDEX_FILE||d.path===`/${V.INDEX_FILE}`);if(!l||l.size>V.MAX_INDEX_BYTES)return!1;let c;if(typeof Buffer<"u"&&Buffer.isBuffer(l.content))c=l.content.toString("utf-8");else if(typeof Blob<"u"&&l.content instanceof Blob)c=await l.content.text();else if(typeof File<"u"&&l.content instanceof File)c=await l.content.text();else return!1;let f={files:e.map(d=>d.path),index:c};return(await this.request(`${this.apiUrl}${T.SPA_CHECK}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)},"SPA check")).isSPA}};R();R();X();async function xt(){let t=JSON.stringify(Ie,null,2),n;typeof Buffer<"u"?n=Buffer.from(t,"utf-8"):n=new Blob([t],{type:"application/json"});let{md5:e}=await B(n);return{path:v,content:n,size:t.length,md5:e}}async function Ue(t,n,e){if(e.spaDetect===!1||e.spa||e.build||e.prerender||t.some(o=>o.path===v))return t;try{if(await n.checkSPA(t,e)){let l=await xt();return[...t,l]}}catch{}return t}function Me(t){let{getApi:n,ensureInit:e,processInput:o}=t;return{upload:async(l,c={})=>{if(await e(),!o)throw m.config("processInput function is not provided.");let f=n(),h=await o(l,c);return h=await Ue(h,f,c),f.deploy(h,c)},list:async l=>(await e(),n().listDeployments(l)),get:async l=>(await e(),n().getDeployment(l)),set:async(l,c)=>(await e(),n().updateDeploymentLabels(l,c.labels)),delete:async l=>(await e(),n().deleteDeployment(l))}}function Be(t){let{getApi:n,ensureInit:e}=t;return{set:async(o,l={})=>(await e(),n().setDomain(o,l.deployment,l.labels)),list:async o=>(await e(),n().listDomains(o)),get:async o=>(await e(),n().getDomain(o)),delete:async o=>(await e(),n().deleteDomain(o)),verify:async o=>(await e(),n().verifyDomain(o)),validate:async o=>(await e(),n().validateDomain(o)),dns:async o=>(await e(),n().getDomainDns(o)),records:async o=>(await e(),n().getDomainRecords(o)),share:async o=>(await e(),n().getDomainShare(o))}}function He(t){let{getApi:n,ensureInit:e}=t;return{get:async()=>(await e(),n().getAccount())}}function Ge(t){let{getApi:n,ensureInit:e}=t;return{create:async(o={})=>(await e(),n().createToken(o.ttl,o.labels)),list:async o=>(await e(),n().listTokens(o)),get:async o=>(await e(),n().getToken(o)),delete:async o=>(await e(),n().deleteToken(o))}}var W=class{constructor(n={}){this.initPromise=null;this.platformLimits=null;this.credential=null;if(n={...n,apiUrl:n.apiUrl||void 0,token:n.token||void 0,caller:n.caller||void 0},this.clientOptions=n,n.caller!==void 0&&Pe(n.caller),n.token&&n.session)throw m.config("Provide either `token` or `session`, not both.");typeof n.token=="string"?(te(n.token),this.credential=n.token):n.token&&(this.credential=n.token),this.http=new j({...n,getAuthHeaders:()=>this.getAuthHeaders(),createDeployBody:this.getDeployBodyCreator()});let e={getApi:()=>this.http,ensureInit:()=>this.ensureInitialized()};this.deployments=Me({...e,processInput:(o,l)=>this.processInput(o,l)}),this.domains=Be(e),this.account=He(e),this.tokens=Ge(e)}async ensureInitialized(){return this.initPromise||(this.initPromise=this.fetchPlatformLimits()),this.initPromise}async fetchPlatformLimits(){try{this.platformLimits=await this.http.getLimits()}catch(n){throw this.initPromise=null,n}}async ping(){return await this.ensureInitialized(),this.http.ping()}async deploy(n,e){return this.deployments.upload(n,e)}async whoami(){return this.account.get()}async getLimits(){return this.platformLimits?this.platformLimits:(await this.ensureInitialized(),this.platformLimits)}on(n,e){this.http.on(n,e)}off(n,e){this.http.off(n,e)}setHeaders(n){this.http.setGlobalHeaders(n)}clearHeaders(){this.http.setGlobalHeaders({})}setToken(n){if(this.clientOptions.session)throw m.config("Provide either `token` or `session`, not both.");if(typeof n=="string"){if(!n)throw m.business("Invalid token provided. Token must be a non-empty string.");te(n),this.credential=n;return}if(typeof n!="function")throw m.business("Invalid token provided. Token must be a non-empty string or a provider function.");this.credential=n}async getAuthHeaders(){if(this.credential===null)return{};let n=typeof this.credential=="function"?await this.credential():this.credential;if(!n)throw m.authentication("Token provider returned no token.");if(typeof n!="string")throw m.authentication("Token provider returned a non-string value.");return{Authorization:`Bearer ${n}`}}};R();async function ke(t,n={}){let{labels:e,via:o,password:l,flags:c,captcha:f}=n,h=new FormData,d=[];for(let g of t){if(!(g.content instanceof File||g.content instanceof Blob))throw m.file(`Unsupported file.content type for browser: ${g.path}`,{filePath:g.path});if(!g.md5)throw m.file(`File missing md5 checksum: ${g.path}`,{filePath:g.path});let y=new File([g.content],g.path,{type:"application/octet-stream"});h.append(P.FILES,y),d.push(g.md5)}return h.append(P.CHECKSUMS,JSON.stringify(d)),e&&e.length>0&&h.append(P.LABELS,JSON.stringify(e)),o&&h.append(P.VIA,o),l&&h.append(P.PASSWORD,l),c?.build&&h.append(P.BUILD,"true"),c?.prerender&&h.append(P.PRERENDER,"true"),c?.spa&&h.append(P.SPA,"true"),f&&h.append(P.CAPTCHA,f),{body:h,headers:{}}}R();R();oe();le();ce();fe();X();de();function Qn(t,n,e,o=!0){let l=t===1?n:e;return o?`${t} ${l}`:l}me();var he=class extends W{async deploy(n,e){return super.deploy(n,e)}async processInput(n,e){if(!Array.isArray(n)||!n.every(l=>l instanceof File))throw m.business("Invalid input type for browser environment. Expected File[].");if(n.length===0)throw m.business("No files to deploy.");let{processFilesForBrowser:o}=await Promise.resolve().then(()=>(me(),Qe));return o(n,e,this.platformLimits??void 0)}getDeployBodyCreator(){return ke}},Sr=he;export{Re as API_KEY,T as API_PATHS,Vt as AUTH_BASE_PATH,zt as AccountPlan,j as ApiHttp,Ee as AuthMethod,$ as CALLER,ne as DEFAULT_API,v as DEPLOYMENT_CONFIG_FILENAME,P as DEPLOY_FIELDS,be as DEPLOY_TOKEN,Ht as DeploymentStatus,at as DeploymentVia,Gt as DomainStatus,E as ErrorType,b as FILE_VALIDATION_STATUS,b as FileValidationStatus,U as IDEMPOTENCY_KEY_CONSTRAINTS,Mt as JUNK_DIRECTORIES,N as LABEL_CONSTRAINTS,ve as LABEL_PATTERN,Wt as MY_API_KEY_URL,Yt as OAuthScope,z as PASSWORD_CONSTRAINTS,Jt as PUBLIC_DEPLOYMENT_TTL_SECONDS,Xt as SHIP_ENV,V as SPA_CHECK_CONSTRAINTS,Ie as SPA_DEFAULT_CONFIG,he as Ship,m as ShipError,O as TokenKind,ht as UNBUILT_PROJECT_MARKERS,mt as UNSAFE_FILENAME_CHARS,Kt as WEB_FILE_ACCEPT,Cn as __setTestEnvironment,zn as allValidFilesReady,we as assertShipJsonSyntax,B as calculateMD5,yt as classifyToken,He as createAccountResource,Me as createDeploymentResource,Be as createDomainResource,Ge as createTokenResource,Sr as default,rn as deserializeLabels,Zt as extractSubdomain,qe as filterJunk,Q as formatFileSize,en as generateDeploymentUrl,tn as generateDomainUrl,Ve as getENV,Ct as getValidFiles,K as hasUnbuiltMarker,Se as hasUnsafeChars,Te as isBlockedExtension,Qt as isCustomDomain,qt as isDeployment,_e as isPlatformDomain,De as isShipError,kt as normalizeVia,Ke as optimizeDeployPaths,Qn as pluralize,Je as processFilesForBrowser,nn as serializeLabels,gt as validateApiKey,jt as validateApiUrl,Pe as validateCaller,We as validateDeployFile,Xe as validateDeployPath,Et as validateDeployToken,pe as validateFileName,kn as validateFiles,Ae as validateIdempotencyKey,re as validatePassword,te as validateToken};
2
2
  //# sourceMappingURL=browser.js.map