react-beauty-calendar 1.2.0 → 1.2.1
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/build/main.cjs.js
CHANGED
|
@@ -167,4 +167,4 @@ object-assign
|
|
|
167
167
|
*/var So,na;function wb(){if(na)return So;na=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function o(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var i={},a=0;a<10;a++)i["_"+String.fromCharCode(a)]=a;var c=Object.getOwnPropertyNames(i).map(function(d){return i[d]});if(c.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(d){l[d]=d}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return So=o()?Object.assign:function(s,i){for(var a,c=r(s),l,d=1;d<arguments.length;d++){a=Object(arguments[d]);for(var u in a)t.call(a,u)&&(c[u]=a[u]);if(e){l=e(a);for(var v=0;v<l.length;v++)n.call(a,l[v])&&(c[l[v]]=a[l[v]])}}return c},So}var Co,ra;function Hs(){if(ra)return Co;ra=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Co=e,Co}var Eo,oa;function iu(){return oa||(oa=1,Eo=Function.call.bind(Object.prototype.hasOwnProperty)),Eo}var Do,sa;function xb(){if(sa)return Do;sa=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Hs(),n={},r=iu();e=function(s){var i="Warning: "+s;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function o(s,i,a,c,l){if(process.env.NODE_ENV!=="production"){for(var d in s)if(r(s,d)){var u;try{if(typeof s[d]!="function"){var v=Error((c||"React class")+": "+a+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw v.name="Invariant Violation",v}u=s[d](i,d,c,a,null,t)}catch(C){u=C}if(u&&!(u instanceof Error)&&e((c||"React class")+": type specification of "+a+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in n)){n[u.message]=!0;var h=l?l():"";e("Failed "+a+" type: "+u.message+(h??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Do=o,Do}var To,ia;function Sb(){if(ia)return To;ia=1;var e=su(),t=wb(),n=Hs(),r=iu(),o=xb(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(a){var c="Warning: "+a;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function i(){return null}return To=function(a,c){var l=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function u(P){var F=P&&(l&&P[l]||P[d]);if(typeof F=="function")return F}var v="<<anonymous>>",h={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:f(),arrayOf:w,element:D(),elementType:m(),instanceOf:T,node:N(),objectOf:E,oneOf:b,oneOfType:M,shape:W,exact:Y};function C(P,F){return P===F?P!==0||1/P===1/F:P!==P&&F!==F}function g(P,F){this.message=P,this.data=F&&typeof F=="object"?F:{},this.stack=""}g.prototype=Error.prototype;function x(P){if(process.env.NODE_ENV!=="production")var F={},U=0;function V(X,K,z,G,q,B,te){if(G=G||v,B=B||z,te!==n){if(c){var _=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw _.name="Invariant Violation",_}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ne=G+":"+z;!F[ne]&&U<3&&(s("You are manually calling a React.PropTypes validation function for the `"+B+"` prop on `"+G+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),F[ne]=!0,U++)}}return K[z]==null?X?K[z]===null?new g("The "+q+" `"+B+"` is marked as required "+("in `"+G+"`, but its value is `null`.")):new g("The "+q+" `"+B+"` is marked as required in "+("`"+G+"`, but its value is `undefined`.")):null:P(K,z,G,q,B)}var H=V.bind(null,!1);return H.isRequired=V.bind(null,!0),H}function y(P){function F(U,V,H,X,K,z){var G=U[V],q=k(G);if(q!==P){var B=I(G);return new g("Invalid "+X+" `"+K+"` of type "+("`"+B+"` supplied to `"+H+"`, expected ")+("`"+P+"`."),{expectedType:P})}return null}return x(F)}function f(){return x(i)}function w(P){function F(U,V,H,X,K){if(typeof P!="function")return new g("Property `"+K+"` of component `"+H+"` has invalid PropType notation inside arrayOf.");var z=U[V];if(!Array.isArray(z)){var G=k(z);return new g("Invalid "+X+" `"+K+"` of type "+("`"+G+"` supplied to `"+H+"`, expected an array."))}for(var q=0;q<z.length;q++){var B=P(z,q,H,X,K+"["+q+"]",n);if(B instanceof Error)return B}return null}return x(F)}function D(){function P(F,U,V,H,X){var K=F[U];if(!a(K)){var z=k(K);return new g("Invalid "+H+" `"+X+"` of type "+("`"+z+"` supplied to `"+V+"`, expected a single ReactElement."))}return null}return x(P)}function m(){function P(F,U,V,H,X){var K=F[U];if(!e.isValidElementType(K)){var z=k(K);return new g("Invalid "+H+" `"+X+"` of type "+("`"+z+"` supplied to `"+V+"`, expected a single ReactElement type."))}return null}return x(P)}function T(P){function F(U,V,H,X,K){if(!(U[V]instanceof P)){var z=P.name||v,G=j(U[V]);return new g("Invalid "+X+" `"+K+"` of type "+("`"+G+"` supplied to `"+H+"`, expected ")+("instance of `"+z+"`."))}return null}return x(F)}function b(P){if(!Array.isArray(P))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),i;function F(U,V,H,X,K){for(var z=U[V],G=0;G<P.length;G++)if(C(z,P[G]))return null;var q=JSON.stringify(P,function(te,_){var ne=I(_);return ne==="symbol"?String(_):_});return new g("Invalid "+X+" `"+K+"` of value `"+String(z)+"` "+("supplied to `"+H+"`, expected one of "+q+"."))}return x(F)}function E(P){function F(U,V,H,X,K){if(typeof P!="function")return new g("Property `"+K+"` of component `"+H+"` has invalid PropType notation inside objectOf.");var z=U[V],G=k(z);if(G!=="object")return new g("Invalid "+X+" `"+K+"` of type "+("`"+G+"` supplied to `"+H+"`, expected an object."));for(var q in z)if(r(z,q)){var B=P(z,q,H,X,K+"."+q,n);if(B instanceof Error)return B}return null}return x(F)}function M(P){if(!Array.isArray(P))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var F=0;F<P.length;F++){var U=P[F];if(typeof U!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+O(U)+" at index "+F+"."),i}function V(H,X,K,z,G){for(var q=[],B=0;B<P.length;B++){var te=P[B],_=te(H,X,K,z,G,n);if(_==null)return null;_.data&&r(_.data,"expectedType")&&q.push(_.data.expectedType)}var ne=q.length>0?", expected one of type ["+q.join(", ")+"]":"";return new g("Invalid "+z+" `"+G+"` supplied to "+("`"+K+"`"+ne+"."))}return x(V)}function N(){function P(F,U,V,H,X){return L(F[U])?null:new g("Invalid "+H+" `"+X+"` supplied to "+("`"+V+"`, expected a ReactNode."))}return x(P)}function A(P,F,U,V,H){return new g((P||"React class")+": "+F+" type `"+U+"."+V+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+H+"`.")}function W(P){function F(U,V,H,X,K){var z=U[V],G=k(z);if(G!=="object")return new g("Invalid "+X+" `"+K+"` of type `"+G+"` "+("supplied to `"+H+"`, expected `object`."));for(var q in P){var B=P[q];if(typeof B!="function")return A(H,X,K,q,I(B));var te=B(z,q,H,X,K+"."+q,n);if(te)return te}return null}return x(F)}function Y(P){function F(U,V,H,X,K){var z=U[V],G=k(z);if(G!=="object")return new g("Invalid "+X+" `"+K+"` of type `"+G+"` "+("supplied to `"+H+"`, expected `object`."));var q=t({},U[V],P);for(var B in q){var te=P[B];if(r(P,B)&&typeof te!="function")return A(H,X,K,B,I(te));if(!te)return new g("Invalid "+X+" `"+K+"` key `"+B+"` supplied to `"+H+"`.\nBad object: "+JSON.stringify(U[V],null," ")+`
|
|
168
168
|
Valid keys: `+JSON.stringify(Object.keys(P),null," "));var _=te(z,B,H,X,K+"."+B,n);if(_)return _}return null}return x(F)}function L(P){switch(typeof P){case"number":case"string":case"undefined":return!0;case"boolean":return!P;case"object":if(Array.isArray(P))return P.every(L);if(P===null||a(P))return!0;var F=u(P);if(F){var U=F.call(P),V;if(F!==P.entries){for(;!(V=U.next()).done;)if(!L(V.value))return!1}else for(;!(V=U.next()).done;){var H=V.value;if(H&&!L(H[1]))return!1}}else return!1;return!0;default:return!1}}function $(P,F){return P==="symbol"?!0:F?F["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&F instanceof Symbol:!1}function k(P){var F=typeof P;return Array.isArray(P)?"array":P instanceof RegExp?"object":$(F,P)?"symbol":F}function I(P){if(typeof P>"u"||P===null)return""+P;var F=k(P);if(F==="object"){if(P instanceof Date)return"date";if(P instanceof RegExp)return"regexp"}return F}function O(P){var F=I(P);switch(F){case"array":case"object":return"an "+F;case"boolean":case"date":case"regexp":return"a "+F;default:return F}}function j(P){return!P.constructor||!P.constructor.name?v:P.constructor.name}return h.checkPropTypes=o,h.resetWarningCache=o.resetWarningCache,h.PropTypes=h,h},To}var Ro,aa;function Cb(){if(aa)return Ro;aa=1;var e=Hs();function t(){}function n(){}return n.resetWarningCache=t,Ro=function(){function r(i,a,c,l,d,u){if(u!==e){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}}r.isRequired=r;function o(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},Ro}var ca;function Xr(){if(ca)return Jn.exports;if(ca=1,process.env.NODE_ENV!=="production"){var e=su(),t=!0;Jn.exports=Sb()(e.isElement,t)}else Jn.exports=Cb()();return Jn.exports}function au(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=au(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function la(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=au(e))&&(r&&(r+=" "),r+=t);return r}const Eb=Object.freeze(Object.defineProperty({__proto__:null,clsx:la,default:la},Symbol.toStringTag,{value:"Module"})),Db=wd(Eb);var pe={},ct={},ua;function Zr(){if(ua)return ct;ua=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.dontSetMe=o,ct.findInArray=e,ct.int=r,ct.isFunction=t,ct.isNum=n;function e(s,i){for(let a=0,c=s.length;a<c;a++)if(i.apply(i,[s[a],a,s]))return s[a]}function t(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Function]"}function n(s){return typeof s=="number"&&!isNaN(s)}function r(s){return parseInt(s,10)}function o(s,i,a){if(s[i])return new Error("Invalid prop ".concat(i," passed to ").concat(a," - do not set this, set it on the child."))}return ct}var lt={},da;function Tb(){if(da)return lt;da=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.browserPrefixToKey=n,lt.browserPrefixToStyle=r,lt.default=void 0,lt.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){var s;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const a=(s=window.document)===null||s===void 0||(s=s.documentElement)===null||s===void 0?void 0:s.style;if(!a||i in a)return"";for(let c=0;c<e.length;c++)if(n(i,e[c])in a)return e[c];return""}function n(s,i){return i?"".concat(i).concat(o(s)):s}function r(s,i){return i?"-".concat(i.toLowerCase(),"-").concat(s):s}function o(s){let i="",a=!0;for(let c=0;c<s.length;c++)a?(i+=s[c].toUpperCase(),a=!1):s[c]==="-"?a=!0:i+=s[c];return i}return lt.default=t(),lt}var fa;function Vs(){if(fa)return pe;fa=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.addClassName=m,pe.addEvent=a,pe.addUserSelectStyles=w,pe.createCSSTransform=C,pe.createSVGTransform=g,pe.getTouch=y,pe.getTouchIdentifier=f,pe.getTranslation=x,pe.innerHeight=u,pe.innerWidth=v,pe.matchesSelector=s,pe.matchesSelectorAndParentsTo=i,pe.offsetXYFromParent=h,pe.outerHeight=l,pe.outerWidth=d,pe.removeClassName=T,pe.removeEvent=c,pe.removeUserSelectStyles=D;var e=Zr(),t=r(Tb());function n(b){if(typeof WeakMap!="function")return null;var E=new WeakMap,M=new WeakMap;return(n=function(N){return N?M:E})(b)}function r(b,E){if(b&&b.__esModule)return b;if(b===null||typeof b!="object"&&typeof b!="function")return{default:b};var M=n(E);if(M&&M.has(b))return M.get(b);var N={},A=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var W in b)if(W!=="default"&&Object.prototype.hasOwnProperty.call(b,W)){var Y=A?Object.getOwnPropertyDescriptor(b,W):null;Y&&(Y.get||Y.set)?Object.defineProperty(N,W,Y):N[W]=b[W]}return N.default=b,M&&M.set(b,N),N}let o="";function s(b,E){return o||(o=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(M){return(0,e.isFunction)(b[M])})),(0,e.isFunction)(b[o])?b[o](E):!1}function i(b,E,M){let N=b;do{if(s(N,E))return!0;if(N===M)return!1;N=N.parentNode}while(N);return!1}function a(b,E,M,N){if(!b)return;const A={capture:!0,...N};b.addEventListener?b.addEventListener(E,M,A):b.attachEvent?b.attachEvent("on"+E,M):b["on"+E]=M}function c(b,E,M,N){if(!b)return;const A={capture:!0,...N};b.removeEventListener?b.removeEventListener(E,M,A):b.detachEvent?b.detachEvent("on"+E,M):b["on"+E]=null}function l(b){let E=b.clientHeight;const M=b.ownerDocument.defaultView.getComputedStyle(b);return E+=(0,e.int)(M.borderTopWidth),E+=(0,e.int)(M.borderBottomWidth),E}function d(b){let E=b.clientWidth;const M=b.ownerDocument.defaultView.getComputedStyle(b);return E+=(0,e.int)(M.borderLeftWidth),E+=(0,e.int)(M.borderRightWidth),E}function u(b){let E=b.clientHeight;const M=b.ownerDocument.defaultView.getComputedStyle(b);return E-=(0,e.int)(M.paddingTop),E-=(0,e.int)(M.paddingBottom),E}function v(b){let E=b.clientWidth;const M=b.ownerDocument.defaultView.getComputedStyle(b);return E-=(0,e.int)(M.paddingLeft),E-=(0,e.int)(M.paddingRight),E}function h(b,E,M){const A=E===E.ownerDocument.body?{left:0,top:0}:E.getBoundingClientRect(),W=(b.clientX+E.scrollLeft-A.left)/M,Y=(b.clientY+E.scrollTop-A.top)/M;return{x:W,y:Y}}function C(b,E){const M=x(b,E,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:M}}function g(b,E){return x(b,E,"")}function x(b,E,M){let{x:N,y:A}=b,W="translate(".concat(N).concat(M,",").concat(A).concat(M,")");if(E){const Y="".concat(typeof E.x=="string"?E.x:E.x+M),L="".concat(typeof E.y=="string"?E.y:E.y+M);W="translate(".concat(Y,", ").concat(L,")")+W}return W}function y(b,E){return b.targetTouches&&(0,e.findInArray)(b.targetTouches,M=>E===M.identifier)||b.changedTouches&&(0,e.findInArray)(b.changedTouches,M=>E===M.identifier)}function f(b){if(b.targetTouches&&b.targetTouches[0])return b.targetTouches[0].identifier;if(b.changedTouches&&b.changedTouches[0])return b.changedTouches[0].identifier}function w(b){if(!b)return;let E=b.getElementById("react-draggable-style-el");E||(E=b.createElement("style"),E.type="text/css",E.id="react-draggable-style-el",E.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
169
169
|
`,E.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
170
|
-
`,b.getElementsByTagName("head")[0].appendChild(E)),b.body&&m(b.body,"react-draggable-transparent-selection")}function D(b){if(b)try{if(b.body&&T(b.body,"react-draggable-transparent-selection"),b.selection)b.selection.empty();else{const E=(b.defaultView||window).getSelection();E&&E.type!=="Caret"&&E.removeAllRanges()}}catch{}}function m(b,E){b.classList?b.classList.add(E):b.className.match(new RegExp("(?:^|\\s)".concat(E,"(?!\\S)")))||(b.className+=" ".concat(E))}function T(b,E){b.classList?b.classList.remove(E):b.className=b.className.replace(new RegExp("(?:^|\\s)".concat(E,"(?!\\S)"),"g"),"")}return pe}var He={},pa;function cu(){if(pa)return He;pa=1,Object.defineProperty(He,"__esModule",{value:!0}),He.canDragX=o,He.canDragY=s,He.createCoreData=a,He.createDraggableData=c,He.getBoundPosition=n,He.getControlPosition=i,He.snapToGrid=r;var e=Zr(),t=Vs();function n(u,v,h){if(!u.props.bounds)return[v,h];let{bounds:C}=u.props;C=typeof C=="string"?C:l(C);const g=d(u);if(typeof C=="string"){const{ownerDocument:x}=g,y=x.defaultView;let f;if(C==="parent"?f=g.parentNode:f=x.querySelector(C),!(f instanceof y.HTMLElement))throw new Error('Bounds selector "'+C+'" could not find an element.');const w=f,D=y.getComputedStyle(g),m=y.getComputedStyle(w);C={left:-g.offsetLeft+(0,e.int)(m.paddingLeft)+(0,e.int)(D.marginLeft),top:-g.offsetTop+(0,e.int)(m.paddingTop)+(0,e.int)(D.marginTop),right:(0,t.innerWidth)(w)-(0,t.outerWidth)(g)-g.offsetLeft+(0,e.int)(m.paddingRight)-(0,e.int)(D.marginRight),bottom:(0,t.innerHeight)(w)-(0,t.outerHeight)(g)-g.offsetTop+(0,e.int)(m.paddingBottom)-(0,e.int)(D.marginBottom)}}return(0,e.isNum)(C.right)&&(v=Math.min(v,C.right)),(0,e.isNum)(C.bottom)&&(h=Math.min(h,C.bottom)),(0,e.isNum)(C.left)&&(v=Math.max(v,C.left)),(0,e.isNum)(C.top)&&(h=Math.max(h,C.top)),[v,h]}function r(u,v,h){const C=Math.round(v/u[0])*u[0],g=Math.round(h/u[1])*u[1];return[C,g]}function o(u){return u.props.axis==="both"||u.props.axis==="x"}function s(u){return u.props.axis==="both"||u.props.axis==="y"}function i(u,v,h){const C=typeof v=="number"?(0,t.getTouch)(u,v):null;if(typeof v=="number"&&!C)return null;const g=d(h),x=h.props.offsetParent||g.offsetParent||g.ownerDocument.body;return(0,t.offsetXYFromParent)(C||u,x,h.props.scale)}function a(u,v,h){const C=!(0,e.isNum)(u.lastX),g=d(u);return C?{node:g,deltaX:0,deltaY:0,lastX:v,lastY:h,x:v,y:h}:{node:g,deltaX:v-u.lastX,deltaY:h-u.lastY,lastX:u.lastX,lastY:u.lastY,x:v,y:h}}function c(u,v){const h=u.props.scale;return{node:v.node,x:u.state.x+v.deltaX/h,y:u.state.y+v.deltaY/h,deltaX:v.deltaX/h,deltaY:v.deltaY/h,lastX:u.state.x,lastY:u.state.y}}function l(u){return{left:u.left,top:u.top,right:u.right,bottom:u.bottom}}function d(u){const v=u.findDOMNode();if(!v)throw new Error("<DraggableCore>: Unmounted during event!");return v}return He}var dn={},er={},ha;function lu(){if(ha)return er;ha=1,Object.defineProperty(er,"__esModule",{value:!0}),er.default=e;function e(){}return er}var ga;function Rb(){if(ga)return dn;ga=1,Object.defineProperty(dn,"__esModule",{value:!0}),dn.default=void 0;var e=l(R),t=a(Xr()),n=a(Ze),r=Vs(),o=cu(),s=Zr(),i=a(lu());function a(x){return x&&x.__esModule?x:{default:x}}function c(x){if(typeof WeakMap!="function")return null;var y=new WeakMap,f=new WeakMap;return(c=function(w){return w?f:y})(x)}function l(x,y){if(x&&x.__esModule)return x;if(x===null||typeof x!="object"&&typeof x!="function")return{default:x};var f=c(y);if(f&&f.has(x))return f.get(x);var w={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var m in x)if(m!=="default"&&Object.prototype.hasOwnProperty.call(x,m)){var T=D?Object.getOwnPropertyDescriptor(x,m):null;T&&(T.get||T.set)?Object.defineProperty(w,m,T):w[m]=x[m]}return w.default=x,f&&f.set(x,w),w}function d(x,y,f){return y=u(y),y in x?Object.defineProperty(x,y,{value:f,enumerable:!0,configurable:!0,writable:!0}):x[y]=f,x}function u(x){var y=v(x,"string");return typeof y=="symbol"?y:String(y)}function v(x,y){if(typeof x!="object"||x===null)return x;var f=x[Symbol.toPrimitive];if(f!==void 0){var w=f.call(x,y);if(typeof w!="object")return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return(y==="string"?String:Number)(x)}const h={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let C=h.mouse,g=class extends e.Component{constructor(){super(...arguments),d(this,"dragging",!1),d(this,"lastX",NaN),d(this,"lastY",NaN),d(this,"touchIdentifier",null),d(this,"mounted",!1),d(this,"handleDragStart",y=>{if(this.props.onMouseDown(y),!this.props.allowAnyClick&&typeof y.button=="number"&&y.button!==0)return!1;const f=this.findDOMNode();if(!f||!f.ownerDocument||!f.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:w}=f;if(this.props.disabled||!(y.target instanceof w.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(y.target,this.props.handle,f)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(y.target,this.props.cancel,f))return;y.type==="touchstart"&&y.preventDefault();const D=(0,r.getTouchIdentifier)(y);this.touchIdentifier=D;const m=(0,o.getControlPosition)(y,D,this);if(m==null)return;const{x:T,y:b}=m,E=(0,o.createCoreData)(this,T,b);(0,i.default)("DraggableCore: handleDragStart: %j",E),(0,i.default)("calling",this.props.onStart),!(this.props.onStart(y,E)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(w),this.dragging=!0,this.lastX=T,this.lastY=b,(0,r.addEvent)(w,C.move,this.handleDrag),(0,r.addEvent)(w,C.stop,this.handleDragStop))}),d(this,"handleDrag",y=>{const f=(0,o.getControlPosition)(y,this.touchIdentifier,this);if(f==null)return;let{x:w,y:D}=f;if(Array.isArray(this.props.grid)){let b=w-this.lastX,E=D-this.lastY;if([b,E]=(0,o.snapToGrid)(this.props.grid,b,E),!b&&!E)return;w=this.lastX+b,D=this.lastY+E}const m=(0,o.createCoreData)(this,w,D);if((0,i.default)("DraggableCore: handleDrag: %j",m),this.props.onDrag(y,m)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const E=document.createEvent("MouseEvents");E.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(E)}return}this.lastX=w,this.lastY=D}),d(this,"handleDragStop",y=>{if(!this.dragging)return;const f=(0,o.getControlPosition)(y,this.touchIdentifier,this);if(f==null)return;let{x:w,y:D}=f;if(Array.isArray(this.props.grid)){let E=w-this.lastX||0,M=D-this.lastY||0;[E,M]=(0,o.snapToGrid)(this.props.grid,E,M),w=this.lastX+E,D=this.lastY+M}const m=(0,o.createCoreData)(this,w,D);if(this.props.onStop(y,m)===!1||this.mounted===!1)return!1;const b=this.findDOMNode();b&&this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(b.ownerDocument),(0,i.default)("DraggableCore: handleDragStop: %j",m),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,b&&((0,i.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(b.ownerDocument,C.move,this.handleDrag),(0,r.removeEvent)(b.ownerDocument,C.stop,this.handleDragStop))}),d(this,"onMouseDown",y=>(C=h.mouse,this.handleDragStart(y))),d(this,"onMouseUp",y=>(C=h.mouse,this.handleDragStop(y))),d(this,"onTouchStart",y=>(C=h.touch,this.handleDragStart(y))),d(this,"onTouchEnd",y=>(C=h.touch,this.handleDragStop(y)))}componentDidMount(){this.mounted=!0;const y=this.findDOMNode();y&&(0,r.addEvent)(y,h.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const y=this.findDOMNode();if(y){const{ownerDocument:f}=y;(0,r.removeEvent)(f,h.mouse.move,this.handleDrag),(0,r.removeEvent)(f,h.touch.move,this.handleDrag),(0,r.removeEvent)(f,h.mouse.stop,this.handleDragStop),(0,r.removeEvent)(f,h.touch.stop,this.handleDragStop),(0,r.removeEvent)(y,h.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(f)}}findDOMNode(){var y,f;return(y=this.props)!==null&&y!==void 0&&y.nodeRef?(f=this.props)===null||f===void 0||(f=f.nodeRef)===null||f===void 0?void 0:f.current:n.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return dn.default=g,d(g,"displayName","DraggableCore"),d(g,"propTypes",{allowAnyClick:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(x,y){if(x[y]&&x[y].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),d(g,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),dn}var ma;function Mb(){return ma||(ma=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var t=v(R),n=d(Xr()),r=d(Ze),o=d(Db),s=Vs(),i=cu(),a=Zr(),c=d(Rb()),l=d(lu());function d(f){return f&&f.__esModule?f:{default:f}}function u(f){if(typeof WeakMap!="function")return null;var w=new WeakMap,D=new WeakMap;return(u=function(m){return m?D:w})(f)}function v(f,w){if(f&&f.__esModule)return f;if(f===null||typeof f!="object"&&typeof f!="function")return{default:f};var D=u(w);if(D&&D.has(f))return D.get(f);var m={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in f)if(b!=="default"&&Object.prototype.hasOwnProperty.call(f,b)){var E=T?Object.getOwnPropertyDescriptor(f,b):null;E&&(E.get||E.set)?Object.defineProperty(m,b,E):m[b]=f[b]}return m.default=f,D&&D.set(f,m),m}function h(){return h=Object.assign?Object.assign.bind():function(f){for(var w=1;w<arguments.length;w++){var D=arguments[w];for(var m in D)Object.prototype.hasOwnProperty.call(D,m)&&(f[m]=D[m])}return f},h.apply(this,arguments)}function C(f,w,D){return w=g(w),w in f?Object.defineProperty(f,w,{value:D,enumerable:!0,configurable:!0,writable:!0}):f[w]=D,f}function g(f){var w=x(f,"string");return typeof w=="symbol"?w:String(w)}function x(f,w){if(typeof f!="object"||f===null)return f;var D=f[Symbol.toPrimitive];if(D!==void 0){var m=D.call(f,w);if(typeof m!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(f)}class y extends t.Component{static getDerivedStateFromProps(w,D){let{position:m}=w,{prevPropsPosition:T}=D;return m&&(!T||m.x!==T.x||m.y!==T.y)?((0,l.default)("Draggable: getDerivedStateFromProps %j",{position:m,prevPropsPosition:T}),{x:m.x,y:m.y,prevPropsPosition:{...m}}):null}constructor(w){super(w),C(this,"onDragStart",(D,m)=>{if((0,l.default)("Draggable: onDragStart: %j",m),this.props.onStart(D,(0,i.createDraggableData)(this,m))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),C(this,"onDrag",(D,m)=>{if(!this.state.dragging)return!1;(0,l.default)("Draggable: onDrag: %j",m);const T=(0,i.createDraggableData)(this,m),b={x:T.x,y:T.y,slackX:0,slackY:0};if(this.props.bounds){const{x:M,y:N}=b;b.x+=this.state.slackX,b.y+=this.state.slackY;const[A,W]=(0,i.getBoundPosition)(this,b.x,b.y);b.x=A,b.y=W,b.slackX=this.state.slackX+(M-b.x),b.slackY=this.state.slackY+(N-b.y),T.x=b.x,T.y=b.y,T.deltaX=b.x-this.state.x,T.deltaY=b.y-this.state.y}if(this.props.onDrag(D,T)===!1)return!1;this.setState(b)}),C(this,"onDragStop",(D,m)=>{if(!this.state.dragging||this.props.onStop(D,(0,i.createDraggableData)(this,m))===!1)return!1;(0,l.default)("Draggable: onDragStop: %j",m);const b={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:M,y:N}=this.props.position;b.x=M,b.y=N}this.setState(b)}),this.state={dragging:!1,dragged:!1,x:w.position?w.position.x:w.defaultPosition.x,y:w.position?w.position.y:w.defaultPosition.y,prevPropsPosition:{...w.position},slackX:0,slackY:0,isElementSVG:!1},w.position&&!(w.onDrag||w.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var w,D;return(w=(D=this.props)===null||D===void 0||(D=D.nodeRef)===null||D===void 0?void 0:D.current)!==null&&w!==void 0?w:r.default.findDOMNode(this)}render(){const{axis:w,bounds:D,children:m,defaultPosition:T,defaultClassName:b,defaultClassNameDragging:E,defaultClassNameDragged:M,position:N,positionOffset:A,scale:W,...Y}=this.props;let L={},$=null;const I=!!!N||this.state.dragging,O=N||T,j={x:(0,i.canDragX)(this)&&I?this.state.x:O.x,y:(0,i.canDragY)(this)&&I?this.state.y:O.y};this.state.isElementSVG?$=(0,s.createSVGTransform)(j,A):L=(0,s.createCSSTransform)(j,A);const P=(0,o.default)(m.props.className||"",b,{[E]:this.state.dragging,[M]:this.state.dragged});return t.createElement(c.default,h({},Y,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(m),{className:P,style:{...m.props.style,...L},transform:$}))}}e.default=y,C(y,"displayName","Draggable"),C(y,"propTypes",{...c.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),C(y,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(xo)),xo}var va;function uu(){if(va)return un.exports;va=1;const{default:e,DraggableCore:t}=Mb();return un.exports=e,un.exports.default=e,un.exports.DraggableCore=t,un.exports}var tr={},ya;function kb(){if(ya)return tr;ya=1,tr.__esModule=!0,tr.cloneElement=a;var e=t(R);function t(c){return c&&c.__esModule?c:{default:c}}function n(c,l){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(c);l&&(u=u.filter(function(v){return Object.getOwnPropertyDescriptor(c,v).enumerable})),d.push.apply(d,u)}return d}function r(c){for(var l=1;l<arguments.length;l++){var d=arguments[l]!=null?arguments[l]:{};l%2?n(Object(d),!0).forEach(function(u){o(c,u,d[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):n(Object(d)).forEach(function(u){Object.defineProperty(c,u,Object.getOwnPropertyDescriptor(d,u))})}return c}function o(c,l,d){return l=s(l),l in c?Object.defineProperty(c,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[l]=d,c}function s(c){var l=i(c,"string");return typeof l=="symbol"?l:String(l)}function i(c,l){if(typeof c!="object"||c===null)return c;var d=c[Symbol.toPrimitive];if(d!==void 0){var u=d.call(c,l);if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(c)}function a(c,l){return l.style&&c.props.style&&(l.style=r(r({},c.props.style),l.style)),l.className&&c.props.className&&(l.className=c.props.className+" "+l.className),e.default.cloneElement(c,l)}return tr}var fn={},ba;function du(){if(ba)return fn;ba=1,fn.__esModule=!0,fn.resizableProps=void 0;var e=t(Xr());uu();function t(r){return r&&r.__esModule?r:{default:r}}var n={axis:e.default.oneOf(["both","x","y","none"]),className:e.default.string,children:e.default.element.isRequired,draggableOpts:e.default.shape({allowAnyClick:e.default.bool,cancel:e.default.string,children:e.default.node,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:e.default.node,grid:e.default.arrayOf(e.default.number),handle:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number}),height:function(){for(var o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];var a=s[0];if(a.axis==="both"||a.axis==="y"){var c;return(c=e.default.number).isRequired.apply(c,s)}return e.default.number.apply(e.default,s)},handle:e.default.oneOfType([e.default.node,e.default.func]),handleSize:e.default.arrayOf(e.default.number),lockAspectRatio:e.default.bool,maxConstraints:e.default.arrayOf(e.default.number),minConstraints:e.default.arrayOf(e.default.number),onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,resizeHandles:e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:e.default.number,width:function(){for(var o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];var a=s[0];if(a.axis==="both"||a.axis==="x"){var c;return(c=e.default.number).isRequired.apply(c,s)}return e.default.number.apply(e.default,s)}};return fn.resizableProps=n,fn}var wa;function fu(){if(wa)return ln;wa=1,ln.__esModule=!0,ln.default=void 0;var e=i(R),t=uu(),n=kb(),r=du(),o=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function s(y){if(typeof WeakMap!="function")return null;var f=new WeakMap,w=new WeakMap;return(s=function(m){return m?w:f})(y)}function i(y,f){if(y&&y.__esModule)return y;if(y===null||typeof y!="object"&&typeof y!="function")return{default:y};var w=s(f);if(w&&w.has(y))return w.get(y);var D={},m=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var T in y)if(T!=="default"&&Object.prototype.hasOwnProperty.call(y,T)){var b=m?Object.getOwnPropertyDescriptor(y,T):null;b&&(b.get||b.set)?Object.defineProperty(D,T,b):D[T]=y[T]}return D.default=y,w&&w.set(y,D),D}function a(){return a=Object.assign?Object.assign.bind():function(y){for(var f=1;f<arguments.length;f++){var w=arguments[f];for(var D in w)Object.prototype.hasOwnProperty.call(w,D)&&(y[D]=w[D])}return y},a.apply(this,arguments)}function c(y,f){if(y==null)return{};var w={},D=Object.keys(y),m,T;for(T=0;T<D.length;T++)m=D[T],!(f.indexOf(m)>=0)&&(w[m]=y[m]);return w}function l(y,f){var w=Object.keys(y);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(y);f&&(D=D.filter(function(m){return Object.getOwnPropertyDescriptor(y,m).enumerable})),w.push.apply(w,D)}return w}function d(y){for(var f=1;f<arguments.length;f++){var w=arguments[f]!=null?arguments[f]:{};f%2?l(Object(w),!0).forEach(function(D){u(y,D,w[D])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(w)):l(Object(w)).forEach(function(D){Object.defineProperty(y,D,Object.getOwnPropertyDescriptor(w,D))})}return y}function u(y,f,w){return f=v(f),f in y?Object.defineProperty(y,f,{value:w,enumerable:!0,configurable:!0,writable:!0}):y[f]=w,y}function v(y){var f=h(y,"string");return typeof f=="symbol"?f:String(f)}function h(y,f){if(typeof y!="object"||y===null)return y;var w=y[Symbol.toPrimitive];if(w!==void 0){var D=w.call(y,f);if(typeof D!="object")return D;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(y)}function C(y,f){y.prototype=Object.create(f.prototype),y.prototype.constructor=y,g(y,f)}function g(y,f){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(D,m){return D.__proto__=m,D},g(y,f)}var x=function(y){C(f,y);function f(){for(var D,m=arguments.length,T=new Array(m),b=0;b<m;b++)T[b]=arguments[b];return D=y.call.apply(y,[this].concat(T))||this,D.handleRefs={},D.lastHandleRect=null,D.slack=null,D}var w=f.prototype;return w.componentWillUnmount=function(){this.resetData()},w.resetData=function(){this.lastHandleRect=this.slack=null},w.runConstraints=function(m,T){var b=this.props,E=b.minConstraints,M=b.maxConstraints,N=b.lockAspectRatio;if(!E&&!M&&!N)return[m,T];if(N){var A=this.props.width/this.props.height,W=m-this.props.width,Y=T-this.props.height;Math.abs(W)>Math.abs(Y*A)?T=m/A:m=T*A}var L=m,$=T,k=this.slack||[0,0],I=k[0],O=k[1];return m+=I,T+=O,E&&(m=Math.max(E[0],m),T=Math.max(E[1],T)),M&&(m=Math.min(M[0],m),T=Math.min(M[1],T)),this.slack=[I+(L-m),O+($-T)],[m,T]},w.resizeHandler=function(m,T){var b=this;return function(E,M){var N=M.node,A=M.deltaX,W=M.deltaY;m==="onResizeStart"&&b.resetData();var Y=(b.props.axis==="both"||b.props.axis==="x")&&T!=="n"&&T!=="s",L=(b.props.axis==="both"||b.props.axis==="y")&&T!=="e"&&T!=="w";if(!(!Y&&!L)){var $=T[0],k=T[T.length-1],I=N.getBoundingClientRect();if(b.lastHandleRect!=null){if(k==="w"){var O=I.left-b.lastHandleRect.left;A+=O}if($==="n"){var j=I.top-b.lastHandleRect.top;W+=j}}b.lastHandleRect=I,k==="w"&&(A=-A),$==="n"&&(W=-W);var P=b.props.width+(Y?A/b.props.transformScale:0),F=b.props.height+(L?W/b.props.transformScale:0),U=b.runConstraints(P,F);P=U[0],F=U[1];var V=P!==b.props.width||F!==b.props.height,H=typeof b.props[m]=="function"?b.props[m]:null,X=m==="onResize"&&!V;H&&!X&&(E.persist==null||E.persist(),H(E,{node:N,size:{width:P,height:F},handle:T})),m==="onResizeStop"&&b.resetData()}}},w.renderResizeHandle=function(m,T){var b=this.props.handle;if(!b)return e.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+m,ref:T});if(typeof b=="function")return b(m,T);var E=typeof b.type=="string",M=d({ref:T},E?{}:{handleAxis:m});return e.cloneElement(b,M)},w.render=function(){var m=this,T=this.props,b=T.children,E=T.className,M=T.draggableOpts;T.width,T.height,T.handle,T.handleSize,T.lockAspectRatio,T.axis,T.minConstraints,T.maxConstraints,T.onResize,T.onResizeStop,T.onResizeStart;var N=T.resizeHandles;T.transformScale;var A=c(T,o);return(0,n.cloneElement)(b,d(d({},A),{},{className:(E?E+" ":"")+"react-resizable",children:[].concat(b.props.children,N.map(function(W){var Y,L=(Y=m.handleRefs[W])!=null?Y:m.handleRefs[W]=e.createRef();return e.createElement(t.DraggableCore,a({},M,{nodeRef:L,key:"resizableHandle-"+W,onStop:m.resizeHandler("onResizeStop",W),onStart:m.resizeHandler("onResizeStart",W),onDrag:m.resizeHandler("onResize",W)}),m.renderResizeHandle(W,L))}))}))},f}(e.Component);return ln.default=x,x.propTypes=r.resizableProps,x.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},ln}var pn={},xa;function Ob(){if(xa)return pn;xa=1,pn.__esModule=!0,pn.default=void 0;var e=a(R),t=s(Xr()),n=s(fu()),r=du(),o=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function s(f){return f&&f.__esModule?f:{default:f}}function i(f){if(typeof WeakMap!="function")return null;var w=new WeakMap,D=new WeakMap;return(i=function(T){return T?D:w})(f)}function a(f,w){if(f&&f.__esModule)return f;if(f===null||typeof f!="object"&&typeof f!="function")return{default:f};var D=i(w);if(D&&D.has(f))return D.get(f);var m={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in f)if(b!=="default"&&Object.prototype.hasOwnProperty.call(f,b)){var E=T?Object.getOwnPropertyDescriptor(f,b):null;E&&(E.get||E.set)?Object.defineProperty(m,b,E):m[b]=f[b]}return m.default=f,D&&D.set(f,m),m}function c(){return c=Object.assign?Object.assign.bind():function(f){for(var w=1;w<arguments.length;w++){var D=arguments[w];for(var m in D)Object.prototype.hasOwnProperty.call(D,m)&&(f[m]=D[m])}return f},c.apply(this,arguments)}function l(f,w){var D=Object.keys(f);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(f);w&&(m=m.filter(function(T){return Object.getOwnPropertyDescriptor(f,T).enumerable})),D.push.apply(D,m)}return D}function d(f){for(var w=1;w<arguments.length;w++){var D=arguments[w]!=null?arguments[w]:{};w%2?l(Object(D),!0).forEach(function(m){u(f,m,D[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(D)):l(Object(D)).forEach(function(m){Object.defineProperty(f,m,Object.getOwnPropertyDescriptor(D,m))})}return f}function u(f,w,D){return w=v(w),w in f?Object.defineProperty(f,w,{value:D,enumerable:!0,configurable:!0,writable:!0}):f[w]=D,f}function v(f){var w=h(f,"string");return typeof w=="symbol"?w:String(w)}function h(f,w){if(typeof f!="object"||f===null)return f;var D=f[Symbol.toPrimitive];if(D!==void 0){var m=D.call(f,w);if(typeof m!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(f)}function C(f,w){if(f==null)return{};var D={},m=Object.keys(f),T,b;for(b=0;b<m.length;b++)T=m[b],!(w.indexOf(T)>=0)&&(D[T]=f[T]);return D}function g(f,w){f.prototype=Object.create(w.prototype),f.prototype.constructor=f,x(f,w)}function x(f,w){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(m,T){return m.__proto__=T,m},x(f,w)}var y=function(f){g(w,f);function w(){for(var m,T=arguments.length,b=new Array(T),E=0;E<T;E++)b[E]=arguments[E];return m=f.call.apply(f,[this].concat(b))||this,m.state={width:m.props.width,height:m.props.height,propsWidth:m.props.width,propsHeight:m.props.height},m.onResize=function(M,N){var A=N.size;m.props.onResize?(M.persist==null||M.persist(),m.setState(A,function(){return m.props.onResize&&m.props.onResize(M,N)})):m.setState(A)},m}w.getDerivedStateFromProps=function(T,b){return b.propsWidth!==T.width||b.propsHeight!==T.height?{width:T.width,height:T.height,propsWidth:T.width,propsHeight:T.height}:null};var D=w.prototype;return D.render=function(){var T=this.props,b=T.handle,E=T.handleSize;T.onResize;var M=T.onResizeStart,N=T.onResizeStop,A=T.draggableOpts,W=T.minConstraints,Y=T.maxConstraints,L=T.lockAspectRatio,$=T.axis;T.width,T.height;var k=T.resizeHandles,I=T.style,O=T.transformScale,j=C(T,o);return e.createElement(n.default,{axis:$,draggableOpts:A,handle:b,handleSize:E,height:this.state.height,lockAspectRatio:L,maxConstraints:Y,minConstraints:W,onResizeStart:M,onResize:this.onResize,onResizeStop:N,resizeHandles:k,transformScale:O,width:this.state.width},e.createElement("div",c({},j,{style:d(d({},I),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},w}(e.Component);return pn.default=y,y.propTypes=d(d({},r.resizableProps),{},{children:t.default.element}),pn}var Sa;function Pb(){return Sa||(Sa=1,cn.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},cn.exports.Resizable=fu().default,cn.exports.ResizableBox=Ob().default),cn.exports}var pu=Pb();function _b(e,t,n){const r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}const Ab=e=>{let{transform:t,draggingNodeRect:n,windowRect:r}=e;return!n||!r?t:_b(t,n,r)},Nb=({bookingInit:e,slotData:t,heightStyle:n})=>p.jsx(op,{modifiers:[Ab],dropAnimation:{duration:2e3,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},className:"Draggable dragging",children:p.jsx(Go,{booking:e,slotData:t,heightStyle:n})}),Go=({booking:e,slotData:t,onClick:n,heightStyle:r,customClasses:o,ref:s})=>{const{day:i,hour:a}=t,[c,l]=R.useState(!1),d=xe(Bs(N=>N.bookingViewType)),{updateIsDragging:u,isDragging:v}=en(N=>N),h=ou(N=>N.startAt),{attributes:C,listeners:g,setNodeRef:x,isDragging:y,transform:f}=us({id:e.id,data:{type:"booking-slots",booking:e,slotData:t}}),w=f?{transform:`translate3d(${f.x}px, ${f.y}px, 0)`}:void 0;kn({onDragStart:()=>u(!0),onDragAbort:()=>D(),onDragCancel:()=>D(),onDragEnd:()=>D()});const D=R.useCallback(()=>{u(!1)},[]),m=N=>N<="11:30",T=R.useMemo(()=>({cursor:v?"ns-resize":"pointer",width:d===re.DAY?"99%":"100%"}),[v,d]),b=(N,A)=>{const W=Q.dateAndHourDateToString(new Date(N.finishAt));return Q.isTodayDate(A)&&m(W)?{backgroundColor:"#000000c0"}:{backgroundColor:"#000456c0"}},[E,M]=R.useState(e);return R.useEffect(()=>{if(h.length){const N=Q.bookingTimeRange(e,h);M({...N})}},[h]),R.useImperativeHandle(s,()=>({changeCurrentCardResize:()=>l(N=>!N)})),y?p.jsx(Nb,{bookingInit:E,slotData:t,heightStyle:r}):p.jsx("div",{ref:x,className:se("cardContent_render",c&&"cardContent_render_dragging",o),style:{...w,...T},...g,...C,children:p.jsx("div",{className:"relative w-full h-full",style:b(e,new Date(i.split(":")[1])),onPointerUp:n,children:p.jsxs("div",{className:se("flex flex-col h-full text-white pl-2 lg:pl-2 justify-start items-start"),children:[p.jsx("p",{style:{height:"1.8rem",alignContent:"center"},children:`${Q.dateAndHourDateToString(e.startAt)} - ${Q.dateAndHourDateToString(e.finishAt)}`}),p.jsx("span",{className:"flex flex-row items-center justify-center"})]})},`${i}-${a}`)},e.id)};function Ib(e,t){const n=e>new Date(t.startAt),r=e<new Date(t.finishAt);return n&&r}const jb={calculateOverlappingBookings:(e,t)=>{const n=t.filter(o=>{const s=new Date(o.startAt).getDate(),i=e.startAt.getDate();return s===i&&o.id!==e.id});let r=0;for(const o of n)Ib(e.startAt,o)&&r++;return r}},Us=({bookingInit:e,slotData:t,heightStyle:n,topHeightIncrement:r,onClick:o,customClasses:s,bookingViewType:i,resizableParam:a,events:c,open:l=!0,lastCard:d,half:u,cardContentRef:v,cardsQuantity:h,cardIndex:C,ref:g})=>{var $;const x=en(k=>k.updateIsDragging),{bookings:y,onCardResizeEnd:f}=Qe(),[w,D]=R.useState(""),m=R.useRef(null),T=i===re.DAY?{width:"99%"}:{width:"100%"},b=(k,I)=>{var O;D("show-handle"),x(!0),a!=null&&a.onResizeStart&&a.onResizeStart(k,I),(O=m.current)==null||O.changeCurrentCardResize()},E=(k,I)=>{var O;(O=m.current)==null||O.changeCurrentCardResize(),D(""),x(!1),f(e),a!=null&&a.onResizeStop&&a.onResizeStop(k,I)},M=R.useMemo(()=>jb.calculateOverlappingBookings(e,y),[e,y]),N=R.useMemo(()=>se(a==null?void 0:a.customClass,w,u&&M>0&&"",u?"":M>0&&"inner_cards_parent",d&&M&&u&&"inner_cards_parent_last_card_disable",d&&M&&"inner_cards_parent_last_card",d&&M===2&&"inner_cards_parent_last_card_layer_2",M===1&&!u&&"inner_cards_parent_1_layer",M===2&&"inner_cards_parent_2_layer",u&&M===3&&"inner_cards_parent_resizable_layer_3_half inner_cards_parent_3_layer_half",M===3&&"inner_cards_parent_resizable_layer_3 inner_cards_parent_3_layer"),[a,w,u,M,d]),A=k=>k===0?"8rem":"4rem",W=R.useMemo(()=>u&&C===0&&h===3||u&&C===1&&h===3?A(C):M===2?"0.8rem":d&&M===1?"0.2rem":d&&M?"1rem":M===1?"0.4rem":0,[u,d,M,C,h]),Y=R.useMemo(()=>u&&C===0&&h===3&&!M?"0rem":u&&C===0&&h===3?"0.4rem":u&&C===1&&h===3?"5rem":d&&h===3?"9rem":d?"6.5rem":0,[u,d,C,M,h]),L=R.useMemo(()=>u&&h===3&&(u&&C===0||u&&C===1)||u&&d&&h===3||u&&d?{inset:`${r}rem ${W} ${n}rem ${Y}`}:u&&h===3||u?{inset:`${r}rem 6.5rem ${n}rem ${W}`}:{inset:`${r||0}rem ${W} ${n}rem`},[u,M,n,r,C,h,W,Y]);if(R.useEffect(()=>()=>{c!=null&&c.onUnmount&&(c==null||c.onUnmount())},[]),R.useImperativeHandle(v,()=>({changeCurrentCardResize:()=>{var k;(k=m.current)==null||k.changeCurrentCardResize()}})),!l&&!e.finishAt)return null;if(($=a==null?void 0:a.state)!=null&&$.height){const{state:k,onResize:I}=a;return p.jsx(pu.Resizable,{className:se(N),height:k==null?void 0:k.height,width:k==null?void 0:k.width,onResize:I,onResizeStart:b,onResizeStop:E,resizeHandles:["s","n"],draggableOpts:{grid:[35,35]},handleSize:[20,20],maxConstraints:[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],transformScale:1,children:p.jsx("div",{className:"card_content_core",style:{...L},children:p.jsx(Go,{ref:m,heightStyle:n,booking:e,slotData:t,onClick:o,layerCount:M,half:u},e.id)})})}return p.jsx("div",{ref:g,className:"card_content_core",style:{...T,...L},children:p.jsx(Go,{heightStyle:n,customClasses:s,booking:e,slotData:t,onClick:o})})},Lb=e=>{const t=R.use(nu);if(!t)throw new Error("useConfig must be used within a ConfigContext");return Rr(t,e)};function Ca(e,[t,n]){return Math.min(n,Math.max(t,e))}function $b(e){const t=S.useRef({value:e,previous:e});return S.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Fb=[" ","Enter","ArrowUp","ArrowDown"],zb=[" ","Enter"],Fn="Select",[Jr,Qr,Wb]=Rs(Fn),[tn,Rx]=mt(Fn,[Wb,vt]),eo=vt(),[Bb,yt]=tn(Fn),[Hb,Vb]=tn(Fn),hu=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:l,name:d,autoComplete:u,disabled:v,required:h,form:C}=e,g=eo(t),[x,y]=S.useState(null),[f,w]=S.useState(null),[D,m]=S.useState(!1),T=Ms(l),[b=!1,E]=Tt({prop:r,defaultProp:o,onChange:s}),[M,N]=Tt({prop:i,defaultProp:a,onChange:c}),A=S.useRef(null),W=x?C||!!x.closest("form"):!0,[Y,L]=S.useState(new Set),$=Array.from(Y).map(k=>k.props.value).join(";");return p.jsx($r,{...g,children:p.jsxs(Bb,{required:h,scope:t,trigger:x,onTriggerChange:y,valueNode:f,onValueNodeChange:w,valueNodeHasChildren:D,onValueNodeHasChildrenChange:m,contentId:ft(),value:M,onValueChange:N,open:b,onOpenChange:E,dir:T,triggerPointerDownPosRef:A,disabled:v,children:[p.jsx(Jr.Provider,{scope:t,children:p.jsx(Hb,{scope:e.__scopeSelect,onNativeOptionAdd:S.useCallback(k=>{L(I=>new Set(I).add(k))},[]),onNativeOptionRemove:S.useCallback(k=>{L(I=>{const O=new Set(I);return O.delete(k),O})},[]),children:n})}),W?p.jsxs(Lu,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:u,value:M,onChange:k=>N(k.target.value),disabled:v,form:C,children:[M===void 0?p.jsx("option",{value:""}):null,Array.from(Y)]},$):null]})})};hu.displayName=Fn;var gu="SelectTrigger",mu=S.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=eo(n),i=yt(gu,n),a=i.disabled||r,c=ue(t,i.onTriggerChange),l=Qr(n),d=S.useRef("touch"),[u,v,h]=$u(g=>{const x=l().filter(w=>!w.disabled),y=x.find(w=>w.value===i.value),f=Fu(x,g,y);f!==void 0&&i.onValueChange(f.value)}),C=g=>{a||(i.onOpenChange(!0),h()),g&&(i.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return p.jsx(Nn,{asChild:!0,...s,children:p.jsx(ie.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":ju(i.value)?"":void 0,...o,ref:c,onClick:ee(o.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&C(g)}),onPointerDown:ee(o.onPointerDown,g=>{d.current=g.pointerType;const x=g.target;x.hasPointerCapture(g.pointerId)&&x.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(C(g),g.preventDefault())}),onKeyDown:ee(o.onKeyDown,g=>{const x=u.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&v(g.key),!(x&&g.key===" ")&&Fb.includes(g.key)&&(C(),g.preventDefault())})})})});mu.displayName=gu;var vu="SelectValue",yu=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=yt(vu,n),{onValueNodeHasChildrenChange:l}=c,d=s!==void 0,u=ue(t,c.onValueNodeChange);return Se(()=>{l(d)},[l,d]),p.jsx(ie.span,{...a,ref:u,style:{pointerEvents:"none"},children:ju(c.value)?p.jsx(p.Fragment,{children:i}):s})});yu.displayName=vu;var Ub="SelectIcon",bu=S.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return p.jsx(ie.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});bu.displayName=Ub;var Yb="SelectPortal",wu=e=>p.jsx(In,{asChild:!0,...e});wu.displayName=Yb;var Rt="SelectContent",xu=S.forwardRef((e,t)=>{const n=yt(Rt,e.__scopeSelect),[r,o]=S.useState();if(Se(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?Tr.createPortal(p.jsx(Su,{scope:e.__scopeSelect,children:p.jsx(Jr.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),s):null}return p.jsx(Cu,{...e,ref:t})});xu.displayName=Rt;var Le=10,[Su,bt]=tn(Rt),Kb="SelectContentImpl",Gb=Ct("SelectContent.RemoveScroll"),Cu=S.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:c,align:l,alignOffset:d,arrowPadding:u,collisionBoundary:v,collisionPadding:h,sticky:C,hideWhenDetached:g,avoidCollisions:x,...y}=e,f=yt(Rt,n),[w,D]=S.useState(null),[m,T]=S.useState(null),b=ue(t,z=>D(z)),[E,M]=S.useState(null),[N,A]=S.useState(null),W=Qr(n),[Y,L]=S.useState(!1),$=S.useRef(!1);S.useEffect(()=>{if(w)return Os(w)},[w]),ks();const k=S.useCallback(z=>{const[G,...q]=W().map(_=>_.ref.current),[B]=q.slice(-1),te=document.activeElement;for(const _ of z)if(_===te||(_==null||_.scrollIntoView({block:"nearest"}),_===G&&m&&(m.scrollTop=0),_===B&&m&&(m.scrollTop=m.scrollHeight),_==null||_.focus(),document.activeElement!==te))return},[W,m]),I=S.useCallback(()=>k([E,w]),[k,E,w]);S.useEffect(()=>{Y&&I()},[Y,I]);const{onOpenChange:O,triggerPointerDownPosRef:j}=f;S.useEffect(()=>{if(w){let z={x:0,y:0};const G=B=>{var te,_;z={x:Math.abs(Math.round(B.pageX)-(((te=j.current)==null?void 0:te.x)??0)),y:Math.abs(Math.round(B.pageY)-(((_=j.current)==null?void 0:_.y)??0))}},q=B=>{z.x<=10&&z.y<=10?B.preventDefault():w.contains(B.target)||O(!1),document.removeEventListener("pointermove",G),j.current=null};return j.current!==null&&(document.addEventListener("pointermove",G),document.addEventListener("pointerup",q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",G),document.removeEventListener("pointerup",q,{capture:!0})}}},[w,O,j]),S.useEffect(()=>{const z=()=>O(!1);return window.addEventListener("blur",z),window.addEventListener("resize",z),()=>{window.removeEventListener("blur",z),window.removeEventListener("resize",z)}},[O]);const[P,F]=$u(z=>{const G=W().filter(te=>!te.disabled),q=G.find(te=>te.ref.current===document.activeElement),B=Fu(G,z,q);B&&setTimeout(()=>B.ref.current.focus())}),U=S.useCallback((z,G,q)=>{const B=!$.current&&!q;(f.value!==void 0&&f.value===G||B)&&(M(z),B&&($.current=!0))},[f.value]),V=S.useCallback(()=>w==null?void 0:w.focus(),[w]),H=S.useCallback((z,G,q)=>{const B=!$.current&&!q;(f.value!==void 0&&f.value===G||B)&&A(z)},[f.value]),X=r==="popper"?qo:Eu,K=X===qo?{side:a,sideOffset:c,align:l,alignOffset:d,arrowPadding:u,collisionBoundary:v,collisionPadding:h,sticky:C,hideWhenDetached:g,avoidCollisions:x}:{};return p.jsx(Su,{scope:n,content:w,viewport:m,onViewportChange:T,itemRefCallback:U,selectedItem:E,onItemLeave:V,itemTextRefCallback:H,focusSelectedItem:I,selectedItemText:N,position:r,isPositioned:Y,searchRef:P,children:p.jsx(Kr,{as:Gb,allowPinchZoom:!0,children:p.jsx(Vr,{asChild:!0,trapped:f.open,onMountAutoFocus:z=>{z.preventDefault()},onUnmountAutoFocus:ee(o,z=>{var G;(G=f.trigger)==null||G.focus({preventScroll:!0}),z.preventDefault()}),children:p.jsx(_n,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:z=>z.preventDefault(),onDismiss:()=>f.onOpenChange(!1),children:p.jsx(X,{role:"listbox",id:f.contentId,"data-state":f.open?"open":"closed",dir:f.dir,onContextMenu:z=>z.preventDefault(),...y,...K,onPlaced:()=>L(!0),ref:b,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:ee(y.onKeyDown,z=>{const G=z.ctrlKey||z.altKey||z.metaKey;if(z.key==="Tab"&&z.preventDefault(),!G&&z.key.length===1&&F(z.key),["ArrowUp","ArrowDown","Home","End"].includes(z.key)){let B=W().filter(te=>!te.disabled).map(te=>te.ref.current);if(["ArrowUp","End"].includes(z.key)&&(B=B.slice().reverse()),["ArrowUp","ArrowDown"].includes(z.key)){const te=z.target,_=B.indexOf(te);B=B.slice(_+1)}setTimeout(()=>k(B)),z.preventDefault()}})})})})})})});Cu.displayName=Kb;var qb="SelectItemAlignedPosition",Eu=S.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=yt(Rt,n),i=bt(Rt,n),[a,c]=S.useState(null),[l,d]=S.useState(null),u=ue(t,b=>d(b)),v=Qr(n),h=S.useRef(!1),C=S.useRef(!0),{viewport:g,selectedItem:x,selectedItemText:y,focusSelectedItem:f}=i,w=S.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&g&&x&&y){const b=s.trigger.getBoundingClientRect(),E=l.getBoundingClientRect(),M=s.valueNode.getBoundingClientRect(),N=y.getBoundingClientRect();if(s.dir!=="rtl"){const te=N.left-E.left,_=M.left-te,ne=b.left-_,ae=b.width+ne,fe=Math.max(ae,E.width),ve=window.innerWidth-Le,Ne=Ca(_,[Le,Math.max(Le,ve-fe)]);a.style.minWidth=ae+"px",a.style.left=Ne+"px"}else{const te=E.right-N.right,_=window.innerWidth-M.right-te,ne=window.innerWidth-b.right-_,ae=b.width+ne,fe=Math.max(ae,E.width),ve=window.innerWidth-Le,Ne=Ca(_,[Le,Math.max(Le,ve-fe)]);a.style.minWidth=ae+"px",a.style.right=Ne+"px"}const A=v(),W=window.innerHeight-Le*2,Y=g.scrollHeight,L=window.getComputedStyle(l),$=parseInt(L.borderTopWidth,10),k=parseInt(L.paddingTop,10),I=parseInt(L.borderBottomWidth,10),O=parseInt(L.paddingBottom,10),j=$+k+Y+O+I,P=Math.min(x.offsetHeight*5,j),F=window.getComputedStyle(g),U=parseInt(F.paddingTop,10),V=parseInt(F.paddingBottom,10),H=b.top+b.height/2-Le,X=W-H,K=x.offsetHeight/2,z=x.offsetTop+K,G=$+k+z,q=j-G;if(G<=H){const te=A.length>0&&x===A[A.length-1].ref.current;a.style.bottom="0px";const _=l.clientHeight-g.offsetTop-g.offsetHeight,ne=Math.max(X,K+(te?V:0)+_+I),ae=G+ne;a.style.height=ae+"px"}else{const te=A.length>0&&x===A[0].ref.current;a.style.top="0px";const ne=Math.max(H,$+g.offsetTop+(te?U:0)+K)+q;a.style.height=ne+"px",g.scrollTop=G-H+g.offsetTop}a.style.margin=`${Le}px 0`,a.style.minHeight=P+"px",a.style.maxHeight=W+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[v,s.trigger,s.valueNode,a,l,g,x,y,s.dir,r]);Se(()=>w(),[w]);const[D,m]=S.useState();Se(()=>{l&&m(window.getComputedStyle(l).zIndex)},[l]);const T=S.useCallback(b=>{b&&C.current===!0&&(w(),f==null||f(),C.current=!1)},[w,f]);return p.jsx(Zb,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:T,children:p.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:D},children:p.jsx(ie.div,{...o,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Eu.displayName=qb;var Xb="SelectPopperPosition",qo=S.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Le,...s}=e,i=eo(n);return p.jsx(Fr,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});qo.displayName=Xb;var[Zb,Ys]=tn(Rt,{}),Xo="SelectViewport",Du=S.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=bt(Xo,n),i=Ys(Xo,n),a=ue(t,s.onViewportChange),c=S.useRef(0);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),p.jsx(Jr.Slot,{scope:n,children:p.jsx(ie.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:ee(o.onScroll,l=>{const d=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:v}=i;if(v!=null&&v.current&&u){const h=Math.abs(c.current-d.scrollTop);if(h>0){const C=window.innerHeight-Le*2,g=parseFloat(u.style.minHeight),x=parseFloat(u.style.height),y=Math.max(g,x);if(y<C){const f=y+h,w=Math.min(C,f),D=f-w;u.style.height=w+"px",u.style.bottom==="0px"&&(d.scrollTop=D>0?D:0,u.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});Du.displayName=Xo;var Tu="SelectGroup",[Jb,Qb]=tn(Tu),ew=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=ft();return p.jsx(Jb,{scope:n,id:o,children:p.jsx(ie.div,{role:"group","aria-labelledby":o,...r,ref:t})})});ew.displayName=Tu;var Ru="SelectLabel",tw=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Qb(Ru,n);return p.jsx(ie.div,{id:o.id,...r,ref:t})});tw.displayName=Ru;var Dr="SelectItem",[nw,Mu]=tn(Dr),ku=S.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=yt(Dr,n),c=bt(Dr,n),l=a.value===r,[d,u]=S.useState(s??""),[v,h]=S.useState(!1),C=ue(t,f=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,f,r,o)}),g=ft(),x=S.useRef("touch"),y=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.jsx(nw,{scope:n,value:r,disabled:o,textId:g,isSelected:l,onItemTextChange:S.useCallback(f=>{u(w=>w||((f==null?void 0:f.textContent)??"").trim())},[]),children:p.jsx(Jr.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:p.jsx(ie.div,{role:"option","aria-labelledby":g,"data-highlighted":v?"":void 0,"aria-selected":l&&v,"data-state":l?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:C,onFocus:ee(i.onFocus,()=>h(!0)),onBlur:ee(i.onBlur,()=>h(!1)),onClick:ee(i.onClick,()=>{x.current!=="mouse"&&y()}),onPointerUp:ee(i.onPointerUp,()=>{x.current==="mouse"&&y()}),onPointerDown:ee(i.onPointerDown,f=>{x.current=f.pointerType}),onPointerMove:ee(i.onPointerMove,f=>{var w;x.current=f.pointerType,o?(w=c.onItemLeave)==null||w.call(c):x.current==="mouse"&&f.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ee(i.onPointerLeave,f=>{var w;f.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:ee(i.onKeyDown,f=>{var D;((D=c.searchRef)==null?void 0:D.current)!==""&&f.key===" "||(zb.includes(f.key)&&y(),f.key===" "&&f.preventDefault())})})})})});ku.displayName=Dr;var gn="SelectItemText",Ou=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=yt(gn,n),a=bt(gn,n),c=Mu(gn,n),l=Vb(gn,n),[d,u]=S.useState(null),v=ue(t,y=>u(y),c.onItemTextChange,y=>{var f;return(f=a.itemTextRefCallback)==null?void 0:f.call(a,y,c.value,c.disabled)}),h=d==null?void 0:d.textContent,C=S.useMemo(()=>p.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:g,onNativeOptionRemove:x}=l;return Se(()=>(g(C),()=>x(C)),[g,x,C]),p.jsxs(p.Fragment,{children:[p.jsx(ie.span,{id:c.textId,...s,ref:v}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Tr.createPortal(s.children,i.valueNode):null]})});Ou.displayName=gn;var Pu="SelectItemIndicator",_u=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Mu(Pu,n).isSelected?p.jsx(ie.span,{"aria-hidden":!0,...r,ref:t}):null});_u.displayName=Pu;var Zo="SelectScrollUpButton",Au=S.forwardRef((e,t)=>{const n=bt(Zo,e.__scopeSelect),r=Ys(Zo,e.__scopeSelect),[o,s]=S.useState(!1),i=ue(t,r.onScrollButtonChange);return Se(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollTop>0;s(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?p.jsx(Iu,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});Au.displayName=Zo;var Jo="SelectScrollDownButton",Nu=S.forwardRef((e,t)=>{const n=bt(Jo,e.__scopeSelect),r=Ys(Jo,e.__scopeSelect),[o,s]=S.useState(!1),i=ue(t,r.onScrollButtonChange);return Se(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<l;s(d)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?p.jsx(Iu,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});Nu.displayName=Jo;var Iu=S.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=bt("SelectScrollButton",n),i=S.useRef(null),a=Qr(n),c=S.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return S.useEffect(()=>()=>c(),[c]),Se(()=>{var d;const l=a().find(u=>u.ref.current===document.activeElement);(d=l==null?void 0:l.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),p.jsx(ie.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:ee(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:ee(o.onPointerMove,()=>{var l;(l=s.onItemLeave)==null||l.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:ee(o.onPointerLeave,()=>{c()})})}),rw="SelectSeparator",ow=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return p.jsx(ie.div,{"aria-hidden":!0,...r,ref:t})});ow.displayName=rw;var Qo="SelectArrow",sw=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=eo(n),s=yt(Qo,n),i=bt(Qo,n);return s.open&&i.position==="popper"?p.jsx(zr,{...o,...r,ref:t}):null});sw.displayName=Qo;function ju(e){return e===""||e===void 0}var Lu=S.forwardRef((e,t)=>{const{value:n,...r}=e,o=S.useRef(null),s=ue(t,o),i=$b(n);return S.useEffect(()=>{const a=o.current,c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==n&&d){const u=new Event("change",{bubbles:!0});d.call(a,n),a.dispatchEvent(u)}},[i,n]),p.jsx(Ss,{asChild:!0,children:p.jsx("select",{...r,ref:s,defaultValue:n})})});Lu.displayName="BubbleSelect";function $u(e){const t=Ae(e),n=S.useRef(""),r=S.useRef(0),o=S.useCallback(i=>{const a=n.current+i;t(a),function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(a)},[t]),s=S.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function Fu(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=iw(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function iw(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var aw=hu,cw=mu,lw=yu,uw=bu,dw=wu,fw=xu,pw=Du,hw=ku,gw=Ou,mw=_u,vw=Au,yw=Nu;function bw({...e}){return p.jsx(aw,{"data-slot":"select",...e})}function ww({...e}){return p.jsx(lw,{"data-slot":"select-value",...e})}function xw({className:e,size:t="default",children:n,...r}){return p.jsxs(cw,{"data-slot":"select-trigger","data-size":t,className:se("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,p.jsx(uw,{asChild:!0,children:p.jsx(lc,{className:"size-4 opacity-50"})})]})}function Sw({className:e,children:t,position:n="popper",...r}){return p.jsx(dw,{children:p.jsxs(fw,{"data-slot":"select-content",className:se("bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[p.jsx(Ew,{}),p.jsx(pw,{className:se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),p.jsx(Dw,{})]})})}function Cw({className:e,children:t,...n}){return p.jsxs(hw,{"data-slot":"select-item",className:se("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[p.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:p.jsx(mw,{children:p.jsx(cc,{className:"size-4"})})}),p.jsx(gw,{children:t})]})}function Ew({className:e,...t}){return p.jsx(vw,{"data-slot":"select-scroll-up-button",className:se("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(xp,{className:"size-4"})})}function Dw({className:e,...t}){return p.jsx(yw,{"data-slot":"select-scroll-down-button",className:se("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(lc,{className:"size-4"})})}const Tw=15,nr=600,Rw=15,Mo=-Math.abs(1.98),Ks=({booking:e,onAddTime:t,onAddStartTime:n,onSubTime:r,starter:o=!1})=>{const[s,i]=R.useState({height:nr,width:nr}),[a,c]=R.useState(0),l=(T,b)=>{const E=Q.timeDiffInSeconds(T,b),M=Math.ceil(E/Tw);return-Math.abs((M-1)*2)},[d,u]=R.useState(o?l(e.finishAt,e.startAt):Mo),v=T=>T===-Math.abs(0)||T===0,h=()=>Q.timeDiffInSeconds(e.finishAt,e.startAt)===Rw,C=async T=>{if(T.includes("n")){const b=y(e.startAt,"add");if(h())return;c(E=>E+2),n&&n(b)}else{const b=x(e.finishAt,"add");u(E=>v(E)?Mo:E-2),t&&t(b)}},g=async T=>{if(T.includes("n")){const E=y(e.startAt,"remove");c(M=>M-2),n&&n(E);return}const b=x(e.finishAt,"remove");h()||(u(E=>E+2),r&&r(b))},x=(T,b)=>{const E=new Date(T),M=E.getMinutes();return b==="add"&&E.setMinutes(M+15),b==="remove"&&E.setMinutes(M-15),E},y=(T,b)=>{const E=new Date(T),M=E.getMinutes();return b==="add"&&E.setMinutes(M+15),b==="remove"&&E.setMinutes(M-15),E};return{state:s,setState:i,resetState:()=>{i({height:nr,width:nr})},resetHeightStyle:()=>{u(Mo)},heightStyle:d,topHeightIncrement:a,onResize:(T,{size:b,handle:E})=>{switch(T.stopPropagation(),T.preventDefault(),E){case"se":case"s":{i(M=>(Number(M.height)<Number(b.height)&&C(["s","se"]),Number(M.height)>Number(b.height)&&g(["s","se"]),{...M,height:b.height}));break}case"n":{i(M=>Math.abs(Number(b.height-Number(M.height)))<10?{...M,height:b.height}:(+(M.height<Number(b.height))&&g(["n"]),+(M.height>Number(b.height))&&C(["n"]),{...M,height:b.height}));break}}},updateHeightStyle:(T,b)=>{u(l(T,b))}}},Mw=R.forwardRef(({isDragging:e,slotData:t,events:{onClick:n,renderPreviewCard:r,resetPrevView:o}},s)=>{const[i,a]=R.useState(!1),c=ts(k=>k.startAt),l=xe(k=>k.bookingViewType),{systemColor:d,isTimeInfoVisible:u}=Lb(k=>k),[v,h]=R.useState(!1),[C,g]=R.useState(Q.addMinutesToHour(t.time,15)),[x,y]=R.useState(!1),f=R.useRef(null),w=x?{backgroundColor:"white",border:"none"}:{},D=R.useMemo(()=>({id:"dragging_booking_preview",startAt:Q.convertStringTimeToDateFormat(c),finishAt:Q.convertStringTimeToDateFormat(C)}),[C,c]),m=()=>{h(!0),y(!0),r()},T=()=>{h(!1),n(C),$()};R.useEffect(()=>{var k;v&&((k=f.current)==null||k.changeCurrentCardResize())},[v]);const{state:b,resetState:E,resetHeightStyle:M,heightStyle:N,onResize:A,updateHeightStyle:W}=Ks({booking:D,onAddTime:k=>{g(Q.dateTimeAsString(k))},onSubTime:k=>{g(Q.dateTimeAsString(k))}}),Y=()=>{$()},L=R.useCallback(()=>{g(Q.addMinutesToHour(t.time,15))},[t.time]),$=R.useCallback(()=>{y(!1),E(),L(),M(),o()},[L,M,o,E]);if(R.useEffect(()=>{if(!C||!c)return;const k=Q.convertStringTimeToDateFormat(C),I=Q.convertStringTimeToDateFormat(c);Number.isNaN(k)||Number.isNaN(I)||!(k instanceof Date)||!(I instanceof Date)||W(k,I)},[C,c]),R.useEffect(()=>()=>{$()},[]),R.useImperativeHandle(s,()=>({show:()=>a(!0),hide:()=>a(!1),changeIsOpen:k=>a(k)}),[]),!!i)return p.jsx("div",{style:{...w,border:u&&!e?`1.5px solid ${d}`:"none"},className:se("timeInfo_core",w),children:p.jsx(pu.Resizable,{className:"slot-resizable",height:b.height,width:b.width,onResizeStart:m,onResizeStop:T,onResize:A,resizeHandles:["se"],draggableOpts:{grid:[35,35]},handleSize:[30,30],maxConstraints:[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],transformScale:1,children:x?p.jsx("div",{className:"timeInfo_core_dragging",children:p.jsx(Us,{bookingInit:D,bookingViewType:l,slotData:{day:new Date().toISOString(),hour:"09:00"},heightStyle:N,cardContentRef:f,resizableParam:{state:b,onResize:A,customClass:"show-handle"},events:{onUnmount:Y}})}):p.jsx("div",{className:"timeInfo_core_timeParent",children:!e&&p.jsx("span",{className:"timeInfo_core_timeParent_time",style:{color:d,display:u?"initial":"none"},children:t.time})})})})}),rr=({slotData:e,slotPosition:t,disabledCss:n,events:r,actualTimerIndicatorChildren:o,children:s,ref:i})=>{const{isDragging:a,updateIsDragging:c}=en(_=>_),{emptySlotNodes:l,setSelectedNode:d,resetSelectedNode:u}=Mt(),{onModalClose:v,onSlotClick:h}=Qe(),{startAt:C,finishAt:g,updateDate:x,updateStartAt:y,updateFinishAtWithOffset:f,resetForm:w}=ts(_=>_),D=xe(_=>_.bookingViewType),[m,T]=R.useState(!1),[b,E]=R.useState(!1),M=R.useRef(null),N=R.useRef(null),A=R.useRef(null),W=()=>A.current,Y=()=>{var _;(_=A.current)==null||_.isModalOpen()},L=()=>{var _;(_=W())==null||_.showCreationModal()},$=()=>{var _;(_=N.current)==null||_.show()},k=()=>{var _;(_=N.current)==null||_.hide()},I=_=>{var ne;(ne=N.current)==null||ne.changeIsOpen(_)},O=R.useMemo(()=>({id:"dragging_booking_preview",startAt:Q.convertStringTimeToDateFormat(C),finishAt:Q.convertStringTimeToDateFormat(g)}),[g,C]),{updateHeightStyle:j,heightStyle:P}=Ks({booking:O}),F=R.useCallback(()=>{var ne,ae,fe;if(!s||typeof s!="object")return;if("props"in s&&s.props&&typeof s.props=="object"&&"bookings"in s.props&&Array.isArray(s.props.bookings)&&(ne=s.props)!=null&&ne.bookings.length&&"slotData"in s.props&&typeof((ae=s==null?void 0:s.props)==null?void 0:ae.slotData)=="object"&&(fe=s==null?void 0:s.props)!=null&&fe.slotData&&"hour"in s.props.slotData&&typeof s.props.slotData.hour=="string"&&"blockTimeString"in s.props&&typeof s.props.blockTimeString=="string"){const ve=s.props.blockTimeString,Ne=s.props.slotData.hour;if(s.props.bookings.findIndex(je=>{const _t=Number(Ne.split(":")[0]),At=Number(ve),Wn=je.startAt.getHours(),Bn=je.startAt.getMinutes();return _t===Wn&&At===Bn})!==-1)return}if(a||Y()||m)return;r.onMouseEnterEvent()===t&&$()},[t,a,m,s,r]),U=()=>{w(),c(!1),u()},V=_=>{var fe;U();const ne=dr(e),ae=l==null?void 0:l.get(ne);ae&&ae.closeEvent(),v==null||v(),_==null||_.stopPropagation(),_==null||_.preventDefault(),(fe=W())==null||fe.closeModal()},H=_=>{_||V(),T(_),I(_)},X=R.useCallback(_=>{if(U(),a&&!_)return;c(!1);const{time:ne,key:ae}=e,fe=dr({key:ae,time:ne}),ve=l==null?void 0:l.get(fe);d(fe),ve&&ve.showEvent(ne),x(ae);const Ie=f(_||ne,_?0:15);h({slotData:e,finishTime:Ie}),L()},[e,l,a,d,h,x,y,c,f]),K=()=>{a||Y()||k()},z=n.length||b?n:"hovering_slotTrigger_core",G=R.useCallback(()=>{const{time:_,key:ne}=e;c(!0),E(!0),x(ne),y(_),f(_)},[f,e,x,c,y]),q=()=>{L()},B=R.useCallback(()=>{E(!1)},[]),te=()=>{k(),L(),T(!0)};return R.useEffect(()=>{a?document.body.style.cursor="ns-resize":document.body.style.cursor="default"},[a]),R.useEffect(()=>{if(!g||!C)return;const _=Q.convertStringTimeToDateFormat(g),ne=Q.convertStringTimeToDateFormat(C);Number.isNaN(_)||Number.isNaN(ne)||!(_ instanceof Date)||!(ne instanceof Date)||j(_,ne)},[g,C]),R.useEffect(()=>{if(!m){k();return}M!=null&&M.current&&M.current.scrollIntoView({behavior:"smooth",block:"center"})},[m]),R.useEffect(()=>{s||k(),b&&$()},[s,b]),R.useEffect(()=>{b&&$()},[b]),R.useImperativeHandle(i,()=>({showEvent:_=>{y(_),te()},closeEvent:()=>{var _;(_=W())==null||_.closeModal(),T(!1),k(),B()},onOpenCloseChange:_=>{I(_),T(_),B()}})),p.jsxs(p.Fragment,{children:[p.jsxs("div",{ref:e.ref,style:{borderBottom:t==="fourth"?"1px solid #8080807a":"",...e.style},className:se("slotTrigger_core",D===re.DAY&&"slotTrigger_core_day",z),onMouseOver:F,onMouseLeave:K,onFocus:()=>{},children:[p.jsx(Mw,{ref:N,isDragging:a,slotData:e,events:{onClick:X,openOptions:q,renderPreviewCard:G,resetPrevView:B}}),o,m&&p.jsx(Us,{ref:M,bookingInit:O,bookingViewType:D,slotData:{day:new Date().toISOString(),hour:"09:00"},heightStyle:P}),s]},e.key),p.jsx(tu,{ref:A,onClose:V,onOpenChange:H,buttonTrigger:p.jsx("div",{},e.key),side:D===re.DAY?"top":"right"})]})};var Gs="Popover",[zu,Mx]=mt(Gs,[vt]),zn=vt(),[kw,wt]=zu(Gs),Wu=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=zn(t),c=S.useRef(null),[l,d]=S.useState(!1),[u=!1,v]=Tt({prop:r,defaultProp:o,onChange:s});return p.jsx($r,{...a,children:p.jsx(kw,{scope:t,contentId:ft(),triggerRef:c,open:u,onOpenChange:v,onOpenToggle:S.useCallback(()=>v(h=>!h),[v]),hasCustomAnchor:l,onCustomAnchorAdd:S.useCallback(()=>d(!0),[]),onCustomAnchorRemove:S.useCallback(()=>d(!1),[]),modal:i,children:n})})};Wu.displayName=Gs;var Bu="PopoverAnchor",Hu=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=wt(Bu,n),s=zn(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return S.useEffect(()=>(i(),()=>a()),[i,a]),p.jsx(Nn,{...s,...r,ref:t})});Hu.displayName=Bu;var Vu="PopoverTrigger",Uu=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=wt(Vu,n),s=zn(n),i=ue(t,o.triggerRef),a=p.jsx(ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Xu(o.open),...r,ref:i,onClick:ee(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:p.jsx(Nn,{asChild:!0,...s,children:a})});Uu.displayName=Vu;var qs="PopoverPortal",[Ow,Pw]=zu(qs,{forceMount:void 0}),Yu=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=wt(qs,t);return p.jsx(Ow,{scope:t,forceMount:n,children:p.jsx(nt,{present:n||s.open,children:p.jsx(In,{asChild:!0,container:o,children:r})})})};Yu.displayName=qs;var Kt="PopoverContent",Ku=S.forwardRef((e,t)=>{const n=Pw(Kt,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=wt(Kt,e.__scopePopover);return p.jsx(nt,{present:r||s.open,children:s.modal?p.jsx(Aw,{...o,ref:t}):p.jsx(Nw,{...o,ref:t})})});Ku.displayName=Kt;var _w=Ct("PopoverContent.RemoveScroll"),Aw=S.forwardRef((e,t)=>{const n=wt(Kt,e.__scopePopover),r=S.useRef(null),o=ue(t,r),s=S.useRef(!1);return S.useEffect(()=>{const i=r.current;if(i)return Os(i)},[]),p.jsx(Kr,{as:_w,allowPinchZoom:!0,children:p.jsx(Gu,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:ee(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,l=a.button===2||c;s.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:ee(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Nw=S.forwardRef((e,t)=>{const n=wt(Kt,e.__scopePopover),r=S.useRef(!1),o=S.useRef(!1);return p.jsx(Gu,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var c,l;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((l=n.triggerRef.current)==null?void 0:l.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Gu=S.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:d,...u}=e,v=wt(Kt,n),h=zn(n);return ks(),p.jsx(Vr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:p.jsx(_n,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>v.onOpenChange(!1),children:p.jsx(Fr,{"data-state":Xu(v.open),role:"dialog",id:v.contentId,...h,...u,ref:t,style:{...u.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),qu="PopoverClose",Iw=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=wt(qu,n);return p.jsx(ie.button,{type:"button",...r,ref:t,onClick:ee(e.onClick,()=>o.onOpenChange(!1))})});Iw.displayName=qu;var jw="PopoverArrow",Lw=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=zn(n);return p.jsx(zr,{...o,...r,ref:t})});Lw.displayName=jw;function Xu(e){return e?"open":"closed"}var $w=Wu,Fw=Hu,zw=Uu,Ww=Yu,Bw=Ku;function Hw({...e}){return p.jsx($w,{"data-slot":"popover",...e})}function Vw({...e}){return p.jsx(zw,{"data-slot":"popover-trigger",...e})}function Uw({className:e,align:t="center",sideOffset:n=4,...r}){return p.jsx(Ww,{children:p.jsx(Bw,{"data-slot":"popover-content",align:t,sideOffset:n,className:se("bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}function Yw({...e}){return p.jsx(Fw,{"data-slot":"popover-anchor",...e})}var Kw="Toggle",Zu=S.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...s}=e,[i=!1,a]=Tt({prop:n,onChange:o,defaultProp:r});return p.jsx(ie.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:t,onClick:ee(e.onClick,()=>{e.disabled||a(!i)})})});Zu.displayName=Kw;var Gw=Zu;const qw=fs("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function Xw({className:e,variant:t,size:n,...r}){return p.jsx(Gw,{"data-slot":"toggle",className:se(qw({variant:t,size:n,className:e})),...r})}const Zw=()=>{const[e,t]=R.useState(!1);return p.jsx(Ds,{children:p.jsxs(tl,{children:[p.jsx(nl,{asChild:!0,children:p.jsx("div",{children:p.jsx(Xw,{className:"group size-10 p-0 hover:bg-indigo-50 hover:text-indigo-500 data-[state=on]:bg-indigo-50 data-[state=on]:text-indigo-500","aria-label":"Bookmark this",variant:e?"default":"outline",pressed:e,onPressedChange:t,children:p.jsx(lp,{size:16,strokeWidth:2,"aria-hidden":"true"})})})}),p.jsx(rl,{className:"border border-input bg-popover px-2 py-1 text-xs text-muted-foreground",children:p.jsx("p",{children:e?"Remove bookmark":"Bookmark this"})})]})})},Jw=({options:e,onChange:t})=>p.jsxs(bw,{onValueChange:n=>t(n),defaultValue:e[1].text,children:[p.jsx(xw,{className:"w-[180px]",children:p.jsx(ww,{placeholder:"view"})}),p.jsx(Sw,{children:e.map(n=>p.jsx(Cw,{value:n.text,children:n.text},n.text))})]}),Qw=[{text:"teste1",onClick:()=>console.log("teste1")},{text:"teste2",onClick:()=>console.log("teste2")}],ex=5,tx=0,nx=({side:e,xAxis:t,yAxis:n,updatePosition:r,children:o})=>{const{attributes:s,listeners:i,setNodeRef:a,transform:c,setActivatorNodeRef:l}=us({id:"booking-info-id",data:{type:"booking-info-options"}}),d=en(v=>v.updateIsDragging),u={transform:`translate3d(${t+((c==null?void 0:c.x)||0)}px, ${n+((c==null?void 0:c.y)||0)}px, 0)`};return kn({onDragStart(){d(!0)},onDragEnd(v){v.active.id&&r(c)}}),p.jsx(Uw,{ref:a,updatePositionStrategy:"optimized",side:e,align:"start",sticky:"always",sideOffset:ex,alignOffset:tx,style:{...u,width:"25rem"},children:p.jsxs("div",{className:"grid gap-3",children:[p.jsx("input",{type:"text",style:{position:"absolute",opacity:0,height:0,width:0}}),p.jsxs("div",{className:"flex justify-end gap-1",children:[p.jsx("div",{ref:l,className:"w-full cursor-move",...s,...i}),p.jsx(Zw,{}),p.jsx(Et,{type:"button",variant:"outline",size:"icon",children:p.jsx(Pp,{className:"h-3 w-3"})}),p.jsx(Et,{type:"button",variant:"outline",size:"icon",onClick:()=>{},children:p.jsx(Ip,{className:"h-3 w-3"})}),p.jsx(Jw,{options:Qw,onChange:()=>{}})]}),o]})})},Ea={xAxis:0,yAxis:0},Ju=({isEditingOpen:e,side:t,booking:n,onOpenChange:r,children:o})=>{const[s,i]=R.useState({...Ea}),a=en(h=>h.updateIsDragging),c=R.useMemo(()=>`${Q.dateAndHourDateToString(n.startAt)} - ${Q.dateAndHourDateToString(n.finishAt)}`,[n.startAt,n.finishAt]),l=R.useMemo(()=>{const h=new Date(n.startAt),C=h.getDate(),g=h.getDay(),x=Wt[h.getMonth()];return p.jsx("span",{children:`${Ed[g]}, ${C} ${x}`})},[n.startAt]),d=()=>({backgroundColor:""}),u=h=>{h||console.info("No transform info to show "),i({xAxis:s.xAxis+((h==null?void 0:h.x)||0),yAxis:s.yAxis+((h==null?void 0:h.y)||0)})};kn({onDragStart(h){const C=h.active.data.current,g=h.active.id,x=C.type==="booking-info-options";g&&x&&a(!0)}});const v=h=>{h===!1&&i({...Ea}),r(h)};return p.jsxs(Hw,{open:e,onOpenChange:v,defaultOpen:!1,children:[p.jsx(Yw,{style:{width:"100%"},children:p.jsx(Vw,{asChild:!0,children:o})}),p.jsx(ls,{children:p.jsx(nx,{side:t,xAxis:s.xAxis,yAxis:s.yAxis,updatePosition:u,children:p.jsxs("div",{className:"bookingCard_content",children:[p.jsx("span",{style:d(),className:"flex h-4 w-4 translate-y-0 rounded-sm"}),p.jsx("div",{className:"space-y-1",children:p.jsxs("p",{className:"text-sm text-muted-foreground",children:[l," | ",c]})})]})})})]})};Ju.displayName="BookingInfoOptions";const Da=({booking:e,slotData:t,cardsQuantity:n=1,cardIndex:r=0,lastCard:o=!1,half:s=!1,ref:i})=>{const{bookingViewType:a}=xe(),[c,l]=R.useState({...e}),[d,u]=R.useState(!1),v=R.useRef("left"),h=()=>{const m=t.day.split(":")[0].trim();if(a===re.DAY)v.current="top";else switch(m){case"Mon":case"Sun":v.current="right";break;default:v.current="left";break}u(!0)},C=async m=>{try{l(T=>({...T,finishAt:m}))}catch(T){console.log(T)}},g=async m=>{l(T=>({...T,startAt:m}))},x=async m=>{try{l(T=>({...T,finishAt:m}))}catch(T){console.log(T)}},{state:y,heightStyle:f,topHeightIncrement:w,onResize:D}=Ks({booking:c,onAddTime:C,onAddStartTime:g,onSubTime:x,starter:!0});return R.useImperativeHandle(i,()=>({bookingId:e.id}),[e.id]),p.jsx(Ju,{booking:c,onOpenChange:u,side:a===re.DAY?"top":"left",isEditingOpen:d,children:p.jsx(Us,{resizableParam:{state:y,onResize:D,resizeHandle:["s","n"]},customClasses:"Draggable",bookingInit:c,bookingViewType:a,slotData:t,topHeightIncrement:w,heightStyle:f,onClick:h,half:s,lastCard:o,cardsQuantity:n,cardIndex:r})})},or=({bookings:e,blockTimeString:t,slotData:n})=>{if(!e||!(n!=null&&n.day)&&!(n!=null&&n.hour))return null;const r=e.filter(o=>Q.dateAndHourDateToString(new Date(o.startAt)).split(":")[1]===t);if(!(!r||!(r!=null&&r.length)))return r.length===1?p.jsx(Da,{booking:r[0],slotData:n}):p.jsx(p.Fragment,{children:r.map((o,s)=>p.jsx(Da,{booking:o,half:!0,slotData:n,lastCard:r.length-1===s,cardsQuantity:r.length,cardIndex:s},o.id))})};var rx="Separator",Ta="horizontal",ox=["horizontal","vertical"],Qu=S.forwardRef((e,t)=>{const{decorative:n,orientation:r=Ta,...o}=e,s=sx(r)?r:Ta,a=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return p.jsx(ie.div,{"data-orientation":s,...a,...o,ref:t})});Qu.displayName=rx;function sx(e){return ox.includes(e)}var ix=Qu;function ax({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return p.jsx(ix,{"data-slot":"separator-root",decorative:n,orientation:t,className:se("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}const cx=fs("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function lx({className:e,variant:t,...n}){return p.jsx("div",{className:se(cx({variant:t}),e),...n})}const ux=({dateToRender:e,isFirstDay:t})=>p.jsx("div",{style:{left:t?"3px":"10px"},className:"first_day_slot",children:p.jsx("span",{children:p.jsx(lx,{children:e})})});class dx{constructor(){xt(this,"positionBasedOnSeconds",t=>{const[,n]=t.split(":");if(!t.length)return-3;const r=Number(n);return this.normalizingMinutes(r)});xt(this,"normalizingMinutes",t=>t>=0&&t<=15?t*2:t>15&&t<30?(t-15)*2:t>=30&&t<=59?t-30:-3);xt(this,"isInitialMinute",t=>t>=0&&t<=8);xt(this,"isSameHour",(t,n)=>n.split(":")[0]===t)}}class fx{constructor(){xt(this,"is15MinLess",t=>{const n=new Date,[r,o]=t.split(":"),s=new Date(n.getFullYear(),n.getMonth(),n.getDate(),Number(r),Number(o),0),i=new Date(n),a=Q.roundMinutes(n.getMinutes());i.setHours(n.getHours(),a,0,0);const c=Q.minuteDifference(s,i);return c>30||c<-30});xt(this,"normalizeDateNow",t=>{const n=t.getHours(),r=Q.roundMinutes(t.getMinutes());return`${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`})}}const sr=({color:e="#000",isFirstDay:t,slotData:n})=>{const{timesRendered:r,bookingViewType:o}=xe(),[s,i]=R.useState(""),[a,c]=R.useState(!1),[l,d]=R.useState(!1),u=R.useMemo(()=>{const f=new Date,w=new Date(n.key);return w.getDay()===f.getDay()&&w.getDate()===f.getDate()},[n.key]),v=f=>{i(f)},h=()=>{c(!0)},C=()=>{c(!1)},g=R.useMemo(()=>new dx().positionBasedOnSeconds(s),[n.time,s,r]),x=R.useMemo(()=>t?"101%":o===re.DAY?"102%":"104%",[t,o]),y=R.useMemo(()=>u?{top:`${g-2}px`,left:t?"-1px":"-3px",width:t?"101%":"104%"}:{top:`${g-1}px`,left:t?"-1px":"0px",width:x},[u,t,x,g]);if(R.useEffect(()=>{const f=n.time,w=new fx,D=()=>{const T=new Date,b=w.normalizeDateNow(T),E=Q.dateAndHourDateToString(T);s!==E&&v(E),d(b===f)};let m;return w.is15MinLess(f)||(m=setInterval(()=>D(),1e3)),()=>clearInterval(m)},[n.time,s]),!!l)return p.jsxs("div",{style:{...y},className:se("timeIndicator_today",u&&x,u&&"timeIndicator_today_circle"),onMouseEnter:h,onMouseOut:C,onBlur:()=>{},children:[p.jsx(ax,{className:"focus-effect",style:{height:u?"4px":"2px",backgroundColor:e}}),a&&p.jsx(ux,{isFirstDay:t,dateToRender:s})]})},Ra=({bookings:e,first:t,second:n,third:r,fourth:o,disabledCss:s,firstDay:i,dayHour:a})=>{const{setEmptySlotNode:c,emptySlotNodes:l}=Mt(),d=R.useCallback((u,v)=>{if(!u)return;const h=dr(v);l.get(h)||c(u,v)},[c,l]);return p.jsxs(p.Fragment,{children:[p.jsx(rr,{ref:u=>d(u,{key:t.key,time:t.time}),slotData:t,disabledCss:s,events:{onMouseEnterEvent:()=>"first"},slotPosition:"first",actualTimerIndicatorChildren:p.jsx(sr,{isFirstDay:i,slotData:t}),children:p.jsx(or,{bookings:e,blockTimeString:"00",slotData:a})}),p.jsx(rr,{ref:u=>d(u,{key:n.key,time:n.time}),slotData:n,disabledCss:s,events:{onMouseEnterEvent:()=>"second"},slotPosition:"second",actualTimerIndicatorChildren:p.jsx(sr,{isFirstDay:i,slotData:n}),children:p.jsx(or,{bookings:e,blockTimeString:"15",slotData:a})}),p.jsx(rr,{ref:u=>d(u,{key:r.key,time:r.time}),slotData:r,disabledCss:s,events:{onMouseEnterEvent:()=>"third"},slotPosition:"third",actualTimerIndicatorChildren:p.jsx(sr,{isFirstDay:i,slotData:r}),children:p.jsx(or,{bookings:e,blockTimeString:"30",slotData:a})}),p.jsx(rr,{ref:u=>d(u,{key:o.key,time:o.time}),slotData:o,disabledCss:s,events:{onMouseEnterEvent:()=>"fourth"},slotPosition:"fourth",actualTimerIndicatorChildren:p.jsx(sr,{isFirstDay:i,slotData:o}),children:p.jsx(or,{bookings:e,blockTimeString:"45",slotData:a})})]})},px=R.memo(({firstDay:e,booking:t,dayHour:n,disabledCss:r,firstBlockTimeData:o,secondBlockTimeData:s,thirdBlockTimeData:i,fourthBlockTimeData:a})=>{const{day:c,hour:l}=n,d=R.useMemo(()=>t.filter(u=>{const v=Q.dateAndHourDateToString(u.startAt),h=new Date(u.startAt).getDate(),C=new Date(c).getDate(),g=l.split(":")[0];return v.split(":")[0]===g&&h===C}),[t,n]);return d.length?p.jsx(Ra,{dayHour:n,bookings:d,first:o,second:s,third:i,fourth:a,disabledCss:r,firstDay:e}):p.jsx(Ra,{first:o,second:s,third:i,fourth:a,disabledCss:r,firstDay:e})}),hx=({dayHour:e,lunchTimeBlock:t,firstDay:n,bookingBulk:r})=>{const o=R.useRef(""),s=ou(T=>T.updateStartAt),{bookingViewType:i}=xe(Bs(T=>({bookingViewType:T.bookingViewType}))),a=R.useMemo(()=>Q.addMinuteToHour(e.hour,15),[e.hour]),c=R.useMemo(()=>Q.addMinuteToHour(e.hour,30),[e.hour]),l=R.useMemo(()=>Q.addMinuteToHour(e.hour,45),[e.hour]),{isOver:d,setNodeRef:u}=Hn({id:`${Q.newDateKey(e.day,e.hour)}`,data:{accepts:["booking-slots"]}}),{isOver:v,setNodeRef:h}=Hn({id:`${Q.newDateKey(e.day,a)}`,data:{accepts:["booking-slots"]}}),{isOver:C,setNodeRef:g}=Hn({id:`${Q.newDateKey(e.day,c)}`,data:{accepts:["booking-slots"]}}),{isOver:x,setNodeRef:y}=Hn({id:`${Q.newDateKey(e.day,l)}`,data:{accepts:["booking-slots"]}});R.useEffect(()=>{d&&s(`${Q.newDateKey(e.day,e.hour)}`),v&&s(`${Q.newDateKey(e.day,a)}`),C&&s(`${Q.newDateKey(e.day,c)}`),x&&s(`${Q.newDateKey(e.day,l)}`)},[d,v,C,x]);const f=R.useMemo(()=>({ref:u,style:{backgroundColor:d?"#0066ff":""},key:Q.newDateKey(e.day,e.hour),time:e.hour}),[e.day,d,e.hour,u]),w=R.useMemo(()=>({ref:h,style:{backgroundColor:v?"#0066ff":""},key:Q.newDateKey(e.day,a),time:a}),[e.day,v,a,h]),D=R.useMemo(()=>({ref:g,style:{backgroundColor:C?"#0066ff":""},key:Q.newDateKey(e.day,c),time:c}),[e.day,C,c,g]),m=R.useMemo(()=>({ref:y,style:{backgroundColor:x?"#0066ff":""},key:Q.newDateKey(e.day,l),time:l}),[e.day,l,x,y]);return p.jsx("td",{className:se("slot",i===re.WEEK&&"slotWeek"),children:p.jsx(px,{booking:r,dayHour:e,firstDay:n,disabledCss:o.current,firstBlockTimeData:f,secondBlockTimeData:w,thirdBlockTimeData:D,fourthBlockTimeData:m})},`${e.day}-${e.hour}-slot`)};function gx({className:e,...t}){return p.jsx("div",{"data-slot":"table-container",className:"relative w-full z-10 overflow-hidden",children:p.jsx("table",{"data-slot":"table",className:se("w-full caption-bottom text-sm",e),...t})})}function mx({className:e,...t}){return p.jsx("td",{"data-slot":"table-cell",className:se("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}const vx=({hour:e,ref:t})=>{const n="Set lunch interval",r="Remove lunch interval",o="Hour options",s=R.useRef(null),i="border-solid hover:border-b-2 hover:border-b-purple-600 border-b-white",a=()=>{s!=null&&s.current&&s.current.setAttribute("class",se("activateVisibilityTime",i))};return R.useImperativeHandle(t,()=>({setActivateHour:a})),p.jsxs(Fs,{children:[p.jsx(zs,{children:p.jsx("span",{ref:s,className:se(i),children:e})}),p.jsxs(Ws,{children:[p.jsx(Wy,{children:o}),p.jsx(By,{}),p.jsx(Gi,{children:n}),p.jsx(Gi,{children:r})]})]})},yx=()=>{const{hours:e,daysOfWeek:t,bookingViewType:n,bookingBulkData:r,addTimesRendered:o}=xe(Bs(g=>({addTimesRendered:g.addTimesRendered,bookingBulkData:g.bookingBulkData,bookingViewType:g.bookingViewType,daysOfWeek:g.daysOfWeek,hours:g.hours}))),{selectedNode:s,emptySlotNodes:i}=Mt(),{finishAt:a,updateFinishAtWithOffset:c}=ts(g=>g),[l]=R.useState({startAt:"12:00",finishAt:"12:30"}),d=R.useCallback((g,x)=>{g&&o(g,x)},[o]),u=R.useMemo(()=>n===re.DAY?{maxWidth:"5rem",padding:0,minWidth:"4rem"}:{},[n]),v=R.useMemo(()=>({borderLeft:"none",backgroundColor:"white"}),[]),h=R.useMemo(()=>s.split(";")[1],[s]);return R.useEffect(()=>{if(s){const g=i.get(s);g==null||g.showEvent(h)}},[s,i]),R.useEffect(()=>{h===a&&c(h)},[s,a]),R.useMemo(()=>{const g=x=>x===0;return p.jsx("div",{className:se("calendarCore",n===re.WEEK&&"calendarCore_max"),children:p.jsx(gx,{children:p.jsx("tbody",{children:e.map(x=>p.jsxs("tr",{children:[p.jsx(mx,{style:{...v,...u,padding:0,position:"relative"},className:"calendarCore_cell",children:p.jsx("div",{className:"calendarCore_actions",children:p.jsx(vx,{ref:y=>d(y,x),hour:x})})},`${x}-hour`),t.map((y,f)=>p.jsx(hx,{dayHour:{day:String(y),hour:x},lunchTimeBlock:l,firstDay:g(f),bookingBulk:r.booking},`${y}-${x}-slot-content`))]},`${x}-content`))})})})},[u,e,v,r.booking,d,n,t,t.length])},bx=({isLoading:e})=>{const{bookings:t}=Qe(),n={distance:5},{setBookingBulkData:r,optimisticCardUpdate:o}=xe(),{onCardDropCallback:s}=Qe(),i=Ud(ci(ec,{activationConstraint:n}),ci(tc,{activationConstraint:n})),{bookingViewType:a,daysOfWeek:c}=xe(),l=R.useCallback(h=>{const{active:C}=h;C.id},[]),d=async(h,C,g)=>{try{const{startAt:x,finishAt:y}=Q.bookingTimeRange(h,C);o(h,x,y,g),await s(h,C,g,{id:h.id,startAt:x,finishAt:y})}catch(x){console.warn(x)}},u=h=>{const{over:C,active:g}=h;if(C&&g){const x=C.data.current,y=g.data.current;y&&x&&x.accepts.includes(y.type)&&y.booking.id&&C.id&&d(y.booking,String(C.id),y.slotData)}},v={position:"absolute",top:"50%",left:"50%",transform:"translate('-50%', '-50%')",zIndex:100};return R.useEffect(()=>{r({user:gb,booking:t})},[t,r]),p.jsxs("div",{className:"calendarHolder",children:[p.jsx(lb,{...ru,children:p.jsxs("div",{className:"calendarHolder_parent",children:[p.jsx(tb,{}),p.jsxs("div",{className:"calendarHolder_parent_content",children:[p.jsx(Gy,{daysOfWeek:c,bookingViewType:a}),p.jsx(nb,{children:p.jsx(ls,{onDragEnd:u,onDragStart:l,sensors:i,children:p.jsx(yx,{})})})]})]})}),p.jsx(hb,{color:"#000000aa",loading:e,cssOverride:v,size:15,"aria-label":"Loading Spinner","data-testid":"GridLoader"})]})},wx=({viewModes:e,createBookingModal:t,onChangeViewType:n,onCardDropCallback:r,onCardResizeEnd:o,onDayChange:s,onHeaderDayClick:i,onTodayClick:a,onSlotClick:c,onModalClose:l,bookings:d,isTimeInfoVisible:u,systemColor:v,ref:h})=>{const[C,g]=R.useState(!1),x=R.useRef(null),{setBookingViewType:y,setWeekAndViewType:f,setTodayDayAndViewType:w,bookingViewType:D,setTodayDay:m,todayWeek:T}=xe(),{setSelectedNode:b}=Mt(A=>A),E=A=>{var W;console.log("hour24Format",A),(W=x==null?void 0:x.current)==null||W.updateFinishAt(A)},M=A=>{m(new Date(A))},N=A=>{T(new Date(A))};return R.useImperativeHandle(h,()=>({updateViewType:A=>y(A),updateWeekAndViewType:A=>f(A),updateTodayDayAndViewType:A=>w(A),updateSelectedNode:A=>{setTimeout(()=>{b(A)},10)},updateFinishAt:A=>E(A),changeLoading:A=>g(A),goToDay:A=>M(A),goToWeek:A=>N(A)})),R.useEffect(()=>{n(D)},[D]),p.jsx(ab,{isTimeInfoVisible:u,systemColor:v,children:p.jsx(rb,{...ka,children:p.jsx(ob,{createBookingModal:t,viewModes:e,onHeaderDayClick:i,onTodayClick:a,onCardDropCallback:r,onCardResizeEnd:o,onDayChange:s,onSlotClick:c,onModalClose:l,bookings:d,children:p.jsx(_d,{ref:x,...Po,children:p.jsx(bx,{isLoading:C})})})})})},xx=e=>{const t=R.useRef(null),n=()=>{if(!(t!=null&&t.current))throw new cd};return{getCalendar:()=>p.jsx(wx,{ref:t,...e}),updateViewType:v=>{var h;n(),(h=t.current)==null||h.updateViewType(v)},updateWeekAndViewType:v=>{var h;return n(),(h=t.current)==null?void 0:h.updateWeekAndViewType(v)},updateTodayDayAndViewType:v=>{var h;return n(),(h=t.current)==null?void 0:h.updateTodayDayAndViewType(v)},updateSelectedNode:v=>{var h;n(),(h=t.current)==null||h.updateSelectedNode(v)},updateFinishAt:v=>{var h;n(),(h=t.current)==null||h.updateFinishAt(v)},changeLoading:v=>{var h;n(),(h=t.current)==null||h.changeLoading(v)},goToDay:v=>{var h;n(),(h=t.current)==null||h.goToDay(v)},goToWeek:v=>{var h;n(),(h=t.current)==null||h.goToWeek(v)}}};exports.useCalendarInstance=xx;
|
|
170
|
+
`,b.getElementsByTagName("head")[0].appendChild(E)),b.body&&m(b.body,"react-draggable-transparent-selection")}function D(b){if(b)try{if(b.body&&T(b.body,"react-draggable-transparent-selection"),b.selection)b.selection.empty();else{const E=(b.defaultView||window).getSelection();E&&E.type!=="Caret"&&E.removeAllRanges()}}catch{}}function m(b,E){b.classList?b.classList.add(E):b.className.match(new RegExp("(?:^|\\s)".concat(E,"(?!\\S)")))||(b.className+=" ".concat(E))}function T(b,E){b.classList?b.classList.remove(E):b.className=b.className.replace(new RegExp("(?:^|\\s)".concat(E,"(?!\\S)"),"g"),"")}return pe}var He={},pa;function cu(){if(pa)return He;pa=1,Object.defineProperty(He,"__esModule",{value:!0}),He.canDragX=o,He.canDragY=s,He.createCoreData=a,He.createDraggableData=c,He.getBoundPosition=n,He.getControlPosition=i,He.snapToGrid=r;var e=Zr(),t=Vs();function n(u,v,h){if(!u.props.bounds)return[v,h];let{bounds:C}=u.props;C=typeof C=="string"?C:l(C);const g=d(u);if(typeof C=="string"){const{ownerDocument:x}=g,y=x.defaultView;let f;if(C==="parent"?f=g.parentNode:f=x.querySelector(C),!(f instanceof y.HTMLElement))throw new Error('Bounds selector "'+C+'" could not find an element.');const w=f,D=y.getComputedStyle(g),m=y.getComputedStyle(w);C={left:-g.offsetLeft+(0,e.int)(m.paddingLeft)+(0,e.int)(D.marginLeft),top:-g.offsetTop+(0,e.int)(m.paddingTop)+(0,e.int)(D.marginTop),right:(0,t.innerWidth)(w)-(0,t.outerWidth)(g)-g.offsetLeft+(0,e.int)(m.paddingRight)-(0,e.int)(D.marginRight),bottom:(0,t.innerHeight)(w)-(0,t.outerHeight)(g)-g.offsetTop+(0,e.int)(m.paddingBottom)-(0,e.int)(D.marginBottom)}}return(0,e.isNum)(C.right)&&(v=Math.min(v,C.right)),(0,e.isNum)(C.bottom)&&(h=Math.min(h,C.bottom)),(0,e.isNum)(C.left)&&(v=Math.max(v,C.left)),(0,e.isNum)(C.top)&&(h=Math.max(h,C.top)),[v,h]}function r(u,v,h){const C=Math.round(v/u[0])*u[0],g=Math.round(h/u[1])*u[1];return[C,g]}function o(u){return u.props.axis==="both"||u.props.axis==="x"}function s(u){return u.props.axis==="both"||u.props.axis==="y"}function i(u,v,h){const C=typeof v=="number"?(0,t.getTouch)(u,v):null;if(typeof v=="number"&&!C)return null;const g=d(h),x=h.props.offsetParent||g.offsetParent||g.ownerDocument.body;return(0,t.offsetXYFromParent)(C||u,x,h.props.scale)}function a(u,v,h){const C=!(0,e.isNum)(u.lastX),g=d(u);return C?{node:g,deltaX:0,deltaY:0,lastX:v,lastY:h,x:v,y:h}:{node:g,deltaX:v-u.lastX,deltaY:h-u.lastY,lastX:u.lastX,lastY:u.lastY,x:v,y:h}}function c(u,v){const h=u.props.scale;return{node:v.node,x:u.state.x+v.deltaX/h,y:u.state.y+v.deltaY/h,deltaX:v.deltaX/h,deltaY:v.deltaY/h,lastX:u.state.x,lastY:u.state.y}}function l(u){return{left:u.left,top:u.top,right:u.right,bottom:u.bottom}}function d(u){const v=u.findDOMNode();if(!v)throw new Error("<DraggableCore>: Unmounted during event!");return v}return He}var dn={},er={},ha;function lu(){if(ha)return er;ha=1,Object.defineProperty(er,"__esModule",{value:!0}),er.default=e;function e(){}return er}var ga;function Rb(){if(ga)return dn;ga=1,Object.defineProperty(dn,"__esModule",{value:!0}),dn.default=void 0;var e=l(R),t=a(Xr()),n=a(Ze),r=Vs(),o=cu(),s=Zr(),i=a(lu());function a(x){return x&&x.__esModule?x:{default:x}}function c(x){if(typeof WeakMap!="function")return null;var y=new WeakMap,f=new WeakMap;return(c=function(w){return w?f:y})(x)}function l(x,y){if(x&&x.__esModule)return x;if(x===null||typeof x!="object"&&typeof x!="function")return{default:x};var f=c(y);if(f&&f.has(x))return f.get(x);var w={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var m in x)if(m!=="default"&&Object.prototype.hasOwnProperty.call(x,m)){var T=D?Object.getOwnPropertyDescriptor(x,m):null;T&&(T.get||T.set)?Object.defineProperty(w,m,T):w[m]=x[m]}return w.default=x,f&&f.set(x,w),w}function d(x,y,f){return y=u(y),y in x?Object.defineProperty(x,y,{value:f,enumerable:!0,configurable:!0,writable:!0}):x[y]=f,x}function u(x){var y=v(x,"string");return typeof y=="symbol"?y:String(y)}function v(x,y){if(typeof x!="object"||x===null)return x;var f=x[Symbol.toPrimitive];if(f!==void 0){var w=f.call(x,y);if(typeof w!="object")return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return(y==="string"?String:Number)(x)}const h={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let C=h.mouse,g=class extends e.Component{constructor(){super(...arguments),d(this,"dragging",!1),d(this,"lastX",NaN),d(this,"lastY",NaN),d(this,"touchIdentifier",null),d(this,"mounted",!1),d(this,"handleDragStart",y=>{if(this.props.onMouseDown(y),!this.props.allowAnyClick&&typeof y.button=="number"&&y.button!==0)return!1;const f=this.findDOMNode();if(!f||!f.ownerDocument||!f.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:w}=f;if(this.props.disabled||!(y.target instanceof w.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(y.target,this.props.handle,f)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(y.target,this.props.cancel,f))return;y.type==="touchstart"&&y.preventDefault();const D=(0,r.getTouchIdentifier)(y);this.touchIdentifier=D;const m=(0,o.getControlPosition)(y,D,this);if(m==null)return;const{x:T,y:b}=m,E=(0,o.createCoreData)(this,T,b);(0,i.default)("DraggableCore: handleDragStart: %j",E),(0,i.default)("calling",this.props.onStart),!(this.props.onStart(y,E)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(w),this.dragging=!0,this.lastX=T,this.lastY=b,(0,r.addEvent)(w,C.move,this.handleDrag),(0,r.addEvent)(w,C.stop,this.handleDragStop))}),d(this,"handleDrag",y=>{const f=(0,o.getControlPosition)(y,this.touchIdentifier,this);if(f==null)return;let{x:w,y:D}=f;if(Array.isArray(this.props.grid)){let b=w-this.lastX,E=D-this.lastY;if([b,E]=(0,o.snapToGrid)(this.props.grid,b,E),!b&&!E)return;w=this.lastX+b,D=this.lastY+E}const m=(0,o.createCoreData)(this,w,D);if((0,i.default)("DraggableCore: handleDrag: %j",m),this.props.onDrag(y,m)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const E=document.createEvent("MouseEvents");E.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(E)}return}this.lastX=w,this.lastY=D}),d(this,"handleDragStop",y=>{if(!this.dragging)return;const f=(0,o.getControlPosition)(y,this.touchIdentifier,this);if(f==null)return;let{x:w,y:D}=f;if(Array.isArray(this.props.grid)){let E=w-this.lastX||0,M=D-this.lastY||0;[E,M]=(0,o.snapToGrid)(this.props.grid,E,M),w=this.lastX+E,D=this.lastY+M}const m=(0,o.createCoreData)(this,w,D);if(this.props.onStop(y,m)===!1||this.mounted===!1)return!1;const b=this.findDOMNode();b&&this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(b.ownerDocument),(0,i.default)("DraggableCore: handleDragStop: %j",m),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,b&&((0,i.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(b.ownerDocument,C.move,this.handleDrag),(0,r.removeEvent)(b.ownerDocument,C.stop,this.handleDragStop))}),d(this,"onMouseDown",y=>(C=h.mouse,this.handleDragStart(y))),d(this,"onMouseUp",y=>(C=h.mouse,this.handleDragStop(y))),d(this,"onTouchStart",y=>(C=h.touch,this.handleDragStart(y))),d(this,"onTouchEnd",y=>(C=h.touch,this.handleDragStop(y)))}componentDidMount(){this.mounted=!0;const y=this.findDOMNode();y&&(0,r.addEvent)(y,h.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const y=this.findDOMNode();if(y){const{ownerDocument:f}=y;(0,r.removeEvent)(f,h.mouse.move,this.handleDrag),(0,r.removeEvent)(f,h.touch.move,this.handleDrag),(0,r.removeEvent)(f,h.mouse.stop,this.handleDragStop),(0,r.removeEvent)(f,h.touch.stop,this.handleDragStop),(0,r.removeEvent)(y,h.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(f)}}findDOMNode(){var y,f;return(y=this.props)!==null&&y!==void 0&&y.nodeRef?(f=this.props)===null||f===void 0||(f=f.nodeRef)===null||f===void 0?void 0:f.current:n.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return dn.default=g,d(g,"displayName","DraggableCore"),d(g,"propTypes",{allowAnyClick:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(x,y){if(x[y]&&x[y].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),d(g,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),dn}var ma;function Mb(){return ma||(ma=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var t=v(R),n=d(Xr()),r=d(Ze),o=d(Db),s=Vs(),i=cu(),a=Zr(),c=d(Rb()),l=d(lu());function d(f){return f&&f.__esModule?f:{default:f}}function u(f){if(typeof WeakMap!="function")return null;var w=new WeakMap,D=new WeakMap;return(u=function(m){return m?D:w})(f)}function v(f,w){if(f&&f.__esModule)return f;if(f===null||typeof f!="object"&&typeof f!="function")return{default:f};var D=u(w);if(D&&D.has(f))return D.get(f);var m={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in f)if(b!=="default"&&Object.prototype.hasOwnProperty.call(f,b)){var E=T?Object.getOwnPropertyDescriptor(f,b):null;E&&(E.get||E.set)?Object.defineProperty(m,b,E):m[b]=f[b]}return m.default=f,D&&D.set(f,m),m}function h(){return h=Object.assign?Object.assign.bind():function(f){for(var w=1;w<arguments.length;w++){var D=arguments[w];for(var m in D)Object.prototype.hasOwnProperty.call(D,m)&&(f[m]=D[m])}return f},h.apply(this,arguments)}function C(f,w,D){return w=g(w),w in f?Object.defineProperty(f,w,{value:D,enumerable:!0,configurable:!0,writable:!0}):f[w]=D,f}function g(f){var w=x(f,"string");return typeof w=="symbol"?w:String(w)}function x(f,w){if(typeof f!="object"||f===null)return f;var D=f[Symbol.toPrimitive];if(D!==void 0){var m=D.call(f,w);if(typeof m!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(f)}class y extends t.Component{static getDerivedStateFromProps(w,D){let{position:m}=w,{prevPropsPosition:T}=D;return m&&(!T||m.x!==T.x||m.y!==T.y)?((0,l.default)("Draggable: getDerivedStateFromProps %j",{position:m,prevPropsPosition:T}),{x:m.x,y:m.y,prevPropsPosition:{...m}}):null}constructor(w){super(w),C(this,"onDragStart",(D,m)=>{if((0,l.default)("Draggable: onDragStart: %j",m),this.props.onStart(D,(0,i.createDraggableData)(this,m))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),C(this,"onDrag",(D,m)=>{if(!this.state.dragging)return!1;(0,l.default)("Draggable: onDrag: %j",m);const T=(0,i.createDraggableData)(this,m),b={x:T.x,y:T.y,slackX:0,slackY:0};if(this.props.bounds){const{x:M,y:N}=b;b.x+=this.state.slackX,b.y+=this.state.slackY;const[A,W]=(0,i.getBoundPosition)(this,b.x,b.y);b.x=A,b.y=W,b.slackX=this.state.slackX+(M-b.x),b.slackY=this.state.slackY+(N-b.y),T.x=b.x,T.y=b.y,T.deltaX=b.x-this.state.x,T.deltaY=b.y-this.state.y}if(this.props.onDrag(D,T)===!1)return!1;this.setState(b)}),C(this,"onDragStop",(D,m)=>{if(!this.state.dragging||this.props.onStop(D,(0,i.createDraggableData)(this,m))===!1)return!1;(0,l.default)("Draggable: onDragStop: %j",m);const b={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:M,y:N}=this.props.position;b.x=M,b.y=N}this.setState(b)}),this.state={dragging:!1,dragged:!1,x:w.position?w.position.x:w.defaultPosition.x,y:w.position?w.position.y:w.defaultPosition.y,prevPropsPosition:{...w.position},slackX:0,slackY:0,isElementSVG:!1},w.position&&!(w.onDrag||w.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var w,D;return(w=(D=this.props)===null||D===void 0||(D=D.nodeRef)===null||D===void 0?void 0:D.current)!==null&&w!==void 0?w:r.default.findDOMNode(this)}render(){const{axis:w,bounds:D,children:m,defaultPosition:T,defaultClassName:b,defaultClassNameDragging:E,defaultClassNameDragged:M,position:N,positionOffset:A,scale:W,...Y}=this.props;let L={},$=null;const I=!!!N||this.state.dragging,O=N||T,j={x:(0,i.canDragX)(this)&&I?this.state.x:O.x,y:(0,i.canDragY)(this)&&I?this.state.y:O.y};this.state.isElementSVG?$=(0,s.createSVGTransform)(j,A):L=(0,s.createCSSTransform)(j,A);const P=(0,o.default)(m.props.className||"",b,{[E]:this.state.dragging,[M]:this.state.dragged});return t.createElement(c.default,h({},Y,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(m),{className:P,style:{...m.props.style,...L},transform:$}))}}e.default=y,C(y,"displayName","Draggable"),C(y,"propTypes",{...c.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),C(y,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(xo)),xo}var va;function uu(){if(va)return un.exports;va=1;const{default:e,DraggableCore:t}=Mb();return un.exports=e,un.exports.default=e,un.exports.DraggableCore=t,un.exports}var tr={},ya;function kb(){if(ya)return tr;ya=1,tr.__esModule=!0,tr.cloneElement=a;var e=t(R);function t(c){return c&&c.__esModule?c:{default:c}}function n(c,l){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(c);l&&(u=u.filter(function(v){return Object.getOwnPropertyDescriptor(c,v).enumerable})),d.push.apply(d,u)}return d}function r(c){for(var l=1;l<arguments.length;l++){var d=arguments[l]!=null?arguments[l]:{};l%2?n(Object(d),!0).forEach(function(u){o(c,u,d[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):n(Object(d)).forEach(function(u){Object.defineProperty(c,u,Object.getOwnPropertyDescriptor(d,u))})}return c}function o(c,l,d){return l=s(l),l in c?Object.defineProperty(c,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[l]=d,c}function s(c){var l=i(c,"string");return typeof l=="symbol"?l:String(l)}function i(c,l){if(typeof c!="object"||c===null)return c;var d=c[Symbol.toPrimitive];if(d!==void 0){var u=d.call(c,l);if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(c)}function a(c,l){return l.style&&c.props.style&&(l.style=r(r({},c.props.style),l.style)),l.className&&c.props.className&&(l.className=c.props.className+" "+l.className),e.default.cloneElement(c,l)}return tr}var fn={},ba;function du(){if(ba)return fn;ba=1,fn.__esModule=!0,fn.resizableProps=void 0;var e=t(Xr());uu();function t(r){return r&&r.__esModule?r:{default:r}}var n={axis:e.default.oneOf(["both","x","y","none"]),className:e.default.string,children:e.default.element.isRequired,draggableOpts:e.default.shape({allowAnyClick:e.default.bool,cancel:e.default.string,children:e.default.node,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:e.default.node,grid:e.default.arrayOf(e.default.number),handle:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number}),height:function(){for(var o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];var a=s[0];if(a.axis==="both"||a.axis==="y"){var c;return(c=e.default.number).isRequired.apply(c,s)}return e.default.number.apply(e.default,s)},handle:e.default.oneOfType([e.default.node,e.default.func]),handleSize:e.default.arrayOf(e.default.number),lockAspectRatio:e.default.bool,maxConstraints:e.default.arrayOf(e.default.number),minConstraints:e.default.arrayOf(e.default.number),onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,resizeHandles:e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:e.default.number,width:function(){for(var o=arguments.length,s=new Array(o),i=0;i<o;i++)s[i]=arguments[i];var a=s[0];if(a.axis==="both"||a.axis==="x"){var c;return(c=e.default.number).isRequired.apply(c,s)}return e.default.number.apply(e.default,s)}};return fn.resizableProps=n,fn}var wa;function fu(){if(wa)return ln;wa=1,ln.__esModule=!0,ln.default=void 0;var e=i(R),t=uu(),n=kb(),r=du(),o=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function s(y){if(typeof WeakMap!="function")return null;var f=new WeakMap,w=new WeakMap;return(s=function(m){return m?w:f})(y)}function i(y,f){if(y&&y.__esModule)return y;if(y===null||typeof y!="object"&&typeof y!="function")return{default:y};var w=s(f);if(w&&w.has(y))return w.get(y);var D={},m=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var T in y)if(T!=="default"&&Object.prototype.hasOwnProperty.call(y,T)){var b=m?Object.getOwnPropertyDescriptor(y,T):null;b&&(b.get||b.set)?Object.defineProperty(D,T,b):D[T]=y[T]}return D.default=y,w&&w.set(y,D),D}function a(){return a=Object.assign?Object.assign.bind():function(y){for(var f=1;f<arguments.length;f++){var w=arguments[f];for(var D in w)Object.prototype.hasOwnProperty.call(w,D)&&(y[D]=w[D])}return y},a.apply(this,arguments)}function c(y,f){if(y==null)return{};var w={},D=Object.keys(y),m,T;for(T=0;T<D.length;T++)m=D[T],!(f.indexOf(m)>=0)&&(w[m]=y[m]);return w}function l(y,f){var w=Object.keys(y);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(y);f&&(D=D.filter(function(m){return Object.getOwnPropertyDescriptor(y,m).enumerable})),w.push.apply(w,D)}return w}function d(y){for(var f=1;f<arguments.length;f++){var w=arguments[f]!=null?arguments[f]:{};f%2?l(Object(w),!0).forEach(function(D){u(y,D,w[D])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(w)):l(Object(w)).forEach(function(D){Object.defineProperty(y,D,Object.getOwnPropertyDescriptor(w,D))})}return y}function u(y,f,w){return f=v(f),f in y?Object.defineProperty(y,f,{value:w,enumerable:!0,configurable:!0,writable:!0}):y[f]=w,y}function v(y){var f=h(y,"string");return typeof f=="symbol"?f:String(f)}function h(y,f){if(typeof y!="object"||y===null)return y;var w=y[Symbol.toPrimitive];if(w!==void 0){var D=w.call(y,f);if(typeof D!="object")return D;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(y)}function C(y,f){y.prototype=Object.create(f.prototype),y.prototype.constructor=y,g(y,f)}function g(y,f){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(D,m){return D.__proto__=m,D},g(y,f)}var x=function(y){C(f,y);function f(){for(var D,m=arguments.length,T=new Array(m),b=0;b<m;b++)T[b]=arguments[b];return D=y.call.apply(y,[this].concat(T))||this,D.handleRefs={},D.lastHandleRect=null,D.slack=null,D}var w=f.prototype;return w.componentWillUnmount=function(){this.resetData()},w.resetData=function(){this.lastHandleRect=this.slack=null},w.runConstraints=function(m,T){var b=this.props,E=b.minConstraints,M=b.maxConstraints,N=b.lockAspectRatio;if(!E&&!M&&!N)return[m,T];if(N){var A=this.props.width/this.props.height,W=m-this.props.width,Y=T-this.props.height;Math.abs(W)>Math.abs(Y*A)?T=m/A:m=T*A}var L=m,$=T,k=this.slack||[0,0],I=k[0],O=k[1];return m+=I,T+=O,E&&(m=Math.max(E[0],m),T=Math.max(E[1],T)),M&&(m=Math.min(M[0],m),T=Math.min(M[1],T)),this.slack=[I+(L-m),O+($-T)],[m,T]},w.resizeHandler=function(m,T){var b=this;return function(E,M){var N=M.node,A=M.deltaX,W=M.deltaY;m==="onResizeStart"&&b.resetData();var Y=(b.props.axis==="both"||b.props.axis==="x")&&T!=="n"&&T!=="s",L=(b.props.axis==="both"||b.props.axis==="y")&&T!=="e"&&T!=="w";if(!(!Y&&!L)){var $=T[0],k=T[T.length-1],I=N.getBoundingClientRect();if(b.lastHandleRect!=null){if(k==="w"){var O=I.left-b.lastHandleRect.left;A+=O}if($==="n"){var j=I.top-b.lastHandleRect.top;W+=j}}b.lastHandleRect=I,k==="w"&&(A=-A),$==="n"&&(W=-W);var P=b.props.width+(Y?A/b.props.transformScale:0),F=b.props.height+(L?W/b.props.transformScale:0),U=b.runConstraints(P,F);P=U[0],F=U[1];var V=P!==b.props.width||F!==b.props.height,H=typeof b.props[m]=="function"?b.props[m]:null,X=m==="onResize"&&!V;H&&!X&&(E.persist==null||E.persist(),H(E,{node:N,size:{width:P,height:F},handle:T})),m==="onResizeStop"&&b.resetData()}}},w.renderResizeHandle=function(m,T){var b=this.props.handle;if(!b)return e.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+m,ref:T});if(typeof b=="function")return b(m,T);var E=typeof b.type=="string",M=d({ref:T},E?{}:{handleAxis:m});return e.cloneElement(b,M)},w.render=function(){var m=this,T=this.props,b=T.children,E=T.className,M=T.draggableOpts;T.width,T.height,T.handle,T.handleSize,T.lockAspectRatio,T.axis,T.minConstraints,T.maxConstraints,T.onResize,T.onResizeStop,T.onResizeStart;var N=T.resizeHandles;T.transformScale;var A=c(T,o);return(0,n.cloneElement)(b,d(d({},A),{},{className:(E?E+" ":"")+"react-resizable",children:[].concat(b.props.children,N.map(function(W){var Y,L=(Y=m.handleRefs[W])!=null?Y:m.handleRefs[W]=e.createRef();return e.createElement(t.DraggableCore,a({},M,{nodeRef:L,key:"resizableHandle-"+W,onStop:m.resizeHandler("onResizeStop",W),onStart:m.resizeHandler("onResizeStart",W),onDrag:m.resizeHandler("onResize",W)}),m.renderResizeHandle(W,L))}))}))},f}(e.Component);return ln.default=x,x.propTypes=r.resizableProps,x.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},ln}var pn={},xa;function Ob(){if(xa)return pn;xa=1,pn.__esModule=!0,pn.default=void 0;var e=a(R),t=s(Xr()),n=s(fu()),r=du(),o=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function s(f){return f&&f.__esModule?f:{default:f}}function i(f){if(typeof WeakMap!="function")return null;var w=new WeakMap,D=new WeakMap;return(i=function(T){return T?D:w})(f)}function a(f,w){if(f&&f.__esModule)return f;if(f===null||typeof f!="object"&&typeof f!="function")return{default:f};var D=i(w);if(D&&D.has(f))return D.get(f);var m={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var b in f)if(b!=="default"&&Object.prototype.hasOwnProperty.call(f,b)){var E=T?Object.getOwnPropertyDescriptor(f,b):null;E&&(E.get||E.set)?Object.defineProperty(m,b,E):m[b]=f[b]}return m.default=f,D&&D.set(f,m),m}function c(){return c=Object.assign?Object.assign.bind():function(f){for(var w=1;w<arguments.length;w++){var D=arguments[w];for(var m in D)Object.prototype.hasOwnProperty.call(D,m)&&(f[m]=D[m])}return f},c.apply(this,arguments)}function l(f,w){var D=Object.keys(f);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(f);w&&(m=m.filter(function(T){return Object.getOwnPropertyDescriptor(f,T).enumerable})),D.push.apply(D,m)}return D}function d(f){for(var w=1;w<arguments.length;w++){var D=arguments[w]!=null?arguments[w]:{};w%2?l(Object(D),!0).forEach(function(m){u(f,m,D[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(D)):l(Object(D)).forEach(function(m){Object.defineProperty(f,m,Object.getOwnPropertyDescriptor(D,m))})}return f}function u(f,w,D){return w=v(w),w in f?Object.defineProperty(f,w,{value:D,enumerable:!0,configurable:!0,writable:!0}):f[w]=D,f}function v(f){var w=h(f,"string");return typeof w=="symbol"?w:String(w)}function h(f,w){if(typeof f!="object"||f===null)return f;var D=f[Symbol.toPrimitive];if(D!==void 0){var m=D.call(f,w);if(typeof m!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(f)}function C(f,w){if(f==null)return{};var D={},m=Object.keys(f),T,b;for(b=0;b<m.length;b++)T=m[b],!(w.indexOf(T)>=0)&&(D[T]=f[T]);return D}function g(f,w){f.prototype=Object.create(w.prototype),f.prototype.constructor=f,x(f,w)}function x(f,w){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(m,T){return m.__proto__=T,m},x(f,w)}var y=function(f){g(w,f);function w(){for(var m,T=arguments.length,b=new Array(T),E=0;E<T;E++)b[E]=arguments[E];return m=f.call.apply(f,[this].concat(b))||this,m.state={width:m.props.width,height:m.props.height,propsWidth:m.props.width,propsHeight:m.props.height},m.onResize=function(M,N){var A=N.size;m.props.onResize?(M.persist==null||M.persist(),m.setState(A,function(){return m.props.onResize&&m.props.onResize(M,N)})):m.setState(A)},m}w.getDerivedStateFromProps=function(T,b){return b.propsWidth!==T.width||b.propsHeight!==T.height?{width:T.width,height:T.height,propsWidth:T.width,propsHeight:T.height}:null};var D=w.prototype;return D.render=function(){var T=this.props,b=T.handle,E=T.handleSize;T.onResize;var M=T.onResizeStart,N=T.onResizeStop,A=T.draggableOpts,W=T.minConstraints,Y=T.maxConstraints,L=T.lockAspectRatio,$=T.axis;T.width,T.height;var k=T.resizeHandles,I=T.style,O=T.transformScale,j=C(T,o);return e.createElement(n.default,{axis:$,draggableOpts:A,handle:b,handleSize:E,height:this.state.height,lockAspectRatio:L,maxConstraints:Y,minConstraints:W,onResizeStart:M,onResize:this.onResize,onResizeStop:N,resizeHandles:k,transformScale:O,width:this.state.width},e.createElement("div",c({},j,{style:d(d({},I),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},w}(e.Component);return pn.default=y,y.propTypes=d(d({},r.resizableProps),{},{children:t.default.element}),pn}var Sa;function Pb(){return Sa||(Sa=1,cn.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},cn.exports.Resizable=fu().default,cn.exports.ResizableBox=Ob().default),cn.exports}var pu=Pb();function _b(e,t,n){const r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}const Ab=e=>{let{transform:t,draggingNodeRect:n,windowRect:r}=e;return!n||!r?t:_b(t,n,r)},Nb=({bookingInit:e,slotData:t,heightStyle:n})=>p.jsx(op,{modifiers:[Ab],dropAnimation:{duration:2e3,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},className:"Draggable dragging",children:p.jsx(Go,{booking:e,slotData:t,heightStyle:n})}),Go=({booking:e,slotData:t,onClick:n,heightStyle:r,customClasses:o,ref:s})=>{const{day:i,hour:a}=t,[c,l]=R.useState(!1),d=xe(Bs(N=>N.bookingViewType)),{updateIsDragging:u,isDragging:v}=en(N=>N),h=ou(N=>N.startAt),{attributes:C,listeners:g,setNodeRef:x,isDragging:y,transform:f}=us({id:e.id,data:{type:"booking-slots",booking:e,slotData:t}}),w=f?{transform:`translate3d(${f.x}px, ${f.y}px, 0)`}:void 0;kn({onDragStart:()=>u(!0),onDragAbort:()=>D(),onDragCancel:()=>D(),onDragEnd:()=>D()});const D=R.useCallback(()=>{u(!1)},[]),m=N=>N<="11:30",T=R.useMemo(()=>({cursor:v?"ns-resize":"pointer",width:d===re.DAY?"99%":"100%"}),[v,d]),b=(N,A)=>{const W=Q.dateAndHourDateToString(new Date(N.finishAt));return Q.isTodayDate(A)&&m(W)?{backgroundColor:"#000000c0"}:{backgroundColor:"#000456c0"}},[E,M]=R.useState(e);return R.useEffect(()=>{if(h.length){const N=Q.bookingTimeRange(e,h);M({...N})}},[h]),R.useImperativeHandle(s,()=>({changeCurrentCardResize:()=>l(N=>!N)})),y?p.jsx(Nb,{bookingInit:E,slotData:t,heightStyle:r}):p.jsx("div",{ref:x,className:se("cardContent_render",c&&"cardContent_render_dragging",o),style:{...w,...T},...g,...C,children:p.jsx("div",{className:"relative w-full h-full",style:b(e,new Date(i.split(":")[1])),onPointerUp:n,children:p.jsxs("div",{className:se("flex flex-col h-full text-white pl-2 lg:pl-2 justify-start items-start"),children:[p.jsx("p",{style:{height:"1.8rem",alignContent:"center"},children:`${Q.dateAndHourDateToString(e.startAt)} - ${Q.dateAndHourDateToString(e.finishAt)}`}),p.jsx("span",{className:"flex flex-row items-center justify-center"})]})},`${i}-${a}`)},e.id)};function Ib(e,t){const n=e>new Date(t.startAt),r=e<new Date(t.finishAt);return n&&r}const jb={calculateOverlappingBookings:(e,t)=>{const n=t.filter(o=>{const s=new Date(o.startAt).getDate(),i=e.startAt.getDate();return s===i&&o.id!==e.id});let r=0;for(const o of n)Ib(e.startAt,o)&&r++;return r}},Us=({bookingInit:e,slotData:t,heightStyle:n,topHeightIncrement:r,onClick:o,customClasses:s,bookingViewType:i,resizableParam:a,events:c,open:l=!0,lastCard:d,half:u,cardContentRef:v,cardsQuantity:h,cardIndex:C,ref:g})=>{var $;const x=en(k=>k.updateIsDragging),{bookings:y,onCardResizeEnd:f}=Qe(),[w,D]=R.useState(""),m=R.useRef(null),T=i===re.DAY?{width:"99%"}:{width:"100%"},b=(k,I)=>{var O;D("show-handle"),x(!0),a!=null&&a.onResizeStart&&a.onResizeStart(k,I),(O=m.current)==null||O.changeCurrentCardResize()},E=(k,I)=>{var O;(O=m.current)==null||O.changeCurrentCardResize(),D(""),x(!1),f(e),a!=null&&a.onResizeStop&&a.onResizeStop(k,I)},M=R.useMemo(()=>jb.calculateOverlappingBookings(e,y),[e,y]),N=R.useMemo(()=>se(a==null?void 0:a.customClass,w,u&&M>0&&"",u?"":M>0&&"inner_cards_parent",d&&M&&u&&"inner_cards_parent_last_card_disable",d&&M&&"inner_cards_parent_last_card",d&&M===2&&"inner_cards_parent_last_card_layer_2",M===1&&!u&&"inner_cards_parent_1_layer",M===2&&"inner_cards_parent_2_layer",u&&M===3&&"inner_cards_parent_resizable_layer_3_half inner_cards_parent_3_layer_half",M===3&&"inner_cards_parent_resizable_layer_3 inner_cards_parent_3_layer"),[a,w,u,M,d]),A=k=>k===0?"8rem":"4rem",W=R.useMemo(()=>u&&C===0&&h===3||u&&C===1&&h===3?A(C):M===2?"0.8rem":d&&M===1?"0.2rem":d&&M?"1rem":M===1?"0.4rem":0,[u,d,M,C,h]),Y=R.useMemo(()=>u&&C===0&&h===3&&!M?"0rem":u&&C===0&&h===3?"0.4rem":u&&C===1&&h===3?"5rem":d&&h===3?"9rem":d?"6.5rem":0,[u,d,C,M,h]),L=R.useMemo(()=>u&&h===3&&(u&&C===0||u&&C===1)||u&&d&&h===3||u&&d?{inset:`${r}rem ${W} ${n}rem ${Y}`}:u&&h===3||u?{inset:`${r}rem 6.5rem ${n}rem ${W}`}:{inset:`${r||0}rem ${W} ${n}rem`},[u,M,n,r,C,h,W,Y]);if(R.useEffect(()=>()=>{c!=null&&c.onUnmount&&(c==null||c.onUnmount())},[]),R.useImperativeHandle(v,()=>({changeCurrentCardResize:()=>{var k;(k=m.current)==null||k.changeCurrentCardResize()}})),!l&&!e.finishAt)return null;if(($=a==null?void 0:a.state)!=null&&$.height){const{state:k,onResize:I}=a;return p.jsx(pu.Resizable,{className:se(N),height:k==null?void 0:k.height,width:k==null?void 0:k.width,onResize:I,onResizeStart:b,onResizeStop:E,resizeHandles:["s","n"],draggableOpts:{grid:[35,35]},handleSize:[20,20],maxConstraints:[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],transformScale:1,children:p.jsx("div",{className:"card_content_core",style:{...L},children:p.jsx(Go,{ref:m,heightStyle:n,booking:e,slotData:t,onClick:o,layerCount:M,half:u},e.id)})})}return p.jsx("div",{ref:g,className:"card_content_core",style:{...T,...L},children:p.jsx(Go,{heightStyle:n,customClasses:s,booking:e,slotData:t,onClick:o})})},Lb=e=>{const t=R.use(nu);if(!t)throw new Error("useConfig must be used within a ConfigContext");return Rr(t,e)};function Ca(e,[t,n]){return Math.min(n,Math.max(t,e))}function $b(e){const t=S.useRef({value:e,previous:e});return S.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Fb=[" ","Enter","ArrowUp","ArrowDown"],zb=[" ","Enter"],Fn="Select",[Jr,Qr,Wb]=Rs(Fn),[tn,Rx]=mt(Fn,[Wb,vt]),eo=vt(),[Bb,yt]=tn(Fn),[Hb,Vb]=tn(Fn),hu=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:a,onValueChange:c,dir:l,name:d,autoComplete:u,disabled:v,required:h,form:C}=e,g=eo(t),[x,y]=S.useState(null),[f,w]=S.useState(null),[D,m]=S.useState(!1),T=Ms(l),[b=!1,E]=Tt({prop:r,defaultProp:o,onChange:s}),[M,N]=Tt({prop:i,defaultProp:a,onChange:c}),A=S.useRef(null),W=x?C||!!x.closest("form"):!0,[Y,L]=S.useState(new Set),$=Array.from(Y).map(k=>k.props.value).join(";");return p.jsx($r,{...g,children:p.jsxs(Bb,{required:h,scope:t,trigger:x,onTriggerChange:y,valueNode:f,onValueNodeChange:w,valueNodeHasChildren:D,onValueNodeHasChildrenChange:m,contentId:ft(),value:M,onValueChange:N,open:b,onOpenChange:E,dir:T,triggerPointerDownPosRef:A,disabled:v,children:[p.jsx(Jr.Provider,{scope:t,children:p.jsx(Hb,{scope:e.__scopeSelect,onNativeOptionAdd:S.useCallback(k=>{L(I=>new Set(I).add(k))},[]),onNativeOptionRemove:S.useCallback(k=>{L(I=>{const O=new Set(I);return O.delete(k),O})},[]),children:n})}),W?p.jsxs(Lu,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:u,value:M,onChange:k=>N(k.target.value),disabled:v,form:C,children:[M===void 0?p.jsx("option",{value:""}):null,Array.from(Y)]},$):null]})})};hu.displayName=Fn;var gu="SelectTrigger",mu=S.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=eo(n),i=yt(gu,n),a=i.disabled||r,c=ue(t,i.onTriggerChange),l=Qr(n),d=S.useRef("touch"),[u,v,h]=$u(g=>{const x=l().filter(w=>!w.disabled),y=x.find(w=>w.value===i.value),f=Fu(x,g,y);f!==void 0&&i.onValueChange(f.value)}),C=g=>{a||(i.onOpenChange(!0),h()),g&&(i.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return p.jsx(Nn,{asChild:!0,...s,children:p.jsx(ie.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":ju(i.value)?"":void 0,...o,ref:c,onClick:ee(o.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&C(g)}),onPointerDown:ee(o.onPointerDown,g=>{d.current=g.pointerType;const x=g.target;x.hasPointerCapture(g.pointerId)&&x.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(C(g),g.preventDefault())}),onKeyDown:ee(o.onKeyDown,g=>{const x=u.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&v(g.key),!(x&&g.key===" ")&&Fb.includes(g.key)&&(C(),g.preventDefault())})})})});mu.displayName=gu;var vu="SelectValue",yu=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...a}=e,c=yt(vu,n),{onValueNodeHasChildrenChange:l}=c,d=s!==void 0,u=ue(t,c.onValueNodeChange);return Se(()=>{l(d)},[l,d]),p.jsx(ie.span,{...a,ref:u,style:{pointerEvents:"none"},children:ju(c.value)?p.jsx(p.Fragment,{children:i}):s})});yu.displayName=vu;var Ub="SelectIcon",bu=S.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return p.jsx(ie.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});bu.displayName=Ub;var Yb="SelectPortal",wu=e=>p.jsx(In,{asChild:!0,...e});wu.displayName=Yb;var Rt="SelectContent",xu=S.forwardRef((e,t)=>{const n=yt(Rt,e.__scopeSelect),[r,o]=S.useState();if(Se(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?Tr.createPortal(p.jsx(Su,{scope:e.__scopeSelect,children:p.jsx(Jr.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),s):null}return p.jsx(Cu,{...e,ref:t})});xu.displayName=Rt;var Le=10,[Su,bt]=tn(Rt),Kb="SelectContentImpl",Gb=Ct("SelectContent.RemoveScroll"),Cu=S.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:a,sideOffset:c,align:l,alignOffset:d,arrowPadding:u,collisionBoundary:v,collisionPadding:h,sticky:C,hideWhenDetached:g,avoidCollisions:x,...y}=e,f=yt(Rt,n),[w,D]=S.useState(null),[m,T]=S.useState(null),b=ue(t,z=>D(z)),[E,M]=S.useState(null),[N,A]=S.useState(null),W=Qr(n),[Y,L]=S.useState(!1),$=S.useRef(!1);S.useEffect(()=>{if(w)return Os(w)},[w]),ks();const k=S.useCallback(z=>{const[G,...q]=W().map(_=>_.ref.current),[B]=q.slice(-1),te=document.activeElement;for(const _ of z)if(_===te||(_==null||_.scrollIntoView({block:"nearest"}),_===G&&m&&(m.scrollTop=0),_===B&&m&&(m.scrollTop=m.scrollHeight),_==null||_.focus(),document.activeElement!==te))return},[W,m]),I=S.useCallback(()=>k([E,w]),[k,E,w]);S.useEffect(()=>{Y&&I()},[Y,I]);const{onOpenChange:O,triggerPointerDownPosRef:j}=f;S.useEffect(()=>{if(w){let z={x:0,y:0};const G=B=>{var te,_;z={x:Math.abs(Math.round(B.pageX)-(((te=j.current)==null?void 0:te.x)??0)),y:Math.abs(Math.round(B.pageY)-(((_=j.current)==null?void 0:_.y)??0))}},q=B=>{z.x<=10&&z.y<=10?B.preventDefault():w.contains(B.target)||O(!1),document.removeEventListener("pointermove",G),j.current=null};return j.current!==null&&(document.addEventListener("pointermove",G),document.addEventListener("pointerup",q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",G),document.removeEventListener("pointerup",q,{capture:!0})}}},[w,O,j]),S.useEffect(()=>{const z=()=>O(!1);return window.addEventListener("blur",z),window.addEventListener("resize",z),()=>{window.removeEventListener("blur",z),window.removeEventListener("resize",z)}},[O]);const[P,F]=$u(z=>{const G=W().filter(te=>!te.disabled),q=G.find(te=>te.ref.current===document.activeElement),B=Fu(G,z,q);B&&setTimeout(()=>B.ref.current.focus())}),U=S.useCallback((z,G,q)=>{const B=!$.current&&!q;(f.value!==void 0&&f.value===G||B)&&(M(z),B&&($.current=!0))},[f.value]),V=S.useCallback(()=>w==null?void 0:w.focus(),[w]),H=S.useCallback((z,G,q)=>{const B=!$.current&&!q;(f.value!==void 0&&f.value===G||B)&&A(z)},[f.value]),X=r==="popper"?qo:Eu,K=X===qo?{side:a,sideOffset:c,align:l,alignOffset:d,arrowPadding:u,collisionBoundary:v,collisionPadding:h,sticky:C,hideWhenDetached:g,avoidCollisions:x}:{};return p.jsx(Su,{scope:n,content:w,viewport:m,onViewportChange:T,itemRefCallback:U,selectedItem:E,onItemLeave:V,itemTextRefCallback:H,focusSelectedItem:I,selectedItemText:N,position:r,isPositioned:Y,searchRef:P,children:p.jsx(Kr,{as:Gb,allowPinchZoom:!0,children:p.jsx(Vr,{asChild:!0,trapped:f.open,onMountAutoFocus:z=>{z.preventDefault()},onUnmountAutoFocus:ee(o,z=>{var G;(G=f.trigger)==null||G.focus({preventScroll:!0}),z.preventDefault()}),children:p.jsx(_n,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:z=>z.preventDefault(),onDismiss:()=>f.onOpenChange(!1),children:p.jsx(X,{role:"listbox",id:f.contentId,"data-state":f.open?"open":"closed",dir:f.dir,onContextMenu:z=>z.preventDefault(),...y,...K,onPlaced:()=>L(!0),ref:b,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:ee(y.onKeyDown,z=>{const G=z.ctrlKey||z.altKey||z.metaKey;if(z.key==="Tab"&&z.preventDefault(),!G&&z.key.length===1&&F(z.key),["ArrowUp","ArrowDown","Home","End"].includes(z.key)){let B=W().filter(te=>!te.disabled).map(te=>te.ref.current);if(["ArrowUp","End"].includes(z.key)&&(B=B.slice().reverse()),["ArrowUp","ArrowDown"].includes(z.key)){const te=z.target,_=B.indexOf(te);B=B.slice(_+1)}setTimeout(()=>k(B)),z.preventDefault()}})})})})})})});Cu.displayName=Kb;var qb="SelectItemAlignedPosition",Eu=S.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=yt(Rt,n),i=bt(Rt,n),[a,c]=S.useState(null),[l,d]=S.useState(null),u=ue(t,b=>d(b)),v=Qr(n),h=S.useRef(!1),C=S.useRef(!0),{viewport:g,selectedItem:x,selectedItemText:y,focusSelectedItem:f}=i,w=S.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&g&&x&&y){const b=s.trigger.getBoundingClientRect(),E=l.getBoundingClientRect(),M=s.valueNode.getBoundingClientRect(),N=y.getBoundingClientRect();if(s.dir!=="rtl"){const te=N.left-E.left,_=M.left-te,ne=b.left-_,ae=b.width+ne,fe=Math.max(ae,E.width),ve=window.innerWidth-Le,Ne=Ca(_,[Le,Math.max(Le,ve-fe)]);a.style.minWidth=ae+"px",a.style.left=Ne+"px"}else{const te=E.right-N.right,_=window.innerWidth-M.right-te,ne=window.innerWidth-b.right-_,ae=b.width+ne,fe=Math.max(ae,E.width),ve=window.innerWidth-Le,Ne=Ca(_,[Le,Math.max(Le,ve-fe)]);a.style.minWidth=ae+"px",a.style.right=Ne+"px"}const A=v(),W=window.innerHeight-Le*2,Y=g.scrollHeight,L=window.getComputedStyle(l),$=parseInt(L.borderTopWidth,10),k=parseInt(L.paddingTop,10),I=parseInt(L.borderBottomWidth,10),O=parseInt(L.paddingBottom,10),j=$+k+Y+O+I,P=Math.min(x.offsetHeight*5,j),F=window.getComputedStyle(g),U=parseInt(F.paddingTop,10),V=parseInt(F.paddingBottom,10),H=b.top+b.height/2-Le,X=W-H,K=x.offsetHeight/2,z=x.offsetTop+K,G=$+k+z,q=j-G;if(G<=H){const te=A.length>0&&x===A[A.length-1].ref.current;a.style.bottom="0px";const _=l.clientHeight-g.offsetTop-g.offsetHeight,ne=Math.max(X,K+(te?V:0)+_+I),ae=G+ne;a.style.height=ae+"px"}else{const te=A.length>0&&x===A[0].ref.current;a.style.top="0px";const ne=Math.max(H,$+g.offsetTop+(te?U:0)+K)+q;a.style.height=ne+"px",g.scrollTop=G-H+g.offsetTop}a.style.margin=`${Le}px 0`,a.style.minHeight=P+"px",a.style.maxHeight=W+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[v,s.trigger,s.valueNode,a,l,g,x,y,s.dir,r]);Se(()=>w(),[w]);const[D,m]=S.useState();Se(()=>{l&&m(window.getComputedStyle(l).zIndex)},[l]);const T=S.useCallback(b=>{b&&C.current===!0&&(w(),f==null||f(),C.current=!1)},[w,f]);return p.jsx(Zb,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:T,children:p.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:D},children:p.jsx(ie.div,{...o,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Eu.displayName=qb;var Xb="SelectPopperPosition",qo=S.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Le,...s}=e,i=eo(n);return p.jsx(Fr,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});qo.displayName=Xb;var[Zb,Ys]=tn(Rt,{}),Xo="SelectViewport",Du=S.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=bt(Xo,n),i=Ys(Xo,n),a=ue(t,s.onViewportChange),c=S.useRef(0);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),p.jsx(Jr.Slot,{scope:n,children:p.jsx(ie.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:ee(o.onScroll,l=>{const d=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:v}=i;if(v!=null&&v.current&&u){const h=Math.abs(c.current-d.scrollTop);if(h>0){const C=window.innerHeight-Le*2,g=parseFloat(u.style.minHeight),x=parseFloat(u.style.height),y=Math.max(g,x);if(y<C){const f=y+h,w=Math.min(C,f),D=f-w;u.style.height=w+"px",u.style.bottom==="0px"&&(d.scrollTop=D>0?D:0,u.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});Du.displayName=Xo;var Tu="SelectGroup",[Jb,Qb]=tn(Tu),ew=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=ft();return p.jsx(Jb,{scope:n,id:o,children:p.jsx(ie.div,{role:"group","aria-labelledby":o,...r,ref:t})})});ew.displayName=Tu;var Ru="SelectLabel",tw=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Qb(Ru,n);return p.jsx(ie.div,{id:o.id,...r,ref:t})});tw.displayName=Ru;var Dr="SelectItem",[nw,Mu]=tn(Dr),ku=S.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,a=yt(Dr,n),c=bt(Dr,n),l=a.value===r,[d,u]=S.useState(s??""),[v,h]=S.useState(!1),C=ue(t,f=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,f,r,o)}),g=ft(),x=S.useRef("touch"),y=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.jsx(nw,{scope:n,value:r,disabled:o,textId:g,isSelected:l,onItemTextChange:S.useCallback(f=>{u(w=>w||((f==null?void 0:f.textContent)??"").trim())},[]),children:p.jsx(Jr.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:p.jsx(ie.div,{role:"option","aria-labelledby":g,"data-highlighted":v?"":void 0,"aria-selected":l&&v,"data-state":l?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:C,onFocus:ee(i.onFocus,()=>h(!0)),onBlur:ee(i.onBlur,()=>h(!1)),onClick:ee(i.onClick,()=>{x.current!=="mouse"&&y()}),onPointerUp:ee(i.onPointerUp,()=>{x.current==="mouse"&&y()}),onPointerDown:ee(i.onPointerDown,f=>{x.current=f.pointerType}),onPointerMove:ee(i.onPointerMove,f=>{var w;x.current=f.pointerType,o?(w=c.onItemLeave)==null||w.call(c):x.current==="mouse"&&f.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ee(i.onPointerLeave,f=>{var w;f.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:ee(i.onKeyDown,f=>{var D;((D=c.searchRef)==null?void 0:D.current)!==""&&f.key===" "||(zb.includes(f.key)&&y(),f.key===" "&&f.preventDefault())})})})})});ku.displayName=Dr;var gn="SelectItemText",Ou=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=yt(gn,n),a=bt(gn,n),c=Mu(gn,n),l=Vb(gn,n),[d,u]=S.useState(null),v=ue(t,y=>u(y),c.onItemTextChange,y=>{var f;return(f=a.itemTextRefCallback)==null?void 0:f.call(a,y,c.value,c.disabled)}),h=d==null?void 0:d.textContent,C=S.useMemo(()=>p.jsx("option",{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:g,onNativeOptionRemove:x}=l;return Se(()=>(g(C),()=>x(C)),[g,x,C]),p.jsxs(p.Fragment,{children:[p.jsx(ie.span,{id:c.textId,...s,ref:v}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Tr.createPortal(s.children,i.valueNode):null]})});Ou.displayName=gn;var Pu="SelectItemIndicator",_u=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Mu(Pu,n).isSelected?p.jsx(ie.span,{"aria-hidden":!0,...r,ref:t}):null});_u.displayName=Pu;var Zo="SelectScrollUpButton",Au=S.forwardRef((e,t)=>{const n=bt(Zo,e.__scopeSelect),r=Ys(Zo,e.__scopeSelect),[o,s]=S.useState(!1),i=ue(t,r.onScrollButtonChange);return Se(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollTop>0;s(l)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?p.jsx(Iu,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop-c.offsetHeight)}}):null});Au.displayName=Zo;var Jo="SelectScrollDownButton",Nu=S.forwardRef((e,t)=>{const n=bt(Jo,e.__scopeSelect),r=Ys(Jo,e.__scopeSelect),[o,s]=S.useState(!1),i=ue(t,r.onScrollButtonChange);return Se(()=>{if(n.viewport&&n.isPositioned){let a=function(){const l=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<l;s(d)};const c=n.viewport;return a(),c.addEventListener("scroll",a),()=>c.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?p.jsx(Iu,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:c}=n;a&&c&&(a.scrollTop=a.scrollTop+c.offsetHeight)}}):null});Nu.displayName=Jo;var Iu=S.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=bt("SelectScrollButton",n),i=S.useRef(null),a=Qr(n),c=S.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return S.useEffect(()=>()=>c(),[c]),Se(()=>{var d;const l=a().find(u=>u.ref.current===document.activeElement);(d=l==null?void 0:l.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),p.jsx(ie.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:ee(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:ee(o.onPointerMove,()=>{var l;(l=s.onItemLeave)==null||l.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:ee(o.onPointerLeave,()=>{c()})})}),rw="SelectSeparator",ow=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return p.jsx(ie.div,{"aria-hidden":!0,...r,ref:t})});ow.displayName=rw;var Qo="SelectArrow",sw=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=eo(n),s=yt(Qo,n),i=bt(Qo,n);return s.open&&i.position==="popper"?p.jsx(zr,{...o,...r,ref:t}):null});sw.displayName=Qo;function ju(e){return e===""||e===void 0}var Lu=S.forwardRef((e,t)=>{const{value:n,...r}=e,o=S.useRef(null),s=ue(t,o),i=$b(n);return S.useEffect(()=>{const a=o.current,c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==n&&d){const u=new Event("change",{bubbles:!0});d.call(a,n),a.dispatchEvent(u)}},[i,n]),p.jsx(Ss,{asChild:!0,children:p.jsx("select",{...r,ref:s,defaultValue:n})})});Lu.displayName="BubbleSelect";function $u(e){const t=Ae(e),n=S.useRef(""),r=S.useRef(0),o=S.useCallback(i=>{const a=n.current+i;t(a),function c(l){n.current=l,window.clearTimeout(r.current),l!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(a)},[t]),s=S.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function Fu(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=iw(e,Math.max(s,0));o.length===1&&(i=i.filter(l=>l!==n));const c=i.find(l=>l.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function iw(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var aw=hu,cw=mu,lw=yu,uw=bu,dw=wu,fw=xu,pw=Du,hw=ku,gw=Ou,mw=_u,vw=Au,yw=Nu;function bw({...e}){return p.jsx(aw,{"data-slot":"select",...e})}function ww({...e}){return p.jsx(lw,{"data-slot":"select-value",...e})}function xw({className:e,size:t="default",children:n,...r}){return p.jsxs(cw,{"data-slot":"select-trigger","data-size":t,className:se("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,p.jsx(uw,{asChild:!0,children:p.jsx(lc,{className:"size-4 opacity-50"})})]})}function Sw({className:e,children:t,position:n="popper",...r}){return p.jsx(dw,{children:p.jsxs(fw,{"data-slot":"select-content",className:se("bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[p.jsx(Ew,{}),p.jsx(pw,{className:se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),p.jsx(Dw,{})]})})}function Cw({className:e,children:t,...n}){return p.jsxs(hw,{"data-slot":"select-item",className:se("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[p.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:p.jsx(mw,{children:p.jsx(cc,{className:"size-4"})})}),p.jsx(gw,{children:t})]})}function Ew({className:e,...t}){return p.jsx(vw,{"data-slot":"select-scroll-up-button",className:se("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(xp,{className:"size-4"})})}function Dw({className:e,...t}){return p.jsx(yw,{"data-slot":"select-scroll-down-button",className:se("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(lc,{className:"size-4"})})}const Tw=15,nr=600,Rw=15,Mo=-Math.abs(1.98),Ks=({booking:e,onAddTime:t,onAddStartTime:n,onSubTime:r,starter:o=!1})=>{const[s,i]=R.useState({height:nr,width:nr}),[a,c]=R.useState(0),l=(T,b)=>{const E=Q.timeDiffInSeconds(T,b),M=Math.ceil(E/Tw);return-Math.abs((M-1)*2)},[d,u]=R.useState(o?l(e.finishAt,e.startAt):Mo),v=T=>T===-Math.abs(0)||T===0,h=()=>Q.timeDiffInSeconds(e.finishAt,e.startAt)===Rw,C=async T=>{if(T.includes("n")){const b=y(e.startAt,"add");if(h())return;c(E=>E+2),n&&n(b)}else{const b=x(e.finishAt,"add");u(E=>v(E)?Mo:E-2),t&&t(b)}},g=async T=>{if(T.includes("n")){const E=y(e.startAt,"remove");c(M=>M-2),n&&n(E);return}const b=x(e.finishAt,"remove");h()||(u(E=>E+2),r&&r(b))},x=(T,b)=>{const E=new Date(T),M=E.getMinutes();return b==="add"&&E.setMinutes(M+15),b==="remove"&&E.setMinutes(M-15),E},y=(T,b)=>{const E=new Date(T),M=E.getMinutes();return b==="add"&&E.setMinutes(M+15),b==="remove"&&E.setMinutes(M-15),E};return{state:s,setState:i,resetState:()=>{i({height:nr,width:nr})},resetHeightStyle:()=>{u(Mo)},heightStyle:d,topHeightIncrement:a,onResize:(T,{size:b,handle:E})=>{switch(T.stopPropagation(),T.preventDefault(),E){case"se":case"s":{i(M=>(Number(M.height)<Number(b.height)&&C(["s","se"]),Number(M.height)>Number(b.height)&&g(["s","se"]),{...M,height:b.height}));break}case"n":{i(M=>Math.abs(Number(b.height-Number(M.height)))<10?{...M,height:b.height}:(+(M.height<Number(b.height))&&g(["n"]),+(M.height>Number(b.height))&&C(["n"]),{...M,height:b.height}));break}}},updateHeightStyle:(T,b)=>{u(l(T,b))}}},Mw=R.forwardRef(({isDragging:e,slotData:t,events:{onClick:n,renderPreviewCard:r,resetPrevView:o}},s)=>{const[i,a]=R.useState(!1),c=ts(k=>k.startAt),l=xe(k=>k.bookingViewType),{systemColor:d,isTimeInfoVisible:u}=Lb(k=>k),[v,h]=R.useState(!1),[C,g]=R.useState(Q.addMinutesToHour(t.time,15)),[x,y]=R.useState(!1),f=R.useRef(null),w=x?{backgroundColor:"white",border:"none"}:{},D=R.useMemo(()=>({id:"dragging_booking_preview",startAt:Q.convertStringTimeToDateFormat(c),finishAt:Q.convertStringTimeToDateFormat(C)}),[C,c]),m=()=>{h(!0),y(!0),r()},T=()=>{h(!1),n(C),$()};R.useEffect(()=>{var k;v&&((k=f.current)==null||k.changeCurrentCardResize())},[v]);const{state:b,resetState:E,resetHeightStyle:M,heightStyle:N,onResize:A,updateHeightStyle:W}=Ks({booking:D,onAddTime:k=>{g(Q.dateTimeAsString(k))},onSubTime:k=>{g(Q.dateTimeAsString(k))}}),Y=()=>{$()},L=R.useCallback(()=>{g(Q.addMinutesToHour(t.time,15))},[t.time]),$=R.useCallback(()=>{y(!1),E(),L(),M(),o()},[L,M,o,E]);if(R.useEffect(()=>{if(!C||!c)return;const k=Q.convertStringTimeToDateFormat(C),I=Q.convertStringTimeToDateFormat(c);Number.isNaN(k)||Number.isNaN(I)||!(k instanceof Date)||!(I instanceof Date)||W(k,I)},[C,c]),R.useEffect(()=>()=>{$()},[]),R.useImperativeHandle(s,()=>({show:()=>a(!0),hide:()=>a(!1),changeIsOpen:k=>a(k)}),[]),!!i)return p.jsx("div",{style:{...w,border:u&&!e?`1.5px solid ${d}`:"none"},className:se("timeInfo_core",w),children:p.jsx(pu.Resizable,{className:"slot-resizable",height:b.height,width:b.width,onResizeStart:m,onResizeStop:T,onResize:A,resizeHandles:["se"],draggableOpts:{grid:[35,35]},handleSize:[30,30],maxConstraints:[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],transformScale:1,children:x?p.jsx("div",{className:"timeInfo_core_dragging",children:p.jsx(Us,{bookingInit:D,bookingViewType:l,slotData:{day:new Date().toISOString(),hour:"09:00"},heightStyle:N,cardContentRef:f,resizableParam:{state:b,onResize:A,customClass:"show-handle"},events:{onUnmount:Y}})}):p.jsx("div",{className:"timeInfo_core_timeParent",children:!e&&p.jsx("span",{className:"timeInfo_core_timeParent_time",style:{color:d,display:u?"initial":"none"},children:t.time})})})})}),rr=({slotData:e,slotPosition:t,disabledCss:n,events:r,actualTimerIndicatorChildren:o,children:s,ref:i})=>{const{isDragging:a,updateIsDragging:c}=en(_=>_),{emptySlotNodes:l,setSelectedNode:d,resetSelectedNode:u}=Mt(),{onModalClose:v,onSlotClick:h}=Qe(),{startAt:C,finishAt:g,updateDate:x,updateStartAt:y,updateFinishAtWithOffset:f,resetForm:w}=ts(_=>_),D=xe(_=>_.bookingViewType),[m,T]=R.useState(!1),[b,E]=R.useState(!1),M=R.useRef(null),N=R.useRef(null),A=R.useRef(null),W=()=>A.current,Y=()=>{var _;(_=A.current)==null||_.isModalOpen()},L=()=>{var _;(_=W())==null||_.showCreationModal()},$=()=>{var _;(_=N.current)==null||_.show()},k=()=>{var _;(_=N.current)==null||_.hide()},I=_=>{var ne;(ne=N.current)==null||ne.changeIsOpen(_)},O=R.useMemo(()=>({id:"dragging_booking_preview",startAt:Q.convertStringTimeToDateFormat(C),finishAt:Q.convertStringTimeToDateFormat(g)}),[g,C]),{updateHeightStyle:j,heightStyle:P}=Ks({booking:O}),F=R.useCallback(()=>{var ne,ae,fe;if(!s||typeof s!="object")return;if("props"in s&&s.props&&typeof s.props=="object"&&"bookings"in s.props&&Array.isArray(s.props.bookings)&&(ne=s.props)!=null&&ne.bookings.length&&"slotData"in s.props&&typeof((ae=s==null?void 0:s.props)==null?void 0:ae.slotData)=="object"&&(fe=s==null?void 0:s.props)!=null&&fe.slotData&&"hour"in s.props.slotData&&typeof s.props.slotData.hour=="string"&&"blockTimeString"in s.props&&typeof s.props.blockTimeString=="string"){const ve=s.props.blockTimeString,Ne=s.props.slotData.hour;if(s.props.bookings.findIndex(je=>{const _t=Number(Ne.split(":")[0]),At=Number(ve),Wn=je.startAt.getHours(),Bn=je.startAt.getMinutes();return _t===Wn&&At===Bn})!==-1)return}if(a||Y()||m)return;r.onMouseEnterEvent()===t&&$()},[t,a,m,s,r]),U=()=>{w(),c(!1),u()},V=_=>{var fe;U();const ne=dr(e),ae=l==null?void 0:l.get(ne);ae&&ae.closeEvent(),v==null||v(),_==null||_.stopPropagation(),_==null||_.preventDefault(),(fe=W())==null||fe.closeModal()},H=_=>{_||V(),T(_),I(_)},X=R.useCallback(_=>{if(U(),a&&!_)return;c(!1);const{time:ne,key:ae}=e,fe=dr({key:ae,time:ne}),ve=l==null?void 0:l.get(fe);d(fe),ve&&ve.showEvent(ne),x(ae);const Ie=f(_||ne,_?0:15);h({slotData:e,finishTime:Ie}),L()},[e,l,a,d,h,x,y,c,f]),K=()=>{a||Y()||k()},z=n.length||b?n:"hovering_slotTrigger_core",G=R.useCallback(()=>{const{time:_,key:ne}=e;c(!0),E(!0),x(ne),y(_),f(_)},[f,e,x,c,y]),q=()=>{L()},B=R.useCallback(()=>{E(!1)},[]),te=()=>{k(),L(),T(!0)};return R.useEffect(()=>{a?document.body.style.cursor="ns-resize":document.body.style.cursor="default"},[a]),R.useEffect(()=>{if(!g||!C)return;const _=Q.convertStringTimeToDateFormat(g),ne=Q.convertStringTimeToDateFormat(C);Number.isNaN(_)||Number.isNaN(ne)||!(_ instanceof Date)||!(ne instanceof Date)||j(_,ne)},[g,C]),R.useEffect(()=>{if(!m){k();return}M!=null&&M.current&&M.current.scrollIntoView({behavior:"smooth",block:"center"})},[m]),R.useEffect(()=>{s||k(),b&&$()},[s,b]),R.useEffect(()=>{b&&$()},[b]),R.useImperativeHandle(i,()=>({showEvent:_=>{y(_),te()},closeEvent:()=>{var _;(_=W())==null||_.closeModal(),T(!1),k(),B()},onOpenCloseChange:_=>{I(_),T(_),B()}})),p.jsxs(p.Fragment,{children:[p.jsxs("div",{ref:e.ref,style:{borderBottom:t==="fourth"?"1px solid #8080807a":"",...e.style},className:se("slotTrigger_core",D===re.DAY&&"slotTrigger_core_day",z),onMouseOver:F,onMouseLeave:K,onFocus:()=>{},children:[p.jsx(Mw,{ref:N,isDragging:a,slotData:e,events:{onClick:X,openOptions:q,renderPreviewCard:G,resetPrevView:B}}),o,m&&p.jsx(Us,{ref:M,bookingInit:O,bookingViewType:D,slotData:{day:new Date().toISOString(),hour:"09:00"},heightStyle:P}),s]},e.key),p.jsx(tu,{ref:A,onClose:V,onOpenChange:H,buttonTrigger:p.jsx("div",{},e.key),side:D===re.DAY?"top":"right"})]})};var Gs="Popover",[zu,Mx]=mt(Gs,[vt]),zn=vt(),[kw,wt]=zu(Gs),Wu=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!1}=e,a=zn(t),c=S.useRef(null),[l,d]=S.useState(!1),[u=!1,v]=Tt({prop:r,defaultProp:o,onChange:s});return p.jsx($r,{...a,children:p.jsx(kw,{scope:t,contentId:ft(),triggerRef:c,open:u,onOpenChange:v,onOpenToggle:S.useCallback(()=>v(h=>!h),[v]),hasCustomAnchor:l,onCustomAnchorAdd:S.useCallback(()=>d(!0),[]),onCustomAnchorRemove:S.useCallback(()=>d(!1),[]),modal:i,children:n})})};Wu.displayName=Gs;var Bu="PopoverAnchor",Hu=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=wt(Bu,n),s=zn(n),{onCustomAnchorAdd:i,onCustomAnchorRemove:a}=o;return S.useEffect(()=>(i(),()=>a()),[i,a]),p.jsx(Nn,{...s,...r,ref:t})});Hu.displayName=Bu;var Vu="PopoverTrigger",Uu=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=wt(Vu,n),s=zn(n),i=ue(t,o.triggerRef),a=p.jsx(ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Xu(o.open),...r,ref:i,onClick:ee(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:p.jsx(Nn,{asChild:!0,...s,children:a})});Uu.displayName=Vu;var qs="PopoverPortal",[Ow,Pw]=zu(qs,{forceMount:void 0}),Yu=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,s=wt(qs,t);return p.jsx(Ow,{scope:t,forceMount:n,children:p.jsx(nt,{present:n||s.open,children:p.jsx(In,{asChild:!0,container:o,children:r})})})};Yu.displayName=qs;var Kt="PopoverContent",Ku=S.forwardRef((e,t)=>{const n=Pw(Kt,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,s=wt(Kt,e.__scopePopover);return p.jsx(nt,{present:r||s.open,children:s.modal?p.jsx(Aw,{...o,ref:t}):p.jsx(Nw,{...o,ref:t})})});Ku.displayName=Kt;var _w=Ct("PopoverContent.RemoveScroll"),Aw=S.forwardRef((e,t)=>{const n=wt(Kt,e.__scopePopover),r=S.useRef(null),o=ue(t,r),s=S.useRef(!1);return S.useEffect(()=>{const i=r.current;if(i)return Os(i)},[]),p.jsx(Kr,{as:_w,allowPinchZoom:!0,children:p.jsx(Gu,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ee(e.onCloseAutoFocus,i=>{var a;i.preventDefault(),s.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:ee(e.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,l=a.button===2||c;s.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:ee(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1})})})}),Nw=S.forwardRef((e,t)=>{const n=wt(Kt,e.__scopePopover),r=S.useRef(!1),o=S.useRef(!1);return p.jsx(Gu,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var c,l;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((l=n.triggerRef.current)==null?void 0:l.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Gu=S.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:i,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:d,...u}=e,v=wt(Kt,n),h=zn(n);return ks(),p.jsx(Vr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:p.jsx(_n,{asChild:!0,disableOutsidePointerEvents:i,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>v.onOpenChange(!1),children:p.jsx(Fr,{"data-state":Xu(v.open),role:"dialog",id:v.contentId,...h,...u,ref:t,style:{...u.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),qu="PopoverClose",Iw=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=wt(qu,n);return p.jsx(ie.button,{type:"button",...r,ref:t,onClick:ee(e.onClick,()=>o.onOpenChange(!1))})});Iw.displayName=qu;var jw="PopoverArrow",Lw=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=zn(n);return p.jsx(zr,{...o,...r,ref:t})});Lw.displayName=jw;function Xu(e){return e?"open":"closed"}var $w=Wu,Fw=Hu,zw=Uu,Ww=Yu,Bw=Ku;function Hw({...e}){return p.jsx($w,{"data-slot":"popover",...e})}function Vw({...e}){return p.jsx(zw,{"data-slot":"popover-trigger",...e})}function Uw({className:e,align:t="center",sideOffset:n=4,...r}){return p.jsx(Ww,{children:p.jsx(Bw,{"data-slot":"popover-content",align:t,sideOffset:n,className:se("bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}function Yw({...e}){return p.jsx(Fw,{"data-slot":"popover-anchor",...e})}var Kw="Toggle",Zu=S.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...s}=e,[i=!1,a]=Tt({prop:n,onChange:o,defaultProp:r});return p.jsx(ie.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...s,ref:t,onClick:ee(e.onClick,()=>{e.disabled||a(!i)})})});Zu.displayName=Kw;var Gw=Zu;const qw=fs("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function Xw({className:e,variant:t,size:n,...r}){return p.jsx(Gw,{"data-slot":"toggle",className:se(qw({variant:t,size:n,className:e})),...r})}const Zw=()=>{const[e,t]=R.useState(!1);return p.jsx(Ds,{children:p.jsxs(tl,{children:[p.jsx(nl,{asChild:!0,children:p.jsx("div",{children:p.jsx(Xw,{className:"group size-10 p-0 hover:bg-indigo-50 hover:text-indigo-500 data-[state=on]:bg-indigo-50 data-[state=on]:text-indigo-500","aria-label":"Bookmark this",variant:e?"default":"outline",pressed:e,onPressedChange:t,children:p.jsx(lp,{size:16,strokeWidth:2,"aria-hidden":"true"})})})}),p.jsx(rl,{className:"border border-input bg-popover px-2 py-1 text-xs text-muted-foreground",children:p.jsx("p",{children:e?"Remove bookmark":"Bookmark this"})})]})})},Jw=({options:e,onChange:t})=>p.jsxs(bw,{onValueChange:n=>t(n),defaultValue:e[1].text,children:[p.jsx(xw,{className:"w-[180px]",children:p.jsx(ww,{placeholder:"view"})}),p.jsx(Sw,{children:e.map(n=>p.jsx(Cw,{value:n.text,children:n.text},n.text))})]}),Qw=[{text:"teste1",onClick:()=>console.log("teste1")},{text:"teste2",onClick:()=>console.log("teste2")}],ex=5,tx=0,nx=({side:e,xAxis:t,yAxis:n,updatePosition:r,children:o})=>{const{attributes:s,listeners:i,setNodeRef:a,transform:c,setActivatorNodeRef:l}=us({id:"booking-info-id",data:{type:"booking-info-options"}}),d=en(v=>v.updateIsDragging),u={transform:`translate3d(${t+((c==null?void 0:c.x)||0)}px, ${n+((c==null?void 0:c.y)||0)}px, 0)`};return kn({onDragStart(){d(!0)},onDragEnd(v){v.active.id&&r(c)}}),p.jsx(Uw,{ref:a,updatePositionStrategy:"optimized",side:e,align:"start",sticky:"always",sideOffset:ex,alignOffset:tx,style:{...u,width:"25rem"},children:p.jsxs("div",{className:"grid gap-3",children:[p.jsx("input",{type:"text",style:{position:"absolute",opacity:0,height:0,width:0}}),p.jsxs("div",{className:"flex justify-end gap-1",children:[p.jsx("div",{ref:l,className:"w-full cursor-move",...s,...i}),p.jsx(Zw,{}),p.jsx(Et,{type:"button",variant:"outline",size:"icon",children:p.jsx(Pp,{className:"h-3 w-3"})}),p.jsx(Et,{type:"button",variant:"outline",size:"icon",onClick:()=>{},children:p.jsx(Ip,{className:"h-3 w-3"})}),p.jsx(Jw,{options:Qw,onChange:()=>{}})]}),o]})})},Ea={xAxis:0,yAxis:0},Ju=({isEditingOpen:e,side:t,booking:n,onOpenChange:r,children:o})=>{const[s,i]=R.useState({...Ea}),a=en(h=>h.updateIsDragging),c=R.useMemo(()=>`${Q.dateAndHourDateToString(n.startAt)} - ${Q.dateAndHourDateToString(n.finishAt)}`,[n.startAt,n.finishAt]),l=R.useMemo(()=>{const h=new Date(n.startAt),C=h.getDate(),g=h.getDay(),x=Wt[h.getMonth()];return p.jsx("span",{children:`${Ed[g]}, ${C} ${x}`})},[n.startAt]),d=()=>({backgroundColor:""}),u=h=>{h||console.info("No transform info to show "),i({xAxis:s.xAxis+((h==null?void 0:h.x)||0),yAxis:s.yAxis+((h==null?void 0:h.y)||0)})};kn({onDragStart(h){const C=h.active.data.current,g=h.active.id,x=C.type==="booking-info-options";g&&x&&a(!0)}});const v=h=>{h===!1&&i({...Ea}),r(h)};return p.jsxs(Hw,{open:e,onOpenChange:v,defaultOpen:!1,children:[p.jsx(Yw,{style:{width:"100%"},children:p.jsx(Vw,{asChild:!0,children:o})}),p.jsx(ls,{children:p.jsx(nx,{side:t,xAxis:s.xAxis,yAxis:s.yAxis,updatePosition:u,children:p.jsxs("div",{className:"bookingCard_content",children:[p.jsx("span",{style:d(),className:"flex h-4 w-4 translate-y-0 rounded-sm"}),p.jsx("div",{className:"space-y-1",children:p.jsxs("p",{className:"text-sm text-muted-foreground",children:[l," | ",c]})})]})})})]})};Ju.displayName="BookingInfoOptions";const Da=({booking:e,slotData:t,cardsQuantity:n=1,cardIndex:r=0,lastCard:o=!1,half:s=!1,ref:i})=>{const{bookingViewType:a}=xe(),[c,l]=R.useState({...e}),[d,u]=R.useState(!1),v=R.useRef("left"),h=()=>{const m=t.day.split(":")[0].trim();if(a===re.DAY)v.current="top";else switch(m){case"Mon":case"Sun":v.current="right";break;default:v.current="left";break}u(!0)},C=async m=>{try{l(T=>({...T,finishAt:m}))}catch(T){console.log(T)}},g=async m=>{l(T=>({...T,startAt:m}))},x=async m=>{try{l(T=>({...T,finishAt:m}))}catch(T){console.log(T)}},{state:y,heightStyle:f,topHeightIncrement:w,onResize:D}=Ks({booking:c,onAddTime:C,onAddStartTime:g,onSubTime:x,starter:!0});return R.useImperativeHandle(i,()=>({bookingId:e.id}),[e.id]),p.jsx(Ju,{booking:c,onOpenChange:u,side:a===re.DAY?"top":"left",isEditingOpen:d,children:p.jsx(Us,{resizableParam:{state:y,onResize:D,resizeHandle:["s","n"]},customClasses:"Draggable",bookingInit:c,bookingViewType:a,slotData:t,topHeightIncrement:w,heightStyle:f,onClick:h,half:s,lastCard:o,cardsQuantity:n,cardIndex:r})})},or=({bookings:e,blockTimeString:t,slotData:n})=>{if(!e||!(n!=null&&n.day)&&!(n!=null&&n.hour))return null;const r=e.filter(o=>Q.dateAndHourDateToString(new Date(o.startAt)).split(":")[1]===t);if(!(!r||!(r!=null&&r.length)))return r.length===1?p.jsx(Da,{booking:r[0],slotData:n}):p.jsx(p.Fragment,{children:r.map((o,s)=>p.jsx(Da,{booking:o,half:!0,slotData:n,lastCard:r.length-1===s,cardsQuantity:r.length,cardIndex:s},o.id))})};var rx="Separator",Ta="horizontal",ox=["horizontal","vertical"],Qu=S.forwardRef((e,t)=>{const{decorative:n,orientation:r=Ta,...o}=e,s=sx(r)?r:Ta,a=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return p.jsx(ie.div,{"data-orientation":s,...a,...o,ref:t})});Qu.displayName=rx;function sx(e){return ox.includes(e)}var ix=Qu;function ax({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return p.jsx(ix,{"data-slot":"separator-root",decorative:n,orientation:t,className:se("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}const cx=fs("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function lx({className:e,variant:t,...n}){return p.jsx("div",{className:se(cx({variant:t}),e),...n})}const ux=({dateToRender:e,isFirstDay:t})=>p.jsx("div",{style:{left:t?"3px":"10px"},className:"first_day_slot",children:p.jsx("span",{children:p.jsx(lx,{children:e})})});class dx{constructor(){xt(this,"positionBasedOnSeconds",t=>{const[,n]=t.split(":");if(!t.length)return-3;const r=Number(n);return this.normalizingMinutes(r)});xt(this,"normalizingMinutes",t=>t>=0&&t<=15?t*2:t>15&&t<30?(t-15)*2:t>=30&&t<=59?t-30:-3);xt(this,"isInitialMinute",t=>t>=0&&t<=8);xt(this,"isSameHour",(t,n)=>n.split(":")[0]===t)}}class fx{constructor(){xt(this,"is15MinLess",t=>{const n=new Date,[r,o]=t.split(":"),s=new Date(n.getFullYear(),n.getMonth(),n.getDate(),Number(r),Number(o),0),i=new Date(n),a=Q.roundMinutes(n.getMinutes());i.setHours(n.getHours(),a,0,0);const c=Q.minuteDifference(s,i);return c>30||c<-30});xt(this,"normalizeDateNow",t=>{const n=t.getHours(),r=Q.roundMinutes(t.getMinutes());return`${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`})}}const sr=({color:e="#000",isFirstDay:t,slotData:n})=>{const{timesRendered:r,bookingViewType:o}=xe(),[s,i]=R.useState(""),[a,c]=R.useState(!1),[l,d]=R.useState(!1),u=R.useMemo(()=>{const f=new Date,w=new Date(n.key);return w.getDay()===f.getDay()&&w.getDate()===f.getDate()},[n.key]),v=f=>{i(f)},h=()=>{c(!0)},C=()=>{c(!1)},g=R.useMemo(()=>new dx().positionBasedOnSeconds(s),[n.time,s,r]),x=R.useMemo(()=>t?"101%":o===re.DAY?"102%":"104%",[t,o]),y=R.useMemo(()=>u?{top:`${g-2}px`,left:t?"-1px":"-3px",width:t?"101%":"104%"}:{top:`${g-1}px`,left:t?"-1px":"0px",width:x},[u,t,x,g]);if(R.useEffect(()=>{const f=n.time,w=new fx,D=()=>{const T=new Date,b=w.normalizeDateNow(T),E=Q.dateAndHourDateToString(T);s!==E&&v(E),d(b===f)};let m;return w.is15MinLess(f)||(m=setInterval(()=>D(),1e3)),()=>clearInterval(m)},[n.time,s]),!!l)return p.jsxs("div",{style:{...y},className:se("timeIndicator_today",u&&x,u&&"timeIndicator_today_circle"),onMouseEnter:h,onMouseOut:C,onBlur:()=>{},children:[p.jsx(ax,{className:"focus-effect",style:{height:u?"4px":"2px",backgroundColor:e}}),a&&p.jsx(ux,{isFirstDay:t,dateToRender:s})]})},Ra=({bookings:e,first:t,second:n,third:r,fourth:o,disabledCss:s,firstDay:i,dayHour:a})=>{const{setEmptySlotNode:c,emptySlotNodes:l}=Mt(),d=R.useCallback((u,v)=>{if(!u)return;const h=dr(v);l.get(h)||c(u,v)},[c,l]);return p.jsxs(p.Fragment,{children:[p.jsx(rr,{ref:u=>d(u,{key:t.key,time:t.time}),slotData:t,disabledCss:s,events:{onMouseEnterEvent:()=>"first"},slotPosition:"first",actualTimerIndicatorChildren:p.jsx(sr,{isFirstDay:i,slotData:t}),children:p.jsx(or,{bookings:e,blockTimeString:"00",slotData:a})}),p.jsx(rr,{ref:u=>d(u,{key:n.key,time:n.time}),slotData:n,disabledCss:s,events:{onMouseEnterEvent:()=>"second"},slotPosition:"second",actualTimerIndicatorChildren:p.jsx(sr,{isFirstDay:i,slotData:n}),children:p.jsx(or,{bookings:e,blockTimeString:"15",slotData:a})}),p.jsx(rr,{ref:u=>d(u,{key:r.key,time:r.time}),slotData:r,disabledCss:s,events:{onMouseEnterEvent:()=>"third"},slotPosition:"third",actualTimerIndicatorChildren:p.jsx(sr,{isFirstDay:i,slotData:r}),children:p.jsx(or,{bookings:e,blockTimeString:"30",slotData:a})}),p.jsx(rr,{ref:u=>d(u,{key:o.key,time:o.time}),slotData:o,disabledCss:s,events:{onMouseEnterEvent:()=>"fourth"},slotPosition:"fourth",actualTimerIndicatorChildren:p.jsx(sr,{isFirstDay:i,slotData:o}),children:p.jsx(or,{bookings:e,blockTimeString:"45",slotData:a})})]})},px=R.memo(({firstDay:e,booking:t,dayHour:n,disabledCss:r,firstBlockTimeData:o,secondBlockTimeData:s,thirdBlockTimeData:i,fourthBlockTimeData:a})=>{const{day:c,hour:l}=n,d=R.useMemo(()=>t.filter(u=>{const v=Q.dateAndHourDateToString(u.startAt),h=new Date(u.startAt).getDate(),C=new Date(c).getDate(),g=l.split(":")[0];return v.split(":")[0]===g&&h===C}),[t,n]);return d.length?p.jsx(Ra,{dayHour:n,bookings:d,first:o,second:s,third:i,fourth:a,disabledCss:r,firstDay:e}):p.jsx(Ra,{first:o,second:s,third:i,fourth:a,disabledCss:r,firstDay:e})}),hx=({dayHour:e,firstDay:t,bookingBulk:n})=>{const r=R.useRef(""),o=ou(m=>m.updateStartAt),{bookingViewType:s}=xe(Bs(m=>({bookingViewType:m.bookingViewType}))),i=R.useMemo(()=>Q.addMinuteToHour(e.hour,15),[e.hour]),a=R.useMemo(()=>Q.addMinuteToHour(e.hour,30),[e.hour]),c=R.useMemo(()=>Q.addMinuteToHour(e.hour,45),[e.hour]),{isOver:l,setNodeRef:d}=Hn({id:`${Q.newDateKey(e.day,e.hour)}`,data:{accepts:["booking-slots"]}}),{isOver:u,setNodeRef:v}=Hn({id:`${Q.newDateKey(e.day,i)}`,data:{accepts:["booking-slots"]}}),{isOver:h,setNodeRef:C}=Hn({id:`${Q.newDateKey(e.day,a)}`,data:{accepts:["booking-slots"]}}),{isOver:g,setNodeRef:x}=Hn({id:`${Q.newDateKey(e.day,c)}`,data:{accepts:["booking-slots"]}});R.useEffect(()=>{l&&o(`${Q.newDateKey(e.day,e.hour)}`),u&&o(`${Q.newDateKey(e.day,i)}`),h&&o(`${Q.newDateKey(e.day,a)}`),g&&o(`${Q.newDateKey(e.day,c)}`)},[l,u,h,g]);const y=R.useMemo(()=>({ref:d,style:{backgroundColor:l?"#0066ff":""},key:Q.newDateKey(e.day,e.hour),time:e.hour}),[e.day,l,e.hour,d]),f=R.useMemo(()=>({ref:v,style:{backgroundColor:u?"#0066ff":""},key:Q.newDateKey(e.day,i),time:i}),[e.day,u,i,v]),w=R.useMemo(()=>({ref:C,style:{backgroundColor:h?"#0066ff":""},key:Q.newDateKey(e.day,a),time:a}),[e.day,h,a,C]),D=R.useMemo(()=>({ref:x,style:{backgroundColor:g?"#0066ff":""},key:Q.newDateKey(e.day,c),time:c}),[e.day,c,g,x]);return p.jsx("td",{className:se("slot",s===re.WEEK&&"slotWeek"),children:p.jsx(px,{booking:n,dayHour:e,firstDay:t,disabledCss:r.current,firstBlockTimeData:y,secondBlockTimeData:f,thirdBlockTimeData:w,fourthBlockTimeData:D})},`${e.day}-${e.hour}-slot`)};function gx({className:e,...t}){return p.jsx("div",{"data-slot":"table-container",className:"relative w-full z-10 overflow-hidden",children:p.jsx("table",{"data-slot":"table",className:se("w-full caption-bottom text-sm",e),...t})})}function mx({className:e,...t}){return p.jsx("td",{"data-slot":"table-cell",className:se("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}const vx=({hour:e,ref:t})=>{const n="Set lunch interval",r="Remove lunch interval",o="Hour options",s=R.useRef(null),i="border-solid hover:border-b-2 hover:border-b-purple-600 border-b-white",a=()=>{s!=null&&s.current&&s.current.setAttribute("class",se("activateVisibilityTime",i))};return R.useImperativeHandle(t,()=>({setActivateHour:a})),p.jsxs(Fs,{children:[p.jsx(zs,{children:p.jsx("span",{ref:s,className:se(i),children:e})}),p.jsxs(Ws,{children:[p.jsx(Wy,{children:o}),p.jsx(By,{}),p.jsx(Gi,{children:n}),p.jsx(Gi,{children:r})]})]})},yx=()=>{const{hours:e,daysOfWeek:t,bookingViewType:n,bookingBulkData:r,addTimesRendered:o}=xe(Bs(g=>({addTimesRendered:g.addTimesRendered,bookingBulkData:g.bookingBulkData,bookingViewType:g.bookingViewType,daysOfWeek:g.daysOfWeek,hours:g.hours}))),{selectedNode:s,emptySlotNodes:i}=Mt(),{finishAt:a,updateFinishAtWithOffset:c}=ts(g=>g),[l]=R.useState({startAt:"12:00",finishAt:"12:30"}),d=R.useCallback((g,x)=>{g&&o(g,x)},[o]),u=R.useMemo(()=>n===re.DAY?{maxWidth:"5rem",padding:0,minWidth:"4rem"}:{},[n]),v=R.useMemo(()=>({borderLeft:"none",backgroundColor:"white"}),[]),h=R.useMemo(()=>s.split(";")[1],[s]);return R.useEffect(()=>{if(s){const g=i.get(s);g==null||g.showEvent(h)}},[s,i]),R.useEffect(()=>{h===a&&c(h)},[s,a]),R.useMemo(()=>{const g=x=>x===0;return p.jsx("div",{className:se("calendarCore",n===re.WEEK&&"calendarCore_max"),children:p.jsx(gx,{children:p.jsx("tbody",{children:e.map(x=>p.jsxs("tr",{children:[p.jsx(mx,{style:{...v,...u,padding:0,position:"relative"},className:"calendarCore_cell",children:p.jsx("div",{className:"calendarCore_actions",children:p.jsx(vx,{ref:y=>d(y,x),hour:x})})},`${x}-hour`),t.map((y,f)=>p.jsx(hx,{dayHour:{day:String(y),hour:x},lunchTimeBlock:l,firstDay:g(f),bookingBulk:r.booking},`${y}-${x}-slot-content`))]},`${x}-content`))})})})},[u,e,v,r.booking,d,n,t,t.length])},bx=({isLoading:e})=>{const{bookings:t}=Qe(),n={distance:5},{setBookingBulkData:r,optimisticCardUpdate:o}=xe(),{onCardDropCallback:s}=Qe(),i=Ud(ci(ec,{activationConstraint:n}),ci(tc,{activationConstraint:n})),{bookingViewType:a,daysOfWeek:c}=xe(),l=R.useCallback(h=>{const{active:C}=h;C.id},[]),d=async(h,C,g)=>{try{const{startAt:x,finishAt:y}=Q.bookingTimeRange(h,C);o(h,x,y,g),await s(h,C,g,{id:h.id,startAt:x,finishAt:y})}catch(x){console.warn(x)}},u=h=>{const{over:C,active:g}=h;if(C&&g){const x=C.data.current,y=g.data.current;y&&x&&x.accepts.includes(y.type)&&y.booking.id&&C.id&&d(y.booking,String(C.id),y.slotData)}},v={position:"absolute",top:"50%",left:"50%",transform:"translate('-50%', '-50%')",zIndex:100};return R.useEffect(()=>{r({user:gb,booking:t})},[t,r]),p.jsxs("div",{className:"calendarHolder",children:[p.jsx(lb,{...ru,children:p.jsxs("div",{className:"calendarHolder_parent",children:[p.jsx(tb,{}),p.jsxs("div",{className:"calendarHolder_parent_content",children:[p.jsx(Gy,{daysOfWeek:c,bookingViewType:a}),p.jsx(nb,{children:p.jsx(ls,{onDragEnd:u,onDragStart:l,sensors:i,children:p.jsx(yx,{})})})]})]})}),p.jsx(hb,{color:"#000000aa",loading:e,cssOverride:v,size:15,"aria-label":"Loading Spinner","data-testid":"GridLoader"})]})},wx=({viewModes:e,createBookingModal:t,onChangeViewType:n,onCardDropCallback:r,onCardResizeEnd:o,onDayChange:s,onHeaderDayClick:i,onTodayClick:a,onSlotClick:c,onModalClose:l,bookings:d,isTimeInfoVisible:u,systemColor:v,ref:h})=>{const[C,g]=R.useState(!1),x=R.useRef(null),{setBookingViewType:y,setWeekAndViewType:f,setTodayDayAndViewType:w,bookingViewType:D,setTodayDay:m,todayWeek:T}=xe(),{setSelectedNode:b}=Mt(A=>A),E=A=>{var W;console.log("hour24Format",A),(W=x==null?void 0:x.current)==null||W.updateFinishAt(A)},M=A=>{m(new Date(A))},N=A=>{T(new Date(A))};return R.useImperativeHandle(h,()=>({updateViewType:A=>y(A),updateWeekAndViewType:A=>f(A),updateTodayDayAndViewType:A=>w(A),updateSelectedNode:A=>{setTimeout(()=>{b(A)},10)},updateFinishAt:A=>E(A),changeLoading:A=>g(A),goToDay:A=>M(A),goToWeek:A=>N(A)})),R.useEffect(()=>{n(D)},[D]),p.jsx(ab,{isTimeInfoVisible:u,systemColor:v,children:p.jsx(rb,{...ka,children:p.jsx(ob,{createBookingModal:t,viewModes:e,onHeaderDayClick:i,onTodayClick:a,onCardDropCallback:r,onCardResizeEnd:o,onDayChange:s,onSlotClick:c,onModalClose:l,bookings:d,children:p.jsx(_d,{ref:x,...Po,children:p.jsx(bx,{isLoading:C})})})})})},xx=e=>{const t=R.useRef(null),n=()=>{if(!(t!=null&&t.current))throw new cd};return{getCalendar:()=>p.jsx(wx,{ref:t,...e}),updateViewType:v=>{var h;n(),(h=t.current)==null||h.updateViewType(v)},updateWeekAndViewType:v=>{var h;return n(),(h=t.current)==null?void 0:h.updateWeekAndViewType(v)},updateTodayDayAndViewType:v=>{var h;return n(),(h=t.current)==null?void 0:h.updateTodayDayAndViewType(v)},updateSelectedNode:v=>{var h;n(),(h=t.current)==null||h.updateSelectedNode(v)},updateFinishAt:v=>{var h;n(),(h=t.current)==null||h.updateFinishAt(v)},changeLoading:v=>{var h;n(),(h=t.current)==null||h.changeLoading(v)},goToDay:v=>{var h;n(),(h=t.current)==null||h.goToDay(v)},goToWeek:v=>{var h;n(),(h=t.current)==null||h.goToWeek(v)}}};exports.useCalendarInstance=xx;
|
package/dist/build/main.es.js
CHANGED
|
@@ -16049,83 +16049,83 @@ const gr = ({
|
|
|
16049
16049
|
}
|
|
16050
16050
|
), _S = ({
|
|
16051
16051
|
dayHour: e,
|
|
16052
|
-
lunchTimeBlock
|
|
16053
|
-
firstDay:
|
|
16054
|
-
bookingBulk:
|
|
16052
|
+
// lunchTimeBlock,
|
|
16053
|
+
firstDay: t,
|
|
16054
|
+
bookingBulk: n
|
|
16055
16055
|
}) => {
|
|
16056
|
-
const
|
|
16057
|
-
ns((
|
|
16058
|
-
bookingViewType:
|
|
16056
|
+
const r = ce(""), o = bu((g) => g.updateStartAt), { bookingViewType: i } = Re(
|
|
16057
|
+
ns((g) => ({
|
|
16058
|
+
bookingViewType: g.bookingViewType
|
|
16059
16059
|
}))
|
|
16060
|
-
),
|
|
16060
|
+
), s = te(() => J.addMinuteToHour(e.hour, 15), [e.hour]), a = te(() => J.addMinuteToHour(e.hour, 30), [e.hour]), c = te(() => J.addMinuteToHour(e.hour, 45), [e.hour]), { isOver: l, setNodeRef: d } = Qn({
|
|
16061
16061
|
id: `${J.newDateKey(e.day, e.hour)}`,
|
|
16062
16062
|
data: { accepts: ["booking-slots"] }
|
|
16063
16063
|
// disabled: isTimeLunch(dayHour.hour),
|
|
16064
|
-
}), { isOver:
|
|
16064
|
+
}), { isOver: u, setNodeRef: m } = Qn(
|
|
16065
16065
|
{
|
|
16066
|
-
id: `${J.newDateKey(e.day,
|
|
16066
|
+
id: `${J.newDateKey(e.day, s)}`,
|
|
16067
16067
|
data: { accepts: ["booking-slots"] }
|
|
16068
16068
|
// disabled: isTimeLunch(secondBlockTime),
|
|
16069
16069
|
}
|
|
16070
|
-
), { isOver:
|
|
16071
|
-
id: `${J.newDateKey(e.day,
|
|
16070
|
+
), { isOver: p, setNodeRef: C } = Qn({
|
|
16071
|
+
id: `${J.newDateKey(e.day, a)}`,
|
|
16072
16072
|
data: { accepts: ["booking-slots"] }
|
|
16073
16073
|
// disabled: isTimeLunch(thirdBlockTime),
|
|
16074
|
-
}), { isOver:
|
|
16074
|
+
}), { isOver: h, setNodeRef: S } = Qn(
|
|
16075
16075
|
{
|
|
16076
|
-
id: `${J.newDateKey(e.day,
|
|
16076
|
+
id: `${J.newDateKey(e.day, c)}`,
|
|
16077
16077
|
data: { accepts: ["booking-slots"] }
|
|
16078
16078
|
// disabled: isTimeLunch(fourthBlockTime),
|
|
16079
16079
|
}
|
|
16080
16080
|
);
|
|
16081
16081
|
oe(() => {
|
|
16082
|
-
|
|
16082
|
+
l && o(`${J.newDateKey(e.day, e.hour)}`), u && o(
|
|
16083
|
+
`${J.newDateKey(e.day, s)}`
|
|
16084
|
+
), p && o(
|
|
16083
16085
|
`${J.newDateKey(e.day, a)}`
|
|
16084
|
-
),
|
|
16086
|
+
), h && o(
|
|
16085
16087
|
`${J.newDateKey(e.day, c)}`
|
|
16086
|
-
), S && i(
|
|
16087
|
-
`${J.newDateKey(e.day, l)}`
|
|
16088
16088
|
);
|
|
16089
|
-
}, [
|
|
16090
|
-
const
|
|
16091
|
-
ref:
|
|
16092
|
-
style: { backgroundColor:
|
|
16089
|
+
}, [l, u, p, h]);
|
|
16090
|
+
const v = te(() => ({
|
|
16091
|
+
ref: d,
|
|
16092
|
+
style: { backgroundColor: l ? "#0066ff" : "" },
|
|
16093
16093
|
key: J.newDateKey(e.day, e.hour),
|
|
16094
16094
|
time: e.hour
|
|
16095
|
-
}), [e.day,
|
|
16096
|
-
ref:
|
|
16097
|
-
style: { backgroundColor:
|
|
16095
|
+
}), [e.day, l, e.hour, d]), f = te(() => ({
|
|
16096
|
+
ref: m,
|
|
16097
|
+
style: { backgroundColor: u ? "#0066ff" : "" },
|
|
16098
|
+
key: J.newDateKey(e.day, s),
|
|
16099
|
+
time: s
|
|
16100
|
+
}), [e.day, u, s, m]), b = te(() => ({
|
|
16101
|
+
ref: C,
|
|
16102
|
+
style: { backgroundColor: p ? "#0066ff" : "" },
|
|
16098
16103
|
key: J.newDateKey(e.day, a),
|
|
16099
16104
|
time: a
|
|
16100
|
-
}), [e.day,
|
|
16101
|
-
ref:
|
|
16102
|
-
style: { backgroundColor:
|
|
16105
|
+
}), [e.day, p, a, C]), E = te(() => ({
|
|
16106
|
+
ref: S,
|
|
16107
|
+
style: { backgroundColor: h ? "#0066ff" : "" },
|
|
16103
16108
|
key: J.newDateKey(e.day, c),
|
|
16104
16109
|
time: c
|
|
16105
|
-
}), [e.day,
|
|
16106
|
-
ref: v,
|
|
16107
|
-
style: { backgroundColor: S ? "#0066ff" : "" },
|
|
16108
|
-
key: J.newDateKey(e.day, l),
|
|
16109
|
-
time: l
|
|
16110
|
-
}), [e.day, l, S, v]);
|
|
16110
|
+
}), [e.day, c, h, S]);
|
|
16111
16111
|
return /* @__PURE__ */ w(
|
|
16112
16112
|
"td",
|
|
16113
16113
|
{
|
|
16114
16114
|
className: ue(
|
|
16115
16115
|
"slot",
|
|
16116
|
-
|
|
16116
|
+
i === ie.WEEK && "slotWeek"
|
|
16117
16117
|
),
|
|
16118
16118
|
children: /* @__PURE__ */ w(
|
|
16119
16119
|
PS,
|
|
16120
16120
|
{
|
|
16121
|
-
booking:
|
|
16121
|
+
booking: n,
|
|
16122
16122
|
dayHour: e,
|
|
16123
|
-
firstDay:
|
|
16124
|
-
disabledCss:
|
|
16125
|
-
firstBlockTimeData:
|
|
16126
|
-
secondBlockTimeData:
|
|
16127
|
-
thirdBlockTimeData:
|
|
16128
|
-
fourthBlockTimeData:
|
|
16123
|
+
firstDay: t,
|
|
16124
|
+
disabledCss: r.current,
|
|
16125
|
+
firstBlockTimeData: v,
|
|
16126
|
+
secondBlockTimeData: f,
|
|
16127
|
+
thirdBlockTimeData: b,
|
|
16128
|
+
fourthBlockTimeData: E
|
|
16129
16129
|
}
|
|
16130
16130
|
)
|
|
16131
16131
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
declare const buttonVariants: (props?: ({
|
|
3
|
-
variant?: "
|
|
3
|
+
variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
4
4
|
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
5
5
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
6
|
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
@@ -9,5 +9,5 @@ interface SlotsProps {
|
|
|
9
9
|
firstDay: boolean;
|
|
10
10
|
bookingBulk: Booking[];
|
|
11
11
|
}
|
|
12
|
-
declare const Slots: ({ dayHour,
|
|
12
|
+
declare const Slots: ({ dayHour, firstDay, bookingBulk, }: SlotsProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export default Slots;
|