import e,{useState as t,useEffect as n}from"react";import{clsx as l}from"clsx";var a="Button-module_button__18Bed",o="Button-module_disabled__UzdWL",r="Button-module_buttonText__reUdv";const c=t=>{let{children:n,text:c,disabled:s,wrapperClass:i,buttonClass:u,...m}=t;return e.createElement("div",{className:l(i&&i,s&&o)},e.createElement("button",Object.assign({className:l(a,u&&u),disabled:s},m),n,c&&e.createElement("span",{className:r},c)))};var s="Heading-module_headingWrapper__oEBIY";const i=t=>{let{title:n,subtitle:l}=t;return e.createElement("div",{className:s},e.createElement("h1",null,n),l&&e.createElement("h3",null,l))};var u="Input-module_input__505b7";const m=t=>{let{type:n="text",active:l,disabled:a,...o}=t;return e.createElement("input",Object.assign({type:"text",className:u},o))};var d="NextButton-module_nextButtonWrapper__Moxf-",p="NextButton-module_nextButton__XdxOI";const _=t=>{let{text:n="Next",...l}=t;return e.createElement(c,Object.assign({text:n,wrapperClass:d,buttonClass:p},l))};var g="SingleChoiceButton-module_singleChoicesWrapper__wze-g",b="SingleChoiceButton-module_wrapper__cZ1yL",h="SingleChoiceButton-module_singleChoiceButton__epCT2",y="SingleChoiceButton-module_singleChoiceText__o7VWi",E="SingleChoiceButton-module_singleChoiceSelected__yDqaN";const v=t=>{let{options:n,selectedKey:l,onSelect:a,align:o="center"}=t;return e.createElement(k,null,n.map((t=>e.createElement(x,{key:t.key,align:o,selected:t.key===l,text:t.value,onClick:()=>a(t)}))))},k=t=>{let{children:n}=t;return e.createElement("div",{className:g}," ",n," ")},x=t=>{let{children:n,text:a,item:o,pageValue:r,setPageValue:s,selected:i,align:u,...m}=t;return e.createElement(e.Fragment,null,e.createElement(c,Object.assign({wrapperClass:b,buttonClass:l(h,i&&E)},m),e.createElement("span",{className:y},a),o&&o.image&&e.createElement("img",{src:o.image,alt:o.key})))};var C="Checkbox-module_checkboxWrapper__A680D",N="Checkbox-module_checkmark__pjJT2";const S=t=>{let{checked:n}=t;return e.createElement("label",{className:C},e.createElement("input",{type:"checkbox",checked:n,onClick:e=>{e.preventDefault(),e.stopPropagation()},readOnly:!0}),e.createElement("span",{className:N}))},w=e=>"boolean"==typeof e,B=e=>"string"==typeof e,f=e=>"number"==typeof e&&Number.isFinite(e),O=e=>!!e.trim(),U=()=>([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)));const V="onStoreUpdated",W=(e,t)=>{const n=localStorage.getItem(e);return n?function(e){try{JSON.parse(e)}catch(e){return!1}return!0}(n)?JSON.parse(n):n:t},j=e=>{let{key:l,defaultValue:a}=e;const[o,r]=t(W(l,a));return n((()=>(window.addEventListener(V,(e=>{l===e.detail.keyEvent&&r(e.detail.value)})),()=>{window.removeEventListener(V,(e=>{l===e.detail.keyEvent&&r(e.detail.value)}))})),[l]),n((()=>{"object"==typeof o?localStorage.setItem(l,JSON.stringify(o)||""):localStorage.setItem(l,"boolean"==typeof o?o:o||""),window.dispatchEvent(new CustomEvent(V,{detail:{value:o,keyEvent:l}}))}),[o,l]),{pageValue:o,setPageValue:r}};class I{constructor(e){let{webHookUrl:t}=e;this.webHookUrl=t}sendMessageToWebhook(e){return fetch(this.webHookUrl,{method:"POST",body:JSON.stringify(e)})}}export{c as Button,S as Checkbox,i as Heading,m as Input,_ as NextButton,v as SingleChoice,x as SingleChoiceButton,k as SingleChoicesButtonWrapper,I as SlackWorkflowAPI,w as isBoolean,O as isEmpty,f as isNumber,B as isString,j as useLocalStorage,U as uuidv4};
//# sourceMappingURL=ui-core-kit.esm.js.map
