react-datagrid-component
Version:
A powerful, customizable data grid component built with React, TypeScript, and TanStack Table v8
30 lines (28 loc) • 568 kB
JavaScript
(function(Ve,ne){typeof exports=="object"&&typeof module<"u"?ne(exports,require("react"),require("@tanstack/react-table"),require("lucide-react"),require("@radix-ui/react-slot"),require("class-variance-authority"),require("clsx"),require("tailwind-merge"),require("@radix-ui/react-checkbox"),require("@radix-ui/react-dropdown-menu"),require("@radix-ui/react-popover"),require("@radix-ui/react-scroll-area"),require("@radix-ui/react-select"),require("@radix-ui/react-dialog"),require("react-day-picker"),require("date-fns")):typeof define=="function"&&define.amd?define(["exports","react","@tanstack/react-table","lucide-react","@radix-ui/react-slot","class-variance-authority","clsx","tailwind-merge","@radix-ui/react-checkbox","@radix-ui/react-dropdown-menu","@radix-ui/react-popover","@radix-ui/react-scroll-area","@radix-ui/react-select","@radix-ui/react-dialog","react-day-picker","date-fns"],ne):(Ve=typeof globalThis<"u"?globalThis:Ve||self,ne(Ve.FluentGrid={},Ve.React,Ve.TanStackTable,Ve.LucideReact,Ve.reactSlot,Ve.cva,Ve.clsx,Ve.twMerge,Ve.CheckboxPrimitive,Ve.DropdownMenuPrimitive,Ve.PopoverPrimitive,Ve.ScrollAreaPrimitive,Ve.SelectPrimitive,Ve.DialogPrimitive,Ve.ReactDayPicker,Ve.dateFns))})(this,function(Ve,ne,aa,se,fl,f0,ll,ul,hl,dl,xl,pl,ml,vl,gl,l0){"use strict";function na(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Ke=na(ne),Cs=na(hl),kr=na(dl),Ga=na(xl),sa=na(pl),yr=na(ml),St=na(vl);var wl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ns={exports:{}},Xa={};/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var u0;function kl(){if(u0)return Xa;u0=1;var e=ne,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,n=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function i(c,o,f){var l,h={},x=null,m=null;f!==void 0&&(x=""+f),o.key!==void 0&&(x=""+o.key),o.ref!==void 0&&(m=o.ref);for(l in o)a.call(o,l)&&!s.hasOwnProperty(l)&&(h[l]=o[l]);if(c&&c.defaultProps)for(l in o=c.defaultProps,o)h[l]===void 0&&(h[l]=o[l]);return{$$typeof:t,type:c,key:x,ref:m,props:h,_owner:n.current}}return Xa.Fragment=r,Xa.jsx=i,Xa.jsxs=i,Xa}var $a={};/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var h0;function yl(){return h0||(h0=1,process.env.NODE_ENV!=="production"&&function(){var e=ne,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),c=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),v=Symbol.iterator,d="@@iterator";function g(p){if(p===null||typeof p!="object")return null;var _=v&&p[v]||p[d];return typeof _=="function"?_:null}var S=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function A(p){{for(var _=arguments.length,F=new Array(_>1?_-1:0),b=1;b<_;b++)F[b-1]=arguments[b];k("error",p,F)}}function k(p,_,F){{var b=S.ReactDebugCurrentFrame,G=b.getStackAddendum();G!==""&&(_+="%s",F=F.concat([G]));var q=F.map(function(V){return String(V)});q.unshift("Warning: "+_),Function.prototype.apply.call(console[p],console,q)}}var I=!1,L=!1,R=!1,E=!1,w=!1,y;y=Symbol.for("react.module.reference");function P(p){return!!(typeof p=="string"||typeof p=="function"||p===a||p===s||w||p===n||p===f||p===l||E||p===m||I||L||R||typeof p=="object"&&p!==null&&(p.$$typeof===x||p.$$typeof===h||p.$$typeof===i||p.$$typeof===c||p.$$typeof===o||p.$$typeof===y||p.getModuleId!==void 0))}function j(p,_,F){var b=p.displayName;if(b)return b;var G=_.displayName||_.name||"";return G!==""?F+"("+G+")":F}function N(p){return p.displayName||"Context"}function H(p){if(p==null)return null;if(typeof p.tag=="number"&&A("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof p=="function")return p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case a:return"Fragment";case r:return"Portal";case s:return"Profiler";case n:return"StrictMode";case f:return"Suspense";case l:return"SuspenseList"}if(typeof p=="object")switch(p.$$typeof){case c:var _=p;return N(_)+".Consumer";case i:var F=p;return N(F._context)+".Provider";case o:return j(p,p.render,"ForwardRef");case h:var b=p.displayName||null;return b!==null?b:H(p.type)||"Memo";case x:{var G=p,q=G._payload,V=G._init;try{return H(V(q))}catch{return null}}}return null}var J=Object.assign,fe=0,de,te,ye,W,_e,ue,C;function M(){}M.__reactDisabledLog=!0;function B(){{if(fe===0){de=console.log,te=console.info,ye=console.warn,W=console.error,_e=console.group,ue=console.groupCollapsed,C=console.groupEnd;var p={configurable:!0,enumerable:!0,value:M,writable:!0};Object.defineProperties(console,{info:p,log:p,warn:p,error:p,group:p,groupCollapsed:p,groupEnd:p})}fe++}}function U(){{if(fe--,fe===0){var p={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:J({},p,{value:de}),info:J({},p,{value:te}),warn:J({},p,{value:ye}),error:J({},p,{value:W}),group:J({},p,{value:_e}),groupCollapsed:J({},p,{value:ue}),groupEnd:J({},p,{value:C})})}fe<0&&A("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Y=S.ReactCurrentDispatcher,oe;function Q(p,_,F){{if(oe===void 0)try{throw Error()}catch(G){var b=G.stack.trim().match(/\n( *(at )?)/);oe=b&&b[1]||""}return`
`+oe+p}}var Z=!1,re;{var me=typeof WeakMap=="function"?WeakMap:Map;re=new me}function D(p,_){if(!p||Z)return"";{var F=re.get(p);if(F!==void 0)return F}var b;Z=!0;var G=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var q;q=Y.current,Y.current=null,B();try{if(_){var V=function(){throw Error()};if(Object.defineProperty(V.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(V,[])}catch(Ce){b=Ce}Reflect.construct(p,[],V)}else{try{V.call()}catch(Ce){b=Ce}p.call(V.prototype)}}else{try{throw Error()}catch(Ce){b=Ce}p()}}catch(Ce){if(Ce&&b&&typeof Ce.stack=="string"){for(var z=Ce.stack.split(`
`),X=b.stack.split(`
`),ae=z.length-1,he=X.length-1;ae>=1&&he>=0&&z[ae]!==X[he];)he--;for(;ae>=1&&he>=0;ae--,he--)if(z[ae]!==X[he]){if(ae!==1||he!==1)do if(ae--,he--,he<0||z[ae]!==X[he]){var ke=`
`+z[ae].replace(" at new "," at ");return p.displayName&&ke.includes("<anonymous>")&&(ke=ke.replace("<anonymous>",p.displayName)),typeof p=="function"&&re.set(p,ke),ke}while(ae>=1&&he>=0);break}}}finally{Z=!1,Y.current=q,U(),Error.prepareStackTrace=G}var xe=p?p.displayName||p.name:"",Ee=xe?Q(xe):"";return typeof p=="function"&&re.set(p,Ee),Ee}function Ie(p,_,F){return D(p,!1)}function Te(p){var _=p.prototype;return!!(_&&_.isReactComponent)}function be(p,_,F){if(p==null)return"";if(typeof p=="function")return D(p,Te(p));if(typeof p=="string")return Q(p);switch(p){case f:return Q("Suspense");case l:return Q("SuspenseList")}if(typeof p=="object")switch(p.$$typeof){case o:return Ie(p.render);case h:return be(p.type,_,F);case x:{var b=p,G=b._payload,q=b._init;try{return be(q(G),_,F)}catch{}}}return""}var ve=Object.prototype.hasOwnProperty,pe={},Se=S.ReactDebugCurrentFrame;function Me(p){if(p){var _=p._owner,F=be(p.type,p._source,_?_.type:null);Se.setExtraStackFrame(F)}else Se.setExtraStackFrame(null)}function pr(p,_,F,b,G){{var q=Function.call.bind(ve);for(var V in p)if(q(p,V)){var z=void 0;try{if(typeof p[V]!="function"){var X=Error((b||"React class")+": "+F+" type `"+V+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof p[V]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw X.name="Invariant Violation",X}z=p[V](_,V,b,F,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ae){z=ae}z&&!(z instanceof Error)&&(Me(G),A("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",b||"React class",F,V,typeof z),Me(null)),z instanceof Error&&!(z.message in pe)&&(pe[z.message]=!0,Me(G),A("Failed %s type: %s",F,z.message),Me(null))}}}var cr=Array.isArray;function wr(p){return cr(p)}function Dr(p){{var _=typeof Symbol=="function"&&Symbol.toStringTag,F=_&&p[Symbol.toStringTag]||p.constructor.name||"Object";return F}}function $e(p){try{return ur(p),!1}catch{return!0}}function ur(p){return""+p}function Ze(p){if($e(p))return A("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Dr(p)),ur(p)}var ar=S.ReactCurrentOwner,nr={key:!0,ref:!0,__self:!0,__source:!0},Or,Pe,ie;ie={};function K(p){if(ve.call(p,"ref")){var _=Object.getOwnPropertyDescriptor(p,"ref").get;if(_&&_.isReactWarning)return!1}return p.ref!==void 0}function le(p){if(ve.call(p,"key")){var _=Object.getOwnPropertyDescriptor(p,"key").get;if(_&&_.isReactWarning)return!1}return p.key!==void 0}function Ae(p,_){if(typeof p.ref=="string"&&ar.current&&_&&ar.current.stateNode!==_){var F=H(ar.current.type);ie[F]||(A('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',H(ar.current.type),p.ref),ie[F]=!0)}}function Qe(p,_){{var F=function(){Or||(Or=!0,A("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",_))};F.isReactWarning=!0,Object.defineProperty(p,"key",{get:F,configurable:!0})}}function Ue(p,_){{var F=function(){Pe||(Pe=!0,A("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",_))};F.isReactWarning=!0,Object.defineProperty(p,"ref",{get:F,configurable:!0})}}var We=function(p,_,F,b,G,q,V){var z={$$typeof:t,type:p,key:_,ref:F,props:V,_owner:q};return z._store={},Object.defineProperty(z._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(z,"_self",{configurable:!1,enumerable:!1,writable:!1,value:b}),Object.defineProperty(z,"_source",{configurable:!1,enumerable:!1,writable:!1,value:G}),Object.freeze&&(Object.freeze(z.props),Object.freeze(z)),z};function _r(p,_,F,b,G){{var q,V={},z=null,X=null;F!==void 0&&(Ze(F),z=""+F),le(_)&&(Ze(_.key),z=""+_.key),K(_)&&(X=_.ref,Ae(_,G));for(q in _)ve.call(_,q)&&!nr.hasOwnProperty(q)&&(V[q]=_[q]);if(p&&p.defaultProps){var ae=p.defaultProps;for(q in ae)V[q]===void 0&&(V[q]=ae[q])}if(z||X){var he=typeof p=="function"?p.displayName||p.name||"Unknown":p;z&&Qe(V,he),X&&Ue(V,he)}return We(p,z,X,G,b,ar.current,V)}}var Vr=S.ReactCurrentOwner,ct=S.ReactDebugCurrentFrame;function Le(p){if(p){var _=p._owner,F=be(p.type,p._source,_?_.type:null);ct.setExtraStackFrame(F)}else ct.setExtraStackFrame(null)}var Xe;Xe=!1;function Zr(p){return typeof p=="object"&&p!==null&&p.$$typeof===t}function Ts(){{if(Vr.current){var p=H(Vr.current.type);if(p)return`
Check the render method of \``+p+"`."}return""}}function t0(p){return""}var Ss={};function a0(p){{var _=Ts();if(!_){var F=typeof p=="string"?p:p.displayName||p.name;F&&(_=`
Check the top-level render call using <`+F+">.")}return _}}function Fs(p,_){{if(!p._store||p._store.validated||p.key!=null)return;p._store.validated=!0;var F=a0(_);if(Ss[F])return;Ss[F]=!0;var b="";p&&p._owner&&p._owner!==Vr.current&&(b=" It was passed a child from "+H(p._owner.type)+"."),Le(p),A('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',F,b),Le(null)}}function bs(p,_){{if(typeof p!="object")return;if(wr(p))for(var F=0;F<p.length;F++){var b=p[F];Zr(b)&&Fs(b,_)}else if(Zr(p))p._store&&(p._store.validated=!0);else if(p){var G=g(p);if(typeof G=="function"&&G!==p.entries)for(var q=G.call(p),V;!(V=q.next()).done;)Zr(V.value)&&Fs(V.value,_)}}}function n0(p){{var _=p.type;if(_==null||typeof _=="string")return;var F;if(typeof _=="function")F=_.propTypes;else if(typeof _=="object"&&(_.$$typeof===o||_.$$typeof===h))F=_.propTypes;else return;if(F){var b=H(_);pr(F,p.props,"prop",b,p)}else if(_.PropTypes!==void 0&&!Xe){Xe=!0;var G=H(_);A("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",G||"Unknown")}typeof _.getDefaultProps=="function"&&!_.getDefaultProps.isReactClassApproved&&A("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function s0(p){{for(var _=Object.keys(p.props),F=0;F<_.length;F++){var b=_[F];if(b!=="children"&&b!=="key"){Le(p),A("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",b),Le(null);break}}p.ref!==null&&(Le(p),A("Invalid attribute `ref` supplied to `React.Fragment`."),Le(null))}}var za={};function As(p,_,F,b,G,q){{var V=P(p);if(!V){var z="";(p===void 0||typeof p=="object"&&p!==null&&Object.keys(p).length===0)&&(z+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var X=t0();X?z+=X:z+=Ts();var ae;p===null?ae="null":wr(p)?ae="array":p!==void 0&&p.$$typeof===t?(ae="<"+(H(p.type)||"Unknown")+" />",z=" Did you accidentally export a JSX literal instead of a component?"):ae=typeof p,A("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ae,z)}var he=_r(p,_,F,G,q);if(he==null)return he;if(V){var ke=_.children;if(ke!==void 0)if(b)if(wr(ke)){for(var xe=0;xe<ke.length;xe++)bs(ke[xe],p);Object.freeze&&Object.freeze(ke)}else A("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else bs(ke,p)}if(ve.call(_,"key")){var Ee=H(p),Ce=Object.keys(_).filter(function(Mr){return Mr!=="key"}),ir=Ce.length>0?"{key: someKey, "+Ce.join(": ..., ")+": ...}":"{key: someKey}";if(!za[Ee+ir]){var hr=Ce.length>0?"{"+Ce.join(": ..., ")+": ...}":"{}";A(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`,ir,Ee,hr,Ee),za[Ee+ir]=!0}}return p===a?s0(he):n0(he),he}}function i0(p,_,F){return As(p,_,F,!0)}function c0(p,_,F){return As(p,_,F,!1)}var T=c0,O=i0;$a.Fragment=a,$a.jsx=T,$a.jsxs=O}()),$a}process.env.NODE_ENV==="production"?Ns.exports=kl():Ns.exports=yl();var u=Ns.exports;function Be(...e){return ul.twMerge(ll.clsx(e))}const Ds=f0.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Fe=Ke.forwardRef(({className:e,variant:t,size:r,asChild:a=!1,...n},s)=>{const i=a?fl.Slot:"button";return u.jsx(i,{className:Be(Ds({variant:t,size:r,className:e})),ref:s,...n})});Fe.displayName="Button";const ia=Ke.forwardRef(({className:e,...t},r)=>u.jsx(Cs.Root,{ref:r,className:Be("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:u.jsx(Cs.Indicator,{className:Be("flex items-center justify-center text-current"),children:u.jsx(se.Check,{className:"h-4 w-4"})})}));ia.displayName=Cs.Root.displayName;const Os=kr.Root,Is=kr.Trigger,El=Ke.forwardRef(({className:e,inset:t,children:r,...a},n)=>u.jsxs(kr.SubTrigger,{ref:n,className:Be("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...a,children:[r,u.jsx(se.ChevronRight,{className:"ml-auto h-4 w-4"})]}));El.displayName=kr.SubTrigger.displayName;const Tl=Ke.forwardRef(({className:e,...t},r)=>u.jsx(kr.SubContent,{ref:r,className:Be("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Tl.displayName=kr.SubContent.displayName;const Mn=Ke.forwardRef(({className:e,sideOffset:t=4,...r},a)=>u.jsx(kr.Portal,{children:u.jsx(kr.Content,{ref:a,sideOffset:t,className:Be("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Mn.displayName=kr.Content.displayName;const ot=Ke.forwardRef(({className:e,inset:t,...r},a)=>u.jsx(kr.Item,{ref:a,className:Be("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r}));ot.displayName=kr.Item.displayName;const Sl=Ke.forwardRef(({className:e,children:t,checked:r,...a},n)=>u.jsxs(kr.CheckboxItem,{ref:n,className:Be("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...a,children:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(kr.ItemIndicator,{children:u.jsx(se.Check,{className:"h-4 w-4"})})}),t]}));Sl.displayName=kr.CheckboxItem.displayName;const Fl=Ke.forwardRef(({className:e,children:t,...r},a)=>u.jsxs(kr.RadioItem,{ref:a,className:Be("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(kr.ItemIndicator,{children:u.jsx(se.Circle,{className:"h-2 w-2 fill-current"})})}),t]}));Fl.displayName=kr.RadioItem.displayName;const bl=Ke.forwardRef(({className:e,inset:t,...r},a)=>u.jsx(kr.Label,{ref:a,className:Be("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));bl.displayName=kr.Label.displayName;const Al=Ke.forwardRef(({className:e,...t},r)=>u.jsx(kr.Separator,{ref:r,className:Be("-mx-1 my-1 h-px bg-muted",e),...t}));Al.displayName=kr.Separator.displayName;const Cl=1,Nl=1e6;let Rs=0;function Dl(){return Rs=(Rs+1)%Number.MAX_SAFE_INTEGER,Rs.toString()}const Ps=new Map,d0=e=>{if(Ps.has(e))return;const t=setTimeout(()=>{Ps.delete(e),Ka({type:"REMOVE_TOAST",toastId:e})},Nl);Ps.set(e,t)},Ol=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Cl)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?d0(r):e.toasts.forEach(a=>{d0(a.id)}),{...e,toasts:e.toasts.map(a=>a.id===r||r===void 0?{...a,open:!1}:a)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},Bn=[];let jn={toasts:[]};function Ka(e){jn=Ol(jn,e),Bn.forEach(t=>{t(jn)})}function Il({...e}){const t=Dl(),r=n=>Ka({type:"UPDATE_TOAST",toast:{...n,id:t}}),a=()=>Ka({type:"DISMISS_TOAST",toastId:t});return Ka({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:n=>{n||a()}}}),{id:t,dismiss:a,update:r}}function Ls(){const[e,t]=Ke.useState(jn);return Ke.useEffect(()=>(Bn.push(t),()=>{const r=Bn.indexOf(t);r>-1&&Bn.splice(r,1)}),[e]),{...e,toast:Il,dismiss:r=>Ka({type:"DISMISS_TOAST",toastId:r})}}function Un(){return(Un=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}function x0(e,t){if(e==null)return{};var r,a,n={},s=Object.keys(e);for(a=0;a<s.length;a++)t.indexOf(r=s[a])>=0||(n[r]=e[r]);return n}function Ms(e){var t=ne.useRef(e),r=ne.useRef(function(a){t.current&&t.current(a)});return t.current=e,r.current}var Ya=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=1),e>r?r:e<t?t:e},qa=function(e){return"touches"in e},Bs=function(e){return e&&e.ownerDocument.defaultView||self},p0=function(e,t,r){var a=e.getBoundingClientRect(),n=qa(t)?function(s,i){for(var c=0;c<s.length;c++)if(s[c].identifier===i)return s[c];return s[0]}(t.touches,r):t;return{left:Ya((n.pageX-(a.left+Bs(e).pageXOffset))/a.width),top:Ya((n.pageY-(a.top+Bs(e).pageYOffset))/a.height)}},m0=function(e){!qa(e)&&e.preventDefault()},v0=ne.memo(function(e){var t=e.onMove,r=e.onKey,a=x0(e,["onMove","onKey"]),n=ne.useRef(null),s=Ms(t),i=Ms(r),c=ne.useRef(null),o=ne.useRef(!1),f=ne.useMemo(function(){var m=function(g){m0(g),(qa(g)?g.touches.length>0:g.buttons>0)&&n.current?s(p0(n.current,g,c.current)):d(!1)},v=function(){return d(!1)};function d(g){var S=o.current,A=Bs(n.current),k=g?A.addEventListener:A.removeEventListener;k(S?"touchmove":"mousemove",m),k(S?"touchend":"mouseup",v)}return[function(g){var S=g.nativeEvent,A=n.current;if(A&&(m0(S),!function(I,L){return L&&!qa(I)}(S,o.current)&&A)){if(qa(S)){o.current=!0;var k=S.changedTouches||[];k.length&&(c.current=k[0].identifier)}A.focus(),s(p0(A,S,c.current)),d(!0)}},function(g){var S=g.which||g.keyCode;S<37||S>40||(g.preventDefault(),i({left:S===39?.05:S===37?-.05:0,top:S===40?.05:S===38?-.05:0}))},d]},[i,s]),l=f[0],h=f[1],x=f[2];return ne.useEffect(function(){return x},[x]),ne.createElement("div",Un({},a,{onTouchStart:l,onMouseDown:l,className:"react-colorful__interactive",ref:n,onKeyDown:h,tabIndex:0,role:"slider"}))}),js=function(e){return e.filter(Boolean).join(" ")},g0=function(e){var t=e.color,r=e.left,a=e.top,n=a===void 0?.5:a,s=js(["react-colorful__pointer",e.className]);return ne.createElement("div",{className:s,style:{top:100*n+"%",left:100*r+"%"}},ne.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Br=function(e,t,r){return t===void 0&&(t=0),r===void 0&&(r=Math.pow(10,t)),Math.round(r*e)/r},Rl=function(e){return jl(Us(e))},Us=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Br(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?Br(parseInt(e.substring(6,8),16)/255,2):1}},Pl=function(e){return Bl(Ml(e))},Ll=function(e){var t=e.s,r=e.v,a=e.a,n=(200-t)*r/100;return{h:Br(e.h),s:Br(n>0&&n<200?t*r/100/(n<=100?n:200-n)*100:0),l:Br(n/2),a:Br(a,2)}},Ws=function(e){var t=Ll(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},Ml=function(e){var t=e.h,r=e.s,a=e.v,n=e.a;t=t/360*6,r/=100,a/=100;var s=Math.floor(t),i=a*(1-r),c=a*(1-(t-s)*r),o=a*(1-(1-t+s)*r),f=s%6;return{r:Br(255*[a,c,i,i,o,a][f]),g:Br(255*[o,a,a,c,i,i][f]),b:Br(255*[i,i,o,a,a,c][f]),a:Br(n,2)}},Wn=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Bl=function(e){var t=e.r,r=e.g,a=e.b,n=e.a,s=n<1?Wn(Br(255*n)):"";return"#"+Wn(t)+Wn(r)+Wn(a)+s},jl=function(e){var t=e.r,r=e.g,a=e.b,n=e.a,s=Math.max(t,r,a),i=s-Math.min(t,r,a),c=i?s===t?(r-a)/i:s===r?2+(a-t)/i:4+(t-r)/i:0;return{h:Br(60*(c<0?c+6:c)),s:Br(s?i/s*100:0),v:Br(s/255*100),a:n}},Ul=ne.memo(function(e){var t=e.hue,r=e.onChange,a=js(["react-colorful__hue",e.className]);return ne.createElement("div",{className:a},ne.createElement(v0,{onMove:function(n){r({h:360*n.left})},onKey:function(n){r({h:Ya(t+360*n.left,0,360)})},"aria-label":"Hue","aria-valuenow":Br(t),"aria-valuemax":"360","aria-valuemin":"0"},ne.createElement(g0,{className:"react-colorful__hue-pointer",left:t/360,color:Ws({h:t,s:100,v:100,a:1})})))}),Wl=ne.memo(function(e){var t=e.hsva,r=e.onChange,a={backgroundColor:Ws({h:t.h,s:100,v:100,a:1})};return ne.createElement("div",{className:"react-colorful__saturation",style:a},ne.createElement(v0,{onMove:function(n){r({s:100*n.left,v:100-100*n.top})},onKey:function(n){r({s:Ya(t.s+100*n.left,0,100),v:Ya(t.v-100*n.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Br(t.s)+"%, Brightness "+Br(t.v)+"%"},ne.createElement(g0,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Ws(t)})))}),w0=function(e,t){if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0},Hl=function(e,t){return e.toLowerCase()===t.toLowerCase()||w0(Us(e),Us(t))};function Vl(e,t,r){var a=Ms(r),n=ne.useState(function(){return e.toHsva(t)}),s=n[0],i=n[1],c=ne.useRef({color:t,hsva:s});ne.useEffect(function(){if(!e.equal(t,c.current.color)){var f=e.toHsva(t);c.current={hsva:f,color:t},i(f)}},[t,e]),ne.useEffect(function(){var f;w0(s,c.current.hsva)||e.equal(f=e.fromHsva(s),c.current.color)||(c.current={hsva:s,color:f},a(f))},[s,e,a]);var o=ne.useCallback(function(f){i(function(l){return Object.assign({},l,f)})},[]);return[s,o]}var zl=typeof window<"u"?ne.useLayoutEffect:ne.useEffect,Gl=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},_0=new Map,Xl=function(e){zl(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!_0.has(t)){var r=t.createElement("style");r.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,_0.set(t,r);var a=Gl();a&&r.setAttribute("nonce",a),t.head.appendChild(r)}},[])},$l=function(e){var t=e.className,r=e.colorModel,a=e.color,n=a===void 0?r.defaultColor:a,s=e.onChange,i=x0(e,["className","colorModel","color","onChange"]),c=ne.useRef(null);Xl(c);var o=Vl(r,n,s),f=o[0],l=o[1],h=js(["react-colorful",t]);return ne.createElement("div",Un({},i,{ref:c,className:h}),ne.createElement(Wl,{hsva:f,onChange:l}),ne.createElement(Ul,{hue:f.h,onChange:l,className:"react-colorful__last-control"}))},Kl={defaultColor:"000",toHsva:Rl,fromHsva:function(e){return Pl({h:e.h,s:e.s,v:e.v,a:1})},equal:Hl},Yl=function(e){return ne.createElement($l,Un({},e,{colorModel:Kl}))};const Ja=Ga.Root,Za=Ga.Trigger,ba=Ke.forwardRef(({className:e,align:t="center",sideOffset:r=4,...a},n)=>u.jsx(Ga.Portal,{children:u.jsx(Ga.Content,{ref:n,align:t,sideOffset:r,className:Be("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));ba.displayName=Ga.Content.displayName;const k0=Ke.forwardRef(({className:e,...t},r)=>u.jsx("div",{ref:r,className:Be("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));k0.displayName="Card";const ql=Ke.forwardRef(({className:e,...t},r)=>u.jsx("div",{ref:r,className:Be("flex flex-col space-y-1.5 p-6",e),...t}));ql.displayName="CardHeader";const Jl=Ke.forwardRef(({className:e,...t},r)=>u.jsx("h3",{ref:r,className:Be("text-2xl font-semibold leading-none tracking-tight",e),...t}));Jl.displayName="CardTitle";const Zl=Ke.forwardRef(({className:e,...t},r)=>u.jsx("p",{ref:r,className:Be("text-sm text-muted-foreground",e),...t}));Zl.displayName="CardDescription";const Ql=Ke.forwardRef(({className:e,...t},r)=>u.jsx("div",{ref:r,className:Be("p-6 pt-0",e),...t}));Ql.displayName="CardContent";const eu=Ke.forwardRef(({className:e,...t},r)=>u.jsx("div",{ref:r,className:Be("flex items-center p-6 pt-0",e),...t}));eu.displayName="CardFooter";const ru=["#3B82F6","#8B5CF6","#10B981","#F59E0B","#EF4444","#EC4899","#6366F1","#14B8A6"];function y0({theme:e,onThemeChange:t}){const[r,a]=ne.useState(!1),[n,s]=ne.useState(e.primaryColor||"#3B82F6"),i=f=>{s(f)},c=f=>{const l=tu(f);document.documentElement.style.setProperty("--primary",l),document.documentElement.style.setProperty("--primary-hover",`${l.split(" ")[0]} ${l.split(" ")[1]} ${Math.max(parseInt(l.split(" ")[2])-5,5)}%`),document.documentElement.style.setProperty("--primary-light",`${l.split(" ")[0]} ${l.split(" ")[1]} 85%`),t({...e,primaryColor:f}),a(!1)},o=()=>{const f=e.mode==="light"?"dark":"light";document.documentElement.classList.toggle("dark",f==="dark"),t({...e,mode:f})};return u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(Fe,{variant:"outline",size:"sm",onClick:o,className:"flex items-center gap-2",children:[e.mode==="light"?u.jsx(se.Sun,{className:"w-4 h-4"}):u.jsx(se.Moon,{className:"w-4 h-4"}),e.mode==="light"?"Light":"Dark"]}),u.jsxs(Ja,{open:r,onOpenChange:a,children:[u.jsx(Za,{asChild:!0,children:u.jsxs(Fe,{variant:"outline",size:"sm",className:"flex items-center gap-2",children:[u.jsx(se.Palette,{className:"w-4 h-4"}),"Theme"]})}),u.jsx(ba,{className:"w-80 p-4",align:"end",children:u.jsx(k0,{className:"p-4",children:u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx("h4",{className:"text-sm font-medium mb-3",children:"Choose Primary Color"}),u.jsx("div",{className:"grid grid-cols-4 gap-2 mb-4",children:ru.map(f=>u.jsx("button",{className:"w-8 h-8 rounded border-2 border-border hover:scale-110 transition-transform",style:{backgroundColor:f},onClick:()=>c(f)},f))})]}),u.jsxs("div",{children:[u.jsx("h4",{className:"text-sm font-medium mb-3",children:"Custom Color"}),u.jsxs("div",{className:"space-y-3",children:[u.jsx(Yl,{color:n,onChange:i,style:{width:"100%",height:"150px"}}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("input",{type:"text",value:n,onChange:f=>s(f.target.value),className:"flex-1 px-2 py-1 text-sm border rounded bg-background",placeholder:"#3B82F6"}),u.jsx(Fe,{size:"sm",onClick:()=>c(n),children:"Apply"})]})]})]})]})})})]})]})}function tu(e){const t=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,a=parseInt(e.slice(5,7),16)/255,n=Math.max(t,r,a),s=Math.min(t,r,a);let i,c,o=(n+s)/2;if(n===s)i=c=0;else{const f=n-s;switch(c=o>.5?f/(2-n-s):f/(n+s),n){case t:i=(r-a)/f+(r<a?6:0);break;case r:i=(a-t)/f+2;break;case a:i=(t-r)/f+4;break;default:i=0}i/=6}return`${Math.round(i*360)} ${Math.round(c*100)}% ${Math.round(o*100)}%`}/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */var Hn={};Hn.version="0.18.5";var E0=1252,au=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],Hs={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969},Vs=function(e){au.indexOf(e)!=-1&&(E0=Hs[0]=e)};function nu(){Vs(1252)}var Ft=function(e){Vs(e)};function zs(){Ft(1200),nu()}function T0(e){for(var t=[],r=0,a=e.length;r<a;++r)t[r]=e.charCodeAt(r);return t}function su(e){for(var t=[],r=0;r<e.length>>1;++r)t[r]=String.fromCharCode(e.charCodeAt(2*r)+(e.charCodeAt(2*r+1)<<8));return t.join("")}function S0(e){for(var t=[],r=0;r<e.length>>1;++r)t[r]=String.fromCharCode(e.charCodeAt(2*r+1)+(e.charCodeAt(2*r)<<8));return t.join("")}var Qa=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1);return t==255&&r==254?su(e.slice(2)):t==254&&r==255?S0(e.slice(2)):t==65279?e.slice(1):e},Vn=function(t){return String.fromCharCode(t)},F0=function(t){return String.fromCharCode(t)},Xt,$t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function en(e){for(var t="",r=0,a=0,n=0,s=0,i=0,c=0,o=0,f=0;f<e.length;)r=e.charCodeAt(f++),s=r>>2,a=e.charCodeAt(f++),i=(r&3)<<4|a>>4,n=e.charCodeAt(f++),c=(a&15)<<2|n>>6,o=n&63,isNaN(a)?c=o=64:isNaN(n)&&(o=64),t+=$t.charAt(s)+$t.charAt(i)+$t.charAt(c)+$t.charAt(o);return t}function ft(e){var t="",r=0,a=0,n=0,s=0,i=0,c=0,o=0;e=e.replace(/[^\w\+\/\=]/g,"");for(var f=0;f<e.length;)s=$t.indexOf(e.charAt(f++)),i=$t.indexOf(e.charAt(f++)),r=s<<2|i>>4,t+=String.fromCharCode(r),c=$t.indexOf(e.charAt(f++)),a=(i&15)<<4|c>>2,c!==64&&(t+=String.fromCharCode(a)),o=$t.indexOf(e.charAt(f++)),n=(c&3)<<6|o,o!==64&&(t+=String.fromCharCode(n));return t}var ze=function(){return typeof Buffer<"u"&&typeof process<"u"&&typeof process.versions<"u"&&!!process.versions.node}(),Mt=function(){if(typeof Buffer<"u"){var e=!Buffer.from;if(!e)try{Buffer.from("foo","utf8")}catch{e=!0}return e?function(t,r){return r?new Buffer(t,r):new Buffer(t)}:Buffer.from.bind(Buffer)}return function(){}}();function Kt(e){return ze?Buffer.alloc?Buffer.alloc(e):new Buffer(e):typeof Uint8Array<"u"?new Uint8Array(e):new Array(e)}function b0(e){return ze?Buffer.allocUnsafe?Buffer.allocUnsafe(e):new Buffer(e):typeof Uint8Array<"u"?new Uint8Array(e):new Array(e)}var lt=function(t){return ze?Mt(t,"binary"):t.split("").map(function(r){return r.charCodeAt(0)&255})};function zn(e){if(typeof ArrayBuffer>"u")return lt(e);for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),a=0;a!=e.length;++a)r[a]=e.charCodeAt(a)&255;return t}function Yt(e){if(Array.isArray(e))return e.map(function(a){return String.fromCharCode(a)}).join("");for(var t=[],r=0;r<e.length;++r)t[r]=String.fromCharCode(e[r]);return t.join("")}function iu(e){if(typeof Uint8Array>"u")throw new Error("Unsupported");return new Uint8Array(e)}function Gs(e){if(typeof ArrayBuffer>"u")throw new Error("Unsupported");if(e instanceof ArrayBuffer)return Gs(new Uint8Array(e));for(var t=new Array(e.length),r=0;r<e.length;++r)t[r]=e[r];return t}var Ir=ze?function(e){return Buffer.concat(e.map(function(t){return Buffer.isBuffer(t)?t:Mt(t)}))}:function(e){if(typeof Uint8Array<"u"){var t=0,r=0;for(t=0;t<e.length;++t)r+=e[t].length;var a=new Uint8Array(r),n=0;for(t=0,r=0;t<e.length;r+=n,++t)if(n=e[t].length,e[t]instanceof Uint8Array)a.set(e[t],r);else{if(typeof e[t]=="string")throw"wtf";a.set(new Uint8Array(e[t]),r)}return a}return[].concat.apply([],e.map(function(s){return Array.isArray(s)?s:[].slice.call(s)}))};function cu(e){for(var t=[],r=0,a=e.length+250,n=Kt(e.length+255),s=0;s<e.length;++s){var i=e.charCodeAt(s);if(i<128)n[r++]=i;else if(i<2048)n[r++]=192|i>>6&31,n[r++]=128|i&63;else if(i>=55296&&i<57344){i=(i&1023)+64;var c=e.charCodeAt(++s)&1023;n[r++]=240|i>>8&7,n[r++]=128|i>>2&63,n[r++]=128|c>>6&15|(i&3)<<4,n[r++]=128|c&63}else n[r++]=224|i>>12&15,n[r++]=128|i>>6&63,n[r++]=128|i&63;r>a&&(t.push(n.slice(0,r)),r=0,n=Kt(65535),a=65530)}return t.push(n.slice(0,r)),Ir(t)}var Qr=/\u0000/g,rn=/[\u0001-\u0006]/g;function Aa(e){for(var t="",r=e.length-1;r>=0;)t+=e.charAt(r--);return t}function bt(e,t){var r=""+e;return r.length>=t?r:vr("0",t-r.length)+r}function Xs(e,t){var r=""+e;return r.length>=t?r:vr(" ",t-r.length)+r}function Gn(e,t){var r=""+e;return r.length>=t?r:r+vr(" ",t-r.length)}function ou(e,t){var r=""+Math.round(e);return r.length>=t?r:vr("0",t-r.length)+r}function fu(e,t){var r=""+e;return r.length>=t?r:vr("0",t-r.length)+r}var A0=Math.pow(2,32);function Ca(e,t){if(e>A0||e<-A0)return ou(e,t);var r=Math.round(e);return fu(r,t)}function Xn(e,t){return t=t||0,e.length>=7+t&&(e.charCodeAt(t)|32)===103&&(e.charCodeAt(t+1)|32)===101&&(e.charCodeAt(t+2)|32)===110&&(e.charCodeAt(t+3)|32)===101&&(e.charCodeAt(t+4)|32)===114&&(e.charCodeAt(t+5)|32)===97&&(e.charCodeAt(t+6)|32)===108}var C0=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],$s=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function lu(e){return e||(e={}),e[0]="General",e[1]="0",e[2]="0.00",e[3]="#,##0",e[4]="#,##0.00",e[9]="0%",e[10]="0.00%",e[11]="0.00E+00",e[12]="# ?/?",e[13]="# ??/??",e[14]="m/d/yy",e[15]="d-mmm-yy",e[16]="d-mmm",e[17]="mmm-yy",e[18]="h:mm AM/PM",e[19]="h:mm:ss AM/PM",e[20]="h:mm",e[21]="h:mm:ss",e[22]="m/d/yy h:mm",e[37]="#,##0 ;(#,##0)",e[38]="#,##0 ;[Red](#,##0)",e[39]="#,##0.00;(#,##0.00)",e[40]="#,##0.00;[Red](#,##0.00)",e[45]="mm:ss",e[46]="[h]:mm:ss",e[47]="mmss.0",e[48]="##0.0E+0",e[49]="@",e[56]='"上午/下午 "hh"時"mm"分"ss"秒 "',e}var De={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"上午/下午 "hh"時"mm"分"ss"秒 "'},N0={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},uu={5:'"$"#,##0_);\\("$"#,##0\\)',63:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function $n(e,t,r){for(var a=e<0?-1:1,n=e*a,s=0,i=1,c=0,o=1,f=0,l=0,h=Math.floor(n);f<t&&(h=Math.floor(n),c=h*i+s,l=h*f+o,!(n-h<5e-8));)n=1/(n-h),s=i,i=c,o=f,f=l;if(l>t&&(f>t?(l=o,c=s):(l=f,c=i)),!r)return[0,a*c,l];var x=Math.floor(a*c/l);return[x,a*c-x*l,l]}function ca(e,t,r){if(e>2958465||e<0)return null;var a=e|0,n=Math.floor(86400*(e-a)),s=0,i=[],c={D:a,T:n,u:86400*(e-a)-n,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(c.u)<1e-6&&(c.u=0),t&&t.date1904&&(a+=1462),c.u>.9999&&(c.u=0,++n==86400&&(c.T=n=0,++a,++c.D)),a===60)i=r?[1317,10,29]:[1900,2,29],s=3;else if(a===0)i=r?[1317,8,29]:[1900,1,0],s=6;else{a>60&&--a;var o=new Date(1900,0,1);o.setDate(o.getDate()+a-1),i=[o.getFullYear(),o.getMonth()+1,o.getDate()],s=o.getDay(),a<60&&(s=(s+6)%7),r&&(s=vu(o,i))}return c.y=i[0],c.m=i[1],c.d=i[2],c.S=n%60,n=Math.floor(n/60),c.M=n%60,n=Math.floor(n/60),c.H=n,c.q=s,c}var D0=new Date(1899,11,31,0,0,0),hu=D0.getTime(),du=new Date(1900,2,1,0,0,0);function O0(e,t){var r=e.getTime();return t?r-=1461*24*60*60*1e3:e>=du&&(r+=24*60*60*1e3),(r-(hu+(e.getTimezoneOffset()-D0.getTimezoneOffset())*6e4))/(24*60*60*1e3)}function Ks(e){return e.indexOf(".")==-1?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function xu(e){return e.indexOf("E")==-1?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}function pu(e){var t=e<0?12:11,r=Ks(e.toFixed(12));return r.length<=t||(r=e.toPrecision(10),r.length<=t)?r:e.toExponential(5)}function mu(e){var t=Ks(e.toFixed(11));return t.length>(e<0?12:11)||t==="0"||t==="-0"?e.toPrecision(6):t}function tn(e){var t=Math.floor(Math.log(Math.abs(e))*Math.LOG10E),r;return t>=-4&&t<=-1?r=e.toPrecision(10+t):Math.abs(t)<=9?r=pu(e):t===10?r=e.toFixed(10).substr(0,12):r=mu(e),Ks(xu(r.toUpperCase()))}function oa(e,t){switch(typeof e){case"string":return e;case"boolean":return e?"TRUE":"FALSE";case"number":return(e|0)===e?e.toString(10):tn(e);case"undefined":return"";case"object":if(e==null)return"";if(e instanceof Date)return vt(14,O0(e,t&&t.date1904),t)}throw new Error("unsupported value in General format: "+e)}function vu(e,t){t[0]-=581;var r=e.getDay();return e<60&&(r=(r+6)%7),r}function gu(e,t,r,a){var n="",s=0,i=0,c=r.y,o,f=0;switch(e){case 98:c=r.y+543;case 121:switch(t.length){case 1:case 2:o=c%100,f=2;break;default:o=c%1e4,f=4;break}break;case 109:switch(t.length){case 1:case 2:o=r.m,f=t.length;break;case 3:return $s[r.m-1][1];case 5:return $s[r.m-1][0];default:return $s[r.m-1][2]}break;case 100:switch(t.length){case 1:case 2:o=r.d,f=t.length;break;case 3:return C0[r.q][0];default:return C0[r.q][1]}break;case 104:switch(t.length){case 1:case 2:o=1+(r.H+11)%12,f=t.length;break;default:throw"bad hour format: "+t}break;case 72:switch(t.length){case 1:case 2:o=r.H,f=t.length;break;default:throw"bad hour format: "+t}break;case 77:switch(t.length){case 1:case 2:o=r.M,f=t.length;break;default:throw"bad minute format: "+t}break;case 115:if(t!="s"&&t!="ss"&&t!=".0"&&t!=".00"&&t!=".000")throw"bad second format: "+t;return r.u===0&&(t=="s"||t=="ss")?bt(r.S,t.length):(a>=2?i=a===3?1e3:100:i=a===1?10:1,s=Math.round(i*(r.S+r.u)),s>=60*i&&(s=0),t==="s"?s===0?"0":""+s/i:(n=bt(s,2+a),t==="ss"?n.substr(0,2):"."+n.substr(2,t.length-1)));case 90:switch(t){case"[h]":case"[hh]":o=r.D*24+r.H;break;case"[m]":case"[mm]":o=(r.D*24+r.H)*60+r.M;break;case"[s]":case"[ss]":o=((r.D*24+r.H)*60+r.M)*60+Math.round(r.S+r.u);break;default:throw"bad abstime format: "+t}f=t.length===3?1:2;break;case 101:o=c,f=1;break}var l=f>0?bt(o,f):"";return l}function qt(e){var t=3;if(e.length<=t)return e;for(var r=e.length%t,a=e.substr(0,r);r!=e.length;r+=t)a+=(a.length>0?",":"")+e.substr(r,t);return a}var I0=/%/g;function wu(e,t,r){var a=t.replace(I0,""),n=t.length-a.length;return Bt(e,a,r*Math.pow(10,2*n))+vr("%",n)}function _u(e,t,r){for(var a=t.length-1;t.charCodeAt(a-1)===44;)--a;return Bt(e,t.substr(0,a),r/Math.pow(10,3*(t.length-a)))}function R0(e,t){var r,a=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(t==0)return"0.0E+0";if(t<0)return"-"+R0(e,-t);var n=e.indexOf(".");n===-1&&(n=e.indexOf("E"));var s=Math.floor(Math.log(t)*Math.LOG10E)%n;if(s<0&&(s+=n),r=(t/Math.pow(10,s)).toPrecision(a+1+(n+s)%n),r.indexOf("e")===-1){var i=Math.floor(Math.log(t)*Math.LOG10E);for(r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(i-r.length+s):r+="E+"+(i-s);r.substr(0,2)==="0.";)r=r.charAt(0)+r.substr(2,n)+"."+r.substr(2+n),r=r.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(c,o,f,l){return o+f+l.substr(0,(n+s)%n)+"."+l.substr(s)+"E"})}else r=t.toExponential(a);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}var P0=/# (\?+)( ?)\/( ?)(\d+)/;function ku(e,t,r){var a=parseInt(e[4],10),n=Math.round(t*a),s=Math.floor(n/a),i=n-s*a,c=a;return r+(s===0?"":""+s)+" "+(i===0?vr(" ",e[1].length+1+e[4].length):Xs(i,e[1].length)+e[2]+"/"+e[3]+bt(c,e[4].length))}function yu(e,t,r){return r+(t===0?"":""+t)+vr(" ",e[1].length+2+e[4].length)}var L0=/^#*0*\.([0#]+)/,M0=/\).*[0#]/,B0=/\(###\) ###\\?-####/;function et(e){for(var t="",r,a=0;a!=e.length;++a)switch(r=e.charCodeAt(a)){case 35:break;case 63:t+=" ";break;case 48:t+="0";break;default:t+=String.fromCharCode(r)}return t}function j0(e,t){var r=Math.pow(10,t);return""+Math.round(e*r)/r}function U0(e,t){var r=e-Math.floor(e),a=Math.pow(10,t);return t<(""+Math.round(r*a)).length?0:Math.round(r*a)}function Eu(e,t){return t<(""+Math.round((e-Math.floor(e))*Math.pow(10,t))).length?1:0}function Tu(e){return e<2147483647&&e>-2147483648?""+(e>=0?e|0:e-1|0):""+Math.floor(e)}function mt(e,t,r){if(e.charCodeAt(0)===40&&!t.match(M0)){var a=t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?mt("n",a,r):"("+mt("n",a,-r)+")"}if(t.charCodeAt(t.length-1)===44)return _u(e,t,r);if(t.indexOf("%")!==-1)return wu(e,t,r);if(t.indexOf("E")!==-1)return R0(t,r);if(t.charCodeAt(0)===36)return"$"+mt(e,t.substr(t.charAt(1)==" "?2:1),r);var n,s,i,c,o=Math.abs(r),f=r<0?"-":"";if(t.match(/^00+$/))return f+Ca(o,t.length);if(t.match(/^[#?]+$/))return n=Ca(r,0),n==="0"&&(n=""),n.length>t.length?n:et(t.substr(0,t.length-n.length))+n;if(s=t.match(P0))return ku(s,o,f);if(t.match(/^#+0+$/))return f+Ca(o,t.length-t.indexOf("0"));if(s=t.match(L0))return n=j0(r,s[1].length).replace(/^([^\.]+)$/,"$1."+et(s[1])).replace(/\.$/,"."+et(s[1])).replace(/\.(\d*)$/,function(v,d){return"."+d+vr("0",et(s[1]).length-d.length)}),t.indexOf("0.")!==-1?n:n.replace(/^0\./,".");if(t=t.replace(/^#+([0.])/,"$1"),s=t.match(/^(0*)\.(#*)$/))return f+j0(o,s[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,s[1].length?"0.":".");if(s=t.match(/^#{1,3},##0(\.?)$/))return f+qt(Ca(o,0));if(s=t.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+mt(e,t,-r):qt(""+(Math.floor(r)+Eu(r,s[1].length)))+"."+bt(U0(r,s[1].length),s[1].length);if(s=t.match(/^#,#*,#0/))return mt(e,t.replace(/^#,#*,/,""),r);if(s=t.match(/^([0#]+)(\\?-([0#]+))+$/))return n=Aa(mt(e,t.replace(/[\\-]/g,""),r)),i=0,Aa(Aa(t.replace(/\\/g,"")).replace(/[0#]/g,function(v){return i<n.length?n.charAt(i++):v==="0"?"0":""}));if(t.match(B0))return n=mt(e,"##########",r),"("+n.substr(0,3)+") "+n.substr(3,3)+"-"+n.substr(6);var l="";if(s=t.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return i=Math.min(s[4].length,7),c=$n(o,Math.pow(10,i)-1,!1),n=""+f,l=Bt("n",s[1],c[1]),l.charAt(l.length-1)==" "&&(l=l.substr(0,l.length-1)+"0"),n+=l+s[2]+"/"+s[3],l=Gn(c[2],i),l.length<s[4].length&&(l=et(s[4].substr(s[4].length-l.length))+l),n+=l,n;if(s=t.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return i=Math.min(Math.max(s[1].length,s[4].length),7),c=$n(o,Math.pow(10,i)-1,!0),f+(c[0]||(c[1]?"":"0"))+" "+(c[1]?Xs(c[1],i)+s[2]+"/"+s[3]+Gn(c[2],i):vr(" ",2*i+1+s[2].length+s[3].length));if(s=t.match(/^[#0?]+$/))return n=Ca(r,0),t.length<=n.length?n:et(t.substr(0,t.length-n.length))+n;if(s=t.match(/^([#0?]+)\.([#0]+)$/)){n=""+r.toFixed(Math.min(s[2].length,10)).replace(/([^0])0+$/,"$1"),i=n.indexOf(".");var h=t.indexOf(".")-i,x=t.length-n.length-h;return et(t.substr(0,h)+n+t.substr(t.length-x))}if(s=t.match(/^00,000\.([#0]*0)$/))return i=U0(r,s[1].length),r<0?"-"+mt(e,t,-r):qt(Tu(r)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(v){return"00,"+(v.length<3?bt(0,3-v.length):"")+v})+"."+bt(i,s[1].length);switch(t){case"###,##0.00":return mt(e,"#,##0.00",r);case"###,###":case"##,###":case"#,###":var m=qt(Ca(o,0));return m!=="0"?f+m:"";case"###,###.00":return mt(