@useinsider/ab-components 0.0.80 → 0.0.81

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.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Tt="_button__size_default_pe2mr_1",$t="_button__size_small_pe2mr_8",Lt="_button_pe2mr_1",Rt="_button__label_pe2mr_60",Ot="_button__solid_pe2mr_72",Dt="_fill_pe2mr_1269",fe={button__size_default:Tt,button__size_small:$t,button:Lt,button__label:Rt,"button__solid-primary":"_button__solid-primary_pe2mr_72","no-hover-effect":"_no-hover-effect_pe2mr_79","button--selected":"_button--selected_pe2mr_99","button__solid-subtle-primary":"_button__solid-subtle-primary_pe2mr_105","button__solid-secondary":"_button__solid-secondary_pe2mr_138","button__solid-neutral":"_button__solid-neutral_pe2mr_171","button__solid-danger":"_button__solid-danger_pe2mr_204","button__solid-warning":"_button__solid-warning_pe2mr_237","button__solid-smart":"_button__solid-smart_pe2mr_270","button__solid-toolbar-primary":"_button__solid-toolbar-primary_pe2mr_303","button__ghost-primary":"_button__ghost-primary_pe2mr_336","button__ghost-subtle-primary":"_button__ghost-subtle-primary_pe2mr_369","button__ghost-secondary":"_button__ghost-secondary_pe2mr_402","button__ghost-neutral":"_button__ghost-neutral_pe2mr_435","button__ghost-danger":"_button__ghost-danger_pe2mr_468","button__ghost-warning":"_button__ghost-warning_pe2mr_501","button__ghost-smart":"_button__ghost-smart_pe2mr_534","button__ghost-toolbar-primary":"_button__ghost-toolbar-primary_pe2mr_567","button__ghost-toolbar-smart":"_button__ghost-toolbar-smart_pe2mr_600","button__text-primary":"_button__text-primary_pe2mr_633","button__text-text":"_button__text-text_pe2mr_666","button__text-subtle-primary":"_button__text-subtle-primary_pe2mr_699","button__text-secondary":"_button__text-secondary_pe2mr_732","button__text-neutral":"_button__text-neutral_pe2mr_765","button__text-danger":"_button__text-danger_pe2mr_798","button__text-warning":"_button__text-warning_pe2mr_831","button__text-smart":"_button__text-smart_pe2mr_864","button__outline-primary":"_button__outline-primary_pe2mr_897","button__outline-subtle-primary":"_button__outline-subtle-primary_pe2mr_933","button__outline-secondary":"_button__outline-secondary_pe2mr_969","button__outline-neutral":"_button__outline-neutral_pe2mr_1005","button__outline-danger":"_button__outline-danger_pe2mr_1041","button__outline-warning":"_button__outline-warning_pe2mr_1077","button__outline-smart":"_button__outline-smart_pe2mr_1113",button__solid:Ot,fill:Dt},Pt=["disabled"],Ie=e.defineComponent({__name:"Button",props:{variant:{},color:{},size:{default:"default"},leftIconName:{},rightIconName:{},iconSize:{default:16},iconColor:{},loadingStatus:{type:Boolean,default:!1},successStatus:{type:Boolean,default:!1},label:{},disabled:{type:Boolean,default:!1},fill:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},customClass:{}},emits:["click"],setup(t,{emit:l}){const n=t,o=l,r=i=>{n.disabled||o("click",i)},c=e.computed(()=>n.loadingStatus?"loading-circle":n.successStatus?"line-check-natural":n.leftIconName),a=e.computed(()=>{const i=[fe.button,fe[`button__${n.variant}`],fe[`button__${n.variant}-${n.color}`],fe[`button__size_${n.size}`]];return n.fill&&i.push(fe.fill),n.selected&&i.push(fe["button--selected"]),n.customClass&&i.push(n.customClass),i});return(i,s)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(a.value),disabled:n.disabled,onClick:r},[c.value?(e.openBlock(),e.createBlock(e.unref(F),{key:0,color:i.iconColor,name:c.value,size:i.iconSize},null,8,["color","name","size"])):e.createCommentVNode("",!0),i.label?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(fe).button__label)},e.toDisplayString(i.label),3)):e.createCommentVNode("",!0),i.rightIconName?(e.openBlock(),e.createBlock(e.unref(F),{key:2,color:i.iconColor,name:i.rightIconName,size:i.iconSize},null,8,["color","name","size"])):e.createCommentVNode("",!0)],10,Pt))}}),Ht="_checkbox__label_wgkvb_1",Ft="_checkbox_wgkvb_1",Wt="_checkbox__input_wgkvb_57",Ut="_checkbox__box_wgkvb_65",qt="_checkbox__disabled_wgkvb_87",Yt="_checkbox__checked_wgkvb_87",we={checkbox__label:Ht,checkbox:Ft,checkbox__input:Wt,checkbox__box:Ut,checkbox__disabled:qt,checkbox__checked:Yt},Kt=["for"],Qt=["id","checked","disabled","name","value"],Gt=e.defineComponent({__name:"Checkbox",props:{id:{},name:{default:""},label:{default:""},checked:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},value:{default:""},modelValue:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:l}){const n=t,o=l,r=e.computed(()=>n.modelValue!==void 0?n.modelValue:n.checked);function c(a){if(n.disabled){a.preventDefault();return}const s=a.target.checked;o("update:modelValue",s),o("change",s)}return(a,i)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass([e.unref(we).checkbox,{[e.unref(we).checkbox__checked]:r.value,[e.unref(we).checkbox__disabled]:a.disabled}]),for:a.id},[e.createElementVNode("input",{id:a.id,type:"checkbox",checked:r.value,class:e.normalizeClass(e.unref(we).checkbox__input),disabled:a.disabled,name:a.name,value:a.value,onChange:c},null,42,Qt),e.createElementVNode("span",{class:e.normalizeClass(e.unref(we).checkbox__box)},[r.value?(e.openBlock(),e.createBlock(e.unref(F),{key:0,name:"line-check-netural",size:16})):e.createCommentVNode("",!0)],2),a.label?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(we).checkbox__label)},e.toDisplayString(a.label),3)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"default")],10,Kt))}}),jt={key:0,class:"in-basic-text-input-wrapper__label"},Xt=["innerHTML"],Zt={class:"in-basic-text-input-wrapper__input-field"},Jt={key:0,class:"in-basic-text-input-wrapper__slot-left"},en=["id","name","value","placeholder","disabled","readonly","autocomplete","maxlength","min","max","type"],tn={key:2,class:"in-basic-text-input-wrapper__suffix-text"},nn={key:4,class:"in-basic-text-input-wrapper__slot-right"},on={key:1,class:"in-basic-text-input-wrapper__helper-container"},ln={key:0,class:"in-basic-text-input-wrapper__helper-message"},an={key:0,class:"in-basic-text-input-wrapper__helper-text"},rn={key:1,class:"in-basic-text-input-wrapper__helper-text"},sn=e.defineComponent({__name:"InBasicTextInput",props:{id:{},name:{},theme:{default:"grey"},modelValue:{default:""},labelStatus:{type:Boolean,default:!0},labelText:{default:""},type:{default:"text"},states:{default:"default"},placeholderText:{},disabledStatus:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},leftIconStatus:{type:Boolean,default:!1},leftIconName:{default:void 0},rightIconStatus:{type:Boolean,default:!1},rightIconName:{default:void 0},suffixTextStatus:{type:Boolean,default:!1},suffixText:{default:""},autoComplete:{default:"off"},maxCharacterLength:{default:""},minValue:{default:0},maxValue:{default:""},autoFocus:{type:Boolean,default:!1},allowDecimal:{type:Boolean,default:!1},allowComma:{type:Boolean,default:!0},preventXss:{type:Boolean,default:!0},helperMessageStatus:{type:Boolean,default:!0},helperMessage:{default:""},stateMessage:{default:""}},emits:["update:modelValue","input","change","focus","blur","keyup","keypress","click","paste","leftIconClick","rightIconClick"],setup(t,{emit:l}){const n=t,o=l,r=e.ref(""),c=e.computed(()=>n.preventXss?String(n.labelText).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):n.labelText),a=e.computed(()=>n.states==="default"),i=e.computed(()=>n.states==="warning"||n.states==="error"),s=e.computed(()=>n.helperMessageStatus||i.value),u=e.computed(()=>n.type==="number"),d=e.computed(()=>{const p=["e","E","+","\\"],f=typeof n.minValue=="number"?n.minValue:Number(n.minValue);return!isNaN(f)&&f>=0&&p.push("-"),n.allowDecimal||p.push("."),n.allowComma||p.push(","),p}),h=p=>d.value.includes(p),w=p=>{var f;if(n.preventXss&&(p!=null&&p.target)){const k=String(p.target.value).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;");p.target.value!==k&&(p.target.value=k)}return r.value=((f=p==null?void 0:p.target)==null?void 0:f.value)||"",p},_=p=>{if(!(p!=null&&p.target))return;const f=p.target,k=f.selectionStart;if(k===null)return;const v=k-1,b=p.target.value,A=y(),M=[...b.matchAll(A)].map(T=>T.index);p.target.value=b.replace(A,""),M.length>0&&v>=0&&f.setSelectionRange(v,v)},B=p=>{if(!(p!=null&&p.target))return;const f=p.target.value,k=p.target,v=k.selectionStart;if(v===null)return;let b=v-1;const A=C(),M=[...f.matchAll(A)].map(P=>P.index),T=f.split("");M.length>1&&b>=0&&(T[b]=""),p.target.value=T.join(""),M.length>1&&b>=0&&k.setSelectionRange(b,b)},C=()=>{let p="";return n.allowDecimal&&(p+="."),n.allowComma&&(p+=","),new RegExp(`[${p}]`,"g")},y=()=>{let p="0-9";return n.allowDecimal&&(p+="\\."),n.allowComma&&(p+=","),new RegExp(`[^${p}]+`,"g")},m=p=>{o("keyup",p)},g=p=>{p.key==="Enter"&&o("keypress",p),u.value&&h(p.key)&&p.preventDefault()},x=p=>{o("focus",p)},E=p=>{o("blur",p)},z=p=>{o("click",p)},R=p=>{var v;const f=p;u.value&&(_(f),B(f)),w(f);const k=((v=f==null?void 0:f.target)==null?void 0:v.value)||"";r.value=k,o("input",k),o("update:modelValue",k)},S=p=>{var v;const f=p;u.value&&(_(f),B(f)),w(f);const k=((v=f==null?void 0:f.target)==null?void 0:v.value)||"";r.value=k,o("change",k),o("update:modelValue",k)},I=p=>{var Le,oe;if(n.maxCharacterLength&&typeof n.maxCharacterLength=="number"){const W=p.target,K=W.selectionStart,le=W.selectionEnd;if(K===null||le===null)return;const Ae=W.value,ae=((Le=p.clipboardData)==null?void 0:Le.getData("text/plain"))||"",Ye=Ae.length,de=le-K,pe=n.maxCharacterLength-Ye+de;if(pe<=0){p.preventDefault();return}const Ve=ae.slice(0,pe);if(Ve!==ae){p.preventDefault();const be=Ae.slice(0,K)+Ve+Ae.slice(le);W.value=be;const it=K+Ve.length;W.setSelectionRange(it,it),r.value=be,o("input",be),o("update:modelValue",be);return}}if(!u.value)return;p.preventDefault();const f=p.target,k=f.selectionStart,v=f.selectionEnd;if(k===null||v===null)return;const b=f.value,A=b.includes(".")||b.includes(","),M=((oe=p.clipboardData)==null?void 0:oe.getData("text/plain"))||"",T=C(),P=y();let O=M.replace(P,"");const qe=[...O.matchAll(T)],ne=[];qe.forEach(W=>{W.index!==void 0&&ne.push(W.index)});const ue=O.split("");A||ne.shift(),ne.forEach(W=>{ue[W]=""}),O=ue.join("");const $e=k+O.length,ve=b.slice(0,k)+O+b.slice(v);f.value=ve,f.setSelectionRange($e,$e),r.value=ve,o("input",ve),o("update:modelValue",ve)},V=p=>{o("leftIconClick",p)},N=p=>{o("rightIconClick",p)},$=()=>{e.nextTick(()=>{var p;(p=D.value)==null||p.focus()})},D=e.ref(null),q=e.ref(null);return e.watch(()=>n.modelValue,p=>{r.value=p},{immediate:!0}),e.watch(()=>n.autoFocus,p=>{p&&$()}),e.onMounted(()=>{n.autoFocus&&$()}),(p,f)=>(e.openBlock(),e.createElementBlock("fieldset",{ref_key:"componentRoot",ref:q,class:e.normalizeClass(["in-basic-text-input-wrapper qa-text-input",[`in-basic-text-input-wrapper__${p.states}`,`in-basic-text-input-wrapper__${p.theme}`,{"in-basic-text-input-wrapper__disable":p.disabledStatus}]])},[p.labelStatus?(e.openBlock(),e.createElementBlock("label",jt,[e.createElementVNode("span",{innerHTML:c.value},null,8,Xt)])):e.createCommentVNode("",!0),e.createElementVNode("div",Zt,[p.$slots.leftSlot?(e.openBlock(),e.createElementBlock("div",Jt,[e.renderSlot(p.$slots,"leftSlot",{},void 0,!0)])):e.createCommentVNode("",!0),p.leftIconStatus?(e.openBlock(),e.createBlock(e.unref(F),{key:1,class:"in-basic-text-input-wrapper__icon-left",name:p.leftIconName,size:24,onClick:V},null,8,["name"])):e.createCommentVNode("",!0),e.createElementVNode("input",{id:p.id,ref_key:"textInput",ref:D,class:"in-basic-text-input-wrapper__input",name:p.name,value:r.value,placeholder:p.placeholderText,disabled:p.disabledStatus,readonly:p.readonly,autocomplete:p.autoComplete,maxlength:typeof p.maxCharacterLength=="number"?p.maxCharacterLength:void 0,min:typeof p.minValue=="number"?p.minValue:void 0,max:typeof p.maxValue=="number"?p.maxValue:void 0,type:p.type,onChange:S,onFocus:x,onBlur:E,onKeyup:m,onKeypress:g,onClick:z,onInput:R,onPaste:I},null,40,en),p.suffixTextStatus&&p.suffixText?(e.openBlock(),e.createElementBlock("span",tn,e.toDisplayString(p.suffixText),1)):e.createCommentVNode("",!0),p.rightIconStatus?(e.openBlock(),e.createBlock(e.unref(F),{key:3,class:"in-basic-text-input-wrapper__icon-right",name:p.rightIconName,size:24,onClick:N},null,8,["name"])):e.createCommentVNode("",!0),p.$slots.rightSlot?(e.openBlock(),e.createElementBlock("div",nn,[e.renderSlot(p.$slots,"rightSlot",{},void 0,!0)])):e.createCommentVNode("",!0)]),s.value?(e.openBlock(),e.createElementBlock("div",on,[p.helperMessageStatus||i.value?(e.openBlock(),e.createElementBlock("div",ln,[a.value?(e.openBlock(),e.createElementBlock("p",an,e.toDisplayString(p.helperMessage),1)):e.createCommentVNode("",!0),i.value&&!p.disabledStatus?(e.openBlock(),e.createElementBlock("p",rn,e.toDisplayString(p.stateMessage),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),ee=(t,l)=>{const n=t.__vccOpts||t;for(const[o,r]of l)n[o]=r;return n},Je=ee(sn,[["__scopeId","data-v-be2df566"]]),cn={key:0,class:"color-swatch__transparent"},un=e.defineComponent({__name:"ColorSwatch",props:{color:{},isTransparent:{type:Boolean}},emits:["click"],setup(t){const l=t,n=e.computed(()=>{if(l.color.startsWith("#")&&l.color.length===9)return!0;if(l.color.startsWith("rgba")){const o=l.color.match(/[\d.]+\)$/);if(o)return parseFloat(o[0])<1}return!1});return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:"color-swatch",onClick:r[0]||(r[0]=c=>o.$emit("click"))},[o.isTransparent||n.value?(e.openBlock(),e.createElementBlock("div",cn,[r[1]||(r[1]=e.createElementVNode("div",{class:"color-swatch__checkerboard"},null,-1)),n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"color-swatch__color-overlay",style:e.normalizeStyle({background:o.color})},null,4)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",{key:1,class:"color-swatch__color",style:e.normalizeStyle({background:o.color})},null,4))]))}}),st=ee(un,[["__scopeId","data-v-6eb90458"]]),dn={class:"color-picker"},pn={class:"color-picker__header-wrapper"},fn={class:"color-picker__header"},_n={class:"color-picker__title"},mn={key:0,class:"color-picker__tabs"},hn={class:"color-picker__content-wrapper"},gn={class:"color-picker__gradient-wrapper"},vn={class:"color-picker__color-area"},bn={class:"color-picker__hue-wrapper"},wn={class:"color-picker__opacity-wrapper"},yn={class:"color-picker__hex-input-wrapper"},kn={key:0,class:"color-picker__preset-row"},Cn={key:1,class:"color-picker__preset-row"},Bn={key:2,class:"color-picker__preset-row"},xn=e.defineComponent({__name:"ColorPicker",props:{color:{default:"#666666"},title:{default:"Text Color"},showSaveButton:{type:Boolean,default:!1},presetColors:{default:()=>["#0A2ECC","#FCEFE5","#258DDE","#D37400","#FBD33C","#D37400","#7630D4","#F7F9FA","transparent","#7630D4","#EFF2F4","#DCDEE6","#5D6980","#E7AB29"]},showOpacityInHex:{type:Boolean,default:!0}},emits:["color-change","close"],setup(t,{emit:l}){const n=t,o=l,r=e.ref(0),c=e.ref(0),a=e.ref(.4),i=e.ref(1),s=e.ref("666666"),u=e.ref([]),d=e.ref(!1),h=e.ref(null),w=e.ref(null),_=e.ref(null),B=e.computed(()=>{const f=n.presetColors||[],k=[],v=8;if(f.length===0)return k;const b=f.slice(0,v-1);k.push(b);for(let A=v-1;A<f.length;A+=v)k.push(f.slice(A,A+v));return k}),C=e.computed(()=>{const f=r.value,k=1-Math.abs(f*6%2-1);let v=0,b=0,A=0;return f<1/6?(v=1,b=k):f<2/6?(v=k,b=1):f<3/6?(b=1,A=k):f<4/6?(b=k,A=1):f<5/6?(v=k,A=1):(v=1,A=k),`rgb(${Math.round(v*255)}, ${Math.round(b*255)}, ${Math.round(A*255)})`}),y=e.computed(()=>{const f=r.value,k=c.value,v=a.value,b=v*k,A=b*(1-Math.abs(f*6%2-1)),M=v-b;let T=0,P=0,O=0;return f<1/6?(T=b,P=A):f<2/6?(T=A,P=b):f<3/6?(P=b,O=A):f<4/6?(P=A,O=b):f<5/6?(T=A,O=b):(T=b,O=A),T=Math.round((T+M)*255),P=Math.round((P+M)*255),O=Math.round((O+M)*255),`rgb(${T}, ${P}, ${O})`}),m=e.computed(()=>{const f=y.value.match(/\d+/g);return f?i.value<1?`rgba(${f[0]}, ${f[1]}, ${f[2]}, ${i.value})`:`rgb(${f[0]}, ${f[1]}, ${f[2]})`:y.value});e.watch([r,c,a,i],()=>{g(),d.value||o("color-change",m.value)}),e.watch(()=>n.color,f=>{f&&(d.value=!0,f.toLowerCase()==="transparent"?p():V(f),setTimeout(()=>{d.value=!1},0))},{immediate:!0});function g(){if(i.value===0){s.value="";return}const f=y.value.match(/\d+/g);if(!f)return;const k=f.map(v=>parseInt(v).toString(16).padStart(2,"0")).join("").toUpperCase();if(n.showOpacityInHex){const v=Math.round(i.value*255).toString(16).padStart(2,"0").toUpperCase();s.value=k+v}else s.value=k}function x(f){const k=A=>{if(!h.value)return;const M=h.value.getBoundingClientRect(),T=Math.max(0,Math.min(1,(A.clientX-M.left)/M.width)),P=Math.max(0,Math.min(1,(A.clientY-M.top)/M.height));c.value=T,a.value=1-P};k(f);const v=A=>{k(A)},b=()=>{document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",b)};document.addEventListener("mousemove",v),document.addEventListener("mouseup",b)}function E(f){const k=A=>{if(!w.value)return;const M=w.value.getBoundingClientRect(),T=Math.max(0,Math.min(1,(A.clientY-M.top)/M.height));r.value=T};k(f);const v=A=>{k(A)},b=()=>{document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",b)};document.addEventListener("mousemove",v),document.addEventListener("mouseup",b)}function z(f){const k=A=>{if(!_.value)return;const M=_.value.getBoundingClientRect(),T=Math.max(0,Math.min(1,(A.clientX-M.left)/M.width));i.value=1-T};k(f);const v=A=>{k(A)},b=()=>{document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",b)};document.addEventListener("mousemove",v),document.addEventListener("mouseup",b)}function R(f){const k=n.showOpacityInHex?8:6,v=String(f).replace(/[^0-9A-Fa-f]/g,"").slice(0,k).toUpperCase();s.value=v,n.showOpacityInHex?(v.length===6||v.length===8)&&V(v):v.length===6&&V(v)}function S(f){var A;const k=((A=f.clipboardData)==null?void 0:A.getData("text"))||"",v=n.showOpacityInHex?8:6,b=k.replace(/^#/,"").replace(/[^0-9A-Fa-f]/g,"").slice(0,v).toUpperCase();n.showOpacityInHex?b.length===6||b.length===8?(s.value=b,V(b),f.preventDefault()):b.length>0&&(s.value=b,f.preventDefault()):b.length===6?(s.value=b,V(b),f.preventDefault()):b.length>0&&(s.value=b,f.preventDefault())}function I(){const f=n.showOpacityInHex?8:6;s.value.length!==f&&g()}function V(f){const k=f.startsWith("#")?f.slice(1):f,v=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(k),b=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(k),A=b||v;if(!A){const oe=/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/.exec(f);if(oe){const W=parseInt(oe[1],10)/255,K=parseInt(oe[2],10)/255,le=parseInt(oe[3],10)/255,Ae=oe[4]?parseFloat(oe[4]):1,ae=Math.max(W,K,le),Ye=Math.min(W,K,le),de=ae-Ye;let pe=0;de!==0&&(ae===W?pe=((K-le)/de+(K<le?6:0))/6:ae===K?pe=((le-W)/de+2)/6:pe=((W-K)/de+4)/6);const Ve=ae===0?0:de/ae,be=ae;r.value=pe,c.value=Ve,a.value=be,i.value=Ae,g();return}return}const M=parseInt(A[1],16)/255,T=parseInt(A[2],16)/255,P=parseInt(A[3],16)/255;b&&A[4]?i.value=parseInt(A[4],16)/255:i.value=1;const O=Math.max(M,T,P),qe=Math.min(M,T,P),ne=O-qe;let ue=0;ne!==0&&(O===M?ue=((T-P)/ne+(T<P?6:0))/6:O===T?ue=((P-M)/ne+2)/6:ue=((M-T)/ne+4)/6);const $e=O===0?0:ne/O,ve=O;r.value=ue,c.value=$e,a.value=ve;const Le=f.replace(/^#/,"");s.value=Le.slice(0,6).toUpperCase()}function N(f){i.value=f}function $(){const f=y.value.match(/\d+/g);if(!f)return"ffffff";const k=f.map(b=>parseInt(b).toString(16).padStart(2,"0")).join("").toUpperCase(),v=Math.round(i.value*255).toString(16).padStart(2,"0").toUpperCase();return`#${k}${v}`}function D(){const f=$();u.value.includes(f)||u.value.push(f)}function q(f){V(f)}function p(){s.value="",i.value=0,r.value=0,c.value=0,a.value=.4,o("color-change","transparent")}return(f,k)=>(e.openBlock(),e.createElementBlock("div",dn,[e.createElementVNode("div",pn,[e.createElementVNode("div",fn,[e.createElementVNode("h3",_n,e.toDisplayString(f.title),1)]),f.$slots.tabs?(e.openBlock(),e.createElementBlock("div",mn,[e.renderSlot(f.$slots,"tabs",{},void 0,!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",hn,[e.createElementVNode("div",gn,[e.createElementVNode("div",vn,[e.createElementVNode("div",{class:"color-picker__color-canvas",style:e.normalizeStyle({background:`linear-gradient(to bottom, transparent, black),
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Tt="_button__size_default_aw3lw_1",$t="_button__size_small_aw3lw_8",Lt="_button_aw3lw_1",Rt="_button__label_aw3lw_60",Ot="_button__solid_aw3lw_72",Dt="_fill_aw3lw_1302",fe={button__size_default:Tt,button__size_small:$t,button:Lt,button__label:Rt,"button__solid-primary":"_button__solid-primary_aw3lw_72","no-hover-effect":"_no-hover-effect_aw3lw_79","button--selected":"_button--selected_aw3lw_99","button__solid-subtle-primary":"_button__solid-subtle-primary_aw3lw_105","button__solid-secondary":"_button__solid-secondary_aw3lw_138","button__solid-neutral":"_button__solid-neutral_aw3lw_171","button__solid-danger":"_button__solid-danger_aw3lw_204","button__solid-warning":"_button__solid-warning_aw3lw_237","button__solid-smart":"_button__solid-smart_aw3lw_270","button__solid-toolbar-primary":"_button__solid-toolbar-primary_aw3lw_303","button__solid-toolbar-smart":"_button__solid-toolbar-smart_aw3lw_336","button__ghost-primary":"_button__ghost-primary_aw3lw_369","button__ghost-subtle-primary":"_button__ghost-subtle-primary_aw3lw_402","button__ghost-secondary":"_button__ghost-secondary_aw3lw_435","button__ghost-neutral":"_button__ghost-neutral_aw3lw_468","button__ghost-danger":"_button__ghost-danger_aw3lw_501","button__ghost-warning":"_button__ghost-warning_aw3lw_534","button__ghost-smart":"_button__ghost-smart_aw3lw_567","button__ghost-toolbar-primary":"_button__ghost-toolbar-primary_aw3lw_600","button__ghost-toolbar-smart":"_button__ghost-toolbar-smart_aw3lw_633","button__text-primary":"_button__text-primary_aw3lw_666","button__text-text":"_button__text-text_aw3lw_699","button__text-subtle-primary":"_button__text-subtle-primary_aw3lw_732","button__text-secondary":"_button__text-secondary_aw3lw_765","button__text-neutral":"_button__text-neutral_aw3lw_798","button__text-danger":"_button__text-danger_aw3lw_831","button__text-warning":"_button__text-warning_aw3lw_864","button__text-smart":"_button__text-smart_aw3lw_897","button__outline-primary":"_button__outline-primary_aw3lw_930","button__outline-subtle-primary":"_button__outline-subtle-primary_aw3lw_966","button__outline-secondary":"_button__outline-secondary_aw3lw_1002","button__outline-neutral":"_button__outline-neutral_aw3lw_1038","button__outline-danger":"_button__outline-danger_aw3lw_1074","button__outline-warning":"_button__outline-warning_aw3lw_1110","button__outline-smart":"_button__outline-smart_aw3lw_1146",button__solid:Ot,fill:Dt},Pt=["disabled"],Ie=e.defineComponent({__name:"Button",props:{variant:{},color:{},size:{default:"default"},leftIconName:{},rightIconName:{},iconSize:{default:16},iconColor:{},loadingStatus:{type:Boolean,default:!1},successStatus:{type:Boolean,default:!1},label:{},disabled:{type:Boolean,default:!1},fill:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},customClass:{}},emits:["click"],setup(t,{emit:l}){const n=t,o=l,r=i=>{n.disabled||o("click",i)},c=e.computed(()=>n.loadingStatus?"loading-circle":n.successStatus?"line-check-natural":n.leftIconName),a=e.computed(()=>{const i=[fe.button,fe[`button__${n.variant}`],fe[`button__${n.variant}-${n.color}`],fe[`button__size_${n.size}`]];return n.fill&&i.push(fe.fill),n.selected&&i.push(fe["button--selected"]),n.customClass&&i.push(n.customClass),i});return(i,s)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(a.value),disabled:n.disabled,onClick:r},[c.value?(e.openBlock(),e.createBlock(e.unref(F),{key:0,color:i.iconColor,name:c.value,size:i.iconSize},null,8,["color","name","size"])):e.createCommentVNode("",!0),i.label?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(fe).button__label)},e.toDisplayString(i.label),3)):e.createCommentVNode("",!0),i.rightIconName?(e.openBlock(),e.createBlock(e.unref(F),{key:2,color:i.iconColor,name:i.rightIconName,size:i.iconSize},null,8,["color","name","size"])):e.createCommentVNode("",!0)],10,Pt))}}),Ht="_checkbox__label_wgkvb_1",Ft="_checkbox_wgkvb_1",Wt="_checkbox__input_wgkvb_57",Ut="_checkbox__box_wgkvb_65",qt="_checkbox__disabled_wgkvb_87",Yt="_checkbox__checked_wgkvb_87",we={checkbox__label:Ht,checkbox:Ft,checkbox__input:Wt,checkbox__box:Ut,checkbox__disabled:qt,checkbox__checked:Yt},Kt=["for"],Qt=["id","checked","disabled","name","value"],Gt=e.defineComponent({__name:"Checkbox",props:{id:{},name:{default:""},label:{default:""},checked:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},value:{default:""},modelValue:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:l}){const n=t,o=l,r=e.computed(()=>n.modelValue!==void 0?n.modelValue:n.checked);function c(a){if(n.disabled){a.preventDefault();return}const s=a.target.checked;o("update:modelValue",s),o("change",s)}return(a,i)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass([e.unref(we).checkbox,{[e.unref(we).checkbox__checked]:r.value,[e.unref(we).checkbox__disabled]:a.disabled}]),for:a.id},[e.createElementVNode("input",{id:a.id,type:"checkbox",checked:r.value,class:e.normalizeClass(e.unref(we).checkbox__input),disabled:a.disabled,name:a.name,value:a.value,onChange:c},null,42,Qt),e.createElementVNode("span",{class:e.normalizeClass(e.unref(we).checkbox__box)},[r.value?(e.openBlock(),e.createBlock(e.unref(F),{key:0,name:"line-check-netural",size:16})):e.createCommentVNode("",!0)],2),a.label?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(we).checkbox__label)},e.toDisplayString(a.label),3)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"default")],10,Kt))}}),jt={key:0,class:"in-basic-text-input-wrapper__label"},Xt=["innerHTML"],Zt={class:"in-basic-text-input-wrapper__input-field"},Jt={key:0,class:"in-basic-text-input-wrapper__slot-left"},en=["id","name","value","placeholder","disabled","readonly","autocomplete","maxlength","min","max","type"],tn={key:2,class:"in-basic-text-input-wrapper__suffix-text"},nn={key:4,class:"in-basic-text-input-wrapper__slot-right"},on={key:1,class:"in-basic-text-input-wrapper__helper-container"},ln={key:0,class:"in-basic-text-input-wrapper__helper-message"},an={key:0,class:"in-basic-text-input-wrapper__helper-text"},rn={key:1,class:"in-basic-text-input-wrapper__helper-text"},sn=e.defineComponent({__name:"InBasicTextInput",props:{id:{},name:{},theme:{default:"grey"},modelValue:{default:""},labelStatus:{type:Boolean,default:!0},labelText:{default:""},type:{default:"text"},states:{default:"default"},placeholderText:{},disabledStatus:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},leftIconStatus:{type:Boolean,default:!1},leftIconName:{default:void 0},rightIconStatus:{type:Boolean,default:!1},rightIconName:{default:void 0},suffixTextStatus:{type:Boolean,default:!1},suffixText:{default:""},autoComplete:{default:"off"},maxCharacterLength:{default:""},minValue:{default:0},maxValue:{default:""},autoFocus:{type:Boolean,default:!1},allowDecimal:{type:Boolean,default:!1},allowComma:{type:Boolean,default:!0},preventXss:{type:Boolean,default:!0},helperMessageStatus:{type:Boolean,default:!0},helperMessage:{default:""},stateMessage:{default:""}},emits:["update:modelValue","input","change","focus","blur","keyup","keypress","click","paste","leftIconClick","rightIconClick"],setup(t,{emit:l}){const n=t,o=l,r=e.ref(""),c=e.computed(()=>n.preventXss?String(n.labelText).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):n.labelText),a=e.computed(()=>n.states==="default"),i=e.computed(()=>n.states==="warning"||n.states==="error"),s=e.computed(()=>n.helperMessageStatus||i.value),u=e.computed(()=>n.type==="number"),d=e.computed(()=>{const p=["e","E","+","\\"],f=typeof n.minValue=="number"?n.minValue:Number(n.minValue);return!isNaN(f)&&f>=0&&p.push("-"),n.allowDecimal||p.push("."),n.allowComma||p.push(","),p}),h=p=>d.value.includes(p),w=p=>{var f;if(n.preventXss&&(p!=null&&p.target)){const k=String(p.target.value).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;");p.target.value!==k&&(p.target.value=k)}return r.value=((f=p==null?void 0:p.target)==null?void 0:f.value)||"",p},_=p=>{if(!(p!=null&&p.target))return;const f=p.target,k=f.selectionStart;if(k===null)return;const v=k-1,b=p.target.value,A=y(),M=[...b.matchAll(A)].map(T=>T.index);p.target.value=b.replace(A,""),M.length>0&&v>=0&&f.setSelectionRange(v,v)},B=p=>{if(!(p!=null&&p.target))return;const f=p.target.value,k=p.target,v=k.selectionStart;if(v===null)return;let b=v-1;const A=C(),M=[...f.matchAll(A)].map(P=>P.index),T=f.split("");M.length>1&&b>=0&&(T[b]=""),p.target.value=T.join(""),M.length>1&&b>=0&&k.setSelectionRange(b,b)},C=()=>{let p="";return n.allowDecimal&&(p+="."),n.allowComma&&(p+=","),new RegExp(`[${p}]`,"g")},y=()=>{let p="0-9";return n.allowDecimal&&(p+="\\."),n.allowComma&&(p+=","),new RegExp(`[^${p}]+`,"g")},m=p=>{o("keyup",p)},g=p=>{p.key==="Enter"&&o("keypress",p),u.value&&h(p.key)&&p.preventDefault()},x=p=>{o("focus",p)},E=p=>{o("blur",p)},z=p=>{o("click",p)},R=p=>{var v;const f=p;u.value&&(_(f),B(f)),w(f);const k=((v=f==null?void 0:f.target)==null?void 0:v.value)||"";r.value=k,o("input",k),o("update:modelValue",k)},S=p=>{var v;const f=p;u.value&&(_(f),B(f)),w(f);const k=((v=f==null?void 0:f.target)==null?void 0:v.value)||"";r.value=k,o("change",k),o("update:modelValue",k)},I=p=>{var Le,oe;if(n.maxCharacterLength&&typeof n.maxCharacterLength=="number"){const W=p.target,K=W.selectionStart,le=W.selectionEnd;if(K===null||le===null)return;const Ae=W.value,ae=((Le=p.clipboardData)==null?void 0:Le.getData("text/plain"))||"",Ye=Ae.length,de=le-K,pe=n.maxCharacterLength-Ye+de;if(pe<=0){p.preventDefault();return}const Ve=ae.slice(0,pe);if(Ve!==ae){p.preventDefault();const be=Ae.slice(0,K)+Ve+Ae.slice(le);W.value=be;const it=K+Ve.length;W.setSelectionRange(it,it),r.value=be,o("input",be),o("update:modelValue",be);return}}if(!u.value)return;p.preventDefault();const f=p.target,k=f.selectionStart,v=f.selectionEnd;if(k===null||v===null)return;const b=f.value,A=b.includes(".")||b.includes(","),M=((oe=p.clipboardData)==null?void 0:oe.getData("text/plain"))||"",T=C(),P=y();let O=M.replace(P,"");const qe=[...O.matchAll(T)],ne=[];qe.forEach(W=>{W.index!==void 0&&ne.push(W.index)});const ue=O.split("");A||ne.shift(),ne.forEach(W=>{ue[W]=""}),O=ue.join("");const $e=k+O.length,ve=b.slice(0,k)+O+b.slice(v);f.value=ve,f.setSelectionRange($e,$e),r.value=ve,o("input",ve),o("update:modelValue",ve)},V=p=>{o("leftIconClick",p)},N=p=>{o("rightIconClick",p)},$=()=>{e.nextTick(()=>{var p;(p=D.value)==null||p.focus()})},D=e.ref(null),q=e.ref(null);return e.watch(()=>n.modelValue,p=>{r.value=p},{immediate:!0}),e.watch(()=>n.autoFocus,p=>{p&&$()}),e.onMounted(()=>{n.autoFocus&&$()}),(p,f)=>(e.openBlock(),e.createElementBlock("fieldset",{ref_key:"componentRoot",ref:q,class:e.normalizeClass(["in-basic-text-input-wrapper qa-text-input",[`in-basic-text-input-wrapper__${p.states}`,`in-basic-text-input-wrapper__${p.theme}`,{"in-basic-text-input-wrapper__disable":p.disabledStatus}]])},[p.labelStatus?(e.openBlock(),e.createElementBlock("label",jt,[e.createElementVNode("span",{innerHTML:c.value},null,8,Xt)])):e.createCommentVNode("",!0),e.createElementVNode("div",Zt,[p.$slots.leftSlot?(e.openBlock(),e.createElementBlock("div",Jt,[e.renderSlot(p.$slots,"leftSlot",{},void 0,!0)])):e.createCommentVNode("",!0),p.leftIconStatus?(e.openBlock(),e.createBlock(e.unref(F),{key:1,class:"in-basic-text-input-wrapper__icon-left",name:p.leftIconName,size:24,onClick:V},null,8,["name"])):e.createCommentVNode("",!0),e.createElementVNode("input",{id:p.id,ref_key:"textInput",ref:D,class:"in-basic-text-input-wrapper__input",name:p.name,value:r.value,placeholder:p.placeholderText,disabled:p.disabledStatus,readonly:p.readonly,autocomplete:p.autoComplete,maxlength:typeof p.maxCharacterLength=="number"?p.maxCharacterLength:void 0,min:typeof p.minValue=="number"?p.minValue:void 0,max:typeof p.maxValue=="number"?p.maxValue:void 0,type:p.type,onChange:S,onFocus:x,onBlur:E,onKeyup:m,onKeypress:g,onClick:z,onInput:R,onPaste:I},null,40,en),p.suffixTextStatus&&p.suffixText?(e.openBlock(),e.createElementBlock("span",tn,e.toDisplayString(p.suffixText),1)):e.createCommentVNode("",!0),p.rightIconStatus?(e.openBlock(),e.createBlock(e.unref(F),{key:3,class:"in-basic-text-input-wrapper__icon-right",name:p.rightIconName,size:24,onClick:N},null,8,["name"])):e.createCommentVNode("",!0),p.$slots.rightSlot?(e.openBlock(),e.createElementBlock("div",nn,[e.renderSlot(p.$slots,"rightSlot",{},void 0,!0)])):e.createCommentVNode("",!0)]),s.value?(e.openBlock(),e.createElementBlock("div",on,[p.helperMessageStatus||i.value?(e.openBlock(),e.createElementBlock("div",ln,[a.value?(e.openBlock(),e.createElementBlock("p",an,e.toDisplayString(p.helperMessage),1)):e.createCommentVNode("",!0),i.value&&!p.disabledStatus?(e.openBlock(),e.createElementBlock("p",rn,e.toDisplayString(p.stateMessage),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),ee=(t,l)=>{const n=t.__vccOpts||t;for(const[o,r]of l)n[o]=r;return n},Je=ee(sn,[["__scopeId","data-v-be2df566"]]),cn={key:0,class:"color-swatch__transparent"},un=e.defineComponent({__name:"ColorSwatch",props:{color:{},isTransparent:{type:Boolean}},emits:["click"],setup(t){const l=t,n=e.computed(()=>{if(l.color.startsWith("#")&&l.color.length===9)return!0;if(l.color.startsWith("rgba")){const o=l.color.match(/[\d.]+\)$/);if(o)return parseFloat(o[0])<1}return!1});return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:"color-swatch",onClick:r[0]||(r[0]=c=>o.$emit("click"))},[o.isTransparent||n.value?(e.openBlock(),e.createElementBlock("div",cn,[r[1]||(r[1]=e.createElementVNode("div",{class:"color-swatch__checkerboard"},null,-1)),n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"color-swatch__color-overlay",style:e.normalizeStyle({background:o.color})},null,4)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",{key:1,class:"color-swatch__color",style:e.normalizeStyle({background:o.color})},null,4))]))}}),st=ee(un,[["__scopeId","data-v-6eb90458"]]),dn={class:"color-picker"},pn={class:"color-picker__header-wrapper"},fn={class:"color-picker__header"},_n={class:"color-picker__title"},mn={key:0,class:"color-picker__tabs"},hn={class:"color-picker__content-wrapper"},gn={class:"color-picker__gradient-wrapper"},vn={class:"color-picker__color-area"},bn={class:"color-picker__hue-wrapper"},wn={class:"color-picker__opacity-wrapper"},yn={class:"color-picker__hex-input-wrapper"},kn={key:0,class:"color-picker__preset-row"},Cn={key:1,class:"color-picker__preset-row"},Bn={key:2,class:"color-picker__preset-row"},xn=e.defineComponent({__name:"ColorPicker",props:{color:{default:"#666666"},title:{default:"Text Color"},showSaveButton:{type:Boolean,default:!1},presetColors:{default:()=>["#0A2ECC","#FCEFE5","#258DDE","#D37400","#FBD33C","#D37400","#7630D4","#F7F9FA","transparent","#7630D4","#EFF2F4","#DCDEE6","#5D6980","#E7AB29"]},showOpacityInHex:{type:Boolean,default:!0}},emits:["color-change","close"],setup(t,{emit:l}){const n=t,o=l,r=e.ref(0),c=e.ref(0),a=e.ref(.4),i=e.ref(1),s=e.ref("666666"),u=e.ref([]),d=e.ref(!1),h=e.ref(null),w=e.ref(null),_=e.ref(null),B=e.computed(()=>{const f=n.presetColors||[],k=[],v=8;if(f.length===0)return k;const b=f.slice(0,v-1);k.push(b);for(let A=v-1;A<f.length;A+=v)k.push(f.slice(A,A+v));return k}),C=e.computed(()=>{const f=r.value,k=1-Math.abs(f*6%2-1);let v=0,b=0,A=0;return f<1/6?(v=1,b=k):f<2/6?(v=k,b=1):f<3/6?(b=1,A=k):f<4/6?(b=k,A=1):f<5/6?(v=k,A=1):(v=1,A=k),`rgb(${Math.round(v*255)}, ${Math.round(b*255)}, ${Math.round(A*255)})`}),y=e.computed(()=>{const f=r.value,k=c.value,v=a.value,b=v*k,A=b*(1-Math.abs(f*6%2-1)),M=v-b;let T=0,P=0,O=0;return f<1/6?(T=b,P=A):f<2/6?(T=A,P=b):f<3/6?(P=b,O=A):f<4/6?(P=A,O=b):f<5/6?(T=A,O=b):(T=b,O=A),T=Math.round((T+M)*255),P=Math.round((P+M)*255),O=Math.round((O+M)*255),`rgb(${T}, ${P}, ${O})`}),m=e.computed(()=>{const f=y.value.match(/\d+/g);return f?i.value<1?`rgba(${f[0]}, ${f[1]}, ${f[2]}, ${i.value})`:`rgb(${f[0]}, ${f[1]}, ${f[2]})`:y.value});e.watch([r,c,a,i],()=>{g(),d.value||o("color-change",m.value)}),e.watch(()=>n.color,f=>{f&&(d.value=!0,f.toLowerCase()==="transparent"?p():V(f),setTimeout(()=>{d.value=!1},0))},{immediate:!0});function g(){if(i.value===0){s.value="";return}const f=y.value.match(/\d+/g);if(!f)return;const k=f.map(v=>parseInt(v).toString(16).padStart(2,"0")).join("").toUpperCase();if(n.showOpacityInHex){const v=Math.round(i.value*255).toString(16).padStart(2,"0").toUpperCase();s.value=k+v}else s.value=k}function x(f){const k=A=>{if(!h.value)return;const M=h.value.getBoundingClientRect(),T=Math.max(0,Math.min(1,(A.clientX-M.left)/M.width)),P=Math.max(0,Math.min(1,(A.clientY-M.top)/M.height));c.value=T,a.value=1-P};k(f);const v=A=>{k(A)},b=()=>{document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",b)};document.addEventListener("mousemove",v),document.addEventListener("mouseup",b)}function E(f){const k=A=>{if(!w.value)return;const M=w.value.getBoundingClientRect(),T=Math.max(0,Math.min(1,(A.clientY-M.top)/M.height));r.value=T};k(f);const v=A=>{k(A)},b=()=>{document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",b)};document.addEventListener("mousemove",v),document.addEventListener("mouseup",b)}function z(f){const k=A=>{if(!_.value)return;const M=_.value.getBoundingClientRect(),T=Math.max(0,Math.min(1,(A.clientX-M.left)/M.width));i.value=1-T};k(f);const v=A=>{k(A)},b=()=>{document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",b)};document.addEventListener("mousemove",v),document.addEventListener("mouseup",b)}function R(f){const k=n.showOpacityInHex?8:6,v=String(f).replace(/[^0-9A-Fa-f]/g,"").slice(0,k).toUpperCase();s.value=v,n.showOpacityInHex?(v.length===6||v.length===8)&&V(v):v.length===6&&V(v)}function S(f){var A;const k=((A=f.clipboardData)==null?void 0:A.getData("text"))||"",v=n.showOpacityInHex?8:6,b=k.replace(/^#/,"").replace(/[^0-9A-Fa-f]/g,"").slice(0,v).toUpperCase();n.showOpacityInHex?b.length===6||b.length===8?(s.value=b,V(b),f.preventDefault()):b.length>0&&(s.value=b,f.preventDefault()):b.length===6?(s.value=b,V(b),f.preventDefault()):b.length>0&&(s.value=b,f.preventDefault())}function I(){const f=n.showOpacityInHex?8:6;s.value.length!==f&&g()}function V(f){const k=f.startsWith("#")?f.slice(1):f,v=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(k),b=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(k),A=b||v;if(!A){const oe=/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/.exec(f);if(oe){const W=parseInt(oe[1],10)/255,K=parseInt(oe[2],10)/255,le=parseInt(oe[3],10)/255,Ae=oe[4]?parseFloat(oe[4]):1,ae=Math.max(W,K,le),Ye=Math.min(W,K,le),de=ae-Ye;let pe=0;de!==0&&(ae===W?pe=((K-le)/de+(K<le?6:0))/6:ae===K?pe=((le-W)/de+2)/6:pe=((W-K)/de+4)/6);const Ve=ae===0?0:de/ae,be=ae;r.value=pe,c.value=Ve,a.value=be,i.value=Ae,g();return}return}const M=parseInt(A[1],16)/255,T=parseInt(A[2],16)/255,P=parseInt(A[3],16)/255;b&&A[4]?i.value=parseInt(A[4],16)/255:i.value=1;const O=Math.max(M,T,P),qe=Math.min(M,T,P),ne=O-qe;let ue=0;ne!==0&&(O===M?ue=((T-P)/ne+(T<P?6:0))/6:O===T?ue=((P-M)/ne+2)/6:ue=((M-T)/ne+4)/6);const $e=O===0?0:ne/O,ve=O;r.value=ue,c.value=$e,a.value=ve;const Le=f.replace(/^#/,"");s.value=Le.slice(0,6).toUpperCase()}function N(f){i.value=f}function $(){const f=y.value.match(/\d+/g);if(!f)return"ffffff";const k=f.map(b=>parseInt(b).toString(16).padStart(2,"0")).join("").toUpperCase(),v=Math.round(i.value*255).toString(16).padStart(2,"0").toUpperCase();return`#${k}${v}`}function D(){const f=$();u.value.includes(f)||u.value.push(f)}function q(f){V(f)}function p(){s.value="",i.value=0,r.value=0,c.value=0,a.value=.4,o("color-change","transparent")}return(f,k)=>(e.openBlock(),e.createElementBlock("div",dn,[e.createElementVNode("div",pn,[e.createElementVNode("div",fn,[e.createElementVNode("h3",_n,e.toDisplayString(f.title),1)]),f.$slots.tabs?(e.openBlock(),e.createElementBlock("div",mn,[e.renderSlot(f.$slots,"tabs",{},void 0,!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",hn,[e.createElementVNode("div",gn,[e.createElementVNode("div",vn,[e.createElementVNode("div",{class:"color-picker__color-canvas",style:e.normalizeStyle({background:`linear-gradient(to bottom, transparent, black),
2
2
  linear-gradient(to right, white, ${C.value})`}),onMousedown:x,ref_key:"colorPickerRef",ref:h},[e.createElementVNode("div",{class:"color-picker__color-indicator",style:e.normalizeStyle({left:`${c.value*100}%`,top:`${(1-a.value)*100}%`})},null,4)],36)]),e.createElementVNode("div",bn,[e.createElementVNode("div",{class:"color-picker__hue-slider",onMousedown:E,ref_key:"hueSliderRef",ref:w},[e.createElementVNode("div",{class:"color-picker__hue-indicator",style:e.normalizeStyle({top:`${r.value*100}%`})},null,4)],544)])]),e.createElementVNode("div",wn,[e.createElementVNode("div",{class:"color-picker__opacity-slider",onMousedown:z,ref_key:"opacitySliderRef",ref:_},[k[1]||(k[1]=e.createElementVNode("div",{class:"color-picker__opacity-checkerboard"},null,-1)),e.createElementVNode("div",{class:"color-picker__opacity-gradient",style:e.normalizeStyle({background:`linear-gradient(to right, ${y.value}, transparent)`})},null,4),e.createElementVNode("div",{class:"color-picker__opacity-handle",style:e.normalizeStyle({left:`${(1-i.value)*100}%`})},null,4)],544)]),e.createElementVNode("div",yn,[e.createVNode(Je,{id:"color-picker-hex-input",modelValue:s.value,"onUpdate:modelValue":k[0]||(k[0]=v=>s.value=v),name:"hex-input","placeholder-text":"","label-status":!1,"helper-message-status":!1,type:"text",onInput:R,onPaste:S,onBlur:I},null,8,["modelValue"])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,(v,b)=>(e.openBlock(),e.createElementBlock("div",{key:`preset-row-${b}`,class:"color-picker__preset-row"},[b===0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"color-picker__no-color",onClick:p},[e.createVNode(e.unref(F),{name:"no-color",size:14})])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v,(A,M)=>(e.openBlock(),e.createBlock(st,{key:`preset-${b}-${M}`,color:A,"is-transparent":A==="transparent",onClick:T=>A==="transparent"?N(0):V(A)},null,8,["color","is-transparent","onClick"]))),128))]))),128)),B.value.length===0?(e.openBlock(),e.createElementBlock("div",kn,[e.createElementVNode("div",{class:"color-picker__no-color",onClick:p},[e.createVNode(e.unref(F),{name:"no-color",size:14})])])):e.createCommentVNode("",!0),f.showSaveButton&&u.value.length>0?(e.openBlock(),e.createElementBlock("div",Cn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(v,b)=>(e.openBlock(),e.createBlock(st,{key:`saved-${b}`,color:v,onClick:A=>q(v)},null,8,["color","onClick"]))),128)),e.createElementVNode("button",{onClick:D,class:"color-picker__save-button",title:"Save current color"})])):f.showSaveButton?(e.openBlock(),e.createElementBlock("div",Bn,[e.createElementVNode("button",{onClick:D,class:"color-picker__save-button",title:"Save current color"})])):e.createCommentVNode("",!0)])]))}}),An=ee(xn,[["__scopeId","data-v-29814b04"]]),et={mounted(t,l){t.clickOutsideEvent=o=>{const r=(l.value.exclude||[]).filter(a=>a.value).map(a=>a.value);[t,...r].some(a=>a&&(a===o.target||a.contains(o.target)))||l.value.handler()};const n=l.value.capture??!1;t.clickOutsideCapture=n,document.addEventListener("click",t.clickOutsideEvent,n)},unmounted(t){if(t.clickOutsideEvent){const l=t.clickOutsideCapture??!1;document.removeEventListener("click",t.clickOutsideEvent,l)}}},Vn=(t,l)=>{var o;let n=0;for(const r of t)if(r.toLowerCase()===((o=l[n])==null?void 0:o.toLowerCase())&&n++,n===l.length)return!0;return!1},bt=(t,l,n)=>{if(!n.trim())return t;const o=n.toLowerCase();return t.filter(r=>{const c=String(r[l]);return Vn(c.toLowerCase(),o)}).sort((r,c)=>{const a=String(r[l]).toLowerCase(),i=String(c[l]).toLowerCase();return a===o?-1:i===o?1:a.startsWith(o)&&!i.startsWith(o)?-1:!a.startsWith(o)&&i.startsWith(o)?1:a.length-i.length})},En="_menu_1sfnf_1",Sn="_dropdown_1sfnf_1",In="_dropdown__valueContent_1sfnf_50",zn="_dropdown__label_1sfnf_61",Nn="_dropdown__value_1sfnf_50",Mn="_dropdown__placeholder_1sfnf_69",Tn="_dropdown__arrowIcon_1sfnf_77",$n="_menu__searchContainer_1sfnf_92",Ln="_menu__searchInputWrap_1sfnf_96",Rn="_menu__searchInput_1sfnf_96",On="_menu__errorMessage_1sfnf_115",Dn="_menu__addButton_1sfnf_122",Pn="_menu__itemContainer_1sfnf_130",Hn="_menu__item_1sfnf_130",H={menu:En,dropdown:Sn,dropdown__valueContent:In,"dropdown__valueContent--open":"_dropdown__valueContent--open_1sfnf_58",dropdown__label:zn,dropdown__value:Nn,dropdown__placeholder:Mn,dropdown__arrowIcon:Tn,menu__searchContainer:$n,menu__searchInputWrap:Ln,menu__searchInput:Rn,"menu__searchInput--error":"_menu__searchInput--error_1sfnf_112",menu__errorMessage:On,menu__addButton:Dn,menu__itemContainer:Pn,menu__item:Hn,"menu__item--active":"_menu__item--active_1sfnf_169"},Fn=["for"],Wn=["placeholder"],Un=["onClick"],qn=e.defineComponent({__name:"DropdownMenu",props:{id:{},label:{},modelValue:{default:""},menuHeight:{default:154},placeholder:{},addable:{type:Boolean},addButtonText:{},searchable:{type:Boolean},searchPlaceHolder:{},items:{},validateAddItem:{type:Function,default:()=>null}},emits:["update:modelValue","add-error","item-added","select-item"],setup(t,{emit:l}){const n=et,o=t,r=l,c=e.ref(),a=e.ref(),i=e.ref(!1),s=e.ref(null),u=e.ref(""),d=e.ref(null),h=e.ref({x:0,y:0,width:0,shouldOpenUp:!1,height:o.menuHeight}),w=e.reactive([...o.items]),_=e.reactive([...o.items]),B=()=>{if(!c.value)return;const{offsetTop:V,offsetLeft:N,offsetWidth:$}=c.value,D=window.innerHeight,q=V+c.value.offsetHeight,p=q+o.menuHeight>D;h.value={x:N+window.scrollX,y:p?V+window.scrollY:q+window.scrollY,width:$,shouldOpenUp:p,height:o.menuHeight}},C=()=>{B(),i.value=!i.value},y=()=>{d.value=null,u.value="",w.splice(0,w.length,..._)},m=()=>{i.value=!1,y()},g=V=>{s.value=V,r("select-item",V),r("update:modelValue",V.value),m()},x=()=>{const V=u.value.trim(),N=o.validateAddItem(V,_);if(N){d.value=N,r("add-error",N);return}const $={text:V,value:V};_.push($),y(),r("item-added",$)},E=()=>{const V=bt(_,"text",u.value);w.splice(0,w.length,...V)},z=()=>{d.value=""},R=e.computed(()=>({top:h.value.shouldOpenUp?`${h.value.y-10}px`:`${h.value.y}px`,left:`${h.value.x}px`,width:`${h.value.width}px`,height:`${o.menuHeight}px`}));e.onMounted(()=>{if(B(),o.modelValue){const V=_.find(N=>N.value===o.modelValue);V&&(s.value=V)}});const S=e.computed(()=>s.value?s.value.text:"");e.watch(()=>o.modelValue,V=>{var N;if(((N=s.value)==null?void 0:N.value)!==V){const $=_.find(D=>D.value===V);$&&(s.value=$)}}),e.watch(()=>o.items,V=>{_.splice(0,_.length,...V),w.splice(0,w.length,...V)},{deep:!0});const I=e.ref({handler:m,exclude:[c,a]});return(V,N)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{ref_key:"dropdownRef",ref:c,class:e.normalizeClass(e.unref(H).dropdown)},[V.label?(e.openBlock(),e.createElementBlock("label",{key:0,class:e.normalizeClass(e.unref(H).dropdown__label),for:V.id},e.toDisplayString(V.label),11,Fn)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass([e.unref(H).dropdown__valueContent,{[e.unref(H)["dropdown__valueContent--open"]]:i.value}]),onClick:C},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(H).dropdown__value)},e.toDisplayString(S.value),3),V.placeholder&&!S.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(H).dropdown__placeholder)},e.toDisplayString(V.placeholder),3)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{fill:"none",height:"17",viewBox:"0 0 16 17",width:"16",xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass(e.unref(H).dropdown__arrowIcon)},N[2]||(N[2]=[e.createElementVNode("path",{d:"M8 11.2021L4.5359 6.70215L11.4641 6.70215L8 11.2021Z",fill:"#91949F"},null,-1)]),2))],2)],2),e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"menuRef",ref:a,class:e.normalizeClass(e.unref(H).menu),style:e.normalizeStyle(R.value),onClick:N[1]||(N[1]=e.withModifiers(()=>{},["prevent"]))},[o.searchable?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(H).menu__searchContainer)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(H).menu__searchInputWrap)},[e.withDirectives(e.createElementVNode("input",{type:"text",class:e.normalizeClass([e.unref(H).menu__searchInput,{[e.unref(H)["menu__searchInput--error"]]:d.value}]),placeholder:V.searchPlaceHolder,"onUpdate:modelValue":N[0]||(N[0]=$=>u.value=$),onFocus:z,onInput:E},null,42,Wn),[[e.vModelText,u.value]]),d.value?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass(e.unref(H).menu__errorMessage)},e.toDisplayString(d.value),3)):e.createCommentVNode("",!0)],2),o.addable?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(e.unref(H).menu__addButton),onClick:x},e.toDisplayString(V.addButtonText),3)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),e.createElementVNode("ul",{class:e.normalizeClass(e.unref(H).menu__itemContainer)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w,($,D)=>(e.openBlock(),e.createElementBlock("li",{key:`${$.value}-${D}`,class:e.normalizeClass([e.unref(H).menu__item,{[e.unref(H)["menu__item--active"]]:s.value&&$.value===s.value.value}]),onClick:q=>g($)},e.toDisplayString($.text),11,Un))),128))],2)],6)),[[e.vShow,i.value],[e.unref(n),I.value]])],64))}}),ct={"mixed-text-color-icon":{viewBox:"0 0 24 24",content:`
3
3
  <path d="M20 18H4C2.9 18 2 18.9 2 20C2 21.1 2.9 22 4 22H20C21.1 22 22 21.1 22 20C22 18.9 21.1 18 20 18Z" fill="url(#pattern0_5043_65214)"/>
4
4
  <path class="preserve-fill" d="M11.9997 2C12.3784 2 12.7248 2.21401 12.8942 2.55273L18.8942 14.5527C19.1412 15.0467 18.9409 15.6475 18.447 15.8945C17.953 16.1414 17.3521 15.9412 17.1052 15.4473L15.3815 12H8.61785L6.89422 15.4473C6.6472 15.9412 6.04637 16.1415 5.55242 15.8945C5.05863 15.6475 4.85828 15.0466 5.10516 14.5527L11.1052 2.55273L11.1764 2.43164C11.3613 2.16374 11.6683 2.00009 11.9997 2ZM9.61785 10H14.3815L11.9997 5.23633L9.61785 10Z" fill="#495366"/>