@arkyn/components 1.3.66 → 1.3.67
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/bundle.js +750 -691
- package/dist/bundle.umd.cjs +10 -10
- package/dist/components/Radio/RadioBox/index.d.ts +5 -0
- package/dist/components/Radio/RadioBox/index.d.ts.map +1 -0
- package/dist/components/Radio/RadioBox/index.js +16 -0
- package/dist/components/Radio/RadioGroup.d.ts +5 -0
- package/dist/components/Radio/RadioGroup.d.ts.map +1 -0
- package/dist/components/Radio/RadioGroup.js +18 -0
- package/dist/components/Radio/index.d.ts +4 -0
- package/dist/components/Radio/index.d.ts.map +1 -0
- package/dist/components/Radio/index.js +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/services/normalizeValue.js +3 -3
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/Radio/RadioBox/index.tsx +40 -0
- package/src/components/Radio/RadioBox/styles.css +95 -0
- package/src/components/Radio/RadioGroup.tsx +48 -0
- package/src/components/Radio/index.ts +4 -0
- package/src/index.ts +1 -0
- package/src/services/normalizeValue.ts +3 -3
- package/dist/components/Input/CurrencyInput/utils.d.ts +0 -11
- package/dist/components/Input/CurrencyInput/utils.d.ts.map +0 -1
- package/dist/components/Input/CurrencyInput/utils.js +0 -39
- package/src/components/Input/CurrencyInput/utils.ts +0 -56
package/dist/bundle.umd.cjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
(function(
|
1
|
+
(function(x,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react"),require("lucide-react"),require("@remix-run/react"),require("@react-input/mask"),require("framer-motion"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","lucide-react","@remix-run/react","@react-input/mask","framer-motion","react-dom"],l):(x=typeof globalThis<"u"?globalThis:x||self,l(x["@arkyn/components"]={},x.e,x.lucideReact,x.react,x.mask,x.framerMotion,x.Gt))})(this,function(x,l,Q,Re,It,_e,Ot){"use strict";var Je={exports:{}},Oe={};/**
|
2
2
|
* @license React
|
3
3
|
* react-jsx-runtime.production.min.js
|
4
4
|
*
|
@@ -6,7 +6,7 @@
|
|
6
6
|
*
|
7
7
|
* This source code is licensed under the MIT license found in the
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
9
|
-
*/var ct;function
|
9
|
+
*/var ct;function zt(){if(ct)return Oe;ct=1;var e=l,n=Symbol.for("react.element"),r=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function f(u,d,p){var m,b={},s=null,v=null;p!==void 0&&(s=""+p),d.key!==void 0&&(s=""+d.key),d.ref!==void 0&&(v=d.ref);for(m in d)o.call(d,m)&&!c.hasOwnProperty(m)&&(b[m]=d[m]);if(u&&u.defaultProps)for(m in d=u.defaultProps,d)b[m]===void 0&&(b[m]=d[m]);return{$$typeof:n,type:u,key:s,ref:v,props:b,_owner:i.current}}return Oe.Fragment=r,Oe.jsx=f,Oe.jsxs=f,Oe}var ze={};/**
|
10
10
|
* @license React
|
11
11
|
* react-jsx-runtime.development.js
|
12
12
|
*
|
@@ -14,20 +14,20 @@
|
|
14
14
|
*
|
15
15
|
* This source code is licensed under the MIT license found in the
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
17
|
-
*/var ut;function
|
18
|
-
`+xe+t}}var Z=!1,oe;{var Ce=typeof WeakMap=="function"?WeakMap:Map;oe=new Ce}function $e(t,
|
17
|
+
*/var ut;function Ft(){return ut||(ut=1,process.env.NODE_ENV!=="production"&&function(){var e=l,n=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),s=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),S=Symbol.iterator,w="@@iterator";function j(t){if(t===null||typeof t!="object")return null;var h=S&&t[S]||t[w];return typeof h=="function"?h:null}var y=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function k(t){{for(var h=arguments.length,g=new Array(h>1?h-1:0),C=1;C<h;C++)g[C-1]=arguments[C];L("error",t,g)}}function L(t,h,g){{var C=y.ReactDebugCurrentFrame,D=C.getStackAddendum();D!==""&&(h+="%s",g=g.concat([D]));var H=g.map(function(O){return String(O)});H.unshift("Warning: "+h),Function.prototype.apply.call(console[t],console,H)}}var F=!1,T=!1,Y=!1,B=!1,G=!1,U;U=Symbol.for("react.module.reference");function K(t){return!!(typeof t=="string"||typeof t=="function"||t===o||t===c||G||t===i||t===p||t===m||B||t===v||F||T||Y||typeof t=="object"&&t!==null&&(t.$$typeof===s||t.$$typeof===b||t.$$typeof===f||t.$$typeof===u||t.$$typeof===d||t.$$typeof===U||t.getModuleId!==void 0))}function z(t,h,g){var C=t.displayName;if(C)return C;var D=h.displayName||h.name||"";return D!==""?g+"("+D+")":g}function te(t){return t.displayName||"Context"}function _(t){if(t==null)return null;if(typeof t.tag=="number"&&k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case o:return"Fragment";case r:return"Portal";case c:return"Profiler";case i:return"StrictMode";case p:return"Suspense";case m:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case u:var h=t;return te(h)+".Consumer";case f:var g=t;return te(g._context)+".Provider";case d:return z(t,t.render,"ForwardRef");case b:var C=t.displayName||null;return C!==null?C:_(t.type)||"Memo";case s:{var D=t,H=D._payload,O=D._init;try{return _(O(H))}catch{return null}}}return null}var X=Object.assign,M=0,q,ne,$,re,ue,R,E;function P(){}P.__reactDisabledLog=!0;function J(){{if(M===0){q=console.log,ne=console.info,$=console.warn,re=console.error,ue=console.group,R=console.groupCollapsed,E=console.groupEnd;var t={configurable:!0,enumerable:!0,value:P,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}M++}}function se(){{if(M--,M===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:X({},t,{value:q}),info:X({},t,{value:ne}),warn:X({},t,{value:$}),error:X({},t,{value:re}),group:X({},t,{value:ue}),groupCollapsed:X({},t,{value:R}),groupEnd:X({},t,{value:E})})}M<0&&k("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var A=y.ReactCurrentDispatcher,xe;function me(t,h,g){{if(xe===void 0)try{throw Error()}catch(D){var C=D.stack.trim().match(/\n( *(at )?)/);xe=C&&C[1]||""}return`
|
18
|
+
`+xe+t}}var Z=!1,oe;{var Ce=typeof WeakMap=="function"?WeakMap:Map;oe=new Ce}function $e(t,h){if(!t||Z)return"";{var g=oe.get(t);if(g!==void 0)return g}var C;Z=!0;var D=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var H;H=A.current,A.current=null,J();try{if(h){var O=function(){throw Error()};if(Object.defineProperty(O.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(O,[])}catch(fe){C=fe}Reflect.construct(t,[],O)}else{try{O.call()}catch(fe){C=fe}t.call(O.prototype)}}else{try{throw Error()}catch(fe){C=fe}t()}}catch(fe){if(fe&&C&&typeof fe.stack=="string"){for(var I=fe.stack.split(`
|
19
19
|
`),ce=C.stack.split(`
|
20
20
|
`),ee=I.length-1,ae=ce.length-1;ee>=1&&ae>=0&&I[ee]!==ce[ae];)ae--;for(;ee>=1&&ae>=0;ee--,ae--)if(I[ee]!==ce[ae]){if(ee!==1||ae!==1)do if(ee--,ae--,ae<0||I[ee]!==ce[ae]){var ve=`
|
21
|
-
`+I[ee].replace(" at new "," at ");return t.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",t.displayName)),typeof t=="function"&&oe.set(t,ve),ve}while(ee>=1&&ae>=0);break}}}finally{Z=!1,A.current=H,se(),Error.prepareStackTrace=
|
21
|
+
`+I[ee].replace(" at new "," at ");return t.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",t.displayName)),typeof t=="function"&&oe.set(t,ve),ve}while(ee>=1&&ae>=0);break}}}finally{Z=!1,A.current=H,se(),Error.prepareStackTrace=D}var Ie=t?t.displayName||t.name:"",Ee=Ie?me(Ie):"";return typeof t=="function"&&oe.set(t,Ee),Ee}function rt(t,h,g){return $e(t,!1)}function Ye(t){var h=t.prototype;return!!(h&&h.isReactComponent)}function Se(t,h,g){if(t==null)return"";if(typeof t=="function")return $e(t,Ye(t));if(typeof t=="string")return me(t);switch(t){case p:return me("Suspense");case m:return me("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case d:return rt(t.render);case b:return Se(t.type,h,g);case s:{var C=t,D=C._payload,H=C._init;try{return Se(H(D),h,g)}catch{}}}return""}var pe=Object.prototype.hasOwnProperty,He={},Ue=y.ReactDebugCurrentFrame;function ie(t){if(t){var h=t._owner,g=Se(t.type,t._source,h?h.type:null);Ue.setExtraStackFrame(g)}else Ue.setExtraStackFrame(null)}function Ne(t,h,g,C,D){{var H=Function.call.bind(pe);for(var O in t)if(H(t,O)){var I=void 0;try{if(typeof t[O]!="function"){var ce=Error((C||"React class")+": "+g+" type `"+O+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[O]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ce.name="Invariant Violation",ce}I=t[O](h,O,C,g,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ee){I=ee}I&&!(I instanceof Error)&&(ie(D),k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",C||"React class",g,O,typeof I),ie(null)),I instanceof Error&&!(I.message in He)&&(He[I.message]=!0,ie(D),k("Failed %s type: %s",g,I.message),ie(null))}}}var at=Array.isArray;function Fe(t){return at(t)}function Pe(t){{var h=typeof Symbol=="function"&&Symbol.toStringTag,g=h&&t[Symbol.toStringTag]||t.constructor.name||"Object";return g}}function st(t){try{return De(t),!1}catch{return!0}}function De(t){return""+t}function Te(t){if(st(t))return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Pe(t)),De(t)}var ge=y.ReactCurrentOwner,Ke={key:!0,ref:!0,__self:!0,__source:!0},we,Le,Be;Be={};function Xe(t){if(pe.call(t,"ref")){var h=Object.getOwnPropertyDescriptor(t,"ref").get;if(h&&h.isReactWarning)return!1}return t.ref!==void 0}function qe(t){if(pe.call(t,"key")){var h=Object.getOwnPropertyDescriptor(t,"key").get;if(h&&h.isReactWarning)return!1}return t.key!==void 0}function ot(t,h){if(typeof t.ref=="string"&&ge.current&&h&&ge.current.stateNode!==h){var g=_(ge.current.type);Be[g]||(k('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',_(ge.current.type),t.ref),Be[g]=!0)}}function Me(t,h){{var g=function(){we||(we=!0,k("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",h))};g.isReactWarning=!0,Object.defineProperty(t,"key",{get:g,configurable:!0})}}function ye(t,h){{var g=function(){Le||(Le=!0,k("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",h))};g.isReactWarning=!0,Object.defineProperty(t,"ref",{get:g,configurable:!0})}}var it=function(t,h,g,C,D,H,O){var I={$$typeof:n,type:t,key:h,ref:g,props:O,_owner:H};return I._store={},Object.defineProperty(I._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(I,"_self",{configurable:!1,enumerable:!1,writable:!1,value:C}),Object.defineProperty(I,"_source",{configurable:!1,enumerable:!1,writable:!1,value:D}),Object.freeze&&(Object.freeze(I.props),Object.freeze(I)),I};function N(t,h,g,C,D){{var H,O={},I=null,ce=null;g!==void 0&&(Te(g),I=""+g),qe(h)&&(Te(h.key),I=""+h.key),Xe(h)&&(ce=h.ref,ot(h,D));for(H in h)pe.call(h,H)&&!Ke.hasOwnProperty(H)&&(O[H]=h[H]);if(t&&t.defaultProps){var ee=t.defaultProps;for(H in ee)O[H]===void 0&&(O[H]=ee[H])}if(I||ce){var ae=typeof t=="function"?t.displayName||t.name||"Unknown":t;I&&Me(O,ae),ce&&ye(O,ae)}return it(t,I,ce,D,C,ge.current,O)}}var V=y.ReactCurrentOwner,W=y.ReactDebugCurrentFrame;function le(t){if(t){var h=t._owner,g=Se(t.type,t._source,h?h.type:null);W.setExtraStackFrame(g)}else W.setExtraStackFrame(null)}var de;de=!1;function je(t){return typeof t=="object"&&t!==null&&t.$$typeof===n}function Ge(){{if(V.current){var t=_(V.current.type);if(t)return`
|
22
22
|
|
23
|
-
Check the render method of \``+t+"`."}return""}}function
|
23
|
+
Check the render method of \``+t+"`."}return""}}function lr(t){{if(t!==void 0){var h=t.fileName.replace(/^.*[\\\/]/,""),g=t.lineNumber;return`
|
24
24
|
|
25
|
-
Check your code at `+
|
25
|
+
Check your code at `+h+":"+g+"."}return""}}var Et={};function cr(t){{var h=Ge();if(!h){var g=typeof t=="string"?t:t.displayName||t.name;g&&(h=`
|
26
26
|
|
27
|
-
Check the top-level render call using <`+g+">.")}return
|
27
|
+
Check the top-level render call using <`+g+">.")}return h}}function Rt(t,h){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var g=cr(h);if(Et[g])return;Et[g]=!0;var C="";t&&t._owner&&t._owner!==V.current&&(C=" It was passed a child from "+_(t._owner.type)+"."),le(t),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',g,C),le(null)}}function $t(t,h){{if(typeof t!="object")return;if(Fe(t))for(var g=0;g<t.length;g++){var C=t[g];je(C)&&Rt(C,h)}else if(je(t))t._store&&(t._store.validated=!0);else if(t){var D=j(t);if(typeof D=="function"&&D!==t.entries)for(var H=D.call(t),O;!(O=H.next()).done;)je(O.value)&&Rt(O.value,h)}}}function ur(t){{var h=t.type;if(h==null||typeof h=="string")return;var g;if(typeof h=="function")g=h.propTypes;else if(typeof h=="object"&&(h.$$typeof===d||h.$$typeof===b))g=h.propTypes;else return;if(g){var C=_(h);Ne(g,t.props,"prop",C,t)}else if(h.PropTypes!==void 0&&!de){de=!0;var D=_(h);k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",D||"Unknown")}typeof h.getDefaultProps=="function"&&!h.getDefaultProps.isReactClassApproved&&k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function dr(t){{for(var h=Object.keys(t.props),g=0;g<h.length;g++){var C=h[g];if(C!=="children"&&C!=="key"){le(t),k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",C),le(null);break}}t.ref!==null&&(le(t),k("Invalid attribute `ref` supplied to `React.Fragment`."),le(null))}}var Pt={};function Tt(t,h,g,C,D,H){{var O=K(t);if(!O){var I="";(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(I+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ce=lr(D);ce?I+=ce:I+=Ge();var ee;t===null?ee="null":Fe(t)?ee="array":t!==void 0&&t.$$typeof===n?(ee="<"+(_(t.type)||"Unknown")+" />",I=" Did you accidentally export a JSX literal instead of a component?"):ee=typeof t,k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ee,I)}var ae=N(t,h,g,D,H);if(ae==null)return ae;if(O){var ve=h.children;if(ve!==void 0)if(C)if(Fe(ve)){for(var Ie=0;Ie<ve.length;Ie++)$t(ve[Ie],t);Object.freeze&&Object.freeze(ve)}else k("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else $t(ve,t)}if(pe.call(h,"key")){var Ee=_(t),fe=Object.keys(h).filter(function(vr){return vr!=="key"}),lt=fe.length>0?"{key: someKey, "+fe.join(": ..., ")+": ...}":"{key: someKey}";if(!Pt[Ee+lt]){var gr=fe.length>0?"{"+fe.join(": ..., ")+": ...}":"{}";k(`A props object containing a "key" prop is being spread into JSX:
|
28
28
|
let props = %s;
|
29
29
|
<%s {...props} />
|
30
30
|
React keys must be passed directly to JSX without using spread:
|
31
31
|
let props = %s;
|
32
|
-
<%s key={someKey} {...props} />`,lt,Ee,fr,Ee),$t[Ee+lt]=!0}}return t===o?ir(ae):or(ae),ae}}function lr(t,d,g){return Pt(t,d,g,!0)}function cr(t,d,g){return Pt(t,d,g,!1)}var ur=cr,dr=lr;ze.Fragment=o,ze.jsx=ur,ze.jsxs=dr}()),ze}process.env.NODE_ENV==="production"?Ge.exports=Ot():Ge.exports=zt();var s=Ge.exports;function Ae(e,n){return n?s.jsx(n,{size:e,strokeWidth:2.5}):s.jsx(s.Fragment,{})}function dt(e,n){return[...new Array(n-e)].map((r,o)=>e+o+1).filter(r=>r>0)}function Ft(e,n,r){return e>=r?[]:dt(e+1,e+n)}function Lt(e,n){return e<=1?[]:dt(e-1-n,e-1)}function Dt(e,n,r){if(!e)return s.jsx(s.Fragment,{});if(typeof e=="string")return s.jsx("p",{className:r,children:e});const o=e;return s.jsx("p",{className:r,children:s.jsx(o,{color:"var(--secondary-600)",size:n,strokeWidth:2.5})})}function Bt(e){const{variant:n="ghost",scheme:r="primary",size:o="md",leftIcon:i,rightIcon:c,className:h="",children:u,...f}=e,m={md:12,lg:14}[o],b=`arkyn_badge ${n} ${r} ${o} ${h}`;return s.jsxs("div",{className:b.trim(),...f,children:[Ae(m,i),u,Ae(m,i)]})}function Mt(e){const{className:n,orientation:r="horizontal",...o}=e,i=`arkyn_divider ${r} ${n}`;return s.jsx("div",{className:i,...o})}function At(e){const{className:n,...r}=e,o=`arkyn_skeleton ${n}`;return s.jsx("aside",{className:o.trim(),...r})}function Wt(e){const{className:n,...r}=e,o=`arkyn_table_body ${n}`;return s.jsx("tbody",{className:o.trim(),...r})}function Vt(e){const{className:n,children:r,...o}=e,i=`arkyn_table_caption ${n}`;return s.jsx("caption",{className:i.trim(),...o,children:s.jsx("div",{className:"arkyn_table_caption-content",children:r})})}function Yt(e){const{children:n,className:r,...o}=e,i=`arkyn_table_container ${r}`;return s.jsx("div",{className:i.trim(),...o,children:s.jsx("table",{children:n})})}function Ht(e){const{className:n,children:r,...o}=e,i=`arkyn_table_footer ${n}`;return s.jsxs("tfoot",{className:i.trim(),...o,children:[s.jsx("tr",{className:"spacing-row"}),s.jsx("tr",{children:s.jsx("th",{colSpan:100,children:s.jsx("div",{className:"arkyn_table_footer-content",children:r})})})]})}function Ut(e){const{className:n,children:r,...o}=e,i=`arkyn_table_header ${n}`;return s.jsxs("thead",{className:i.trim(),...o,children:[s.jsx("tr",{children:r}),s.jsx("tr",{className:"spacing-row"})]})}function Kt(e){const{isLoading:n=!1,scheme:r="primary",variant:o="solid",loadingText:i,size:c="md",leftIcon:h,rightIcon:u,disabled:f,className:p="",children:m,...b}=e,v={xs:12,sm:16,md:20,lg:24}[c],S=`arkyn_button loading_text_${!!i} ${o} ${r} ${c} loading_${n} ${p}`;return s.jsxs("button",{className:S,disabled:f||n,...b,children:[s.jsxs("div",{className:"arkyn_button-spinner",children:[s.jsx(Q.Loader2,{size:v,strokeWidth:2.5}),i&&i]}),s.jsxs("div",{className:"arkyn_button-content",children:[Ae(v,h),m,Ae(v,u)]})]})}const ft=l.createContext({});function Xt(e){var m,b;const n=Re.useActionData(),{children:r,className:o,...i}=e,c=l.useRef(null),h=((m=c.current)==null?void 0:m.name)||"",u=((b=n==null?void 0:n.fieldErrors)==null?void 0:b[h])||null,f=l.useId(),p=`arkyn_form_controller ${o}`;return s.jsx(ft.Provider,{value:{error:u,id:f,inputRef:c},children:s.jsx("section",{className:p.trim(),...i,children:r})})}function ye(){return l.useContext(ft)}function qt(e){const{name:n,className:r="",size:o="md",isError:i,defaultChecked:c=!1,checked:h=null,onCheck:u,value:f,...p}=e,{id:m,inputRef:b,error:a}=ye(),v=i||!!a,[S,x]=l.useState(c||!1),_=typeof h=="boolean"?h:S,y=`arkyn_checkbox ${o} ${v?"error":""} ${_?"checked":""} ${r}`;function w(){const D=S;x(!D),u&&u(D?"":f||"checked")}return s.jsxs("button",{type:"button",id:m,className:y,onClick:w,...p,children:[s.jsx("input",{type:"hidden",name:n,ref:b,value:_?f||"checked":""}),s.jsx(Q.Check,{})]})}function Jt(e){const{children:n,className:r,...o}=e,i=`arkyn_form_error ${r}`,{error:c}=ye();return n?s.jsx("strong",{className:i.trim(),...o,children:n}):c?s.jsx("strong",{className:i.trim(),...o,children:c}):s.jsx(s.Fragment,{})}function Gt(e){const{showAsterisk:n=!1,className:r="",...o}=e,{id:i}=ye(),h=`arkyn_form_label ${n?"show-asterisk":""} ${r}`;return s.jsx("label",{...o,className:h.trim(),htmlFor:i})}function Zt(e){const{isLoading:n=!1,scheme:r="primary",variant:o="solid",size:i="md",icon:c,disabled:h,className:u="",...f}=e,p={xs:12,sm:16,md:20,lg:24},m=`arkyn_icon_button ${o} ${r} ${i} loading_${n} ${u}`;return s.jsxs("button",{disabled:h||n,className:m.trim(),...f,children:[s.jsx("div",{className:"arkyn_icon_button-spinner",children:s.jsx(Q.Loader2,{size:p[i],strokeWidth:2.5})}),s.jsx("div",{className:"arkyn_icon_button-content",children:s.jsx(c,{size:p[i],strokeWidth:2.5})})]})}function ke(e,n,r){if(!e)return s.jsx(s.Fragment,{});if(typeof e=="string")return s.jsx("p",{className:r,children:e});const o=e;return s.jsx("p",{className:r,children:s.jsx(o,{color:"var(--secondary-600)",size:n,strokeWidth:2.5})})}function Ze(e){return e&&e.replace(/[^0-9]/g,"")}function ht(e,n){let r="",o=0;return Array.from(e).forEach((i,c)=>{n[c+o].match(/[0-9]/)||(r+=n[c+o],o++),r+=i}),r}function mt(e){return e.length>11?"CNPJ":"CPF"}const Qe={CPF:"999.999.999-999",CNPJ:"99.999.999/9999-99"},pt=Ze(Qe.CNPJ).length;function Qt(e,n){const{isLoading:r,isError:o,size:i="md",className:c="",variant:h="solid",prefix:u,sufix:f,leftIcon:p,rightIcon:m,disabled:b,defaultValue:a,readOnly:v,onFocus:S,onBlur:x,title:_,style:y,onChange:w,...D}=e;function F(X){let M=Ze(X);const q=mt(M);if(!(M.length>pt))return M=ht(M,Qe[q]),M}const T=m?"right":"left",z=`arkyn_input ${u?"hasPrefix":""} ${f?"hasSufix":""} ${h} ${i} ${b||v||r?"opacity":""} ${o?"errored":""} ${n?"focused":""} ${c}`,j={md:20,lg:20}[i];return{isLoading:r,className:z,prefix:ke(u,j,"prefix"),sufix:ke(f,j,"sufix"),LeftIcon:p,RightIcon:m,defaultValue:F(a||""),disabled:b,readOnly:v,onFocus:S,onBlur:x,title:_,style:y,onChange:w,loadingPosition:T,iconSize:j,Spinner:s.jsx(Q.Loader2,{className:"spinner",size:j,strokeWidth:2.5}),...D}}function en(e){const[n,r]=l.useState(!1),o=l.useRef(null),{inputRef:i,id:c,error:h}=ye(),u=i||o,f=e.isError||!!h,{disabled:p,title:m,style:b,className:a,prefix:v,sufix:S,iconSize:x,loadingPosition:_,isLoading:y,LeftIcon:w,readOnly:D,onFocus:F,onBlur:T,RightIcon:Y,Spinner:B,onChange:J,value:U,defaultValue:K,...z}=Qt({...e,id:c,isError:f},n),[te,j]=l.useState(K),X=w&&!y,M=Y&&!y,q=_==="left"&&y,ne=_==="right"&&y;function $(){p||!(u!=null&&u.current)||(r(!0),u.current.focus())}function re(E){let P=Ze(E.target.value);const G=mt(P);P.length>pt||(P=ht(P,Qe[G]),E.target.value=P,j(P),J&&J(E))}function ue(E){r(!0),F&&F(E)}function R(E){r(!1),T&&T(E)}return s.jsxs("section",{title:m,style:b,onClick:$,className:a,children:[v,q&&B,X&&s.jsx(w,{size:x,strokeWidth:2.5}),s.jsx("input",{disabled:p||y,readOnly:D,ref:u,value:U||te,onFocus:ue,onChange:re,onBlur:R,...z}),M&&s.jsx(Y,{size:x,strokeWidth:2.5}),ne&&B,S]})}const tn=3,nn=(e="pt-BR",n,r="BRL",o=!0)=>new Intl.NumberFormat(e,{style:"currency",currency:r,currencyDisplay:"symbol",minimumFractionDigits:2,maximumFractionDigits:2}).format(n).slice(o?tn:0),We=2,gt=e=>typeof e=="number"?e:Number(e.toString().replace(/[^0-9-]/g,"")),et=e=>{let n=e||0;return typeof e=="string"?(n=gt(e),n%1!==0&&(n=n==null?void 0:n.toFixed(We))):n=Number.isInteger(e)?Number(e)*10**We:e==null?void 0:e.toFixed(We),gt(n)/10**We},vt=(e,n,r)=>{if(!n)return[0,""];const o=et(n),i=nn(e,o,r);return[o,i]};function rn(e,n){const{isLoading:r,isError:o,size:i="md",className:c="",variant:h="solid",prefix:u,sufix:f,leftIcon:p,rightIcon:m,disabled:b,readOnly:a,onFocus:v,onBlur:S,title:x,style:_,max:y=1e9,locale:w="pt-BR",currency:D="BRL",...F}=e,T=m?"right":"left",z=`arkyn_input ${u?"hasPrefix":""} ${f?"hasSufix":""} ${h} ${i} ${b||a||r?"opacity":""} ${o?"errored":""} ${n?"focused":""} ${c}`,j={md:20,lg:20}[i];return{isLoading:r,className:z,prefix:ke(u,j,"prefix"),sufix:ke(f,j,"sufix"),LeftIcon:p,RightIcon:m,disabled:b,locale:w,currency:D,readOnly:a,onFocus:v,onBlur:S,title:x,style:_,max:y,loadingPosition:T,iconSize:j,Spinner:s.jsx(Q.Loader2,{className:"spinner",size:j,strokeWidth:2.5}),...F}}function an(e){const[n,r]=l.useState(!1),[o,i]=l.useState("0"),c=l.useRef(null),{inputRef:h,id:u,error:f}=ye(),p=h||c,m=e.isError||!!f,{disabled:b,title:a,style:v,className:S,prefix:x,sufix:_,iconSize:y,loadingPosition:w,isLoading:D,LeftIcon:F,readOnly:T,onFocus:Y,onBlur:B,RightIcon:J,Spinner:U,value:K,max:z,onChangeValue:te,onKeyPress:j,currency:X,locale:M,name:q,defaultValue:ne,...$}=rn({...e,id:u,isError:m},n),re=F&&!D,ue=J&&!D,R=w==="left"&&D,E=w==="right"&&D;function P(){b||!(p!=null&&p.current)||(r(!0),p.current.focus())}function G(Z){r(!0),Y&&Y(Z)}function se(Z){r(!1),B&&B(Z)}const A=Z=>{const[oe,Ce]=vt(M,Z,X);return!z||oe<=z?(i(Ce),[oe,Ce]):[et(o),o]},xe=Z=>{Z.preventDefault();const[oe,Ce]=A(Z.target.value);te(Z,String(oe),String(Ce))},me=Z=>j&&j(Z,Z.key,Z.key);return l.useEffect(()=>{const Z=K||ne||void 0,[,oe]=vt(M,Z,X);i(oe)},[X,ne,K]),s.jsxs("section",{title:a,style:v,onClick:P,className:S,children:[x,R&&U,re&&s.jsx(F,{size:y,strokeWidth:2.5}),s.jsx("input",{value:o,onChange:xe,onBlur:se,onFocus:G,onKeyUp:me,disabled:b||D,readOnly:T,ref:p,...$}),s.jsx("input",{type:"hidden",name:q,value:et(o)}),E&&U,ue&&s.jsx(J,{size:y,strokeWidth:2.5}),_]})}function sn(e,n){const{isLoading:r,isError:o,size:i="md",className:c="",variant:h="solid",prefix:u,sufix:f,leftIcon:p,rightIcon:m,disabled:b,readOnly:a,onFocus:v,onBlur:S,title:x,style:_,onChange:y,showMask:w=!1,type:D,...F}=e,T=m?"right":"left",z=`arkyn_input ${u?"hasPrefix":""} ${f?"hasSufix":""} ${h} ${i} ${b||a||r?"opacity":""} ${o?"errored":""} ${n?"focused":""} ${c}`,j={md:20,lg:20}[i];return{isLoading:r,className:z,prefix:ke(u,j,"prefix"),sufix:ke(f,j,"sufix"),LeftIcon:p,RightIcon:m,disabled:b,readOnly:a,onFocus:v,onBlur:S,title:x,style:_,onChange:y,loadingPosition:T,iconSize:j,showMask:w,Spinner:s.jsx(Q.Loader2,{className:"spinner",size:j,strokeWidth:2.5}),...F}}const on=l.forwardRef((e,n)=>s.jsx("input",{ref:n,...e}));function ln(e){const[n,r]=l.useState(!1),o=l.useRef(null),{inputRef:i,id:c,error:h}=ye(),u=i||o,f=e.isError||!!h,{disabled:p,title:m,style:b,className:a,prefix:v,sufix:S,iconSize:x,loadingPosition:_,isLoading:y,LeftIcon:w,readOnly:D,onFocus:F,onBlur:T,RightIcon:Y,Spinner:B,...J}=sn({...e,id:c,isError:f},n),U=w&&!y,K=Y&&!y,z=_==="left"&&y,te=_==="right"&&y;function j(){p||!(u!=null&&u.current)||(r(!0),u.current.focus())}function X(q){r(!0),F&&F(q)}function M(q){r(!1),T&&T(q)}return s.jsxs("section",{title:m,style:b,onClick:j,className:a,children:[v,z&&B,U&&s.jsx(w,{size:x,strokeWidth:2.5}),s.jsx(Tt.InputMask,{component:on,ref:u,onFocus:X,onBlur:M,...J}),K&&s.jsx(Y,{size:x,strokeWidth:2.5}),te&&B,S]})}function cn(e,n){const{isLoading:r,isError:o,size:i="md",className:c="",variant:h="solid",prefix:u,sufix:f,leftIcon:p,rightIcon:m,disabled:b,readOnly:a,onFocus:v,onBlur:S,title:x,style:_,onChange:y,...w}=e,D=m?"right":"left",U=`arkyn_input ${u?"hasPrefix":""} ${f?"hasSufix":""} ${h} ${i} ${b||a||r?"opacity":""} ${o?"errored":""} ${n?"focused":""} ${c}`,z={md:20,lg:20}[i];return{isLoading:r,className:U,prefix:ke(u,z,"prefix"),sufix:ke(f,z,"sufix"),LeftIcon:p,RightIcon:m,disabled:b,readOnly:a,onFocus:v,onBlur:S,title:x,style:_,onChange:y,loadingPosition:D,iconSize:z,Spinner:s.jsx(Q.Loader2,{className:"spinner",size:z,strokeWidth:2.5}),...w}}function un(e){const[n,r]=l.useState(!1),o=l.useRef(null),{inputRef:i,id:c,error:h}=ye(),u=i||o,f=e.isError||!!h,{disabled:p,title:m,style:b,className:a,prefix:v,sufix:S,iconSize:x,loadingPosition:_,isLoading:y,LeftIcon:w,readOnly:D,onFocus:F,onBlur:T,RightIcon:Y,type:B,Spinner:J,...U}=cn({...e,id:c,isError:f},n),K=w&&!y,z=Y&&!y,te=_==="left"&&y,j=_==="right"&&y;function X(){p||!(u!=null&&u.current)||(r(!0),u.current.focus())}function M(ne){r(!0),F&&F(ne)}function q(ne){r(!1),T&&T(ne)}return B==="hidden"?s.jsx("input",{style:{display:"none"},readOnly:!0,type:"text",ref:u,...U}):s.jsxs("section",{title:m,style:b,onClick:X,className:a,children:[v,te&&J,K&&s.jsx(w,{size:x,strokeWidth:2.5}),s.jsx("input",{disabled:p||y,readOnly:D,ref:u,onFocus:M,onBlur:q,type:B,...U}),z&&s.jsx(Y,{size:x,strokeWidth:2.5}),j&&J,S]})}function dn(e){return e.type==="currency"?s.jsx(an,{...e}):e.type==="masked"?s.jsx(ln,{...e}):e.type==="cpf-cnpj"?s.jsx(en,{...e}):s.jsx(un,{...e})}function fn(e,n){const{isLoading:r,isError:o,size:i="md",className:c="",variant:h="solid",prefix:u,leftIcon:f,disabled:p,readOnly:m,onFocus:b,onBlur:a,title:v,style:S,closeOnSelect:x=!0,..._}=e,T=`arkyn_select ${u?"hasPrefix":""} ${h} ${i} ${p||m||r?"opacity":""} ${o?"errored":""} ${n?"focused":""} ${c}`,B={md:20,lg:20}[i];return{isLoading:r,className:T,prefix:Dt(u,B,"prefix"),LeftIcon:f,disabled:p,readOnly:m,onFocus:b,onBlur:a,title:v,closeOnSelect:x,style:S,iconSize:B,Spinner:s.jsx(Q.Loader2,{className:"spinner",size:B,strokeWidth:2.5}),..._}}function hn(e){var P;const[n,r]=l.useState(!1),{inputRef:o,id:i,error:c}=ye(),h=l.useRef(null),u=o||h,f=e.isError||!!c,{disabled:p,title:m,style:b,className:a,prefix:v,iconSize:S,isLoading:x,LeftIcon:_,value:y=null,defaultValue:w="",readOnly:D,onFocus:F,onBlur:T,Spinner:Y,name:B,placeholder:J,onSelect:U,options:K,optionMaxHeight:z,closeOnSelect:te,...j}=fn({...e,id:i,isError:f},n),[X,M]=l.useState(w);function q(){p||!(u!=null&&u.current)||(r(!0),u.current.focus())}function ne(G){n||(r(!0),F&&F(G))}function $(){r(!1),T&&u.current&&u.current.blur()}function re(G){const{label:se,value:A}=G;M(X!==A?A:""),U&&U({label:se,value:A}),te&&$()}const ue=typeof y=="string"?y:X,R=((P=K.find(G=>G.value===ue))==null?void 0:P.label)||"",E=()=>{if(!n&&R)return!0;if(!n&&!R)return!1;if(n&&R)return!0;if(n&&!R)return!1};return s.jsxs(s.Fragment,{children:[s.jsxs("section",{title:m,style:b,onClick:q,className:`${a} placeholder_dark_${E()}`,children:[v,_&&s.jsx(_,{size:S,strokeWidth:2.5}),s.jsx("input",{disabled:p||x,readOnly:!0,placeholder:R||J,onFocus:ne,...j}),s.jsx("input",{type:"hidden",ref:u,name:B,value:ue||"",readOnly:!0}),n&&s.jsxs("div",{className:"arkyn_select_content",style:{overflow:"auto",maxHeight:z},children:[K.map(({label:G,value:se})=>s.jsxs("div",{onClick:()=>re({label:G,value:se}),className:ue===se?"arkyn_select_option active":"arkyn_select_option",children:[G," ",s.jsx(Q.Check,{})]},se)),K.length<=0&&s.jsx("p",{children:"Sem opções disponíveis"})]}),!x&&s.jsx(Q.ChevronDown,{className:"arkyn_select_arrow",size:S,strokeWidth:2.5}),x&&Y]}),n&&s.jsx("aside",{className:"arkyn_select_overlay",onClick:$})]})}function mn(e){const{variant:n="solid",size:r="md",className:o,disabled:i=!1,readOnly:c=!1,onFocus:h,onBlur:u,title:f,style:p,...m}=e,[b,a]=l.useState(!1),{inputRef:v,id:S,error:x}=ye(),_=l.useRef(null),y=v||_,D=e.isError||!!x?"errored":"",Y=`arkyn_textarea ${n} ${r} ${i||c?"opacity":""} ${D} ${b?"focused":""} ${o}`;function B(){i||!(y!=null&&y.current)||(a(!0),y.current.focus())}function J(K){a(!0),h&&h(K)}function U(K){a(!1),u&&u(K)}return s.jsx("section",{title:f,style:p,onClick:B,className:Y,children:s.jsx("textarea",{id:S,disabled:i,readOnly:c,ref:y,onFocus:J,onBlur:U,...m})})}function pn(e){const{className:n="",...r}=e,o=`arkyn_breadcrumb_container ${n}`;return s.jsx("nav",{className:o,...r})}function gn(e){const{pathname:n}=Re.useLocation(),{className:r="",disabled:o=!1,children:i,to:c,...h}=e,f=`arkyn_breadcrumb_link ${n===c?"active":"inactive"} ${r}`;return o?s.jsxs("p",{className:f,children:[s.jsx(Q.ChevronRight,{size:14,strokeWidth:2.5}),i]}):s.jsxs(Re.Link,{to:c,className:f,...h,children:[s.jsx(Q.ChevronRight,{size:14,strokeWidth:2.5}),i]})}function bt(e=""){const n=Re.useLocation(),r=new URLSearchParams(n.search),o=e?`${e}:`:"",i=c=>{Object.entries(c).forEach(([h,u])=>{u===void 0?r.delete(`${o}${h}`):r.set(`${o}${h}`,String(u))})};return{getParam:c=>r.get(`${o}${c}`),getScopedSearch:c=>{i(c);let h=r.toString();return h&&(h="?"+h),h}}}function vn(e){const{scope:n,totalCountRegisters:r,perPageKey:o="per_page",pageKey:i="page",siblingsCount:c=2,...h}=e,u=Re.useNavigate(),{getParam:f,getScopedSearch:p}=bt(n),m=Number(f(i))||1,b=Number(f(o))||20,a=Math.ceil(r/b),v=Lt(m,c),S=Ft(m,c,a);function x(_){u(p({page:_}))}return s.jsxs("div",{className:"arkyn_pagination",...h,children:[s.jsx("button",{className:"arkyn_pagination-icon_button",disabled:m<=1,onClick:()=>x(m-1),children:s.jsx(Q.ChevronLeft,{})}),m>1+c&&s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"arkyn_pagination-page_button",onClick:()=>x(1),children:"1"}),m>2+c&&s.jsx("button",{disabled:!0,className:"arkyn_pagination-spread",children:s.jsx(Q.Ellipsis,{})})]}),v.map((_,y)=>s.jsx("button",{onClick:()=>x(_),className:"arkyn_pagination-page_button",children:_},y)),s.jsx("button",{className:"arkyn_pagination-current",disabled:!0,children:m}),S.map((_,y)=>s.jsx("button",{onClick:()=>x(_),className:"arkyn_pagination-page_button",children:_},y)),m+c<a&&s.jsxs(s.Fragment,{children:[m+1+c<a&&s.jsx("button",{disabled:!0,className:"arkyn_pagination-spread",children:s.jsx(Q.Ellipsis,{})}),s.jsx("button",{className:"arkyn_pagination-page_button",onClick:()=>x(a),children:a})]}),s.jsx("button",{className:"arkyn_pagination-icon_button",disabled:m>=a,onClick:()=>x(m+1),children:s.jsx(Q.ChevronRight,{})})]})}function bn(e){const{children:n,value:r,className:o,defaultActive:i,...c}=e,h=`arkyn_tab_button ${i?"active":""} ${o||""}`;return s.jsx("button",{className:h.trim(),...c,children:n})}function yn(e){const{children:n,onClick:r,className:o,...i}=e,c=l.useRef(null),h=`arkyn_tab_container ${o||""}`,[u,f]=l.useState({width:"0px",left:"0px",transition:"none"}),p=(b,a)=>{const v=b.getBoundingClientRect(),S=c.current.getBoundingClientRect();f({transition:a?void 0:"none",width:`${v.width}px`,left:`${v.left-S.left}px`})};l.useLayoutEffect(()=>{const b=c.current;if(!b)return;let a=null;a=b.querySelector("button.active"),a&&p(a)},[]);const m=b=>{const a=b.target,v=c.current;a&&v&&v.contains(a)&&(v.querySelectorAll("button").forEach(x=>x.classList.remove("active")),a.classList.add("active"),p(a,!0),r&&r(a.value))};return s.jsxs("nav",{ref:c,onClick:m,className:h.trim(),...i,children:[n,s.jsx("div",{className:"active-line",style:u})]})}const yt=l.createContext({});function xn(e){const{isVisibled:n,makeInvisible:r,orientation:o="left",children:i,className:c,...h}=e,u=o==="left"?"-100%":"100%",p=`arkyn_drawer_container ${o} ${n?"visible":""} ${c}`;return s.jsx(yt.Provider,{value:{makeInvisible:r},children:s.jsx(je.AnimatePresence,{children:n&&s.jsxs("aside",{className:p.trim(),...h,children:[s.jsx(je.motion.div,{className:"arkyn_drawer_container-overlay",transition:{duration:.15,ease:"easeOut"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:r}),s.jsx(je.motion.div,{className:"arkyn_drawer_container-content",transition:{ease:"easeOut",duration:.15},initial:{transform:`translateX(${u})`},animate:{transform:"translateX(0px)"},exit:{transform:`translateX(${u})`},children:i})]})})})}function wn(e){const{showCloseButton:n=!0,className:r,children:o,...i}=e,{makeInvisible:c}=l.useContext(yt),h=`arkyn_drawer_header ${r}`;return s.jsxs("header",{className:h.trim(),...i,children:[o,n&&s.jsx("button",{className:"arkyn_drawer_header-close_button",type:"button",onClick:c,"aria-label":"Close drawer",children:s.jsx(Q.X,{size:24})})]})}const xt=l.createContext({});function kn(e){const{isVisibled:n,makeInvisible:r,children:o,className:i="",...c}=e,u=`arkyn_modal_container ${n?"visible":""} ${i}`;return s.jsx(xt.Provider,{value:{makeInvisible:r},children:s.jsx(je.AnimatePresence,{children:n&&s.jsxs("aside",{className:u.trim(),...c,children:[s.jsx(je.motion.div,{className:"arkyn_modal_container-overlay",transition:{duration:.15,ease:"easeOut"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:r}),s.jsx(je.motion.div,{className:"arkyn_modal_container-content",transition:{duration:.15,ease:"easeOut"},initial:{opacity:0,scale:.75},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0},children:o})]})})})}function Cn(e){const{alignment:n="right",className:r,...o}=e,i=`arkyn_modal_footer ${n} ${r}`;return s.jsx("footer",{className:i.trim(),...o})}function Nn(e){const{showCloseButton:n=!0,className:r,children:o,...i}=e,{makeInvisible:c}=l.useContext(xt),h=`arkyn_modal_header ${r}`;return s.jsxs("header",{className:h.trim(),...i,children:[o,n&&s.jsx("button",{type:"button",onClick:c,"aria-label":"Close modal button",className:"arkyn_modal_header-close_button",children:s.jsx(Q.X,{size:24})})]})}function _n(e){const{children:n,button:r,closeOnClick:o,orientation:i="bottom-left"}=e,[c,h]=l.useState(!1),u=`arkyn_popover ${i} ${c?"show":""}`;function f(){c||h(!0)}return s.jsxs("div",{className:u,onClick:f,children:[r,s.jsx(je.motion.div,{style:{visibility:c?"visible":"hidden"},transition:{ease:"easeOut",duration:0},initial:{opacity:0},animate:{opacity:c?1:0},exit:{opacity:0},onClick:()=>o&&h(!1),className:"arkyn_popover-content",children:n}),c&&s.jsx("div",{onClick:()=>h(!1),className:"arkyn_popover-overlay"})]})}function wt(e){const{message:n,title:r,type:o,size:i="lg"}=e,c=`arkyn_toast ${o} ${i}`;function h(){switch(o){case"info":return s.jsx(Q.Info,{});case"success":return s.jsx(Q.CheckCircle2,{});case"danger":return s.jsx(Q.XCircle,{});case"warning":return s.jsx(Q.AlertCircle,{});default:return s.jsx(Q.Info,{})}}return s.jsxs("aside",{className:c,children:[s.jsxs("div",{children:[s.jsx("div",{className:"bg"}),s.jsx(h,{})]}),s.jsxs("p",{children:[s.jsx("strong",{title:r,children:r}),s.jsx("span",{children:n})]})]})}function jn(e){const{text:n,size:r="lg",children:o,orientation:i="top",className:c,...h}=e,u=`arkyn_tooltip ${r} ${i} ${c}`;return s.jsxs("div",{className:u.trim(),...h,children:[o,s.jsx("div",{className:"arkyn_tooltip-text",children:n})]})}const tt=l.createContext({}),kt=l.createContext({});function Ct(){const e=l.useContext(kt);if(Object.entries(e).length===0)throw new Error("useToast must be used within a Provider");return e}function Nt(e){return e&&typeof e.title=="string"&&typeof e.message=="string"&&(e.size===void 0||e.size==="md"||e.size==="lg")&&(e.type==="info"||e.type==="success"||e.type==="danger"||e.type==="warning")}function Sn(){const e=Re.useActionData(),{closeModal:n}=l.useContext(tt),{showToast:r}=Ct();l.useEffect(()=>{const o=e==null?void 0:e.closeModalKey;o&&n(o)},[e]),l.useEffect(()=>{const o=e==null?void 0:e.toast,i=e==null?void 0:e.message;Nt(o)&&r(o),!Nt(o)&&i&&r({message:i,title:"Atenção!",type:"warning"})},[e])}const _t=l.createContext({});function En(e){const n=l.useContext(_t);if(Object.entries(n).length===0)throw new Error("useDrawer must be used within a Provider");if(e){const{drawerData:r,drawerIsOpen:o,openDrawer:i,closeDrawer:c}=n,h=o(e),u=r(e);return{drawerIsOpen:h,drawerData:u,openDrawer:m=>i(e,m),closeDrawer:()=>c(e)}}else return n}function Rn(e){const n=l.useContext(tt);if(Object.entries(n).length===0)throw new Error("useModal must be used within a Provider");if(e){const{modalData:r,modalIsOpen:o,openModal:i,closeModal:c}=n,h=o(e),u=r(e);return{modalIsOpen:h,modalData:u,openModal:m=>i(e,m),closeModal:()=>c(e)}}else return n}function $n(e){const{children:n=!1}=e,[r,o]=l.useState([]);function i(f){return!!r.some(p=>p.key===f)}function c(f){var p;return(p=r.find(m=>m.key===f))==null?void 0:p.data}function h(f,p){const m=i(f);o(m?b=>[...b.filter(v=>v.key!==f),{key:f,data:p}]:[...r,{key:f,data:p}])}function u(f){o(r.filter(p=>p.key!==f))}return s.jsx(_t.Provider,{value:{drawerIsOpen:i,drawerData:c,openDrawer:h,closeDrawer:u},children:n})}function Pn(e){const{children:n=!1}=e,[r,o]=l.useState([]);function i(f){return!!r.some(p=>p.key===f)}function c(f){var p;return(p=r.find(m=>m.key===f))==null?void 0:p.data}function h(f,p){const m=i(f);o(m?b=>[...b.filter(v=>v.key!==f),{key:f,data:p}]:[...r,{key:f,data:p}])}function u(f){o(r.filter(p=>p.key!==f))}return s.jsx(tt.Provider,{value:{modalIsOpen:i,modalData:c,openModal:h,closeModal:u},children:n})}var Tn=e=>{switch(e){case"success":return zn;case"info":return Ln;case"warning":return Fn;case"error":return Dn;default:return null}},In=Array(12).fill(0),On=({visible:e})=>l.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},l.createElement("div",{className:"sonner-spinner"},In.map((n,r)=>l.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),zn=l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Fn=l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},l.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Ln=l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Dn=l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Bn=()=>{let[e,n]=l.useState(document.hidden);return l.useEffect(()=>{let r=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},nt=1,Mn=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;let{message:r,...o}=e,i=typeof(e==null?void 0:e.id)=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:nt++,c=this.toasts.find(u=>u.id===i),h=e.dismissible===void 0?!0:e.dismissible;return c?this.toasts=this.toasts.map(u=>u.id===i?(this.publish({...u,...e,id:i,title:r}),{...u,...e,id:i,dismissible:h,title:r}):u):this.addToast({title:r,...o,dismissible:h,id:i}),i},this.dismiss=e=>(e||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),this.subscribers.forEach(n=>n({id:e,dismiss:!0})),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));let o=e instanceof Promise?e:e(),i=r!==void 0;return o.then(async c=>{if(Wn(c)&&!c.ok){i=!1;let h=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,u=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description;this.create({id:r,type:"error",message:h,description:u})}else if(n.success!==void 0){i=!1;let h=typeof n.success=="function"?await n.success(c):n.success,u=typeof n.description=="function"?await n.description(c):n.description;this.create({id:r,type:"success",message:h,description:u})}}).catch(async c=>{if(n.error!==void 0){i=!1;let h=typeof n.error=="function"?await n.error(c):n.error,u=typeof n.description=="function"?await n.description(c):n.description;this.create({id:r,type:"error",message:h,description:u})}}).finally(()=>{var c;i&&(this.dismiss(r),r=void 0),(c=n.finally)==null||c.call(n)}),r},this.custom=(e,n)=>{let r=(n==null?void 0:n.id)||nt++;return this.create({jsx:e(r),id:r,...n}),r},this.subscribers=[],this.toasts=[]}},he=new Mn,An=(e,n)=>{let r=(n==null?void 0:n.id)||nt++;return he.addToast({title:e,...n,id:r}),r},Wn=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Vn=An,Yn=()=>he.toasts,Hn=Object.assign(Vn,{success:he.success,info:he.info,warning:he.warning,error:he.error,custom:he.custom,message:he.message,promise:he.promise,dismiss:he.dismiss,loading:he.loading},{getHistory:Yn});function Un(e,{insertAt:n}={}){if(!e||typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",n==="top"&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}Un(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
33
|
-
`);function Ve(e){return e.label!==void 0}var Kn=3,Xn="32px",qn=4e3,Jn=356,Gn=14,Zn=20,Qn=200;function er(...e){return e.filter(Boolean).join(" ")}var tr=e=>{var n,r,o,i,c,h,u,f,p,m;let{invert:b,toast:a,unstyled:v,interacting:S,setHeights:x,visibleToasts:_,heights:y,index:w,toasts:D,expanded:F,removeToast:T,defaultRichColors:Y,closeButton:B,style:J,cancelButtonStyle:U,actionButtonStyle:K,className:z="",descriptionClassName:te="",duration:j,position:X,gap:M,loadingIcon:q,expandByDefault:ne,classNames:$,icons:re,closeButtonAriaLabel:ue="Close toast",pauseWhenPageIsHidden:R,cn:E}=e,[P,G]=l.useState(!1),[se,A]=l.useState(!1),[xe,me]=l.useState(!1),[Z,oe]=l.useState(!1),[Ce,$e]=l.useState(0),[rt,Ye]=l.useState(0),Se=l.useRef(null),pe=l.useRef(null),He=w===0,Ue=w+1<=_,ie=a.type,Ne=a.dismissible!==!1,at=a.className||"",Fe=a.descriptionClassName||"",Pe=l.useMemo(()=>y.findIndex(N=>N.toastId===a.id)||0,[y,a.id]),st=l.useMemo(()=>{var N;return(N=a.closeButton)!=null?N:B},[a.closeButton,B]),Le=l.useMemo(()=>a.duration||j||qn,[a.duration,j]),Te=l.useRef(0),ge=l.useRef(0),Ke=l.useRef(0),we=l.useRef(null),[De,Be]=X.split("-"),Xe=l.useMemo(()=>y.reduce((N,W,V)=>V>=Pe?N:N+W.height,0),[y,Pe]),qe=Bn(),ot=a.invert||b,Me=ie==="loading";ge.current=l.useMemo(()=>Pe*M+Xe,[Pe,Xe]),l.useEffect(()=>{G(!0)},[]),l.useLayoutEffect(()=>{if(!P)return;let N=pe.current,W=N.style.height;N.style.height="auto";let V=N.getBoundingClientRect().height;N.style.height=W,Ye(V),x(le=>le.find(de=>de.toastId===a.id)?le.map(de=>de.toastId===a.id?{...de,height:V}:de):[{toastId:a.id,height:V,position:a.position},...le])},[P,a.title,a.description,x,a.id]);let be=l.useCallback(()=>{A(!0),$e(ge.current),x(N=>N.filter(W=>W.toastId!==a.id)),setTimeout(()=>{T(a)},Qn)},[a,T,x,ge]);l.useEffect(()=>{if(a.promise&&ie==="loading"||a.duration===1/0||a.type==="loading")return;let N,W=Le;return F||S||R&&qe?(()=>{if(Ke.current<Te.current){let V=new Date().getTime()-Te.current;W=W-V}Ke.current=new Date().getTime()})():W!==1/0&&(Te.current=new Date().getTime(),N=setTimeout(()=>{var V;(V=a.onAutoClose)==null||V.call(a,a),be()},W)),()=>clearTimeout(N)},[F,S,ne,a,Le,be,a.promise,ie,R,qe]),l.useEffect(()=>{let N=pe.current;if(N){let W=N.getBoundingClientRect().height;return Ye(W),x(V=>[{toastId:a.id,height:W,position:a.position},...V]),()=>x(V=>V.filter(le=>le.toastId!==a.id))}},[x,a.id]),l.useEffect(()=>{a.delete&&be()},[be,a.delete]);function it(){return re!=null&&re.loading?l.createElement("div",{className:"sonner-loader","data-visible":ie==="loading"},re.loading):q?l.createElement("div",{className:"sonner-loader","data-visible":ie==="loading"},q):l.createElement(On,{visible:ie==="loading"})}return l.createElement("li",{"aria-live":a.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:pe,className:E(z,at,$==null?void 0:$.toast,(n=a==null?void 0:a.classNames)==null?void 0:n.toast,$==null?void 0:$.default,$==null?void 0:$[ie],(r=a==null?void 0:a.classNames)==null?void 0:r[ie]),"data-sonner-toast":"","data-rich-colors":(o=a.richColors)!=null?o:Y,"data-styled":!(a.jsx||a.unstyled||v),"data-mounted":P,"data-promise":!!a.promise,"data-removed":se,"data-visible":Ue,"data-y-position":De,"data-x-position":Be,"data-index":w,"data-front":He,"data-swiping":xe,"data-dismissible":Ne,"data-type":ie,"data-invert":ot,"data-swipe-out":Z,"data-expanded":!!(F||ne&&P),style:{"--index":w,"--toasts-before":w,"--z-index":D.length-w,"--offset":`${se?Ce:ge.current}px`,"--initial-height":ne?"auto":`${rt}px`,...J,...a.style},onPointerDown:N=>{Me||!Ne||(Se.current=new Date,$e(ge.current),N.target.setPointerCapture(N.pointerId),N.target.tagName!=="BUTTON"&&(me(!0),we.current={x:N.clientX,y:N.clientY}))},onPointerUp:()=>{var N,W,V,le;if(Z||!Ne)return;we.current=null;let de=Number(((N=pe.current)==null?void 0:N.style.getPropertyValue("--swipe-amount").replace("px",""))||0),_e=new Date().getTime()-((W=Se.current)==null?void 0:W.getTime()),Je=Math.abs(de)/_e;if(Math.abs(de)>=Zn||Je>.11){$e(ge.current),(V=a.onDismiss)==null||V.call(a,a),be(),oe(!0);return}(le=pe.current)==null||le.style.setProperty("--swipe-amount","0px"),me(!1)},onPointerMove:N=>{var W;if(!we.current||!Ne)return;let V=N.clientY-we.current.y,le=N.clientX-we.current.x,de=(De==="top"?Math.min:Math.max)(0,V),_e=N.pointerType==="touch"?10:2;Math.abs(de)>_e?(W=pe.current)==null||W.style.setProperty("--swipe-amount",`${V}px`):Math.abs(le)>_e&&(we.current=null)}},st&&!a.jsx?l.createElement("button",{"aria-label":ue,"data-disabled":Me,"data-close-button":!0,onClick:Me||!Ne?()=>{}:()=>{var N;be(),(N=a.onDismiss)==null||N.call(a,a)},className:E($==null?void 0:$.closeButton,(i=a==null?void 0:a.classNames)==null?void 0:i.closeButton)},l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},l.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,a.jsx||l.isValidElement(a.title)?a.jsx||a.title:l.createElement(l.Fragment,null,ie||a.icon||a.promise?l.createElement("div",{"data-icon":"",className:E($==null?void 0:$.icon,(c=a==null?void 0:a.classNames)==null?void 0:c.icon)},a.promise||a.type==="loading"&&!a.icon?a.icon||it():null,a.type!=="loading"?a.icon||(re==null?void 0:re[ie])||Tn(ie):null):null,l.createElement("div",{"data-content":"",className:E($==null?void 0:$.content,(h=a==null?void 0:a.classNames)==null?void 0:h.content)},l.createElement("div",{"data-title":"",className:E($==null?void 0:$.title,(u=a==null?void 0:a.classNames)==null?void 0:u.title)},a.title),a.description?l.createElement("div",{"data-description":"",className:E(te,Fe,$==null?void 0:$.description,(f=a==null?void 0:a.classNames)==null?void 0:f.description)},a.description):null),l.isValidElement(a.cancel)?a.cancel:a.cancel&&Ve(a.cancel)?l.createElement("button",{"data-button":!0,"data-cancel":!0,style:a.cancelButtonStyle||U,onClick:N=>{var W,V;Ve(a.cancel)&&Ne&&((V=(W=a.cancel).onClick)==null||V.call(W,N),be())},className:E($==null?void 0:$.cancelButton,(p=a==null?void 0:a.classNames)==null?void 0:p.cancelButton)},a.cancel.label):null,l.isValidElement(a.action)?a.action:a.action&&Ve(a.action)?l.createElement("button",{"data-button":!0,"data-action":!0,style:a.actionButtonStyle||K,onClick:N=>{var W,V;Ve(a.action)&&(N.defaultPrevented||((V=(W=a.action).onClick)==null||V.call(W,N),be()))},className:E($==null?void 0:$.actionButton,(m=a==null?void 0:a.classNames)==null?void 0:m.actionButton)},a.action.label):null))};function jt(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var nr=e=>{let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:i,closeButton:c,className:h,offset:u,theme:f="light",richColors:p,duration:m,style:b,visibleToasts:a=Kn,toastOptions:v,dir:S=jt(),gap:x=Gn,loadingIcon:_,icons:y,containerAriaLabel:w="Notifications",pauseWhenPageIsHidden:D,cn:F=er}=e,[T,Y]=l.useState([]),B=l.useMemo(()=>Array.from(new Set([r].concat(T.filter(R=>R.position).map(R=>R.position)))),[T,r]),[J,U]=l.useState([]),[K,z]=l.useState(!1),[te,j]=l.useState(!1),[X,M]=l.useState(f!=="system"?f:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=l.useRef(null),ne=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),$=l.useRef(null),re=l.useRef(!1),ue=l.useCallback(R=>{var E;(E=T.find(P=>P.id===R.id))!=null&&E.delete||he.dismiss(R.id),Y(P=>P.filter(({id:G})=>G!==R.id))},[T]);return l.useEffect(()=>he.subscribe(R=>{if(R.dismiss){Y(E=>E.map(P=>P.id===R.id?{...P,delete:!0}:P));return}setTimeout(()=>{It.flushSync(()=>{Y(E=>{let P=E.findIndex(G=>G.id===R.id);return P!==-1?[...E.slice(0,P),{...E[P],...R},...E.slice(P+1)]:[R,...E]})})})}),[]),l.useEffect(()=>{if(f!=="system"){M(f);return}f==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?M("dark"):M("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:R})=>{M(R?"dark":"light")})},[f]),l.useEffect(()=>{T.length<=1&&z(!1)},[T]),l.useEffect(()=>{let R=E=>{var P,G;o.every(se=>E[se]||E.code===se)&&(z(!0),(P=q.current)==null||P.focus()),E.code==="Escape"&&(document.activeElement===q.current||(G=q.current)!=null&&G.contains(document.activeElement))&&z(!1)};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[o]),l.useEffect(()=>{if(q.current)return()=>{$.current&&($.current.focus({preventScroll:!0}),$.current=null,re.current=!1)}},[q.current]),T.length?l.createElement("section",{"aria-label":`${w} ${ne}`,tabIndex:-1},B.map((R,E)=>{var P;let[G,se]=R.split("-");return l.createElement("ol",{key:R,dir:S==="auto"?jt():S,tabIndex:-1,ref:q,className:h,"data-sonner-toaster":!0,"data-theme":X,"data-y-position":G,"data-x-position":se,style:{"--front-toast-height":`${((P=J[0])==null?void 0:P.height)||0}px`,"--offset":typeof u=="number"?`${u}px`:u||Xn,"--width":`${Jn}px`,"--gap":`${x}px`,...b},onBlur:A=>{re.current&&!A.currentTarget.contains(A.relatedTarget)&&(re.current=!1,$.current&&($.current.focus({preventScroll:!0}),$.current=null))},onFocus:A=>{A.target instanceof HTMLElement&&A.target.dataset.dismissible==="false"||re.current||(re.current=!0,$.current=A.relatedTarget)},onMouseEnter:()=>z(!0),onMouseMove:()=>z(!0),onMouseLeave:()=>{te||z(!1)},onPointerDown:A=>{A.target instanceof HTMLElement&&A.target.dataset.dismissible==="false"||j(!0)},onPointerUp:()=>j(!1)},T.filter(A=>!A.position&&E===0||A.position===R).map((A,xe)=>{var me,Z;return l.createElement(tr,{key:A.id,icons:y,index:xe,toast:A,defaultRichColors:p,duration:(me=v==null?void 0:v.duration)!=null?me:m,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:n,visibleToasts:a,closeButton:(Z=v==null?void 0:v.closeButton)!=null?Z:c,interacting:te,position:R,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:ue,toasts:T.filter(oe=>oe.position==A.position),heights:J.filter(oe=>oe.position==A.position),setHeights:U,expandByDefault:i,gap:x,loadingIcon:_,expanded:K,pauseWhenPageIsHidden:D,cn:F})}))})):null};function rr({children:e}){function n(r){Hn.custom(o=>s.jsx(wt,{...r}))}return s.jsxs(kt.Provider,{value:{showToast:n},children:[s.jsx(nr,{}),e]})}k.Badge=Bt,k.BreadcrumbContainer=pn,k.BreadcrumbLink=gn,k.Button=Kt,k.Checkbox=qt,k.Divider=Mt,k.DrawerContainer=xn,k.DrawerHeader=wn,k.DrawerProvider=$n,k.FormController=Xt,k.FormError=Jt,k.FormLabel=Gt,k.IconButton=Zt,k.Input=dn,k.ModalContainer=kn,k.ModalFooter=Cn,k.ModalHeader=Nn,k.ModalProvider=Pn,k.Pagination=vn,k.Popover=_n,k.Select=hn,k.Skeleton=At,k.TabButton=bn,k.TabContainer=yn,k.TableBody=Wt,k.TableCaption=Vt,k.TableContainer=Yt,k.TableFooter=Ht,k.TableHeader=Ut,k.Textarea=mn,k.Toast=wt,k.ToastProvider=rr,k.Tooltip=jn,k.useAutomation=Sn,k.useDrawer=En,k.useModal=Rn,k.useScopedParams=bt,k.useToast=Ct,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
|
32
|
+
<%s key={someKey} {...props} />`,lt,Ee,gr,Ee),Pt[Ee+lt]=!0}}return t===o?dr(ae):ur(ae),ae}}function fr(t,h,g){return Tt(t,h,g,!0)}function hr(t,h,g){return Tt(t,h,g,!1)}var mr=hr,pr=fr;ze.Fragment=o,ze.jsx=mr,ze.jsxs=pr}()),ze}process.env.NODE_ENV==="production"?Je.exports=zt():Je.exports=Ft();var a=Je.exports;function Ae(e,n){return n?a.jsx(n,{size:e,strokeWidth:2.5}):a.jsx(a.Fragment,{})}function dt(e,n){return[...new Array(n-e)].map((r,o)=>e+o+1).filter(r=>r>0)}function Dt(e,n,r){return e>=r?[]:dt(e+1,e+n)}function Lt(e,n){return e<=1?[]:dt(e-1-n,e-1)}function Bt(e,n,r){if(!e)return a.jsx(a.Fragment,{});if(typeof e=="string")return a.jsx("p",{className:r,children:e});const o=e;return a.jsx("p",{className:r,children:a.jsx(o,{color:"var(--secondary-600)",size:n,strokeWidth:2.5})})}function Mt(e){const{variant:n="ghost",scheme:r="primary",size:o="md",leftIcon:i,rightIcon:c,className:f="",children:u,...d}=e,m={md:12,lg:14}[o],b=`arkyn_badge ${n} ${r} ${o} ${f}`;return a.jsxs("div",{className:b.trim(),...d,children:[Ae(m,i),u,Ae(m,i)]})}function At(e){const{className:n,orientation:r="horizontal",...o}=e,i=`arkyn_divider ${r} ${n}`;return a.jsx("div",{className:i,...o})}function Vt(e){const{className:n,...r}=e,o=`arkyn_skeleton ${n}`;return a.jsx("aside",{className:o.trim(),...r})}function Wt(e){const{className:n,...r}=e,o=`arkyn_table_body ${n}`;return a.jsx("tbody",{className:o.trim(),...r})}function Yt(e){const{className:n,children:r,...o}=e,i=`arkyn_table_caption ${n}`;return a.jsx("caption",{className:i.trim(),...o,children:a.jsx("div",{className:"arkyn_table_caption-content",children:r})})}function Ht(e){const{children:n,className:r,...o}=e,i=`arkyn_table_container ${r}`;return a.jsx("div",{className:i.trim(),...o,children:a.jsx("table",{children:n})})}function Ut(e){const{className:n,children:r,...o}=e,i=`arkyn_table_footer ${n}`;return a.jsxs("tfoot",{className:i.trim(),...o,children:[a.jsx("tr",{className:"spacing-row"}),a.jsx("tr",{children:a.jsx("th",{colSpan:100,children:a.jsx("div",{className:"arkyn_table_footer-content",children:r})})})]})}function Kt(e){const{className:n,children:r,...o}=e,i=`arkyn_table_header ${n}`;return a.jsxs("thead",{className:i.trim(),...o,children:[a.jsx("tr",{children:r}),a.jsx("tr",{className:"spacing-row"})]})}function Xt(e){const{isLoading:n=!1,scheme:r="primary",variant:o="solid",loadingText:i,size:c="md",leftIcon:f,rightIcon:u,disabled:d,className:p="",children:m,...b}=e,v={xs:12,sm:16,md:20,lg:24}[c],S=`arkyn_button loading_text_${!!i} ${o} ${r} ${c} loading_${n} ${p}`;return a.jsxs("button",{className:S,disabled:d||n,...b,children:[a.jsxs("div",{className:"arkyn_button-spinner",children:[a.jsx(Q.Loader2,{size:v,strokeWidth:2.5}),i&&i]}),a.jsxs("div",{className:"arkyn_button-content",children:[Ae(v,f),m,Ae(v,u)]})]})}const ft=l.createContext({});function qt(e){var m,b;const n=Re.useActionData(),{children:r,className:o,...i}=e,c=l.useRef(null),f=((m=c.current)==null?void 0:m.name)||"",u=((b=n==null?void 0:n.fieldErrors)==null?void 0:b[f])||null,d=l.useId(),p=`arkyn_form_controller ${o}`;return a.jsx(ft.Provider,{value:{error:u,id:d,inputRef:c},children:a.jsx("section",{className:p.trim(),...i,children:r})})}function be(){return l.useContext(ft)}function Gt(e){const{name:n,className:r="",size:o="md",isError:i,defaultChecked:c=!1,checked:f=null,onCheck:u,value:d,...p}=e,{id:m,inputRef:b,error:s}=be(),v=i||!!s,[S,w]=l.useState(c||!1),j=typeof f=="boolean"?f:S,y=`arkyn_checkbox ${o} ${v?"error":""} ${j?"checked":""} ${r}`;function k(){const L=S;w(!L),u&&u(L?"":d||"checked")}return a.jsxs("button",{type:"button",id:m,className:y,onClick:k,...p,children:[a.jsx("input",{type:"hidden",name:n,ref:b,value:j?d||"checked":""}),a.jsx(Q.Check,{})]})}function Jt(e){const{children:n,className:r,...o}=e,i=`arkyn_form_error ${r}`,{error:c}=be();return n?a.jsx("strong",{className:i.trim(),...o,children:n}):c?a.jsx("strong",{className:i.trim(),...o,children:c}):a.jsx(a.Fragment,{})}function Zt(e){const{showAsterisk:n=!1,className:r="",...o}=e,{id:i}=be(),f=`arkyn_form_label ${n?"show-asterisk":""} ${r}`;return a.jsx("label",{...o,className:f.trim(),htmlFor:i})}function Qt(e){const{isLoading:n=!1,scheme:r="primary",variant:o="solid",size:i="md",icon:c,disabled:f,className:u="",...d}=e,p={xs:12,sm:16,md:20,lg:24},m=`arkyn_icon_button ${o} ${r} ${i} loading_${n} ${u}`;return a.jsxs("button",{disabled:f||n,className:m.trim(),...d,children:[a.jsx("div",{className:"arkyn_icon_button-spinner",children:a.jsx(Q.Loader2,{size:p[i],strokeWidth:2.5})}),a.jsx("div",{className:"arkyn_icon_button-content",children:a.jsx(c,{size:p[i],strokeWidth:2.5})})]})}function ke(e,n,r){if(!e)return a.jsx(a.Fragment,{});if(typeof e=="string")return a.jsx("p",{className:r,children:e});const o=e;return a.jsx("p",{className:r,children:a.jsx(o,{color:"var(--secondary-600)",size:n,strokeWidth:2.5})})}function Ze(e){return e&&e.replace(/[^0-9]/g,"")}function ht(e,n){let r="",o=0;return Array.from(e).forEach((i,c)=>{n[c+o].match(/[0-9]/)||(r+=n[c+o],o++),r+=i}),r}function mt(e){return e.length>11?"CNPJ":"CPF"}const Qe={CPF:"999.999.999-999",CNPJ:"99.999.999/9999-99"},pt=Ze(Qe.CNPJ).length;function en(e,n){const{isLoading:r,isError:o,size:i="md",className:c="",variant:f="solid",prefix:u,sufix:d,leftIcon:p,rightIcon:m,disabled:b,defaultValue:s,readOnly:v,onFocus:S,onBlur:w,title:j,style:y,onChange:k,...L}=e;function F(X){let M=Ze(X);const q=mt(M);if(!(M.length>pt))return M=ht(M,Qe[q]),M}const T=m?"right":"left",z=`arkyn_input ${u?"hasPrefix":""} ${d?"hasSufix":""} ${f} ${i} ${b||v||r?"opacity":""} ${o?"errored":""} ${n?"focused":""} ${c}`,_={md:20,lg:20}[i];return{isLoading:r,className:z,prefix:ke(u,_,"prefix"),sufix:ke(d,_,"sufix"),LeftIcon:p,RightIcon:m,defaultValue:F(s||""),disabled:b,readOnly:v,onFocus:S,onBlur:w,title:j,style:y,onChange:k,loadingPosition:T,iconSize:_,Spinner:a.jsx(Q.Loader2,{className:"spinner",size:_,strokeWidth:2.5}),...L}}function tn(e){const[n,r]=l.useState(!1),o=l.useRef(null),{inputRef:i,id:c,error:f}=be(),u=i||o,d=e.isError||!!f,{disabled:p,title:m,style:b,className:s,prefix:v,sufix:S,iconSize:w,loadingPosition:j,isLoading:y,LeftIcon:k,readOnly:L,onFocus:F,onBlur:T,RightIcon:Y,Spinner:B,onChange:G,value:U,defaultValue:K,...z}=en({...e,id:c,isError:d},n),[te,_]=l.useState(K),X=k&&!y,M=Y&&!y,q=j==="left"&&y,ne=j==="right"&&y;function $(){p||!(u!=null&&u.current)||(r(!0),u.current.focus())}function re(E){let P=Ze(E.target.value);const J=mt(P);P.length>pt||(P=ht(P,Qe[J]),E.target.value=P,_(P),G&&G(E))}function ue(E){r(!0),F&&F(E)}function R(E){r(!1),T&&T(E)}return a.jsxs("section",{title:m,style:b,onClick:$,className:s,children:[v,q&&B,X&&a.jsx(k,{size:w,strokeWidth:2.5}),a.jsx("input",{disabled:p||y,readOnly:L,ref:u,value:U||te,onFocus:ue,onChange:re,onBlur:R,...z}),M&&a.jsx(Y,{size:w,strokeWidth:2.5}),ne&&B,S]})}const nn=3,rn=(e="pt-BR",n,r="BRL",o=!0)=>new Intl.NumberFormat(e,{style:"currency",currency:r,currencyDisplay:"symbol",minimumFractionDigits:2,maximumFractionDigits:2}).format(n).slice(o?nn:0),Ve=2,gt=e=>typeof e=="number"?e:Number(e.toString().replace(/[^0-9-]/g,"")),et=e=>{let n=e;return typeof e=="string"?(n=gt(e),n%1!==0&&(n=n.toFixed(Ve))):n=Number.isInteger(e)?Number(e)*10**Ve:e.toFixed(Ve),gt(n)/10**Ve},vt=(e,n,r)=>{if(!n)return[0,""];const o=et(n),i=rn(e,o,r);return[o,i]};function an(e,n){const{isLoading:r,isError:o,size:i="md",className:c="",variant:f="solid",prefix:u,sufix:d,leftIcon:p,rightIcon:m,disabled:b,readOnly:s,onFocus:v,onBlur:S,title:w,style:j,max:y=1e9,locale:k="pt-BR",currency:L="BRL",...F}=e,T=m?"right":"left",z=`arkyn_input ${u?"hasPrefix":""} ${d?"hasSufix":""} ${f} ${i} ${b||s||r?"opacity":""} ${o?"errored":""} ${n?"focused":""} ${c}`,_={md:20,lg:20}[i];return{isLoading:r,className:z,prefix:ke(u,_,"prefix"),sufix:ke(d,_,"sufix"),LeftIcon:p,RightIcon:m,disabled:b,locale:k,currency:L,readOnly:s,onFocus:v,onBlur:S,title:w,style:j,max:y,loadingPosition:T,iconSize:_,Spinner:a.jsx(Q.Loader2,{className:"spinner",size:_,strokeWidth:2.5}),...F}}function sn(e){const[n,r]=l.useState(!1),[o,i]=l.useState("0"),c=l.useRef(null),{inputRef:f,id:u,error:d}=be(),p=f||c,m=e.isError||!!d,{disabled:b,title:s,style:v,className:S,prefix:w,sufix:j,iconSize:y,loadingPosition:k,isLoading:L,LeftIcon:F,readOnly:T,onFocus:Y,onBlur:B,RightIcon:G,Spinner:U,value:K,max:z,onChangeValue:te,onKeyPress:_,currency:X,locale:M,name:q,defaultValue:ne,...$}=an({...e,id:u,isError:m},n),re=F&&!L,ue=G&&!L,R=k==="left"&&L,E=k==="right"&&L;function P(){b||!(p!=null&&p.current)||(r(!0),p.current.focus())}function J(Z){r(!0),Y&&Y(Z)}function se(Z){r(!1),B&&B(Z)}const A=Z=>{const[oe,Ce]=vt(M,Z,X);return!z||oe<=z?(i(Ce),[oe,Ce]):[et(o),o]},xe=Z=>{Z.preventDefault();const[oe,Ce]=A(Z.target.value);te(Z,String(oe),String(Ce))},me=Z=>_&&_(Z,Z.key,Z.key);return l.useEffect(()=>{const Z=K||ne||void 0,[,oe]=vt(M,Z,X);i(oe)},[X,ne,K]),a.jsxs("section",{title:s,style:v,onClick:P,className:S,children:[w,R&&U,re&&a.jsx(F,{size:y,strokeWidth:2.5}),a.jsx("input",{value:o,onChange:xe,onBlur:se,onFocus:J,onKeyUp:me,disabled:b||L,readOnly:T,ref:p,...$}),a.jsx("input",{type:"hidden",name:q,value:et(o)}),E&&U,ue&&a.jsx(G,{size:y,strokeWidth:2.5}),j]})}function on(e,n){const{isLoading:r,isError:o,size:i="md",className:c="",variant:f="solid",prefix:u,sufix:d,leftIcon:p,rightIcon:m,disabled:b,readOnly:s,onFocus:v,onBlur:S,title:w,style:j,onChange:y,showMask:k=!1,type:L,...F}=e,T=m?"right":"left",z=`arkyn_input ${u?"hasPrefix":""} ${d?"hasSufix":""} ${f} ${i} ${b||s||r?"opacity":""} ${o?"errored":""} ${n?"focused":""} ${c}`,_={md:20,lg:20}[i];return{isLoading:r,className:z,prefix:ke(u,_,"prefix"),sufix:ke(d,_,"sufix"),LeftIcon:p,RightIcon:m,disabled:b,readOnly:s,onFocus:v,onBlur:S,title:w,style:j,onChange:y,loadingPosition:T,iconSize:_,showMask:k,Spinner:a.jsx(Q.Loader2,{className:"spinner",size:_,strokeWidth:2.5}),...F}}const ln=l.forwardRef((e,n)=>a.jsx("input",{ref:n,...e}));function cn(e){const[n,r]=l.useState(!1),o=l.useRef(null),{inputRef:i,id:c,error:f}=be(),u=i||o,d=e.isError||!!f,{disabled:p,title:m,style:b,className:s,prefix:v,sufix:S,iconSize:w,loadingPosition:j,isLoading:y,LeftIcon:k,readOnly:L,onFocus:F,onBlur:T,RightIcon:Y,Spinner:B,...G}=on({...e,id:c,isError:d},n),U=k&&!y,K=Y&&!y,z=j==="left"&&y,te=j==="right"&&y;function _(){p||!(u!=null&&u.current)||(r(!0),u.current.focus())}function X(q){r(!0),F&&F(q)}function M(q){r(!1),T&&T(q)}return a.jsxs("section",{title:m,style:b,onClick:_,className:s,children:[v,z&&B,U&&a.jsx(k,{size:w,strokeWidth:2.5}),a.jsx(It.InputMask,{component:ln,ref:u,onFocus:X,onBlur:M,...G}),K&&a.jsx(Y,{size:w,strokeWidth:2.5}),te&&B,S]})}function un(e,n){const{isLoading:r,isError:o,size:i="md",className:c="",variant:f="solid",prefix:u,sufix:d,leftIcon:p,rightIcon:m,disabled:b,readOnly:s,onFocus:v,onBlur:S,title:w,style:j,onChange:y,...k}=e,L=m?"right":"left",U=`arkyn_input ${u?"hasPrefix":""} ${d?"hasSufix":""} ${f} ${i} ${b||s||r?"opacity":""} ${o?"errored":""} ${n?"focused":""} ${c}`,z={md:20,lg:20}[i];return{isLoading:r,className:U,prefix:ke(u,z,"prefix"),sufix:ke(d,z,"sufix"),LeftIcon:p,RightIcon:m,disabled:b,readOnly:s,onFocus:v,onBlur:S,title:w,style:j,onChange:y,loadingPosition:L,iconSize:z,Spinner:a.jsx(Q.Loader2,{className:"spinner",size:z,strokeWidth:2.5}),...k}}function dn(e){const[n,r]=l.useState(!1),o=l.useRef(null),{inputRef:i,id:c,error:f}=be(),u=i||o,d=e.isError||!!f,{disabled:p,title:m,style:b,className:s,prefix:v,sufix:S,iconSize:w,loadingPosition:j,isLoading:y,LeftIcon:k,readOnly:L,onFocus:F,onBlur:T,RightIcon:Y,type:B,Spinner:G,...U}=un({...e,id:c,isError:d},n),K=k&&!y,z=Y&&!y,te=j==="left"&&y,_=j==="right"&&y;function X(){p||!(u!=null&&u.current)||(r(!0),u.current.focus())}function M(ne){r(!0),F&&F(ne)}function q(ne){r(!1),T&&T(ne)}return B==="hidden"?a.jsx("input",{style:{display:"none"},readOnly:!0,type:"text",ref:u,...U}):a.jsxs("section",{title:m,style:b,onClick:X,className:s,children:[v,te&&G,K&&a.jsx(k,{size:w,strokeWidth:2.5}),a.jsx("input",{disabled:p||y,readOnly:L,ref:u,onFocus:M,onBlur:q,type:B,...U}),z&&a.jsx(Y,{size:w,strokeWidth:2.5}),_&&G,S]})}function fn(e){return e.type==="currency"?a.jsx(sn,{...e}):e.type==="masked"?a.jsx(cn,{...e}):e.type==="cpf-cnpj"?a.jsx(tn,{...e}):a.jsx(dn,{...e})}const bt=l.createContext({});function hn(){return l.useContext(bt)}function mn(e){const{defaultValue:n,name:r,value:o,onChange:i,size:c="md",...f}=e,[u,d]=l.useState(n||""),{inputRef:p}=be();function m(b){d(b),i&&i(b)}return a.jsxs(bt.Provider,{value:{onChange:m,value:o||u,size:c},children:[a.jsx("input",{style:{display:"none"},type:"text",readOnly:!0,name:r,ref:p,value:u}),a.jsx("div",{...f})]})}function pn(e){const{value:n,size:r,disabled:o,children:i}=e,{onChange:c,size:f,value:u}=hn(),{error:d}=be(),v=`arkyn_radio_box ${r||f} ${u===n?"isChecked":""} ${d?"isErrored":""} ${o?"isDisabled":""}`;return a.jsxs("label",{className:v.trim(),children:[a.jsx("button",{type:"button",disabled:o,onClick:()=>c(n),onFocus:()=>c(n)}),i]})}function gn(e,n){const{isLoading:r,isError:o,size:i="md",className:c="",variant:f="solid",prefix:u,leftIcon:d,disabled:p,readOnly:m,onFocus:b,onBlur:s,title:v,style:S,closeOnSelect:w=!0,...j}=e,T=`arkyn_select ${u?"hasPrefix":""} ${f} ${i} ${p||m||r?"opacity":""} ${o?"errored":""} ${n?"focused":""} ${c}`,B={md:20,lg:20}[i];return{isLoading:r,className:T,prefix:Bt(u,B,"prefix"),LeftIcon:d,disabled:p,readOnly:m,onFocus:b,onBlur:s,title:v,closeOnSelect:w,style:S,iconSize:B,Spinner:a.jsx(Q.Loader2,{className:"spinner",size:B,strokeWidth:2.5}),...j}}function vn(e){var P;const[n,r]=l.useState(!1),{inputRef:o,id:i,error:c}=be(),f=l.useRef(null),u=o||f,d=e.isError||!!c,{disabled:p,title:m,style:b,className:s,prefix:v,iconSize:S,isLoading:w,LeftIcon:j,value:y=null,defaultValue:k="",readOnly:L,onFocus:F,onBlur:T,Spinner:Y,name:B,placeholder:G,onSelect:U,options:K,optionMaxHeight:z,closeOnSelect:te,..._}=gn({...e,id:i,isError:d},n),[X,M]=l.useState(k);function q(){p||!(u!=null&&u.current)||(r(!0),u.current.focus())}function ne(J){n||(r(!0),F&&F(J))}function $(){r(!1),T&&u.current&&u.current.blur()}function re(J){const{label:se,value:A}=J;M(X!==A?A:""),U&&U({label:se,value:A}),te&&$()}const ue=typeof y=="string"?y:X,R=((P=K.find(J=>J.value===ue))==null?void 0:P.label)||"",E=()=>{if(!n&&R)return!0;if(!n&&!R)return!1;if(n&&R)return!0;if(n&&!R)return!1};return a.jsxs(a.Fragment,{children:[a.jsxs("section",{title:m,style:b,onClick:q,className:`${s} placeholder_dark_${E()}`,children:[v,j&&a.jsx(j,{size:S,strokeWidth:2.5}),a.jsx("input",{disabled:p||w,readOnly:!0,placeholder:R||G,onFocus:ne,..._}),a.jsx("input",{type:"hidden",ref:u,name:B,value:ue||"",readOnly:!0}),n&&a.jsxs("div",{className:"arkyn_select_content",style:{overflow:"auto",maxHeight:z},children:[K.map(({label:J,value:se})=>a.jsxs("div",{onClick:()=>re({label:J,value:se}),className:ue===se?"arkyn_select_option active":"arkyn_select_option",children:[J," ",a.jsx(Q.Check,{})]},se)),K.length<=0&&a.jsx("p",{children:"Sem opções disponíveis"})]}),!w&&a.jsx(Q.ChevronDown,{className:"arkyn_select_arrow",size:S,strokeWidth:2.5}),w&&Y]}),n&&a.jsx("aside",{className:"arkyn_select_overlay",onClick:$})]})}function bn(e){const{variant:n="solid",size:r="md",className:o,disabled:i=!1,readOnly:c=!1,onFocus:f,onBlur:u,title:d,style:p,...m}=e,[b,s]=l.useState(!1),{inputRef:v,id:S,error:w}=be(),j=l.useRef(null),y=v||j,L=e.isError||!!w?"errored":"",Y=`arkyn_textarea ${n} ${r} ${i||c?"opacity":""} ${L} ${b?"focused":""} ${o}`;function B(){i||!(y!=null&&y.current)||(s(!0),y.current.focus())}function G(K){s(!0),f&&f(K)}function U(K){s(!1),u&&u(K)}return a.jsx("section",{title:d,style:p,onClick:B,className:Y,children:a.jsx("textarea",{id:S,disabled:i,readOnly:c,ref:y,onFocus:G,onBlur:U,...m})})}function yn(e){const{className:n="",...r}=e,o=`arkyn_breadcrumb_container ${n}`;return a.jsx("nav",{className:o,...r})}function xn(e){const{pathname:n}=Re.useLocation(),{className:r="",disabled:o=!1,children:i,to:c,...f}=e,d=`arkyn_breadcrumb_link ${n===c?"active":"inactive"} ${r}`;return o?a.jsxs("p",{className:d,children:[a.jsx(Q.ChevronRight,{size:14,strokeWidth:2.5}),i]}):a.jsxs(Re.Link,{to:c,className:d,...f,children:[a.jsx(Q.ChevronRight,{size:14,strokeWidth:2.5}),i]})}function yt(e=""){const n=Re.useLocation(),r=new URLSearchParams(n.search),o=e?`${e}:`:"",i=c=>{Object.entries(c).forEach(([f,u])=>{u===void 0?r.delete(`${o}${f}`):r.set(`${o}${f}`,String(u))})};return{getParam:c=>r.get(`${o}${c}`),getScopedSearch:c=>{i(c);let f=r.toString();return f&&(f="?"+f),f}}}function wn(e){const{scope:n,totalCountRegisters:r,perPageKey:o="per_page",pageKey:i="page",siblingsCount:c=2,...f}=e,u=Re.useNavigate(),{getParam:d,getScopedSearch:p}=yt(n),m=Number(d(i))||1,b=Number(d(o))||20,s=Math.ceil(r/b),v=Lt(m,c),S=Dt(m,c,s);function w(j){u(p({page:j}))}return a.jsxs("div",{className:"arkyn_pagination",...f,children:[a.jsx("button",{className:"arkyn_pagination-icon_button",disabled:m<=1,onClick:()=>w(m-1),children:a.jsx(Q.ChevronLeft,{})}),m>1+c&&a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"arkyn_pagination-page_button",onClick:()=>w(1),children:"1"}),m>2+c&&a.jsx("button",{disabled:!0,className:"arkyn_pagination-spread",children:a.jsx(Q.Ellipsis,{})})]}),v.map((j,y)=>a.jsx("button",{onClick:()=>w(j),className:"arkyn_pagination-page_button",children:j},y)),a.jsx("button",{className:"arkyn_pagination-current",disabled:!0,children:m}),S.map((j,y)=>a.jsx("button",{onClick:()=>w(j),className:"arkyn_pagination-page_button",children:j},y)),m+c<s&&a.jsxs(a.Fragment,{children:[m+1+c<s&&a.jsx("button",{disabled:!0,className:"arkyn_pagination-spread",children:a.jsx(Q.Ellipsis,{})}),a.jsx("button",{className:"arkyn_pagination-page_button",onClick:()=>w(s),children:s})]}),a.jsx("button",{className:"arkyn_pagination-icon_button",disabled:m>=s,onClick:()=>w(m+1),children:a.jsx(Q.ChevronRight,{})})]})}function kn(e){const{children:n,value:r,className:o,defaultActive:i,...c}=e,f=`arkyn_tab_button ${i?"active":""} ${o||""}`;return a.jsx("button",{className:f.trim(),...c,children:n})}function Cn(e){const{children:n,onClick:r,className:o,...i}=e,c=l.useRef(null),f=`arkyn_tab_container ${o||""}`,[u,d]=l.useState({width:"0px",left:"0px",transition:"none"}),p=(b,s)=>{const v=b.getBoundingClientRect(),S=c.current.getBoundingClientRect();d({transition:s?void 0:"none",width:`${v.width}px`,left:`${v.left-S.left}px`})};l.useLayoutEffect(()=>{const b=c.current;if(!b)return;let s=null;s=b.querySelector("button.active"),s&&p(s)},[]);const m=b=>{const s=b.target,v=c.current;s&&v&&v.contains(s)&&(v.querySelectorAll("button").forEach(w=>w.classList.remove("active")),s.classList.add("active"),p(s,!0),r&&r(s.value))};return a.jsxs("nav",{ref:c,onClick:m,className:f.trim(),...i,children:[n,a.jsx("div",{className:"active-line",style:u})]})}const xt=l.createContext({});function Nn(e){const{isVisibled:n,makeInvisible:r,orientation:o="left",children:i,className:c,...f}=e,u=o==="left"?"-100%":"100%",p=`arkyn_drawer_container ${o} ${n?"visible":""} ${c}`;return a.jsx(xt.Provider,{value:{makeInvisible:r},children:a.jsx(_e.AnimatePresence,{children:n&&a.jsxs("aside",{className:p.trim(),...f,children:[a.jsx(_e.motion.div,{className:"arkyn_drawer_container-overlay",transition:{duration:.15,ease:"easeOut"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:r}),a.jsx(_e.motion.div,{className:"arkyn_drawer_container-content",transition:{ease:"easeOut",duration:.15},initial:{transform:`translateX(${u})`},animate:{transform:"translateX(0px)"},exit:{transform:`translateX(${u})`},children:i})]})})})}function jn(e){const{showCloseButton:n=!0,className:r,children:o,...i}=e,{makeInvisible:c}=l.useContext(xt),f=`arkyn_drawer_header ${r}`;return a.jsxs("header",{className:f.trim(),...i,children:[o,n&&a.jsx("button",{className:"arkyn_drawer_header-close_button",type:"button",onClick:c,"aria-label":"Close drawer",children:a.jsx(Q.X,{size:24})})]})}const wt=l.createContext({});function _n(e){const{isVisibled:n,makeInvisible:r,children:o,className:i="",...c}=e,u=`arkyn_modal_container ${n?"visible":""} ${i}`;return a.jsx(wt.Provider,{value:{makeInvisible:r},children:a.jsx(_e.AnimatePresence,{children:n&&a.jsxs("aside",{className:u.trim(),...c,children:[a.jsx(_e.motion.div,{className:"arkyn_modal_container-overlay",transition:{duration:.15,ease:"easeOut"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:r}),a.jsx(_e.motion.div,{className:"arkyn_modal_container-content",transition:{duration:.15,ease:"easeOut"},initial:{opacity:0,scale:.75},animate:{opacity:1,scale:1},exit:{opacity:0,scale:0},children:o})]})})})}function Sn(e){const{alignment:n="right",className:r,...o}=e,i=`arkyn_modal_footer ${n} ${r}`;return a.jsx("footer",{className:i.trim(),...o})}function En(e){const{showCloseButton:n=!0,className:r,children:o,...i}=e,{makeInvisible:c}=l.useContext(wt),f=`arkyn_modal_header ${r}`;return a.jsxs("header",{className:f.trim(),...i,children:[o,n&&a.jsx("button",{type:"button",onClick:c,"aria-label":"Close modal button",className:"arkyn_modal_header-close_button",children:a.jsx(Q.X,{size:24})})]})}function Rn(e){const{children:n,button:r,closeOnClick:o,orientation:i="bottom-left"}=e,[c,f]=l.useState(!1),u=`arkyn_popover ${i} ${c?"show":""}`;function d(){c||f(!0)}return a.jsxs("div",{className:u,onClick:d,children:[r,a.jsx(_e.motion.div,{style:{visibility:c?"visible":"hidden"},transition:{ease:"easeOut",duration:0},initial:{opacity:0},animate:{opacity:c?1:0},exit:{opacity:0},onClick:()=>o&&f(!1),className:"arkyn_popover-content",children:n}),c&&a.jsx("div",{onClick:()=>f(!1),className:"arkyn_popover-overlay"})]})}function kt(e){const{message:n,title:r,type:o,size:i="lg"}=e,c=`arkyn_toast ${o} ${i}`;function f(){switch(o){case"info":return a.jsx(Q.Info,{});case"success":return a.jsx(Q.CheckCircle2,{});case"danger":return a.jsx(Q.XCircle,{});case"warning":return a.jsx(Q.AlertCircle,{});default:return a.jsx(Q.Info,{})}}return a.jsxs("aside",{className:c,children:[a.jsxs("div",{children:[a.jsx("div",{className:"bg"}),a.jsx(f,{})]}),a.jsxs("p",{children:[a.jsx("strong",{title:r,children:r}),a.jsx("span",{children:n})]})]})}function $n(e){const{text:n,size:r="lg",children:o,orientation:i="top",className:c,...f}=e,u=`arkyn_tooltip ${r} ${i} ${c}`;return a.jsxs("div",{className:u.trim(),...f,children:[o,a.jsx("div",{className:"arkyn_tooltip-text",children:n})]})}const tt=l.createContext({}),Ct=l.createContext({});function Nt(){const e=l.useContext(Ct);if(Object.entries(e).length===0)throw new Error("useToast must be used within a Provider");return e}function jt(e){return e&&typeof e.title=="string"&&typeof e.message=="string"&&(e.size===void 0||e.size==="md"||e.size==="lg")&&(e.type==="info"||e.type==="success"||e.type==="danger"||e.type==="warning")}function Pn(){const e=Re.useActionData(),{closeModal:n}=l.useContext(tt),{showToast:r}=Nt();l.useEffect(()=>{const o=e==null?void 0:e.closeModalKey;o&&n(o)},[e]),l.useEffect(()=>{const o=e==null?void 0:e.toast,i=e==null?void 0:e.message;jt(o)&&r(o),!jt(o)&&i&&r({message:i,title:"Atenção!",type:"warning"})},[e])}const _t=l.createContext({});function Tn(e){const n=l.useContext(_t);if(Object.entries(n).length===0)throw new Error("useDrawer must be used within a Provider");if(e){const{drawerData:r,drawerIsOpen:o,openDrawer:i,closeDrawer:c}=n,f=o(e),u=r(e);return{drawerIsOpen:f,drawerData:u,openDrawer:m=>i(e,m),closeDrawer:()=>c(e)}}else return n}function In(e){const n=l.useContext(tt);if(Object.entries(n).length===0)throw new Error("useModal must be used within a Provider");if(e){const{modalData:r,modalIsOpen:o,openModal:i,closeModal:c}=n,f=o(e),u=r(e);return{modalIsOpen:f,modalData:u,openModal:m=>i(e,m),closeModal:()=>c(e)}}else return n}function On(e){const{children:n=!1}=e,[r,o]=l.useState([]);function i(d){return!!r.some(p=>p.key===d)}function c(d){var p;return(p=r.find(m=>m.key===d))==null?void 0:p.data}function f(d,p){const m=i(d);o(m?b=>[...b.filter(v=>v.key!==d),{key:d,data:p}]:[...r,{key:d,data:p}])}function u(d){o(r.filter(p=>p.key!==d))}return a.jsx(_t.Provider,{value:{drawerIsOpen:i,drawerData:c,openDrawer:f,closeDrawer:u},children:n})}function zn(e){const{children:n=!1}=e,[r,o]=l.useState([]);function i(d){return!!r.some(p=>p.key===d)}function c(d){var p;return(p=r.find(m=>m.key===d))==null?void 0:p.data}function f(d,p){const m=i(d);o(m?b=>[...b.filter(v=>v.key!==d),{key:d,data:p}]:[...r,{key:d,data:p}])}function u(d){o(r.filter(p=>p.key!==d))}return a.jsx(tt.Provider,{value:{modalIsOpen:i,modalData:c,openModal:f,closeModal:u},children:n})}var Fn=e=>{switch(e){case"success":return Bn;case"info":return An;case"warning":return Mn;case"error":return Vn;default:return null}},Dn=Array(12).fill(0),Ln=({visible:e})=>l.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},l.createElement("div",{className:"sonner-spinner"},Dn.map((n,r)=>l.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Bn=l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Mn=l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},l.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),An=l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Vn=l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Wn=()=>{let[e,n]=l.useState(document.hidden);return l.useEffect(()=>{let r=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},nt=1,Yn=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;let{message:r,...o}=e,i=typeof(e==null?void 0:e.id)=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:nt++,c=this.toasts.find(u=>u.id===i),f=e.dismissible===void 0?!0:e.dismissible;return c?this.toasts=this.toasts.map(u=>u.id===i?(this.publish({...u,...e,id:i,title:r}),{...u,...e,id:i,dismissible:f,title:r}):u):this.addToast({title:r,...o,dismissible:f,id:i}),i},this.dismiss=e=>(e||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),this.subscribers.forEach(n=>n({id:e,dismiss:!0})),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));let o=e instanceof Promise?e:e(),i=r!==void 0;return o.then(async c=>{if(Un(c)&&!c.ok){i=!1;let f=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,u=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description;this.create({id:r,type:"error",message:f,description:u})}else if(n.success!==void 0){i=!1;let f=typeof n.success=="function"?await n.success(c):n.success,u=typeof n.description=="function"?await n.description(c):n.description;this.create({id:r,type:"success",message:f,description:u})}}).catch(async c=>{if(n.error!==void 0){i=!1;let f=typeof n.error=="function"?await n.error(c):n.error,u=typeof n.description=="function"?await n.description(c):n.description;this.create({id:r,type:"error",message:f,description:u})}}).finally(()=>{var c;i&&(this.dismiss(r),r=void 0),(c=n.finally)==null||c.call(n)}),r},this.custom=(e,n)=>{let r=(n==null?void 0:n.id)||nt++;return this.create({jsx:e(r),id:r,...n}),r},this.subscribers=[],this.toasts=[]}},he=new Yn,Hn=(e,n)=>{let r=(n==null?void 0:n.id)||nt++;return he.addToast({title:e,...n,id:r}),r},Un=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Kn=Hn,Xn=()=>he.toasts,qn=Object.assign(Kn,{success:he.success,info:he.info,warning:he.warning,error:he.error,custom:he.custom,message:he.message,promise:he.promise,dismiss:he.dismiss,loading:he.loading},{getHistory:Xn});function Gn(e,{insertAt:n}={}){if(!e||typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",n==="top"&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}Gn(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
33
|
+
`);function We(e){return e.label!==void 0}var Jn=3,Zn="32px",Qn=4e3,er=356,tr=14,nr=20,rr=200;function ar(...e){return e.filter(Boolean).join(" ")}var sr=e=>{var n,r,o,i,c,f,u,d,p,m;let{invert:b,toast:s,unstyled:v,interacting:S,setHeights:w,visibleToasts:j,heights:y,index:k,toasts:L,expanded:F,removeToast:T,defaultRichColors:Y,closeButton:B,style:G,cancelButtonStyle:U,actionButtonStyle:K,className:z="",descriptionClassName:te="",duration:_,position:X,gap:M,loadingIcon:q,expandByDefault:ne,classNames:$,icons:re,closeButtonAriaLabel:ue="Close toast",pauseWhenPageIsHidden:R,cn:E}=e,[P,J]=l.useState(!1),[se,A]=l.useState(!1),[xe,me]=l.useState(!1),[Z,oe]=l.useState(!1),[Ce,$e]=l.useState(0),[rt,Ye]=l.useState(0),Se=l.useRef(null),pe=l.useRef(null),He=k===0,Ue=k+1<=j,ie=s.type,Ne=s.dismissible!==!1,at=s.className||"",Fe=s.descriptionClassName||"",Pe=l.useMemo(()=>y.findIndex(N=>N.toastId===s.id)||0,[y,s.id]),st=l.useMemo(()=>{var N;return(N=s.closeButton)!=null?N:B},[s.closeButton,B]),De=l.useMemo(()=>s.duration||_||Qn,[s.duration,_]),Te=l.useRef(0),ge=l.useRef(0),Ke=l.useRef(0),we=l.useRef(null),[Le,Be]=X.split("-"),Xe=l.useMemo(()=>y.reduce((N,V,W)=>W>=Pe?N:N+V.height,0),[y,Pe]),qe=Wn(),ot=s.invert||b,Me=ie==="loading";ge.current=l.useMemo(()=>Pe*M+Xe,[Pe,Xe]),l.useEffect(()=>{J(!0)},[]),l.useLayoutEffect(()=>{if(!P)return;let N=pe.current,V=N.style.height;N.style.height="auto";let W=N.getBoundingClientRect().height;N.style.height=V,Ye(W),w(le=>le.find(de=>de.toastId===s.id)?le.map(de=>de.toastId===s.id?{...de,height:W}:de):[{toastId:s.id,height:W,position:s.position},...le])},[P,s.title,s.description,w,s.id]);let ye=l.useCallback(()=>{A(!0),$e(ge.current),w(N=>N.filter(V=>V.toastId!==s.id)),setTimeout(()=>{T(s)},rr)},[s,T,w,ge]);l.useEffect(()=>{if(s.promise&&ie==="loading"||s.duration===1/0||s.type==="loading")return;let N,V=De;return F||S||R&&qe?(()=>{if(Ke.current<Te.current){let W=new Date().getTime()-Te.current;V=V-W}Ke.current=new Date().getTime()})():V!==1/0&&(Te.current=new Date().getTime(),N=setTimeout(()=>{var W;(W=s.onAutoClose)==null||W.call(s,s),ye()},V)),()=>clearTimeout(N)},[F,S,ne,s,De,ye,s.promise,ie,R,qe]),l.useEffect(()=>{let N=pe.current;if(N){let V=N.getBoundingClientRect().height;return Ye(V),w(W=>[{toastId:s.id,height:V,position:s.position},...W]),()=>w(W=>W.filter(le=>le.toastId!==s.id))}},[w,s.id]),l.useEffect(()=>{s.delete&&ye()},[ye,s.delete]);function it(){return re!=null&&re.loading?l.createElement("div",{className:"sonner-loader","data-visible":ie==="loading"},re.loading):q?l.createElement("div",{className:"sonner-loader","data-visible":ie==="loading"},q):l.createElement(Ln,{visible:ie==="loading"})}return l.createElement("li",{"aria-live":s.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:pe,className:E(z,at,$==null?void 0:$.toast,(n=s==null?void 0:s.classNames)==null?void 0:n.toast,$==null?void 0:$.default,$==null?void 0:$[ie],(r=s==null?void 0:s.classNames)==null?void 0:r[ie]),"data-sonner-toast":"","data-rich-colors":(o=s.richColors)!=null?o:Y,"data-styled":!(s.jsx||s.unstyled||v),"data-mounted":P,"data-promise":!!s.promise,"data-removed":se,"data-visible":Ue,"data-y-position":Le,"data-x-position":Be,"data-index":k,"data-front":He,"data-swiping":xe,"data-dismissible":Ne,"data-type":ie,"data-invert":ot,"data-swipe-out":Z,"data-expanded":!!(F||ne&&P),style:{"--index":k,"--toasts-before":k,"--z-index":L.length-k,"--offset":`${se?Ce:ge.current}px`,"--initial-height":ne?"auto":`${rt}px`,...G,...s.style},onPointerDown:N=>{Me||!Ne||(Se.current=new Date,$e(ge.current),N.target.setPointerCapture(N.pointerId),N.target.tagName!=="BUTTON"&&(me(!0),we.current={x:N.clientX,y:N.clientY}))},onPointerUp:()=>{var N,V,W,le;if(Z||!Ne)return;we.current=null;let de=Number(((N=pe.current)==null?void 0:N.style.getPropertyValue("--swipe-amount").replace("px",""))||0),je=new Date().getTime()-((V=Se.current)==null?void 0:V.getTime()),Ge=Math.abs(de)/je;if(Math.abs(de)>=nr||Ge>.11){$e(ge.current),(W=s.onDismiss)==null||W.call(s,s),ye(),oe(!0);return}(le=pe.current)==null||le.style.setProperty("--swipe-amount","0px"),me(!1)},onPointerMove:N=>{var V;if(!we.current||!Ne)return;let W=N.clientY-we.current.y,le=N.clientX-we.current.x,de=(Le==="top"?Math.min:Math.max)(0,W),je=N.pointerType==="touch"?10:2;Math.abs(de)>je?(V=pe.current)==null||V.style.setProperty("--swipe-amount",`${W}px`):Math.abs(le)>je&&(we.current=null)}},st&&!s.jsx?l.createElement("button",{"aria-label":ue,"data-disabled":Me,"data-close-button":!0,onClick:Me||!Ne?()=>{}:()=>{var N;ye(),(N=s.onDismiss)==null||N.call(s,s)},className:E($==null?void 0:$.closeButton,(i=s==null?void 0:s.classNames)==null?void 0:i.closeButton)},l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},l.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,s.jsx||l.isValidElement(s.title)?s.jsx||s.title:l.createElement(l.Fragment,null,ie||s.icon||s.promise?l.createElement("div",{"data-icon":"",className:E($==null?void 0:$.icon,(c=s==null?void 0:s.classNames)==null?void 0:c.icon)},s.promise||s.type==="loading"&&!s.icon?s.icon||it():null,s.type!=="loading"?s.icon||(re==null?void 0:re[ie])||Fn(ie):null):null,l.createElement("div",{"data-content":"",className:E($==null?void 0:$.content,(f=s==null?void 0:s.classNames)==null?void 0:f.content)},l.createElement("div",{"data-title":"",className:E($==null?void 0:$.title,(u=s==null?void 0:s.classNames)==null?void 0:u.title)},s.title),s.description?l.createElement("div",{"data-description":"",className:E(te,Fe,$==null?void 0:$.description,(d=s==null?void 0:s.classNames)==null?void 0:d.description)},s.description):null),l.isValidElement(s.cancel)?s.cancel:s.cancel&&We(s.cancel)?l.createElement("button",{"data-button":!0,"data-cancel":!0,style:s.cancelButtonStyle||U,onClick:N=>{var V,W;We(s.cancel)&&Ne&&((W=(V=s.cancel).onClick)==null||W.call(V,N),ye())},className:E($==null?void 0:$.cancelButton,(p=s==null?void 0:s.classNames)==null?void 0:p.cancelButton)},s.cancel.label):null,l.isValidElement(s.action)?s.action:s.action&&We(s.action)?l.createElement("button",{"data-button":!0,"data-action":!0,style:s.actionButtonStyle||K,onClick:N=>{var V,W;We(s.action)&&(N.defaultPrevented||((W=(V=s.action).onClick)==null||W.call(V,N),ye()))},className:E($==null?void 0:$.actionButton,(m=s==null?void 0:s.classNames)==null?void 0:m.actionButton)},s.action.label):null))};function St(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var or=e=>{let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:i,closeButton:c,className:f,offset:u,theme:d="light",richColors:p,duration:m,style:b,visibleToasts:s=Jn,toastOptions:v,dir:S=St(),gap:w=tr,loadingIcon:j,icons:y,containerAriaLabel:k="Notifications",pauseWhenPageIsHidden:L,cn:F=ar}=e,[T,Y]=l.useState([]),B=l.useMemo(()=>Array.from(new Set([r].concat(T.filter(R=>R.position).map(R=>R.position)))),[T,r]),[G,U]=l.useState([]),[K,z]=l.useState(!1),[te,_]=l.useState(!1),[X,M]=l.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=l.useRef(null),ne=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),$=l.useRef(null),re=l.useRef(!1),ue=l.useCallback(R=>{var E;(E=T.find(P=>P.id===R.id))!=null&&E.delete||he.dismiss(R.id),Y(P=>P.filter(({id:J})=>J!==R.id))},[T]);return l.useEffect(()=>he.subscribe(R=>{if(R.dismiss){Y(E=>E.map(P=>P.id===R.id?{...P,delete:!0}:P));return}setTimeout(()=>{Ot.flushSync(()=>{Y(E=>{let P=E.findIndex(J=>J.id===R.id);return P!==-1?[...E.slice(0,P),{...E[P],...R},...E.slice(P+1)]:[R,...E]})})})}),[]),l.useEffect(()=>{if(d!=="system"){M(d);return}d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?M("dark"):M("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:R})=>{M(R?"dark":"light")})},[d]),l.useEffect(()=>{T.length<=1&&z(!1)},[T]),l.useEffect(()=>{let R=E=>{var P,J;o.every(se=>E[se]||E.code===se)&&(z(!0),(P=q.current)==null||P.focus()),E.code==="Escape"&&(document.activeElement===q.current||(J=q.current)!=null&&J.contains(document.activeElement))&&z(!1)};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[o]),l.useEffect(()=>{if(q.current)return()=>{$.current&&($.current.focus({preventScroll:!0}),$.current=null,re.current=!1)}},[q.current]),T.length?l.createElement("section",{"aria-label":`${k} ${ne}`,tabIndex:-1},B.map((R,E)=>{var P;let[J,se]=R.split("-");return l.createElement("ol",{key:R,dir:S==="auto"?St():S,tabIndex:-1,ref:q,className:f,"data-sonner-toaster":!0,"data-theme":X,"data-y-position":J,"data-x-position":se,style:{"--front-toast-height":`${((P=G[0])==null?void 0:P.height)||0}px`,"--offset":typeof u=="number"?`${u}px`:u||Zn,"--width":`${er}px`,"--gap":`${w}px`,...b},onBlur:A=>{re.current&&!A.currentTarget.contains(A.relatedTarget)&&(re.current=!1,$.current&&($.current.focus({preventScroll:!0}),$.current=null))},onFocus:A=>{A.target instanceof HTMLElement&&A.target.dataset.dismissible==="false"||re.current||(re.current=!0,$.current=A.relatedTarget)},onMouseEnter:()=>z(!0),onMouseMove:()=>z(!0),onMouseLeave:()=>{te||z(!1)},onPointerDown:A=>{A.target instanceof HTMLElement&&A.target.dataset.dismissible==="false"||_(!0)},onPointerUp:()=>_(!1)},T.filter(A=>!A.position&&E===0||A.position===R).map((A,xe)=>{var me,Z;return l.createElement(sr,{key:A.id,icons:y,index:xe,toast:A,defaultRichColors:p,duration:(me=v==null?void 0:v.duration)!=null?me:m,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:n,visibleToasts:s,closeButton:(Z=v==null?void 0:v.closeButton)!=null?Z:c,interacting:te,position:R,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:ue,toasts:T.filter(oe=>oe.position==A.position),heights:G.filter(oe=>oe.position==A.position),setHeights:U,expandByDefault:i,gap:w,loadingIcon:j,expanded:K,pauseWhenPageIsHidden:L,cn:F})}))})):null};function ir({children:e}){function n(r){qn.custom(o=>a.jsx(kt,{...r}))}return a.jsxs(Ct.Provider,{value:{showToast:n},children:[a.jsx(or,{}),e]})}x.Badge=Mt,x.BreadcrumbContainer=yn,x.BreadcrumbLink=xn,x.Button=Xt,x.Checkbox=Gt,x.Divider=At,x.DrawerContainer=Nn,x.DrawerHeader=jn,x.DrawerProvider=On,x.FormController=qt,x.FormError=Jt,x.FormLabel=Zt,x.IconButton=Qt,x.Input=fn,x.ModalContainer=_n,x.ModalFooter=Sn,x.ModalHeader=En,x.ModalProvider=zn,x.Pagination=wn,x.Popover=Rn,x.RadioBox=pn,x.RadioGroup=mn,x.Select=vn,x.Skeleton=Vt,x.TabButton=kn,x.TabContainer=Cn,x.TableBody=Wt,x.TableCaption=Yt,x.TableContainer=Ht,x.TableFooter=Ut,x.TableHeader=Kt,x.Textarea=bn,x.Toast=kt,x.ToastProvider=ir,x.Tooltip=$n,x.useAutomation=Pn,x.useDrawer=Tn,x.useModal=In,x.useScopedParams=yt,x.useToast=Nt,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Radio/RadioBox/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAK7C,OAAO,cAAc,CAAC;AAEtB,iBAAS,QAAQ,CAAC,KAAK,EAAE,aAAa,2CA8BrC;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { useFormController } from "../../Form/FormController";
|
3
|
+
import { useRadioGroup } from "../RadioGroup";
|
4
|
+
import "./styles.css";
|
5
|
+
function RadioBox(props) {
|
6
|
+
const { value: componentValue, size: componentSize, disabled, children, } = props;
|
7
|
+
const { onChange, size: groupSize, value: selectedValue } = useRadioGroup();
|
8
|
+
const { error } = useFormController();
|
9
|
+
const size = componentSize || groupSize;
|
10
|
+
const isChecked = selectedValue === componentValue ? "isChecked" : "";
|
11
|
+
const isErrored = !!error ? "isErrored" : "";
|
12
|
+
const isDisabled = disabled ? "isDisabled" : "";
|
13
|
+
const className = `arkyn_radio_box ${size} ${isChecked} ${isErrored} ${isDisabled}`;
|
14
|
+
return (_jsxs("label", { className: className.trim(), children: [_jsx("button", { type: "button", disabled: disabled, onClick: () => onChange(componentValue), onFocus: () => onChange(componentValue) }), children] }));
|
15
|
+
}
|
16
|
+
export { RadioBox };
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { RadioGroupContextType, RadioGroupProps } from "@arkyn/types";
|
2
|
+
declare function useRadioGroup(): RadioGroupContextType;
|
3
|
+
declare function RadioGroup(props: RadioGroupProps): import("react/jsx-runtime").JSX.Element;
|
4
|
+
export { RadioGroup, useRadioGroup };
|
5
|
+
//# sourceMappingURL=RadioGroup.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../src/components/Radio/RadioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAOtE,iBAAS,aAAa,0BAErB;AAED,iBAAS,UAAU,CAAC,KAAK,EAAE,eAAe,2CAkCzC;AAED,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { createContext, useContext, useState } from "react";
|
3
|
+
import { useFormController } from "../Form/FormController";
|
4
|
+
const RadioContext = createContext({});
|
5
|
+
function useRadioGroup() {
|
6
|
+
return useContext(RadioContext);
|
7
|
+
}
|
8
|
+
function RadioGroup(props) {
|
9
|
+
const { defaultValue, name, value: forceValue, onChange, size = "md", ...rest } = props;
|
10
|
+
const [value, setValue] = useState(defaultValue || "");
|
11
|
+
const { inputRef } = useFormController();
|
12
|
+
function handleChange(value) {
|
13
|
+
setValue(value);
|
14
|
+
onChange && onChange(value);
|
15
|
+
}
|
16
|
+
return (_jsxs(RadioContext.Provider, { value: { onChange: handleChange, value: forceValue || value, size }, children: [_jsx("input", { style: { display: "none" }, type: "text", readOnly: true, name: name, ref: inputRef, value: value }), _jsx("div", { ...rest })] }));
|
17
|
+
}
|
18
|
+
export { RadioGroup, useRadioGroup };
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Radio/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/index.d.ts
CHANGED
@@ -7,6 +7,7 @@ export { Checkbox } from "./components/Checkbox";
|
|
7
7
|
export { FormController, FormError, FormLabel } from "./components/Form";
|
8
8
|
export { IconButton } from "./components/IconButton";
|
9
9
|
export { Input } from "./components/Input";
|
10
|
+
export { RadioBox, RadioGroup } from "./components/Radio";
|
10
11
|
export { Select } from "./components/Select";
|
11
12
|
export { Textarea } from "./components/Textarea";
|
12
13
|
export { BreadcrumbContainer, BreadcrumbLink } from "./components/Breadcrumb";
|
package/dist/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACL,SAAS,EACT,YAAY,EACZ,cAAc,EACd,WAAW,EACX,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAG/C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACL,SAAS,EACT,YAAY,EACZ,cAAc,EACd,WAAW,EACX,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAG/C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
@@ -9,6 +9,7 @@ export { Checkbox } from "./components/Checkbox";
|
|
9
9
|
export { FormController, FormError, FormLabel } from "./components/Form";
|
10
10
|
export { IconButton } from "./components/IconButton";
|
11
11
|
export { Input } from "./components/Input";
|
12
|
+
export { RadioBox, RadioGroup } from "./components/Radio";
|
12
13
|
export { Select } from "./components/Select";
|
13
14
|
export { Textarea } from "./components/Textarea";
|
14
15
|
// Navigation
|
@@ -1,17 +1,17 @@
|
|
1
1
|
import { MAXIMUM_FRACTION_DIGITS } from "../constants/decimals";
|
2
2
|
import { clearNumber } from "./clearNumber";
|
3
3
|
const normalizeValue = (number) => {
|
4
|
-
let safeNumber = number
|
4
|
+
let safeNumber = number;
|
5
5
|
if (typeof number === "string") {
|
6
6
|
safeNumber = clearNumber(number);
|
7
7
|
if (safeNumber % 1 !== 0) {
|
8
|
-
safeNumber = safeNumber
|
8
|
+
safeNumber = safeNumber.toFixed(MAXIMUM_FRACTION_DIGITS);
|
9
9
|
}
|
10
10
|
}
|
11
11
|
else {
|
12
12
|
safeNumber = Number.isInteger(number)
|
13
13
|
? Number(number) * 10 ** MAXIMUM_FRACTION_DIGITS
|
14
|
-
: number
|
14
|
+
: number.toFixed(MAXIMUM_FRACTION_DIGITS);
|
15
15
|
}
|
16
16
|
return clearNumber(safeNumber) / 10 ** MAXIMUM_FRACTION_DIGITS;
|
17
17
|
};
|