diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index fc12a7fc886..bb80440c664 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@  - 11.1.0-rc.3.5 + 11.1.0-rc.3.6 diff --git a/src/BootstrapBlazor/wwwroot/lib/pickr/nano.min.css b/src/BootstrapBlazor/wwwroot/lib/pickr/nano.min.css index 15a9e59e168..c29e3a887db 100644 --- a/src/BootstrapBlazor/wwwroot/lib/pickr/nano.min.css +++ b/src/BootstrapBlazor/wwwroot/lib/pickr/nano.min.css @@ -1,2 +1,2 @@ -/*! Pickr 1.10.2 MIT | https://github.com/simonwep/pickr */ +/*! Pickr 1.10.3 MIT | https://github.com/simonwep/pickr */ .pickr{position:relative;overflow:visible;transform:translateY(0)}.pickr *{box-sizing:border-box;outline:none;border:none;-webkit-appearance:none}.pickr .pcr-button::before{position:absolute;content:"";top:0;left:0;width:100%;height:100%;background:url('data:image/svg+xml;utf8, ');background-size:.5em;border-radius:.15em;z-index:-1}.pickr .pcr-button{position:relative;height:2em;width:2em;padding:.5em;cursor:pointer;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Helvetica Neue",Arial,sans-serif;border-radius:.15em;background:url('data:image/svg+xml;utf8, ') no-repeat center;background-size:0;transition:all .3s}.pickr .pcr-button::before{z-index:initial}.pickr .pcr-button::after{position:absolute;content:"";top:0;left:0;height:100%;width:100%;transition:background .3s;background:var(--pcr-color);border-radius:.15em}.pickr .pcr-button.clear{background-size:70%}.pickr .pcr-button.clear::before{opacity:0}.pickr .pcr-button.clear:focus{box-shadow:0 0 0 1px hsla(0,0%,100%,.85),0 0 0 3px var(--pcr-color)}.pickr .pcr-button.disabled{cursor:not-allowed}.pickr *,.pcr-app *{box-sizing:border-box;outline:none;border:none;-webkit-appearance:none}.pickr input:focus,.pickr input.pcr-active,.pickr button:focus,.pickr button.pcr-active,.pcr-app input:focus,.pcr-app input.pcr-active,.pcr-app button:focus,.pcr-app button.pcr-active{box-shadow:0 0 0 1px hsla(0,0%,100%,.85),0 0 0 3px var(--pcr-color)}.pickr .pcr-palette,.pickr .pcr-slider,.pcr-app .pcr-palette,.pcr-app .pcr-slider{transition:box-shadow .3s}.pickr .pcr-palette:focus,.pickr .pcr-slider:focus,.pcr-app .pcr-palette:focus,.pcr-app .pcr-slider:focus{box-shadow:0 0 0 1px hsla(0,0%,100%,.85),0 0 0 3px rgba(0,0,0,.25)}.pcr-app{position:fixed;display:flex;flex-direction:column;z-index:10000;border-radius:.1em;background:#fff;opacity:0;visibility:hidden;transition:opacity .3s,visibility 0s .3s;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Helvetica Neue",Arial,sans-serif;box-shadow:0 .15em 1.5em 0 rgba(0,0,0,.1),0 0 1em 0 rgba(0,0,0,.03);left:0;top:0}.pcr-app.visible{transition:opacity .3s;visibility:visible;opacity:1}.pcr-app .pcr-swatches{display:flex;flex-wrap:wrap;margin-top:.75em}.pcr-app .pcr-swatches.pcr-last{margin:0}@supports(display: grid){.pcr-app .pcr-swatches{display:grid;align-items:center;grid-template-columns:repeat(auto-fit, 1.75em)}}.pcr-app .pcr-swatches>button::before{position:absolute;content:"";top:0;left:0;width:100%;height:100%;background:url('data:image/svg+xml;utf8, ');background-size:6px;border-radius:.15em;z-index:-1}.pcr-app .pcr-swatches>button{font-size:1em;position:relative;width:calc(1.75em - 5px);height:calc(1.75em - 5px);border-radius:.15em;cursor:pointer;margin:2.5px;flex-shrink:0;justify-self:center;transition:all .15s;overflow:hidden;background:rgba(0,0,0,0);z-index:1}.pcr-app .pcr-swatches>button::after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background:var(--pcr-color);border:1px solid rgba(0,0,0,.05);border-radius:.15em;box-sizing:border-box}.pcr-app .pcr-swatches>button:hover{filter:brightness(1.05)}.pcr-app .pcr-swatches>button:not(.pcr-active){box-shadow:none}.pcr-app .pcr-interaction{display:flex;flex-wrap:wrap;align-items:center;margin:0 -0.2em 0 -0.2em}.pcr-app .pcr-interaction>*{margin:0 .2em}.pcr-app .pcr-interaction input{letter-spacing:.07em;font-size:.75em;text-align:center;cursor:pointer;color:#75797e;background:#f1f3f4;border-radius:.15em;transition:all .15s;padding:.45em .5em;margin-top:.75em}.pcr-app .pcr-interaction input:hover{filter:brightness(0.975)}.pcr-app .pcr-interaction input:focus{box-shadow:0 0 0 1px hsla(0,0%,100%,.85),0 0 0 3px rgba(66,133,244,.75)}.pcr-app .pcr-interaction .pcr-result{color:#75797e;text-align:left;flex:1 1 8em;min-width:8em;transition:all .2s;border-radius:.15em;background:#f1f3f4;cursor:text}.pcr-app .pcr-interaction .pcr-result::selection{background:#4285f4;color:#fff}.pcr-app .pcr-interaction .pcr-type.active{color:#fff;background:#4285f4}.pcr-app .pcr-interaction .pcr-save,.pcr-app .pcr-interaction .pcr-cancel,.pcr-app .pcr-interaction .pcr-clear{color:#fff;width:auto}.pcr-app .pcr-interaction .pcr-save,.pcr-app .pcr-interaction .pcr-cancel,.pcr-app .pcr-interaction .pcr-clear{color:#fff}.pcr-app .pcr-interaction .pcr-save:hover,.pcr-app .pcr-interaction .pcr-cancel:hover,.pcr-app .pcr-interaction .pcr-clear:hover{filter:brightness(0.925)}.pcr-app .pcr-interaction .pcr-save{background:#4285f4}.pcr-app .pcr-interaction .pcr-clear,.pcr-app .pcr-interaction .pcr-cancel{background:#f44250}.pcr-app .pcr-interaction .pcr-clear:focus,.pcr-app .pcr-interaction .pcr-cancel:focus{box-shadow:0 0 0 1px hsla(0,0%,100%,.85),0 0 0 3px rgba(244,66,80,.75)}.pcr-app .pcr-selection .pcr-picker{position:absolute;height:18px;width:18px;border:2px solid #fff;border-radius:100%;user-select:none}.pcr-app .pcr-selection .pcr-color-palette,.pcr-app .pcr-selection .pcr-color-chooser,.pcr-app .pcr-selection .pcr-color-opacity{position:relative;user-select:none;display:flex;flex-direction:column;cursor:grab}.pcr-app .pcr-selection .pcr-color-palette:active,.pcr-app .pcr-selection .pcr-color-chooser:active,.pcr-app .pcr-selection .pcr-color-opacity:active{cursor:grabbing}.pcr-app[data-theme=nano]{width:14.25em;max-width:95vw}.pcr-app[data-theme=nano] .pcr-swatches{margin-top:.6em;padding:0 .6em}.pcr-app[data-theme=nano] .pcr-interaction{padding:0 .6em .6em .6em}.pcr-app[data-theme=nano] .pcr-selection{display:grid;grid-gap:.6em;grid-template-columns:1fr 4fr;grid-template-rows:5fr auto auto;align-items:center;height:10.5em;width:100%;align-self:flex-start}.pcr-app[data-theme=nano] .pcr-selection .pcr-color-preview{grid-area:2/1/4/1;height:100%;width:100%;display:flex;flex-direction:row;justify-content:center;margin-left:.6em}.pcr-app[data-theme=nano] .pcr-selection .pcr-color-preview .pcr-last-color{display:none}.pcr-app[data-theme=nano] .pcr-selection .pcr-color-preview .pcr-current-color::before{position:absolute;content:"";top:0;left:0;width:100%;height:100%;background:url('data:image/svg+xml;utf8, ');background-size:.5em;border-radius:.15em;z-index:-1}.pcr-app[data-theme=nano] .pcr-selection .pcr-color-preview .pcr-current-color{position:relative;background:var(--pcr-color);width:2em;height:2em;border-radius:50em;overflow:hidden}.pcr-app[data-theme=nano] .pcr-selection .pcr-color-palette{grid-area:1/1/2/3;width:100%;height:100%;z-index:1}.pcr-app[data-theme=nano] .pcr-selection .pcr-color-palette .pcr-palette{border-radius:.15em}.pcr-app[data-theme=nano] .pcr-selection .pcr-color-palette .pcr-palette::before{position:absolute;content:"";top:0;left:0;width:100%;height:100%;background:url('data:image/svg+xml;utf8, ');background-size:.5em;border-radius:.15em;z-index:-1}.pcr-app[data-theme=nano] .pcr-selection .pcr-color-palette .pcr-palette{width:100%;height:100%}.pcr-app[data-theme=nano] .pcr-selection .pcr-color-chooser{grid-area:2/2/2/2}.pcr-app[data-theme=nano] .pcr-selection .pcr-color-opacity{grid-area:3/2/3/2}.pcr-app[data-theme=nano] .pcr-selection .pcr-color-chooser,.pcr-app[data-theme=nano] .pcr-selection .pcr-color-opacity{height:.5em;margin:0 .6em}.pcr-app[data-theme=nano] .pcr-selection .pcr-color-chooser .pcr-picker,.pcr-app[data-theme=nano] .pcr-selection .pcr-color-opacity .pcr-picker{top:50%;transform:translateY(-50%)}.pcr-app[data-theme=nano] .pcr-selection .pcr-color-chooser .pcr-slider,.pcr-app[data-theme=nano] .pcr-selection .pcr-color-opacity .pcr-slider{flex-grow:1;border-radius:50em}.pcr-app[data-theme=nano] .pcr-selection .pcr-color-chooser .pcr-slider{background:linear-gradient(to right, hsl(0, 100%, 50%), hsl(60, 100%, 50%), hsl(120, 100%, 50%), hsl(180, 100%, 50%), hsl(240, 100%, 50%), hsl(300, 100%, 50%), hsl(0, 100%, 50%))}.pcr-app[data-theme=nano] .pcr-selection .pcr-color-opacity .pcr-slider{background:linear-gradient(to right, transparent, black),url('data:image/svg+xml;utf8, ');background-size:100%,.25em} \ No newline at end of file diff --git a/src/BootstrapBlazor/wwwroot/lib/pickr/pickr.min.js b/src/BootstrapBlazor/wwwroot/lib/pickr/pickr.min.js index 749ad3f8ef2..38afc1cb133 100644 --- a/src/BootstrapBlazor/wwwroot/lib/pickr/pickr.min.js +++ b/src/BootstrapBlazor/wwwroot/lib/pickr/pickr.min.js @@ -1,4 +1,4 @@ -/*! Pickr 1.10.2 MIT | https://github.com/simonwep/pickr */ +/*! Pickr 1.10.3 MIT | https://github.com/simonwep/pickr */ (function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.Pickr=t())})(this,function(){var e=Object.defineProperty,t=((t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r})({adjustableInputNumbers:()=>l,createElementFromString:()=>a,createFromTemplate:()=>o,eventPath:()=>s,off:()=>i,on:()=>r,resolveElement:()=>c});function n(e,t,n,r,i={}){t instanceof HTMLCollection||t instanceof NodeList?t=Array.from(t):Array.isArray(t)||(t=[t]),Array.isArray(n)||(n=[n]);for(let a of t)for(let t of n)a[e](t,r,{capture:!1,...i});return Array.prototype.slice.call(arguments,1)}var r=n.bind(null,`addEventListener`),i=n.bind(null,`removeEventListener`);function a(e){let t=document.createElement(`div`);return t.innerHTML=e.trim(),t.firstElementChild}function o(e){let t=(e,t)=>{let n=e.getAttribute(t);return e.removeAttribute(t),n},n=(e,r={})=>{let i=t(e,`:obj`),a=t(e,`:ref`),o=i?r[i]={}:r;a&&(r[a]=e);for(let r of Array.from(e.children)){let e=t(r,`:arr`),i=n(r,e?{}:o);e&&(o[e]||(o[e]=[])).push(Object.keys(i).length?i:r)}return r};return n(a(e))}function s(e){let t=e.path||e.composedPath&&e.composedPath();if(t)return t;let n=e.target.parentElement;for(t=[e.target,n];n=n.parentElement;)t.push(n);return t.push(document,window),t}function c(e){return e instanceof Element?e:typeof e==`string`?e.split(/>>/g).reduce((e,t,n,r)=>(e=e.querySelector(t),ne){function n(n){let r=[.001,.01,.1][Number(n.shiftKey||n.ctrlKey*2)]*(n.deltaY<0?1:-1),i=0,a=e.selectionStart;e.value=e.value.replace(/[\d.]+/g,(e,n)=>n<=a&&n+e.length>=a?(a=n,t(Number(e),r,i)):(i++,e)),e.focus(),e.setSelectionRange(a,a),n.preventDefault(),e.dispatchEvent(new Event(`input`))}r(e,`focus`,()=>r(window,`wheel`,n,{passive:!1})),r(e,`blur`,()=>i(window,`wheel`,n))}var{min:u,max:d,floor:f,round:p}=Math;function m(e){if(e.toLowerCase()===`black`)return`#000`;let t=document.createElement(`canvas`).getContext(`2d`);return t.fillStyle=e,/^#0{3,6}$/.test(t.fillStyle)?null:t.fillStyle}function h(e,t,n){e=e/360*6,t/=100,n/=100;let r=f(e),i=e-r,a=n*(1-t),o=n*(1-i*t),s=n*(1-(1-i)*t),c=r%6,l=[n,o,a,a,s,n][c],u=[s,n,n,o,a,a][c],d=[a,a,s,n,n,o][c];return[l*255,u*255,d*255]}function g(e,t,n){return h(e,t,n).map(e=>p(e).toString(16).padStart(2,`0`))}function _(e,t,n){let r=h(e,t,n),i=r[0]/255,a=r[1]/255,o=r[2]/255,s=u(1-i,1-a,1-o),c=s===1?0:(1-i-s)/(1-s),l=s===1?0:(1-a-s)/(1-s),d=s===1?0:(1-o-s)/(1-s);return[c*100,l*100,d*100,s*100]}function v(e,t,n){t/=100,n/=100;let r=(2-t)*n/2;return r!==0&&(t=r===1?0:r<.5?t*n/(r*2):t*n/(2-r*2)),[e,t*100,r*100]}function y(e,t,n){e/=255,t/=255,n/=255;let r=u(e,t,n),i=d(e,t,n),a=i-r,o,s,c=i;if(a===0)o=s=0;else{s=a/i;let r=((i-e)/6+a/2)/a,c=((i-t)/6+a/2)/a,l=((i-n)/6+a/2)/a;e===i?o=l-c:t===i?o=1/3+r-l:n===i&&(o=2/3+c-r),o<0?o+=1:o>1&&--o}return[o*360,s*100,c*100]}function b(e,t,n,r){return e/=100,t/=100,n/=100,r/=100,[...y((1-u(1,e*(1-r)+r))*255,(1-u(1,t*(1-r)+r))*255,(1-u(1,n*(1-r)+r))*255)]}function x(e,t,n){t/=100,n/=100,t*=n<.5?n:1-n;let r=2*t/(n+t)*100,i=(n+t)*100;return[e,isNaN(r)?0:r,i]}function S(e){return y(...e.match(/.{2}/g).map(e=>parseInt(e,16)))}function C(e){e=e.match(/^[a-zA-Z]+$/)&&m(e)||e;let t={cmyk:/^cmyk\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)/i,rgba:/^rgba?\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D*?(([\d.]+)(%?)|$)/i,hsla:/^hsla?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hsva:/^hsva?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},n=e=>e.map(e=>/^(|\d+)\.\d+|\d+$/.test(e)?Number(e):void 0),r;invalid:for(let i in t)if(r=t[i].exec(e))switch(i){case`cmyk`:{let[,e,t,a,o]=n(r);if(e>100||t>100||a>100||o>100)break invalid;return{values:b(e,t,a,o),type:i}}case`rgba`:{let[,e,,t,,a,,,o]=n(r);if(e=r[2]===`%`?e/100*255:e,t=r[4]===`%`?t/100*255:t,a=r[6]===`%`?a/100*255:a,o=r[9]===`%`?o/100:o,e>255||t>255||a>255||o<0||o>1)break invalid;return{values:[...y(e,t,a),o],a:o,type:i}}case`hexa`:{let[,e]=r;(e.length===4||e.length===3)&&(e=e.split(``).map(e=>e+e).join(``));let t=e.substring(0,6),n=e.substring(6);return n=n?parseInt(n,16)/255:void 0,{values:[...S(t),n],a:n,type:i}}case`hsla`:{let[,e,t,a,,o]=n(r);if(o=r[6]===`%`?o/100:o,e>360||t>100||a>100||o<0||o>1)break invalid;return{values:[...x(e,t,a),o],a:o,type:i}}case`hsva`:{let[,e,t,a,,o]=n(r);if(o=r[6]===`%`?o/100:o,e>360||t>100||a>100||o<0||o>1)break invalid;return{values:[e,t,a,o],a:o,type:i}}}return{values:null,type:null}}function w(e=0,t=0,n=0,r=1){let i=(e,t)=>(n=-1)=>t(~n?e.map(e=>Number(e.toFixed(n))):e),a={h:e,s:t,v:n,a:r,toHSVA(){let e=[a.h,a.s,a.v,a.a];return e.toString=i(e,e=>`hsva(${e[0]}, ${e[1]}%, ${e[2]}%, ${a.a})`),e},toHSLA(){let e=[...v(a.h,a.s,a.v),a.a];return e.toString=i(e,e=>`hsla(${e[0]}, ${e[1]}%, ${e[2]}%, ${a.a})`),e},toRGBA(){let e=[...h(a.h,a.s,a.v),a.a];return e.toString=i(e,e=>`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${a.a})`),e},toCMYK(){let e=_(a.h,a.s,a.v);return e.toString=i(e,e=>`cmyk(${e[0]}%, ${e[1]}%, ${e[2]}%, ${e[3]}%)`),e},toHEXA(){let e=g(a.h,a.s,a.v),t=a.a>=1?``:Number((a.a*255).toFixed(0)).toString(16).toUpperCase().padStart(2,`0`);return t&&e.push(t),e.toString=()=>`#${e.join(``).toUpperCase()}`,e},clone:()=>w(a.h,a.s,a.v,a.a)};return a}var T=e=>Math.max(Math.min(e,1),0);function E(e){let t={options:Object.assign({lock:null,onchange:()=>0,onstop:()=>0},e),_keyboard(e){let{options:n}=t,{type:r,key:i}=e;if(document.activeElement===n.wrapper){let{lock:n}=t.options,a=i===`ArrowUp`,o=i===`ArrowRight`,s=i===`ArrowDown`,c=i===`ArrowLeft`;if(r===`keydown`&&(a||o||s||c)){let r,i=0;n===`v`?r=a||o?1:-1:n===`h`?r=a||o?-1:1:(i=a?-1:+!!s,r=c?-1:+!!o),t.update(T(t.cache.x+.01*r),T(t.cache.y+.01*i)),e.preventDefault()}else i.startsWith(`Arrow`)&&(t.options.onstop(),e.preventDefault())}},_tapstart(e){r(document,[`mouseup`,`touchend`,`touchcancel`],t._tapstop),r(document,[`mousemove`,`touchmove`],t._tapmove),e.cancelable&&e.preventDefault(),t._tapmove(e)},_tapmove(e){let{options:n,cache:r}=t,{lock:i,element:a,wrapper:o}=n,s=o.getBoundingClientRect(),c=0,l=0;if(e){let t=e&&e.touches&&e.touches[0];c=e?(t||e).clientX:0,l=e?(t||e).clientY:0,cs.left+s.width&&(c=s.left+s.width),ls.top+s.height&&(l=s.top+s.height),c-=s.left,l-=s.top}else r&&(c=r.x*s.width,l=r.y*s.height);i!==`h`&&(a.style.left=`calc(${c/s.width*100}% - ${a.offsetWidth/2}px)`),i!==`v`&&(a.style.top=`calc(${l/s.height*100}% - ${a.offsetHeight/2}px)`),t.cache={x:c/s.width,y:l/s.height};let u=T(c/s.width),d=T(l/s.height);switch(i){case`v`:return n.onchange(u);case`h`:return n.onchange(d);default:return n.onchange(u,d)}},_tapstop(){t.options.onstop(),i(document,[`mouseup`,`touchend`,`touchcancel`],t._tapstop),i(document,[`mousemove`,`touchmove`],t._tapmove)},trigger(){t._tapmove()},update(e=0,n=0){let{left:r,top:i,width:a,height:o}=t.options.wrapper.getBoundingClientRect();t.options.lock===`h`&&(n=e),t._tapmove({clientX:r+a*e,clientY:i+o*n})},destroy(){let{options:e,_tapstart:n,_keyboard:r}=t;i(document,[`keydown`,`keyup`],r),i([e.wrapper,e.element],`mousedown`,n),i([e.wrapper,e.element],`touchstart`,n,{passive:!1})}},{options:n,_tapstart:a,_keyboard:o}=t;return r([n.wrapper,n.element],`mousedown`,a),r([n.wrapper,n.element],`touchstart`,a,{passive:!1}),r(document,[`keydown`,`keyup`],o),t}function D(e={}){e=Object.assign({onchange:()=>0,className:``,elements:[]},e);let t=r(e.elements,`click`,t=>{e.elements.forEach(n=>n.classList[t.target===n?`add`:`remove`](e.className)),e.onchange(t),t.stopPropagation()});return{destroy:()=>i(...t)}}var O=e=>{let{components:t,useAsButton:n,inline:r,appClass:i,theme:a,lockOpacity:s}=e.options,c=e=>e?``:`style="display:none" hidden`,l=t=>e._t(t),u=o(`
@@ -44,8 +44,8 @@
- `),d=u.interaction;return d.options.find(e=>!e.hidden&&!e.classList.add(`active`)),d.type=()=>d.options.find(e=>e.classList.contains(`active`)),u},k={variantFlipOrder:{start:`sme`,middle:`mse`,end:`ems`},positionFlipOrder:{top:`tbrl`,right:`rltb`,bottom:`btrl`,left:`lrbt`},position:`bottom`,margin:8,padding:0},A=(e,t,n)=>{let{container:r,arrow:i,margin:a,padding:o,position:s,variantFlipOrder:c,positionFlipOrder:l}={container:document.documentElement.getBoundingClientRect(),...k,...n},{left:u,top:d}=t.style;t.style.left=`0`,t.style.top=`0`;let f=e.getBoundingClientRect(),p=t.getBoundingClientRect(),m={t:f.top-p.height-a,b:f.bottom+a,r:f.right+a,l:f.left-p.width-a},h={vs:f.left,vm:f.left+f.width/2-p.width/2,ve:f.left+f.width-p.width,hs:f.top,hm:f.bottom-f.height/2-p.height/2,he:f.bottom-p.height},[g,_=`middle`]=s.split(`-`),v=l[g],y=c[_],{top:b,left:x,bottom:S,right:C}=r;for(let e of v){let n=e===`t`||e===`b`,r=m[e],[a,s]=n?[`top`,`left`]:[`left`,`top`],[c,l]=n?[p.height,p.width]:[p.width,p.height],[u,d]=n?[S,C]:[C,S],[g,_]=n?[b,x]:[x,b];if(!(ru))for(let u of y){let m=h[(n?`v`:`h`)+u];if(!(m<_||m+l+o>d)){if(m-=p[s],r-=p[a],t.style[s]=`${m}px`,t.style[a]=`${r}px`,i){let t=n?f.width/2:f.height/2,o=l/2,d=t>o,p={s:d?o:t,m:o,e:d?o:l-t},h={t:c,b:0,r:0,l:c},g=m+p[u],_=r+h[e];i.style[s]=`${g}px`,i.style[a]=`${_}px`}return e+u}}}return t.style.left=u,t.style.top=d,null},j=(e,t,n)=>{let r=typeof e==`object`&&!(e instanceof HTMLElement)?e:{reference:e,popper:t,...n};return{update(e=r){let{reference:t,popper:n}=Object.assign(r,e);if(!n||!t)throw Error(`Popper- or reference-element missing.`);return A(t,n,r)}}};return class e{static utils=t;static version=`1.10.2`;static I18N_DEFAULTS={"ui:dialog":`color picker dialog`,"btn:toggle":`toggle color picker dialog`,"btn:swatch":`color swatch`,"btn:last-color":`use previous color`,"btn:save":`Save`,"btn:cancel":`Cancel`,"btn:clear":`Clear`,"aria:btn:save":`save and close`,"aria:btn:cancel":`cancel and close`,"aria:btn:clear":`clear and close`,"aria:input":`color input field`,"aria:palette":`color selection area`,"aria:hue":`hue selection slider`,"aria:opacity":`selection slider`};static DEFAULT_OPTIONS={appClass:null,theme:`classic`,useAsButton:!1,padding:8,disabled:!1,comparison:!0,closeOnScroll:!1,outputPrecision:0,lockOpacity:!1,autoReposition:!0,container:`body`,components:{interaction:{}},i18n:{},swatches:null,inline:!1,sliders:null,default:`#42445a`,defaultRepresentation:null,position:`bottom-middle`,adjustableNumbers:!0,showAlways:!1,closeWithKey:`Escape`};_initializingActive=!0;_recalc=!0;_nanopop=null;_root=null;_color=w();_lastColor=w();_swatchColors=[];_setupAnimationFrame=null;_components=null;_eventBindings=[];_eventListener={init:[],save:[],hide:[],show:[],clear:[],change:[],changestop:[],cancel:[],swatchselect:[]};constructor(t){this.options=t=Object.assign({...e.DEFAULT_OPTIONS},t);let{swatches:n,components:r,theme:i,sliders:a,lockOpacity:o,padding:s}=t;[`nano`,`monolith`].includes(i)&&!a&&(t.sliders=`h`),r.interaction||={};let{preview:c,opacity:l,hue:u,palette:d}=r;r.opacity=!o&&l,r.palette=d||c||l||u,this._preBuild(),this._buildComponents(),this._bindEvents(),this._finalBuild(),n&&n.length&&n.forEach(e=>this.addSwatch(e));let{button:f,app:p}=this._root;this._nanopop=j(f,p,{margin:s}),f.setAttribute(`role`,`button`),f.setAttribute(`aria-label`,this._t(`btn:toggle`));let m=this;this._setupAnimationFrame=requestAnimationFrame((function e(){if(!p.offsetWidth)return requestAnimationFrame(e);m.setColor(m._color?.toHSLA().toString()??t.default),m._rePositioningPicker(),t.defaultRepresentation&&(m._representation=t.defaultRepresentation,m.setColorRepresentation(m._representation)),t.showAlways&&m.show(),m._initializingActive=!1,m._emit(`init`)}))}static create=t=>new e(t);_preBuild(){let{options:e}=this;for(let t of[`el`,`container`])e[t]=c(e[t]);this._root=O(this),e.useAsButton&&(this._root.button=e.el),e.container.appendChild(this._root.root)}_finalBuild(){let e=this.options,t=this._root;if(e.container.removeChild(t.root),e.inline){let n=e.el.parentElement;e.el.nextSibling?n.insertBefore(t.app,e.el.nextSibling):n.appendChild(t.app)}else e.container.appendChild(t.app);e.useAsButton?e.inline&&e.el.remove():e.el.parentNode.replaceChild(t.root,e.el),e.disabled&&this.disable(),e.comparison||(t.button.style.transition=`none`,e.useAsButton||(t.preview.lastColor.style.transition=`none`)),this.hide()}_buildComponents(){let e=this,t=this.options.components,n=(e.options.sliders||`v`).repeat(2),[r,i]=n.match(/^[vh]+$/g)?n:[],a=()=>this._color||=this._lastColor.clone(),o={palette:E({element:e._root.palette.picker,wrapper:e._root.palette.palette,onstop:()=>e._emit(`changestop`,`slider`,e),onchange(n,r){if(!t.palette)return;let i=a(),{_root:o,options:s}=e,{lastColor:c,currentColor:l}=o.preview;e._recalc&&(i.s=n*100,i.v=100-r*100,i.v<0&&(i.v=0),e._updateOutput(`slider`));let u=i.toRGBA().toString(0);this.element.style.background=u,this.wrapper.style.background=` + `),d=u.interaction;return d.options.find(e=>!e.hidden&&!e.classList.add(`active`)),d.type=()=>d.options.find(e=>e.classList.contains(`active`)),u},k={variantFlipOrder:{start:`sme`,middle:`mse`,end:`ems`},positionFlipOrder:{top:`tbrl`,right:`rltb`,bottom:`btrl`,left:`lrbt`},position:`bottom`,margin:8,padding:0},A=(e,t,n)=>{let{container:r,arrow:i,margin:a,padding:o,position:s,variantFlipOrder:c,positionFlipOrder:l}={container:document.documentElement.getBoundingClientRect(),...k,...n},{left:u,top:d}=t.style;t.style.left=`0`,t.style.top=`0`;let f=e.getBoundingClientRect(),p=t.getBoundingClientRect(),m={t:f.top-p.height-a,b:f.bottom+a,r:f.right+a,l:f.left-p.width-a},h={vs:f.left,vm:f.left+f.width/2-p.width/2,ve:f.left+f.width-p.width,hs:f.top,hm:f.bottom-f.height/2-p.height/2,he:f.bottom-p.height},[g,_=`middle`]=s.split(`-`),v=l[g],y=c[_],{top:b,left:x,bottom:S,right:C}=r;for(let e of v){let n=e===`t`||e===`b`,r=m[e],[a,s]=n?[`top`,`left`]:[`left`,`top`],[c,l]=n?[p.height,p.width]:[p.width,p.height],[u,d]=n?[S,C]:[C,S],[g,_]=n?[b,x]:[x,b];if(!(ru))for(let u of y){let m=h[(n?`v`:`h`)+u];if(!(m<_||m+l+o>d)){if(m-=p[s],r-=p[a],t.style[s]=`${m}px`,t.style[a]=`${r}px`,i){let t=n?f.width/2:f.height/2,o=l/2,d=t>o,p={s:d?o:t,m:o,e:d?o:l-t},h={t:c,b:0,r:0,l:c},g=m+p[u],_=r+h[e];i.style[s]=`${g}px`,i.style[a]=`${_}px`}return e+u}}}return t.style.left=u,t.style.top=d,null},j=(e,t,n)=>{let r=typeof e==`object`&&!(e instanceof HTMLElement)?e:{reference:e,popper:t,...n};return{update(e=r){let{reference:t,popper:n}=Object.assign(r,e);if(!n||!t)throw Error(`Popper- or reference-element missing.`);return A(t,n,r)}}};return class e{static utils=t;static version=`1.10.3`;static I18N_DEFAULTS={"ui:dialog":`color picker dialog`,"btn:toggle":`toggle color picker dialog`,"btn:swatch":`color swatch`,"btn:last-color":`use previous color`,"btn:save":`Save`,"btn:cancel":`Cancel`,"btn:clear":`Clear`,"aria:btn:save":`save and close`,"aria:btn:cancel":`cancel and close`,"aria:btn:clear":`clear and close`,"aria:input":`color input field`,"aria:palette":`color selection area`,"aria:hue":`hue selection slider`,"aria:opacity":`selection slider`};static DEFAULT_OPTIONS={appClass:null,theme:`classic`,useAsButton:!1,padding:8,disabled:!1,comparison:!0,closeOnScroll:!1,outputPrecision:0,lockOpacity:!1,autoReposition:!0,container:`body`,components:{interaction:{}},i18n:{},swatches:null,inline:!1,sliders:null,default:`#42445a`,defaultRepresentation:null,position:`bottom-middle`,adjustableNumbers:!0,showAlways:!1,closeWithKey:`Escape`};_initializingActive=!0;_recalc=!0;_nanopop=null;_root=null;_color=w();_lastColor=w();_swatchColors=[];_setupAnimationFrame=null;_components=null;_eventBindings=[];_eventListener={init:[],save:[],hide:[],show:[],clear:[],change:[],changestop:[],cancel:[],swatchselect:[]};constructor(t){this.options=t=Object.assign({...e.DEFAULT_OPTIONS},t);let{swatches:n,components:r,theme:i,sliders:a,lockOpacity:o,padding:s}=t;[`nano`,`monolith`].includes(i)&&!a&&(t.sliders=`h`),r.interaction||={};let{preview:c,opacity:l,hue:u,palette:d}=r;r.opacity=!o&&l,r.palette=d||c||l||u,this._preBuild(),this._buildComponents(),this._bindEvents(),this._finalBuild(),n&&n.length&&n.forEach(e=>this.addSwatch(e));let{button:f,app:p}=this._root;this._nanopop=j(f,p,{margin:s}),f.setAttribute(`role`,`button`),f.setAttribute(`aria-label`,this._t(`btn:toggle`));let m=this;this._setupAnimationFrame=requestAnimationFrame((function e(){if(!p.offsetWidth)return requestAnimationFrame(e);m.setColor(t.default),m._rePositioningPicker(),t.defaultRepresentation&&(m._representation=t.defaultRepresentation,m.setColorRepresentation(m._representation)),t.showAlways&&m.show(),m._initializingActive=!1,m._emit(`init`)}))}static create=t=>new e(t);_preBuild(){let{options:e}=this;for(let t of[`el`,`container`])e[t]=c(e[t]);this._root=O(this),e.useAsButton&&(this._root.button=e.el),e.container.appendChild(this._root.root)}_finalBuild(){let e=this.options,t=this._root;if(e.container.removeChild(t.root),e.inline){let n=e.el.parentElement;e.el.nextSibling?n.insertBefore(t.app,e.el.nextSibling):n.appendChild(t.app)}else e.container.appendChild(t.app);e.useAsButton?e.inline&&e.el.remove():e.el.parentNode.replaceChild(t.root,e.el),e.disabled&&this.disable(),e.comparison||(t.button.style.transition=`none`,e.useAsButton||(t.preview.lastColor.style.transition=`none`)),this.hide()}_buildComponents(){let e=this,t=this.options.components,n=(e.options.sliders||`v`).repeat(2),[r,i]=n.match(/^[vh]+$/g)?n:[],a=()=>this._color||=this._lastColor.clone(),o={palette:E({element:e._root.palette.picker,wrapper:e._root.palette.palette,onstop:()=>e._emit(`changestop`,`slider`,e),onchange(n,r){if(!t.palette)return;let i=a(),{_root:o,options:s}=e,{lastColor:c,currentColor:l}=o.preview;e._recalc&&(i.s=n*100,i.v=100-r*100,i.v<0&&(i.v=0),e._updateOutput(`slider`));let u=i.toRGBA().toString(0);this.element.style.background=u,this.wrapper.style.background=` linear-gradient(to top, rgba(0, 0, 0, ${i.a}), transparent), linear-gradient(to left, hsla(${i.h}, 100%, 50%, ${i.a}), rgba(255, 255, 255, ${i.a})) - `,s.comparison?!s.useAsButton&&!e._lastColor&&c.style.setProperty(`--pcr-color`,u):(o.button.style.setProperty(`--pcr-color`,u),o.button.classList.remove(`clear`));let d=i.toHEXA().toString();for(let{el:t,color:n}of e._swatchColors)t.classList[d===n.toHEXA().toString()?`add`:`remove`](`pcr-active`);l.style.setProperty(`--pcr-color`,u)}}),hue:E({lock:i===`v`?`h`:`v`,element:e._root.hue.picker,wrapper:e._root.hue.slider,onstop:()=>e._emit(`changestop`,`slider`,e),onchange(n){if(!t.hue||!t.palette)return;let r=a();e._recalc&&(r.h=n*360),this.element.style.backgroundColor=`hsl(${r.h}, 100%, 50%)`,o.palette.trigger()}}),opacity:E({lock:r===`v`?`h`:`v`,element:e._root.opacity.picker,wrapper:e._root.opacity.slider,onstop:()=>e._emit(`changestop`,`slider`,e),onchange(n){if(!t.opacity||!t.palette)return;let r=a();e._recalc&&(r.a=Math.round(n*100)/100),this.element.style.background=`rgba(0, 0, 0, ${r.a})`,o.palette.trigger()}}),selectable:D({elements:e._root.interaction.options,className:`active`,onchange(t){e._representation=t.target.getAttribute(`data-type`).toUpperCase(),e._recalc&&e._updateOutput(`swatch`)}})};this._components=o}_bindEvents(){let{_root:e,options:t}=this,n=[r(e.interaction.clear,`click`,()=>this._clearColor()),r([e.interaction.cancel,e.preview.lastColor],`click`,()=>{this.setHSVA(...(this._lastColor||this._color).toHSVA(),!0),this._emit(`cancel`)}),r(e.interaction.save,`click`,()=>{!this.applyColor()&&!t.showAlways&&this.hide()}),r(e.interaction.result,[`keyup`,`input`],e=>{this.setColor(e.target.value,!0)&&!this._initializingActive&&(this._emit(`change`,this._color,`input`,this),this._emit(`changestop`,`input`,this)),e.stopImmediatePropagation()}),r(e.interaction.result,[`focus`,`blur`],e=>{this._recalc=e.type===`blur`,this._recalc&&this._updateOutput(null)}),r([e.palette.palette,e.palette.picker,e.hue.slider,e.hue.picker,e.opacity.slider,e.opacity.picker],[`mousedown`,`touchstart`],()=>{this._root.interaction.result.blur(),this._recalc=!0},{passive:!0})];if(!t.showAlways){let i=t.closeWithKey;n.push(r(e.button,`click`,()=>this.isOpen()?this.hide():this.show()),r(document,`keyup`,e=>this.isOpen()&&(e.key===i||e.code===i)&&this.hide()),r(document,[`touchstart`,`mousedown`],t=>{this.isOpen()&&!s(t).some(t=>t===e.app||t===e.button)&&this.hide()},{capture:!0}))}if(t.adjustableNumbers){let t={rgba:[255,255,255,1],hsva:[360,100,100,1],hsla:[360,100,100,1],cmyk:[100,100,100,100]};l(e.interaction.result,(e,n,r)=>{let i=t[this.getColorRepresentation().toLowerCase()];if(i){let t=i[r],a=e+(t>=100?n*1e3:n);return a<=0?0:Number((a{i.isOpen()&&(t.closeOnScroll&&i.hide(),e===null?(e=setTimeout(()=>e=null,100),requestAnimationFrame(function t(){i._rePositioningPicker(),e!==null&&requestAnimationFrame(t)})):(clearTimeout(e),e=setTimeout(()=>e=null,100)))},{capture:!0}))}this._eventBindings=n}_rePositioningPicker(){let{options:e}=this;if(!e.inline&&!this._nanopop.update({container:document.body.getBoundingClientRect(),position:e.position})){let e=this._root.app,t=e.getBoundingClientRect();e.style.top=`${(window.innerHeight-t.height)/2}px`,e.style.left=`${(window.innerWidth-t.width)/2}px`}}_updateOutput(e){let{_root:t,_color:n,options:r}=this;if(t.interaction.type()){let e=`to${t.interaction.type().getAttribute(`data-type`)}`;t.interaction.result.value=typeof n[e]==`function`?n[e]().toString(r.outputPrecision):``}!this._initializingActive&&this._recalc&&this._emit(`change`,n,e,this)}_clearColor(e=!1){let{_root:t,options:n}=this;n.useAsButton||t.button.style.setProperty(`--pcr-color`,`rgba(0, 0, 0, 0.15)`),t.button.classList.add(`clear`),n.showAlways||this.hide(),this._lastColor=null,!this._initializingActive&&!e&&(this._emit(`save`,null),this._emit(`clear`))}_parseLocalColor(e){let{values:t,type:n,a:r}=C(e),{lockOpacity:i}=this.options,a=r!==void 0&&r!==1;return t&&t.length===3&&(t[3]=void 0),{values:!t||i&&a?null:t,type:n}}_t(t){return this.options.i18n[t]||e.I18N_DEFAULTS[t]}_emit(e,...t){this._eventListener[e].forEach(e=>e(...t,this))}on(e,t){return this._eventListener[e].push(t),this}off(e,t){let n=this._eventListener[e]||[],r=n.indexOf(t);return~r&&n.splice(r,1),this}addSwatch(e){let{values:t}=this._parseLocalColor(e);if(t){let{_swatchColors:e,_root:n}=this,i=w(...t),o=a(`