PageSourceSearch

https://volumo.com/_next/static/chunks/3698.f0fb9b00838dfd1e.js

js volumo.com collected 2026-10-03 21:27:12 UTC 16,335 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3698],{11317:(t,e,r)=>{r.d(e,{getPalette:()=>K});var i,n,o=Object.defineProperty,a=Object.getOwnPropertyNames,h=(t,e)=>function(){return t&&(e=(0,t[a(t)[0]])(t=0)),e};function s(t){return("display-p3"===t||"auto"===t)&&function(){if(void 0!==i)return i;try{let t=document.createElement("canvas").getContext("2d",{colorSpace:"display-p3"});i=!!t&&t.getContextAttributes?.().colorSpace==="display-p3"}catch{i=!1}return i}()?"display-p3":"srgb"}function l(t,e,r,i){try{return"display-p3"===i?t.getImageData(0,0,e,r,{colorSpace:"display-p3"}):t.getImageData(0,0,e,r)}catch(t){if(t instanceof DOMException&&"SecurityError"===t.name){let e=Error('Image is tainted by cross-origin data. Add crossorigin="anonymous" to the <img> tag and ensure the server sends appropriate CORS headers.');throw e.cause=t,e}throw t}}function u(t,e,r,i){let n=s(r),o=document.createElement("canvas");o.width=t,o.height=e;let a="display-p3"===n?o.getContext("2d",{colorSpace:"display-p3"}):o.getContext("2d");return i(a),{data:l(a,t,e,n).data,width:t,height:e,colorSpace:n}}function c(t,e,r,i){let n=s(i);return{data:l(t,e,r,n).data,width:e,height:r,colorSpace:n}}var f=h({"src/loaders/canvas-utils.ts"(){}}),g={},d={BrowserPixelLoader:()=>n};for(var m in d)o(g,m,{get:d[m],enumerable:!0});var p=h({"src/loaders/browser.ts"(){f(),n=class{async load(t,e,r="srgb"){if("u">typeof HTMLImageElement&&t instanceof HTMLImageElement)return this.loadFromImage(t,r);if("u">typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement)return this.loadFromCanvas(t,r);if("u">typeof ImageData&&t instanceof ImageData)return{data:t.data,width:t.width,height:t.height,colorSpace:t.colorSpace??"srgb"};if("u">typeof HTMLVideoElement&&t instanceof HTMLVideoElement)return this.loadFromVideo(t,r);if("u">typeof ImageBitmap&&t instanceof ImageBitmap)return this.loadFromImageBitmap(t,r);if("u">typeof OffscreenCanvas&&t instanceof OffscreenCanvas)return this.loadFromOffscreenCanvas(t,r);throw Error("Unsupported source type. Expected HTMLImageElement, HTMLCanvasElement, HTMLVideoElement, ImageData, ImageBitmap, or OffscreenCanvas.")}loadFromImage(t,e){if(!t.complete)throw Error('Image has not finished loading. Wait for the "load" event before calling getColor/getPalette.');if(!t.naturalWidth)throw Error("Image has no dimensions. It may not have loaded successfully.");return u(t.naturalWidth,t.naturalHeight,e,e=>e.drawImage(t,0,0,t.naturalWidth,t.naturalHeight))}loadFromCanvas(t,e){return c(t.getContext("2d"),t.width,t.height,e)}loadFromVideo(t,e){if(t.readyState<2)throw Error('Video is not ready. Wait for the "loadeddata" or "canplay" event before calling getColor/getPalette.');let r=t.videoWidth,i=t.videoHeight;if(!r||!i)throw Error("Video has no dimensions. It may not have loaded successfully.");return u(r,i,e,e=>e.drawImage(t,0,0,r,i))}loadFromOffscreenCanvas(t,e){let r=t.getContext("2d");if(!r)throw Error("Could not get 2D context from OffscreenCanvas.");return c(r,t.width,t.height,e)}loadFromImageBitmap(t,e){return u(t.width,t.height,e,e=>e.drawImage(t,0,0))}}}});function b(t){let e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function w(t){return Math.round(Math.max(0,Math.min(255,255*(t<=.0031308?12.92*t:1.055*M
1ath.pow(t,1/2.4)-.055))))}function M(t,e){let r=[[0,0,0],[0,0,0],[0,0,0]];for(let i=0;i<3;i++)for(let n=0;n<3;n++)r[i][n]=t[i][0]*e[0][n]+t[i][1]*e[1][n]+t[i][2]*e[2][n];return r}function y(t){let[e,r,i]=t[0],[n,o,a]=t[1],[h,s,l]=t[2],u=o*l-a*s,c=-(n*l-a*h),f=n*s-o*h,g=1/(e*u+r*c+i*f);return[[u*g,(i*s-r*l)*g,(r*a-i*o)*g],[c*g,(e*l-i*h)*g,(i*n-e*a)*g],[f*g,(r*h-e*s)*g,(e*o-r*n)*g]]}function v(t,e,r,i){return[t[0][0]*e+t[0][1]*r+t[0][2]*i,t[1][0]*e+t[1][1]*r+t[1][2]*i,t[2][0]*e+t[2][1]*r+t[2][2]*i]}var _=[[.4865709486,.2656676932,.1982172852],[.2289745641,.6917385218,.0792869141],[0,.0451133819,1.0439443689]],x=M([[.8189330101,.3618667424,-.1288597137],[.0329845436,.9293118715,.0361456387],[.0482003018,.2643662691,.633851707]],_),E=y(x),C=M(y([[.4123907993,.3575843394,.1804807884],[.2126390059,.7151686788,.0721923154],[.0193308187,.1191947798,.9505321522]]),_),I=y(C),k=[.2126,.7152,.0722];function S(t,e,r,i="srgb"){if("display-p3"===i)return function(t,e,r){var i,n,o;let a,h,s,l,[u,c,f]=v(x,b(t),b(e),b(r));return a=1.9779984951*(i=Math.cbrt(u))-2.428592205*(n=Math.cbrt(c))+.4505937099*(o=Math.cbrt(f)),s=Math.sqrt(a*a+(h=.0259040371*i+.7827717662*n-.808675766*o)*h),(l=180/Math.PI*Math.atan2(h,a))<0&&(l+=360),{l:.2104542553*i+.793617785*n-.0040720468*o,c:s,h:l}}(t,e,r);let n=b(t),o=b(e),a=b(r),h=Math.cbrt(.4122214708*n+.5363325363*o+.0514459929*a),s=Math.cbrt(.2119034982*n+.6806995451*o+.1073969566*a),l=Math.cbrt(.0883024619*n+.2817188376*o+.6299787005*a),u=1.9779984951*h-2.428592205*s+.4505937099*l,c=.0259040371*h+.7827717662*s-.808675766*l,f=Math.sqrt(u*u+c*c),g=180/Math.PI*Math.atan2(c,u);return g<0&&(g+=360),{l:.2104542553*h+.793617785*s-.0040720468*l,c:f,h:g}}function $(t,e,r){let[i,n,o]=v(C,b(t),b(e),b(r));return[w(i),w(n),w(o)]}function T(t,e){return(Math.max(t,e)+.05)/(Math.min(t,e)+.05)}var F=class{constructor(t,e,r,i,n,o="srgb"){this._r=t,this._g=e,this._b=r,this.gamut=o,this.population=i,this.proportion=n}get srgb(){return this._srgb||(this._srgb="display-p3"===this.gamut?$(this._r,this._g,this._b):[this._r,this._g,this._b]),this._srgb}rgb(t="srgb"){if(t===this.gamut)return{r:this._r,g:this._g,b:this._b};let[e,r,i]="display-p3"===t?function(t,e,r){let[i,n,o]=v(I,b(t),b(e),b(r));return[w(i),w(n),w(o)]}(this._r,this._g,this._b):this.srgb;return{r:e,g:r,b:i}}hex(){let[t,e,r]=this.srgb,i=t=>t.toString(16).padStart(2,"0");return`#${i(t)}${i(e)}${i(r)}`}hsl(){if(!this._hsl){let[t,e,r]=this.srgb;this._hsl=function(t,e,r){let i=t/255,n=e/255,o=r/255,a=Math.max(i,n,o),h=Math.min(i,n,o),s=(a+h)/2,l=0,u=0;if(a!==h){let t=a-h;u=s>.5?t/(2-a-h):t/(a+h),l=a===i?((n-o)/t+6*(n<o))/6:a===n?((o-i)/t+2)/6:((i-n)/t+4)/6}return{h:Math.round(360*l),s:Math.round(100*u),l:Math.round(100*s)}}(t,e,r)}return this._hsl}oklch(){return this._oklch||(this._oklch=S(this._r,this._g,this._b,this.gamut)),this._oklch}css(t){if(void 0===t){if("display-p3"===this.gamut){let t=t=>+(t/255).toFixed(4);return`color(display-p3 ${t(this._r)} ${t(this._g)} ${t(this._b)})`}t="rgb"}switch(t){case"hsl":{let{h:t,s:e,l:r}=this.hsl();return`hsl(${t}, ${e}%, ${r}%)`}case"oklch":{let{l:t,c:e,h:r}=this.oklch();return`oklch(${t.toFixed(3)} ${e.toFixed(3)} ${r.toFixed(1)})`}default:{let[t,e,r]=this.srgb;return`rgb(${t}, ${e}, ${r})`}}}array(){return[...this.srgb]}toString(){return this.hex()}get textColor(){return this.isDark?"#ffffff":"#000000"}get luminance(){return void 0===this._luminance&&(this._luminance=function(t,e,r,i="srgb"){let n=b(t),o=b(e),a=b(r),[h,s,l]="display-p3"===i?_[1]:k;return h*n+s*o+l*a}(this._r,this._g,this._b,this.gamut)),this._luminance}get isDark(){return this.luminance<=.179}get isLight(){return!this.isDark}get contrast(){if(!this._contrast){let t=this.luminance,e=T(t,1),r=T(t,0),i=this.isDark?D(255,255,255,0,0):D(0,0,0,0,0);this._contrast={white:Math.round(100*e)/100,black:Math.round(100*r)/100,foreground:i}}return this._contrast}};function D(t,e,r,i,n=0,o="srgb"){return new F(t,e,r,i,n,o)}function P(t,e){if("number"!=typeof t||!Number.isFinite(t))throw Error(`region.${e} must be a finite number between 0 and 1 (received ${String(t)})`);if(t<0||t>1)throw Error(`region.${e} must be between 0 and 1 (received ${t}). Region coordinates are fractions of the image size, not pixels.`);return t}function O(t){if(null===t||"object"!=typeof t)throw Error("region must be an object of the form { x, y, width, height } with values between 0 and 1");let e=P(t.x,"x"),r=P(t.y,"y"),i=P(t.width,"width"),n=P(t.height,"height");if(i<=0||n<=0)throw Error(`region.width and region.height must be greater than 0 (received ${i} and ${n})`);let o=Math.min(i,1-e),a=Math.min(n,1-r);if(o<=0||a<=0)throw Error(`region is outside the image: x=${e}, y=${r} leaves no area to sample`);return{x:e,y:r,width:o,height:a}}function H(t,e,r,i){let{ignoreWhite:n=!0,whiteThreshold:o=250,alphaThreshold:a=125,minSaturation:h=0}=i,s=[];for(let i=0;i<e;i+=r){let e=4*i,r=t[e],l=t[e+1],u=t[e+2],c=t[e+3];if((void 0===c||!(c<a))&&(!n||!(r>o)||!(l>o)||!(u>o))){if(h>0){let t=Math.max(r,l,u);if(0===t||(t-Math.min(r,l,u))/t<h)continue}s.push([r,l,u])}}return s}D(255,255,255,0),D(0,0,0,0);function L(t,e,r){return(t<<10)+(e<<5)+r}var W=class t{constructor(t,e,r,i,n,o,a){this.r1=t,this.r2=e,this.g1=r,this.g2=i,this.b1=n,this.b2=o,this.histo=a}volume(t=!1){return(void 0===this._volume||t)&&(this._volume=(this.r2-this.r1+1)*(this.g2-this.g1+1)*(this.b2-this.b1+1)),this._volume}count(t=!1){if(void 0===this._count||t){let t=0;for(let e=this.r1;e<=this.r2;e++)for(let r=this.g1;r<=this.g2;r++)for(let i=this.b1;i<=this.b2;i++)t+=this.histo[L(e,r,i)]||0;this._count=t}return this._count}copy(){return new t(this.r1,this.r2,this.g1,this.g2,this.b1,this.b2,this.histo)}avg(t=!1){if(void 0===this._avg||t){let t=8;if(this.r1===this.r2&&this.g1===this.g2&&this.b1===this.b2)this._avg=[this.r1<<3,this.g1<<3,this.b1<<3];else{let e=0,r=0,i=0,n=0;for(let o=this.r1;o<=this.r2;o++)for(let a=this.g1;a<=this.g2;a++)for(let h=this.b1;h<=this.b2;h++){let s=this.histo[L(o,a,h)]||0;e+=s,r+=s*(o+.5)*t,i+=s*(a+.5)*t,n+=s*(h+.5)*t}e?this._avg=[~~(r/e),~~(i/e),~~(n/e)]:this._avg=[~~(t*(this.r1+this.r2+1)/2),~~(t*(this.g1+this.g2+1)/2),~~(t*(this.b1+this.b2+1)/2)]}}return this._avg}},q=class{constructor(t){this.comparator=t,this.contents=[],this.sorted=!1}sort(){this.contents.sort(this.comparator),this.sorted=!0}
1push(t){this.contents.push(t),this.sorted=!1}peek(t){return this.sorted||this.sort(),this.contents[t??this.contents.length-1]}pop(){return this.sorted||this.sort(),this.contents.pop()}size(){return this.contents.length}map(t){return this.contents.map(t)}};function A(t,e,r){let i=t.size(),n=0;for(;n<1e3;){if(i>=e)return;n++;let o=t.pop();if(!o.count()){t.push(o);continue}let a=function(t,e){if(!e.count())return;if(1===e.count())return[e.copy(),null];let r=e.r2-e.r1+1,i=e.g2-e.g1+1,n=Math.max(r,i,e.b2-e.b1+1),o=0,a=[],h=[];if(n===r)for(let r=e.r1;r<=e.r2;r++){let i=0;for(let n=e.g1;n<=e.g2;n++)for(let o=e.b1;o<=e.b2;o++)i+=t[L(r,n,o)]||0;o+=i,a[r]=o}else if(n===i)for(let r=e.g1;r<=e.g2;r++){let i=0;for(let n=e.r1;n<=e.r2;n++)for(let o=e.b1;o<=e.b2;o++)i+=t[L(n,r,o)]||0;o+=i,a[r]=o}else for(let r=e.b1;r<=e.b2;r++){let i=0;for(let n=e.r1;n<=e.r2;n++)for(let o=e.g1;o<=e.g2;o++)i+=t[L(n,o,r)]||0;o+=i,a[r]=o}function s(t){let r=t+"1",i=t+"2";for(let t=e[r];t<=e[i];t++)if(a[t]>o/2){let n,o=e.copy(),s=e.copy(),l=t-e[r],u=e[i]-t;
1for(n=l<=u?Math.min(e[i]-1,~~(t+u/2)):Math.max(e[r],~~(t-1-l/2));!a[n];)n++;let c=h[n];for(;!c&&a[n-1];)c=h[--n];return o[i]=n,s[r]=o[i]+1,[o,s]}}return s((a.forEach((t,e)=>{h[e]=o-t}),n===r)?"r":n===i?"g":"b")}(r,o);if(!a||!a[0])return;t.push(a[0]),a[1]&&(t.push(a[1]),i++)}}var z=class{async init(){}quantize(t,e){return function(t,e){if(!t.length||e<2||e>256)return[];let r=function(t){let e=new Uint32Array(32768);for(let r of t){let t=r[0]>>3,i=r[1]>>3,n=r[2]>>3;e[L(t,i,n)]++}return e}(t),i=function(t,e){let r=1e6,i=0,n=1e6,o=0,a=1e6,h=0;for(let e of t){let t=e[0]>>3,s=e[1]>>3,l=e[2]>>3;t<r?r=t:t>i&&(i=t),s<n?n=s:s>o&&(o=s),l<a?a=l:l>h&&(h=l)}return new W(r,i,n,o,a,h,e)}(t,r),n=new q((t,e)=>t.count()-e.count());n.push(i),A(n,.75*e,r);let o=new q((t,e)=>t.count()*t.volume()-e.count()*e.volume());for(;n.size();)o.push(n.pop());A(o,e,r);let a=[];for(;o.size();){let t=o.pop();a.push({color:t.avg(),population:t.count()})}return a}(t,e)}};async function j(){let{BrowserPixelLoader:t}=await Promise.resolve().then(()=>(p(),g));return new t}var B=new Set,V=null,N=null;async function U(t){return t||V||(V=await j())}async function R(t){if(t)return await t.init(),t;if(N)return N;let e=new z;return await e.init(),N=e,e}function G(t){if(t?.aborted)throw t.reason??new DOMException("Aborted","AbortError")}async function J(t,e,r){G(e?.signal);let i=await U(e?.loader);return function(t,e){var r,i;if(!e)return t;let{width:n,height:o}=t;if(!n||!o)return t;let a=function(t,e,r){let{x:i,y:n,width:o,height:a}=O(t),h=Math.min(Math.max(Math.round(i*e),0),Math.max(e-1,0)),s=Math.min(Math.max(Math.round(n*r),0),Math.max(r-1,0)),l=Math.min(Math.max(Math.round(o*e),1),e-h),u=Math.min(Math.max(Math.round(a*r),1),r-s);return{left:h,top:s,width:l,height:u}}(e,n,o);if(0===a.left&&0===a.top&&a.width===n&&a.height===o)return t;let h=4*a.width,s=(r=t.data,i=h*a.height,r instanceof Uint8ClampedArray?new Uint8ClampedArray(i):new Uint8Array(i));for(let e=0;e<a.height;e++){let r=((a.top+e)*n+a.left)*4;s.set(t.data.subarray(r,r+h),e*h)}return{data:s,width:a.width,height:a.height,colorSpace:t.colorSpace}}(await i.load(t,e?.signal,e?.gamut??"srgb"),r)}async function K(t,e){var r;let i=function(t){let{colorCount:e,quality:r}=t;if(void 0!==e&&Number.isInteger(e))if(1===e)throw Error("colorCount should be between 2 and 20. To get one color, call getColor() instead of getPalette()");else e=Math.min(e=Math.max(e,2),20);else e=10;(void 0===r||!Number.isInteger(r)||r<1)&&(r=10);let i=void 0===t.ignoreWhite||!!t.ignoreWhite,n="number"==typeof t.whiteThreshold?t.whiteThreshold:250,o="number"==typeof t.alphaThreshold?t.alphaThreshold:125,a="number"==typeof t.minSaturation?Math.max(0,Math.min(1,t.minSaturation)):0,h=t.colorSpace??"oklch";return{colorCount:e,quality:r,ignoreWhite:i,whiteThreshold:n,alphaThreshold:o,minSaturation:a,colorSpace:h,gamut:t.gamut??"srgb",region:void 0!==t.region?O(t.region):void 0}}(e??{});G(e?.signal),e?.worker&&(r="the `worker` option is ignored as of v3 and will be removed in v4. Offloading cost more than it saved and returned different colors than the default path. To move work off the main thread, run Color Thief inside your own worker — see the README.",B.has(r)||(B.add(r),console.warn(`[colorthief] Deprecation: ${r}`)));let[n,o]=await Promise.all([J(t,e,i.region),R(e?.quantizer)]);return G(e?.signal),function(t,e,r,i,n,o="srgb"){var a,h;let s,l=e*r,u={ignoreWhite:i.ignoreWhite,whiteThreshold:i.whiteThreshold,alphaThreshold:i.alphaThreshold,minSaturation:i.minSaturation},c=H(t,l,i.quality,u);0===c.length&&(c=H(t,l,i.quality,{...u,ignoreWhite:!1})),0===c.length&&(c=H(t,l,i.quality,{...u,ignoreWhite:!1,alphaThreshold:0}));let f=(a=c,"srgb"===(h=i.gamut)||"display-p3"!==o?"srgb":"auto"===h?a.some(([t,e,r])=>(function(t,e,r){let[i,n,o]=v(C,b(t),b(e),b(r));return i<-.001||i>1.001||n<-.001||n>1.001||o<-.001||o>1.001})(t,e,r))?"display-p3":"srgb":"display-p3"),g=t=>o===f?t:$(t[0],t[1],t[2]),d=new Set,m=[];for(let t of c){let e=t.join(",");if(!d.has(e)&&(d.add(e),m.push(t),m.length>i.colorCount))break}if(m.length<=i.colorCount){let t=new Map;for(let e of c){let r=e.join(",");t.set(r,(t.get(r)||0)+1)}s=m.map(e=>({color:e,population:t.get(e.join(","))}))}else if("oklch"===i.colorSpace){let t=function(t,e="srgb"){let r=Array(t.length);for(let i=0;i<t.length;i++){let[n,o,a]=t[i],{l:h,c:s,h:l}=S(n,o,a,e);r[i]=[Math.round(255*h),Math.round(s/.4*255),Math.round(l/360*255)]}return r}(c,o);s=function(t,e="srgb"){return t.map(({color:[t,r,i],population:n})=>({color:function(t,e,r,i="srgb"){if("display-p3"===i)return function(t,e,r){let i,n,o,a,h,s,[l,u,c]=(n=e*Math.cos(i=Math.PI/180*r),a=t+.3963377774*n+.2158037573*(o=e*Math.sin(i)),[a*a*a,(h=t-.1055613458*n-.0638541728*o)*h*h,(s=t-.0894841775*n-1.291485548*o)*s*s]),[f,g,d]=v(E,l,u,c);return[w(f),w(g),w(d)]}(t,e,r);let n=Math.PI/180*r,o=e*Math.cos(n),a=e*Math.sin(n),h=t+.3963377774*o+.2158037573*a,s=t-.1055613458*o-.0638541728*a,l=t-.0894841775*o-1.291485548*a,u=h*h*h,c=s*s*s,f=l*l*l;return[w(4.0767416621*u-3.3077115913*c+.2309699292*f),w(-1.2684380046*u+2.6097574011*c-.3413193965*f),w(-.0041960863*u-.7034186147*c+1.707614701*f)]}(t/255,r/255*.4,i/255*360,e),population:n}))}(n.quantize(t,i.colorCount),o)}else s=n.quantize(c,i.colorCount);if(s.length>0){let t=s.reduce((t,e)=>t+e.population,0);return s.map(({color:e,population:r})=>{let[i,n,o]=g(e);return D(i,n,o,r,t>0?r/t:0,f)})}let p=function(t,e,r){let i=0,n=0,o=0,a=0;for(let h=0;h<e;h+=r){let e=4*h;i+=t[e],n+=t[e+1],o+=t[e+2],a++}return 0===a?null:[Math.round(i/a),Math.round(n/a),Math.round(o/a)]}(t,l,i.quality);if(!p)return null;let[M,y,_]=g(p);return[D(M,y,_,1,1,f)]}(n.data,n.width,n.height,i,o,n.colorSpace??"srgb")}f(),new z}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.