// @bun
var{defineProperty:L,getOwnPropertyNames:O,getOwnPropertyDescriptor:Q}=Object,X=Object.prototype.hasOwnProperty;function Y(j){return this[j]}var H=(j)=>{var A=(N??=new WeakMap).get(j),B;if(A)return A;if(A=L({},"__esModule",{value:!0}),j&&typeof j==="object"||typeof j==="function"){for(var D of O(j))if(!X.call(A,D))L(A,D,{get:Y.bind(j,D),enumerable:!(B=Q(j,D))||B.enumerable})}return N.set(j,A),A},N;var Z=(j)=>j;function _(j,A){this[j]=Z.bind(null,A)}var W=(j,A)=>{for(var B in A)L(j,B,{get:A[B],enumerable:!0,configurable:!0,set:_.bind(A,B)})};var $=(j,A)=>()=>(j&&(A=j(j=0)),A);var V=import.meta.require;function C(j,A={}){let B=[];for(let[F,G]of Object.entries(A)){if(G===void 0||G===null)continue;if(Array.isArray(G))B.push(`${F}=${encodeURIComponent(G.join(","))}`);else if(typeof G==="boolean"){if(G)B.push(`${F}=true`)}else B.push(`${F}=${encodeURIComponent(String(G))}`)}if(B.length===0)return j;let D=j.includes("?")?"&":"?";return`${j}${D}${B.join("&")}`}function S(j){let A=j.indexOf("?");if(A===-1)return{src:j,params:{}};let B=j.slice(0,A),D=j.slice(A+1),F={};for(let G of D.split("&")){let[K,M]=G.split("="),J=M?decodeURIComponent(M):"";if(J==="true")F[K]=!0;else if(J==="false")F[K]=!1;else if(/^-?\d+$/.test(J))F[K]=Number.parseInt(J,10);else if(/^-?\d+\.\d+$/.test(J))F[K]=Number.parseFloat(J);else if(J.includes(","))F[K]=J.split(",");else F[K]=J}return{src:B,params:F}}function R(...j){let A={};for(let B of j)if(B)Object.assign(A,B);return A}function x(j,A,B,D){let F={w:A};if(B)F.h=B;if(D)F.fit=D;return C(j,F)}function k(j,A,B,D="center"){return C(j,{w:A,h:B,fit:"crop",crop:D})}function P(j,A,B="center"){return C(j,{w:A,h:A,fit:"crop",crop:B})}function w(j,A,B){return C(j,{w:A,h:B,fit:"max"})}function q(j,A,B){return C(j,{w:A,h:B,fit:"crop"})}function v(j,A){return C(j,{blur:Math.min(2000,Math.max(0,A))})}function y(j,A){return C(j,{sharp:Math.min(100,Math.max(0,A))})}function b(j){return C(j,{sat:-100})}function z(j,A=100){return C(j,{sepia:Math.min(100,Math.max(0,A))})}function U(j){return C(j,{invert:!0})}function I(j,A){return C(j,{bri:Math.min(100,Math.max(-100,A))})}function h(j,A){return C(j,{con:Math.min(100,Math.max(-100,A))})}function g(j,A){return C(j,{sat:Math.min(100,Math.max(-100,A))})}function o(j,A){return C(j,{rot:(A%360+360)%360})}function c(j){return C(j,{flip:"h"})}function n(j){return C(j,{flip:"v"})}function d(j,A,B){let D={fm:A};if(B!==void 0)D.q=B;return C(j,D)}function u(j,A){return C(j,{q:Math.min(100,Math.max(1,A))})}function l(j,A=["format","compress"]){return C(j,{auto:A})}function p(j,A,B={}){return C(j,{mark:A,markx:B.x,marky:B.y,markalpha:B.alpha,markscale:B.scale,markalign:B.align})}function t(j,A,B){return C(j,R(T[A],B))}function m(j,A,B){return A.map((D)=>C(j,{...B,w:D}))}function i(j,A,B=[1,2,3],D){return B.map((F)=>C(j,{...D,w:Math.round(A*F),dpr:F}))}function e(j){let A=[];if(j.w!==void 0&&(j.w<1||j.w>16383))A.push("Width must be between 1 and 16383");if(j.h!==void 0&&(j.h<1||j.h>16383))A.push("Height must be between 1 and 16383");if(j.q!==void 0&&(j.q<1||j.q>100))A.push("Quality must be between 1 and 100");if(j.blur!==void 0&&(j.blur<0||j.blur>2000))A.push("Blur must be between 0 and 2000");if(j.rot!==void 0&&(j.rot<0||j.rot>359))A.push("Rotation must be between 0 and 359");if(j.dpr!==void 0&&(j.dpr<1||j.dpr>5))A.push("DPR must be between 1 and 5");return{valid:A.length===0,errors:A}}function s(j){let A={...j};if(A.w!==void 0)A.w=Math.min(16383,Math.max(1,A.w));if(A.h!==void 0)A.h=Math.min(16383,Math.max(1,A.h));if(A.q!==void 0)A.q=Math.min(100,Math.max(1,A.q));if(A.blur!==void 0)A.blur=Math.min(2000,Math.max(0,A.blur));if(A.rot!==void 0)A.rot=(A.rot%360+360)%360;if(A.dpr!==void 0)A.dpr=Math.min(5,Math.max(1,A.dpr));return A}var T;var E=$(()=>{T={web:{fm:"webp",q:80,auto:["format","compress"]},highQuality:{q:95},thumb:{w:150,h:150,fit:"crop",crop:"center"},avatar:{w:200,h:200,fit:"crop",crop:"faces"},social:{w:1200,h:630,fit:"crop"},preview:{w:400,q:70},placeholder:{w:20,blur:200,q:20}}});E();export{p as watermark,e as validateParams,P as thumbnail,m as srcsetUrls,y as sharpen,z as sepia,g as saturation,s as sanitizeParams,o as rotate,x as resize,u as quality,S as parseImageUrl,R as mergeParams,U as invert,b as grayscale,d as format,n as flipVertical,c as flipHorizontal,i as dprUrls,k as crop,q as cover,h as contrast,w as contain,C as buildImageUrl,I as brightness,v as blur,l as auto,t as applyPreset,T as PRESETS};
