@arkyn/components 1.3.68 → 1.3.70
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/bundle.js +869 -860
- package/dist/bundle.umd.cjs +11 -11
- package/dist/components/Tabs/TabButton/index.d.ts.map +1 -1
- package/dist/components/Tabs/TabButton/index.js +11 -3
- package/dist/components/Tabs/TabContainer/index.d.ts +8 -1
- package/dist/components/Tabs/TabContainer/index.d.ts.map +1 -1
- package/dist/components/Tabs/TabContainer/index.js +16 -9
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/Table/TableBody/styles.css +2 -0
- package/src/components/Table/TableHeader/styles.css +4 -0
- package/src/components/Tabs/TabButton/index.tsx +18 -12
- package/src/components/Tabs/TabButton/styles.css +13 -0
- package/src/components/Tabs/TabContainer/index.tsx +42 -10
package/dist/bundle.umd.cjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
(function(
|
1
|
+
(function(w,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):(w=typeof globalThis<"u"?globalThis:w||self,l(w["@arkyn/components"]={},w.e,w.lucideReact,w.react,w.mask,w.framerMotion,w.Gt))})(this,function(w,l,Q,Re,Ot,je,zt){"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
|
9
|
+
*/var ut;function Ft(){if(ut)return Oe;ut=1;var e=l,n=Symbol.for("react.element"),a=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,y={},s=null,b=null;p!==void 0&&(s=""+p),d.key!==void 0&&(s=""+d.key),d.ref!==void 0&&(b=d.ref);for(m in d)o.call(d,m)&&!c.hasOwnProperty(m)&&(y[m]=d[m]);if(u&&u.defaultProps)for(m in d=u.defaultProps,d)y[m]===void 0&&(y[m]=d[m]);return{$$typeof:n,type:u,key:s,ref:b,props:y,_owner:i.current}}return Oe.Fragment=a,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
|
18
|
-
`+xe+t}}var Z=!1,oe;{var
|
19
|
-
`),ce=
|
17
|
+
*/var dt;function Bt(){return dt||(dt=1,process.env.NODE_ENV!=="production"&&function(){var e=l,n=Symbol.for("react.element"),a=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"),y=Symbol.for("react.memo"),s=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),_=Symbol.iterator,C="@@iterator";function k(t){if(t===null||typeof t!="object")return null;var h=_&&t[_]||t[C];return typeof h=="function"?h:null}var v=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function x(t){{for(var h=arguments.length,g=new Array(h>1?h-1:0),N=1;N<h;N++)g[N-1]=arguments[N];F("error",t,g)}}function F(t,h,g){{var N=v.ReactDebugCurrentFrame,D=N.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 z=!1,P=!1,Y=!1,L=!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||L||t===b||z||P||Y||typeof t=="object"&&t!==null&&(t.$$typeof===s||t.$$typeof===y||t.$$typeof===f||t.$$typeof===u||t.$$typeof===d||t.$$typeof===U||t.getModuleId!==void 0))}function B(t,h,g){var N=t.displayName;if(N)return N;var D=h.displayName||h.name||"";return D!==""?g+"("+D+")":g}function te(t){return t.displayName||"Context"}function S(t){if(t==null)return null;if(typeof t.tag=="number"&&x("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 a: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 B(t,t.render,"ForwardRef");case y:var N=t.displayName||null;return N!==null?N:S(t.type)||"Memo";case s:{var D=t,H=D._payload,O=D._init;try{return S(O(H))}catch{return null}}}return null}var X=Object.assign,M=0,q,ne,$,ae,ue,R,E;function T(){}T.__reactDisabledLog=!0;function J(){{if(M===0){q=console.log,ne=console.info,$=console.warn,ae=console.error,ue=console.group,R=console.groupCollapsed,E=console.groupEnd;var t={configurable:!0,enumerable:!0,value:T,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:ae}),group:X({},t,{value:ue}),groupCollapsed:X({},t,{value:R}),groupEnd:X({},t,{value:E})})}M<0&&x("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var A=v.ReactCurrentDispatcher,xe;function me(t,h,g){{if(xe===void 0)try{throw Error()}catch(D){var N=D.stack.trim().match(/\n( *(at )?)/);xe=N&&N[1]||""}return`
|
18
|
+
`+xe+t}}var Z=!1,oe;{var ke=typeof WeakMap=="function"?WeakMap:Map;oe=new ke}function $e(t,h){if(!t||Z)return"";{var g=oe.get(t);if(g!==void 0)return g}var N;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){N=fe}Reflect.construct(t,[],O)}else{try{O.call()}catch(fe){N=fe}t.call(O.prototype)}}else{try{throw Error()}catch(fe){N=fe}t()}}catch(fe){if(fe&&N&&typeof fe.stack=="string"){for(var I=fe.stack.split(`
|
19
|
+
`),ce=N.stack.split(`
|
20
20
|
`),ee=I.length-1,re=ce.length-1;ee>=1&&re>=0&&I[ee]!==ce[re];)re--;for(;ee>=1&&re>=0;ee--,re--)if(I[ee]!==ce[re]){if(ee!==1||re!==1)do if(ee--,re--,re<0||I[ee]!==ce[re]){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&&re>=0);break}}}finally{Z=!1,A.current=H,se(),Error.prepareStackTrace=D}var Ie=t?t.displayName||t.name:"",Ee=Ie?
|
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&&re>=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 y:return Se(t.type,h,g);case s:{var N=t,D=N._payload,H=N._init;try{return Se(H(D),h,g)}catch{}}}return""}var pe=Object.prototype.hasOwnProperty,He={},Ue=v.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,N,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((N||"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,N,g,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ee){I=ee}I&&!(I instanceof Error)&&(ie(D),x("%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).",N||"React class",g,O,typeof I),ie(null)),I instanceof Error&&!(I.message in He)&&(He[I.message]=!0,ie(D),x("Failed %s type: %s",g,I.message),ie(null))}}}var st=Array.isArray;function Fe(t){return st(t)}function Te(t){{var h=typeof Symbol=="function"&&Symbol.toStringTag,g=h&&t[Symbol.toStringTag]||t.constructor.name||"Object";return g}}function ot(t){try{return Be(t),!1}catch{return!0}}function Be(t){return""+t}function Pe(t){if(ot(t))return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Te(t)),Be(t)}var ge=v.ReactCurrentOwner,Ke={key:!0,ref:!0,__self:!0,__source:!0},we,De,Le;Le={};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 it(t,h){if(typeof t.ref=="string"&&ge.current&&h&&ge.current.stateNode!==h){var g=S(ge.current.type);Le[g]||(x('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',S(ge.current.type),t.ref),Le[g]=!0)}}function Me(t,h){{var g=function(){we||(we=!0,x("%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(){De||(De=!0,x("%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 lt=function(t,h,g,N,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:N}),Object.defineProperty(I,"_source",{configurable:!1,enumerable:!1,writable:!1,value:D}),Object.freeze&&(Object.freeze(I.props),Object.freeze(I)),I};function j(t,h,g,N,D){{var H,O={},I=null,ce=null;g!==void 0&&(Pe(g),I=""+g),qe(h)&&(Pe(h.key),I=""+h.key),Xe(h)&&(ce=h.ref,it(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 re=typeof t=="function"?t.displayName||t.name||"Unknown":t;I&&Me(O,re),ce&&ye(O,re)}return lt(t,I,ce,D,N,ge.current,O)}}var V=v.ReactCurrentOwner,W=v.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 _e(t){return typeof t=="object"&&t!==null&&t.$$typeof===n}function Ge(){{if(V.current){var t=S(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 ua(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 Rt={};function da(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 $t(t,h){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var g=da(h);if(Rt[g])return;Rt[g]=!0;var N="";t&&t._owner&&t._owner!==V.current&&(N=" It was passed a child from "+S(t._owner.type)+"."),le(t),x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',g,N),le(null)}}function Tt(t,h){{if(typeof t!="object")return;if(Fe(t))for(var g=0;g<t.length;g++){var N=t[g];_e(N)&&$t(N,h)}else if(_e(t))t._store&&(t._store.validated=!0);else if(t){var D=k(t);if(typeof D=="function"&&D!==t.entries)for(var H=D.call(t),O;!(O=H.next()).done;)_e(O.value)&&$t(O.value,h)}}}function fa(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===y))g=h.propTypes;else return;if(g){var N=S(h);Ne(g,t.props,"prop",N,t)}else if(h.PropTypes!==void 0&&!de){de=!0;var D=S(h);x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",D||"Unknown")}typeof h.getDefaultProps=="function"&&!h.getDefaultProps.isReactClassApproved&&x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ha(t){{for(var h=Object.keys(t.props),g=0;g<h.length;g++){var N=h[g];if(N!=="children"&&N!=="key"){le(t),x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",N),le(null);break}}t.ref!==null&&(le(t),x("Invalid attribute `ref` supplied to `React.Fragment`."),le(null))}}var Pt={};function It(t,h,g,N,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=ua(D);ce?I+=ce:I+=Ge();var ee;t===null?ee="null":Fe(t)?ee="array":t!==void 0&&t.$$typeof===n?(ee="<"+(S(t.type)||"Unknown")+" />",I=" Did you accidentally export a JSX literal instead of a component?"):ee=typeof t,x("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 re=j(t,h,g,D,H);if(re==null)return re;if(O){var ve=h.children;if(ve!==void 0)if(N)if(Fe(ve)){for(var Ie=0;Ie<ve.length;Ie++)Tt(ve[Ie],t);Object.freeze&&Object.freeze(ve)}else x("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 Tt(ve,t)}if(pe.call(h,"key")){var Ee=S(t),fe=Object.keys(h).filter(function(ya){return ya!=="key"}),ct=fe.length>0?"{key: someKey, "+fe.join(": ..., ")+": ...}":"{key: someKey}";if(!Pt[Ee+ct]){var ba=fe.length>0?"{"+fe.join(": ..., ")+": ...}":"{}";x(`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,ga,Ee),Pt[Ee+lt]=!0}}return t===o?da(re):ua(re),re}}function fa(t,m,g){return Tt(t,m,g,!0)}function ma(t,m,g){return Tt(t,m,g,!1)}var ha=ma,pa=fa;ze.Fragment=o,ze.jsx=ha,ze.jsxs=pa}()),ze}process.env.NODE_ENV==="production"?Je.exports=zt():Je.exports=Ft();var s=Je.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((a,o)=>e+o+1).filter(a=>a>0)}function Dt(e,n,a){return e>=a?[]:dt(e+1,e+n)}function Lt(e,n){return e<=1?[]:dt(e-1-n,e-1)}function Bt(e,n,a){if(!e)return s.jsx(s.Fragment,{});if(typeof e=="string")return s.jsx("p",{className:a,children:e});const o=e;return s.jsx("p",{className:a,children:s.jsx(o,{color:"var(--secondary-600)",size:n,strokeWidth:2.5})})}function Mt(e){const{variant:n="ghost",scheme:a="primary",size:o="md",leftIcon:i,rightIcon:c,className:f="",children:u,...d}=e,h={md:12,lg:14}[o],b=`arkyn_badge ${n} ${a} ${o} ${f}`;return s.jsxs("div",{className:b.trim(),...d,children:[Ae(h,i),u,Ae(h,i)]})}function At(e){const{className:n,orientation:a="horizontal",...o}=e,i=`arkyn_divider ${a} ${n}`;return s.jsx("div",{className:i,...o})}function Vt(e){const{className:n,...a}=e,o=`arkyn_skeleton ${n}`;return s.jsx("aside",{className:o.trim(),...a})}function Wt(e){const{className:n,...a}=e,o=`arkyn_table_body ${n}`;return s.jsx("tbody",{className:o.trim(),...a})}function Yt(e){const{className:n,children:a,...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:a})})}function Ht(e){const{children:n,className:a,...o}=e,i=`arkyn_table_container ${a}`;return s.jsx("div",{className:i.trim(),...o,children:s.jsx("table",{children:n})})}function Ut(e){const{className:n,children:a,...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:a})})})]})}function Kt(e){const{className:n,children:a,...o}=e,i=`arkyn_table_header ${n}`;return s.jsxs("thead",{className:i.trim(),...o,children:[s.jsx("tr",{children:a}),s.jsx("tr",{className:"spacing-row"})]})}function Xt(e){const{isLoading:n=!1,scheme:a="primary",variant:o="solid",loadingText:i,size:c="md",leftIcon:f,rightIcon:u,disabled:d,className:p="",children:h,...b}=e,v={xs:12,sm:16,md:20,lg:24}[c],N=`arkyn_button loading_text_${!!i} ${o} ${a} ${c} loading_${n} ${p}`;return s.jsxs("button",{className:N,disabled:d||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,f),h,Ae(v,u)]})]})}const ft=l.createContext({});function qt(e){var h,b;const n=Re.useActionData(),{children:a,className:o,...i}=e,c=l.useRef(null),f=((h=c.current)==null?void 0:h.name)||"",u=((b=n==null?void 0:n.fieldErrors)==null?void 0:b[f])||null,d=l.useId(),p=`arkyn_form_controller ${o}`;return s.jsx(ft.Provider,{value:{error:u,id:d,inputRef:c},children:s.jsx("section",{className:p.trim(),...i,children:a})})}function be(){return l.useContext(ft)}function Gt(e){const{name:n,className:a="",size:o="md",isError:i,defaultChecked:c=!1,checked:f=null,onCheck:u,value:d,...p}=e,{id:h,inputRef:b,error:r}=be(),v=i||!!r,[N,w]=l.useState(c||!1),j=typeof f=="boolean"?f:N,y=`arkyn_checkbox ${o} ${v?"error":""} ${j?"checked":""} ${a}`;function k(){const L=N;w(!L),u&&u(L?"":d||"checked")}return s.jsxs("button",{type:"button",id:h,className:y,onClick:k,...p,children:[s.jsx("input",{type:"hidden",name:n,ref:b,value:j?d||"checked":""}),s.jsx(Q.Check,{})]})}function Jt(e){const{children:n,className:a,...o}=e,i=`arkyn_form_error ${a}`,{error:c}=be();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 Zt(e){const{showAsterisk:n=!1,className:a="",...o}=e,{id:i}=be(),f=`arkyn_form_label ${n?"show-asterisk":""} ${a}`;return s.jsx("label",{...o,className:f.trim(),htmlFor:i})}function Qt(e){const{isLoading:n=!1,scheme:a="primary",variant:o="solid",size:i="md",icon:c,disabled:f,className:u="",...d}=e,p={xs:12,sm:16,md:20,lg:24},h=`arkyn_icon_button ${o} ${a} ${i} loading_${n} ${u}`;return s.jsxs("button",{disabled:f||n,className:h.trim(),...d,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,a){if(!e)return s.jsx(s.Fragment,{});if(typeof e=="string")return s.jsx("p",{className:a,children:e});const o=e;return s.jsx("p",{className:a,children:s.jsx(o,{color:"var(--secondary-600)",size:n,strokeWidth:2.5})})}function Ze(e){return e&&e.replace(/[^0-9]/g,"")}function mt(e,n){let a="",o=0;return Array.from(e).forEach((i,c)=>{n[c+o].match(/[0-9]/)||(a+=n[c+o],o++),a+=i}),a}function ht(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:a,isError:o,size:i="md",className:c="",variant:f="solid",prefix:u,sufix:d,leftIcon:p,rightIcon:h,disabled:b,defaultValue:r,readOnly:v,onFocus:N,onBlur:w,title:j,style:y,onChange:k,...L}=e;function F(X){let M=Ze(X);const q=ht(M);if(!(M.length>pt))return M=mt(M,Qe[q]),M}const T=h?"right":"left",z=`arkyn_input ${u?"hasPrefix":""} ${d?"hasSufix":""} ${f} ${i} ${b||v||a?"opacity":""} ${o?"errored":""} ${n?"focused":""} ${c}`,S={md:20,lg:20}[i];return{isLoading:a,className:z,prefix:ke(u,S,"prefix"),sufix:ke(d,S,"sufix"),LeftIcon:p,RightIcon:h,defaultValue:F(r||""),disabled:b,readOnly:v,onFocus:N,onBlur:w,title:j,style:y,onChange:k,loadingPosition:T,iconSize:S,Spinner:s.jsx(Q.Loader2,{className:"spinner",size:S,strokeWidth:2.5}),...L}}function tn(e){const[n,a]=l.useState(!1),o=l.useRef(null),{inputRef:i,id:c,error:f}=be(),u=i||o,d=e.isError||!!f,{disabled:p,title:h,style:b,className:r,prefix:v,sufix:N,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,S]=l.useState(K),X=k&&!y,M=Y&&!y,q=j==="left"&&y,ne=j==="right"&&y;function $(){p||!(u!=null&&u.current)||(a(!0),u.current.focus())}function ae(E){let P=Ze(E.target.value);const J=ht(P);P.length>pt||(P=mt(P,Qe[J]),E.target.value=P,S(P),G&&G(E))}function ue(E){a(!0),F&&F(E)}function R(E){a(!1),T&&T(E)}return s.jsxs("section",{title:h,style:b,onClick:$,className:r,children:[v,q&&B,X&&s.jsx(k,{size:w,strokeWidth:2.5}),s.jsx("input",{disabled:p||y,readOnly:L,ref:u,value:U||te,onFocus:ue,onChange:ae,onBlur:R,...z}),M&&s.jsx(Y,{size:w,strokeWidth:2.5}),ne&&B,N]})}const nn=3,an=(e="pt-BR",n,a="BRL",o=!0)=>new Intl.NumberFormat(e,{style:"currency",currency:a,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,a)=>{if(!n)return[0,""];const o=et(n),i=an(e,o,a);return[o,i]};function rn(e,n){const{isLoading:a,isError:o,size:i="md",className:c="",variant:f="solid",prefix:u,sufix:d,leftIcon:p,rightIcon:h,disabled:b,readOnly:r,onFocus:v,onBlur:N,title:w,style:j,max:y=1e9,locale:k="pt-BR",currency:L="BRL",...F}=e,T=h?"right":"left",z=`arkyn_input ${u?"hasPrefix":""} ${d?"hasSufix":""} ${f} ${i} ${b||r||a?"opacity":""} ${o?"errored":""} ${n?"focused":""} ${c}`,S={md:20,lg:20}[i];return{isLoading:a,className:z,prefix:ke(u,S,"prefix"),sufix:ke(d,S,"sufix"),LeftIcon:p,RightIcon:h,disabled:b,locale:k,currency:L,readOnly:r,onFocus:v,onBlur:N,title:w,style:j,max:y,loadingPosition:T,iconSize:S,Spinner:s.jsx(Q.Loader2,{className:"spinner",size:S,strokeWidth:2.5}),...F}}function sn(e){const[n,a]=l.useState(!1),[o,i]=l.useState("0"),c=l.useRef(null),{inputRef:f,id:u,error:d}=be(),p=f||c,h=e.isError||!!d,{disabled:b,title:r,style:v,className:N,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:S,currency:X,locale:M,name:q,defaultValue:ne,...$}=rn({...e,id:u,isError:h},n),ae=F&&!L,ue=G&&!L,R=k==="left"&&L,E=k==="right"&&L;function P(){b||!(p!=null&&p.current)||(a(!0),p.current.focus())}function J(Z){a(!0),Y&&Y(Z)}function se(Z){a(!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))},he=Z=>S&&S(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:r,style:v,onClick:P,className:N,children:[w,R&&U,ae&&s.jsx(F,{size:y,strokeWidth:2.5}),s.jsx("input",{value:o,onChange:xe,onBlur:se,onFocus:J,onKeyUp:he,disabled:b||L,readOnly:T,ref:p,...$}),s.jsx("input",{type:"hidden",name:q,value:et(o)}),E&&U,ue&&s.jsx(G,{size:y,strokeWidth:2.5}),j]})}function on(e,n){const{isLoading:a,isError:o,size:i="md",className:c="",variant:f="solid",prefix:u,sufix:d,leftIcon:p,rightIcon:h,disabled:b,readOnly:r,onFocus:v,onBlur:N,title:w,style:j,onChange:y,showMask:k=!1,type:L,...F}=e,T=h?"right":"left",z=`arkyn_input ${u?"hasPrefix":""} ${d?"hasSufix":""} ${f} ${i} ${b||r||a?"opacity":""} ${o?"errored":""} ${n?"focused":""} ${c}`,S={md:20,lg:20}[i];return{isLoading:a,className:z,prefix:ke(u,S,"prefix"),sufix:ke(d,S,"sufix"),LeftIcon:p,RightIcon:h,disabled:b,readOnly:r,onFocus:v,onBlur:N,title:w,style:j,onChange:y,loadingPosition:T,iconSize:S,showMask:k,Spinner:s.jsx(Q.Loader2,{className:"spinner",size:S,strokeWidth:2.5}),...F}}const ln=l.forwardRef((e,n)=>s.jsx("input",{ref:n,...e}));function cn(e){const[n,a]=l.useState(!1),o=l.useRef(null),{inputRef:i,id:c,error:f}=be(),u=i||o,d=e.isError||!!f,{disabled:p,title:h,style:b,className:r,prefix:v,sufix:N,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 S(){p||!(u!=null&&u.current)||(a(!0),u.current.focus())}function X(q){a(!0),F&&F(q)}function M(q){a(!1),T&&T(q)}return s.jsxs("section",{title:h,style:b,onClick:S,className:r,children:[v,z&&B,U&&s.jsx(k,{size:w,strokeWidth:2.5}),s.jsx(It.InputMask,{component:ln,ref:u,onFocus:X,onBlur:M,...G}),K&&s.jsx(Y,{size:w,strokeWidth:2.5}),te&&B,N]})}function un(e,n){const{isLoading:a,isError:o,size:i="md",className:c="",variant:f="solid",prefix:u,sufix:d,leftIcon:p,rightIcon:h,disabled:b,readOnly:r,onFocus:v,onBlur:N,title:w,style:j,onChange:y,...k}=e,L=h?"right":"left",U=`arkyn_input ${u?"hasPrefix":""} ${d?"hasSufix":""} ${f} ${i} ${b||r||a?"opacity":""} ${o?"errored":""} ${n?"focused":""} ${c}`,z={md:20,lg:20}[i];return{isLoading:a,className:U,prefix:ke(u,z,"prefix"),sufix:ke(d,z,"sufix"),LeftIcon:p,RightIcon:h,disabled:b,readOnly:r,onFocus:v,onBlur:N,title:w,style:j,onChange:y,loadingPosition:L,iconSize:z,Spinner:s.jsx(Q.Loader2,{className:"spinner",size:z,strokeWidth:2.5}),...k}}function dn(e){const[n,a]=l.useState(!1),o=l.useRef(null),{inputRef:i,id:c,error:f}=be(),u=i||o,d=e.isError||!!f,{disabled:p,title:h,style:b,className:r,prefix:v,sufix:N,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,S=j==="right"&&y;function X(){p||!(u!=null&&u.current)||(a(!0),u.current.focus())}function M(ne){a(!0),F&&F(ne)}function q(ne){a(!1),T&&T(ne)}return B==="hidden"?s.jsx("input",{style:{display:"none"},readOnly:!0,type:"text",ref:u,...U}):s.jsxs("section",{title:h,style:b,onClick:X,className:r,children:[v,te&&G,K&&s.jsx(k,{size:w,strokeWidth:2.5}),s.jsx("input",{disabled:p||y,readOnly:L,ref:u,onFocus:M,onBlur:q,type:B,...U}),z&&s.jsx(Y,{size:w,strokeWidth:2.5}),S&&G,N]})}function fn(e){return e.type==="currency"?s.jsx(sn,{...e}):e.type==="masked"?s.jsx(cn,{...e}):e.type==="cpf-cnpj"?s.jsx(tn,{...e}):s.jsx(dn,{...e})}const bt=l.createContext({});function mn(){return l.useContext(bt)}function hn(e){const{defaultValue:n,name:a,value:o,onChange:i,size:c="md",className:f,...u}=e,[d,p]=l.useState(n||""),{inputRef:h,id:b}=be();function r(N){p(N),i&&i(N)}const v=`arkyn_radio_group ${c} ${f||""}`;return s.jsxs(bt.Provider,{value:{onChange:r,value:o||d,size:c},children:[s.jsx("input",{style:{display:"none"},type:"text",id:b,readOnly:!0,name:a,ref:h,value:d}),s.jsx("div",{className:v.trim(),...u})]})}function pn(e){const{value:n,size:a,disabled:o,children:i}=e,{onChange:c,size:f,value:u}=mn(),{error:d}=be(),v=`arkyn_radio_box ${a||f} ${u===n?"isChecked":""} ${d?"isErrored":""} ${o?"isDisabled":""}`;return s.jsxs("label",{className:v.trim(),children:[s.jsx("button",{type:"button",disabled:o,onClick:()=>c(n),onFocus:()=>c(n)}),i]})}function gn(e,n){const{isLoading:a,isError:o,size:i="md",className:c="",variant:f="solid",prefix:u,leftIcon:d,disabled:p,readOnly:h,onFocus:b,onBlur:r,title:v,style:N,closeOnSelect:w=!0,...j}=e,T=`arkyn_select ${u?"hasPrefix":""} ${f} ${i} ${p||h||a?"opacity":""} ${o?"errored":""} ${n?"focused":""} ${c}`,B={md:20,lg:20}[i];return{isLoading:a,className:T,prefix:Bt(u,B,"prefix"),LeftIcon:d,disabled:p,readOnly:h,onFocus:b,onBlur:r,title:v,closeOnSelect:w,style:N,iconSize:B,Spinner:s.jsx(Q.Loader2,{className:"spinner",size:B,strokeWidth:2.5}),...j}}function vn(e){var P;const[n,a]=l.useState(!1),{inputRef:o,id:i,error:c}=be(),f=l.useRef(null),u=o||f,d=e.isError||!!c,{disabled:p,title:h,style:b,className:r,prefix:v,iconSize:N,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,...S}=gn({...e,id:i,isError:d},n),[X,M]=l.useState(k);function q(){p||!(u!=null&&u.current)||(a(!0),u.current.focus())}function ne(J){n||(a(!0),F&&F(J))}function $(){a(!1),T&&u.current&&u.current.blur()}function ae(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 s.jsxs(s.Fragment,{children:[s.jsxs("section",{title:h,style:b,onClick:q,className:`${r} placeholder_dark_${E()}`,children:[v,j&&s.jsx(j,{size:N,strokeWidth:2.5}),s.jsx("input",{disabled:p||w,readOnly:!0,placeholder:R||G,onFocus:ne,...S}),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:J,value:se})=>s.jsxs("div",{onClick:()=>ae({label:J,value:se}),className:ue===se?"arkyn_select_option active":"arkyn_select_option",children:[J," ",s.jsx(Q.Check,{})]},se)),K.length<=0&&s.jsx("p",{children:"Sem opções disponíveis"})]}),!w&&s.jsx(Q.ChevronDown,{className:"arkyn_select_arrow",size:N,strokeWidth:2.5}),w&&Y]}),n&&s.jsx("aside",{className:"arkyn_select_overlay",onClick:$})]})}function bn(e){const{variant:n="solid",size:a="md",className:o,disabled:i=!1,readOnly:c=!1,onFocus:f,onBlur:u,title:d,style:p,...h}=e,[b,r]=l.useState(!1),{inputRef:v,id:N,error:w}=be(),j=l.useRef(null),y=v||j,L=e.isError||!!w?"errored":"",Y=`arkyn_textarea ${n} ${a} ${i||c?"opacity":""} ${L} ${b?"focused":""} ${o}`;function B(){i||!(y!=null&&y.current)||(r(!0),y.current.focus())}function G(K){r(!0),f&&f(K)}function U(K){r(!1),u&&u(K)}return s.jsx("section",{title:d,style:p,onClick:B,className:Y,children:s.jsx("textarea",{id:N,disabled:i,readOnly:c,ref:y,onFocus:G,onBlur:U,...h})})}function yn(e){const{className:n="",...a}=e,o=`arkyn_breadcrumb_container ${n}`;return s.jsx("nav",{className:o,...a})}function xn(e){const{pathname:n}=Re.useLocation(),{className:a="",disabled:o=!1,children:i,to:c,...f}=e,d=`arkyn_breadcrumb_link ${n===c?"active":"inactive"} ${a}`;return o?s.jsxs("p",{className:d,children:[s.jsx(Q.ChevronRight,{size:14,strokeWidth:2.5}),i]}):s.jsxs(Re.Link,{to:c,className:d,...f,children:[s.jsx(Q.ChevronRight,{size:14,strokeWidth:2.5}),i]})}function yt(e=""){const n=Re.useLocation(),a=new URLSearchParams(n.search),o=e?`${e}:`:"",i=c=>{Object.entries(c).forEach(([f,u])=>{u===void 0?a.delete(`${o}${f}`):a.set(`${o}${f}`,String(u))})};return{getParam:c=>a.get(`${o}${c}`),getScopedSearch:c=>{i(c);let f=a.toString();return f&&(f="?"+f),f}}}function wn(e){const{scope:n,totalCountRegisters:a,perPageKey:o="per_page",pageKey:i="page",siblingsCount:c=2,...f}=e,u=Re.useNavigate(),{getParam:d,getScopedSearch:p}=yt(n),h=Number(d(i))||1,b=Number(d(o))||20,r=Math.ceil(a/b),v=Lt(h,c),N=Dt(h,c,r);function w(j){u(p({page:j}))}return s.jsxs("div",{className:"arkyn_pagination",...f,children:[s.jsx("button",{className:"arkyn_pagination-icon_button",disabled:h<=1,onClick:()=>w(h-1),children:s.jsx(Q.ChevronLeft,{})}),h>1+c&&s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"arkyn_pagination-page_button",onClick:()=>w(1),children:"1"}),h>2+c&&s.jsx("button",{disabled:!0,className:"arkyn_pagination-spread",children:s.jsx(Q.Ellipsis,{})})]}),v.map((j,y)=>s.jsx("button",{onClick:()=>w(j),className:"arkyn_pagination-page_button",children:j},y)),s.jsx("button",{className:"arkyn_pagination-current",disabled:!0,children:h}),N.map((j,y)=>s.jsx("button",{onClick:()=>w(j),className:"arkyn_pagination-page_button",children:j},y)),h+c<r&&s.jsxs(s.Fragment,{children:[h+1+c<r&&s.jsx("button",{disabled:!0,className:"arkyn_pagination-spread",children:s.jsx(Q.Ellipsis,{})}),s.jsx("button",{className:"arkyn_pagination-page_button",onClick:()=>w(r),children:r})]}),s.jsx("button",{className:"arkyn_pagination-icon_button",disabled:h>=r,onClick:()=>w(h+1),children:s.jsx(Q.ChevronRight,{})})]})}function kn(e){const{children:n,value:a,className:o,defaultActive:i,...c}=e,f=`arkyn_tab_button ${i?"active":""} ${o||""}`;return s.jsx("button",{className:f.trim(),...c,children:n})}function Cn(e){const{children:n,onClick:a,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,r)=>{const v=b.getBoundingClientRect(),N=c.current.getBoundingClientRect();d({transition:r?void 0:"none",width:`${v.width}px`,left:`${v.left-N.left}px`})};l.useLayoutEffect(()=>{const b=c.current;if(!b)return;let r=null;r=b.querySelector("button.active"),r&&p(r)},[]);const h=b=>{const r=b.target,v=c.current;r&&v&&v.contains(r)&&(v.querySelectorAll("button").forEach(w=>w.classList.remove("active")),r.classList.add("active"),p(r,!0),a&&a(r.value))};return s.jsxs("nav",{ref:c,onClick:h,className:f.trim(),...i,children:[n,s.jsx("div",{className:"active-line",style:u})]})}const xt=l.createContext({});function Nn(e){const{isVisibled:n,makeInvisible:a,orientation:o="left",children:i,className:c,...f}=e,u=o==="left"?"-100%":"100%",p=`arkyn_drawer_container ${o} ${n?"visible":""} ${c}`;return s.jsx(xt.Provider,{value:{makeInvisible:a},children:s.jsx(je.AnimatePresence,{children:n&&s.jsxs("aside",{className:p.trim(),...f,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:a}),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 _n(e){const{showCloseButton:n=!0,className:a,children:o,...i}=e,{makeInvisible:c}=l.useContext(xt),f=`arkyn_drawer_header ${a}`;return s.jsxs("header",{className:f.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 wt=l.createContext({});function jn(e){const{isVisibled:n,makeInvisible:a,children:o,className:i="",...c}=e,u=`arkyn_modal_container ${n?"visible":""} ${i}`;return s.jsx(wt.Provider,{value:{makeInvisible:a},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:a}),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 Sn(e){const{alignment:n="right",className:a,...o}=e,i=`arkyn_modal_footer ${n} ${a}`;return s.jsx("footer",{className:i.trim(),...o})}function En(e){const{showCloseButton:n=!0,className:a,children:o,...i}=e,{makeInvisible:c}=l.useContext(wt),f=`arkyn_modal_header ${a}`;return s.jsxs("header",{className:f.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 Rn(e){const{children:n,button:a,closeOnClick:o,orientation:i="bottom-left"}=e,[c,f]=l.useState(!1),u=`arkyn_popover ${i} ${c?"show":""}`;function d(){c||f(!0)}return s.jsxs("div",{className:u,onClick:d,children:[a,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&&f(!1),className:"arkyn_popover-content",children:n}),c&&s.jsx("div",{onClick:()=>f(!1),className:"arkyn_popover-overlay"})]})}function kt(e){const{message:n,title:a,type:o,size:i="lg"}=e,c=`arkyn_toast ${o} ${i}`;function f(){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(f,{})]}),s.jsxs("p",{children:[s.jsx("strong",{title:a,children:a}),s.jsx("span",{children:n})]})]})}function $n(e){const{text:n,size:a="lg",children:o,orientation:i="top",className:c,...f}=e,u=`arkyn_tooltip ${a} ${i} ${c}`;return s.jsxs("div",{className:u.trim(),...f,children:[o,s.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 _t(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:a}=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;_t(o)&&a(o),!_t(o)&&i&&a({message:i,title:"Atenção!",type:"warning"})},[e])}const jt=l.createContext({});function Tn(e){const n=l.useContext(jt);if(Object.entries(n).length===0)throw new Error("useDrawer must be used within a Provider");if(e){const{drawerData:a,drawerIsOpen:o,openDrawer:i,closeDrawer:c}=n,f=o(e),u=a(e);return{drawerIsOpen:f,drawerData:u,openDrawer:h=>i(e,h),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:a,modalIsOpen:o,openModal:i,closeModal:c}=n,f=o(e),u=a(e);return{modalIsOpen:f,modalData:u,openModal:h=>i(e,h),closeModal:()=>c(e)}}else return n}function On(e){const{children:n=!1}=e,[a,o]=l.useState([]);function i(d){return!!a.some(p=>p.key===d)}function c(d){var p;return(p=a.find(h=>h.key===d))==null?void 0:p.data}function f(d,p){const h=i(d);o(h?b=>[...b.filter(v=>v.key!==d),{key:d,data:p}]:[...a,{key:d,data:p}])}function u(d){o(a.filter(p=>p.key!==d))}return s.jsx(jt.Provider,{value:{drawerIsOpen:i,drawerData:c,openDrawer:f,closeDrawer:u},children:n})}function zn(e){const{children:n=!1}=e,[a,o]=l.useState([]);function i(d){return!!a.some(p=>p.key===d)}function c(d){var p;return(p=a.find(h=>h.key===d))==null?void 0:p.data}function f(d,p){const h=i(d);o(h?b=>[...b.filter(v=>v.key!==d),{key:d,data:p}]:[...a,{key:d,data:p}])}function u(d){o(a.filter(p=>p.key!==d))}return s.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,a)=>l.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),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 a=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),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:a,...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:a}),{...u,...e,id:i,dismissible:f,title:a}):u):this.addToast({title:a,...o,dismissible:f,id:i}),i},this.dismiss=e=>(e||this.toasts.forEach(n=>{this.subscribers.forEach(a=>a({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 a;n.loading!==void 0&&(a=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=a!==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:a,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:a,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:a,type:"error",message:f,description:u})}}).finally(()=>{var c;i&&(this.dismiss(a),a=void 0),(c=n.finally)==null||c.call(n)}),a},this.custom=(e,n)=>{let a=(n==null?void 0:n.id)||nt++;return this.create({jsx:e(a),id:a,...n}),a},this.subscribers=[],this.toasts=[]}},me=new Yn,Hn=(e,n)=>{let a=(n==null?void 0:n.id)||nt++;return me.addToast({title:e,...n,id:a}),a},Un=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Kn=Hn,Xn=()=>me.toasts,qn=Object.assign(Kn,{success:me.success,info:me.info,warning:me.warning,error:me.error,custom:me.custom,message:me.message,promise:me.promise,dismiss:me.dismiss,loading:me.loading},{getHistory:Xn});function Gn(e,{insertAt:n}={}){if(!e||typeof document>"u")return;let a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",n==="top"&&a.firstChild?a.insertBefore(o,a.firstChild):a.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,ea=356,ta=14,na=20,aa=200;function ra(...e){return e.filter(Boolean).join(" ")}var sa=e=>{var n,a,o,i,c,f,u,d,p,h;let{invert:b,toast:r,unstyled:v,interacting:N,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:S,position:X,gap:M,loadingIcon:q,expandByDefault:ne,classNames:$,icons:ae,closeButtonAriaLabel:ue="Close toast",pauseWhenPageIsHidden:R,cn:E}=e,[P,J]=l.useState(!1),[se,A]=l.useState(!1),[xe,he]=l.useState(!1),[Z,oe]=l.useState(!1),[Ce,$e]=l.useState(0),[at,Ye]=l.useState(0),Se=l.useRef(null),pe=l.useRef(null),He=k===0,Ue=k+1<=j,ie=r.type,Ne=r.dismissible!==!1,rt=r.className||"",Fe=r.descriptionClassName||"",Pe=l.useMemo(()=>y.findIndex(_=>_.toastId===r.id)||0,[y,r.id]),st=l.useMemo(()=>{var _;return(_=r.closeButton)!=null?_:B},[r.closeButton,B]),De=l.useMemo(()=>r.duration||S||Qn,[r.duration,S]),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((_,V,W)=>W>=Pe?_:_+V.height,0),[y,Pe]),qe=Wn(),ot=r.invert||b,Me=ie==="loading";ge.current=l.useMemo(()=>Pe*M+Xe,[Pe,Xe]),l.useEffect(()=>{J(!0)},[]),l.useLayoutEffect(()=>{if(!P)return;let _=pe.current,V=_.style.height;_.style.height="auto";let W=_.getBoundingClientRect().height;_.style.height=V,Ye(W),w(le=>le.find(de=>de.toastId===r.id)?le.map(de=>de.toastId===r.id?{...de,height:W}:de):[{toastId:r.id,height:W,position:r.position},...le])},[P,r.title,r.description,w,r.id]);let ye=l.useCallback(()=>{A(!0),$e(ge.current),w(_=>_.filter(V=>V.toastId!==r.id)),setTimeout(()=>{T(r)},aa)},[r,T,w,ge]);l.useEffect(()=>{if(r.promise&&ie==="loading"||r.duration===1/0||r.type==="loading")return;let _,V=De;return F||N||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(),_=setTimeout(()=>{var W;(W=r.onAutoClose)==null||W.call(r,r),ye()},V)),()=>clearTimeout(_)},[F,N,ne,r,De,ye,r.promise,ie,R,qe]),l.useEffect(()=>{let _=pe.current;if(_){let V=_.getBoundingClientRect().height;return Ye(V),w(W=>[{toastId:r.id,height:V,position:r.position},...W]),()=>w(W=>W.filter(le=>le.toastId!==r.id))}},[w,r.id]),l.useEffect(()=>{r.delete&&ye()},[ye,r.delete]);function it(){return ae!=null&&ae.loading?l.createElement("div",{className:"sonner-loader","data-visible":ie==="loading"},ae.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":r.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:pe,className:E(z,rt,$==null?void 0:$.toast,(n=r==null?void 0:r.classNames)==null?void 0:n.toast,$==null?void 0:$.default,$==null?void 0:$[ie],(a=r==null?void 0:r.classNames)==null?void 0:a[ie]),"data-sonner-toast":"","data-rich-colors":(o=r.richColors)!=null?o:Y,"data-styled":!(r.jsx||r.unstyled||v),"data-mounted":P,"data-promise":!!r.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":`${at}px`,...G,...r.style},onPointerDown:_=>{Me||!Ne||(Se.current=new Date,$e(ge.current),_.target.setPointerCapture(_.pointerId),_.target.tagName!=="BUTTON"&&(he(!0),we.current={x:_.clientX,y:_.clientY}))},onPointerUp:()=>{var _,V,W,le;if(Z||!Ne)return;we.current=null;let de=Number(((_=pe.current)==null?void 0:_.style.getPropertyValue("--swipe-amount").replace("px",""))||0),_e=new Date().getTime()-((V=Se.current)==null?void 0:V.getTime()),Ge=Math.abs(de)/_e;if(Math.abs(de)>=na||Ge>.11){$e(ge.current),(W=r.onDismiss)==null||W.call(r,r),ye(),oe(!0);return}(le=pe.current)==null||le.style.setProperty("--swipe-amount","0px"),he(!1)},onPointerMove:_=>{var V;if(!we.current||!Ne)return;let W=_.clientY-we.current.y,le=_.clientX-we.current.x,de=(Le==="top"?Math.min:Math.max)(0,W),_e=_.pointerType==="touch"?10:2;Math.abs(de)>_e?(V=pe.current)==null||V.style.setProperty("--swipe-amount",`${W}px`):Math.abs(le)>_e&&(we.current=null)}},st&&!r.jsx?l.createElement("button",{"aria-label":ue,"data-disabled":Me,"data-close-button":!0,onClick:Me||!Ne?()=>{}:()=>{var _;ye(),(_=r.onDismiss)==null||_.call(r,r)},className:E($==null?void 0:$.closeButton,(i=r==null?void 0:r.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,r.jsx||l.isValidElement(r.title)?r.jsx||r.title:l.createElement(l.Fragment,null,ie||r.icon||r.promise?l.createElement("div",{"data-icon":"",className:E($==null?void 0:$.icon,(c=r==null?void 0:r.classNames)==null?void 0:c.icon)},r.promise||r.type==="loading"&&!r.icon?r.icon||it():null,r.type!=="loading"?r.icon||(ae==null?void 0:ae[ie])||Fn(ie):null):null,l.createElement("div",{"data-content":"",className:E($==null?void 0:$.content,(f=r==null?void 0:r.classNames)==null?void 0:f.content)},l.createElement("div",{"data-title":"",className:E($==null?void 0:$.title,(u=r==null?void 0:r.classNames)==null?void 0:u.title)},r.title),r.description?l.createElement("div",{"data-description":"",className:E(te,Fe,$==null?void 0:$.description,(d=r==null?void 0:r.classNames)==null?void 0:d.description)},r.description):null),l.isValidElement(r.cancel)?r.cancel:r.cancel&&We(r.cancel)?l.createElement("button",{"data-button":!0,"data-cancel":!0,style:r.cancelButtonStyle||U,onClick:_=>{var V,W;We(r.cancel)&&Ne&&((W=(V=r.cancel).onClick)==null||W.call(V,_),ye())},className:E($==null?void 0:$.cancelButton,(p=r==null?void 0:r.classNames)==null?void 0:p.cancelButton)},r.cancel.label):null,l.isValidElement(r.action)?r.action:r.action&&We(r.action)?l.createElement("button",{"data-button":!0,"data-action":!0,style:r.actionButtonStyle||K,onClick:_=>{var V,W;We(r.action)&&(_.defaultPrevented||((W=(V=r.action).onClick)==null||W.call(V,_),ye()))},className:E($==null?void 0:$.actionButton,(h=r==null?void 0:r.classNames)==null?void 0:h.actionButton)},r.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 oa=e=>{let{invert:n,position:a="bottom-right",hotkey:o=["altKey","KeyT"],expand:i,closeButton:c,className:f,offset:u,theme:d="light",richColors:p,duration:h,style:b,visibleToasts:r=Jn,toastOptions:v,dir:N=St(),gap:w=ta,loadingIcon:j,icons:y,containerAriaLabel:k="Notifications",pauseWhenPageIsHidden:L,cn:F=ra}=e,[T,Y]=l.useState([]),B=l.useMemo(()=>Array.from(new Set([a].concat(T.filter(R=>R.position).map(R=>R.position)))),[T,a]),[G,U]=l.useState([]),[K,z]=l.useState(!1),[te,S]=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),ae=l.useRef(!1),ue=l.useCallback(R=>{var E;(E=T.find(P=>P.id===R.id))!=null&&E.delete||me.dismiss(R.id),Y(P=>P.filter(({id:J})=>J!==R.id))},[T]);return l.useEffect(()=>me.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,ae.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:N==="auto"?St():N,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":`${ea}px`,"--gap":`${w}px`,...b},onBlur:A=>{ae.current&&!A.currentTarget.contains(A.relatedTarget)&&(ae.current=!1,$.current&&($.current.focus({preventScroll:!0}),$.current=null))},onFocus:A=>{A.target instanceof HTMLElement&&A.target.dataset.dismissible==="false"||ae.current||(ae.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"||S(!0)},onPointerUp:()=>S(!1)},T.filter(A=>!A.position&&E===0||A.position===R).map((A,xe)=>{var he,Z;return l.createElement(sa,{key:A.id,icons:y,index:xe,toast:A,defaultRichColors:p,duration:(he=v==null?void 0:v.duration)!=null?he:h,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:n,visibleToasts:r,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 ia({children:e}){function n(a){qn.custom(o=>s.jsx(kt,{...a}))}return s.jsxs(Ct.Provider,{value:{showToast:n},children:[s.jsx(oa,{}),e]})}x.Badge=Mt,x.BreadcrumbContainer=yn,x.BreadcrumbLink=xn,x.Button=Xt,x.Checkbox=Gt,x.Divider=At,x.DrawerContainer=Nn,x.DrawerHeader=_n,x.DrawerProvider=On,x.FormController=qt,x.FormError=Jt,x.FormLabel=Zt,x.IconButton=Qt,x.Input=fn,x.ModalContainer=jn,x.ModalFooter=Sn,x.ModalHeader=En,x.ModalProvider=zn,x.Pagination=wn,x.Popover=Rn,x.RadioBox=pn,x.RadioGroup=hn,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=ia,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"})});
|
32
|
+
<%s key={someKey} {...props} />`,ct,Ee,ba,Ee),Pt[Ee+ct]=!0}}return t===o?ha(re):fa(re),re}}function ma(t,h,g){return It(t,h,g,!0)}function pa(t,h,g){return It(t,h,g,!1)}var ga=pa,va=ma;ze.Fragment=o,ze.jsx=ga,ze.jsxs=va}()),ze}process.env.NODE_ENV==="production"?Je.exports=Ft():Je.exports=Bt();var r=Je.exports;function Ae(e,n){return n?r.jsx(n,{size:e,strokeWidth:2.5}):r.jsx(r.Fragment,{})}function ft(e,n){return[...new Array(n-e)].map((a,o)=>e+o+1).filter(a=>a>0)}function Dt(e,n,a){return e>=a?[]:ft(e+1,e+n)}function Lt(e,n){return e<=1?[]:ft(e-1-n,e-1)}function Mt(e,n,a){if(!e)return r.jsx(r.Fragment,{});if(typeof e=="string")return r.jsx("p",{className:a,children:e});const o=e;return r.jsx("p",{className:a,children:r.jsx(o,{color:"var(--secondary-600)",size:n,strokeWidth:2.5})})}function At(e){const{variant:n="ghost",scheme:a="primary",size:o="md",leftIcon:i,rightIcon:c,className:f="",children:u,...d}=e,m={md:12,lg:14}[o],y=`arkyn_badge ${n} ${a} ${o} ${f}`;return r.jsxs("div",{className:y.trim(),...d,children:[Ae(m,i),u,Ae(m,i)]})}function Vt(e){const{className:n,orientation:a="horizontal",...o}=e,i=`arkyn_divider ${a} ${n}`;return r.jsx("div",{className:i,...o})}function Wt(e){const{className:n,...a}=e,o=`arkyn_skeleton ${n}`;return r.jsx("aside",{className:o.trim(),...a})}function Yt(e){const{className:n,...a}=e,o=`arkyn_table_body ${n}`;return r.jsx("tbody",{className:o.trim(),...a})}function Ht(e){const{className:n,children:a,...o}=e,i=`arkyn_table_caption ${n}`;return r.jsx("caption",{className:i.trim(),...o,children:r.jsx("div",{className:"arkyn_table_caption-content",children:a})})}function Ut(e){const{children:n,className:a,...o}=e,i=`arkyn_table_container ${a}`;return r.jsx("div",{className:i.trim(),...o,children:r.jsx("table",{children:n})})}function Kt(e){const{className:n,children:a,...o}=e,i=`arkyn_table_footer ${n}`;return r.jsxs("tfoot",{className:i.trim(),...o,children:[r.jsx("tr",{className:"spacing-row"}),r.jsx("tr",{children:r.jsx("th",{colSpan:100,children:r.jsx("div",{className:"arkyn_table_footer-content",children:a})})})]})}function Xt(e){const{className:n,children:a,...o}=e,i=`arkyn_table_header ${n}`;return r.jsxs("thead",{className:i.trim(),...o,children:[r.jsx("tr",{children:a}),r.jsx("tr",{className:"spacing-row"})]})}function qt(e){const{isLoading:n=!1,scheme:a="primary",variant:o="solid",loadingText:i,size:c="md",leftIcon:f,rightIcon:u,disabled:d,className:p="",children:m,...y}=e,b={xs:12,sm:16,md:20,lg:24}[c],_=`arkyn_button loading_text_${!!i} ${o} ${a} ${c} loading_${n} ${p}`;return r.jsxs("button",{className:_,disabled:d||n,...y,children:[r.jsxs("div",{className:"arkyn_button-spinner",children:[r.jsx(Q.Loader2,{size:b,strokeWidth:2.5}),i&&i]}),r.jsxs("div",{className:"arkyn_button-content",children:[Ae(b,f),m,Ae(b,u)]})]})}const ht=l.createContext({});function Gt(e){var m,y;const n=Re.useActionData(),{children:a,className:o,...i}=e,c=l.useRef(null),f=((m=c.current)==null?void 0:m.name)||"",u=((y=n==null?void 0:n.fieldErrors)==null?void 0:y[f])||null,d=l.useId(),p=`arkyn_form_controller ${o}`;return r.jsx(ht.Provider,{value:{error:u,id:d,inputRef:c},children:r.jsx("section",{className:p.trim(),...i,children:a})})}function be(){return l.useContext(ht)}function Jt(e){const{name:n,className:a="",size:o="md",isError:i,defaultChecked:c=!1,checked:f=null,onCheck:u,value:d,...p}=e,{id:m,inputRef:y,error:s}=be(),b=i||!!s,[_,C]=l.useState(c||!1),k=typeof f=="boolean"?f:_,v=`arkyn_checkbox ${o} ${b?"error":""} ${k?"checked":""} ${a}`;function x(){const F=_;C(!F),u&&u(F?"":d||"checked")}return r.jsxs("button",{type:"button",id:m,className:v,onClick:x,...p,children:[r.jsx("input",{type:"hidden",name:n,ref:y,value:k?d||"checked":""}),r.jsx(Q.Check,{})]})}function Zt(e){const{children:n,className:a,...o}=e,i=`arkyn_form_error ${a}`,{error:c}=be();return n?r.jsx("strong",{className:i.trim(),...o,children:n}):c?r.jsx("strong",{className:i.trim(),...o,children:c}):r.jsx(r.Fragment,{})}function Qt(e){const{showAsterisk:n=!1,className:a="",...o}=e,{id:i}=be(),f=`arkyn_form_label ${n?"show-asterisk":""} ${a}`;return r.jsx("label",{...o,className:f.trim(),htmlFor:i})}function en(e){const{isLoading:n=!1,scheme:a="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} ${a} ${i} loading_${n} ${u}`;return r.jsxs("button",{disabled:f||n,className:m.trim(),...d,children:[r.jsx("div",{className:"arkyn_icon_button-spinner",children:r.jsx(Q.Loader2,{size:p[i],strokeWidth:2.5})}),r.jsx("div",{className:"arkyn_icon_button-content",children:r.jsx(c,{size:p[i],strokeWidth:2.5})})]})}function Ce(e,n,a){if(!e)return r.jsx(r.Fragment,{});if(typeof e=="string")return r.jsx("p",{className:a,children:e});const o=e;return r.jsx("p",{className:a,children:r.jsx(o,{color:"var(--secondary-600)",size:n,strokeWidth:2.5})})}function Ze(e){return e&&e.replace(/[^0-9]/g,"")}function mt(e,n){let a="",o=0;return Array.from(e).forEach((i,c)=>{n[c+o].match(/[0-9]/)||(a+=n[c+o],o++),a+=i}),a}function pt(e){return e.length>11?"CNPJ":"CPF"}const Qe={CPF:"999.999.999-999",CNPJ:"99.999.999/9999-99"},gt=Ze(Qe.CNPJ).length;function tn(e,n){const{isLoading:a,isError:o,size:i="md",className:c="",variant:f="solid",prefix:u,sufix:d,leftIcon:p,rightIcon:m,disabled:y,defaultValue:s,readOnly:b,onFocus:_,onBlur:C,title:k,style:v,onChange:x,...F}=e;function z(X){let M=Ze(X);const q=pt(M);if(!(M.length>gt))return M=mt(M,Qe[q]),M}const P=m?"right":"left",B=`arkyn_input ${u?"hasPrefix":""} ${d?"hasSufix":""} ${f} ${i} ${y||b||a?"opacity":""} ${o?"errored":""} ${n?"focused":""} ${c}`,S={md:20,lg:20}[i];return{isLoading:a,className:B,prefix:Ce(u,S,"prefix"),sufix:Ce(d,S,"sufix"),LeftIcon:p,RightIcon:m,defaultValue:z(s||""),disabled:y,readOnly:b,onFocus:_,onBlur:C,title:k,style:v,onChange:x,loadingPosition:P,iconSize:S,Spinner:r.jsx(Q.Loader2,{className:"spinner",size:S,strokeWidth:2.5}),...F}}function nn(e){const[n,a]=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:y,className:s,prefix:b,sufix:_,iconSize:C,loadingPosition:k,isLoading:v,LeftIcon:x,readOnly:F,onFocus:z,onBlur:P,RightIcon:Y,Spinner:L,onChange:G,value:U,defaultValue:K,...B}=tn({...e,id:c,isError:d},n),[te,S]=l.useState(K),X=x&&!v,M=Y&&!v,q=k==="left"&&v,ne=k==="right"&&v;function $(){p||!(u!=null&&u.current)||(a(!0),u.current.focus())}function ae(E){let T=Ze(E.target.value);const J=pt(T);T.length>gt||(T=mt(T,Qe[J]),E.target.value=T,S(T),G&&G(E))}function ue(E){a(!0),z&&z(E)}function R(E){a(!1),P&&P(E)}return r.jsxs("section",{title:m,style:y,onClick:$,className:s,children:[b,q&&L,X&&r.jsx(x,{size:C,strokeWidth:2.5}),r.jsx("input",{disabled:p||v,readOnly:F,ref:u,value:U||te,onFocus:ue,onChange:ae,onBlur:R,...B}),M&&r.jsx(Y,{size:C,strokeWidth:2.5}),ne&&L,_]})}const an=3,rn=(e="pt-BR",n,a="BRL",o=!0)=>new Intl.NumberFormat(e,{style:"currency",currency:a,currencyDisplay:"symbol",minimumFractionDigits:2,maximumFractionDigits:2}).format(n).slice(o?an:0),Ve=2,vt=e=>typeof e=="number"?e:Number(e.toString().replace(/[^0-9-]/g,"")),et=e=>{let n=e;return typeof e=="string"?(n=vt(e),n%1!==0&&(n=n.toFixed(Ve))):n=Number.isInteger(e)?Number(e)*10**Ve:e.toFixed(Ve),vt(n)/10**Ve},bt=(e,n,a)=>{if(!n)return[0,""];const o=et(n),i=rn(e,o,a);return[o,i]};function sn(e,n){const{isLoading:a,isError:o,size:i="md",className:c="",variant:f="solid",prefix:u,sufix:d,leftIcon:p,rightIcon:m,disabled:y,readOnly:s,onFocus:b,onBlur:_,title:C,style:k,max:v=1e9,locale:x="pt-BR",currency:F="BRL",...z}=e,P=m?"right":"left",B=`arkyn_input ${u?"hasPrefix":""} ${d?"hasSufix":""} ${f} ${i} ${y||s||a?"opacity":""} ${o?"errored":""} ${n?"focused":""} ${c}`,S={md:20,lg:20}[i];return{isLoading:a,className:B,prefix:Ce(u,S,"prefix"),sufix:Ce(d,S,"sufix"),LeftIcon:p,RightIcon:m,disabled:y,locale:x,currency:F,readOnly:s,onFocus:b,onBlur:_,title:C,style:k,max:v,loadingPosition:P,iconSize:S,Spinner:r.jsx(Q.Loader2,{className:"spinner",size:S,strokeWidth:2.5}),...z}}function on(e){const[n,a]=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:y,title:s,style:b,className:_,prefix:C,sufix:k,iconSize:v,loadingPosition:x,isLoading:F,LeftIcon:z,readOnly:P,onFocus:Y,onBlur:L,RightIcon:G,Spinner:U,value:K,max:B,onChangeValue:te,onKeyPress:S,currency:X,locale:M,name:q,defaultValue:ne,...$}=sn({...e,id:u,isError:m},n),ae=z&&!F,ue=G&&!F,R=x==="left"&&F,E=x==="right"&&F;function T(){y||!(p!=null&&p.current)||(a(!0),p.current.focus())}function J(Z){a(!0),Y&&Y(Z)}function se(Z){a(!1),L&&L(Z)}const A=Z=>{const[oe,ke]=bt(M,Z,X);return!B||oe<=B?(i(ke),[oe,ke]):[et(o),o]},xe=Z=>{Z.preventDefault();const[oe,ke]=A(Z.target.value);te(Z,String(oe),String(ke))},me=Z=>S&&S(Z,Z.key,Z.key);return l.useEffect(()=>{const Z=K||ne||void 0,[,oe]=bt(M,Z,X);i(oe)},[X,ne,K]),r.jsxs("section",{title:s,style:b,onClick:T,className:_,children:[C,R&&U,ae&&r.jsx(z,{size:v,strokeWidth:2.5}),r.jsx("input",{value:o,onChange:xe,onBlur:se,onFocus:J,onKeyUp:me,disabled:y||F,readOnly:P,ref:p,...$}),r.jsx("input",{type:"hidden",name:q,value:et(o)}),E&&U,ue&&r.jsx(G,{size:v,strokeWidth:2.5}),k]})}function ln(e,n){const{isLoading:a,isError:o,size:i="md",className:c="",variant:f="solid",prefix:u,sufix:d,leftIcon:p,rightIcon:m,disabled:y,readOnly:s,onFocus:b,onBlur:_,title:C,style:k,onChange:v,showMask:x=!1,type:F,...z}=e,P=m?"right":"left",B=`arkyn_input ${u?"hasPrefix":""} ${d?"hasSufix":""} ${f} ${i} ${y||s||a?"opacity":""} ${o?"errored":""} ${n?"focused":""} ${c}`,S={md:20,lg:20}[i];return{isLoading:a,className:B,prefix:Ce(u,S,"prefix"),sufix:Ce(d,S,"sufix"),LeftIcon:p,RightIcon:m,disabled:y,readOnly:s,onFocus:b,onBlur:_,title:C,style:k,onChange:v,loadingPosition:P,iconSize:S,showMask:x,Spinner:r.jsx(Q.Loader2,{className:"spinner",size:S,strokeWidth:2.5}),...z}}const cn=l.forwardRef((e,n)=>r.jsx("input",{ref:n,...e}));function un(e){const[n,a]=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:y,className:s,prefix:b,sufix:_,iconSize:C,loadingPosition:k,isLoading:v,LeftIcon:x,readOnly:F,onFocus:z,onBlur:P,RightIcon:Y,Spinner:L,...G}=ln({...e,id:c,isError:d},n),U=x&&!v,K=Y&&!v,B=k==="left"&&v,te=k==="right"&&v;function S(){p||!(u!=null&&u.current)||(a(!0),u.current.focus())}function X(q){a(!0),z&&z(q)}function M(q){a(!1),P&&P(q)}return r.jsxs("section",{title:m,style:y,onClick:S,className:s,children:[b,B&&L,U&&r.jsx(x,{size:C,strokeWidth:2.5}),r.jsx(Ot.InputMask,{component:cn,ref:u,onFocus:X,onBlur:M,...G}),K&&r.jsx(Y,{size:C,strokeWidth:2.5}),te&&L,_]})}function dn(e,n){const{isLoading:a,isError:o,size:i="md",className:c="",variant:f="solid",prefix:u,sufix:d,leftIcon:p,rightIcon:m,disabled:y,readOnly:s,onFocus:b,onBlur:_,title:C,style:k,onChange:v,...x}=e,F=m?"right":"left",U=`arkyn_input ${u?"hasPrefix":""} ${d?"hasSufix":""} ${f} ${i} ${y||s||a?"opacity":""} ${o?"errored":""} ${n?"focused":""} ${c}`,B={md:20,lg:20}[i];return{isLoading:a,className:U,prefix:Ce(u,B,"prefix"),sufix:Ce(d,B,"sufix"),LeftIcon:p,RightIcon:m,disabled:y,readOnly:s,onFocus:b,onBlur:_,title:C,style:k,onChange:v,loadingPosition:F,iconSize:B,Spinner:r.jsx(Q.Loader2,{className:"spinner",size:B,strokeWidth:2.5}),...x}}function fn(e){const[n,a]=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:y,className:s,prefix:b,sufix:_,iconSize:C,loadingPosition:k,isLoading:v,LeftIcon:x,readOnly:F,onFocus:z,onBlur:P,RightIcon:Y,type:L,Spinner:G,...U}=dn({...e,id:c,isError:d},n),K=x&&!v,B=Y&&!v,te=k==="left"&&v,S=k==="right"&&v;function X(){p||!(u!=null&&u.current)||(a(!0),u.current.focus())}function M(ne){a(!0),z&&z(ne)}function q(ne){a(!1),P&&P(ne)}return L==="hidden"?r.jsx("input",{style:{display:"none"},readOnly:!0,type:"text",ref:u,...U}):r.jsxs("section",{title:m,style:y,onClick:X,className:s,children:[b,te&&G,K&&r.jsx(x,{size:C,strokeWidth:2.5}),r.jsx("input",{disabled:p||v,readOnly:F,ref:u,onFocus:M,onBlur:q,type:L,...U}),B&&r.jsx(Y,{size:C,strokeWidth:2.5}),S&&G,_]})}function hn(e){return e.type==="currency"?r.jsx(on,{...e}):e.type==="masked"?r.jsx(un,{...e}):e.type==="cpf-cnpj"?r.jsx(nn,{...e}):r.jsx(fn,{...e})}const yt=l.createContext({});function mn(){return l.useContext(yt)}function pn(e){const{defaultValue:n,name:a,value:o,onChange:i,size:c="md",className:f,...u}=e,[d,p]=l.useState(n||""),{inputRef:m,id:y}=be();function s(_){p(_),i&&i(_)}const b=`arkyn_radio_group ${c} ${f||""}`;return r.jsxs(yt.Provider,{value:{onChange:s,value:o||d,size:c},children:[r.jsx("input",{style:{display:"none"},type:"text",id:y,readOnly:!0,name:a,ref:m,value:d}),r.jsx("div",{className:b.trim(),...u})]})}function gn(e){const{value:n,size:a,disabled:o,children:i}=e,{onChange:c,size:f,value:u}=mn(),{error:d}=be(),b=`arkyn_radio_box ${a||f} ${u===n?"isChecked":""} ${d?"isErrored":""} ${o?"isDisabled":""}`;return r.jsxs("label",{className:b.trim(),children:[r.jsx("button",{type:"button",disabled:o,onClick:()=>c(n),onFocus:()=>c(n)}),i]})}function vn(e,n){const{isLoading:a,isError:o,size:i="md",className:c="",variant:f="solid",prefix:u,leftIcon:d,disabled:p,readOnly:m,onFocus:y,onBlur:s,title:b,style:_,closeOnSelect:C=!0,...k}=e,P=`arkyn_select ${u?"hasPrefix":""} ${f} ${i} ${p||m||a?"opacity":""} ${o?"errored":""} ${n?"focused":""} ${c}`,L={md:20,lg:20}[i];return{isLoading:a,className:P,prefix:Mt(u,L,"prefix"),LeftIcon:d,disabled:p,readOnly:m,onFocus:y,onBlur:s,title:b,closeOnSelect:C,style:_,iconSize:L,Spinner:r.jsx(Q.Loader2,{className:"spinner",size:L,strokeWidth:2.5}),...k}}function bn(e){var T;const[n,a]=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:y,className:s,prefix:b,iconSize:_,isLoading:C,LeftIcon:k,value:v=null,defaultValue:x="",readOnly:F,onFocus:z,onBlur:P,Spinner:Y,name:L,placeholder:G,onSelect:U,options:K,optionMaxHeight:B,closeOnSelect:te,...S}=vn({...e,id:i,isError:d},n),[X,M]=l.useState(x);function q(){p||!(u!=null&&u.current)||(a(!0),u.current.focus())}function ne(J){n||(a(!0),z&&z(J))}function $(){a(!1),P&&u.current&&u.current.blur()}function ae(J){const{label:se,value:A}=J;M(X!==A?A:""),U&&U({label:se,value:A}),te&&$()}const ue=typeof v=="string"?v:X,R=((T=K.find(J=>J.value===ue))==null?void 0:T.label)||"",E=()=>{if(!n&&R)return!0;if(!n&&!R)return!1;if(n&&R)return!0;if(n&&!R)return!1};return r.jsxs(r.Fragment,{children:[r.jsxs("section",{title:m,style:y,onClick:q,className:`${s} placeholder_dark_${E()}`,children:[b,k&&r.jsx(k,{size:_,strokeWidth:2.5}),r.jsx("input",{disabled:p||C,readOnly:!0,placeholder:R||G,onFocus:ne,...S}),r.jsx("input",{type:"hidden",ref:u,name:L,value:ue||"",readOnly:!0}),n&&r.jsxs("div",{className:"arkyn_select_content",style:{overflow:"auto",maxHeight:B},children:[K.map(({label:J,value:se})=>r.jsxs("div",{onClick:()=>ae({label:J,value:se}),className:ue===se?"arkyn_select_option active":"arkyn_select_option",children:[J," ",r.jsx(Q.Check,{})]},se)),K.length<=0&&r.jsx("p",{children:"Sem opções disponíveis"})]}),!C&&r.jsx(Q.ChevronDown,{className:"arkyn_select_arrow",size:_,strokeWidth:2.5}),C&&Y]}),n&&r.jsx("aside",{className:"arkyn_select_overlay",onClick:$})]})}function yn(e){const{variant:n="solid",size:a="md",className:o,disabled:i=!1,readOnly:c=!1,onFocus:f,onBlur:u,title:d,style:p,...m}=e,[y,s]=l.useState(!1),{inputRef:b,id:_,error:C}=be(),k=l.useRef(null),v=b||k,F=e.isError||!!C?"errored":"",Y=`arkyn_textarea ${n} ${a} ${i||c?"opacity":""} ${F} ${y?"focused":""} ${o}`;function L(){i||!(v!=null&&v.current)||(s(!0),v.current.focus())}function G(K){s(!0),f&&f(K)}function U(K){s(!1),u&&u(K)}return r.jsx("section",{title:d,style:p,onClick:L,className:Y,children:r.jsx("textarea",{id:_,disabled:i,readOnly:c,ref:v,onFocus:G,onBlur:U,...m})})}function xn(e){const{className:n="",...a}=e,o=`arkyn_breadcrumb_container ${n}`;return r.jsx("nav",{className:o,...a})}function wn(e){const{pathname:n}=Re.useLocation(),{className:a="",disabled:o=!1,children:i,to:c,...f}=e,d=`arkyn_breadcrumb_link ${n===c?"active":"inactive"} ${a}`;return o?r.jsxs("p",{className:d,children:[r.jsx(Q.ChevronRight,{size:14,strokeWidth:2.5}),i]}):r.jsxs(Re.Link,{to:c,className:d,...f,children:[r.jsx(Q.ChevronRight,{size:14,strokeWidth:2.5}),i]})}function xt(e=""){const n=Re.useLocation(),a=new URLSearchParams(n.search),o=e?`${e}:`:"",i=c=>{Object.entries(c).forEach(([f,u])=>{u===void 0?a.delete(`${o}${f}`):a.set(`${o}${f}`,String(u))})};return{getParam:c=>a.get(`${o}${c}`),getScopedSearch:c=>{i(c);let f=a.toString();return f&&(f="?"+f),f}}}function Cn(e){const{scope:n,totalCountRegisters:a,perPageKey:o="per_page",pageKey:i="page",siblingsCount:c=2,...f}=e,u=Re.useNavigate(),{getParam:d,getScopedSearch:p}=xt(n),m=Number(d(i))||1,y=Number(d(o))||20,s=Math.ceil(a/y),b=Lt(m,c),_=Dt(m,c,s);function C(k){u(p({page:k}))}return r.jsxs("div",{className:"arkyn_pagination",...f,children:[r.jsx("button",{className:"arkyn_pagination-icon_button",disabled:m<=1,onClick:()=>C(m-1),children:r.jsx(Q.ChevronLeft,{})}),m>1+c&&r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"arkyn_pagination-page_button",onClick:()=>C(1),children:"1"}),m>2+c&&r.jsx("button",{disabled:!0,className:"arkyn_pagination-spread",children:r.jsx(Q.Ellipsis,{})})]}),b.map((k,v)=>r.jsx("button",{onClick:()=>C(k),className:"arkyn_pagination-page_button",children:k},v)),r.jsx("button",{className:"arkyn_pagination-current",disabled:!0,children:m}),_.map((k,v)=>r.jsx("button",{onClick:()=>C(k),className:"arkyn_pagination-page_button",children:k},v)),m+c<s&&r.jsxs(r.Fragment,{children:[m+1+c<s&&r.jsx("button",{disabled:!0,className:"arkyn_pagination-spread",children:r.jsx(Q.Ellipsis,{})}),r.jsx("button",{className:"arkyn_pagination-page_button",onClick:()=>C(s),children:s})]}),r.jsx("button",{className:"arkyn_pagination-icon_button",disabled:m>=s,onClick:()=>C(m+1),children:r.jsx(Q.ChevronRight,{})})]})}const tt=l.createContext({});function kn(){if(!tt)throw new Error("useTabContext must be used within a TabProvider");return l.useContext(tt)}function Nn(e){const{children:n,onClick:a,defaultActive:o,className:i,...c}=e,[f,u]=l.useState(o||""),[d,p]=l.useState(!0),m=l.useRef(null),y=`arkyn_tab_container ${i||""}`,[s,b]=l.useState({width:"0px",left:"0px",transition:"none"}),_=(k,v)=>{const x=k.getBoundingClientRect(),F=m.current.getBoundingClientRect(),z=v?void 0:"none";p(!1),b({transition:z,width:`${x.width}px`,left:`${x.left-F.left}px`})};l.useEffect(()=>{const k=m.current;if(!k)return;let v=null;v=k.querySelector("button.active"),v&&_(v)},[]);const C=k=>{const v=k.target;v&&(u(v.value),v.classList.add("active"),_(v,!0),a&&a(v.value))};return r.jsxs("nav",{ref:m,onClick:C,className:y.trim(),...c,children:[r.jsx(tt.Provider,{value:{handleTabClick:C,showInitialTab:d,value:f},children:n}),r.jsx("div",{className:"active-line",style:s})]})}function _n(e){const{children:n,className:a="",onClick:o,...i}=e,{value:c,showInitialTab:f,handleTabClick:u}=kn(),d=c===i.value&&c?"active":"",m=`arkyn_tab_button ${c===i.value&&f?"show_border_bottom":""} ${d} ${a}`;function y(s){u(s),o&&o(s)}return r.jsx("button",{onClick:y,className:m.trim(),...i,children:n})}const wt=l.createContext({});function jn(e){const{isVisibled:n,makeInvisible:a,orientation:o="left",children:i,className:c,...f}=e,u=o==="left"?"-100%":"100%",p=`arkyn_drawer_container ${o} ${n?"visible":""} ${c}`;return r.jsx(wt.Provider,{value:{makeInvisible:a},children:r.jsx(je.AnimatePresence,{children:n&&r.jsxs("aside",{className:p.trim(),...f,children:[r.jsx(je.motion.div,{className:"arkyn_drawer_container-overlay",transition:{duration:.15,ease:"easeOut"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:a}),r.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 Sn(e){const{showCloseButton:n=!0,className:a,children:o,...i}=e,{makeInvisible:c}=l.useContext(wt),f=`arkyn_drawer_header ${a}`;return r.jsxs("header",{className:f.trim(),...i,children:[o,n&&r.jsx("button",{className:"arkyn_drawer_header-close_button",type:"button",onClick:c,"aria-label":"Close drawer",children:r.jsx(Q.X,{size:24})})]})}const Ct=l.createContext({});function En(e){const{isVisibled:n,makeInvisible:a,children:o,className:i="",...c}=e,u=`arkyn_modal_container ${n?"visible":""} ${i}`;return r.jsx(Ct.Provider,{value:{makeInvisible:a},children:r.jsx(je.AnimatePresence,{children:n&&r.jsxs("aside",{className:u.trim(),...c,children:[r.jsx(je.motion.div,{className:"arkyn_modal_container-overlay",transition:{duration:.15,ease:"easeOut"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:a}),r.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 Rn(e){const{alignment:n="right",className:a,...o}=e,i=`arkyn_modal_footer ${n} ${a}`;return r.jsx("footer",{className:i.trim(),...o})}function $n(e){const{showCloseButton:n=!0,className:a,children:o,...i}=e,{makeInvisible:c}=l.useContext(Ct),f=`arkyn_modal_header ${a}`;return r.jsxs("header",{className:f.trim(),...i,children:[o,n&&r.jsx("button",{type:"button",onClick:c,"aria-label":"Close modal button",className:"arkyn_modal_header-close_button",children:r.jsx(Q.X,{size:24})})]})}function Tn(e){const{children:n,button:a,closeOnClick:o,orientation:i="bottom-left"}=e,[c,f]=l.useState(!1),u=`arkyn_popover ${i} ${c?"show":""}`;function d(){c||f(!0)}return r.jsxs("div",{className:u,onClick:d,children:[a,r.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&&f(!1),className:"arkyn_popover-content",children:n}),c&&r.jsx("div",{onClick:()=>f(!1),className:"arkyn_popover-overlay"})]})}function kt(e){const{message:n,title:a,type:o,size:i="lg"}=e,c=`arkyn_toast ${o} ${i}`;function f(){switch(o){case"info":return r.jsx(Q.Info,{});case"success":return r.jsx(Q.CheckCircle2,{});case"danger":return r.jsx(Q.XCircle,{});case"warning":return r.jsx(Q.AlertCircle,{});default:return r.jsx(Q.Info,{})}}return r.jsxs("aside",{className:c,children:[r.jsxs("div",{children:[r.jsx("div",{className:"bg"}),r.jsx(f,{})]}),r.jsxs("p",{children:[r.jsx("strong",{title:a,children:a}),r.jsx("span",{children:n})]})]})}function Pn(e){const{text:n,size:a="lg",children:o,orientation:i="top",className:c,...f}=e,u=`arkyn_tooltip ${a} ${i} ${c}`;return r.jsxs("div",{className:u.trim(),...f,children:[o,r.jsx("div",{className:"arkyn_tooltip-text",children:n})]})}const nt=l.createContext({}),Nt=l.createContext({});function _t(){const e=l.useContext(Nt);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 In(){const e=Re.useActionData(),{closeModal:n}=l.useContext(nt),{showToast:a}=_t();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)&&a(o),!jt(o)&&i&&a({message:i,title:"Atenção!",type:"warning"})},[e])}const St=l.createContext({});function On(e){const n=l.useContext(St);if(Object.entries(n).length===0)throw new Error("useDrawer must be used within a Provider");if(e){const{drawerData:a,drawerIsOpen:o,openDrawer:i,closeDrawer:c}=n,f=o(e),u=a(e);return{drawerIsOpen:f,drawerData:u,openDrawer:m=>i(e,m),closeDrawer:()=>c(e)}}else return n}function zn(e){const n=l.useContext(nt);if(Object.entries(n).length===0)throw new Error("useModal must be used within a Provider");if(e){const{modalData:a,modalIsOpen:o,openModal:i,closeModal:c}=n,f=o(e),u=a(e);return{modalIsOpen:f,modalData:u,openModal:m=>i(e,m),closeModal:()=>c(e)}}else return n}function Fn(e){const{children:n=!1}=e,[a,o]=l.useState([]);function i(d){return!!a.some(p=>p.key===d)}function c(d){var p;return(p=a.find(m=>m.key===d))==null?void 0:p.data}function f(d,p){const m=i(d);o(m?y=>[...y.filter(b=>b.key!==d),{key:d,data:p}]:[...a,{key:d,data:p}])}function u(d){o(a.filter(p=>p.key!==d))}return r.jsx(St.Provider,{value:{drawerIsOpen:i,drawerData:c,openDrawer:f,closeDrawer:u},children:n})}function Bn(e){const{children:n=!1}=e,[a,o]=l.useState([]);function i(d){return!!a.some(p=>p.key===d)}function c(d){var p;return(p=a.find(m=>m.key===d))==null?void 0:p.data}function f(d,p){const m=i(d);o(m?y=>[...y.filter(b=>b.key!==d),{key:d,data:p}]:[...a,{key:d,data:p}])}function u(d){o(a.filter(p=>p.key!==d))}return r.jsx(nt.Provider,{value:{modalIsOpen:i,modalData:c,openModal:f,closeModal:u},children:n})}var Dn=e=>{switch(e){case"success":return An;case"info":return Wn;case"warning":return Vn;case"error":return Yn;default:return null}},Ln=Array(12).fill(0),Mn=({visible:e})=>l.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},l.createElement("div",{className:"sonner-spinner"},Ln.map((n,a)=>l.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),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:"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"})),Vn=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"})),Wn=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"})),Yn=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"})),Hn=()=>{let[e,n]=l.useState(document.hidden);return l.useEffect(()=>{let a=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),e},at=1,Un=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:a,...o}=e,i=typeof(e==null?void 0:e.id)=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:at++,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:a}),{...u,...e,id:i,dismissible:f,title:a}):u):this.addToast({title:a,...o,dismissible:f,id:i}),i},this.dismiss=e=>(e||this.toasts.forEach(n=>{this.subscribers.forEach(a=>a({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 a;n.loading!==void 0&&(a=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=a!==void 0;return o.then(async c=>{if(Xn(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:a,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:a,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:a,type:"error",message:f,description:u})}}).finally(()=>{var c;i&&(this.dismiss(a),a=void 0),(c=n.finally)==null||c.call(n)}),a},this.custom=(e,n)=>{let a=(n==null?void 0:n.id)||at++;return this.create({jsx:e(a),id:a,...n}),a},this.subscribers=[],this.toasts=[]}},he=new Un,Kn=(e,n)=>{let a=(n==null?void 0:n.id)||at++;return he.addToast({title:e,...n,id:a}),a},Xn=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",qn=Kn,Gn=()=>he.toasts,Jn=Object.assign(qn,{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:Gn});function Zn(e,{insertAt:n}={}){if(!e||typeof document>"u")return;let a=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",n==="top"&&a.firstChild?a.insertBefore(o,a.firstChild):a.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}Zn(`: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 Qn=3,ea="32px",ta=4e3,na=356,aa=14,ra=20,sa=200;function oa(...e){return e.filter(Boolean).join(" ")}var ia=e=>{var n,a,o,i,c,f,u,d,p,m;let{invert:y,toast:s,unstyled:b,interacting:_,setHeights:C,visibleToasts:k,heights:v,index:x,toasts:F,expanded:z,removeToast:P,defaultRichColors:Y,closeButton:L,style:G,cancelButtonStyle:U,actionButtonStyle:K,className:B="",descriptionClassName:te="",duration:S,position:X,gap:M,loadingIcon:q,expandByDefault:ne,classNames:$,icons:ae,closeButtonAriaLabel:ue="Close toast",pauseWhenPageIsHidden:R,cn:E}=e,[T,J]=l.useState(!1),[se,A]=l.useState(!1),[xe,me]=l.useState(!1),[Z,oe]=l.useState(!1),[ke,$e]=l.useState(0),[rt,Ye]=l.useState(0),Se=l.useRef(null),pe=l.useRef(null),He=x===0,Ue=x+1<=k,ie=s.type,Ne=s.dismissible!==!1,st=s.className||"",Fe=s.descriptionClassName||"",Te=l.useMemo(()=>v.findIndex(j=>j.toastId===s.id)||0,[v,s.id]),ot=l.useMemo(()=>{var j;return(j=s.closeButton)!=null?j:L},[s.closeButton,L]),Be=l.useMemo(()=>s.duration||S||ta,[s.duration,S]),Pe=l.useRef(0),ge=l.useRef(0),Ke=l.useRef(0),we=l.useRef(null),[De,Le]=X.split("-"),Xe=l.useMemo(()=>v.reduce((j,V,W)=>W>=Te?j:j+V.height,0),[v,Te]),qe=Hn(),it=s.invert||y,Me=ie==="loading";ge.current=l.useMemo(()=>Te*M+Xe,[Te,Xe]),l.useEffect(()=>{J(!0)},[]),l.useLayoutEffect(()=>{if(!T)return;let j=pe.current,V=j.style.height;j.style.height="auto";let W=j.getBoundingClientRect().height;j.style.height=V,Ye(W),C(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])},[T,s.title,s.description,C,s.id]);let ye=l.useCallback(()=>{A(!0),$e(ge.current),C(j=>j.filter(V=>V.toastId!==s.id)),setTimeout(()=>{P(s)},sa)},[s,P,C,ge]);l.useEffect(()=>{if(s.promise&&ie==="loading"||s.duration===1/0||s.type==="loading")return;let j,V=Be;return z||_||R&&qe?(()=>{if(Ke.current<Pe.current){let W=new Date().getTime()-Pe.current;V=V-W}Ke.current=new Date().getTime()})():V!==1/0&&(Pe.current=new Date().getTime(),j=setTimeout(()=>{var W;(W=s.onAutoClose)==null||W.call(s,s),ye()},V)),()=>clearTimeout(j)},[z,_,ne,s,Be,ye,s.promise,ie,R,qe]),l.useEffect(()=>{let j=pe.current;if(j){let V=j.getBoundingClientRect().height;return Ye(V),C(W=>[{toastId:s.id,height:V,position:s.position},...W]),()=>C(W=>W.filter(le=>le.toastId!==s.id))}},[C,s.id]),l.useEffect(()=>{s.delete&&ye()},[ye,s.delete]);function lt(){return ae!=null&&ae.loading?l.createElement("div",{className:"sonner-loader","data-visible":ie==="loading"},ae.loading):q?l.createElement("div",{className:"sonner-loader","data-visible":ie==="loading"},q):l.createElement(Mn,{visible:ie==="loading"})}return l.createElement("li",{"aria-live":s.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:pe,className:E(B,st,$==null?void 0:$.toast,(n=s==null?void 0:s.classNames)==null?void 0:n.toast,$==null?void 0:$.default,$==null?void 0:$[ie],(a=s==null?void 0:s.classNames)==null?void 0:a[ie]),"data-sonner-toast":"","data-rich-colors":(o=s.richColors)!=null?o:Y,"data-styled":!(s.jsx||s.unstyled||b),"data-mounted":T,"data-promise":!!s.promise,"data-removed":se,"data-visible":Ue,"data-y-position":De,"data-x-position":Le,"data-index":x,"data-front":He,"data-swiping":xe,"data-dismissible":Ne,"data-type":ie,"data-invert":it,"data-swipe-out":Z,"data-expanded":!!(z||ne&&T),style:{"--index":x,"--toasts-before":x,"--z-index":F.length-x,"--offset":`${se?ke:ge.current}px`,"--initial-height":ne?"auto":`${rt}px`,...G,...s.style},onPointerDown:j=>{Me||!Ne||(Se.current=new Date,$e(ge.current),j.target.setPointerCapture(j.pointerId),j.target.tagName!=="BUTTON"&&(me(!0),we.current={x:j.clientX,y:j.clientY}))},onPointerUp:()=>{var j,V,W,le;if(Z||!Ne)return;we.current=null;let de=Number(((j=pe.current)==null?void 0:j.style.getPropertyValue("--swipe-amount").replace("px",""))||0),_e=new Date().getTime()-((V=Se.current)==null?void 0:V.getTime()),Ge=Math.abs(de)/_e;if(Math.abs(de)>=ra||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:j=>{var V;if(!we.current||!Ne)return;let W=j.clientY-we.current.y,le=j.clientX-we.current.x,de=(De==="top"?Math.min:Math.max)(0,W),_e=j.pointerType==="touch"?10:2;Math.abs(de)>_e?(V=pe.current)==null||V.style.setProperty("--swipe-amount",`${W}px`):Math.abs(le)>_e&&(we.current=null)}},ot&&!s.jsx?l.createElement("button",{"aria-label":ue,"data-disabled":Me,"data-close-button":!0,onClick:Me||!Ne?()=>{}:()=>{var j;ye(),(j=s.onDismiss)==null||j.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||lt():null,s.type!=="loading"?s.icon||(ae==null?void 0:ae[ie])||Dn(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:j=>{var V,W;We(s.cancel)&&Ne&&((W=(V=s.cancel).onClick)==null||W.call(V,j),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:j=>{var V,W;We(s.action)&&(j.defaultPrevented||((W=(V=s.action).onClick)==null||W.call(V,j),ye()))},className:E($==null?void 0:$.actionButton,(m=s==null?void 0:s.classNames)==null?void 0:m.actionButton)},s.action.label):null))};function Et(){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 la=e=>{let{invert:n,position:a="bottom-right",hotkey:o=["altKey","KeyT"],expand:i,closeButton:c,className:f,offset:u,theme:d="light",richColors:p,duration:m,style:y,visibleToasts:s=Qn,toastOptions:b,dir:_=Et(),gap:C=aa,loadingIcon:k,icons:v,containerAriaLabel:x="Notifications",pauseWhenPageIsHidden:F,cn:z=oa}=e,[P,Y]=l.useState([]),L=l.useMemo(()=>Array.from(new Set([a].concat(P.filter(R=>R.position).map(R=>R.position)))),[P,a]),[G,U]=l.useState([]),[K,B]=l.useState(!1),[te,S]=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),ae=l.useRef(!1),ue=l.useCallback(R=>{var E;(E=P.find(T=>T.id===R.id))!=null&&E.delete||he.dismiss(R.id),Y(T=>T.filter(({id:J})=>J!==R.id))},[P]);return l.useEffect(()=>he.subscribe(R=>{if(R.dismiss){Y(E=>E.map(T=>T.id===R.id?{...T,delete:!0}:T));return}setTimeout(()=>{zt.flushSync(()=>{Y(E=>{let T=E.findIndex(J=>J.id===R.id);return T!==-1?[...E.slice(0,T),{...E[T],...R},...E.slice(T+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(()=>{P.length<=1&&B(!1)},[P]),l.useEffect(()=>{let R=E=>{var T,J;o.every(se=>E[se]||E.code===se)&&(B(!0),(T=q.current)==null||T.focus()),E.code==="Escape"&&(document.activeElement===q.current||(J=q.current)!=null&&J.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[o]),l.useEffect(()=>{if(q.current)return()=>{$.current&&($.current.focus({preventScroll:!0}),$.current=null,ae.current=!1)}},[q.current]),P.length?l.createElement("section",{"aria-label":`${x} ${ne}`,tabIndex:-1},L.map((R,E)=>{var T;let[J,se]=R.split("-");return l.createElement("ol",{key:R,dir:_==="auto"?Et():_,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":`${((T=G[0])==null?void 0:T.height)||0}px`,"--offset":typeof u=="number"?`${u}px`:u||ea,"--width":`${na}px`,"--gap":`${C}px`,...y},onBlur:A=>{ae.current&&!A.currentTarget.contains(A.relatedTarget)&&(ae.current=!1,$.current&&($.current.focus({preventScroll:!0}),$.current=null))},onFocus:A=>{A.target instanceof HTMLElement&&A.target.dataset.dismissible==="false"||ae.current||(ae.current=!0,$.current=A.relatedTarget)},onMouseEnter:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{te||B(!1)},onPointerDown:A=>{A.target instanceof HTMLElement&&A.target.dataset.dismissible==="false"||S(!0)},onPointerUp:()=>S(!1)},P.filter(A=>!A.position&&E===0||A.position===R).map((A,xe)=>{var me,Z;return l.createElement(ia,{key:A.id,icons:v,index:xe,toast:A,defaultRichColors:p,duration:(me=b==null?void 0:b.duration)!=null?me:m,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:n,visibleToasts:s,closeButton:(Z=b==null?void 0:b.closeButton)!=null?Z:c,interacting:te,position:R,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,removeToast:ue,toasts:P.filter(oe=>oe.position==A.position),heights:G.filter(oe=>oe.position==A.position),setHeights:U,expandByDefault:i,gap:C,loadingIcon:k,expanded:K,pauseWhenPageIsHidden:F,cn:z})}))})):null};function ca({children:e}){function n(a){Jn.custom(o=>r.jsx(kt,{...a}))}return r.jsxs(Nt.Provider,{value:{showToast:n},children:[r.jsx(la,{}),e]})}w.Badge=At,w.BreadcrumbContainer=xn,w.BreadcrumbLink=wn,w.Button=qt,w.Checkbox=Jt,w.Divider=Vt,w.DrawerContainer=jn,w.DrawerHeader=Sn,w.DrawerProvider=Fn,w.FormController=Gt,w.FormError=Zt,w.FormLabel=Qt,w.IconButton=en,w.Input=hn,w.ModalContainer=En,w.ModalFooter=Rn,w.ModalHeader=$n,w.ModalProvider=Bn,w.Pagination=Cn,w.Popover=Tn,w.RadioBox=gn,w.RadioGroup=pn,w.Select=bn,w.Skeleton=Wt,w.TabButton=_n,w.TabContainer=Nn,w.TableBody=Yt,w.TableCaption=Ht,w.TableContainer=Ut,w.TableFooter=Kt,w.TableHeader=Xt,w.Textarea=yn,w.Toast=kt,w.ToastProvider=ca,w.Tooltip=Pn,w.useAutomation=In,w.useDrawer=On,w.useModal=zn,w.useScopedParams=xt,w.useToast=_t,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Tabs/TabButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Tabs/TabButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAI9C,OAAO,cAAc,CAAC;AAEtB,iBAAS,SAAS,CAAC,KAAK,EAAE,cAAc,2CAqBvC;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
@@ -1,8 +1,16 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import { useTabContext } from "../TabContainer";
|
2
3
|
import "./styles.css";
|
3
4
|
function TabButton(props) {
|
4
|
-
const { children,
|
5
|
-
const
|
6
|
-
|
5
|
+
const { children, className: baseClassName = "", onClick, ...rest } = props;
|
6
|
+
const { value, showInitialTab, handleTabClick } = useTabContext();
|
7
|
+
const active = value === rest.value && value ? "active" : "";
|
8
|
+
const defaultShowBorderBottomTable = value === rest.value && showInitialTab ? "show_border_bottom" : "";
|
9
|
+
const className = `arkyn_tab_button ${defaultShowBorderBottomTable} ${active} ${baseClassName}`;
|
10
|
+
function handleClick(event) {
|
11
|
+
handleTabClick(event);
|
12
|
+
onClick && onClick(event);
|
13
|
+
}
|
14
|
+
return (_jsx("button", { onClick: handleClick, className: className.trim(), ...rest, children: children }));
|
7
15
|
}
|
8
16
|
export { TabButton };
|
@@ -1,5 +1,12 @@
|
|
1
1
|
import { TabContainerProps } from "@arkyn/types";
|
2
|
+
import { MouseEvent } from "react";
|
2
3
|
import "./styles.css";
|
4
|
+
type TabContextType = {
|
5
|
+
value: string;
|
6
|
+
showInitialTab: boolean;
|
7
|
+
handleTabClick: (event: MouseEvent<HTMLButtonElement>) => void;
|
8
|
+
};
|
9
|
+
declare function useTabContext(): TabContextType;
|
3
10
|
declare function TabContainer(props: TabContainerProps): import("react/jsx-runtime").JSX.Element;
|
4
|
-
export { TabContainer };
|
11
|
+
export { TabContainer, useTabContext };
|
5
12
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Tabs/TabContainer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Tabs/TabContainer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAEL,UAAU,EAKX,MAAM,OAAO,CAAC;AAEf,OAAO,cAAc,CAAC;AAEtB,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CAChE,CAAC;AAIF,iBAAS,aAAa,mBAKrB;AAED,iBAAS,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CAyE7C;AAED,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
@@ -1,8 +1,16 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
-
import {
|
2
|
+
import { createContext, useContext, useEffect, useRef, useState, } from "react";
|
3
3
|
import "./styles.css";
|
4
|
+
const TabContext = createContext({});
|
5
|
+
function useTabContext() {
|
6
|
+
if (!TabContext)
|
7
|
+
throw new Error("useTabContext must be used within a TabProvider");
|
8
|
+
return useContext(TabContext);
|
9
|
+
}
|
4
10
|
function TabContainer(props) {
|
5
|
-
const { children, onClick, className: baseClassName, ...rest } = props;
|
11
|
+
const { children, onClick, defaultActive, className: baseClassName, ...rest } = props;
|
12
|
+
const [value, setValue] = useState(defaultActive || "");
|
13
|
+
const [showInitialTab, setShowInitialTab] = useState(true);
|
6
14
|
const reference = useRef(null);
|
7
15
|
const className = `arkyn_tab_container ${baseClassName || ""}`;
|
8
16
|
const [activeLineStyle, setActiveLineStyle] = useState({
|
@@ -14,13 +22,14 @@ function TabContainer(props) {
|
|
14
22
|
const rect = button.getBoundingClientRect();
|
15
23
|
const containerRect = reference.current.getBoundingClientRect();
|
16
24
|
const transition = applyTransition ? undefined : "none";
|
25
|
+
setShowInitialTab(false);
|
17
26
|
setActiveLineStyle({
|
18
27
|
transition,
|
19
28
|
width: `${rect.width}px`,
|
20
29
|
left: `${rect.left - containerRect.left}px`,
|
21
30
|
});
|
22
31
|
};
|
23
|
-
|
32
|
+
useEffect(() => {
|
24
33
|
const tabContainer = reference.current;
|
25
34
|
if (!tabContainer)
|
26
35
|
return;
|
@@ -31,15 +40,13 @@ function TabContainer(props) {
|
|
31
40
|
}, []);
|
32
41
|
const handleTabClick = (event) => {
|
33
42
|
const target = event.target;
|
34
|
-
|
35
|
-
|
36
|
-
const buttons = tabContainer.querySelectorAll("button");
|
37
|
-
buttons.forEach((button) => button.classList.remove("active"));
|
43
|
+
if (target) {
|
44
|
+
setValue(target.value);
|
38
45
|
target.classList.add("active");
|
39
46
|
updateActiveLine(target, true);
|
40
47
|
onClick && onClick(target.value);
|
41
48
|
}
|
42
49
|
};
|
43
|
-
return (_jsxs("nav", { ref: reference, onClick: handleTabClick, className: className.trim(), ...rest, children: [children, _jsx("div", { className: "active-line", style: activeLineStyle })] }));
|
50
|
+
return (_jsxs("nav", { ref: reference, onClick: handleTabClick, className: className.trim(), ...rest, children: [_jsx(TabContext.Provider, { value: { handleTabClick, showInitialTab, value }, children: children }), _jsx("div", { className: "active-line", style: activeLineStyle })] }));
|
44
51
|
}
|
45
|
-
export { TabContainer };
|
52
|
+
export { TabContainer, useTabContext };
|