randmarcomps 1.212.0 → 1.214.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/randmarcomps.js
CHANGED
|
@@ -2022,21 +2022,21 @@ const fromTheme = (e) => {
|
|
|
2022
2022
|
* @see https://tailwindcss.com/docs/height
|
|
2023
2023
|
*/
|
|
2024
2024
|
h: [{
|
|
2025
|
-
h: ["screen", ...Ge()]
|
|
2025
|
+
h: ["screen", "lh", ...Ge()]
|
|
2026
2026
|
}],
|
|
2027
2027
|
/**
|
|
2028
2028
|
* Min-Height
|
|
2029
2029
|
* @see https://tailwindcss.com/docs/min-height
|
|
2030
2030
|
*/
|
|
2031
2031
|
"min-h": [{
|
|
2032
|
-
"min-h": ["screen", "none", ...Ge()]
|
|
2032
|
+
"min-h": ["screen", "lh", "none", ...Ge()]
|
|
2033
2033
|
}],
|
|
2034
2034
|
/**
|
|
2035
2035
|
* Max-Height
|
|
2036
2036
|
* @see https://tailwindcss.com/docs/max-height
|
|
2037
2037
|
*/
|
|
2038
2038
|
"max-h": [{
|
|
2039
|
-
"max-h": ["screen", ...Ge()]
|
|
2039
|
+
"max-h": ["screen", "lh", ...Ge()]
|
|
2040
2040
|
}],
|
|
2041
2041
|
// ------------------
|
|
2042
2042
|
// --- Typography ---
|
|
@@ -66866,9 +66866,9 @@ const PartnerLogo = ({ applicationId: e, width: t, height: n, align: o }) => {
|
|
|
66866
66866
|
f || d === !0 && b && !g ? /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-8 rounded-sm" }) : d === !0 && _ ? /* @__PURE__ */ jsx("img", { src: _, alt: `${e}'s logo`, className: "h-8 w-auto max-w-[60px] object-contain rounded-sm" }) : /* @__PURE__ */ jsx(
|
|
66867
66867
|
"div",
|
|
66868
66868
|
{
|
|
66869
|
-
className: "h-8 w-
|
|
66869
|
+
className: "h-8 w-full flex items-center justify-center border border-dashed border-border rounded-sm bg-muted/20 p-1",
|
|
66870
66870
|
title: `Logo for ${e}`,
|
|
66871
|
-
children: /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground font-mono text-center leading-none break-all", children: e
|
|
66871
|
+
children: /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground font-mono text-center leading-none break-all", children: e })
|
|
66872
66872
|
}
|
|
66873
66873
|
)
|
|
66874
66874
|
] }) }),
|
|
@@ -352,7 +352,7 @@
|
|
|
352
352
|
*
|
|
353
353
|
* This source code is licensed under the ISC license.
|
|
354
354
|
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
-
*/const __iconNode=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],X$1=createLucideIcon("X",__iconNode);function r(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(n=r(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function clsx(){for(var e,t,n=0,o="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=r(e))&&(o&&(o+=" "),o+=t);return o}const CLASS_PART_SEPARATOR="-",createClassGroupUtils=e=>{const t=createClassMap(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:f=>{const g=f.split(CLASS_PART_SEPARATOR);return g[0]===""&&g.length!==1&&g.shift(),getGroupRecursive(g,t)||getGroupIdForArbitraryProperty(f)},getConflictingClassGroupIds:(f,g)=>{const b=n[f]||[];return g&&o[f]?[...b,...o[f]]:b}}},getGroupRecursive=(e,t)=>{var f;if(e.length===0)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),l=o?getGroupRecursive(e.slice(1),o):void 0;if(l)return l;if(t.validators.length===0)return;const d=e.join(CLASS_PART_SEPARATOR);return(f=t.validators.find(({validator:g})=>g(d)))==null?void 0:f.classGroupId},arbitraryPropertyRegex=/^\[(.+)\]$/,getGroupIdForArbitraryProperty=e=>{if(arbitraryPropertyRegex.test(e)){const t=arbitraryPropertyRegex.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},createClassMap=e=>{const{theme:t,classGroups:n}=e,o={nextPart:new Map,validators:[]};for(const l in n)processClassesRecursively(n[l],o,l,t);return o},processClassesRecursively=(e,t,n,o)=>{e.forEach(l=>{if(typeof l=="string"){const d=l===""?t:getPart(t,l);d.classGroupId=n;return}if(typeof l=="function"){if(isThemeGetter(l)){processClassesRecursively(l(o),t,n,o);return}t.validators.push({validator:l,classGroupId:n});return}Object.entries(l).forEach(([d,f])=>{processClassesRecursively(f,getPart(t,d),n,o)})})},getPart=(e,t)=>{let n=e;return t.split(CLASS_PART_SEPARATOR).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},isThemeGetter=e=>e.isThemeGetter,createLruCache$1=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const l=(d,f)=>{n.set(d,f),t++,t>e&&(t=0,o=n,n=new Map)};return{get(d){let f=n.get(d);if(f!==void 0)return f;if((f=o.get(d))!==void 0)return l(d,f),f},set(d,f){n.has(d)?n.set(d,f):l(d,f)}}},IMPORTANT_MODIFIER="!",MODIFIER_SEPARATOR=":",MODIFIER_SEPARATOR_LENGTH=MODIFIER_SEPARATOR.length,createParseClassName=e=>{const{prefix:t,experimentalParseClassName:n}=e;let o=l=>{const d=[];let f=0,g=0,b=0,_;for(let M=0;M<l.length;M++){let I=l[M];if(f===0&&g===0){if(I===MODIFIER_SEPARATOR){d.push(l.slice(b,M)),b=M+MODIFIER_SEPARATOR_LENGTH;continue}if(I==="/"){_=M;continue}}I==="["?f++:I==="]"?f--:I==="("?g++:I===")"&&g--}const S=d.length===0?l:l.substring(b),R=stripImportantModifier(S),C=R!==S,E=_&&_>b?_-b:void 0;return{modifiers:d,hasImportantModifier:C,baseClassName:R,maybePostfixModifierPosition:E}};if(t){const l=t+MODIFIER_SEPARATOR,d=o;o=f=>f.startsWith(l)?d(f.substring(l.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:f,maybePostfixModifierPosition:void 0}}if(n){const l=o;o=d=>n({className:d,parseClassName:l})}return o},stripImportantModifier=e=>e.endsWith(IMPORTANT_MODIFIER)?e.substring(0,e.length-1):e.startsWith(IMPORTANT_MODIFIER)?e.substring(1):e,createSortModifiers=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const l=[];let d=[];return o.forEach(f=>{f[0]==="["||t[f]?(l.push(...d.sort(),f),d=[]):d.push(f)}),l.push(...d.sort()),l}},createConfigUtils=e=>({cache:createLruCache$1(e.cacheSize),parseClassName:createParseClassName(e),sortModifiers:createSortModifiers(e),...createClassGroupUtils(e)}),SPLIT_CLASSES_REGEX=/\s+/,mergeClassList=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:l,sortModifiers:d}=t,f=[],g=e.trim().split(SPLIT_CLASSES_REGEX);let b="";for(let _=g.length-1;_>=0;_-=1){const S=g[_],{isExternal:R,modifiers:C,hasImportantModifier:E,baseClassName:M,maybePostfixModifierPosition:I}=n(S);if(R){b=S+(b.length>0?" "+b:b);continue}let A=!!I,O=o(A?M.substring(0,I):M);if(!O){if(!A){b=S+(b.length>0?" "+b:b);continue}if(O=o(M),!O){b=S+(b.length>0?" "+b:b);continue}A=!1}const q=d(C).join(":"),z=E?q+IMPORTANT_MODIFIER:q,Q=z+O;if(f.includes(Q))continue;f.push(Q);const F=l(O,A);for(let V=0;V<F.length;++V){const te=F[V];f.push(z+te)}b=S+(b.length>0?" "+b:b)}return b};function twJoin(){let e=0,t,n,o="";for(;e<arguments.length;)(t=arguments[e++])&&(n=toValue(t))&&(o&&(o+=" "),o+=n);return o}const toValue=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=toValue(e[o]))&&(n&&(n+=" "),n+=t);return n};function createTailwindMerge(e,...t){let n,o,l,d=f;function f(b){const _=t.reduce((S,R)=>R(S),e());return n=createConfigUtils(_),o=n.cache.get,l=n.cache.set,d=g,g(b)}function g(b){const _=o(b);if(_)return _;const S=mergeClassList(b,n);return l(b,S),S}return function(){return d(twJoin.apply(null,arguments))}}const fromTheme=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},arbitraryValueRegex=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,arbitraryVariableRegex=/^\((?:(\w[\w-]*):)?(.+)\)$/i,fractionRegex=/^\d+\/\d+$/,tshirtUnitRegex=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lengthUnitRegex=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,colorFunctionRegex=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,shadowRegex=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,imageRegex=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,isFraction=e=>fractionRegex.test(e),isNumber$2=e=>!!e&&!Number.isNaN(Number(e)),isInteger=e=>!!e&&Number.isInteger(Number(e)),isPercent$1=e=>e.endsWith("%")&&isNumber$2(e.slice(0,-1)),isTshirtSize=e=>tshirtUnitRegex.test(e),isAny=()=>!0,isLengthOnly=e=>lengthUnitRegex.test(e)&&!colorFunctionRegex.test(e),isNever=()=>!1,isShadow=e=>shadowRegex.test(e),isImage=e=>imageRegex.test(e),isAnyNonArbitrary=e=>!isArbitraryValue(e)&&!isArbitraryVariable(e),isArbitrarySize=e=>getIsArbitraryValue(e,isLabelSize,isNever),isArbitraryValue=e=>arbitraryValueRegex.test(e),isArbitraryLength=e=>getIsArbitraryValue(e,isLabelLength,isLengthOnly),isArbitraryNumber=e=>getIsArbitraryValue(e,isLabelNumber,isNumber$2),isArbitraryPosition=e=>getIsArbitraryValue(e,isLabelPosition,isNever),isArbitraryImage=e=>getIsArbitraryValue(e,isLabelImage,isImage),isArbitraryShadow=e=>getIsArbitraryValue(e,isLabelShadow,isShadow),isArbitraryVariable=e=>arbitraryVariableRegex.test(e),isArbitraryVariableLength=e=>getIsArbitraryVariable(e,isLabelLength),isArbitraryVariableFamilyName=e=>getIsArbitraryVariable(e,isLabelFamilyName),isArbitraryVariablePosition=e=>getIsArbitraryVariable(e,isLabelPosition),isArbitraryVariableSize=e=>getIsArbitraryVariable(e,isLabelSize),isArbitraryVariableImage=e=>getIsArbitraryVariable(e,isLabelImage),isArbitraryVariableShadow=e=>getIsArbitraryVariable(e,isLabelShadow,!0),getIsArbitraryValue=(e,t,n)=>{const o=arbitraryValueRegex.exec(e);return o?o[1]?t(o[1]):n(o[2]):!1},getIsArbitraryVariable=(e,t,n=!1)=>{const o=arbitraryVariableRegex.exec(e);return o?o[1]?t(o[1]):n:!1},isLabelPosition=e=>e==="position"||e==="percentage",isLabelImage=e=>e==="image"||e==="url",isLabelSize=e=>e==="length"||e==="size"||e==="bg-size",isLabelLength=e=>e==="length",isLabelNumber=e=>e==="number",isLabelFamilyName=e=>e==="family-name",isLabelShadow=e=>e==="shadow",getDefaultConfig=()=>{const e=fromTheme("color"),t=fromTheme("font"),n=fromTheme("text"),o=fromTheme("font-weight"),l=fromTheme("tracking"),d=fromTheme("leading"),f=fromTheme("breakpoint"),g=fromTheme("container"),b=fromTheme("spacing"),_=fromTheme("radius"),S=fromTheme("shadow"),R=fromTheme("inset-shadow"),C=fromTheme("text-shadow"),E=fromTheme("drop-shadow"),M=fromTheme("blur"),I=fromTheme("perspective"),A=fromTheme("aspect"),O=fromTheme("ease"),q=fromTheme("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Q=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],F=()=>[...Q(),isArbitraryVariable,isArbitraryValue],V=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto","contain","none"],ie=()=>[isArbitraryVariable,isArbitraryValue,b],ae=()=>[isFraction,"full","auto",...ie()],oe=()=>[isInteger,"none","subgrid",isArbitraryVariable,isArbitraryValue],se=()=>["auto",{span:["full",isInteger,isArbitraryVariable,isArbitraryValue]},isInteger,isArbitraryVariable,isArbitraryValue],ge=()=>[isInteger,"auto",isArbitraryVariable,isArbitraryValue],Ae=()=>["auto","min","max","fr",isArbitraryVariable,isArbitraryValue],Ne=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Oe=()=>["start","end","center","stretch","center-safe","end-safe"],Le=()=>["auto",...ie()],Ge=()=>[isFraction,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...ie()],je=()=>[e,isArbitraryVariable,isArbitraryValue],Be=()=>[...Q(),isArbitraryVariablePosition,isArbitraryPosition,{position:[isArbitraryVariable,isArbitraryValue]}],Fe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ze=()=>["auto","cover","contain",isArbitraryVariableSize,isArbitrarySize,{size:[isArbitraryVariable,isArbitraryValue]}],He=()=>[isPercent$1,isArbitraryVariableLength,isArbitraryLength],Xe=()=>["","none","full",_,isArbitraryVariable,isArbitraryValue],Je=()=>["",isNumber$2,isArbitraryVariableLength,isArbitraryLength],Ye=()=>["solid","dashed","dotted","double"],at=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ke=()=>[isNumber$2,isPercent$1,isArbitraryVariablePosition,isArbitraryPosition],tt=()=>["","none",M,isArbitraryVariable,isArbitraryValue],Ze=()=>["none",isNumber$2,isArbitraryVariable,isArbitraryValue],et=()=>["none",isNumber$2,isArbitraryVariable,isArbitraryValue],st=()=>[isNumber$2,isArbitraryVariable,isArbitraryValue],qe=()=>[isFraction,"full",...ie()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[isTshirtSize],breakpoint:[isTshirtSize],color:[isAny],container:[isTshirtSize],"drop-shadow":[isTshirtSize],ease:["in","out","in-out"],font:[isAnyNonArbitrary],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[isTshirtSize],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[isTshirtSize],shadow:[isTshirtSize],spacing:["px",isNumber$2],text:[isTshirtSize],"text-shadow":[isTshirtSize],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",isFraction,isArbitraryValue,isArbitraryVariable,A]}],container:["container"],columns:[{columns:[isNumber$2,isArbitraryValue,isArbitraryVariable,g]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:F()}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:te()}],"overscroll-x":[{"overscroll-x":te()}],"overscroll-y":[{"overscroll-y":te()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ae()}],"inset-x":[{"inset-x":ae()}],"inset-y":[{"inset-y":ae()}],start:[{start:ae()}],end:[{end:ae()}],top:[{top:ae()}],right:[{right:ae()}],bottom:[{bottom:ae()}],left:[{left:ae()}],visibility:["visible","invisible","collapse"],z:[{z:[isInteger,"auto",isArbitraryVariable,isArbitraryValue]}],basis:[{basis:[isFraction,"full","auto",g,...ie()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[isNumber$2,isFraction,"auto","initial","none",isArbitraryValue]}],grow:[{grow:["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],shrink:[{shrink:["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],order:[{order:[isInteger,"first","last","none",isArbitraryVariable,isArbitraryValue]}],"grid-cols":[{"grid-cols":oe()}],"col-start-end":[{col:se()}],"col-start":[{"col-start":ge()}],"col-end":[{"col-end":ge()}],"grid-rows":[{"grid-rows":oe()}],"row-start-end":[{row:se()}],"row-start":[{"row-start":ge()}],"row-end":[{"row-end":ge()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ae()}],"auto-rows":[{"auto-rows":Ae()}],gap:[{gap:ie()}],"gap-x":[{"gap-x":ie()}],"gap-y":[{"gap-y":ie()}],"justify-content":[{justify:[...Ne(),"normal"]}],"justify-items":[{"justify-items":[...Oe(),"normal"]}],"justify-self":[{"justify-self":["auto",...Oe()]}],"align-content":[{content:["normal",...Ne()]}],"align-items":[{items:[...Oe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Oe(),{baseline:["","last"]}]}],"place-content":[{"place-content":Ne()}],"place-items":[{"place-items":[...Oe(),"baseline"]}],"place-self":[{"place-self":["auto",...Oe()]}],p:[{p:ie()}],px:[{px:ie()}],py:[{py:ie()}],ps:[{ps:ie()}],pe:[{pe:ie()}],pt:[{pt:ie()}],pr:[{pr:ie()}],pb:[{pb:ie()}],pl:[{pl:ie()}],m:[{m:Le()}],mx:[{mx:Le()}],my:[{my:Le()}],ms:[{ms:Le()}],me:[{me:Le()}],mt:[{mt:Le()}],mr:[{mr:Le()}],mb:[{mb:Le()}],ml:[{ml:Le()}],"space-x":[{"space-x":ie()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":ie()}],"space-y-reverse":["space-y-reverse"],size:[{size:Ge()}],w:[{w:[g,"screen",...Ge()]}],"min-w":[{"min-w":[g,"screen","none",...Ge()]}],"max-w":[{"max-w":[g,"screen","none","prose",{screen:[f]},...Ge()]}],h:[{h:["screen",...Ge()]}],"min-h":[{"min-h":["screen","none",...Ge()]}],"max-h":[{"max-h":["screen",...Ge()]}],"font-size":[{text:["base",n,isArbitraryVariableLength,isArbitraryLength]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,isArbitraryVariable,isArbitraryNumber]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",isPercent$1,isArbitraryValue]}],"font-family":[{font:[isArbitraryVariableFamilyName,isArbitraryValue,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,isArbitraryVariable,isArbitraryValue]}],"line-clamp":[{"line-clamp":[isNumber$2,"none",isArbitraryVariable,isArbitraryNumber]}],leading:[{leading:[d,...ie()]}],"list-image":[{"list-image":["none",isArbitraryVariable,isArbitraryValue]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",isArbitraryVariable,isArbitraryValue]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:je()}],"text-color":[{text:je()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ye(),"wavy"]}],"text-decoration-thickness":[{decoration:[isNumber$2,"from-font","auto",isArbitraryVariable,isArbitraryLength]}],"text-decoration-color":[{decoration:je()}],"underline-offset":[{"underline-offset":[isNumber$2,"auto",isArbitraryVariable,isArbitraryValue]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ie()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",isArbitraryVariable,isArbitraryValue]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",isArbitraryVariable,isArbitraryValue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Be()}],"bg-repeat":[{bg:Fe()}],"bg-size":[{bg:ze()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},isInteger,isArbitraryVariable,isArbitraryValue],radial:["",isArbitraryVariable,isArbitraryValue],conic:[isInteger,isArbitraryVariable,isArbitraryValue]},isArbitraryVariableImage,isArbitraryImage]}],"bg-color":[{bg:je()}],"gradient-from-pos":[{from:He()}],"gradient-via-pos":[{via:He()}],"gradient-to-pos":[{to:He()}],"gradient-from":[{from:je()}],"gradient-via":[{via:je()}],"gradient-to":[{to:je()}],rounded:[{rounded:Xe()}],"rounded-s":[{"rounded-s":Xe()}],"rounded-e":[{"rounded-e":Xe()}],"rounded-t":[{"rounded-t":Xe()}],"rounded-r":[{"rounded-r":Xe()}],"rounded-b":[{"rounded-b":Xe()}],"rounded-l":[{"rounded-l":Xe()}],"rounded-ss":[{"rounded-ss":Xe()}],"rounded-se":[{"rounded-se":Xe()}],"rounded-ee":[{"rounded-ee":Xe()}],"rounded-es":[{"rounded-es":Xe()}],"rounded-tl":[{"rounded-tl":Xe()}],"rounded-tr":[{"rounded-tr":Xe()}],"rounded-br":[{"rounded-br":Xe()}],"rounded-bl":[{"rounded-bl":Xe()}],"border-w":[{border:Je()}],"border-w-x":[{"border-x":Je()}],"border-w-y":[{"border-y":Je()}],"border-w-s":[{"border-s":Je()}],"border-w-e":[{"border-e":Je()}],"border-w-t":[{"border-t":Je()}],"border-w-r":[{"border-r":Je()}],"border-w-b":[{"border-b":Je()}],"border-w-l":[{"border-l":Je()}],"divide-x":[{"divide-x":Je()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Je()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ye(),"hidden","none"]}],"divide-style":[{divide:[...Ye(),"hidden","none"]}],"border-color":[{border:je()}],"border-color-x":[{"border-x":je()}],"border-color-y":[{"border-y":je()}],"border-color-s":[{"border-s":je()}],"border-color-e":[{"border-e":je()}],"border-color-t":[{"border-t":je()}],"border-color-r":[{"border-r":je()}],"border-color-b":[{"border-b":je()}],"border-color-l":[{"border-l":je()}],"divide-color":[{divide:je()}],"outline-style":[{outline:[...Ye(),"none","hidden"]}],"outline-offset":[{"outline-offset":[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"outline-w":[{outline:["",isNumber$2,isArbitraryVariableLength,isArbitraryLength]}],"outline-color":[{outline:je()}],shadow:[{shadow:["","none",S,isArbitraryVariableShadow,isArbitraryShadow]}],"shadow-color":[{shadow:je()}],"inset-shadow":[{"inset-shadow":["none",R,isArbitraryVariableShadow,isArbitraryShadow]}],"inset-shadow-color":[{"inset-shadow":je()}],"ring-w":[{ring:Je()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:je()}],"ring-offset-w":[{"ring-offset":[isNumber$2,isArbitraryLength]}],"ring-offset-color":[{"ring-offset":je()}],"inset-ring-w":[{"inset-ring":Je()}],"inset-ring-color":[{"inset-ring":je()}],"text-shadow":[{"text-shadow":["none",C,isArbitraryVariableShadow,isArbitraryShadow]}],"text-shadow-color":[{"text-shadow":je()}],opacity:[{opacity:[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"mix-blend":[{"mix-blend":[...at(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":at()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[isNumber$2]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ke()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ke()}],"mask-image-linear-from-color":[{"mask-linear-from":je()}],"mask-image-linear-to-color":[{"mask-linear-to":je()}],"mask-image-t-from-pos":[{"mask-t-from":Ke()}],"mask-image-t-to-pos":[{"mask-t-to":Ke()}],"mask-image-t-from-color":[{"mask-t-from":je()}],"mask-image-t-to-color":[{"mask-t-to":je()}],"mask-image-r-from-pos":[{"mask-r-from":Ke()}],"mask-image-r-to-pos":[{"mask-r-to":Ke()}],"mask-image-r-from-color":[{"mask-r-from":je()}],"mask-image-r-to-color":[{"mask-r-to":je()}],"mask-image-b-from-pos":[{"mask-b-from":Ke()}],"mask-image-b-to-pos":[{"mask-b-to":Ke()}],"mask-image-b-from-color":[{"mask-b-from":je()}],"mask-image-b-to-color":[{"mask-b-to":je()}],"mask-image-l-from-pos":[{"mask-l-from":Ke()}],"mask-image-l-to-pos":[{"mask-l-to":Ke()}],"mask-image-l-from-color":[{"mask-l-from":je()}],"mask-image-l-to-color":[{"mask-l-to":je()}],"mask-image-x-from-pos":[{"mask-x-from":Ke()}],"mask-image-x-to-pos":[{"mask-x-to":Ke()}],"mask-image-x-from-color":[{"mask-x-from":je()}],"mask-image-x-to-color":[{"mask-x-to":je()}],"mask-image-y-from-pos":[{"mask-y-from":Ke()}],"mask-image-y-to-pos":[{"mask-y-to":Ke()}],"mask-image-y-from-color":[{"mask-y-from":je()}],"mask-image-y-to-color":[{"mask-y-to":je()}],"mask-image-radial":[{"mask-radial":[isArbitraryVariable,isArbitraryValue]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ke()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ke()}],"mask-image-radial-from-color":[{"mask-radial-from":je()}],"mask-image-radial-to-color":[{"mask-radial-to":je()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":Q()}],"mask-image-conic-pos":[{"mask-conic":[isNumber$2]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ke()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ke()}],"mask-image-conic-from-color":[{"mask-conic-from":je()}],"mask-image-conic-to-color":[{"mask-conic-to":je()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Be()}],"mask-repeat":[{mask:Fe()}],"mask-size":[{mask:ze()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",isArbitraryVariable,isArbitraryValue]}],filter:[{filter:["","none",isArbitraryVariable,isArbitraryValue]}],blur:[{blur:tt()}],brightness:[{brightness:[isNumber$2,isArbitraryVariable,isArbitraryValue]}],contrast:[{contrast:[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"drop-shadow":[{"drop-shadow":["","none",E,isArbitraryVariableShadow,isArbitraryShadow]}],"drop-shadow-color":[{"drop-shadow":je()}],grayscale:[{grayscale:["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],"hue-rotate":[{"hue-rotate":[isNumber$2,isArbitraryVariable,isArbitraryValue]}],invert:[{invert:["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],saturate:[{saturate:[isNumber$2,isArbitraryVariable,isArbitraryValue]}],sepia:[{sepia:["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-filter":[{"backdrop-filter":["","none",isArbitraryVariable,isArbitraryValue]}],"backdrop-blur":[{"backdrop-blur":tt()}],"backdrop-brightness":[{"backdrop-brightness":[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-contrast":[{"backdrop-contrast":[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-grayscale":[{"backdrop-grayscale":["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-invert":[{"backdrop-invert":["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-opacity":[{"backdrop-opacity":[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-saturate":[{"backdrop-saturate":[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-sepia":[{"backdrop-sepia":["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":ie()}],"border-spacing-x":[{"border-spacing-x":ie()}],"border-spacing-y":[{"border-spacing-y":ie()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",isArbitraryVariable,isArbitraryValue]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[isNumber$2,"initial",isArbitraryVariable,isArbitraryValue]}],ease:[{ease:["linear","initial",O,isArbitraryVariable,isArbitraryValue]}],delay:[{delay:[isNumber$2,isArbitraryVariable,isArbitraryValue]}],animate:[{animate:["none",q,isArbitraryVariable,isArbitraryValue]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[I,isArbitraryVariable,isArbitraryValue]}],"perspective-origin":[{"perspective-origin":F()}],rotate:[{rotate:Ze()}],"rotate-x":[{"rotate-x":Ze()}],"rotate-y":[{"rotate-y":Ze()}],"rotate-z":[{"rotate-z":Ze()}],scale:[{scale:et()}],"scale-x":[{"scale-x":et()}],"scale-y":[{"scale-y":et()}],"scale-z":[{"scale-z":et()}],"scale-3d":["scale-3d"],skew:[{skew:st()}],"skew-x":[{"skew-x":st()}],"skew-y":[{"skew-y":st()}],transform:[{transform:[isArbitraryVariable,isArbitraryValue,"","none","gpu","cpu"]}],"transform-origin":[{origin:F()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:qe()}],"translate-x":[{"translate-x":qe()}],"translate-y":[{"translate-y":qe()}],"translate-z":[{"translate-z":qe()}],"translate-none":["translate-none"],accent:[{accent:je()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:je()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",isArbitraryVariable,isArbitraryValue]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ie()}],"scroll-mx":[{"scroll-mx":ie()}],"scroll-my":[{"scroll-my":ie()}],"scroll-ms":[{"scroll-ms":ie()}],"scroll-me":[{"scroll-me":ie()}],"scroll-mt":[{"scroll-mt":ie()}],"scroll-mr":[{"scroll-mr":ie()}],"scroll-mb":[{"scroll-mb":ie()}],"scroll-ml":[{"scroll-ml":ie()}],"scroll-p":[{"scroll-p":ie()}],"scroll-px":[{"scroll-px":ie()}],"scroll-py":[{"scroll-py":ie()}],"scroll-ps":[{"scroll-ps":ie()}],"scroll-pe":[{"scroll-pe":ie()}],"scroll-pt":[{"scroll-pt":ie()}],"scroll-pr":[{"scroll-pr":ie()}],"scroll-pb":[{"scroll-pb":ie()}],"scroll-pl":[{"scroll-pl":ie()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",isArbitraryVariable,isArbitraryValue]}],fill:[{fill:["none",...je()]}],"stroke-w":[{stroke:[isNumber$2,isArbitraryVariableLength,isArbitraryLength,isArbitraryNumber]}],stroke:[{stroke:["none",...je()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},twMerge=createTailwindMerge(getDefaultConfig);function cn(...e){return twMerge(clsx(e))}function InputOTP({className:e,containerClassName:t,...n}){return jsxRuntime.jsx(Lt,{"data-slot":"input-otp",containerClassName:cn("flex items-center gap-2 has-disabled:opacity-50",t),className:cn("disabled:cursor-not-allowed",e),...n})}function InputOTPGroup({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"input-otp-group",className:cn("flex items-center",e),...t})}function InputOTPSlot({index:e,className:t,...n}){const o=React__namespace.useContext(jt),{char:l,hasFakeCaret:d,isActive:f}=(o==null?void 0:o.slots[e])??{};return jsxRuntime.jsxs("div",{"data-slot":"input-otp-slot","data-active":f,className:cn("border-input data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",t),...n,children:[l,d&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:jsxRuntime.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function InputOTPSeparator({...e}){return jsxRuntime.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...e,children:jsxRuntime.jsx(Minus,{})})}function composeEventHandlers(e,t,{checkForDefaultPrevented:n=!0}={}){return function(l){if(e==null||e(l),n===!1||!l.defaultPrevented)return t==null?void 0:t(l)}}function setRef(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function composeRefs(...e){return t=>{let n=!1;const o=e.map(l=>{const d=setRef(l,t);return!n&&typeof d=="function"&&(n=!0),d});if(n)return()=>{for(let l=0;l<o.length;l++){const d=o[l];typeof d=="function"?d():setRef(e[l],null)}}}}function useComposedRefs(...e){return React__namespace.useCallback(composeRefs(...e),e)}function createContext2(e,t){const n=React__namespace.createContext(t),o=d=>{const{children:f,...g}=d,b=React__namespace.useMemo(()=>g,Object.values(g));return jsxRuntime.jsx(n.Provider,{value:b,children:f})};o.displayName=e+"Provider";function l(d){const f=React__namespace.useContext(n);if(f)return f;if(t!==void 0)return t;throw new Error(`\`${d}\` must be used within \`${e}\``)}return[o,l]}function createContextScope(e,t=[]){let n=[];function o(d,f){const g=React__namespace.createContext(f),b=n.length;n=[...n,f];const _=R=>{var O;const{scope:C,children:E,...M}=R,I=((O=C==null?void 0:C[e])==null?void 0:O[b])||g,A=React__namespace.useMemo(()=>M,Object.values(M));return jsxRuntime.jsx(I.Provider,{value:A,children:E})};_.displayName=d+"Provider";function S(R,C){var I;const E=((I=C==null?void 0:C[e])==null?void 0:I[b])||g,M=React__namespace.useContext(E);if(M)return M;if(f!==void 0)return f;throw new Error(`\`${R}\` must be used within \`${d}\``)}return[_,S]}const l=()=>{const d=n.map(f=>React__namespace.createContext(f));return function(g){const b=(g==null?void 0:g[e])||d;return React__namespace.useMemo(()=>({[`__scope${e}`]:{...g,[e]:b}}),[g,b])}};return l.scopeName=e,[o,composeContextScopes(l,...t)]}function composeContextScopes(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(d){const f=o.reduce((g,{useScope:b,scopeName:_})=>{const R=b(d)[`__scope${_}`];return{...g,...R}},{});return React__namespace.useMemo(()=>({[`__scope${t.scopeName}`]:f}),[f])}};return n.scopeName=t.scopeName,n}function createSlot(e){const t=createSlotClone(e),n=React__namespace.forwardRef((o,l)=>{const{children:d,...f}=o,g=React__namespace.Children.toArray(d),b=g.find(isSlottable);if(b){const _=b.props.children,S=g.map(R=>R===b?React__namespace.Children.count(_)>1?React__namespace.Children.only(null):React__namespace.isValidElement(_)?_.props.children:null:R);return jsxRuntime.jsx(t,{...f,ref:l,children:React__namespace.isValidElement(_)?React__namespace.cloneElement(_,void 0,S):null})}return jsxRuntime.jsx(t,{...f,ref:l,children:d})});return n.displayName=`${e}.Slot`,n}var Slot$4=createSlot("Slot");function createSlotClone(e){const t=React__namespace.forwardRef((n,o)=>{const{children:l,...d}=n,f=React__namespace.isValidElement(l)?getElementRef$1(l):void 0,g=useComposedRefs(f,o);if(React__namespace.isValidElement(l)){const b=mergeProps(d,l.props);return l.type!==React__namespace.Fragment&&(b.ref=g),React__namespace.cloneElement(l,b)}return React__namespace.Children.count(l)>1?React__namespace.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var SLOTTABLE_IDENTIFIER=Symbol("radix.slottable");function createSlottable(e){const t=({children:n})=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=SLOTTABLE_IDENTIFIER,t}function isSlottable(e){return React__namespace.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===SLOTTABLE_IDENTIFIER}function mergeProps(e,t){const n={...t};for(const o in t){const l=e[o],d=t[o];/^on[A-Z]/.test(o)?l&&d?n[o]=(...g)=>{const b=d(...g);return l(...g),b}:l&&(n[o]=l):o==="style"?n[o]={...l,...d}:o==="className"&&(n[o]=[l,d].filter(Boolean).join(" "))}return{...e,...n}}function getElementRef$1(e){var o,l;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var NODES=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive=NODES.reduce((e,t)=>{const n=createSlot(`Primitive.${t}`),o=React__namespace.forwardRef((l,d)=>{const{asChild:f,...g}=l,b=f?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntime.jsx(b,{...g,ref:d})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function dispatchDiscreteCustomEvent(e,t){e&&ReactDOM__namespace.flushSync(()=>e.dispatchEvent(t))}function createCollection(e){const t=e+"CollectionProvider",[n,o]=createContextScope(t),[l,d]=n(t,{collectionRef:{current:null},itemMap:new Map}),f=I=>{const{scope:A,children:O}=I,q=React.useRef(null),z=React.useRef(new Map).current;return jsxRuntime.jsx(l,{scope:A,itemMap:z,collectionRef:q,children:O})};f.displayName=t;const g=e+"CollectionSlot",b=createSlot(g),_=React.forwardRef((I,A)=>{const{scope:O,children:q}=I,z=d(g,O),Q=useComposedRefs(A,z.collectionRef);return jsxRuntime.jsx(b,{ref:Q,children:q})});_.displayName=g;const S=e+"CollectionItemSlot",R="data-radix-collection-item",C=createSlot(S),E=React.forwardRef((I,A)=>{const{scope:O,children:q,...z}=I,Q=React.useRef(null),F=useComposedRefs(A,Q),V=d(S,O);return React.useEffect(()=>(V.itemMap.set(Q,{ref:Q,...z}),()=>void V.itemMap.delete(Q))),jsxRuntime.jsx(C,{[R]:"",ref:F,children:q})});E.displayName=S;function M(I){const A=d(e+"CollectionConsumer",I);return React.useCallback(()=>{const q=A.collectionRef.current;if(!q)return[];const z=Array.from(q.querySelectorAll(`[${R}]`));return Array.from(A.itemMap.values()).sort((V,te)=>z.indexOf(V.ref.current)-z.indexOf(te.ref.current))},[A.collectionRef,A.itemMap])}return[{Provider:f,Slot:_,ItemSlot:E},M,o]}var useLayoutEffect2=globalThis!=null&&globalThis.document?React__namespace.useLayoutEffect:()=>{},useReactId=React__namespace[" useId ".trim().toString()]||(()=>{}),count$3=0;function useId(e){const[t,n]=React__namespace.useState(useReactId());return useLayoutEffect2(()=>{n(o=>o??String(count$3++))},[e]),t?`radix-${t}`:""}function useCallbackRef$1(e){const t=React__namespace.useRef(e);return React__namespace.useEffect(()=>{t.current=e}),React__namespace.useMemo(()=>(...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[])}var useInsertionEffect=React__namespace[" useInsertionEffect ".trim().toString()]||useLayoutEffect2;function useControllableState({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[l,d,f]=useUncontrolledState({defaultProp:t,onChange:n}),g=e!==void 0,b=g?e:l;{const S=React__namespace.useRef(e!==void 0);React__namespace.useEffect(()=>{const R=S.current;R!==g&&console.warn(`${o} is changing from ${R?"controlled":"uncontrolled"} to ${g?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),S.current=g},[g,o])}const _=React__namespace.useCallback(S=>{var R;if(g){const C=isFunction$5(S)?S(e):S;C!==e&&((R=f.current)==null||R.call(f,C))}else d(S)},[g,e,d,f]);return[b,_]}function useUncontrolledState({defaultProp:e,onChange:t}){const[n,o]=React__namespace.useState(e),l=React__namespace.useRef(n),d=React__namespace.useRef(t);return useInsertionEffect(()=>{d.current=t},[t]),React__namespace.useEffect(()=>{var f;l.current!==n&&((f=d.current)==null||f.call(d,n),l.current=n)},[n,l]),[n,o,d]}function isFunction$5(e){return typeof e=="function"}var DirectionContext=React__namespace.createContext(void 0);function useDirection(e){const t=React__namespace.useContext(DirectionContext);return e||t||"ltr"}var ENTRY_FOCUS="rovingFocusGroup.onEntryFocus",EVENT_OPTIONS$1={bubbles:!1,cancelable:!0},GROUP_NAME$3="RovingFocusGroup",[Collection$3,useCollection$3,createCollectionScope$3]=createCollection(GROUP_NAME$3),[createRovingFocusGroupContext,createRovingFocusGroupScope]=createContextScope(GROUP_NAME$3,[createCollectionScope$3]),[RovingFocusProvider,useRovingFocusContext]=createRovingFocusGroupContext(GROUP_NAME$3),RovingFocusGroup=React__namespace.forwardRef((e,t)=>jsxRuntime.jsx(Collection$3.Provider,{scope:e.__scopeRovingFocusGroup,children:jsxRuntime.jsx(Collection$3.Slot,{scope:e.__scopeRovingFocusGroup,children:jsxRuntime.jsx(RovingFocusGroupImpl,{...e,ref:t})})}));RovingFocusGroup.displayName=GROUP_NAME$3;var RovingFocusGroupImpl=React__namespace.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:l=!1,dir:d,currentTabStopId:f,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:b,onEntryFocus:_,preventScrollOnEntryFocus:S=!1,...R}=e,C=React__namespace.useRef(null),E=useComposedRefs(t,C),M=useDirection(d),[I,A]=useControllableState({prop:f,defaultProp:g??null,onChange:b,caller:GROUP_NAME$3}),[O,q]=React__namespace.useState(!1),z=useCallbackRef$1(_),Q=useCollection$3(n),F=React__namespace.useRef(!1),[V,te]=React__namespace.useState(0);return React__namespace.useEffect(()=>{const ie=C.current;if(ie)return ie.addEventListener(ENTRY_FOCUS,z),()=>ie.removeEventListener(ENTRY_FOCUS,z)},[z]),jsxRuntime.jsx(RovingFocusProvider,{scope:n,orientation:o,dir:M,loop:l,currentTabStopId:I,onItemFocus:React__namespace.useCallback(ie=>A(ie),[A]),onItemShiftTab:React__namespace.useCallback(()=>q(!0),[]),onFocusableItemAdd:React__namespace.useCallback(()=>te(ie=>ie+1),[]),onFocusableItemRemove:React__namespace.useCallback(()=>te(ie=>ie-1),[]),children:jsxRuntime.jsx(Primitive.div,{tabIndex:O||V===0?-1:0,"data-orientation":o,...R,ref:E,style:{outline:"none",...e.style},onMouseDown:composeEventHandlers(e.onMouseDown,()=>{F.current=!0}),onFocus:composeEventHandlers(e.onFocus,ie=>{const ae=!F.current;if(ie.target===ie.currentTarget&&ae&&!O){const oe=new CustomEvent(ENTRY_FOCUS,EVENT_OPTIONS$1);if(ie.currentTarget.dispatchEvent(oe),!oe.defaultPrevented){const se=Q().filter(Le=>Le.focusable),ge=se.find(Le=>Le.active),Ae=se.find(Le=>Le.id===I),Oe=[ge,Ae,...se].filter(Boolean).map(Le=>Le.ref.current);focusFirst$3(Oe,S)}}F.current=!1}),onBlur:composeEventHandlers(e.onBlur,()=>q(!1))})})}),ITEM_NAME$4="RovingFocusGroupItem",RovingFocusGroupItem=React__namespace.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:l=!1,tabStopId:d,children:f,...g}=e,b=useId(),_=d||b,S=useRovingFocusContext(ITEM_NAME$4,n),R=S.currentTabStopId===_,C=useCollection$3(n),{onFocusableItemAdd:E,onFocusableItemRemove:M,currentTabStopId:I}=S;return React__namespace.useEffect(()=>{if(o)return E(),()=>M()},[o,E,M]),jsxRuntime.jsx(Collection$3.ItemSlot,{scope:n,id:_,focusable:o,active:l,children:jsxRuntime.jsx(Primitive.span,{tabIndex:R?0:-1,"data-orientation":S.orientation,...g,ref:t,onMouseDown:composeEventHandlers(e.onMouseDown,A=>{o?S.onItemFocus(_):A.preventDefault()}),onFocus:composeEventHandlers(e.onFocus,()=>S.onItemFocus(_)),onKeyDown:composeEventHandlers(e.onKeyDown,A=>{if(A.key==="Tab"&&A.shiftKey){S.onItemShiftTab();return}if(A.target!==A.currentTarget)return;const O=getFocusIntent(A,S.orientation,S.dir);if(O!==void 0){if(A.metaKey||A.ctrlKey||A.altKey||A.shiftKey)return;A.preventDefault();let z=C().filter(Q=>Q.focusable).map(Q=>Q.ref.current);if(O==="last")z.reverse();else if(O==="prev"||O==="next"){O==="prev"&&z.reverse();const Q=z.indexOf(A.currentTarget);z=S.loop?wrapArray$2(z,Q+1):z.slice(Q+1)}setTimeout(()=>focusFirst$3(z))}}),children:typeof f=="function"?f({isCurrentTabStop:R,hasTabStop:I!=null}):f})})});RovingFocusGroupItem.displayName=ITEM_NAME$4;var MAP_KEY_TO_FOCUS_INTENT={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function getDirectionAwareKey(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function getFocusIntent(e,t,n){const o=getDirectionAwareKey(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return MAP_KEY_TO_FOCUS_INTENT[o]}function focusFirst$3(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function wrapArray$2(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Root$9=RovingFocusGroup,Item$1=RovingFocusGroupItem;function useSize(e){const[t,n]=React__namespace.useState(void 0);return useLayoutEffect2(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const d=l[0];let f,g;if("borderBoxSize"in d){const b=d.borderBoxSize,_=Array.isArray(b)?b[0]:b;f=_.inlineSize,g=_.blockSize}else f=e.offsetWidth,g=e.offsetHeight;n({width:f,height:g})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}function usePrevious(e){const t=React__namespace.useRef({value:e,previous:e});return React__namespace.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function useStateMachine$1(e,t){return React__namespace.useReducer((n,o)=>t[n][o]??n,e)}var Presence=e=>{const{present:t,children:n}=e,o=usePresence(t),l=typeof n=="function"?n({present:o.isPresent}):React__namespace.Children.only(n),d=useComposedRefs(o.ref,getElementRef(l));return typeof n=="function"||o.isPresent?React__namespace.cloneElement(l,{ref:d}):null};Presence.displayName="Presence";function usePresence(e){const[t,n]=React__namespace.useState(),o=React__namespace.useRef(null),l=React__namespace.useRef(e),d=React__namespace.useRef("none"),f=e?"mounted":"unmounted",[g,b]=useStateMachine$1(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return React__namespace.useEffect(()=>{const _=getAnimationName(o.current);d.current=g==="mounted"?_:"none"},[g]),useLayoutEffect2(()=>{const _=o.current,S=l.current;if(S!==e){const C=d.current,E=getAnimationName(_);e?b("MOUNT"):E==="none"||(_==null?void 0:_.display)==="none"?b("UNMOUNT"):b(S&&C!==E?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,b]),useLayoutEffect2(()=>{if(t){let _;const S=t.ownerDocument.defaultView??window,R=E=>{const I=getAnimationName(o.current).includes(E.animationName);if(E.target===t&&I&&(b("ANIMATION_END"),!l.current)){const A=t.style.animationFillMode;t.style.animationFillMode="forwards",_=S.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=A)})}},C=E=>{E.target===t&&(d.current=getAnimationName(o.current))};return t.addEventListener("animationstart",C),t.addEventListener("animationcancel",R),t.addEventListener("animationend",R),()=>{S.clearTimeout(_),t.removeEventListener("animationstart",C),t.removeEventListener("animationcancel",R),t.removeEventListener("animationend",R)}}else b("ANIMATION_END")},[t,b]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:React__namespace.useCallback(_=>{o.current=_?getComputedStyle(_):null,n(_)},[])}}function getAnimationName(e){return(e==null?void 0:e.animationName)||"none"}function getElementRef(e){var o,l;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var RADIO_NAME="Radio",[createRadioContext,createRadioScope]=createContextScope(RADIO_NAME),[RadioProvider,useRadioContext]=createRadioContext(RADIO_NAME),Radio=React__namespace.forwardRef((e,t)=>{const{__scopeRadio:n,name:o,checked:l=!1,required:d,disabled:f,value:g="on",onCheck:b,form:_,...S}=e,[R,C]=React__namespace.useState(null),E=useComposedRefs(t,A=>C(A)),M=React__namespace.useRef(!1),I=R?_||!!R.closest("form"):!0;return jsxRuntime.jsxs(RadioProvider,{scope:n,checked:l,disabled:f,children:[jsxRuntime.jsx(Primitive.button,{type:"button",role:"radio","aria-checked":l,"data-state":getState$4(l),"data-disabled":f?"":void 0,disabled:f,value:g,...S,ref:E,onClick:composeEventHandlers(e.onClick,A=>{l||b==null||b(),I&&(M.current=A.isPropagationStopped(),M.current||A.stopPropagation())})}),I&&jsxRuntime.jsx(RadioBubbleInput,{control:R,bubbles:!M.current,name:o,value:g,checked:l,required:d,disabled:f,form:_,style:{transform:"translateX(-100%)"}})]})});Radio.displayName=RADIO_NAME;var INDICATOR_NAME$2="RadioIndicator",RadioIndicator=React__namespace.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:o,...l}=e,d=useRadioContext(INDICATOR_NAME$2,n);return jsxRuntime.jsx(Presence,{present:o||d.checked,children:jsxRuntime.jsx(Primitive.span,{"data-state":getState$4(d.checked),"data-disabled":d.disabled?"":void 0,...l,ref:t})})});RadioIndicator.displayName=INDICATOR_NAME$2;var BUBBLE_INPUT_NAME$3="RadioBubbleInput",RadioBubbleInput=React__namespace.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:o=!0,...l},d)=>{const f=React__namespace.useRef(null),g=useComposedRefs(f,d),b=usePrevious(n),_=useSize(t);return React__namespace.useEffect(()=>{const S=f.current;if(!S)return;const R=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(R,"checked").set;if(b!==n&&E){const M=new Event("click",{bubbles:o});E.call(S,n),S.dispatchEvent(M)}},[b,n,o]),jsxRuntime.jsx(Primitive.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...l,tabIndex:-1,ref:g,style:{...l.style,..._,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});RadioBubbleInput.displayName=BUBBLE_INPUT_NAME$3;function getState$4(e){return e?"checked":"unchecked"}var ARROW_KEYS=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],RADIO_GROUP_NAME$2="RadioGroup",[createRadioGroupContext,createRadioGroupScope]=createContextScope(RADIO_GROUP_NAME$2,[createRovingFocusGroupScope,createRadioScope]),useRovingFocusGroupScope$2=createRovingFocusGroupScope(),useRadioScope=createRadioScope(),[RadioGroupProvider$1,useRadioGroupContext$1]=createRadioGroupContext(RADIO_GROUP_NAME$2),RadioGroup$2=React__namespace.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:o,defaultValue:l,value:d,required:f=!1,disabled:g=!1,orientation:b,dir:_,loop:S=!0,onValueChange:R,...C}=e,E=useRovingFocusGroupScope$2(n),M=useDirection(_),[I,A]=useControllableState({prop:d,defaultProp:l??null,onChange:R,caller:RADIO_GROUP_NAME$2});return jsxRuntime.jsx(RadioGroupProvider$1,{scope:n,name:o,required:f,disabled:g,value:I,onValueChange:A,children:jsxRuntime.jsx(Root$9,{asChild:!0,...E,orientation:b,dir:M,loop:S,children:jsxRuntime.jsx(Primitive.div,{role:"radiogroup","aria-required":f,"aria-orientation":b,"data-disabled":g?"":void 0,dir:M,...C,ref:t})})})});RadioGroup$2.displayName=RADIO_GROUP_NAME$2;var ITEM_NAME$3="RadioGroupItem",RadioGroupItem$1=React__namespace.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:o,...l}=e,d=useRadioGroupContext$1(ITEM_NAME$3,n),f=d.disabled||o,g=useRovingFocusGroupScope$2(n),b=useRadioScope(n),_=React__namespace.useRef(null),S=useComposedRefs(t,_),R=d.value===l.value,C=React__namespace.useRef(!1);return React__namespace.useEffect(()=>{const E=I=>{ARROW_KEYS.includes(I.key)&&(C.current=!0)},M=()=>C.current=!1;return document.addEventListener("keydown",E),document.addEventListener("keyup",M),()=>{document.removeEventListener("keydown",E),document.removeEventListener("keyup",M)}},[]),jsxRuntime.jsx(Item$1,{asChild:!0,...g,focusable:!f,active:R,children:jsxRuntime.jsx(Radio,{disabled:f,required:d.required,checked:R,...b,...l,name:d.name,ref:S,onCheck:()=>d.onValueChange(l.value),onKeyDown:composeEventHandlers(E=>{E.key==="Enter"&&E.preventDefault()}),onFocus:composeEventHandlers(l.onFocus,()=>{var E;C.current&&((E=_.current)==null||E.click())})})})});RadioGroupItem$1.displayName=ITEM_NAME$3;var INDICATOR_NAME2="RadioGroupIndicator",RadioGroupIndicator=React__namespace.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...o}=e,l=useRadioScope(n);return jsxRuntime.jsx(RadioIndicator,{...l,...o,ref:t})});RadioGroupIndicator.displayName=INDICATOR_NAME2;var Root2$6=RadioGroup$2,Item2$2=RadioGroupItem$1,Indicator=RadioGroupIndicator;const RadioGroup$1=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Root2$6,{className:cn("grid gap-2",e),...t,ref:n}));RadioGroup$1.displayName=Root2$6.displayName;const RadioGroupItem=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Item2$2,{ref:n,className:cn("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow-sm focus:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:jsxRuntime.jsx(Indicator,{className:"flex items-center justify-center",children:jsxRuntime.jsx(Circle,{className:"h-3.5 w-3.5 fill-primary"})})}));RadioGroupItem.displayName=Item2$2.displayName;function useEscapeKeydown(e,t=globalThis==null?void 0:globalThis.document){const n=useCallbackRef$1(e);React__namespace.useEffect(()=>{const o=l=>{l.key==="Escape"&&n(l)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var DISMISSABLE_LAYER_NAME="DismissableLayer",CONTEXT_UPDATE="dismissableLayer.update",POINTER_DOWN_OUTSIDE="dismissableLayer.pointerDownOutside",FOCUS_OUTSIDE="dismissableLayer.focusOutside",originalBodyPointerEvents,DismissableLayerContext=React__namespace.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),DismissableLayer=React__namespace.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:f,onDismiss:g,...b}=e,_=React__namespace.useContext(DismissableLayerContext),[S,R]=React__namespace.useState(null),C=(S==null?void 0:S.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,E]=React__namespace.useState({}),M=useComposedRefs(t,te=>R(te)),I=Array.from(_.layers),[A]=[..._.layersWithOutsidePointerEventsDisabled].slice(-1),O=I.indexOf(A),q=S?I.indexOf(S):-1,z=_.layersWithOutsidePointerEventsDisabled.size>0,Q=q>=O,F=usePointerDownOutside(te=>{const ie=te.target,ae=[..._.branches].some(oe=>oe.contains(ie));!Q||ae||(l==null||l(te),f==null||f(te),te.defaultPrevented||g==null||g())},C),V=useFocusOutside(te=>{const ie=te.target;[..._.branches].some(oe=>oe.contains(ie))||(d==null||d(te),f==null||f(te),te.defaultPrevented||g==null||g())},C);return useEscapeKeydown(te=>{q===_.layers.size-1&&(o==null||o(te),!te.defaultPrevented&&g&&(te.preventDefault(),g()))},C),React__namespace.useEffect(()=>{if(S)return n&&(_.layersWithOutsidePointerEventsDisabled.size===0&&(originalBodyPointerEvents=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),_.layersWithOutsidePointerEventsDisabled.add(S)),_.layers.add(S),dispatchUpdate(),()=>{n&&_.layersWithOutsidePointerEventsDisabled.size===1&&(C.body.style.pointerEvents=originalBodyPointerEvents)}},[S,C,n,_]),React__namespace.useEffect(()=>()=>{S&&(_.layers.delete(S),_.layersWithOutsidePointerEventsDisabled.delete(S),dispatchUpdate())},[S,_]),React__namespace.useEffect(()=>{const te=()=>E({});return document.addEventListener(CONTEXT_UPDATE,te),()=>document.removeEventListener(CONTEXT_UPDATE,te)},[]),jsxRuntime.jsx(Primitive.div,{...b,ref:M,style:{pointerEvents:z?Q?"auto":"none":void 0,...e.style},onFocusCapture:composeEventHandlers(e.onFocusCapture,V.onFocusCapture),onBlurCapture:composeEventHandlers(e.onBlurCapture,V.onBlurCapture),onPointerDownCapture:composeEventHandlers(e.onPointerDownCapture,F.onPointerDownCapture)})});DismissableLayer.displayName=DISMISSABLE_LAYER_NAME;var BRANCH_NAME="DismissableLayerBranch",DismissableLayerBranch=React__namespace.forwardRef((e,t)=>{const n=React__namespace.useContext(DismissableLayerContext),o=React__namespace.useRef(null),l=useComposedRefs(t,o);return React__namespace.useEffect(()=>{const d=o.current;if(d)return n.branches.add(d),()=>{n.branches.delete(d)}},[n.branches]),jsxRuntime.jsx(Primitive.div,{...e,ref:l})});DismissableLayerBranch.displayName=BRANCH_NAME;function usePointerDownOutside(e,t=globalThis==null?void 0:globalThis.document){const n=useCallbackRef$1(e),o=React__namespace.useRef(!1),l=React__namespace.useRef(()=>{});return React__namespace.useEffect(()=>{const d=g=>{if(g.target&&!o.current){let b=function(){handleAndDispatchCustomEvent$1(POINTER_DOWN_OUTSIDE,n,_,{discrete:!0})};const _={originalEvent:g};g.pointerType==="touch"?(t.removeEventListener("click",l.current),l.current=b,t.addEventListener("click",l.current,{once:!0})):b()}else t.removeEventListener("click",l.current);o.current=!1},f=window.setTimeout(()=>{t.addEventListener("pointerdown",d)},0);return()=>{window.clearTimeout(f),t.removeEventListener("pointerdown",d),t.removeEventListener("click",l.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function useFocusOutside(e,t=globalThis==null?void 0:globalThis.document){const n=useCallbackRef$1(e),o=React__namespace.useRef(!1);return React__namespace.useEffect(()=>{const l=d=>{d.target&&!o.current&&handleAndDispatchCustomEvent$1(FOCUS_OUTSIDE,n,{originalEvent:d},{discrete:!1})};return t.addEventListener("focusin",l),()=>t.removeEventListener("focusin",l)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function dispatchUpdate(){const e=new CustomEvent(CONTEXT_UPDATE);document.dispatchEvent(e)}function handleAndDispatchCustomEvent$1(e,t,n,{discrete:o}){const l=n.originalEvent.target,d=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&l.addEventListener(e,t,{once:!0}),o?dispatchDiscreteCustomEvent(l,d):l.dispatchEvent(d)}var Root$8=DismissableLayer,Branch=DismissableLayerBranch,AUTOFOCUS_ON_MOUNT="focusScope.autoFocusOnMount",AUTOFOCUS_ON_UNMOUNT="focusScope.autoFocusOnUnmount",EVENT_OPTIONS={bubbles:!1,cancelable:!0},FOCUS_SCOPE_NAME="FocusScope",FocusScope=React__namespace.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:l,onUnmountAutoFocus:d,...f}=e,[g,b]=React__namespace.useState(null),_=useCallbackRef$1(l),S=useCallbackRef$1(d),R=React__namespace.useRef(null),C=useComposedRefs(t,I=>b(I)),E=React__namespace.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;React__namespace.useEffect(()=>{if(o){let I=function(z){if(E.paused||!g)return;const Q=z.target;g.contains(Q)?R.current=Q:focus(R.current,{select:!0})},A=function(z){if(E.paused||!g)return;const Q=z.relatedTarget;Q!==null&&(g.contains(Q)||focus(R.current,{select:!0}))},O=function(z){if(document.activeElement===document.body)for(const F of z)F.removedNodes.length>0&&focus(g)};document.addEventListener("focusin",I),document.addEventListener("focusout",A);const q=new MutationObserver(O);return g&&q.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",I),document.removeEventListener("focusout",A),q.disconnect()}}},[o,g,E.paused]),React__namespace.useEffect(()=>{if(g){focusScopesStack.add(E);const I=document.activeElement;if(!g.contains(I)){const O=new CustomEvent(AUTOFOCUS_ON_MOUNT,EVENT_OPTIONS);g.addEventListener(AUTOFOCUS_ON_MOUNT,_),g.dispatchEvent(O),O.defaultPrevented||(focusFirst$2(removeLinks(getTabbableCandidates$1(g)),{select:!0}),document.activeElement===I&&focus(g))}return()=>{g.removeEventListener(AUTOFOCUS_ON_MOUNT,_),setTimeout(()=>{const O=new CustomEvent(AUTOFOCUS_ON_UNMOUNT,EVENT_OPTIONS);g.addEventListener(AUTOFOCUS_ON_UNMOUNT,S),g.dispatchEvent(O),O.defaultPrevented||focus(I??document.body,{select:!0}),g.removeEventListener(AUTOFOCUS_ON_UNMOUNT,S),focusScopesStack.remove(E)},0)}}},[g,_,S,E]);const M=React__namespace.useCallback(I=>{if(!n&&!o||E.paused)return;const A=I.key==="Tab"&&!I.altKey&&!I.ctrlKey&&!I.metaKey,O=document.activeElement;if(A&&O){const q=I.currentTarget,[z,Q]=getTabbableEdges(q);z&&Q?!I.shiftKey&&O===Q?(I.preventDefault(),n&&focus(z,{select:!0})):I.shiftKey&&O===z&&(I.preventDefault(),n&&focus(Q,{select:!0})):O===q&&I.preventDefault()}},[n,o,E.paused]);return jsxRuntime.jsx(Primitive.div,{tabIndex:-1,...f,ref:C,onKeyDown:M})});FocusScope.displayName=FOCUS_SCOPE_NAME;function focusFirst$2(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(focus(o,{select:t}),document.activeElement!==n)return}function getTabbableEdges(e){const t=getTabbableCandidates$1(e),n=findVisible(t,e),o=findVisible(t.reverse(),e);return[n,o]}function getTabbableCandidates$1(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const l=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||l?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function findVisible(e,t){for(const n of e)if(!isHidden(n,{upTo:t}))return n}function isHidden(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function isSelectableInput(e){return e instanceof HTMLInputElement&&"select"in e}function focus(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&isSelectableInput(e)&&t&&e.select()}}var focusScopesStack=createFocusScopesStack();function createFocusScopesStack(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=arrayRemove(e,t),e.unshift(t)},remove(t){var n;e=arrayRemove(e,t),(n=e[0])==null||n.resume()}}}function arrayRemove(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function removeLinks(e){return e.filter(t=>t.tagName!=="A")}var PORTAL_NAME$6="Portal",Portal$5=React__namespace.forwardRef((e,t)=>{var g;const{container:n,...o}=e,[l,d]=React__namespace.useState(!1);useLayoutEffect2(()=>d(!0),[]);const f=n||l&&((g=globalThis==null?void 0:globalThis.document)==null?void 0:g.body);return f?ReactDOM.createPortal(jsxRuntime.jsx(Primitive.div,{...o,ref:t}),f):null});Portal$5.displayName=PORTAL_NAME$6;var count$2=0;function useFocusGuards(){React__namespace.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??createFocusGuard()),document.body.insertAdjacentElement("beforeend",e[1]??createFocusGuard()),count$2++,()=>{count$2===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),count$2--}},[])}function createFocusGuard(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var __assign$1=function(){return __assign$1=Object.assign||function(t){for(var n,o=1,l=arguments.length;o<l;o++){n=arguments[o];for(var d in n)Object.prototype.hasOwnProperty.call(n,d)&&(t[d]=n[d])}return t},__assign$1.apply(this,arguments)};function __rest(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,o=Object.getOwnPropertySymbols(e);l<o.length;l++)t.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(n[o[l]]=e[o[l]]);return n}function __spreadArray(e,t,n){if(n||arguments.length===2)for(var o=0,l=t.length,d;o<l;o++)(d||!(o in t))&&(d||(d=Array.prototype.slice.call(t,0,o)),d[o]=t[o]);return e.concat(d||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var zeroRightClassName="right-scroll-bar-position",fullWidthClassName="width-before-scroll-bar",noScrollbarsClassName="with-scroll-bars-hidden",removedBarSizeVariable="--removed-body-scroll-bar-size";function assignRef(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function useCallbackRef(e,t){var n=React.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var l=n.value;l!==o&&(n.value=o,n.callback(o,l))}}}})[0];return n.callback=t,n.facade}var useIsomorphicLayoutEffect$2=typeof window<"u"?React__namespace.useLayoutEffect:React__namespace.useEffect,currentValues=new WeakMap;function useMergeRefs(e,t){var n=useCallbackRef(null,function(o){return e.forEach(function(l){return assignRef(l,o)})});return useIsomorphicLayoutEffect$2(function(){var o=currentValues.get(n);if(o){var l=new Set(o),d=new Set(e),f=n.current;l.forEach(function(g){d.has(g)||assignRef(g,null)}),d.forEach(function(g){l.has(g)||assignRef(g,f)})}currentValues.set(n,e)},[e]),n}function ItoI(e){return e}function innerCreateMedium(e,t){t===void 0&&(t=ItoI);var n=[],o=!1,l={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(d){var f=t(d,o);return n.push(f),function(){n=n.filter(function(g){return g!==f})}},assignSyncMedium:function(d){for(o=!0;n.length;){var f=n;n=[],f.forEach(d)}n={push:function(g){return d(g)},filter:function(){return n}}},assignMedium:function(d){o=!0;var f=[];if(n.length){var g=n;n=[],g.forEach(d),f=n}var b=function(){var S=f;f=[],S.forEach(d)},_=function(){return Promise.resolve().then(b)};_(),n={push:function(S){f.push(S),_()},filter:function(S){return f=f.filter(S),n}}}};return l}function createSidecarMedium(e){e===void 0&&(e={});var t=innerCreateMedium(null);return t.options=__assign$1({async:!0,ssr:!1},e),t}var SideCar$1=function(e){var t=e.sideCar,n=__rest(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return React__namespace.createElement(o,__assign$1({},n))};SideCar$1.isSideCarExport=!0;function exportSidecar(e,t){return e.useMedium(t),SideCar$1}var effectCar=createSidecarMedium(),nothing=function(){},RemoveScroll=React__namespace.forwardRef(function(e,t){var n=React__namespace.useRef(null),o=React__namespace.useState({onScrollCapture:nothing,onWheelCapture:nothing,onTouchMoveCapture:nothing}),l=o[0],d=o[1],f=e.forwardProps,g=e.children,b=e.className,_=e.removeScrollBar,S=e.enabled,R=e.shards,C=e.sideCar,E=e.noIsolation,M=e.inert,I=e.allowPinchZoom,A=e.as,O=A===void 0?"div":A,q=e.gapMode,z=__rest(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),Q=C,F=useMergeRefs([n,t]),V=__assign$1(__assign$1({},z),l);return React__namespace.createElement(React__namespace.Fragment,null,S&&React__namespace.createElement(Q,{sideCar:effectCar,removeScrollBar:_,shards:R,noIsolation:E,inert:M,setCallbacks:d,allowPinchZoom:!!I,lockRef:n,gapMode:q}),f?React__namespace.cloneElement(React__namespace.Children.only(g),__assign$1(__assign$1({},V),{ref:F})):React__namespace.createElement(O,__assign$1({},V,{className:b,ref:F}),g))});RemoveScroll.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},RemoveScroll.classNames={fullWidth:fullWidthClassName,zeroRight:zeroRightClassName};var getNonce=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function makeStyleTag(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=getNonce();return t&&e.setAttribute("nonce",t),e}function injectStyles(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function insertStyleTag(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var stylesheetSingleton=function(){var e=0,t=null;return{add:function(n){e==0&&(t=makeStyleTag())&&(injectStyles(t,n),insertStyleTag(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},styleHookSingleton=function(){var e=stylesheetSingleton();return function(t,n){React__namespace.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},styleSingleton=function(){var e=styleHookSingleton(),t=function(n){var o=n.styles,l=n.dynamic;return e(o,l),null};return t},zeroGap={left:0,top:0,right:0,gap:0},parse=function(e){return parseInt(e||"",10)||0},getOffset$1=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],l=t[e==="padding"?"paddingRight":"marginRight"];return[parse(n),parse(o),parse(l)]},getGapWidth=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return zeroGap;var t=getOffset$1(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},Style=styleSingleton(),lockAttribute="data-scroll-locked",getStyles=function(e,t,n,o){var l=e.left,d=e.top,f=e.right,g=e.gap;return n===void 0&&(n="margin"),`
|
|
355
|
+
*/const __iconNode=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],X$1=createLucideIcon("X",__iconNode);function r(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(n=r(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function clsx(){for(var e,t,n=0,o="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=r(e))&&(o&&(o+=" "),o+=t);return o}const CLASS_PART_SEPARATOR="-",createClassGroupUtils=e=>{const t=createClassMap(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:f=>{const g=f.split(CLASS_PART_SEPARATOR);return g[0]===""&&g.length!==1&&g.shift(),getGroupRecursive(g,t)||getGroupIdForArbitraryProperty(f)},getConflictingClassGroupIds:(f,g)=>{const b=n[f]||[];return g&&o[f]?[...b,...o[f]]:b}}},getGroupRecursive=(e,t)=>{var f;if(e.length===0)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),l=o?getGroupRecursive(e.slice(1),o):void 0;if(l)return l;if(t.validators.length===0)return;const d=e.join(CLASS_PART_SEPARATOR);return(f=t.validators.find(({validator:g})=>g(d)))==null?void 0:f.classGroupId},arbitraryPropertyRegex=/^\[(.+)\]$/,getGroupIdForArbitraryProperty=e=>{if(arbitraryPropertyRegex.test(e)){const t=arbitraryPropertyRegex.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},createClassMap=e=>{const{theme:t,classGroups:n}=e,o={nextPart:new Map,validators:[]};for(const l in n)processClassesRecursively(n[l],o,l,t);return o},processClassesRecursively=(e,t,n,o)=>{e.forEach(l=>{if(typeof l=="string"){const d=l===""?t:getPart(t,l);d.classGroupId=n;return}if(typeof l=="function"){if(isThemeGetter(l)){processClassesRecursively(l(o),t,n,o);return}t.validators.push({validator:l,classGroupId:n});return}Object.entries(l).forEach(([d,f])=>{processClassesRecursively(f,getPart(t,d),n,o)})})},getPart=(e,t)=>{let n=e;return t.split(CLASS_PART_SEPARATOR).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},isThemeGetter=e=>e.isThemeGetter,createLruCache$1=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const l=(d,f)=>{n.set(d,f),t++,t>e&&(t=0,o=n,n=new Map)};return{get(d){let f=n.get(d);if(f!==void 0)return f;if((f=o.get(d))!==void 0)return l(d,f),f},set(d,f){n.has(d)?n.set(d,f):l(d,f)}}},IMPORTANT_MODIFIER="!",MODIFIER_SEPARATOR=":",MODIFIER_SEPARATOR_LENGTH=MODIFIER_SEPARATOR.length,createParseClassName=e=>{const{prefix:t,experimentalParseClassName:n}=e;let o=l=>{const d=[];let f=0,g=0,b=0,_;for(let M=0;M<l.length;M++){let I=l[M];if(f===0&&g===0){if(I===MODIFIER_SEPARATOR){d.push(l.slice(b,M)),b=M+MODIFIER_SEPARATOR_LENGTH;continue}if(I==="/"){_=M;continue}}I==="["?f++:I==="]"?f--:I==="("?g++:I===")"&&g--}const S=d.length===0?l:l.substring(b),R=stripImportantModifier(S),C=R!==S,E=_&&_>b?_-b:void 0;return{modifiers:d,hasImportantModifier:C,baseClassName:R,maybePostfixModifierPosition:E}};if(t){const l=t+MODIFIER_SEPARATOR,d=o;o=f=>f.startsWith(l)?d(f.substring(l.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:f,maybePostfixModifierPosition:void 0}}if(n){const l=o;o=d=>n({className:d,parseClassName:l})}return o},stripImportantModifier=e=>e.endsWith(IMPORTANT_MODIFIER)?e.substring(0,e.length-1):e.startsWith(IMPORTANT_MODIFIER)?e.substring(1):e,createSortModifiers=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const l=[];let d=[];return o.forEach(f=>{f[0]==="["||t[f]?(l.push(...d.sort(),f),d=[]):d.push(f)}),l.push(...d.sort()),l}},createConfigUtils=e=>({cache:createLruCache$1(e.cacheSize),parseClassName:createParseClassName(e),sortModifiers:createSortModifiers(e),...createClassGroupUtils(e)}),SPLIT_CLASSES_REGEX=/\s+/,mergeClassList=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:l,sortModifiers:d}=t,f=[],g=e.trim().split(SPLIT_CLASSES_REGEX);let b="";for(let _=g.length-1;_>=0;_-=1){const S=g[_],{isExternal:R,modifiers:C,hasImportantModifier:E,baseClassName:M,maybePostfixModifierPosition:I}=n(S);if(R){b=S+(b.length>0?" "+b:b);continue}let A=!!I,O=o(A?M.substring(0,I):M);if(!O){if(!A){b=S+(b.length>0?" "+b:b);continue}if(O=o(M),!O){b=S+(b.length>0?" "+b:b);continue}A=!1}const q=d(C).join(":"),z=E?q+IMPORTANT_MODIFIER:q,Q=z+O;if(f.includes(Q))continue;f.push(Q);const F=l(O,A);for(let V=0;V<F.length;++V){const te=F[V];f.push(z+te)}b=S+(b.length>0?" "+b:b)}return b};function twJoin(){let e=0,t,n,o="";for(;e<arguments.length;)(t=arguments[e++])&&(n=toValue(t))&&(o&&(o+=" "),o+=n);return o}const toValue=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=toValue(e[o]))&&(n&&(n+=" "),n+=t);return n};function createTailwindMerge(e,...t){let n,o,l,d=f;function f(b){const _=t.reduce((S,R)=>R(S),e());return n=createConfigUtils(_),o=n.cache.get,l=n.cache.set,d=g,g(b)}function g(b){const _=o(b);if(_)return _;const S=mergeClassList(b,n);return l(b,S),S}return function(){return d(twJoin.apply(null,arguments))}}const fromTheme=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},arbitraryValueRegex=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,arbitraryVariableRegex=/^\((?:(\w[\w-]*):)?(.+)\)$/i,fractionRegex=/^\d+\/\d+$/,tshirtUnitRegex=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lengthUnitRegex=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,colorFunctionRegex=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,shadowRegex=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,imageRegex=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,isFraction=e=>fractionRegex.test(e),isNumber$2=e=>!!e&&!Number.isNaN(Number(e)),isInteger=e=>!!e&&Number.isInteger(Number(e)),isPercent$1=e=>e.endsWith("%")&&isNumber$2(e.slice(0,-1)),isTshirtSize=e=>tshirtUnitRegex.test(e),isAny=()=>!0,isLengthOnly=e=>lengthUnitRegex.test(e)&&!colorFunctionRegex.test(e),isNever=()=>!1,isShadow=e=>shadowRegex.test(e),isImage=e=>imageRegex.test(e),isAnyNonArbitrary=e=>!isArbitraryValue(e)&&!isArbitraryVariable(e),isArbitrarySize=e=>getIsArbitraryValue(e,isLabelSize,isNever),isArbitraryValue=e=>arbitraryValueRegex.test(e),isArbitraryLength=e=>getIsArbitraryValue(e,isLabelLength,isLengthOnly),isArbitraryNumber=e=>getIsArbitraryValue(e,isLabelNumber,isNumber$2),isArbitraryPosition=e=>getIsArbitraryValue(e,isLabelPosition,isNever),isArbitraryImage=e=>getIsArbitraryValue(e,isLabelImage,isImage),isArbitraryShadow=e=>getIsArbitraryValue(e,isLabelShadow,isShadow),isArbitraryVariable=e=>arbitraryVariableRegex.test(e),isArbitraryVariableLength=e=>getIsArbitraryVariable(e,isLabelLength),isArbitraryVariableFamilyName=e=>getIsArbitraryVariable(e,isLabelFamilyName),isArbitraryVariablePosition=e=>getIsArbitraryVariable(e,isLabelPosition),isArbitraryVariableSize=e=>getIsArbitraryVariable(e,isLabelSize),isArbitraryVariableImage=e=>getIsArbitraryVariable(e,isLabelImage),isArbitraryVariableShadow=e=>getIsArbitraryVariable(e,isLabelShadow,!0),getIsArbitraryValue=(e,t,n)=>{const o=arbitraryValueRegex.exec(e);return o?o[1]?t(o[1]):n(o[2]):!1},getIsArbitraryVariable=(e,t,n=!1)=>{const o=arbitraryVariableRegex.exec(e);return o?o[1]?t(o[1]):n:!1},isLabelPosition=e=>e==="position"||e==="percentage",isLabelImage=e=>e==="image"||e==="url",isLabelSize=e=>e==="length"||e==="size"||e==="bg-size",isLabelLength=e=>e==="length",isLabelNumber=e=>e==="number",isLabelFamilyName=e=>e==="family-name",isLabelShadow=e=>e==="shadow",getDefaultConfig=()=>{const e=fromTheme("color"),t=fromTheme("font"),n=fromTheme("text"),o=fromTheme("font-weight"),l=fromTheme("tracking"),d=fromTheme("leading"),f=fromTheme("breakpoint"),g=fromTheme("container"),b=fromTheme("spacing"),_=fromTheme("radius"),S=fromTheme("shadow"),R=fromTheme("inset-shadow"),C=fromTheme("text-shadow"),E=fromTheme("drop-shadow"),M=fromTheme("blur"),I=fromTheme("perspective"),A=fromTheme("aspect"),O=fromTheme("ease"),q=fromTheme("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Q=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],F=()=>[...Q(),isArbitraryVariable,isArbitraryValue],V=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto","contain","none"],ie=()=>[isArbitraryVariable,isArbitraryValue,b],ae=()=>[isFraction,"full","auto",...ie()],oe=()=>[isInteger,"none","subgrid",isArbitraryVariable,isArbitraryValue],se=()=>["auto",{span:["full",isInteger,isArbitraryVariable,isArbitraryValue]},isInteger,isArbitraryVariable,isArbitraryValue],ge=()=>[isInteger,"auto",isArbitraryVariable,isArbitraryValue],Ae=()=>["auto","min","max","fr",isArbitraryVariable,isArbitraryValue],Ne=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Oe=()=>["start","end","center","stretch","center-safe","end-safe"],Le=()=>["auto",...ie()],Ge=()=>[isFraction,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...ie()],je=()=>[e,isArbitraryVariable,isArbitraryValue],Be=()=>[...Q(),isArbitraryVariablePosition,isArbitraryPosition,{position:[isArbitraryVariable,isArbitraryValue]}],Fe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ze=()=>["auto","cover","contain",isArbitraryVariableSize,isArbitrarySize,{size:[isArbitraryVariable,isArbitraryValue]}],He=()=>[isPercent$1,isArbitraryVariableLength,isArbitraryLength],Xe=()=>["","none","full",_,isArbitraryVariable,isArbitraryValue],Je=()=>["",isNumber$2,isArbitraryVariableLength,isArbitraryLength],Ye=()=>["solid","dashed","dotted","double"],at=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ke=()=>[isNumber$2,isPercent$1,isArbitraryVariablePosition,isArbitraryPosition],tt=()=>["","none",M,isArbitraryVariable,isArbitraryValue],Ze=()=>["none",isNumber$2,isArbitraryVariable,isArbitraryValue],et=()=>["none",isNumber$2,isArbitraryVariable,isArbitraryValue],st=()=>[isNumber$2,isArbitraryVariable,isArbitraryValue],qe=()=>[isFraction,"full",...ie()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[isTshirtSize],breakpoint:[isTshirtSize],color:[isAny],container:[isTshirtSize],"drop-shadow":[isTshirtSize],ease:["in","out","in-out"],font:[isAnyNonArbitrary],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[isTshirtSize],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[isTshirtSize],shadow:[isTshirtSize],spacing:["px",isNumber$2],text:[isTshirtSize],"text-shadow":[isTshirtSize],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",isFraction,isArbitraryValue,isArbitraryVariable,A]}],container:["container"],columns:[{columns:[isNumber$2,isArbitraryValue,isArbitraryVariable,g]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:F()}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:te()}],"overscroll-x":[{"overscroll-x":te()}],"overscroll-y":[{"overscroll-y":te()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ae()}],"inset-x":[{"inset-x":ae()}],"inset-y":[{"inset-y":ae()}],start:[{start:ae()}],end:[{end:ae()}],top:[{top:ae()}],right:[{right:ae()}],bottom:[{bottom:ae()}],left:[{left:ae()}],visibility:["visible","invisible","collapse"],z:[{z:[isInteger,"auto",isArbitraryVariable,isArbitraryValue]}],basis:[{basis:[isFraction,"full","auto",g,...ie()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[isNumber$2,isFraction,"auto","initial","none",isArbitraryValue]}],grow:[{grow:["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],shrink:[{shrink:["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],order:[{order:[isInteger,"first","last","none",isArbitraryVariable,isArbitraryValue]}],"grid-cols":[{"grid-cols":oe()}],"col-start-end":[{col:se()}],"col-start":[{"col-start":ge()}],"col-end":[{"col-end":ge()}],"grid-rows":[{"grid-rows":oe()}],"row-start-end":[{row:se()}],"row-start":[{"row-start":ge()}],"row-end":[{"row-end":ge()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ae()}],"auto-rows":[{"auto-rows":Ae()}],gap:[{gap:ie()}],"gap-x":[{"gap-x":ie()}],"gap-y":[{"gap-y":ie()}],"justify-content":[{justify:[...Ne(),"normal"]}],"justify-items":[{"justify-items":[...Oe(),"normal"]}],"justify-self":[{"justify-self":["auto",...Oe()]}],"align-content":[{content:["normal",...Ne()]}],"align-items":[{items:[...Oe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Oe(),{baseline:["","last"]}]}],"place-content":[{"place-content":Ne()}],"place-items":[{"place-items":[...Oe(),"baseline"]}],"place-self":[{"place-self":["auto",...Oe()]}],p:[{p:ie()}],px:[{px:ie()}],py:[{py:ie()}],ps:[{ps:ie()}],pe:[{pe:ie()}],pt:[{pt:ie()}],pr:[{pr:ie()}],pb:[{pb:ie()}],pl:[{pl:ie()}],m:[{m:Le()}],mx:[{mx:Le()}],my:[{my:Le()}],ms:[{ms:Le()}],me:[{me:Le()}],mt:[{mt:Le()}],mr:[{mr:Le()}],mb:[{mb:Le()}],ml:[{ml:Le()}],"space-x":[{"space-x":ie()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":ie()}],"space-y-reverse":["space-y-reverse"],size:[{size:Ge()}],w:[{w:[g,"screen",...Ge()]}],"min-w":[{"min-w":[g,"screen","none",...Ge()]}],"max-w":[{"max-w":[g,"screen","none","prose",{screen:[f]},...Ge()]}],h:[{h:["screen","lh",...Ge()]}],"min-h":[{"min-h":["screen","lh","none",...Ge()]}],"max-h":[{"max-h":["screen","lh",...Ge()]}],"font-size":[{text:["base",n,isArbitraryVariableLength,isArbitraryLength]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,isArbitraryVariable,isArbitraryNumber]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",isPercent$1,isArbitraryValue]}],"font-family":[{font:[isArbitraryVariableFamilyName,isArbitraryValue,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,isArbitraryVariable,isArbitraryValue]}],"line-clamp":[{"line-clamp":[isNumber$2,"none",isArbitraryVariable,isArbitraryNumber]}],leading:[{leading:[d,...ie()]}],"list-image":[{"list-image":["none",isArbitraryVariable,isArbitraryValue]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",isArbitraryVariable,isArbitraryValue]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:je()}],"text-color":[{text:je()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ye(),"wavy"]}],"text-decoration-thickness":[{decoration:[isNumber$2,"from-font","auto",isArbitraryVariable,isArbitraryLength]}],"text-decoration-color":[{decoration:je()}],"underline-offset":[{"underline-offset":[isNumber$2,"auto",isArbitraryVariable,isArbitraryValue]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ie()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",isArbitraryVariable,isArbitraryValue]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",isArbitraryVariable,isArbitraryValue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Be()}],"bg-repeat":[{bg:Fe()}],"bg-size":[{bg:ze()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},isInteger,isArbitraryVariable,isArbitraryValue],radial:["",isArbitraryVariable,isArbitraryValue],conic:[isInteger,isArbitraryVariable,isArbitraryValue]},isArbitraryVariableImage,isArbitraryImage]}],"bg-color":[{bg:je()}],"gradient-from-pos":[{from:He()}],"gradient-via-pos":[{via:He()}],"gradient-to-pos":[{to:He()}],"gradient-from":[{from:je()}],"gradient-via":[{via:je()}],"gradient-to":[{to:je()}],rounded:[{rounded:Xe()}],"rounded-s":[{"rounded-s":Xe()}],"rounded-e":[{"rounded-e":Xe()}],"rounded-t":[{"rounded-t":Xe()}],"rounded-r":[{"rounded-r":Xe()}],"rounded-b":[{"rounded-b":Xe()}],"rounded-l":[{"rounded-l":Xe()}],"rounded-ss":[{"rounded-ss":Xe()}],"rounded-se":[{"rounded-se":Xe()}],"rounded-ee":[{"rounded-ee":Xe()}],"rounded-es":[{"rounded-es":Xe()}],"rounded-tl":[{"rounded-tl":Xe()}],"rounded-tr":[{"rounded-tr":Xe()}],"rounded-br":[{"rounded-br":Xe()}],"rounded-bl":[{"rounded-bl":Xe()}],"border-w":[{border:Je()}],"border-w-x":[{"border-x":Je()}],"border-w-y":[{"border-y":Je()}],"border-w-s":[{"border-s":Je()}],"border-w-e":[{"border-e":Je()}],"border-w-t":[{"border-t":Je()}],"border-w-r":[{"border-r":Je()}],"border-w-b":[{"border-b":Je()}],"border-w-l":[{"border-l":Je()}],"divide-x":[{"divide-x":Je()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Je()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ye(),"hidden","none"]}],"divide-style":[{divide:[...Ye(),"hidden","none"]}],"border-color":[{border:je()}],"border-color-x":[{"border-x":je()}],"border-color-y":[{"border-y":je()}],"border-color-s":[{"border-s":je()}],"border-color-e":[{"border-e":je()}],"border-color-t":[{"border-t":je()}],"border-color-r":[{"border-r":je()}],"border-color-b":[{"border-b":je()}],"border-color-l":[{"border-l":je()}],"divide-color":[{divide:je()}],"outline-style":[{outline:[...Ye(),"none","hidden"]}],"outline-offset":[{"outline-offset":[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"outline-w":[{outline:["",isNumber$2,isArbitraryVariableLength,isArbitraryLength]}],"outline-color":[{outline:je()}],shadow:[{shadow:["","none",S,isArbitraryVariableShadow,isArbitraryShadow]}],"shadow-color":[{shadow:je()}],"inset-shadow":[{"inset-shadow":["none",R,isArbitraryVariableShadow,isArbitraryShadow]}],"inset-shadow-color":[{"inset-shadow":je()}],"ring-w":[{ring:Je()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:je()}],"ring-offset-w":[{"ring-offset":[isNumber$2,isArbitraryLength]}],"ring-offset-color":[{"ring-offset":je()}],"inset-ring-w":[{"inset-ring":Je()}],"inset-ring-color":[{"inset-ring":je()}],"text-shadow":[{"text-shadow":["none",C,isArbitraryVariableShadow,isArbitraryShadow]}],"text-shadow-color":[{"text-shadow":je()}],opacity:[{opacity:[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"mix-blend":[{"mix-blend":[...at(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":at()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[isNumber$2]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ke()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ke()}],"mask-image-linear-from-color":[{"mask-linear-from":je()}],"mask-image-linear-to-color":[{"mask-linear-to":je()}],"mask-image-t-from-pos":[{"mask-t-from":Ke()}],"mask-image-t-to-pos":[{"mask-t-to":Ke()}],"mask-image-t-from-color":[{"mask-t-from":je()}],"mask-image-t-to-color":[{"mask-t-to":je()}],"mask-image-r-from-pos":[{"mask-r-from":Ke()}],"mask-image-r-to-pos":[{"mask-r-to":Ke()}],"mask-image-r-from-color":[{"mask-r-from":je()}],"mask-image-r-to-color":[{"mask-r-to":je()}],"mask-image-b-from-pos":[{"mask-b-from":Ke()}],"mask-image-b-to-pos":[{"mask-b-to":Ke()}],"mask-image-b-from-color":[{"mask-b-from":je()}],"mask-image-b-to-color":[{"mask-b-to":je()}],"mask-image-l-from-pos":[{"mask-l-from":Ke()}],"mask-image-l-to-pos":[{"mask-l-to":Ke()}],"mask-image-l-from-color":[{"mask-l-from":je()}],"mask-image-l-to-color":[{"mask-l-to":je()}],"mask-image-x-from-pos":[{"mask-x-from":Ke()}],"mask-image-x-to-pos":[{"mask-x-to":Ke()}],"mask-image-x-from-color":[{"mask-x-from":je()}],"mask-image-x-to-color":[{"mask-x-to":je()}],"mask-image-y-from-pos":[{"mask-y-from":Ke()}],"mask-image-y-to-pos":[{"mask-y-to":Ke()}],"mask-image-y-from-color":[{"mask-y-from":je()}],"mask-image-y-to-color":[{"mask-y-to":je()}],"mask-image-radial":[{"mask-radial":[isArbitraryVariable,isArbitraryValue]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ke()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ke()}],"mask-image-radial-from-color":[{"mask-radial-from":je()}],"mask-image-radial-to-color":[{"mask-radial-to":je()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":Q()}],"mask-image-conic-pos":[{"mask-conic":[isNumber$2]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ke()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ke()}],"mask-image-conic-from-color":[{"mask-conic-from":je()}],"mask-image-conic-to-color":[{"mask-conic-to":je()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Be()}],"mask-repeat":[{mask:Fe()}],"mask-size":[{mask:ze()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",isArbitraryVariable,isArbitraryValue]}],filter:[{filter:["","none",isArbitraryVariable,isArbitraryValue]}],blur:[{blur:tt()}],brightness:[{brightness:[isNumber$2,isArbitraryVariable,isArbitraryValue]}],contrast:[{contrast:[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"drop-shadow":[{"drop-shadow":["","none",E,isArbitraryVariableShadow,isArbitraryShadow]}],"drop-shadow-color":[{"drop-shadow":je()}],grayscale:[{grayscale:["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],"hue-rotate":[{"hue-rotate":[isNumber$2,isArbitraryVariable,isArbitraryValue]}],invert:[{invert:["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],saturate:[{saturate:[isNumber$2,isArbitraryVariable,isArbitraryValue]}],sepia:[{sepia:["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-filter":[{"backdrop-filter":["","none",isArbitraryVariable,isArbitraryValue]}],"backdrop-blur":[{"backdrop-blur":tt()}],"backdrop-brightness":[{"backdrop-brightness":[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-contrast":[{"backdrop-contrast":[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-grayscale":[{"backdrop-grayscale":["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-invert":[{"backdrop-invert":["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-opacity":[{"backdrop-opacity":[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-saturate":[{"backdrop-saturate":[isNumber$2,isArbitraryVariable,isArbitraryValue]}],"backdrop-sepia":[{"backdrop-sepia":["",isNumber$2,isArbitraryVariable,isArbitraryValue]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":ie()}],"border-spacing-x":[{"border-spacing-x":ie()}],"border-spacing-y":[{"border-spacing-y":ie()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",isArbitraryVariable,isArbitraryValue]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[isNumber$2,"initial",isArbitraryVariable,isArbitraryValue]}],ease:[{ease:["linear","initial",O,isArbitraryVariable,isArbitraryValue]}],delay:[{delay:[isNumber$2,isArbitraryVariable,isArbitraryValue]}],animate:[{animate:["none",q,isArbitraryVariable,isArbitraryValue]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[I,isArbitraryVariable,isArbitraryValue]}],"perspective-origin":[{"perspective-origin":F()}],rotate:[{rotate:Ze()}],"rotate-x":[{"rotate-x":Ze()}],"rotate-y":[{"rotate-y":Ze()}],"rotate-z":[{"rotate-z":Ze()}],scale:[{scale:et()}],"scale-x":[{"scale-x":et()}],"scale-y":[{"scale-y":et()}],"scale-z":[{"scale-z":et()}],"scale-3d":["scale-3d"],skew:[{skew:st()}],"skew-x":[{"skew-x":st()}],"skew-y":[{"skew-y":st()}],transform:[{transform:[isArbitraryVariable,isArbitraryValue,"","none","gpu","cpu"]}],"transform-origin":[{origin:F()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:qe()}],"translate-x":[{"translate-x":qe()}],"translate-y":[{"translate-y":qe()}],"translate-z":[{"translate-z":qe()}],"translate-none":["translate-none"],accent:[{accent:je()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:je()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",isArbitraryVariable,isArbitraryValue]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ie()}],"scroll-mx":[{"scroll-mx":ie()}],"scroll-my":[{"scroll-my":ie()}],"scroll-ms":[{"scroll-ms":ie()}],"scroll-me":[{"scroll-me":ie()}],"scroll-mt":[{"scroll-mt":ie()}],"scroll-mr":[{"scroll-mr":ie()}],"scroll-mb":[{"scroll-mb":ie()}],"scroll-ml":[{"scroll-ml":ie()}],"scroll-p":[{"scroll-p":ie()}],"scroll-px":[{"scroll-px":ie()}],"scroll-py":[{"scroll-py":ie()}],"scroll-ps":[{"scroll-ps":ie()}],"scroll-pe":[{"scroll-pe":ie()}],"scroll-pt":[{"scroll-pt":ie()}],"scroll-pr":[{"scroll-pr":ie()}],"scroll-pb":[{"scroll-pb":ie()}],"scroll-pl":[{"scroll-pl":ie()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",isArbitraryVariable,isArbitraryValue]}],fill:[{fill:["none",...je()]}],"stroke-w":[{stroke:[isNumber$2,isArbitraryVariableLength,isArbitraryLength,isArbitraryNumber]}],stroke:[{stroke:["none",...je()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},twMerge=createTailwindMerge(getDefaultConfig);function cn(...e){return twMerge(clsx(e))}function InputOTP({className:e,containerClassName:t,...n}){return jsxRuntime.jsx(Lt,{"data-slot":"input-otp",containerClassName:cn("flex items-center gap-2 has-disabled:opacity-50",t),className:cn("disabled:cursor-not-allowed",e),...n})}function InputOTPGroup({className:e,...t}){return jsxRuntime.jsx("div",{"data-slot":"input-otp-group",className:cn("flex items-center",e),...t})}function InputOTPSlot({index:e,className:t,...n}){const o=React__namespace.useContext(jt),{char:l,hasFakeCaret:d,isActive:f}=(o==null?void 0:o.slots[e])??{};return jsxRuntime.jsxs("div",{"data-slot":"input-otp-slot","data-active":f,className:cn("border-input data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",t),...n,children:[l,d&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:jsxRuntime.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function InputOTPSeparator({...e}){return jsxRuntime.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...e,children:jsxRuntime.jsx(Minus,{})})}function composeEventHandlers(e,t,{checkForDefaultPrevented:n=!0}={}){return function(l){if(e==null||e(l),n===!1||!l.defaultPrevented)return t==null?void 0:t(l)}}function setRef(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function composeRefs(...e){return t=>{let n=!1;const o=e.map(l=>{const d=setRef(l,t);return!n&&typeof d=="function"&&(n=!0),d});if(n)return()=>{for(let l=0;l<o.length;l++){const d=o[l];typeof d=="function"?d():setRef(e[l],null)}}}}function useComposedRefs(...e){return React__namespace.useCallback(composeRefs(...e),e)}function createContext2(e,t){const n=React__namespace.createContext(t),o=d=>{const{children:f,...g}=d,b=React__namespace.useMemo(()=>g,Object.values(g));return jsxRuntime.jsx(n.Provider,{value:b,children:f})};o.displayName=e+"Provider";function l(d){const f=React__namespace.useContext(n);if(f)return f;if(t!==void 0)return t;throw new Error(`\`${d}\` must be used within \`${e}\``)}return[o,l]}function createContextScope(e,t=[]){let n=[];function o(d,f){const g=React__namespace.createContext(f),b=n.length;n=[...n,f];const _=R=>{var O;const{scope:C,children:E,...M}=R,I=((O=C==null?void 0:C[e])==null?void 0:O[b])||g,A=React__namespace.useMemo(()=>M,Object.values(M));return jsxRuntime.jsx(I.Provider,{value:A,children:E})};_.displayName=d+"Provider";function S(R,C){var I;const E=((I=C==null?void 0:C[e])==null?void 0:I[b])||g,M=React__namespace.useContext(E);if(M)return M;if(f!==void 0)return f;throw new Error(`\`${R}\` must be used within \`${d}\``)}return[_,S]}const l=()=>{const d=n.map(f=>React__namespace.createContext(f));return function(g){const b=(g==null?void 0:g[e])||d;return React__namespace.useMemo(()=>({[`__scope${e}`]:{...g,[e]:b}}),[g,b])}};return l.scopeName=e,[o,composeContextScopes(l,...t)]}function composeContextScopes(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(d){const f=o.reduce((g,{useScope:b,scopeName:_})=>{const R=b(d)[`__scope${_}`];return{...g,...R}},{});return React__namespace.useMemo(()=>({[`__scope${t.scopeName}`]:f}),[f])}};return n.scopeName=t.scopeName,n}function createSlot(e){const t=createSlotClone(e),n=React__namespace.forwardRef((o,l)=>{const{children:d,...f}=o,g=React__namespace.Children.toArray(d),b=g.find(isSlottable);if(b){const _=b.props.children,S=g.map(R=>R===b?React__namespace.Children.count(_)>1?React__namespace.Children.only(null):React__namespace.isValidElement(_)?_.props.children:null:R);return jsxRuntime.jsx(t,{...f,ref:l,children:React__namespace.isValidElement(_)?React__namespace.cloneElement(_,void 0,S):null})}return jsxRuntime.jsx(t,{...f,ref:l,children:d})});return n.displayName=`${e}.Slot`,n}var Slot$4=createSlot("Slot");function createSlotClone(e){const t=React__namespace.forwardRef((n,o)=>{const{children:l,...d}=n,f=React__namespace.isValidElement(l)?getElementRef$1(l):void 0,g=useComposedRefs(f,o);if(React__namespace.isValidElement(l)){const b=mergeProps(d,l.props);return l.type!==React__namespace.Fragment&&(b.ref=g),React__namespace.cloneElement(l,b)}return React__namespace.Children.count(l)>1?React__namespace.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var SLOTTABLE_IDENTIFIER=Symbol("radix.slottable");function createSlottable(e){const t=({children:n})=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=SLOTTABLE_IDENTIFIER,t}function isSlottable(e){return React__namespace.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===SLOTTABLE_IDENTIFIER}function mergeProps(e,t){const n={...t};for(const o in t){const l=e[o],d=t[o];/^on[A-Z]/.test(o)?l&&d?n[o]=(...g)=>{const b=d(...g);return l(...g),b}:l&&(n[o]=l):o==="style"?n[o]={...l,...d}:o==="className"&&(n[o]=[l,d].filter(Boolean).join(" "))}return{...e,...n}}function getElementRef$1(e){var o,l;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var NODES=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive=NODES.reduce((e,t)=>{const n=createSlot(`Primitive.${t}`),o=React__namespace.forwardRef((l,d)=>{const{asChild:f,...g}=l,b=f?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntime.jsx(b,{...g,ref:d})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function dispatchDiscreteCustomEvent(e,t){e&&ReactDOM__namespace.flushSync(()=>e.dispatchEvent(t))}function createCollection(e){const t=e+"CollectionProvider",[n,o]=createContextScope(t),[l,d]=n(t,{collectionRef:{current:null},itemMap:new Map}),f=I=>{const{scope:A,children:O}=I,q=React.useRef(null),z=React.useRef(new Map).current;return jsxRuntime.jsx(l,{scope:A,itemMap:z,collectionRef:q,children:O})};f.displayName=t;const g=e+"CollectionSlot",b=createSlot(g),_=React.forwardRef((I,A)=>{const{scope:O,children:q}=I,z=d(g,O),Q=useComposedRefs(A,z.collectionRef);return jsxRuntime.jsx(b,{ref:Q,children:q})});_.displayName=g;const S=e+"CollectionItemSlot",R="data-radix-collection-item",C=createSlot(S),E=React.forwardRef((I,A)=>{const{scope:O,children:q,...z}=I,Q=React.useRef(null),F=useComposedRefs(A,Q),V=d(S,O);return React.useEffect(()=>(V.itemMap.set(Q,{ref:Q,...z}),()=>void V.itemMap.delete(Q))),jsxRuntime.jsx(C,{[R]:"",ref:F,children:q})});E.displayName=S;function M(I){const A=d(e+"CollectionConsumer",I);return React.useCallback(()=>{const q=A.collectionRef.current;if(!q)return[];const z=Array.from(q.querySelectorAll(`[${R}]`));return Array.from(A.itemMap.values()).sort((V,te)=>z.indexOf(V.ref.current)-z.indexOf(te.ref.current))},[A.collectionRef,A.itemMap])}return[{Provider:f,Slot:_,ItemSlot:E},M,o]}var useLayoutEffect2=globalThis!=null&&globalThis.document?React__namespace.useLayoutEffect:()=>{},useReactId=React__namespace[" useId ".trim().toString()]||(()=>{}),count$3=0;function useId(e){const[t,n]=React__namespace.useState(useReactId());return useLayoutEffect2(()=>{n(o=>o??String(count$3++))},[e]),t?`radix-${t}`:""}function useCallbackRef$1(e){const t=React__namespace.useRef(e);return React__namespace.useEffect(()=>{t.current=e}),React__namespace.useMemo(()=>(...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[])}var useInsertionEffect=React__namespace[" useInsertionEffect ".trim().toString()]||useLayoutEffect2;function useControllableState({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[l,d,f]=useUncontrolledState({defaultProp:t,onChange:n}),g=e!==void 0,b=g?e:l;{const S=React__namespace.useRef(e!==void 0);React__namespace.useEffect(()=>{const R=S.current;R!==g&&console.warn(`${o} is changing from ${R?"controlled":"uncontrolled"} to ${g?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),S.current=g},[g,o])}const _=React__namespace.useCallback(S=>{var R;if(g){const C=isFunction$5(S)?S(e):S;C!==e&&((R=f.current)==null||R.call(f,C))}else d(S)},[g,e,d,f]);return[b,_]}function useUncontrolledState({defaultProp:e,onChange:t}){const[n,o]=React__namespace.useState(e),l=React__namespace.useRef(n),d=React__namespace.useRef(t);return useInsertionEffect(()=>{d.current=t},[t]),React__namespace.useEffect(()=>{var f;l.current!==n&&((f=d.current)==null||f.call(d,n),l.current=n)},[n,l]),[n,o,d]}function isFunction$5(e){return typeof e=="function"}var DirectionContext=React__namespace.createContext(void 0);function useDirection(e){const t=React__namespace.useContext(DirectionContext);return e||t||"ltr"}var ENTRY_FOCUS="rovingFocusGroup.onEntryFocus",EVENT_OPTIONS$1={bubbles:!1,cancelable:!0},GROUP_NAME$3="RovingFocusGroup",[Collection$3,useCollection$3,createCollectionScope$3]=createCollection(GROUP_NAME$3),[createRovingFocusGroupContext,createRovingFocusGroupScope]=createContextScope(GROUP_NAME$3,[createCollectionScope$3]),[RovingFocusProvider,useRovingFocusContext]=createRovingFocusGroupContext(GROUP_NAME$3),RovingFocusGroup=React__namespace.forwardRef((e,t)=>jsxRuntime.jsx(Collection$3.Provider,{scope:e.__scopeRovingFocusGroup,children:jsxRuntime.jsx(Collection$3.Slot,{scope:e.__scopeRovingFocusGroup,children:jsxRuntime.jsx(RovingFocusGroupImpl,{...e,ref:t})})}));RovingFocusGroup.displayName=GROUP_NAME$3;var RovingFocusGroupImpl=React__namespace.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:l=!1,dir:d,currentTabStopId:f,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:b,onEntryFocus:_,preventScrollOnEntryFocus:S=!1,...R}=e,C=React__namespace.useRef(null),E=useComposedRefs(t,C),M=useDirection(d),[I,A]=useControllableState({prop:f,defaultProp:g??null,onChange:b,caller:GROUP_NAME$3}),[O,q]=React__namespace.useState(!1),z=useCallbackRef$1(_),Q=useCollection$3(n),F=React__namespace.useRef(!1),[V,te]=React__namespace.useState(0);return React__namespace.useEffect(()=>{const ie=C.current;if(ie)return ie.addEventListener(ENTRY_FOCUS,z),()=>ie.removeEventListener(ENTRY_FOCUS,z)},[z]),jsxRuntime.jsx(RovingFocusProvider,{scope:n,orientation:o,dir:M,loop:l,currentTabStopId:I,onItemFocus:React__namespace.useCallback(ie=>A(ie),[A]),onItemShiftTab:React__namespace.useCallback(()=>q(!0),[]),onFocusableItemAdd:React__namespace.useCallback(()=>te(ie=>ie+1),[]),onFocusableItemRemove:React__namespace.useCallback(()=>te(ie=>ie-1),[]),children:jsxRuntime.jsx(Primitive.div,{tabIndex:O||V===0?-1:0,"data-orientation":o,...R,ref:E,style:{outline:"none",...e.style},onMouseDown:composeEventHandlers(e.onMouseDown,()=>{F.current=!0}),onFocus:composeEventHandlers(e.onFocus,ie=>{const ae=!F.current;if(ie.target===ie.currentTarget&&ae&&!O){const oe=new CustomEvent(ENTRY_FOCUS,EVENT_OPTIONS$1);if(ie.currentTarget.dispatchEvent(oe),!oe.defaultPrevented){const se=Q().filter(Le=>Le.focusable),ge=se.find(Le=>Le.active),Ae=se.find(Le=>Le.id===I),Oe=[ge,Ae,...se].filter(Boolean).map(Le=>Le.ref.current);focusFirst$3(Oe,S)}}F.current=!1}),onBlur:composeEventHandlers(e.onBlur,()=>q(!1))})})}),ITEM_NAME$4="RovingFocusGroupItem",RovingFocusGroupItem=React__namespace.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:l=!1,tabStopId:d,children:f,...g}=e,b=useId(),_=d||b,S=useRovingFocusContext(ITEM_NAME$4,n),R=S.currentTabStopId===_,C=useCollection$3(n),{onFocusableItemAdd:E,onFocusableItemRemove:M,currentTabStopId:I}=S;return React__namespace.useEffect(()=>{if(o)return E(),()=>M()},[o,E,M]),jsxRuntime.jsx(Collection$3.ItemSlot,{scope:n,id:_,focusable:o,active:l,children:jsxRuntime.jsx(Primitive.span,{tabIndex:R?0:-1,"data-orientation":S.orientation,...g,ref:t,onMouseDown:composeEventHandlers(e.onMouseDown,A=>{o?S.onItemFocus(_):A.preventDefault()}),onFocus:composeEventHandlers(e.onFocus,()=>S.onItemFocus(_)),onKeyDown:composeEventHandlers(e.onKeyDown,A=>{if(A.key==="Tab"&&A.shiftKey){S.onItemShiftTab();return}if(A.target!==A.currentTarget)return;const O=getFocusIntent(A,S.orientation,S.dir);if(O!==void 0){if(A.metaKey||A.ctrlKey||A.altKey||A.shiftKey)return;A.preventDefault();let z=C().filter(Q=>Q.focusable).map(Q=>Q.ref.current);if(O==="last")z.reverse();else if(O==="prev"||O==="next"){O==="prev"&&z.reverse();const Q=z.indexOf(A.currentTarget);z=S.loop?wrapArray$2(z,Q+1):z.slice(Q+1)}setTimeout(()=>focusFirst$3(z))}}),children:typeof f=="function"?f({isCurrentTabStop:R,hasTabStop:I!=null}):f})})});RovingFocusGroupItem.displayName=ITEM_NAME$4;var MAP_KEY_TO_FOCUS_INTENT={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function getDirectionAwareKey(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function getFocusIntent(e,t,n){const o=getDirectionAwareKey(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return MAP_KEY_TO_FOCUS_INTENT[o]}function focusFirst$3(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function wrapArray$2(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Root$9=RovingFocusGroup,Item$1=RovingFocusGroupItem;function useSize(e){const[t,n]=React__namespace.useState(void 0);return useLayoutEffect2(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const d=l[0];let f,g;if("borderBoxSize"in d){const b=d.borderBoxSize,_=Array.isArray(b)?b[0]:b;f=_.inlineSize,g=_.blockSize}else f=e.offsetWidth,g=e.offsetHeight;n({width:f,height:g})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}function usePrevious(e){const t=React__namespace.useRef({value:e,previous:e});return React__namespace.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function useStateMachine$1(e,t){return React__namespace.useReducer((n,o)=>t[n][o]??n,e)}var Presence=e=>{const{present:t,children:n}=e,o=usePresence(t),l=typeof n=="function"?n({present:o.isPresent}):React__namespace.Children.only(n),d=useComposedRefs(o.ref,getElementRef(l));return typeof n=="function"||o.isPresent?React__namespace.cloneElement(l,{ref:d}):null};Presence.displayName="Presence";function usePresence(e){const[t,n]=React__namespace.useState(),o=React__namespace.useRef(null),l=React__namespace.useRef(e),d=React__namespace.useRef("none"),f=e?"mounted":"unmounted",[g,b]=useStateMachine$1(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return React__namespace.useEffect(()=>{const _=getAnimationName(o.current);d.current=g==="mounted"?_:"none"},[g]),useLayoutEffect2(()=>{const _=o.current,S=l.current;if(S!==e){const C=d.current,E=getAnimationName(_);e?b("MOUNT"):E==="none"||(_==null?void 0:_.display)==="none"?b("UNMOUNT"):b(S&&C!==E?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,b]),useLayoutEffect2(()=>{if(t){let _;const S=t.ownerDocument.defaultView??window,R=E=>{const I=getAnimationName(o.current).includes(E.animationName);if(E.target===t&&I&&(b("ANIMATION_END"),!l.current)){const A=t.style.animationFillMode;t.style.animationFillMode="forwards",_=S.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=A)})}},C=E=>{E.target===t&&(d.current=getAnimationName(o.current))};return t.addEventListener("animationstart",C),t.addEventListener("animationcancel",R),t.addEventListener("animationend",R),()=>{S.clearTimeout(_),t.removeEventListener("animationstart",C),t.removeEventListener("animationcancel",R),t.removeEventListener("animationend",R)}}else b("ANIMATION_END")},[t,b]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:React__namespace.useCallback(_=>{o.current=_?getComputedStyle(_):null,n(_)},[])}}function getAnimationName(e){return(e==null?void 0:e.animationName)||"none"}function getElementRef(e){var o,l;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var RADIO_NAME="Radio",[createRadioContext,createRadioScope]=createContextScope(RADIO_NAME),[RadioProvider,useRadioContext]=createRadioContext(RADIO_NAME),Radio=React__namespace.forwardRef((e,t)=>{const{__scopeRadio:n,name:o,checked:l=!1,required:d,disabled:f,value:g="on",onCheck:b,form:_,...S}=e,[R,C]=React__namespace.useState(null),E=useComposedRefs(t,A=>C(A)),M=React__namespace.useRef(!1),I=R?_||!!R.closest("form"):!0;return jsxRuntime.jsxs(RadioProvider,{scope:n,checked:l,disabled:f,children:[jsxRuntime.jsx(Primitive.button,{type:"button",role:"radio","aria-checked":l,"data-state":getState$4(l),"data-disabled":f?"":void 0,disabled:f,value:g,...S,ref:E,onClick:composeEventHandlers(e.onClick,A=>{l||b==null||b(),I&&(M.current=A.isPropagationStopped(),M.current||A.stopPropagation())})}),I&&jsxRuntime.jsx(RadioBubbleInput,{control:R,bubbles:!M.current,name:o,value:g,checked:l,required:d,disabled:f,form:_,style:{transform:"translateX(-100%)"}})]})});Radio.displayName=RADIO_NAME;var INDICATOR_NAME$2="RadioIndicator",RadioIndicator=React__namespace.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:o,...l}=e,d=useRadioContext(INDICATOR_NAME$2,n);return jsxRuntime.jsx(Presence,{present:o||d.checked,children:jsxRuntime.jsx(Primitive.span,{"data-state":getState$4(d.checked),"data-disabled":d.disabled?"":void 0,...l,ref:t})})});RadioIndicator.displayName=INDICATOR_NAME$2;var BUBBLE_INPUT_NAME$3="RadioBubbleInput",RadioBubbleInput=React__namespace.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:o=!0,...l},d)=>{const f=React__namespace.useRef(null),g=useComposedRefs(f,d),b=usePrevious(n),_=useSize(t);return React__namespace.useEffect(()=>{const S=f.current;if(!S)return;const R=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(R,"checked").set;if(b!==n&&E){const M=new Event("click",{bubbles:o});E.call(S,n),S.dispatchEvent(M)}},[b,n,o]),jsxRuntime.jsx(Primitive.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...l,tabIndex:-1,ref:g,style:{...l.style,..._,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});RadioBubbleInput.displayName=BUBBLE_INPUT_NAME$3;function getState$4(e){return e?"checked":"unchecked"}var ARROW_KEYS=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],RADIO_GROUP_NAME$2="RadioGroup",[createRadioGroupContext,createRadioGroupScope]=createContextScope(RADIO_GROUP_NAME$2,[createRovingFocusGroupScope,createRadioScope]),useRovingFocusGroupScope$2=createRovingFocusGroupScope(),useRadioScope=createRadioScope(),[RadioGroupProvider$1,useRadioGroupContext$1]=createRadioGroupContext(RADIO_GROUP_NAME$2),RadioGroup$2=React__namespace.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:o,defaultValue:l,value:d,required:f=!1,disabled:g=!1,orientation:b,dir:_,loop:S=!0,onValueChange:R,...C}=e,E=useRovingFocusGroupScope$2(n),M=useDirection(_),[I,A]=useControllableState({prop:d,defaultProp:l??null,onChange:R,caller:RADIO_GROUP_NAME$2});return jsxRuntime.jsx(RadioGroupProvider$1,{scope:n,name:o,required:f,disabled:g,value:I,onValueChange:A,children:jsxRuntime.jsx(Root$9,{asChild:!0,...E,orientation:b,dir:M,loop:S,children:jsxRuntime.jsx(Primitive.div,{role:"radiogroup","aria-required":f,"aria-orientation":b,"data-disabled":g?"":void 0,dir:M,...C,ref:t})})})});RadioGroup$2.displayName=RADIO_GROUP_NAME$2;var ITEM_NAME$3="RadioGroupItem",RadioGroupItem$1=React__namespace.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:o,...l}=e,d=useRadioGroupContext$1(ITEM_NAME$3,n),f=d.disabled||o,g=useRovingFocusGroupScope$2(n),b=useRadioScope(n),_=React__namespace.useRef(null),S=useComposedRefs(t,_),R=d.value===l.value,C=React__namespace.useRef(!1);return React__namespace.useEffect(()=>{const E=I=>{ARROW_KEYS.includes(I.key)&&(C.current=!0)},M=()=>C.current=!1;return document.addEventListener("keydown",E),document.addEventListener("keyup",M),()=>{document.removeEventListener("keydown",E),document.removeEventListener("keyup",M)}},[]),jsxRuntime.jsx(Item$1,{asChild:!0,...g,focusable:!f,active:R,children:jsxRuntime.jsx(Radio,{disabled:f,required:d.required,checked:R,...b,...l,name:d.name,ref:S,onCheck:()=>d.onValueChange(l.value),onKeyDown:composeEventHandlers(E=>{E.key==="Enter"&&E.preventDefault()}),onFocus:composeEventHandlers(l.onFocus,()=>{var E;C.current&&((E=_.current)==null||E.click())})})})});RadioGroupItem$1.displayName=ITEM_NAME$3;var INDICATOR_NAME2="RadioGroupIndicator",RadioGroupIndicator=React__namespace.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...o}=e,l=useRadioScope(n);return jsxRuntime.jsx(RadioIndicator,{...l,...o,ref:t})});RadioGroupIndicator.displayName=INDICATOR_NAME2;var Root2$6=RadioGroup$2,Item2$2=RadioGroupItem$1,Indicator=RadioGroupIndicator;const RadioGroup$1=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Root2$6,{className:cn("grid gap-2",e),...t,ref:n}));RadioGroup$1.displayName=Root2$6.displayName;const RadioGroupItem=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Item2$2,{ref:n,className:cn("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow-sm focus:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:jsxRuntime.jsx(Indicator,{className:"flex items-center justify-center",children:jsxRuntime.jsx(Circle,{className:"h-3.5 w-3.5 fill-primary"})})}));RadioGroupItem.displayName=Item2$2.displayName;function useEscapeKeydown(e,t=globalThis==null?void 0:globalThis.document){const n=useCallbackRef$1(e);React__namespace.useEffect(()=>{const o=l=>{l.key==="Escape"&&n(l)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var DISMISSABLE_LAYER_NAME="DismissableLayer",CONTEXT_UPDATE="dismissableLayer.update",POINTER_DOWN_OUTSIDE="dismissableLayer.pointerDownOutside",FOCUS_OUTSIDE="dismissableLayer.focusOutside",originalBodyPointerEvents,DismissableLayerContext=React__namespace.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),DismissableLayer=React__namespace.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:f,onDismiss:g,...b}=e,_=React__namespace.useContext(DismissableLayerContext),[S,R]=React__namespace.useState(null),C=(S==null?void 0:S.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,E]=React__namespace.useState({}),M=useComposedRefs(t,te=>R(te)),I=Array.from(_.layers),[A]=[..._.layersWithOutsidePointerEventsDisabled].slice(-1),O=I.indexOf(A),q=S?I.indexOf(S):-1,z=_.layersWithOutsidePointerEventsDisabled.size>0,Q=q>=O,F=usePointerDownOutside(te=>{const ie=te.target,ae=[..._.branches].some(oe=>oe.contains(ie));!Q||ae||(l==null||l(te),f==null||f(te),te.defaultPrevented||g==null||g())},C),V=useFocusOutside(te=>{const ie=te.target;[..._.branches].some(oe=>oe.contains(ie))||(d==null||d(te),f==null||f(te),te.defaultPrevented||g==null||g())},C);return useEscapeKeydown(te=>{q===_.layers.size-1&&(o==null||o(te),!te.defaultPrevented&&g&&(te.preventDefault(),g()))},C),React__namespace.useEffect(()=>{if(S)return n&&(_.layersWithOutsidePointerEventsDisabled.size===0&&(originalBodyPointerEvents=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),_.layersWithOutsidePointerEventsDisabled.add(S)),_.layers.add(S),dispatchUpdate(),()=>{n&&_.layersWithOutsidePointerEventsDisabled.size===1&&(C.body.style.pointerEvents=originalBodyPointerEvents)}},[S,C,n,_]),React__namespace.useEffect(()=>()=>{S&&(_.layers.delete(S),_.layersWithOutsidePointerEventsDisabled.delete(S),dispatchUpdate())},[S,_]),React__namespace.useEffect(()=>{const te=()=>E({});return document.addEventListener(CONTEXT_UPDATE,te),()=>document.removeEventListener(CONTEXT_UPDATE,te)},[]),jsxRuntime.jsx(Primitive.div,{...b,ref:M,style:{pointerEvents:z?Q?"auto":"none":void 0,...e.style},onFocusCapture:composeEventHandlers(e.onFocusCapture,V.onFocusCapture),onBlurCapture:composeEventHandlers(e.onBlurCapture,V.onBlurCapture),onPointerDownCapture:composeEventHandlers(e.onPointerDownCapture,F.onPointerDownCapture)})});DismissableLayer.displayName=DISMISSABLE_LAYER_NAME;var BRANCH_NAME="DismissableLayerBranch",DismissableLayerBranch=React__namespace.forwardRef((e,t)=>{const n=React__namespace.useContext(DismissableLayerContext),o=React__namespace.useRef(null),l=useComposedRefs(t,o);return React__namespace.useEffect(()=>{const d=o.current;if(d)return n.branches.add(d),()=>{n.branches.delete(d)}},[n.branches]),jsxRuntime.jsx(Primitive.div,{...e,ref:l})});DismissableLayerBranch.displayName=BRANCH_NAME;function usePointerDownOutside(e,t=globalThis==null?void 0:globalThis.document){const n=useCallbackRef$1(e),o=React__namespace.useRef(!1),l=React__namespace.useRef(()=>{});return React__namespace.useEffect(()=>{const d=g=>{if(g.target&&!o.current){let b=function(){handleAndDispatchCustomEvent$1(POINTER_DOWN_OUTSIDE,n,_,{discrete:!0})};const _={originalEvent:g};g.pointerType==="touch"?(t.removeEventListener("click",l.current),l.current=b,t.addEventListener("click",l.current,{once:!0})):b()}else t.removeEventListener("click",l.current);o.current=!1},f=window.setTimeout(()=>{t.addEventListener("pointerdown",d)},0);return()=>{window.clearTimeout(f),t.removeEventListener("pointerdown",d),t.removeEventListener("click",l.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function useFocusOutside(e,t=globalThis==null?void 0:globalThis.document){const n=useCallbackRef$1(e),o=React__namespace.useRef(!1);return React__namespace.useEffect(()=>{const l=d=>{d.target&&!o.current&&handleAndDispatchCustomEvent$1(FOCUS_OUTSIDE,n,{originalEvent:d},{discrete:!1})};return t.addEventListener("focusin",l),()=>t.removeEventListener("focusin",l)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function dispatchUpdate(){const e=new CustomEvent(CONTEXT_UPDATE);document.dispatchEvent(e)}function handleAndDispatchCustomEvent$1(e,t,n,{discrete:o}){const l=n.originalEvent.target,d=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&l.addEventListener(e,t,{once:!0}),o?dispatchDiscreteCustomEvent(l,d):l.dispatchEvent(d)}var Root$8=DismissableLayer,Branch=DismissableLayerBranch,AUTOFOCUS_ON_MOUNT="focusScope.autoFocusOnMount",AUTOFOCUS_ON_UNMOUNT="focusScope.autoFocusOnUnmount",EVENT_OPTIONS={bubbles:!1,cancelable:!0},FOCUS_SCOPE_NAME="FocusScope",FocusScope=React__namespace.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:l,onUnmountAutoFocus:d,...f}=e,[g,b]=React__namespace.useState(null),_=useCallbackRef$1(l),S=useCallbackRef$1(d),R=React__namespace.useRef(null),C=useComposedRefs(t,I=>b(I)),E=React__namespace.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;React__namespace.useEffect(()=>{if(o){let I=function(z){if(E.paused||!g)return;const Q=z.target;g.contains(Q)?R.current=Q:focus(R.current,{select:!0})},A=function(z){if(E.paused||!g)return;const Q=z.relatedTarget;Q!==null&&(g.contains(Q)||focus(R.current,{select:!0}))},O=function(z){if(document.activeElement===document.body)for(const F of z)F.removedNodes.length>0&&focus(g)};document.addEventListener("focusin",I),document.addEventListener("focusout",A);const q=new MutationObserver(O);return g&&q.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",I),document.removeEventListener("focusout",A),q.disconnect()}}},[o,g,E.paused]),React__namespace.useEffect(()=>{if(g){focusScopesStack.add(E);const I=document.activeElement;if(!g.contains(I)){const O=new CustomEvent(AUTOFOCUS_ON_MOUNT,EVENT_OPTIONS);g.addEventListener(AUTOFOCUS_ON_MOUNT,_),g.dispatchEvent(O),O.defaultPrevented||(focusFirst$2(removeLinks(getTabbableCandidates$1(g)),{select:!0}),document.activeElement===I&&focus(g))}return()=>{g.removeEventListener(AUTOFOCUS_ON_MOUNT,_),setTimeout(()=>{const O=new CustomEvent(AUTOFOCUS_ON_UNMOUNT,EVENT_OPTIONS);g.addEventListener(AUTOFOCUS_ON_UNMOUNT,S),g.dispatchEvent(O),O.defaultPrevented||focus(I??document.body,{select:!0}),g.removeEventListener(AUTOFOCUS_ON_UNMOUNT,S),focusScopesStack.remove(E)},0)}}},[g,_,S,E]);const M=React__namespace.useCallback(I=>{if(!n&&!o||E.paused)return;const A=I.key==="Tab"&&!I.altKey&&!I.ctrlKey&&!I.metaKey,O=document.activeElement;if(A&&O){const q=I.currentTarget,[z,Q]=getTabbableEdges(q);z&&Q?!I.shiftKey&&O===Q?(I.preventDefault(),n&&focus(z,{select:!0})):I.shiftKey&&O===z&&(I.preventDefault(),n&&focus(Q,{select:!0})):O===q&&I.preventDefault()}},[n,o,E.paused]);return jsxRuntime.jsx(Primitive.div,{tabIndex:-1,...f,ref:C,onKeyDown:M})});FocusScope.displayName=FOCUS_SCOPE_NAME;function focusFirst$2(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(focus(o,{select:t}),document.activeElement!==n)return}function getTabbableEdges(e){const t=getTabbableCandidates$1(e),n=findVisible(t,e),o=findVisible(t.reverse(),e);return[n,o]}function getTabbableCandidates$1(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const l=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||l?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function findVisible(e,t){for(const n of e)if(!isHidden(n,{upTo:t}))return n}function isHidden(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function isSelectableInput(e){return e instanceof HTMLInputElement&&"select"in e}function focus(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&isSelectableInput(e)&&t&&e.select()}}var focusScopesStack=createFocusScopesStack();function createFocusScopesStack(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=arrayRemove(e,t),e.unshift(t)},remove(t){var n;e=arrayRemove(e,t),(n=e[0])==null||n.resume()}}}function arrayRemove(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function removeLinks(e){return e.filter(t=>t.tagName!=="A")}var PORTAL_NAME$6="Portal",Portal$5=React__namespace.forwardRef((e,t)=>{var g;const{container:n,...o}=e,[l,d]=React__namespace.useState(!1);useLayoutEffect2(()=>d(!0),[]);const f=n||l&&((g=globalThis==null?void 0:globalThis.document)==null?void 0:g.body);return f?ReactDOM.createPortal(jsxRuntime.jsx(Primitive.div,{...o,ref:t}),f):null});Portal$5.displayName=PORTAL_NAME$6;var count$2=0;function useFocusGuards(){React__namespace.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??createFocusGuard()),document.body.insertAdjacentElement("beforeend",e[1]??createFocusGuard()),count$2++,()=>{count$2===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),count$2--}},[])}function createFocusGuard(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var __assign$1=function(){return __assign$1=Object.assign||function(t){for(var n,o=1,l=arguments.length;o<l;o++){n=arguments[o];for(var d in n)Object.prototype.hasOwnProperty.call(n,d)&&(t[d]=n[d])}return t},__assign$1.apply(this,arguments)};function __rest(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,o=Object.getOwnPropertySymbols(e);l<o.length;l++)t.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(n[o[l]]=e[o[l]]);return n}function __spreadArray(e,t,n){if(n||arguments.length===2)for(var o=0,l=t.length,d;o<l;o++)(d||!(o in t))&&(d||(d=Array.prototype.slice.call(t,0,o)),d[o]=t[o]);return e.concat(d||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var zeroRightClassName="right-scroll-bar-position",fullWidthClassName="width-before-scroll-bar",noScrollbarsClassName="with-scroll-bars-hidden",removedBarSizeVariable="--removed-body-scroll-bar-size";function assignRef(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function useCallbackRef(e,t){var n=React.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var l=n.value;l!==o&&(n.value=o,n.callback(o,l))}}}})[0];return n.callback=t,n.facade}var useIsomorphicLayoutEffect$2=typeof window<"u"?React__namespace.useLayoutEffect:React__namespace.useEffect,currentValues=new WeakMap;function useMergeRefs(e,t){var n=useCallbackRef(null,function(o){return e.forEach(function(l){return assignRef(l,o)})});return useIsomorphicLayoutEffect$2(function(){var o=currentValues.get(n);if(o){var l=new Set(o),d=new Set(e),f=n.current;l.forEach(function(g){d.has(g)||assignRef(g,null)}),d.forEach(function(g){l.has(g)||assignRef(g,f)})}currentValues.set(n,e)},[e]),n}function ItoI(e){return e}function innerCreateMedium(e,t){t===void 0&&(t=ItoI);var n=[],o=!1,l={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(d){var f=t(d,o);return n.push(f),function(){n=n.filter(function(g){return g!==f})}},assignSyncMedium:function(d){for(o=!0;n.length;){var f=n;n=[],f.forEach(d)}n={push:function(g){return d(g)},filter:function(){return n}}},assignMedium:function(d){o=!0;var f=[];if(n.length){var g=n;n=[],g.forEach(d),f=n}var b=function(){var S=f;f=[],S.forEach(d)},_=function(){return Promise.resolve().then(b)};_(),n={push:function(S){f.push(S),_()},filter:function(S){return f=f.filter(S),n}}}};return l}function createSidecarMedium(e){e===void 0&&(e={});var t=innerCreateMedium(null);return t.options=__assign$1({async:!0,ssr:!1},e),t}var SideCar$1=function(e){var t=e.sideCar,n=__rest(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return React__namespace.createElement(o,__assign$1({},n))};SideCar$1.isSideCarExport=!0;function exportSidecar(e,t){return e.useMedium(t),SideCar$1}var effectCar=createSidecarMedium(),nothing=function(){},RemoveScroll=React__namespace.forwardRef(function(e,t){var n=React__namespace.useRef(null),o=React__namespace.useState({onScrollCapture:nothing,onWheelCapture:nothing,onTouchMoveCapture:nothing}),l=o[0],d=o[1],f=e.forwardProps,g=e.children,b=e.className,_=e.removeScrollBar,S=e.enabled,R=e.shards,C=e.sideCar,E=e.noIsolation,M=e.inert,I=e.allowPinchZoom,A=e.as,O=A===void 0?"div":A,q=e.gapMode,z=__rest(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),Q=C,F=useMergeRefs([n,t]),V=__assign$1(__assign$1({},z),l);return React__namespace.createElement(React__namespace.Fragment,null,S&&React__namespace.createElement(Q,{sideCar:effectCar,removeScrollBar:_,shards:R,noIsolation:E,inert:M,setCallbacks:d,allowPinchZoom:!!I,lockRef:n,gapMode:q}),f?React__namespace.cloneElement(React__namespace.Children.only(g),__assign$1(__assign$1({},V),{ref:F})):React__namespace.createElement(O,__assign$1({},V,{className:b,ref:F}),g))});RemoveScroll.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},RemoveScroll.classNames={fullWidth:fullWidthClassName,zeroRight:zeroRightClassName};var getNonce=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function makeStyleTag(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=getNonce();return t&&e.setAttribute("nonce",t),e}function injectStyles(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function insertStyleTag(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var stylesheetSingleton=function(){var e=0,t=null;return{add:function(n){e==0&&(t=makeStyleTag())&&(injectStyles(t,n),insertStyleTag(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},styleHookSingleton=function(){var e=stylesheetSingleton();return function(t,n){React__namespace.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},styleSingleton=function(){var e=styleHookSingleton(),t=function(n){var o=n.styles,l=n.dynamic;return e(o,l),null};return t},zeroGap={left:0,top:0,right:0,gap:0},parse=function(e){return parseInt(e||"",10)||0},getOffset$1=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],l=t[e==="padding"?"paddingRight":"marginRight"];return[parse(n),parse(o),parse(l)]},getGapWidth=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return zeroGap;var t=getOffset$1(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},Style=styleSingleton(),lockAttribute="data-scroll-locked",getStyles=function(e,t,n,o){var l=e.left,d=e.top,f=e.right,g=e.gap;return n===void 0&&(n="margin"),`
|
|
356
356
|
.`.concat(noScrollbarsClassName,` {
|
|
357
357
|
overflow: hidden `).concat(o,`;
|
|
358
358
|
padding-right: `).concat(g,"px ").concat(o,`;
|
|
@@ -1009,7 +1009,7 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
|
|
|
1009
1009
|
* LICENSE file in the root directory of this source tree.
|
|
1010
1010
|
*/var hasRequiredReactIs_development;function requireReactIs_development(){return hasRequiredReactIs_development||(hasRequiredReactIs_development=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,l=e?Symbol.for("react.strict_mode"):60108,d=e?Symbol.for("react.profiler"):60114,f=e?Symbol.for("react.provider"):60109,g=e?Symbol.for("react.context"):60110,b=e?Symbol.for("react.async_mode"):60111,_=e?Symbol.for("react.concurrent_mode"):60111,S=e?Symbol.for("react.forward_ref"):60112,R=e?Symbol.for("react.suspense"):60113,C=e?Symbol.for("react.suspense_list"):60120,E=e?Symbol.for("react.memo"):60115,M=e?Symbol.for("react.lazy"):60116,I=e?Symbol.for("react.block"):60121,A=e?Symbol.for("react.fundamental"):60117,O=e?Symbol.for("react.responder"):60118,q=e?Symbol.for("react.scope"):60119;function z(qe){return typeof qe=="string"||typeof qe=="function"||qe===o||qe===_||qe===d||qe===l||qe===R||qe===C||typeof qe=="object"&&qe!==null&&(qe.$$typeof===M||qe.$$typeof===E||qe.$$typeof===f||qe.$$typeof===g||qe.$$typeof===S||qe.$$typeof===A||qe.$$typeof===O||qe.$$typeof===q||qe.$$typeof===I)}function Q(qe){if(typeof qe=="object"&&qe!==null){var ft=qe.$$typeof;switch(ft){case t:var Qe=qe.type;switch(Qe){case b:case _:case o:case d:case l:case R:return Qe;default:var nt=Qe&&Qe.$$typeof;switch(nt){case g:case S:case M:case E:case f:return nt;default:return ft}}case n:return ft}}}var F=b,V=_,te=g,ie=f,ae=t,oe=S,se=o,ge=M,Ae=E,Ne=n,Oe=d,Le=l,Ge=R,je=!1;function Be(qe){return je||(je=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),Fe(qe)||Q(qe)===b}function Fe(qe){return Q(qe)===_}function ze(qe){return Q(qe)===g}function He(qe){return Q(qe)===f}function Xe(qe){return typeof qe=="object"&&qe!==null&&qe.$$typeof===t}function Je(qe){return Q(qe)===S}function Ye(qe){return Q(qe)===o}function at(qe){return Q(qe)===M}function Ke(qe){return Q(qe)===E}function tt(qe){return Q(qe)===n}function Ze(qe){return Q(qe)===d}function et(qe){return Q(qe)===l}function st(qe){return Q(qe)===R}reactIs_development.AsyncMode=F,reactIs_development.ConcurrentMode=V,reactIs_development.ContextConsumer=te,reactIs_development.ContextProvider=ie,reactIs_development.Element=ae,reactIs_development.ForwardRef=oe,reactIs_development.Fragment=se,reactIs_development.Lazy=ge,reactIs_development.Memo=Ae,reactIs_development.Portal=Ne,reactIs_development.Profiler=Oe,reactIs_development.StrictMode=Le,reactIs_development.Suspense=Ge,reactIs_development.isAsyncMode=Be,reactIs_development.isConcurrentMode=Fe,reactIs_development.isContextConsumer=ze,reactIs_development.isContextProvider=He,reactIs_development.isElement=Xe,reactIs_development.isForwardRef=Je,reactIs_development.isFragment=Ye,reactIs_development.isLazy=at,reactIs_development.isMemo=Ke,reactIs_development.isPortal=tt,reactIs_development.isProfiler=Ze,reactIs_development.isStrictMode=et,reactIs_development.isSuspense=st,reactIs_development.isValidElementType=z,reactIs_development.typeOf=Q}()),reactIs_development}var hasRequiredReactIs;function requireReactIs(){return hasRequiredReactIs||(hasRequiredReactIs=1,process.env.NODE_ENV==="production"?reactIs.exports=requireReactIs_production_min():reactIs.exports=requireReactIs_development()),reactIs.exports}var hoistNonReactStatics_cjs,hasRequiredHoistNonReactStatics_cjs;function requireHoistNonReactStatics_cjs(){if(hasRequiredHoistNonReactStatics_cjs)return hoistNonReactStatics_cjs;hasRequiredHoistNonReactStatics_cjs=1;var e=requireReactIs(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},d={};d[e.ForwardRef]=o,d[e.Memo]=l;function f(M){return e.isMemo(M)?l:d[M.$$typeof]||t}var g=Object.defineProperty,b=Object.getOwnPropertyNames,_=Object.getOwnPropertySymbols,S=Object.getOwnPropertyDescriptor,R=Object.getPrototypeOf,C=Object.prototype;function E(M,I,A){if(typeof I!="string"){if(C){var O=R(I);O&&O!==C&&E(M,O,A)}var q=b(I);_&&(q=q.concat(_(I)));for(var z=f(M),Q=f(I),F=0;F<q.length;++F){var V=q[F];if(!n[V]&&!(A&&A[V])&&!(Q&&Q[V])&&!(z&&z[V])){var te=S(I,V);try{g(M,V,te)}catch{}}}}return M}return hoistNonReactStatics_cjs=E,hoistNonReactStatics_cjs}requireHoistNonReactStatics_cjs();var IntlContext=typeof window<"u"&&!window.__REACT_INTL_BYPASS_GLOBAL_CONTEXT__?window.__REACT_INTL_CONTEXT__||(window.__REACT_INTL_CONTEXT__=React__namespace.createContext(null)):React__namespace.createContext(null);IntlContext.Consumer,IntlContext.Provider;var Context=IntlContext;function useIntl(){var e=React__namespace.useContext(Context);return invariantIntlContext(e),e}var DisplayName;(function(e){e.formatDate="FormattedDate",e.formatTime="FormattedTime",e.formatNumber="FormattedNumber",e.formatList="FormattedList",e.formatDisplayName="FormattedDisplayName"})(DisplayName||(DisplayName={}));var DisplayNameParts;(function(e){e.formatDate="FormattedDateParts",e.formatTime="FormattedTimeParts",e.formatNumber="FormattedNumberParts",e.formatList="FormattedListParts"})(DisplayNameParts||(DisplayNameParts={}));function createFormattedDateTimePartsComponent(e){var t=function(n){var o=useIntl(),l=n.value,d=n.children,f=__rest(n,["value","children"]),g=typeof l=="string"?new Date(l||0):l,b=e==="formatDate"?o.formatDateToParts(g,f):o.formatTimeToParts(g,f);return d(b)};return t.displayName=DisplayNameParts[e],t}function createFormattedComponent(e){var t=function(n){var o=useIntl(),l=n.value,d=n.children,f=__rest(n,["value","children"]),g=o[e](l,f);if(typeof d=="function")return d(g);var b=o.textComponent||React__namespace.Fragment;return React__namespace.createElement(b,null,g)};return t.displayName=DisplayName[e],t}createFormattedComponent("formatDate"),createFormattedComponent("formatTime");var FormattedNumber=createFormattedComponent("formatNumber");createFormattedComponent("formatList"),createFormattedComponent("formatDisplayName"),createFormattedDateTimePartsComponent("formatDate"),createFormattedDateTimePartsComponent("formatTime");function BillingCard({appID:e,reseller:t,isLoading:n,withoutReports:o}){const{Statement:l,CreditLimit:d}=t,f=[{label:"0 - 30 Days",value:jsxRuntime.jsx(FormattedNumber,{value:(l==null?void 0:l.Over0)||0,style:"currency",currency:"CAD",currencyDisplay:"symbol"}),icon:Calendar},{label:"31 - 45 Days",value:jsxRuntime.jsx(FormattedNumber,{value:(l==null?void 0:l.Over30)||0,style:"currency",currency:"CAD",currencyDisplay:"symbol"}),icon:CalendarDays},{label:"45+ Days",value:jsxRuntime.jsx(FormattedNumber,{value:(l==null?void 0:l.Over45)||0,style:"currency",currency:"CAD",currencyDisplay:"symbol"}),icon:CalendarRange},{label:"Total",value:jsxRuntime.jsx(FormattedNumber,{value:(l==null?void 0:l.Total)||0,style:"currency",currency:"CAD",currencyDisplay:"symbol"}),icon:DollarSign},{label:"Credit Limit",value:jsxRuntime.jsx(FormattedNumber,{value:d||0,style:"currency",currency:"CAD",currencyDisplay:"symbol"}),icon:CreditCard}],g=()=>{const _=`https://dashboard.randmar.io/${e}/PayInvoice`;window.open(_,"_blank","noopener,noreferrer")};if(n)return jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{className:"border-b p-6 md:p-5",children:jsxRuntime.jsx(Skeleton,{className:"h-6 w-36"})}),jsxRuntime.jsxs(CardContent,{className:"p-6 md:p-5",children:[jsxRuntime.jsxs("div",{className:"grid sm:grid-cols-2 sm:divide-x divide-border",children:[jsxRuntime.jsx("div",{className:"space-y-6 sm:pe-4",children:[1,2,3].map(_=>jsxRuntime.jsxs("div",{className:"flex items-center flex-wrap gap-1.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-24"})]}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 ms-auto"})]},_))}),jsxRuntime.jsx("div",{className:"space-y-6 sm:ps-4 pt-6 sm:pt-0 mt-6 sm:mt-0 border-t sm:border-t-0 border-border",children:[1,2].map(_=>jsxRuntime.jsx("div",{className:_===2?"pt-6 mt-6 border-t border-border":"",children:jsxRuntime.jsxs("div",{className:"flex items-center flex-wrap gap-1.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-24"})]}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 ms-auto"})]})},_))})]}),jsxRuntime.jsx("div",{className:"flex justify-end",children:jsxRuntime.jsx(Skeleton,{className:"h-10 w-28 mt-6"})})]})]});const b=!o;return jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{className:"border-b p-6 md:p-5",children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Billing Overview"})}),jsxRuntime.jsxs(CardContent,{className:"p-6 md:p-5",children:[jsxRuntime.jsxs("div",{className:"grid sm:grid-cols-2 sm:divide-x divide-border",children:[jsxRuntime.jsx("div",{className:"space-y-6 sm:pe-4",children:f.slice(0,3).map((_,S)=>jsxRuntime.jsx(BillingItem,{icon:_.icon,label:_.label,value:_.value},S))}),jsxRuntime.jsx("div",{className:"space-y-6 sm:ps-4 pt-6 sm:pt-0 mt-6 sm:mt-0 border-t sm:border-t-0 border-border",children:f.slice(3).map((_,S)=>jsxRuntime.jsx("div",{className:S===1?"pt-6 mt-6 border-t border-border":"",children:jsxRuntime.jsx(BillingItem,{icon:_.icon,label:_.label,value:_.value})},S))})]}),b&&jsxRuntime.jsx("div",{className:"flex justify-end",children:jsxRuntime.jsx(Button,{className:"mt-6",onClick:g,children:"Pay Invoices"})})]})]})}function BillingItem({icon:e,label:t,value:n}){return jsxRuntime.jsxs("div",{className:"flex items-center flex-wrap gap-1.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(e,{className:"size-4 text-muted-foreground"}),jsxRuntime.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:t})]}),jsxRuntime.jsx("span",{className:"text-base font-semibold ms-auto",children:n})]})}function ChangePricingTierModal({open:e,setOpen:t,tier:n,onTierChange:o,isLoading:l}){const d=()=>{t(!1)};return jsxRuntime.jsx(Dialog,{open:e,onOpenChange:t,children:jsxRuntime.jsxs(DialogContent,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsx(DialogHeader,{children:jsxRuntime.jsx(DialogTitle,{children:"Change Pricing Tier"})}),jsxRuntime.jsxs("div",{className:"grid gap-1.5 py-2",children:[jsxRuntime.jsxs("p",{className:"text-lg text-muted-foreground",children:["Requested Pricing Tier: ",jsxRuntime.jsx("span",{className:"font-bold",children:n})]}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:"If your account qualifies, your pricing will update immediately."}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:"If not, we'll review your request and notify you of the decision."})]}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button,{variant:"outline",onClick:d,disabled:l,children:"Cancel"}),jsxRuntime.jsx(Button,{onClick:o,disabled:l,children:l?"Loading...":`Apply for ${n}`})]})]})})}const getPricingText=e=>e===1?"The Best":e===2?"Fixed 12.5% GP on all items":e===3?"Advantageous":e===4?"Buying Group":e===5?"Cost":e,getShippingText=e=>e==="A"?"Free or Custom":e==="B"?"Fixed $10 anywhere":e==="C"?`Free shipping on $150+ orders to your location,
|
|
1011
1011
|
$15 for drop shipped orders under $1,500,
|
|
1012
|
-
$10 with opportunities under $1,000`:e==="D"?"$15 under $1,500":e==="E"?"Full shipping charges":e,getTermsText=e=>e==="STRIPE"?"Credit card payment":e==="NET30"?"Net 30 days":e,AccountTier=({isSuperAdmin:e,readonly:t,reseller:n,appID:o,isLoading:l})=>{const{toast:d}=useToast(),[f,g]=React.useState(!1),[b,_]=React.useState(""),[S,{isLoading:R}]=usePostV4PartnerByApplicationIdAccountResellerAndFieldNameMutation(),C=Oe=>Oe&&{Starter:"starter","E-Commerce":"ecommerce",Commercial:"commercial",Basics:"cws",Novexco:"novexco","Jean Coutu":"jeancoutu",Exclusive:"exclusive"}[Oe]||"",E=Oe=>Oe&&{A:"free",B:"fixed",C:"dropshipped",D:"under1500",E:"fullcharges"}[Oe]||"",M=Oe=>Oe&&{1:"exclusive",2:"ecommerce",3:"commercial",4:"buyinggroup",5:"cost"}[Oe]||"",[I,A]=React.useState(C((n==null?void 0:n.Priority)??"")),[O,q]=React.useState(E((n==null?void 0:n.ShippingProfile)??"")),[z,Q]=React.useState(M(n==null?void 0:n.PriceProfile)),F=Oe=>({starter:"Starter",ecommerce:"E-Commerce",commercial:"Commercial",cws:"Basics",novexco:"Novexco",jeancoutu:"Jean Coutu",exclusive:"Exclusive"})[Oe]||Oe,V=Oe=>({free:"A",fixed:"B",dropshipped:"C",under1500:"D",fullcharges:"E"})[Oe]||Oe,te=Oe=>({exclusive:"1",ecommerce:"2",commercial:"3",buyinggroup:"4",cost:"5"})[Oe]||Oe;React.useEffect(()=>{A(C((n==null?void 0:n.Priority)??"")),q(E((n==null?void 0:n.ShippingProfile)??"")),Q(M(n==null?void 0:n.PriceProfile))},[n]);const ie=async(Oe,Le,Ge,je)=>{try{(await S({applicationId:o,fieldName:Oe,newValue:Le})).error?d({title:"Error",description:je,variant:"destructive"}):d({title:"Success",description:Ge,variant:"success"})}catch{d({title:"Error",description:"An unexpected error occurred",variant:"destructive"})}},ae=async Oe=>{A(Oe);const Le=F(Oe);ie("Priority",Le,`Priority updated to ${Le}`,"Failed to update priority")},oe=async Oe=>{q(Oe);const Le=V(Oe);ie("ShippingProfile",Le,`Shipping profile updated to ${Le}`,"Failed to update shipping profile")},se=async Oe=>{Q(Oe);const Le=te(Oe);ie("PriceProfile",Le,`Pricing profile updated to ${Le}`,"Failed to update pricing profile")},ge=async()=>{try{const Oe=await S({applicationId:o,fieldName:"Tier",newValue:b});Oe.error?d({title:"Error",description:"Failed to update reseller",variant:"destructive"}):Oe.data?d({title:"Success",description:`Pricing Tier changed to ${b}`,variant:"success"}):d({title:"Considered",description:"Request being considered",variant:"success"})}catch{d({title:"Error",description:"An unexpected error occurred",variant:"destructive"})}finally{g(!1),_("")}},Ae=[{name:"Terms",enabled:n.Priority==="Starter"},{name:"E-Commerce",enabled:n.Priority==="Commercial"},{name:"Commercial",enabled:n.Priority==="E-Commerce"},{name:"Exclusive",enabled:e}],Ne=Oe=>{_(Oe),g(!0)};return l?jsxRuntime.jsxs(Card,{className:"md:col-span-2 xl:col-span-1 md:max-w-xl xl:max-w-[unset]",children:[jsxRuntime.jsx(CardHeader,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-28"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-16 rounded-full"})]})}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsxs("div",{className:"mb-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-40 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-56"})]}),jsxRuntime.jsx("div",{className:"grid gap-3",children:[1,2,3].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full shrink-0"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-full"})]})]},Oe))}),jsxRuntime.jsxs("div",{className:"flex gap-2 mt-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Card,{className:"md:col-span-2 xl:col-span-1 md:max-w-xl xl:max-w-[unset]",children:[jsxRuntime.jsxs(CardHeader,{className:"pb-2 pt-4 px-4 flex flex-row items-center justify-between",children:[jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Account Tier"}),jsxRuntime.jsx(Badge,{variant:"secondary",className:"bg-green-100 text-green-700 hover:bg-green-200 text-xs",children:"Active"})]}),jsxRuntime.jsxs(CardContent,{className:"pt-2 px-4 pb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3 bg-primary/5 p-4 rounded-lg",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-lg font-bold text-primary",children:[(n==null?void 0:n.Priority)||""," Tier"]}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Optimized for online retail"})]}),jsxRuntime.jsx(CircleCheck,{className:"h-6 w-6 text-green-600"})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-2 mb-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Package2,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Pricing"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground truncate",children:getPricingText(n.PriceProfile||0)})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Truck,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Shipping"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:getShippingText(n.ShippingProfile||"").split(".")[0]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Calendar,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Payment terms"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:getTermsText((n==null?void 0:n.Terms)||"")})]})]})]}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[!t&&jsxRuntime.jsx(Button,{variant:"outline",className:"flex-1",asChild:!0,children:jsxRuntime.jsxs("a",{href:"https://www.randmar.io/docs/overview/pricingTiers",target:"_blank",rel:"noreferrer",children:[jsxRuntime.jsx(ExternalLink,{className:"h-4 w-4 mr-1"}),"Pricing Tiers"]})}),jsxRuntime.jsxs(Popover,{children:[jsxRuntime.jsx(PopoverTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button,{disabled:t,className:t?"hidden":"flex-1",children:["Upgrade Tier ",jsxRuntime.jsx(ChevronRight,{className:"h-3 w-3 ml-1"})]})}),jsxRuntime.jsx(PopoverContent,{className:"w-56 p-2",children:jsxRuntime.jsxs("div",{className:"grid gap-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-xs mb-1",children:"Select a tier"}),Ae.map(Oe=>jsxRuntime.jsx(Button,{variant:"ghost",size:"sm",className:"w-full justify-start h-8",disabled:!Oe.enabled,onClick:()=>Ne(Oe.name),children:Oe.name},Oe.name))]})})]})]})]})]}),jsxRuntime.jsx(ChangePricingTierModal,{isLoading:R,open:f,setOpen:g,tier:b,onTierChange:ge}),e&&!t&&jsxRuntime.jsxs(Card,{className:"mt-4",children:[jsxRuntime.jsx(CardHeader,{className:"pb-2 pt-3 px-4",children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Admin Configuration"})}),jsxRuntime.jsx(CardContent,{className:"pt-2 px-4 pb-4",children:jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Priority"}),jsxRuntime.jsx(RadioGroup$1,{value:I,onValueChange:ae,className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-1",children:[{value:"starter",label:"Starter"},{value:"ecommerce",label:"E-Commerce"},{value:"commercial",label:"Commercial"},{value:"cws",label:"CWS (Basics)"},{value:"novexco",label:"Novexco"},{value:"jeancoutu",label:"Jean Coutu"},{value:"exclusive",label:"Exclusive"}].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:Oe.value,id:`priority-${Oe.value}`,className:"h-6 w-6 scale-50"}),jsxRuntime.jsx(Label$2,{htmlFor:`priority-${Oe.value}`,className:"cursor-pointer text-xs",children:Oe.label})]},Oe.value))})]}),jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Shipping Profile"}),jsxRuntime.jsx(RadioGroup$1,{value:O,onValueChange:oe,className:"grid grid-cols-1 md:grid-cols-2 gap-1",children:[{value:"free",label:"Free (A)"},{value:"fixed",label:"Fixed $10 Shipping (B)"},{value:"dropshipped",label:"$15 for drop shipped (C)"},{value:"under1500",label:"15$ under 1,500 (D)"},{value:"fullcharges",label:"Full shipping charges (E)"}].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:Oe.value,id:`shipping-${Oe.value}`,className:"h-6 w-6 scale-50"}),jsxRuntime.jsx(Label$2,{htmlFor:`shipping-${Oe.value}`,className:"cursor-pointer text-xs",children:Oe.label})]},Oe.value))})]}),jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Pricing Profile"}),jsxRuntime.jsx(RadioGroup$1,{value:z,onValueChange:se,className:"grid grid-cols-2 sm:grid-cols-3 gap-1",children:[{value:"exclusive",label:"Exclusive (1)"},{value:"ecommerce",label:"E-Commerce (2)"},{value:"commercial",label:"Commercial (3)"},{value:"buyinggroup",label:"Buying Group (4)"},{value:"cost",label:"Cost (5)"}].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:Oe.value,id:`pricing-${Oe.value}`,className:"h-6 w-6 scale-50 antialiased"}),jsxRuntime.jsx(Label$2,{htmlFor:`pricing-${Oe.value}`,className:"cursor-pointer text-xs",children:Oe.label})]},Oe.value))})]})]})})]})]})};function OrderCategories({openOrders:e=[],isLoading:t=!1}){const n=(e==null?void 0:e.filter(I=>I.DocumentType==="Order"))||[],o=(e==null?void 0:e.filter(I=>I.DocumentType==="Shipment"))||[],l=n.filter(I=>I.WarehouseCode!=="3PLE"),d=l.reduce((I,A)=>I+(A.Quantity??0),0),f=l.reduce((I,A)=>I+(A.ExtendedPrice??0),0),g=n.filter(I=>I.WarehouseCode==="3PLE"),b=g.reduce((I,A)=>I+(A.Quantity??0),0),_=g.reduce((I,A)=>I+(A.ExtendedPrice??0),0),S=o.reduce((I,A)=>I+(A.Quantity??0),0),R=o.reduce((I,A)=>I+(A.ExtendedPrice??0),0),C=d+b+S,E=f+_+R,M=[{name:"All",icon:Package,color:"bg-blue-500",orders:C,amount:E},{name:"Processing",icon:RefreshCcw,color:"bg-yellow-500",orders:d,amount:f},{name:"Shipped",icon:Truck,color:"bg-green-500",orders:S,amount:R},{name:"Delayed",icon:CircleAlert,color:"bg-red-500",orders:b,amount:_}];return t?jsxRuntime.jsxs(Card,{className:"w-full md:col-span-2 xl:col-span-1",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(Skeleton,{className:"h-7 w-40"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3.5",children:[1,2,3,4].map(I=>jsxRuntime.jsx(Card,{className:"overflow-hidden rounded-md rounded-b-lg border-0 shadow-md",children:jsxRuntime.jsxs(CardContent,{className:"p-0",children:[jsxRuntime.jsx("div",{className:"bg-gray-200 h-[3px]"}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-12"})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]})]})]})]})},I))})})]}):jsxRuntime.jsxs(Card,{className:"w-full md:col-span-2 xl:col-span-1",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Order Categories"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3.5",children:M.map(I=>jsxRuntime.jsx(Card,{className:"overflow-hidden rounded-md rounded-b-lg border-0 shadow-md",children:jsxRuntime.jsxs(CardContent,{className:"p-0",children:[jsxRuntime.jsx("div",{className:`${I.color} bg-opacity-60 h-[3px]`}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-base",children:I.name}),jsxRuntime.jsx("div",{className:`${I.color} bg-opacity-90 p-2 rounded-full`,children:jsxRuntime.jsx(I.icon,{className:"size-4 shrink-0 text-white"})})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Orders"}),jsxRuntime.jsx("p",{className:"text-xl font-bold",children:I.orders})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Amount"}),jsxRuntime.jsx("p",{className:"text-base font-semibold",children:jsxRuntime.jsx(FormattedNumber,{value:I.amount,style:"currency",currency:"CAD",currencyDisplay:"symbol"})})]})]})]})]})},I.name))})})]})}function LongMonthName(e){if(!e)return;const t=["","January","February","March","April","May","June","July","August","September","October","November","December"];return e===void 0&&(e=new Date().getMonth()+1),e<1&&(e=12+e),t[e]}function SalesSummary({fiscalYearMonthStart:e,salesData:t,isLoading:n}){const o=(t==null?void 0:t.SalesLast30Days)??0,l=(t==null?void 0:t.SalesLast3Months)??0,d=(t==null?void 0:t.SalesYearToDay)??0,f=LongMonthName(e);return n?jsxRuntime.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 mb-4",children:[jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-24"})]})]}),jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-28"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-24"})]})]}),jsxRuntime.jsxs(Card,{className:"col-span-2 lg:col-span-1",children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-36"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-24"})]})]})]}):jsxRuntime.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 mb-4",children:[jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsx(CardTitle,{className:"text-sm font-medium",children:"Last 30 Days"}),jsxRuntime.jsx("div",{className:"p-2 rounded-full bg-neutral-200",children:jsxRuntime.jsx(TrendingUp,{className:"size-4 shrink-0 text-muted-foreground"})})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx("div",{className:"text-2xl font-bold",children:jsxRuntime.jsx(FormattedNumber,{value:o,style:"currency",currency:"CAD",currencyDisplay:"symbol"})}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground"})]})]}),jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsx(CardTitle,{className:"text-sm font-medium",children:"Last 3 Months"}),jsxRuntime.jsx("div",{className:"p-2 rounded-full bg-neutral-200",children:jsxRuntime.jsx(Calendar,{className:"size-4 shrink-0 text-muted-foreground"})})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx("div",{className:"text-2xl font-bold",children:jsxRuntime.jsx(FormattedNumber,{value:l,style:"currency",currency:"CAD",currencyDisplay:"symbol"})}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground"})]})]}),f&&jsxRuntime.jsxs(Card,{className:"col-span-2 lg:col-span-1",children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsxs(CardTitle,{className:"text-sm font-medium",children:["Year to Date (",f,")"]}),jsxRuntime.jsx("div",{className:"p-2 rounded-full bg-neutral-200",children:jsxRuntime.jsx(CalendarDays,{className:"size-4 shrink-0 text-muted-foreground"})})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx("div",{className:"text-2xl font-bold",children:jsxRuntime.jsx(FormattedNumber,{value:d,style:"currency",currency:"CAD",currencyDisplay:"symbol"})}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground"})]})]})]})}function ReportsSection({isLoading:e,userEmail:t,appID:n}){const{toast:o}=useToast(),[l,{isLoading:d}]=usePostV4ResellerByRouteResellerIdReportWalmartTrackingFileEmailMutation(),[f,{isLoading:g}]=usePostV4ResellerByRouteResellerIdReportAmazonTrackingFileEmailMutation(),[b,{isLoading:_}]=usePostV4ResellerByRouteResellerIdReportOpenOrdersEmailMutation(),[S,{isLoading:R}]=usePostV4ResellerByRouteResellerIdReportProductsEmailMutation(),[C,{isLoading:E}]=usePostV4ResellerByRouteResellerIdReportInvoicesEmailMutation(),[M,{isLoading:I}]=usePostV4ResellerByRouteResellerIdDocumentStatementEmailMutation(),[A,O]=React.useState(null),[q,z]=React.useState(t),[Q,F]=React.useState(!1),V=[{name:"Products",reports:[{id:"Products",title:"Universal Product List",description:"A comprehensive overview of your product list with detailed specifications and pricing information.",icon:Package}]},{name:"Operation Details",reports:[{id:"OpenOrders",title:"Order Details",description:"A detailed report of all your orders and shipments, including status, tracking information, and delivery estimates.",icon:ShoppingCart},{id:"Invoices",title:"Invoices and Credits Report",description:"Detailed overview of your invoices and credits within a specific date range. It also contains reports about additional charges, serial numbers, and other relevant information.",icon:ScrollText},{id:"Statement",title:"Statement and RMAs Report",description:"A detailed report of all unpaid invoices and active RMAs.",icon:Banknote}]},{name:"Tracking Files",reports:[{id:"AmazonTrackingFile",title:"Amazon Tracking File",description:"Track products sold on Amazon marketplace with detailed sales and inventory information.",icon:ChartNoAxesColumnIncreasing},{id:"WalmartTrackingFile",title:"Walmart Tracking File",description:"Track products sold on Walmart marketplace with detailed sales and inventory information.",icon:ChartNoAxesColumnIncreasing}]}],te=async oe=>{O(oe),F(!0)},ie=async()=>{if(!(!A||!n))try{switch(A.id){case"Products":await S({routeResellerId:n,emailAddress:q}).unwrap();break;case"AmazonTrackingFile":await f({routeResellerId:n,emailAddress:q}).unwrap();break;case"WalmartTrackingFile":await l({routeResellerId:n,emailAddress:q}).unwrap();break;case"OpenOrders":await b({routeResellerId:n,emailAddress:q}).unwrap();break;case"Invoices":await C({routeResellerId:n,emailAddress:q}).unwrap();break;case"Statement":await M({routeResellerId:n,emailAddress:q}).unwrap();break;default:throw new Error("invalid report id")}o({title:"Report requested",description:`The ${A.title} will be sent to ${q} shortly.`,variant:"success"}),F(!1)}catch(oe){console.error("Error requesting report:",oe),o({title:"Error",description:"Failed to request report. Please try again.",variant:"destructive"})}},ae=_||R||g||d||I||E;return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{children:[jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Reports"}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:"Download essential business reports, from your Product List to your Order Details."})]}),jsxRuntime.jsx(CardContent,{className:"space-y-6",children:e?jsxRuntime.jsx(jsxRuntime.Fragment,{children:[1,2,3].map(oe=>jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-48"}),[1,2].map(se=>jsxRuntime.jsxs("div",{className:"flex items-start gap-4 p-4 border rounded-lg",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-9 rounded-full"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-full"})]}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"})]},se))]},oe))}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:V.map(oe=>jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold",children:oe.name}),oe.reports.map(se=>jsxRuntime.jsxs("div",{className:"flex items-start gap-4 p-4 border rounded-lg hover:bg-gray-100 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:jsxRuntime.jsx(se.icon,{className:"h-5 w-5 text-primary"})}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("h4",{className:"font-semibold text-sm",children:se.title}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:se.description})]}),jsxRuntime.jsxs(Button,{variant:"outline",size:"sm",className:"flex items-center gap-1",onClick:()=>te(se),children:[jsxRuntime.jsx(Download,{className:"h-4 w-4"}),"Request"]})]},se.id))]},oe.name))})}),jsxRuntime.jsx(Dialog,{open:Q,onOpenChange:F,children:jsxRuntime.jsxs(DialogContent,{children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsxs(DialogTitle,{children:["Request ",A==null?void 0:A.title]}),jsxRuntime.jsx(DialogDescription,{children:"Enter the email address where you would like to receive the report."})]}),jsxRuntime.jsxs("div",{className:"py-4",children:[jsxRuntime.jsx(Label$2,{htmlFor:"email",children:"Email"}),jsxRuntime.jsx(Input,{id:"email",value:q,onChange:oe=>z(oe.target.value),placeholder:"your@email.com",className:"mt-2"})]}),jsxRuntime.jsx(DialogDescription,{children:"The report will take around 5 minutes to generate."}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button,{variant:"outline",onClick:()=>F(!1),children:"Cancel"}),jsxRuntime.jsx(Button,{onClick:ie,disabled:!q||ae,children:ae?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):"Send Report"})]})]})})]})}function MonthlySalesChart({salesData:e,chartHeight:t=300,units:n="$",unitsPosition:o="left",className:l,extrapolate:d=!0,isLoading:f=!1}){const[g,b]=React.useState([]);return React.useEffect(()=>{if(f||!e||e.length===0){b([]);return}const _=e.reduce((q,z)=>{const Q=z.Day??0,F=Math.floor(Q).toString();if(F.length!==8||isNaN(parseInt(F)))return console.warn(`Skipping invalid Day format: ${z.Day}`),q;const V=F.substring(0,4),te=F.substring(4,6),ie=`${V}-${te}`;return q[ie]=(q[ie]||0)+(z.ExtendedPrice??0),q},{}),S=Object.keys(_).sort(),R=new Date,C=R.getFullYear(),E=R.getMonth(),M=R.getDate(),I=`${C}-${(E+1).toString().padStart(2,"0")}`,A={..._};if(d&&S.length>0&&S[S.length-1]===I){const q=A[I],z=new Date(C,E+1,0).getDate();if(M<z&&M>0){const F=q/M*z;A[I]=F}}const O=S.map(q=>{const z=A[q],[Q,F]=q.split("-").map(Number);return{month:new Date(Q,F-1).toLocaleString("default",{month:"short",year:"numeric"}),sales:z}});b(O)},[e,d,f]),f?jsxRuntime.jsx(Skeleton,{style:{height:t},className:l}):g.length===0?jsxRuntime.jsx("div",{style:{height:t},className:l||"p-4 text-center text-muted-foreground flex items-center justify-center",children:"No monthly sales data to display."}):jsxRuntime.jsx(AreaChart,{data:g,units:n,unitsPosition:o,height:t,className:l})}function UnsavedChangesDialog({isOpen:e,onClose:t,onConfirm:n,title:o,description:l,confirmText:d="Confirm",cancelText:f="Cancel"}){return jsxRuntime.jsx(Dialog,{open:e,onOpenChange:t,children:jsxRuntime.jsxs(DialogContent,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:o}),jsxRuntime.jsx(DialogDescription,{children:l})]}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button,{variant:"outline",onClick:t,children:f}),jsxRuntime.jsx(Button,{onClick:n,children:d})]})]})})}function useRouterNavigationGuard(e){const[t,n]=React.useState(!1),o=reactRouterDom.useBlocker(React.useCallback(({currentLocation:g,nextLocation:b})=>{const _=g.pathname!==b.pathname||g.search!==b.search||g.hash!==b.hash;return e()&&_},[e]));React.useEffect(()=>{o.state==="blocked"&&n(!0)},[o]),React.useEffect(()=>{const g=b=>{if(e())return b.preventDefault(),"You have unsaved changes. Are you sure you want to leave?"};return window.addEventListener("beforeunload",g),()=>{window.removeEventListener("beforeunload",g)}},[e]);const l=React.useCallback(()=>{n(!1),o.state==="blocked"&&o.proceed()},[o]),d=React.useCallback(()=>{n(!1),o.state==="blocked"&&o.reset()},[o]),f=React.useCallback(()=>jsxRuntime.jsx(UnsavedChangesDialog,{isOpen:t,onClose:d,onConfirm:l,title:"Unsaved Changes",description:"You have unsaved changes. Are you sure you want to leave? Your changes will be lost.",confirmText:"Discard Changes",cancelText:"Stay on Page"}),[t,d,l]);return{showDialog:t,handleConfirm:l,handleCancel:d,NavigationGuardDialog:f}}const PartnerLogo=({applicationId:e,width:t,height:n,align:o})=>{const l=!e,{data:d,isLoading:f}=useGetV4PartnerByApplicationIdAccountLogoExistsQuery({applicationId:e},{skip:l}),{data:g,isLoading:b}=useGetV4PartnerByApplicationIdAccountLogoQuery({applicationId:e,...t!==void 0&&{width:t},...n!==void 0&&{height:n},...o!==void 0&&{align:o}},{skip:l||!d}),_=React.useMemo(()=>{if(g instanceof ArrayBuffer&&g.byteLength>0)try{const R=new Uint8Array(g);let C="";for(let I=0;I<R.byteLength;I++)C+=String.fromCharCode(R[I]);const E=btoa(C);let M="image/png";return R.length>4&&(R[0]===137&&R[1]===80&&R[2]===78&&R[3]===71?M="image/png":R[0]===255&&R[1]===216&&R[R.length-2]===255&&R[R.length-1]===217?M="image/jpeg":R[0]===71&&R[1]===73&&R[2]===70&&R[3]===56&&(M="image/gif")),`data:${M};base64,${E}`}catch(R){return console.error(`Error converting logo for Partner ID ${e}:`,R),null}return null},[g,e]);if(!e)return jsxRuntime.jsx("div",{className:"flex items-center justify-start h-8 w-8 text-muted-foreground",children:jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx("div",{className:"h-8 w-8 flex items-center justify-center border border-dashed border-border rounded-sm bg-muted/20 p-1",children:jsxRuntime.jsx("span",{className:"text-xs font-mono",children:"N/A"})})}),jsxRuntime.jsx(TooltipContent,{side:"top",align:"center",children:jsxRuntime.jsx("p",{children:"ID: Not available"})})]})})});const S=()=>f||d===!0&&b&&!g?jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-sm"}):d===!0&&_?jsxRuntime.jsx("img",{src:_,alt:`${e}'s logo`,className:"h-8 w-auto max-w-[60px] object-contain rounded-sm"}):jsxRuntime.jsx("div",{className:"h-8 w-8 flex items-center justify-center border border-dashed border-border rounded-sm bg-muted/20 p-1",title:`Logo for ${e}`,children:jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground font-mono text-center leading-none break-all",children:e.substring(0,3).toUpperCase()})});return jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs("div",{className:"flex items-center justify-start h-8 min-w-[32px] cursor-default",children:[" ",S()]})}),jsxRuntime.jsx(TooltipContent,{side:"top",align:"center",children:jsxRuntime.jsxs("p",{children:["ID: ",e]})})]})})};function getEndDateStatus(e){if(!e)return{text:"No End Date",variant:"neutral",daysRemaining:null};const t=new Date(e);if(isNaN(t.getTime()))return{text:"Invalid Date",variant:"neutral",daysRemaining:null};const n=new Date,o=new Date(t.getFullYear(),t.getMonth(),t.getDate()),l=new Date(n.getFullYear(),n.getMonth(),n.getDate()),d=o.getTime()-l.getTime(),f=Math.ceil(d/(1e3*60*60*24));return f<0?{text:`Ended ${Math.abs(f)}d ago`,variant:"destructive",daysRemaining:f}:f===0?{text:"Ends today",variant:"destructive",daysRemaining:f}:f<=7?{text:`Ends in ${f}d`,variant:"destructive",daysRemaining:f}:f<=30?{text:`Ends in ${f}d`,variant:"warning",daysRemaining:f}:{text:`Ends in ${f}d`,variant:"neutral",daysRemaining:f}}const formatDate=e=>{if(!e)return"N/A";try{const t=new Date(e);return isNaN(t.getTime())?"Invalid Date":t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return"Invalid Date"}},Opportunities=({applicationId:e,opportunities:t=null,loading:n=!1})=>{var V;const{toast:o}=useToast(),[l,d]=React.useState({}),[f,g]=React.useState(!1),[b,_]=React.useState(""),[S,R]=React.useState(null),C=React.useCallback((te,ie,ae)=>{d(oe=>({...oe,[te]:{...oe[te],[ie]:ae}}))},[]),[E]=usePutV4ResellerByRouteResellerIdOpportunityAndManufacturerIdDefaultMutation(),M=React.useCallback(async te=>{if(!te.BidNumber){o({title:"Error",description:"Bid Number is missing, cannot set default.",variant:"destructive"});return}const ie=te.BidNumber;C(ie,"isSettingDefault",!0),E({routeResellerId:e,manufacturerId:te.ManufacturerId??"",opportunityNumber:ie}).unwrap().then(()=>{o({title:"Success",description:`Opportunity "${te.OpportunityName||te.Opportunity||ie}" was successfully set as default.`,variant:"success"})}).catch(ae=>{var oe;console.error("Set as default error:",ae),o({title:"Error",description:((oe=ae.data)==null?void 0:oe.message)||ae.message||"An error occurred while setting this opportunity as default.",variant:"destructive"})}).finally(()=>{C(ie,"isSettingDefault",!1)})},[e,E,o,C]),[I]=usePostV4ResellerByRouteResellerIdOpportunityAndManufacturerIdBidNumberEmailMutation(),A=React.useCallback(te=>{if(!te.BidNumber){o({title:"Error",description:"Bid Number is missing, cannot prepare report.",variant:"destructive"});return}R(te),_(""),g(!0)},[o]),O=React.useCallback(async()=>{if(!S||!S.BidNumber){o({title:"Error",description:"No opportunity selected or Bid Number is missing.",variant:"destructive"});return}if(!b.trim()||!/\S+@\S+\.\S+/.test(b)){o({title:"Validation Error",description:"Please enter a valid email address.",variant:"destructive"});return}const te=S.BidNumber;C(te,"isSendingReport",!0),I({routeResellerId:e,manufacturerId:S.ManufacturerId??"",bidNumber:te,emailAddress:b}).unwrap().then(()=>{o({title:"Success",description:`A report for "${S.OpportunityName||S.Opportunity||te}" was successfully sent to ${b}.`,variant:"success"}),g(!1)}).catch(ie=>{var ae;console.error("Send report by email error:",ie),o({title:"Error",description:((ae=ie.data)==null?void 0:ae.message)||ie.message||"An error occurred while sending the report by email.",variant:"destructive"})}).finally(()=>{C(te,"isSendingReport",!1),f||(R(null),_(""))})},[S,b,e,I,o,C,g]),q=React.useMemo(()=>[{accessorKey:"ManufacturerId",header:"Manuf. ID",cell:({row:te})=>jsxRuntime.jsx(PartnerLogo,{applicationId:te.original.ManufacturerId,height:10,width:18}),enableSorting:!0,enableFiltering:!0},{id:"opportunityDisplay",accessorFn:te=>te.OpportunityName||te.Opportunity,header:"Opportunity",cell:({getValue:te})=>jsxRuntime.jsx("div",{className:"min-w-[150px]",children:te()??"N/A"}),enableSorting:!0,enableFiltering:!0},{accessorKey:"BidNumber",header:"Bid Number",cell:({row:te})=>te.original.BidNumber??"N/A",enableSorting:!0,enableFiltering:!0},{id:"statusInfo",header:"Status",cell:({row:te})=>{const ie=te.original,ae=ie.Active===!0,oe=getEndDateStatus(ie.EndDate);let se="border-gray-400 bg-gray-100 text-gray-600 dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400";return oe.variant==="destructive"?se="border-red-500 bg-red-100 text-red-700 dark:border-red-600 dark:bg-red-900/50 dark:text-red-400":oe.variant==="warning"&&(se="border-yellow-500 bg-yellow-100 text-yellow-700 dark:border-yellow-600 dark:bg-yellow-900/50 dark:text-yellow-400"),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 min-w-[200px]",children:[jsxRuntime.jsx(Badge,{variant:"outline",className:ae?"border-green-500 bg-green-100 text-green-700 dark:border-green-600 dark:bg-green-900/50 dark:text-green-400 font-medium":"border-gray-400 bg-gray-100 text-gray-600 dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400 font-medium",children:ae?"Active":"Inactive"}),ie.EndDate&&jsxRuntime.jsx(Badge,{variant:"outline",className:`${se} font-medium`,children:oe.text}),jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Button,{variant:"ghost",size:"icon",className:"h-6 w-6 p-0 data-[state=delayed-open]:bg-accent data-[state=instant-open]:bg-accent",children:jsxRuntime.jsx(Info,{className:"h-4 w-4 text-muted-foreground"})})}),jsxRuntime.jsx(TooltipContent,{side:"top",align:"center",className:"bg-popover text-popover-foreground p-2 rounded shadow-lg",children:jsxRuntime.jsxs("div",{className:"text-sm space-y-1",children:[jsxRuntime.jsxs("p",{children:[jsxRuntime.jsx("strong",{children:"Start:"})," ",formatDate(ie.StartDate)]}),jsxRuntime.jsxs("p",{children:[jsxRuntime.jsx("strong",{children:"End:"})," ",formatDate(ie.EndDate)]}),jsxRuntime.jsxs("p",{children:[jsxRuntime.jsx("strong",{children:"Updated:"})," ",formatDate(ie.LastUpdate)]})]})})]})})]})},enableFiltering:!1},{id:"actions",header:"Actions",cell:({row:te})=>{var Ne,Oe;const ie=te.original;if(!ie.BidNumber)return jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"Actions unavailable"});const ae=ie.BidNumber,oe=(Ne=l[ae])==null?void 0:Ne.isSettingDefault,se=(S==null?void 0:S.BidNumber)===ae&&((Oe=l[ae])==null?void 0:Oe.isSendingReport),ge=oe||se,Ae=ie.CanBeSetAsDefault===!0;return jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsxs(Button,{variant:"outline",size:"sm",onClick:()=>M(ie),disabled:ge||!Ae,title:Ae?"Set as default":"This opportunity cannot be set as default",className:"flex items-center",children:[oe?jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}):jsxRuntime.jsx(Star,{className:"mr-2 h-4 w-4"})," Set Default"]}),jsxRuntime.jsxs(Button,{variant:"outline",size:"sm",onClick:()=>A(ie),disabled:ge,title:"Send report by email",className:"flex items-center",children:[se?jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}):jsxRuntime.jsx(Send,{className:"mr-2 h-4 w-4"})," Send Report"]})]})}}],[l,M,A,S]),z=React.useMemo(()=>{const te={};if(t){const ie=Array.from(new Set(t.map(oe=>oe.ManufacturerId).filter(oe=>oe!=null)));te.ManufacturerId=ie;const ae=Array.from(new Set(t.map(oe=>oe.OpportunityName||oe.Opportunity).filter(oe=>oe!=null)));te.opportunityDisplay=ae}return te},[t]),Q=t||[],F=S!=null&&S.BidNumber?(V=l[S.BidNumber])==null?void 0:V.isSendingReport:!1;return n?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsxs(CardHeader,{children:[" ",jsxRuntime.jsx(Skeleton,{className:"h-7 w-48"})," "]}),jsxRuntime.jsxs(CardContent,{className:"space-y-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-full rounded-md border"}),jsxRuntime.jsx(Skeleton,{className:"h-48 w-full rounded-md border"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between pt-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-[130px]"}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-20"})," ",jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"})," ",jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"})," ",jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"})]})]})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsxs(CardHeader,{children:[" ",jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Opportunities"})," "]}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx(DataTable,{columns:q,data:Q,uniqueValues:z})})]}),jsxRuntime.jsx(Dialog,{open:f,onOpenChange:te=>{g(te),te||(R(null),_(""))},children:jsxRuntime.jsxs(DialogContent,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:"Send Opportunity Report"}),jsxRuntime.jsxs(DialogDescription,{children:["Enter the email address to send the report for opportunity: ",jsxRuntime.jsx("br",{}),jsxRuntime.jsx("span",{className:"font-semibold",children:(S==null?void 0:S.OpportunityName)||(S==null?void 0:S.Opportunity)||"N/A"}),(S==null?void 0:S.BidNumber)&&jsxRuntime.jsxs("span",{className:"block text-sm text-muted-foreground",children:["Bid Number: ",S.BidNumber]})]})]}),jsxRuntime.jsx("div",{className:"grid gap-4 py-4",children:jsxRuntime.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[jsxRuntime.jsx(Label$2,{htmlFor:"email",className:"text-right",children:"Email"}),jsxRuntime.jsx(Input,{id:"email",type:"email",value:b,onChange:te=>_(te.target.value),placeholder:"recipient@example.com",className:"col-span-3",disabled:F})]})}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button,{variant:"outline",onClick:()=>g(!1),disabled:F,children:"Cancel"}),jsxRuntime.jsxs(Button,{type:"submit",onClick:O,disabled:F,children:[F&&jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"})," Send Report"]})]})]})})]})};function ResellerOverview({appID:e,reseller:t,readonly:n,userEmail:o,isSuperAdmin:l,withoutReports:d=!1}){const{data:f,isLoading:g,isError:b}=useGetV4PartnerByApplicationIdAccountResellerQuery({applicationId:e??"",withSpecification:!0},{skip:!!t}),[_,S]=React.useState(!0),[R,C]=React.useState({publicInfo:{hasUnsavedChanges:!1}}),E=React.useCallback(()=>n?!1:R.publicInfo.hasUnsavedChanges,[n,R]),M=React.useCallback((F,V)=>{C(te=>{var ie;return((ie=te[F])==null?void 0:ie.hasUnsavedChanges)!==V.hasUnsavedChanges?{...te,[F]:V}:te})},[]),{NavigationGuardDialog:I}=useRouterNavigationGuard(E),A=t??f,O=!n||!!(A!=null&&A.Statement)&&(A.Statement.Total??0)>0,q=!g&&!!(A!=null&&A.SalesStatistics)&&A.SalesStatistics.length>0,z=(A==null?void 0:A.QualifiedManufacturers)??[],Q=(A==null?void 0:A.Qualifications)??[];return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[b?jsxRuntime.jsx(Card,{className:"p-6",children:jsxRuntime.jsxs(Alert,{variant:"destructive",children:[jsxRuntime.jsx(CircleAlert,{className:"h-4 w-4"}),jsxRuntime.jsx(AlertTitle,{children:"Error"}),jsxRuntime.jsx(AlertDescription,{children:"There was an error loading your reseller information. Please try again later."})]})}):jsxRuntime.jsxs("div",{className:"space-y-6 mb-6",children:[jsxRuntime.jsx(SalesSummary,{fiscalYearMonthStart:(A==null?void 0:A.FiscalYearMonthStart)||1,salesData:A==null?void 0:A.SalesData,isLoading:g}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsx(OrderCategories,{openOrders:(A==null?void 0:A.ActiveOrderDetails)??[],isLoading:g}),O&&jsxRuntime.jsx(BillingCard,{appID:e,reseller:A||{},withoutReports:d,isLoading:g}),jsxRuntime.jsx(PublicInfo,{reseller:A||{},appID:e??"",isLoading:g,readonly:n,onUnsavedChanges:F=>M("publicInfo",{hasUnsavedChanges:F})})]}),jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Sales"})}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx(MonthlySalesChart,{salesData:(A==null?void 0:A.SalesStatistics)??[],extrapolate:_,isLoading:g}),q&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 my-1 pt-2",children:[jsxRuntime.jsx(Switch,{checked:_,onCheckedChange:S,id:"extrapolate-switch","aria-label":"Toggle sales extrapolation"}),jsxRuntime.jsx(Label$2,{htmlFor:"extrapolate-switch",children:"Extrapolate"})]}),_&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"* Sales for the current month are projected, not actual."})]})]})]}),jsxRuntime.jsx(AccountTier,{isSuperAdmin:l,readonly:n,reseller:A||{},appID:e??"",isLoading:g})]})]}),g||z.length>0?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Manufacturers you are qualified for"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:g?Array.from({length:2}).map((F,V)=>jsxRuntime.jsx(ManufacturerCard,{loading:!0},V)):z.map(F=>jsxRuntime.jsx(ManufacturerCard,{manufacturer:F,link:`https://dashboard.randmar.io/${e}/Partner/${F.ManufacturerId}`},F.ManufacturerId))})})]}):jsxRuntime.jsx(ResellerQualificationsCard,{qualifications:Q}),jsxRuntime.jsx(Opportunities,{applicationId:e,opportunities:A==null?void 0:A.Opportunities,loading:g}),!d&&jsxRuntime.jsx(ReportsSection,{appID:e,userEmail:o,isLoading:g})]}),jsxRuntime.jsx(I,{})]})}/**
|
|
1012
|
+
$10 with opportunities under $1,000`:e==="D"?"$15 under $1,500":e==="E"?"Full shipping charges":e,getTermsText=e=>e==="STRIPE"?"Credit card payment":e==="NET30"?"Net 30 days":e,AccountTier=({isSuperAdmin:e,readonly:t,reseller:n,appID:o,isLoading:l})=>{const{toast:d}=useToast(),[f,g]=React.useState(!1),[b,_]=React.useState(""),[S,{isLoading:R}]=usePostV4PartnerByApplicationIdAccountResellerAndFieldNameMutation(),C=Oe=>Oe&&{Starter:"starter","E-Commerce":"ecommerce",Commercial:"commercial",Basics:"cws",Novexco:"novexco","Jean Coutu":"jeancoutu",Exclusive:"exclusive"}[Oe]||"",E=Oe=>Oe&&{A:"free",B:"fixed",C:"dropshipped",D:"under1500",E:"fullcharges"}[Oe]||"",M=Oe=>Oe&&{1:"exclusive",2:"ecommerce",3:"commercial",4:"buyinggroup",5:"cost"}[Oe]||"",[I,A]=React.useState(C((n==null?void 0:n.Priority)??"")),[O,q]=React.useState(E((n==null?void 0:n.ShippingProfile)??"")),[z,Q]=React.useState(M(n==null?void 0:n.PriceProfile)),F=Oe=>({starter:"Starter",ecommerce:"E-Commerce",commercial:"Commercial",cws:"Basics",novexco:"Novexco",jeancoutu:"Jean Coutu",exclusive:"Exclusive"})[Oe]||Oe,V=Oe=>({free:"A",fixed:"B",dropshipped:"C",under1500:"D",fullcharges:"E"})[Oe]||Oe,te=Oe=>({exclusive:"1",ecommerce:"2",commercial:"3",buyinggroup:"4",cost:"5"})[Oe]||Oe;React.useEffect(()=>{A(C((n==null?void 0:n.Priority)??"")),q(E((n==null?void 0:n.ShippingProfile)??"")),Q(M(n==null?void 0:n.PriceProfile))},[n]);const ie=async(Oe,Le,Ge,je)=>{try{(await S({applicationId:o,fieldName:Oe,newValue:Le})).error?d({title:"Error",description:je,variant:"destructive"}):d({title:"Success",description:Ge,variant:"success"})}catch{d({title:"Error",description:"An unexpected error occurred",variant:"destructive"})}},ae=async Oe=>{A(Oe);const Le=F(Oe);ie("Priority",Le,`Priority updated to ${Le}`,"Failed to update priority")},oe=async Oe=>{q(Oe);const Le=V(Oe);ie("ShippingProfile",Le,`Shipping profile updated to ${Le}`,"Failed to update shipping profile")},se=async Oe=>{Q(Oe);const Le=te(Oe);ie("PriceProfile",Le,`Pricing profile updated to ${Le}`,"Failed to update pricing profile")},ge=async()=>{try{const Oe=await S({applicationId:o,fieldName:"Tier",newValue:b});Oe.error?d({title:"Error",description:"Failed to update reseller",variant:"destructive"}):Oe.data?d({title:"Success",description:`Pricing Tier changed to ${b}`,variant:"success"}):d({title:"Considered",description:"Request being considered",variant:"success"})}catch{d({title:"Error",description:"An unexpected error occurred",variant:"destructive"})}finally{g(!1),_("")}},Ae=[{name:"Terms",enabled:n.Priority==="Starter"},{name:"E-Commerce",enabled:n.Priority==="Commercial"},{name:"Commercial",enabled:n.Priority==="E-Commerce"},{name:"Exclusive",enabled:e}],Ne=Oe=>{_(Oe),g(!0)};return l?jsxRuntime.jsxs(Card,{className:"md:col-span-2 xl:col-span-1 md:max-w-xl xl:max-w-[unset]",children:[jsxRuntime.jsx(CardHeader,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-28"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-16 rounded-full"})]})}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsxs("div",{className:"mb-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-40 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-56"})]}),jsxRuntime.jsx("div",{className:"grid gap-3",children:[1,2,3].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full shrink-0"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-full"})]})]},Oe))}),jsxRuntime.jsxs("div",{className:"flex gap-2 mt-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Card,{className:"md:col-span-2 xl:col-span-1 md:max-w-xl xl:max-w-[unset]",children:[jsxRuntime.jsxs(CardHeader,{className:"pb-2 pt-4 px-4 flex flex-row items-center justify-between",children:[jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Account Tier"}),jsxRuntime.jsx(Badge,{variant:"secondary",className:"bg-green-100 text-green-700 hover:bg-green-200 text-xs",children:"Active"})]}),jsxRuntime.jsxs(CardContent,{className:"pt-2 px-4 pb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3 bg-primary/5 p-4 rounded-lg",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-lg font-bold text-primary",children:[(n==null?void 0:n.Priority)||""," Tier"]}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Optimized for online retail"})]}),jsxRuntime.jsx(CircleCheck,{className:"h-6 w-6 text-green-600"})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-2 mb-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Package2,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Pricing"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground truncate",children:getPricingText(n.PriceProfile||0)})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Truck,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Shipping"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:getShippingText(n.ShippingProfile||"").split(".")[0]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Calendar,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Payment terms"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:getTermsText((n==null?void 0:n.Terms)||"")})]})]})]}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[!t&&jsxRuntime.jsx(Button,{variant:"outline",className:"flex-1",asChild:!0,children:jsxRuntime.jsxs("a",{href:"https://www.randmar.io/docs/overview/pricingTiers",target:"_blank",rel:"noreferrer",children:[jsxRuntime.jsx(ExternalLink,{className:"h-4 w-4 mr-1"}),"Pricing Tiers"]})}),jsxRuntime.jsxs(Popover,{children:[jsxRuntime.jsx(PopoverTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button,{disabled:t,className:t?"hidden":"flex-1",children:["Upgrade Tier ",jsxRuntime.jsx(ChevronRight,{className:"h-3 w-3 ml-1"})]})}),jsxRuntime.jsx(PopoverContent,{className:"w-56 p-2",children:jsxRuntime.jsxs("div",{className:"grid gap-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-xs mb-1",children:"Select a tier"}),Ae.map(Oe=>jsxRuntime.jsx(Button,{variant:"ghost",size:"sm",className:"w-full justify-start h-8",disabled:!Oe.enabled,onClick:()=>Ne(Oe.name),children:Oe.name},Oe.name))]})})]})]})]})]}),jsxRuntime.jsx(ChangePricingTierModal,{isLoading:R,open:f,setOpen:g,tier:b,onTierChange:ge}),e&&!t&&jsxRuntime.jsxs(Card,{className:"mt-4",children:[jsxRuntime.jsx(CardHeader,{className:"pb-2 pt-3 px-4",children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Admin Configuration"})}),jsxRuntime.jsx(CardContent,{className:"pt-2 px-4 pb-4",children:jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Priority"}),jsxRuntime.jsx(RadioGroup$1,{value:I,onValueChange:ae,className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-1",children:[{value:"starter",label:"Starter"},{value:"ecommerce",label:"E-Commerce"},{value:"commercial",label:"Commercial"},{value:"cws",label:"CWS (Basics)"},{value:"novexco",label:"Novexco"},{value:"jeancoutu",label:"Jean Coutu"},{value:"exclusive",label:"Exclusive"}].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:Oe.value,id:`priority-${Oe.value}`,className:"h-6 w-6 scale-50"}),jsxRuntime.jsx(Label$2,{htmlFor:`priority-${Oe.value}`,className:"cursor-pointer text-xs",children:Oe.label})]},Oe.value))})]}),jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Shipping Profile"}),jsxRuntime.jsx(RadioGroup$1,{value:O,onValueChange:oe,className:"grid grid-cols-1 md:grid-cols-2 gap-1",children:[{value:"free",label:"Free (A)"},{value:"fixed",label:"Fixed $10 Shipping (B)"},{value:"dropshipped",label:"$15 for drop shipped (C)"},{value:"under1500",label:"15$ under 1,500 (D)"},{value:"fullcharges",label:"Full shipping charges (E)"}].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:Oe.value,id:`shipping-${Oe.value}`,className:"h-6 w-6 scale-50"}),jsxRuntime.jsx(Label$2,{htmlFor:`shipping-${Oe.value}`,className:"cursor-pointer text-xs",children:Oe.label})]},Oe.value))})]}),jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Pricing Profile"}),jsxRuntime.jsx(RadioGroup$1,{value:z,onValueChange:se,className:"grid grid-cols-2 sm:grid-cols-3 gap-1",children:[{value:"exclusive",label:"Exclusive (1)"},{value:"ecommerce",label:"E-Commerce (2)"},{value:"commercial",label:"Commercial (3)"},{value:"buyinggroup",label:"Buying Group (4)"},{value:"cost",label:"Cost (5)"}].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:Oe.value,id:`pricing-${Oe.value}`,className:"h-6 w-6 scale-50 antialiased"}),jsxRuntime.jsx(Label$2,{htmlFor:`pricing-${Oe.value}`,className:"cursor-pointer text-xs",children:Oe.label})]},Oe.value))})]})]})})]})]})};function OrderCategories({openOrders:e=[],isLoading:t=!1}){const n=(e==null?void 0:e.filter(I=>I.DocumentType==="Order"))||[],o=(e==null?void 0:e.filter(I=>I.DocumentType==="Shipment"))||[],l=n.filter(I=>I.WarehouseCode!=="3PLE"),d=l.reduce((I,A)=>I+(A.Quantity??0),0),f=l.reduce((I,A)=>I+(A.ExtendedPrice??0),0),g=n.filter(I=>I.WarehouseCode==="3PLE"),b=g.reduce((I,A)=>I+(A.Quantity??0),0),_=g.reduce((I,A)=>I+(A.ExtendedPrice??0),0),S=o.reduce((I,A)=>I+(A.Quantity??0),0),R=o.reduce((I,A)=>I+(A.ExtendedPrice??0),0),C=d+b+S,E=f+_+R,M=[{name:"All",icon:Package,color:"bg-blue-500",orders:C,amount:E},{name:"Processing",icon:RefreshCcw,color:"bg-yellow-500",orders:d,amount:f},{name:"Shipped",icon:Truck,color:"bg-green-500",orders:S,amount:R},{name:"Delayed",icon:CircleAlert,color:"bg-red-500",orders:b,amount:_}];return t?jsxRuntime.jsxs(Card,{className:"w-full md:col-span-2 xl:col-span-1",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(Skeleton,{className:"h-7 w-40"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3.5",children:[1,2,3,4].map(I=>jsxRuntime.jsx(Card,{className:"overflow-hidden rounded-md rounded-b-lg border-0 shadow-md",children:jsxRuntime.jsxs(CardContent,{className:"p-0",children:[jsxRuntime.jsx("div",{className:"bg-gray-200 h-[3px]"}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-12"})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]})]})]})]})},I))})})]}):jsxRuntime.jsxs(Card,{className:"w-full md:col-span-2 xl:col-span-1",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Order Categories"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3.5",children:M.map(I=>jsxRuntime.jsx(Card,{className:"overflow-hidden rounded-md rounded-b-lg border-0 shadow-md",children:jsxRuntime.jsxs(CardContent,{className:"p-0",children:[jsxRuntime.jsx("div",{className:`${I.color} bg-opacity-60 h-[3px]`}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-base",children:I.name}),jsxRuntime.jsx("div",{className:`${I.color} bg-opacity-90 p-2 rounded-full`,children:jsxRuntime.jsx(I.icon,{className:"size-4 shrink-0 text-white"})})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Orders"}),jsxRuntime.jsx("p",{className:"text-xl font-bold",children:I.orders})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Amount"}),jsxRuntime.jsx("p",{className:"text-base font-semibold",children:jsxRuntime.jsx(FormattedNumber,{value:I.amount,style:"currency",currency:"CAD",currencyDisplay:"symbol"})})]})]})]})]})},I.name))})})]})}function LongMonthName(e){if(!e)return;const t=["","January","February","March","April","May","June","July","August","September","October","November","December"];return e===void 0&&(e=new Date().getMonth()+1),e<1&&(e=12+e),t[e]}function SalesSummary({fiscalYearMonthStart:e,salesData:t,isLoading:n}){const o=(t==null?void 0:t.SalesLast30Days)??0,l=(t==null?void 0:t.SalesLast3Months)??0,d=(t==null?void 0:t.SalesYearToDay)??0,f=LongMonthName(e);return n?jsxRuntime.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 mb-4",children:[jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-24"})]})]}),jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-28"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-24"})]})]}),jsxRuntime.jsxs(Card,{className:"col-span-2 lg:col-span-1",children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-36"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-24"})]})]})]}):jsxRuntime.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 mb-4",children:[jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsx(CardTitle,{className:"text-sm font-medium",children:"Last 30 Days"}),jsxRuntime.jsx("div",{className:"p-2 rounded-full bg-neutral-200",children:jsxRuntime.jsx(TrendingUp,{className:"size-4 shrink-0 text-muted-foreground"})})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx("div",{className:"text-2xl font-bold",children:jsxRuntime.jsx(FormattedNumber,{value:o,style:"currency",currency:"CAD",currencyDisplay:"symbol"})}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground"})]})]}),jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsx(CardTitle,{className:"text-sm font-medium",children:"Last 3 Months"}),jsxRuntime.jsx("div",{className:"p-2 rounded-full bg-neutral-200",children:jsxRuntime.jsx(Calendar,{className:"size-4 shrink-0 text-muted-foreground"})})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx("div",{className:"text-2xl font-bold",children:jsxRuntime.jsx(FormattedNumber,{value:l,style:"currency",currency:"CAD",currencyDisplay:"symbol"})}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground"})]})]}),f&&jsxRuntime.jsxs(Card,{className:"col-span-2 lg:col-span-1",children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[jsxRuntime.jsxs(CardTitle,{className:"text-sm font-medium",children:["Year to Date (",f,")"]}),jsxRuntime.jsx("div",{className:"p-2 rounded-full bg-neutral-200",children:jsxRuntime.jsx(CalendarDays,{className:"size-4 shrink-0 text-muted-foreground"})})]}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx("div",{className:"text-2xl font-bold",children:jsxRuntime.jsx(FormattedNumber,{value:d,style:"currency",currency:"CAD",currencyDisplay:"symbol"})}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground"})]})]})]})}function ReportsSection({isLoading:e,userEmail:t,appID:n}){const{toast:o}=useToast(),[l,{isLoading:d}]=usePostV4ResellerByRouteResellerIdReportWalmartTrackingFileEmailMutation(),[f,{isLoading:g}]=usePostV4ResellerByRouteResellerIdReportAmazonTrackingFileEmailMutation(),[b,{isLoading:_}]=usePostV4ResellerByRouteResellerIdReportOpenOrdersEmailMutation(),[S,{isLoading:R}]=usePostV4ResellerByRouteResellerIdReportProductsEmailMutation(),[C,{isLoading:E}]=usePostV4ResellerByRouteResellerIdReportInvoicesEmailMutation(),[M,{isLoading:I}]=usePostV4ResellerByRouteResellerIdDocumentStatementEmailMutation(),[A,O]=React.useState(null),[q,z]=React.useState(t),[Q,F]=React.useState(!1),V=[{name:"Products",reports:[{id:"Products",title:"Universal Product List",description:"A comprehensive overview of your product list with detailed specifications and pricing information.",icon:Package}]},{name:"Operation Details",reports:[{id:"OpenOrders",title:"Order Details",description:"A detailed report of all your orders and shipments, including status, tracking information, and delivery estimates.",icon:ShoppingCart},{id:"Invoices",title:"Invoices and Credits Report",description:"Detailed overview of your invoices and credits within a specific date range. It also contains reports about additional charges, serial numbers, and other relevant information.",icon:ScrollText},{id:"Statement",title:"Statement and RMAs Report",description:"A detailed report of all unpaid invoices and active RMAs.",icon:Banknote}]},{name:"Tracking Files",reports:[{id:"AmazonTrackingFile",title:"Amazon Tracking File",description:"Track products sold on Amazon marketplace with detailed sales and inventory information.",icon:ChartNoAxesColumnIncreasing},{id:"WalmartTrackingFile",title:"Walmart Tracking File",description:"Track products sold on Walmart marketplace with detailed sales and inventory information.",icon:ChartNoAxesColumnIncreasing}]}],te=async oe=>{O(oe),F(!0)},ie=async()=>{if(!(!A||!n))try{switch(A.id){case"Products":await S({routeResellerId:n,emailAddress:q}).unwrap();break;case"AmazonTrackingFile":await f({routeResellerId:n,emailAddress:q}).unwrap();break;case"WalmartTrackingFile":await l({routeResellerId:n,emailAddress:q}).unwrap();break;case"OpenOrders":await b({routeResellerId:n,emailAddress:q}).unwrap();break;case"Invoices":await C({routeResellerId:n,emailAddress:q}).unwrap();break;case"Statement":await M({routeResellerId:n,emailAddress:q}).unwrap();break;default:throw new Error("invalid report id")}o({title:"Report requested",description:`The ${A.title} will be sent to ${q} shortly.`,variant:"success"}),F(!1)}catch(oe){console.error("Error requesting report:",oe),o({title:"Error",description:"Failed to request report. Please try again.",variant:"destructive"})}},ae=_||R||g||d||I||E;return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{children:[jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Reports"}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:"Download essential business reports, from your Product List to your Order Details."})]}),jsxRuntime.jsx(CardContent,{className:"space-y-6",children:e?jsxRuntime.jsx(jsxRuntime.Fragment,{children:[1,2,3].map(oe=>jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-48"}),[1,2].map(se=>jsxRuntime.jsxs("div",{className:"flex items-start gap-4 p-4 border rounded-lg",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-9 rounded-full"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-full"})]}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"})]},se))]},oe))}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:V.map(oe=>jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold",children:oe.name}),oe.reports.map(se=>jsxRuntime.jsxs("div",{className:"flex items-start gap-4 p-4 border rounded-lg hover:bg-gray-100 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:jsxRuntime.jsx(se.icon,{className:"h-5 w-5 text-primary"})}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("h4",{className:"font-semibold text-sm",children:se.title}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:se.description})]}),jsxRuntime.jsxs(Button,{variant:"outline",size:"sm",className:"flex items-center gap-1",onClick:()=>te(se),children:[jsxRuntime.jsx(Download,{className:"h-4 w-4"}),"Request"]})]},se.id))]},oe.name))})}),jsxRuntime.jsx(Dialog,{open:Q,onOpenChange:F,children:jsxRuntime.jsxs(DialogContent,{children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsxs(DialogTitle,{children:["Request ",A==null?void 0:A.title]}),jsxRuntime.jsx(DialogDescription,{children:"Enter the email address where you would like to receive the report."})]}),jsxRuntime.jsxs("div",{className:"py-4",children:[jsxRuntime.jsx(Label$2,{htmlFor:"email",children:"Email"}),jsxRuntime.jsx(Input,{id:"email",value:q,onChange:oe=>z(oe.target.value),placeholder:"your@email.com",className:"mt-2"})]}),jsxRuntime.jsx(DialogDescription,{children:"The report will take around 5 minutes to generate."}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button,{variant:"outline",onClick:()=>F(!1),children:"Cancel"}),jsxRuntime.jsx(Button,{onClick:ie,disabled:!q||ae,children:ae?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):"Send Report"})]})]})})]})}function MonthlySalesChart({salesData:e,chartHeight:t=300,units:n="$",unitsPosition:o="left",className:l,extrapolate:d=!0,isLoading:f=!1}){const[g,b]=React.useState([]);return React.useEffect(()=>{if(f||!e||e.length===0){b([]);return}const _=e.reduce((q,z)=>{const Q=z.Day??0,F=Math.floor(Q).toString();if(F.length!==8||isNaN(parseInt(F)))return console.warn(`Skipping invalid Day format: ${z.Day}`),q;const V=F.substring(0,4),te=F.substring(4,6),ie=`${V}-${te}`;return q[ie]=(q[ie]||0)+(z.ExtendedPrice??0),q},{}),S=Object.keys(_).sort(),R=new Date,C=R.getFullYear(),E=R.getMonth(),M=R.getDate(),I=`${C}-${(E+1).toString().padStart(2,"0")}`,A={..._};if(d&&S.length>0&&S[S.length-1]===I){const q=A[I],z=new Date(C,E+1,0).getDate();if(M<z&&M>0){const F=q/M*z;A[I]=F}}const O=S.map(q=>{const z=A[q],[Q,F]=q.split("-").map(Number);return{month:new Date(Q,F-1).toLocaleString("default",{month:"short",year:"numeric"}),sales:z}});b(O)},[e,d,f]),f?jsxRuntime.jsx(Skeleton,{style:{height:t},className:l}):g.length===0?jsxRuntime.jsx("div",{style:{height:t},className:l||"p-4 text-center text-muted-foreground flex items-center justify-center",children:"No monthly sales data to display."}):jsxRuntime.jsx(AreaChart,{data:g,units:n,unitsPosition:o,height:t,className:l})}function UnsavedChangesDialog({isOpen:e,onClose:t,onConfirm:n,title:o,description:l,confirmText:d="Confirm",cancelText:f="Cancel"}){return jsxRuntime.jsx(Dialog,{open:e,onOpenChange:t,children:jsxRuntime.jsxs(DialogContent,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:o}),jsxRuntime.jsx(DialogDescription,{children:l})]}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button,{variant:"outline",onClick:t,children:f}),jsxRuntime.jsx(Button,{onClick:n,children:d})]})]})})}function useRouterNavigationGuard(e){const[t,n]=React.useState(!1),o=reactRouterDom.useBlocker(React.useCallback(({currentLocation:g,nextLocation:b})=>{const _=g.pathname!==b.pathname||g.search!==b.search||g.hash!==b.hash;return e()&&_},[e]));React.useEffect(()=>{o.state==="blocked"&&n(!0)},[o]),React.useEffect(()=>{const g=b=>{if(e())return b.preventDefault(),"You have unsaved changes. Are you sure you want to leave?"};return window.addEventListener("beforeunload",g),()=>{window.removeEventListener("beforeunload",g)}},[e]);const l=React.useCallback(()=>{n(!1),o.state==="blocked"&&o.proceed()},[o]),d=React.useCallback(()=>{n(!1),o.state==="blocked"&&o.reset()},[o]),f=React.useCallback(()=>jsxRuntime.jsx(UnsavedChangesDialog,{isOpen:t,onClose:d,onConfirm:l,title:"Unsaved Changes",description:"You have unsaved changes. Are you sure you want to leave? Your changes will be lost.",confirmText:"Discard Changes",cancelText:"Stay on Page"}),[t,d,l]);return{showDialog:t,handleConfirm:l,handleCancel:d,NavigationGuardDialog:f}}const PartnerLogo=({applicationId:e,width:t,height:n,align:o})=>{const l=!e,{data:d,isLoading:f}=useGetV4PartnerByApplicationIdAccountLogoExistsQuery({applicationId:e},{skip:l}),{data:g,isLoading:b}=useGetV4PartnerByApplicationIdAccountLogoQuery({applicationId:e,...t!==void 0&&{width:t},...n!==void 0&&{height:n},...o!==void 0&&{align:o}},{skip:l||!d}),_=React.useMemo(()=>{if(g instanceof ArrayBuffer&&g.byteLength>0)try{const R=new Uint8Array(g);let C="";for(let I=0;I<R.byteLength;I++)C+=String.fromCharCode(R[I]);const E=btoa(C);let M="image/png";return R.length>4&&(R[0]===137&&R[1]===80&&R[2]===78&&R[3]===71?M="image/png":R[0]===255&&R[1]===216&&R[R.length-2]===255&&R[R.length-1]===217?M="image/jpeg":R[0]===71&&R[1]===73&&R[2]===70&&R[3]===56&&(M="image/gif")),`data:${M};base64,${E}`}catch(R){return console.error(`Error converting logo for Partner ID ${e}:`,R),null}return null},[g,e]);if(!e)return jsxRuntime.jsx("div",{className:"flex items-center justify-start h-8 w-8 text-muted-foreground",children:jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx("div",{className:"h-8 w-8 flex items-center justify-center border border-dashed border-border rounded-sm bg-muted/20 p-1",children:jsxRuntime.jsx("span",{className:"text-xs font-mono",children:"N/A"})})}),jsxRuntime.jsx(TooltipContent,{side:"top",align:"center",children:jsxRuntime.jsx("p",{children:"ID: Not available"})})]})})});const S=()=>f||d===!0&&b&&!g?jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-sm"}):d===!0&&_?jsxRuntime.jsx("img",{src:_,alt:`${e}'s logo`,className:"h-8 w-auto max-w-[60px] object-contain rounded-sm"}):jsxRuntime.jsx("div",{className:"h-8 w-full flex items-center justify-center border border-dashed border-border rounded-sm bg-muted/20 p-1",title:`Logo for ${e}`,children:jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground font-mono text-center leading-none break-all",children:e})});return jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs("div",{className:"flex items-center justify-start h-8 min-w-[32px] cursor-default",children:[" ",S()]})}),jsxRuntime.jsx(TooltipContent,{side:"top",align:"center",children:jsxRuntime.jsxs("p",{children:["ID: ",e]})})]})})};function getEndDateStatus(e){if(!e)return{text:"No End Date",variant:"neutral",daysRemaining:null};const t=new Date(e);if(isNaN(t.getTime()))return{text:"Invalid Date",variant:"neutral",daysRemaining:null};const n=new Date,o=new Date(t.getFullYear(),t.getMonth(),t.getDate()),l=new Date(n.getFullYear(),n.getMonth(),n.getDate()),d=o.getTime()-l.getTime(),f=Math.ceil(d/(1e3*60*60*24));return f<0?{text:`Ended ${Math.abs(f)}d ago`,variant:"destructive",daysRemaining:f}:f===0?{text:"Ends today",variant:"destructive",daysRemaining:f}:f<=7?{text:`Ends in ${f}d`,variant:"destructive",daysRemaining:f}:f<=30?{text:`Ends in ${f}d`,variant:"warning",daysRemaining:f}:{text:`Ends in ${f}d`,variant:"neutral",daysRemaining:f}}const formatDate=e=>{if(!e)return"N/A";try{const t=new Date(e);return isNaN(t.getTime())?"Invalid Date":t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return"Invalid Date"}},Opportunities=({applicationId:e,opportunities:t=null,loading:n=!1})=>{var V;const{toast:o}=useToast(),[l,d]=React.useState({}),[f,g]=React.useState(!1),[b,_]=React.useState(""),[S,R]=React.useState(null),C=React.useCallback((te,ie,ae)=>{d(oe=>({...oe,[te]:{...oe[te],[ie]:ae}}))},[]),[E]=usePutV4ResellerByRouteResellerIdOpportunityAndManufacturerIdDefaultMutation(),M=React.useCallback(async te=>{if(!te.BidNumber){o({title:"Error",description:"Bid Number is missing, cannot set default.",variant:"destructive"});return}const ie=te.BidNumber;C(ie,"isSettingDefault",!0),E({routeResellerId:e,manufacturerId:te.ManufacturerId??"",opportunityNumber:ie}).unwrap().then(()=>{o({title:"Success",description:`Opportunity "${te.OpportunityName||te.Opportunity||ie}" was successfully set as default.`,variant:"success"})}).catch(ae=>{var oe;console.error("Set as default error:",ae),o({title:"Error",description:((oe=ae.data)==null?void 0:oe.message)||ae.message||"An error occurred while setting this opportunity as default.",variant:"destructive"})}).finally(()=>{C(ie,"isSettingDefault",!1)})},[e,E,o,C]),[I]=usePostV4ResellerByRouteResellerIdOpportunityAndManufacturerIdBidNumberEmailMutation(),A=React.useCallback(te=>{if(!te.BidNumber){o({title:"Error",description:"Bid Number is missing, cannot prepare report.",variant:"destructive"});return}R(te),_(""),g(!0)},[o]),O=React.useCallback(async()=>{if(!S||!S.BidNumber){o({title:"Error",description:"No opportunity selected or Bid Number is missing.",variant:"destructive"});return}if(!b.trim()||!/\S+@\S+\.\S+/.test(b)){o({title:"Validation Error",description:"Please enter a valid email address.",variant:"destructive"});return}const te=S.BidNumber;C(te,"isSendingReport",!0),I({routeResellerId:e,manufacturerId:S.ManufacturerId??"",bidNumber:te,emailAddress:b}).unwrap().then(()=>{o({title:"Success",description:`A report for "${S.OpportunityName||S.Opportunity||te}" was successfully sent to ${b}.`,variant:"success"}),g(!1)}).catch(ie=>{var ae;console.error("Send report by email error:",ie),o({title:"Error",description:((ae=ie.data)==null?void 0:ae.message)||ie.message||"An error occurred while sending the report by email.",variant:"destructive"})}).finally(()=>{C(te,"isSendingReport",!1),f||(R(null),_(""))})},[S,b,e,I,o,C,g]),q=React.useMemo(()=>[{accessorKey:"ManufacturerId",header:"Manuf. ID",cell:({row:te})=>jsxRuntime.jsx(PartnerLogo,{applicationId:te.original.ManufacturerId,height:10,width:18}),enableSorting:!0,enableFiltering:!0},{id:"opportunityDisplay",accessorFn:te=>te.OpportunityName||te.Opportunity,header:"Opportunity",cell:({getValue:te})=>jsxRuntime.jsx("div",{className:"min-w-[150px]",children:te()??"N/A"}),enableSorting:!0,enableFiltering:!0},{accessorKey:"BidNumber",header:"Bid Number",cell:({row:te})=>te.original.BidNumber??"N/A",enableSorting:!0,enableFiltering:!0},{id:"statusInfo",header:"Status",cell:({row:te})=>{const ie=te.original,ae=ie.Active===!0,oe=getEndDateStatus(ie.EndDate);let se="border-gray-400 bg-gray-100 text-gray-600 dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400";return oe.variant==="destructive"?se="border-red-500 bg-red-100 text-red-700 dark:border-red-600 dark:bg-red-900/50 dark:text-red-400":oe.variant==="warning"&&(se="border-yellow-500 bg-yellow-100 text-yellow-700 dark:border-yellow-600 dark:bg-yellow-900/50 dark:text-yellow-400"),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 min-w-[200px]",children:[jsxRuntime.jsx(Badge,{variant:"outline",className:ae?"border-green-500 bg-green-100 text-green-700 dark:border-green-600 dark:bg-green-900/50 dark:text-green-400 font-medium":"border-gray-400 bg-gray-100 text-gray-600 dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400 font-medium",children:ae?"Active":"Inactive"}),ie.EndDate&&jsxRuntime.jsx(Badge,{variant:"outline",className:`${se} font-medium`,children:oe.text}),jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Button,{variant:"ghost",size:"icon",className:"h-6 w-6 p-0 data-[state=delayed-open]:bg-accent data-[state=instant-open]:bg-accent",children:jsxRuntime.jsx(Info,{className:"h-4 w-4 text-muted-foreground"})})}),jsxRuntime.jsx(TooltipContent,{side:"top",align:"center",className:"bg-popover text-popover-foreground p-2 rounded shadow-lg",children:jsxRuntime.jsxs("div",{className:"text-sm space-y-1",children:[jsxRuntime.jsxs("p",{children:[jsxRuntime.jsx("strong",{children:"Start:"})," ",formatDate(ie.StartDate)]}),jsxRuntime.jsxs("p",{children:[jsxRuntime.jsx("strong",{children:"End:"})," ",formatDate(ie.EndDate)]}),jsxRuntime.jsxs("p",{children:[jsxRuntime.jsx("strong",{children:"Updated:"})," ",formatDate(ie.LastUpdate)]})]})})]})})]})},enableFiltering:!1},{id:"actions",header:"Actions",cell:({row:te})=>{var Ne,Oe;const ie=te.original;if(!ie.BidNumber)return jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"Actions unavailable"});const ae=ie.BidNumber,oe=(Ne=l[ae])==null?void 0:Ne.isSettingDefault,se=(S==null?void 0:S.BidNumber)===ae&&((Oe=l[ae])==null?void 0:Oe.isSendingReport),ge=oe||se,Ae=ie.CanBeSetAsDefault===!0;return jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsxs(Button,{variant:"outline",size:"sm",onClick:()=>M(ie),disabled:ge||!Ae,title:Ae?"Set as default":"This opportunity cannot be set as default",className:"flex items-center",children:[oe?jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}):jsxRuntime.jsx(Star,{className:"mr-2 h-4 w-4"})," Set Default"]}),jsxRuntime.jsxs(Button,{variant:"outline",size:"sm",onClick:()=>A(ie),disabled:ge,title:"Send report by email",className:"flex items-center",children:[se?jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}):jsxRuntime.jsx(Send,{className:"mr-2 h-4 w-4"})," Send Report"]})]})}}],[l,M,A,S]),z=React.useMemo(()=>{const te={};if(t){const ie=Array.from(new Set(t.map(oe=>oe.ManufacturerId).filter(oe=>oe!=null)));te.ManufacturerId=ie;const ae=Array.from(new Set(t.map(oe=>oe.OpportunityName||oe.Opportunity).filter(oe=>oe!=null)));te.opportunityDisplay=ae}return te},[t]),Q=t||[],F=S!=null&&S.BidNumber?(V=l[S.BidNumber])==null?void 0:V.isSendingReport:!1;return n?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsxs(CardHeader,{children:[" ",jsxRuntime.jsx(Skeleton,{className:"h-7 w-48"})," "]}),jsxRuntime.jsxs(CardContent,{className:"space-y-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-full rounded-md border"}),jsxRuntime.jsx(Skeleton,{className:"h-48 w-full rounded-md border"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between pt-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-[130px]"}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-20"})," ",jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"})," ",jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"})," ",jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"})]})]})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsxs(CardHeader,{children:[" ",jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Opportunities"})," "]}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx(DataTable,{columns:q,data:Q,uniqueValues:z})})]}),jsxRuntime.jsx(Dialog,{open:f,onOpenChange:te=>{g(te),te||(R(null),_(""))},children:jsxRuntime.jsxs(DialogContent,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:"Send Opportunity Report"}),jsxRuntime.jsxs(DialogDescription,{children:["Enter the email address to send the report for opportunity: ",jsxRuntime.jsx("br",{}),jsxRuntime.jsx("span",{className:"font-semibold",children:(S==null?void 0:S.OpportunityName)||(S==null?void 0:S.Opportunity)||"N/A"}),(S==null?void 0:S.BidNumber)&&jsxRuntime.jsxs("span",{className:"block text-sm text-muted-foreground",children:["Bid Number: ",S.BidNumber]})]})]}),jsxRuntime.jsx("div",{className:"grid gap-4 py-4",children:jsxRuntime.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[jsxRuntime.jsx(Label$2,{htmlFor:"email",className:"text-right",children:"Email"}),jsxRuntime.jsx(Input,{id:"email",type:"email",value:b,onChange:te=>_(te.target.value),placeholder:"recipient@example.com",className:"col-span-3",disabled:F})]})}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button,{variant:"outline",onClick:()=>g(!1),disabled:F,children:"Cancel"}),jsxRuntime.jsxs(Button,{type:"submit",onClick:O,disabled:F,children:[F&&jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"})," Send Report"]})]})]})})]})};function ResellerOverview({appID:e,reseller:t,readonly:n,userEmail:o,isSuperAdmin:l,withoutReports:d=!1}){const{data:f,isLoading:g,isError:b}=useGetV4PartnerByApplicationIdAccountResellerQuery({applicationId:e??"",withSpecification:!0},{skip:!!t}),[_,S]=React.useState(!0),[R,C]=React.useState({publicInfo:{hasUnsavedChanges:!1}}),E=React.useCallback(()=>n?!1:R.publicInfo.hasUnsavedChanges,[n,R]),M=React.useCallback((F,V)=>{C(te=>{var ie;return((ie=te[F])==null?void 0:ie.hasUnsavedChanges)!==V.hasUnsavedChanges?{...te,[F]:V}:te})},[]),{NavigationGuardDialog:I}=useRouterNavigationGuard(E),A=t??f,O=!n||!!(A!=null&&A.Statement)&&(A.Statement.Total??0)>0,q=!g&&!!(A!=null&&A.SalesStatistics)&&A.SalesStatistics.length>0,z=(A==null?void 0:A.QualifiedManufacturers)??[],Q=(A==null?void 0:A.Qualifications)??[];return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[b?jsxRuntime.jsx(Card,{className:"p-6",children:jsxRuntime.jsxs(Alert,{variant:"destructive",children:[jsxRuntime.jsx(CircleAlert,{className:"h-4 w-4"}),jsxRuntime.jsx(AlertTitle,{children:"Error"}),jsxRuntime.jsx(AlertDescription,{children:"There was an error loading your reseller information. Please try again later."})]})}):jsxRuntime.jsxs("div",{className:"space-y-6 mb-6",children:[jsxRuntime.jsx(SalesSummary,{fiscalYearMonthStart:(A==null?void 0:A.FiscalYearMonthStart)||1,salesData:A==null?void 0:A.SalesData,isLoading:g}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsx(OrderCategories,{openOrders:(A==null?void 0:A.ActiveOrderDetails)??[],isLoading:g}),O&&jsxRuntime.jsx(BillingCard,{appID:e,reseller:A||{},withoutReports:d,isLoading:g}),jsxRuntime.jsx(PublicInfo,{reseller:A||{},appID:e??"",isLoading:g,readonly:n,onUnsavedChanges:F=>M("publicInfo",{hasUnsavedChanges:F})})]}),jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Sales"})}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx(MonthlySalesChart,{salesData:(A==null?void 0:A.SalesStatistics)??[],extrapolate:_,isLoading:g}),q&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 my-1 pt-2",children:[jsxRuntime.jsx(Switch,{checked:_,onCheckedChange:S,id:"extrapolate-switch","aria-label":"Toggle sales extrapolation"}),jsxRuntime.jsx(Label$2,{htmlFor:"extrapolate-switch",children:"Extrapolate"})]}),_&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"* Sales for the current month are projected, not actual."})]})]})]}),jsxRuntime.jsx(AccountTier,{isSuperAdmin:l,readonly:n,reseller:A||{},appID:e??"",isLoading:g})]})]}),g||z.length>0?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Manufacturers you are qualified for"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:g?Array.from({length:2}).map((F,V)=>jsxRuntime.jsx(ManufacturerCard,{loading:!0},V)):z.map(F=>jsxRuntime.jsx(ManufacturerCard,{manufacturer:F,link:`https://dashboard.randmar.io/${e}/Partner/${F.ManufacturerId}`},F.ManufacturerId))})})]}):jsxRuntime.jsx(ResellerQualificationsCard,{qualifications:Q}),jsxRuntime.jsx(Opportunities,{applicationId:e,opportunities:A==null?void 0:A.Opportunities,loading:g}),!d&&jsxRuntime.jsx(ReportsSection,{appID:e,userEmail:o,isLoading:g})]}),jsxRuntime.jsx(I,{})]})}/**
|
|
1013
1013
|
* table-core
|
|
1014
1014
|
*
|
|
1015
1015
|
* Copyright (c) TanStack
|