@mngh/jalali-datepicker 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,13 @@
1
+ # 📅 Jalali Datepicker (تقویم و انتخاب‌گر تاریخ جلالی)
2
+
3
+ A modern, highly customizable, accessible, and lightweight Jalali Date & Time Picker for React.
4
+
5
+ ## 📦 نصب (Installation)
6
+
7
+ ```bash
8
+ npm install jalali-datepicker
9
+ # یا
10
+ pnpm add jalali-datepicker
11
+ # یا
12
+ yarn add jalali-datepicker
13
+ ```
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="48" height="46" fill="none" viewBox="0 0 48 46"><path fill="#863bff" d="M25.946 44.938c-.664.845-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.287c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.497 0-3.578-1.842-3.578H1.237c-.92 0-1.456-1.04-.92-1.788L10.013.474c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.579 1.842 3.579h11.377c.943 0 1.473 1.088.89 1.83L25.947 44.94z" style="fill:#863bff;fill:color(display-p3 .5252 .23 1);fill-opacity:1"/><mask id="a" width="48" height="46" x="0" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#000" d="M25.842 44.938c-.664.844-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.183c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.498 0-3.579-1.842-3.579H1.133c-.92 0-1.456-1.04-.92-1.787L9.91.473c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.578 1.842 3.578h11.377c.943 0 1.473 1.088.89 1.832L25.843 44.94z" style="fill:#000;fill-opacity:1"/></mask><g mask="url(#a)"><g filter="url(#b)"><ellipse cx="5.508" cy="14.704" fill="#ede6ff" rx="5.508" ry="14.704" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -4.47 31.516)"/></g><g filter="url(#c)"><ellipse cx="10.399" cy="29.851" fill="#ede6ff" rx="10.399" ry="29.851" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -39.328 7.883)"/></g><g filter="url(#d)"><ellipse cx="5.508" cy="30.487" fill="#7e14ff" rx="5.508" ry="30.487" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -25.913 -14.639)scale(1 -1)"/></g><g filter="url(#e)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -32.644 -3.334)scale(1 -1)"/></g><g filter="url(#f)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -34.34 30.47)"/></g><g filter="url(#g)"><ellipse cx="14.072" cy="22.078" fill="#ede6ff" rx="14.072" ry="22.078" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="rotate(93.35 24.506 48.493)scale(-1 1)"/></g><g filter="url(#h)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#i)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#j)"><ellipse cx=".387" cy="8.972" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(39.51 .387 8.972)"/></g><g filter="url(#k)"><ellipse cx="47.523" cy="-6.092" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 47.523 -6.092)"/></g><g filter="url(#l)"><ellipse cx="41.412" cy="6.333" fill="#47bfff" rx="5.971" ry="9.665" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 41.412 6.333)"/></g><g filter="url(#m)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#n)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#o)"><ellipse cx="35.651" cy="29.907" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 35.651 29.907)"/></g><g filter="url(#p)"><ellipse cx="38.418" cy="32.4" fill="#47bfff" rx="5.971" ry="15.297" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 38.418 32.4)"/></g></g><defs><filter id="b" width="60.045" height="41.654" x="-19.77" y="16.149" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="c" width="90.34" height="51.437" x="-54.613" y="-7.533" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="d" width="79.355" height="29.4" x="-49.64" y="2.03" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="e" width="79.579" height="29.4" x="-45.045" y="20.029" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="f" width="79.579" height="29.4" x="-43.513" y="21.178" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="g" width="74.749" height="58.852" x="15.756" y="-17.901" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="h" width="61.377" height="25.362" x="23.548" y="2.284" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="i" width="61.377" height="25.362" x="23.548" y="2.284" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="j" width="56.045" height="63.649" x="-27.636" y="-22.853" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="k" width="54.814" height="64.646" x="20.116" y="-38.415" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="l" width="33.541" height="35.313" x="24.641" y="-11.323" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="m" width="54.814" height="64.646" x="-29.286" y="6.009" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="n" width="54.814" height="64.646" x="-29.286" y="6.009" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="o" width="54.814" height="64.646" x="8.244" y="-2.416" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="p" width="39.409" height="43.623" x="18.713" y="10.588" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter></defs></svg>
package/dist/icons.svg ADDED
@@ -0,0 +1,24 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg">
2
+ <symbol id="bluesky-icon" viewBox="0 0 16 17">
3
+ <g clip-path="url(#bluesky-clip)"><path fill="#08060d" d="M7.75 7.735c-.693-1.348-2.58-3.86-4.334-5.097-1.68-1.187-2.32-.981-2.74-.79C.188 2.065.1 2.812.1 3.251s.241 3.602.398 4.13c.52 1.744 2.367 2.333 4.07 2.145-2.495.37-4.71 1.278-1.805 4.512 3.196 3.309 4.38-.71 4.987-2.746.608 2.036 1.307 5.91 4.93 2.746 2.72-2.746.747-4.143-1.747-4.512 1.702.189 3.55-.4 4.07-2.145.156-.528.397-3.691.397-4.13s-.088-1.186-.575-1.406c-.42-.19-1.06-.395-2.741.79-1.755 1.24-3.64 3.752-4.334 5.099"/></g>
4
+ <defs><clipPath id="bluesky-clip"><path fill="#fff" d="M.1.85h15.3v15.3H.1z"/></clipPath></defs>
5
+ </symbol>
6
+ <symbol id="discord-icon" viewBox="0 0 20 19">
7
+ <path fill="#08060d" d="M16.224 3.768a14.5 14.5 0 0 0-3.67-1.153c-.158.286-.343.67-.47.976a13.5 13.5 0 0 0-4.067 0c-.128-.306-.317-.69-.476-.976A14.4 14.4 0 0 0 3.868 3.77C1.546 7.28.916 10.703 1.231 14.077a14.7 14.7 0 0 0 4.5 2.306q.545-.748.965-1.587a9.5 9.5 0 0 1-1.518-.74q.191-.14.372-.293c2.927 1.369 6.107 1.369 8.999 0q.183.152.372.294-.723.437-1.52.74.418.838.963 1.588a14.6 14.6 0 0 0 4.504-2.308c.37-3.911-.63-7.302-2.644-10.309m-9.13 8.234c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.894 0 1.614.82 1.599 1.82.001 1-.705 1.82-1.6 1.82m5.91 0c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.893 0 1.614.82 1.599 1.82 0 1-.706 1.82-1.6 1.82"/>
8
+ </symbol>
9
+ <symbol id="documentation-icon" viewBox="0 0 21 20">
10
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="m15.5 13.333 1.533 1.322c.645.555.967.833.967 1.178s-.322.623-.967 1.179L15.5 18.333m-3.333-5-1.534 1.322c-.644.555-.966.833-.966 1.178s.322.623.966 1.179l1.534 1.321"/>
11
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M17.167 10.836v-4.32c0-1.41 0-2.117-.224-2.68-.359-.906-1.118-1.621-2.08-1.96-.599-.21-1.349-.21-2.848-.21-2.623 0-3.935 0-4.983.369-1.684.591-3.013 1.842-3.641 3.428C3 6.449 3 7.684 3 10.154v2.122c0 2.558 0 3.838.706 4.726q.306.383.713.671c.76.536 1.79.64 3.581.66"/>
12
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M3 10a2.78 2.78 0 0 1 2.778-2.778c.555 0 1.209.097 1.748-.047.48-.129.854-.503.982-.982.145-.54.048-1.194.048-1.749a2.78 2.78 0 0 1 2.777-2.777"/>
13
+ </symbol>
14
+ <symbol id="github-icon" viewBox="0 0 19 19">
15
+ <path fill="#08060d" fill-rule="evenodd" d="M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844" clip-rule="evenodd"/>
16
+ </symbol>
17
+ <symbol id="social-icon" viewBox="0 0 20 20">
18
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M12.5 6.667a4.167 4.167 0 1 0-8.334 0 4.167 4.167 0 0 0 8.334 0"/>
19
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M2.5 16.667a5.833 5.833 0 0 1 8.75-5.053m3.837.474.513 1.035c.07.144.257.282.414.309l.93.155c.596.1.736.536.307.965l-.723.73a.64.64 0 0 0-.152.531l.207.903c.164.715-.213.991-.84.618l-.872-.52a.63.63 0 0 0-.577 0l-.872.52c-.624.373-1.003.094-.84-.618l.207-.903a.64.64 0 0 0-.152-.532l-.723-.729c-.426-.43-.289-.864.306-.964l.93-.156a.64.64 0 0 0 .412-.31l.513-1.034c.28-.562.735-.562 1.012 0"/>
20
+ </symbol>
21
+ <symbol id="x-icon" viewBox="0 0 19 19">
22
+ <path fill="#08060d" fill-rule="evenodd" d="M1.893 1.98c.052.072 1.245 1.769 2.653 3.77l2.892 4.114c.183.261.333.48.333.486s-.068.089-.152.183l-.522.593-.765.867-3.597 4.087c-.375.426-.734.834-.798.905a1 1 0 0 0-.118.148c0 .01.236.017.664.017h.663l.729-.83c.4-.457.796-.906.879-.999a692 692 0 0 0 1.794-2.038c.034-.037.301-.34.594-.675l.551-.624.345-.392a7 7 0 0 1 .34-.374c.006 0 .93 1.306 2.052 2.903l2.084 2.965.045.063h2.275c1.87 0 2.273-.003 2.266-.021-.008-.02-1.098-1.572-3.894-5.547-2.013-2.862-2.28-3.246-2.273-3.266.008-.019.282-.332 2.085-2.38l2-2.274 1.567-1.782c.022-.028-.016-.03-.65-.03h-.674l-.3.342a871 871 0 0 1-1.782 2.025c-.067.075-.405.458-.75.852a100 100 0 0 1-.803.91c-.148.172-.299.344-.99 1.127-.304.343-.32.358-.345.327-.015-.019-.904-1.282-1.976-2.808L6.365 1.85H1.8zm1.782.91 8.078 11.294c.772 1.08 1.413 1.973 1.425 1.984.016.017.241.02 1.05.017l1.03-.004-2.694-3.766L7.796 5.75 5.722 2.852l-1.039-.004-1.039-.004z" clip-rule="evenodd"/>
23
+ </symbol>
24
+ </svg>
package/dist/index.cjs ADDED
@@ -0,0 +1,2 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,s)=>(s=n==null?{}:e(i(n)),o(r||!n||!n.__esModule||!a.call(n,`default`)?t(s,`default`,{value:n,enumerable:!0}):s,n));let c=require("react");c=s(c,1);let l=require("react/jsx-runtime");var u=[`فروردین`,`اردیبهشت`,`خرداد`,`تیر`,`مرداد`,`شهریور`,`مهر`,`آبان`,`آذر`,`دی`,`بهمن`,`اسفند`],d=[`Farvardin`,`Ordibehesht`,`Khordad`,`Tir`,`Mordad`,`Shahrivar`,`Mehr`,`Aban`,`Azar`,`Dey`,`Bahman`,`Esfand`],f=[`ش`,`ی`,`د`,`س`,`چ`,`پ`,`ج`],p=[`شنبه`,`یکشنبه`,`دوشنبه`,`سه‌شنبه`,`چهارشنبه`,`پنج‌شنبه`,`جمعه`];function m(e){let t=[-61,9,38,199,426,686,756,818,1111,1181,1210,1635,2060,2097,2192,2262,2324,2394,2456,3178],n=t[0],r=0;if(e<n||e>=t[t.length-1])throw Error(`Jalali year ${e} is outside supported range.`);for(let i=1;i<t.length;i++){let a=t[i];if(r=a-n,e<a)break;n=a}let i=e-n;r-i<6&&(i=i-r+(r+4)/33*33);let a=(i+1)%33-1;return a===-1&&(a=4),a%4==0}function h(e,t){if(t<0||t>11)throw RangeError(`Month index must be between 0 (Farvardin) and 11 (Esfand).`);return t<=5?31:t<=10||m(e)?30:29}function g(e,t,n){let r=[0,31,e%4==0&&e%100!=0||e%400==0?29:28,31,30,31,30,31,31,30,31,30,31],i,a,o,s=t>2?e+1:e,c=355666+365*e+Math.floor((s+3)/4)-Math.floor((s+99)/100)+Math.floor((s+399)/400)+n;for(let e=0;e<t;++e)c+=r[e];return i=-1595+33*Math.floor(c/12053),c%=12053,i+=4*Math.floor(c/1461),c%=1461,c>365&&(i+=Math.floor((c-1)/365),c=(c-1)%365),c<186?(a=Math.floor(c/31),o=1+c%31):(a=6+Math.floor((c-186)/30),o=1+(c-186)%30),{year:i,month:a,day:o}}function _(e,t,n){let r,i,a,o=e+1595,s=-355668+365*o+Math.floor(o/33)*8+Math.floor((o%33+3)/4)+n+(t<6?t*31:(t-6)*30+186);r=400*Math.floor(s/146097),s%=146097,s>36524&&(r+=100*Math.floor(--s/36524),s%=36524,s>=365&&s++),r+=4*Math.floor(s/1461),s%=1461,s>365&&(r+=Math.floor((s-1)/365),s=(s-1)%365),a=s+1;let c=[0,31,r%4==0&&r%100!=0||r%400==0?29:28,31,30,31,30,31,31,30,31,30,31];for(i=0;i<13&&a>c[i];i++)a-=c[i];let l=new Date(r,i-1,a);return l.setHours(0,0,0,0),l}function v(){let e=new Date;return g(e.getFullYear(),e.getMonth()+1,e.getDate())}function y(e,t){return!e||!t?!1:e.year===t.year&&e.month===t.month&&e.day===t.day}function b(e){return e instanceof Date?g(e.getFullYear(),e.getMonth()+1,e.getDate()):e}function x(e){let{year:t,month:n,firstDayOfWeek:r=0,selectedDate:i,minDate:a,maxDate:o,isDateDisabled:s}=e,c=[],l=v(),u=i?b(i):null,d=a?b(a):null,f=o?b(o):null,p=((_(t,n,1).getDay()+1)%7-r+7)%7,m=n===0?11:n-1,g=n===0?t-1:t,x=h(g,m);for(let e=p-1;e>=0;e--){let t={year:g,month:m,day:x-e};c.push(E(t,!1))}let S=h(t,n);for(let e=1;e<=S;e++){let r={year:t,month:n,day:e};c.push(E(r,!0))}let C=n===11?0:n+1,w=n===11?t+1:t,T=42-c.length;for(let e=1;e<=T;e++){let t={year:w,month:C,day:e};c.push(E(t,!1))}function E(e,t){let n=_(e.year,e.month,e.day),r=y(e,l),i=u?y(e,u):!1,a=!1;if(d){let e=_(d.year,d.month,d.day);n.getTime()<e.getTime()&&(a=!0)}if(f){let e=_(f.year,f.month,f.day);n.getTime()>e.getTime()&&(a=!0)}return s&&s(e,n)&&(a=!0),{jalali:e,gregorianDate:n,dayNumber:e.day,isCurrentMonth:t,isToday:r,isSelected:i,isDisabled:a}}return c}function S(e,t,n){return(_(e,t,n).getDay()+1)%7}function C(e,t){let n=_(e.year,e.month,e.day);return n.setDate(n.getDate()+t),g(n.getFullYear(),n.getMonth()+1,n.getDate())}var w=C;function T(e,t){return e.year===t.year?e.month===t.month?e.day===t.day?0:e.day<t.day?-1:1:e.month<t.month?-1:1:e.year<t.year?-1:1}function E(e,t,n,r=!0){let i=T(t,n)<=0?t:n,a=T(t,n)<=0?n:t,o=T(e,i),s=T(e,a);return r?o>=0&&s<=0:o>0&&s<0}function D(e){let t=C(e,-S(e.year,e.month,e.day));return[t,C(t,6)]}function O(e){let t=h(e.year,e.month);return[{year:e.year,month:e.month,day:1},{year:e.year,month:e.month,day:t}]}function k(e={}){let{mode:t=`single`,value:n,defaultValue:r,onChange:i,initialViewDate:a,firstDayOfWeek:o=0,minDate:s,maxDate:l,isDateDisabled:u}=e,[d,f]=(0,c.useState)(()=>r===void 0?t===`single`?null:t===`range`?[null,null]:[]:r),p=n===void 0?d:n,[m,h]=(0,c.useState)(null),g=(0,c.useMemo)(()=>v(),[]),[_,b]=(0,c.useState)(()=>{if(a)return a;if(t===`single`&&p)return{year:p.year,month:p.month};if(t===`range`&&p?.[0]){let e=p[0];return{year:e.year,month:e.month}}return{year:g.year,month:g.month}}),S=(0,c.useCallback)(()=>{b(e=>e.month===11?{year:e.year+1,month:0}:{year:e.year,month:e.month+1})},[]),C=(0,c.useCallback)(()=>{b(e=>e.month===0?{year:e.year-1,month:11}:{year:e.year,month:e.month-1})},[]),w=(0,c.useCallback)((e,t)=>{b({year:e,month:t})},[]),D=(0,c.useCallback)(()=>{b({year:g.year,month:g.month})},[g]),O=(0,c.useCallback)(e=>{if(t===`single`)return y(p,e);if(t===`range`){let[t,n]=p||[null,null];return y(t,e)||y(n,e)}return t===`multiple`&&(p||[]).some(t=>y(t,e))},[t,p]),k=(0,c.useCallback)(e=>{n===void 0&&f(e),i?.(e)},[n,i]),A=(0,c.useCallback)(e=>{if(t===`single`)k(e);else if(t===`multiple`){let t=p||[],n=t.some(t=>y(t,e))?t.filter(t=>!y(t,e)):[...t,e].sort(T);k(n)}else if(t===`range`){let[t,n]=p||[null,null];!t||t&&n?k([e,null]):(T(e,t)<0?k([e,t]):k([t,e]),h(null))}},[t,p,k]),j=(0,c.useCallback)(()=>{k(t===`single`?null:t===`range`?[null,null]:[])},[t,k]),M=(0,c.useMemo)(()=>x({year:_.year,month:_.month,firstDayOfWeek:o,minDate:s,maxDate:l,isDateDisabled:u}),[_.year,_.month,o,s,l,u]),N=(0,c.useMemo)(()=>{let e=t===`range`?p?.[0]:null,n=(t===`range`?p?.[1]:null)??(e&&m?m:null);return M.map(r=>{let i=O(r.jalali),a=!1,o=!1,s=!1;return t===`range`&&e&&(o=y(r.jalali,e),s=n?y(r.jalali,n):!1,n&&(a=E(r.jalali,e,n))),{...r,isSelected:i,isInRange:a,isRangeStart:o,isRangeEnd:s}})},[M,t,p,m,O]);return{selected:p,viewYear:_.year,viewMonth:_.month,grid:N,goToPrevMonth:C,goToNextMonth:S,setView:w,goToToday:D,selectDate:A,setHoverDate:h,clear:j,isDateSelected:O,hoverDate:m}}function A(e){let{currentFocused:t,key:n,isRtl:r=!0}=e,{year:i,month:a,day:o}=t,s=!1,c=!0,l=r?1:-1,u=r?-1:1;switch(n){case`ArrowRight`:o+=u;break;case`ArrowLeft`:o+=l;break;case`ArrowUp`:o-=7;break;case`ArrowDown`:o+=7;break;case`Home`:o=1;break;case`End`:o=h(i,a);break;case`PageUp`:a===0?(--i,a=11):--a,s=!0;break;case`PageDown`:a===11?(i+=1,a=0):a+=1,s=!0;break;default:return c=!1,{nextDate:t,viewChanged:!1,handled:!1}}for(;o<1;)a===0?(--i,a=11):--a,o+=h(i,a),s=!0;for(;o>h(i,a);)o-=h(i,a),a===11?(i+=1,a=0):a+=1,s=!0;return{nextDate:{year:i,month:a,day:o},viewChanged:s,handled:c}}function j(e){let t=p[(_(e.year,e.month,e.day).getDay()+1)%7],n=u[e.month];return`${t}، ${e.day} ${n} ${e.year}`}function M(e){let{viewYear:t,viewMonth:n,selectedDate:r,onSelectDate:i,onViewChange:a,isRtl:o=!0}=e,[s,l]=(0,c.useState)(()=>r??{year:t,month:n,day:1});return{focusedDate:s,setFocusedDate:l,handleKeyDown:(0,c.useCallback)(e=>{if(e.key===`Enter`||e.key===` `){e.preventDefault(),i(s);return}let t=A({currentFocused:s,key:e.key,isRtl:o});t.handled&&(e.preventDefault(),l(t.nextDate),t.viewChanged&&a(t.nextDate.year,t.nextDate.month))},[s,o,i,a]),getCellTabIndex:(0,c.useCallback)(e=>y(e,s)?0:-1,[s])}}var N=[`۰`,`۱`,`۲`,`۳`,`۴`,`۵`,`۶`,`۷`,`۸`,`۹`],ee={"۰":`0`,"۱":`1`,"۲":`2`,"۳":`3`,"۴":`4`,"۵":`5`,"۶":`6`,"۷":`7`,"۸":`8`,"۹":`9`,"٠":`0`,"١":`1`,"٢":`2`,"٣":`3`,"٤":`4`,"٥":`5`,"٦":`6`,"٧":`7`,"٨":`8`,"٩":`9`};function P(e){return String(e).replace(/[0-9]/g,e=>N[+e])}function F(e){return e.replace(/[۰-۹٠-٩]/g,e=>ee[e]??e)}function I(e,t=`YYYY/MM/DD`,n={}){if(!e)return``;let{digitType:r=`persian`}=n,i=(_(e.year,e.month,e.day).getDay()+1)%7,a=String(e.year),o=a.slice(-2),s=e.month+1,c=s<10?`0${s}`:String(s),l=u[e.month],d=e.day<10?`0${e.day}`:String(e.day),f=p[i],m=t.replace(/\bYYYY\b/g,a).replace(/\bYY\b/g,o).replace(/\bMMMM\b/g,l).replace(/\bMM\b/g,c).replace(/\bM\b/g,String(s)).replace(/\bdddd\b/g,f).replace(/\bDD\b/g,d).replace(/\bD\b/g,String(e.day));return r===`persian`&&(m=m.replace(/\d+/g,e=>P(e))),m}var L={primaryColor:`#0284c7`,primaryHover:`#0369a1`,primaryActive:`#075985`,primaryContrastText:`#ffffff`,rangeBetweenBg:`#e0f2fe`,rangeBetweenText:`#0369a1`,surfaceBg:`#ffffff`,surfaceBorder:`#e2e8f0`,headerBg:`#f8fafc`,textPrimary:`#0f172a`,textSecondary:`#475569`,textMuted:`#94a3b8`,textDisabled:`#cbd5e1`,todayIndicatorColor:`#0284c7`,borderRadius:`8px`,cellSize:`36px`,shadow:`0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)`,fontFamily:`inherit`},R={primaryColor:`#38bdf8`,primaryHover:`#7dd3fc`,primaryActive:`#bae6fd`,primaryContrastText:`#0f172a`,rangeBetweenBg:`#082f49`,rangeBetweenText:`#7dd3fc`,surfaceBg:`#0f172a`,surfaceBorder:`#334155`,headerBg:`#1e293b`,textPrimary:`#f8fafc`,textSecondary:`#cbd5e1`,textMuted:`#64748b`,textDisabled:`#475569`,todayIndicatorColor:`#38bdf8`,borderRadius:`8px`,cellSize:`36px`,shadow:`0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5)`,fontFamily:`inherit`};function z(e){let t={};for(let[n,r]of Object.entries(e))if(r!==void 0){let e=`--pdp-${n.replace(/([A-Z])/g,`-$1`).toLowerCase()}`;t[e]=r}return t}var B=(0,c.createContext)({tokens:L,mode:`light`}),te=({mode:e=`light`,customTokens:t,children:n})=>{let r=(0,c.useMemo)(()=>({...e===`dark`?R:L,...t}),[e,t]),i=(0,c.useMemo)(()=>z(r),[r]);return(0,l.jsx)(B.Provider,{value:{tokens:r,mode:e},children:(0,l.jsx)(`div`,{className:`pdp-theme-root`,dir:`rtl`,style:{...i,display:`inline-block`,fontFamily:r.fontFamily},children:n})})},V=()=>(0,c.useContext)(B),ne=({year:e,month:t,onPrevMonth:n,onNextMonth:r,onTogglePicker:i,classNames:a,styles:o})=>(0,l.jsxs)(`div`,{className:a?.header,style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:`12px`,padding:`0 4px`,height:`28px`,...o?.header},children:[(0,l.jsx)(`button`,{type:`button`,"aria-label":`ماه قبل`,onClick:n,className:a?.navButton,style:{width:`28px`,height:`28px`,borderRadius:`6px`,border:`1px solid var(--pdp-surface-border, #e2e8f0)`,backgroundColor:`var(--pdp-surface-bg, #ffffff)`,color:`var(--pdp-text-primary, #0f172a)`,cursor:`pointer`,...o?.navButton},children:`›`}),(0,l.jsxs)(`button`,{type:`button`,onClick:i,className:a?.headerTitle,style:{background:`none`,border:`none`,cursor:`pointer`,fontSize:`15px`,fontWeight:600,color:`var(--pdp-text-primary, #0f172a)`,display:`flex`,gap:`6px`,...o?.headerTitle},children:[(0,l.jsx)(`span`,{children:u[t]}),(0,l.jsx)(`span`,{children:P(e)})]}),(0,l.jsx)(`button`,{type:`button`,"aria-label":`ماه بعد`,onClick:r,className:a?.navButton,style:{width:`28px`,height:`28px`,borderRadius:`6px`,border:`1px solid var(--pdp-surface-border, #e2e8f0)`,backgroundColor:`var(--pdp-surface-bg, #ffffff)`,color:`var(--pdp-text-primary, #0f172a)`,cursor:`pointer`,...o?.navButton},children:`‹`})]}),H=({firstDayOfWeek:e=0,classNames:t,styles:n})=>{let r=[...f.slice(e),...f.slice(0,e)];return(0,l.jsx)(`div`,{role:`row`,"aria-label":`روزهای هفته`,className:t?.weekdays,style:{display:`grid`,gridTemplateColumns:`repeat(7, var(--pdp-cell-size, 36px))`,gap:`4px`,marginBottom:`6px`,textAlign:`center`,...n?.weekdays},children:r.map((e,r)=>(0,l.jsx)(`div`,{role:`columnheader`,className:t?.weekdayCell,style:{fontSize:`12px`,fontWeight:600,color:`var(--pdp-text-muted, #94a3b8)`,userSelect:`none`,...n?.weekdayCell},children:e},r))})},U=({cell:e,tabIndex:t,digitType:n=`persian`,isHoliday:r=!1,holidayTitle:i,events:a=[],classNames:o,styles:s,onSelect:u,onHover:d,onFocus:f})=>{let{jalali:p,isCurrentMonth:m,isToday:h,isSelected:g,isDisabled:_,isInRange:v,isRangeStart:y,isRangeEnd:b}=e,[x,S]=(0,c.useState)(!1),C=n===`persian`?P(e.dayNumber):e.dayNumber,w=j(p);r&&i&&(w+=` (${i})`);let T=`transparent`,E=m?r?`var(--pdp-holiday-color, #ef4444)`:`var(--pdp-text-primary, #0f172a)`:`var(--pdp-text-disabled, #cbd5e1)`;v&&!g&&(T=`var(--pdp-range-between-bg, #e0f2fe)`,E=`var(--pdp-range-between-text, #0369a1)`),(g||y||b)&&(T=`var(--pdp-primary-color, #0284c7)`,E=`var(--pdp-primary-contrast-text, #ffffff)`);let D=[o?.dayCell,h&&o?.todayCell,g&&o?.selectedCell,v&&!g&&o?.rangeBetweenCell,_&&o?.disabledCell,r&&o?.holidayCell].filter(Boolean).join(` `),O={width:`var(--pdp-cell-size, 36px)`,height:`var(--pdp-cell-size, 36px)`,display:`inline-flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,borderRadius:y||b||!v&&g?`var(--pdp-border-radius, 8px)`:`4px`,border:h&&!g?`1px solid var(--pdp-today-indicator-color, #0284c7)`:`none`,backgroundColor:T,color:E,fontWeight:h||g||r?700:400,fontSize:`14px`,cursor:_?`not-allowed`:`pointer`,opacity:_?.4:1,transition:`background-color 0.15s ease, color 0.15s ease`,outline:`none`,position:`relative`,...s?.dayCell,...h?s?.todayCell:{},...g?s?.selectedCell:{},...v&&!g?s?.rangeBetweenCell:{},..._?s?.disabledCell:{},...r?s?.holidayCell:{}},k=a.length>0,A=k?a[0].color??`var(--pdp-primary-color, #0284c7)`:void 0;return(0,l.jsxs)(`div`,{style:{position:`relative`,display:`inline-flex`},onMouseEnter:()=>{S(!0),_||d?.(p)},onMouseLeave:()=>{S(!1),d?.(null)},children:[(0,l.jsxs)(`button`,{type:`button`,role:`gridcell`,tabIndex:_?-1:t,"aria-selected":g||y||b,"aria-disabled":_,"aria-label":w,disabled:_,onClick:()=>!_&&u(p),onFocus:()=>!_&&f?.(p),className:D||void 0,style:O,children:[(0,l.jsx)(`span`,{style:{lineHeight:1},children:C}),k&&!g&&(0,l.jsx)(`div`,{className:o?.eventBadge,style:{display:`flex`,gap:`2px`,position:`absolute`,bottom:`3px`,...s?.eventBadge},children:a.slice(0,3).map((e,t)=>(0,l.jsx)(`span`,{style:{width:`4px`,height:`4px`,borderRadius:`50%`,backgroundColor:e.color??A,display:`inline-block`}},t))})]}),x&&(k||r&&i)&&(0,l.jsxs)(`div`,{role:`tooltip`,style:{position:`absolute`,bottom:`calc(100% + 6px)`,left:`50%`,transform:`translateX(-50%)`,zIndex:100,backgroundColor:`#0f172a`,color:`#f8fafc`,padding:`6px 10px`,borderRadius:`6px`,fontSize:`11px`,whiteSpace:`nowrap`,boxShadow:`0 4px 6px -1px rgb(0 0 0 / 0.3)`,pointerEvents:`none`,display:`flex`,flexDirection:`column`,gap:`2px`,minWidth:`max-content`,maxWidth:`200px`,textAlign:`center`},children:[r&&i&&(0,l.jsx)(`div`,{style:{color:`#f87171`,fontWeight:600},children:i}),a.map(e=>(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`4px`,justifyContent:`center`},children:[e.color&&(0,l.jsx)(`span`,{style:{width:`6px`,height:`6px`,borderRadius:`50%`,backgroundColor:e.color,display:`inline-block`}}),(0,l.jsx)(`span`,{style:{fontWeight:500},children:e.title})]},e.id)),(0,l.jsx)(`div`,{style:{position:`absolute`,top:`100%`,left:`50%`,transform:`translateX(-50%)`,borderWidth:`4px`,borderStyle:`solid`,borderColor:`#0f172a transparent transparent transparent`}})]})]})},re=({currentYear:e,currentMonth:t,onSelectMonth:n,onSelectYear:r,onClose:i})=>{let[a,o]=(0,c.useState)(`months`),[s,d]=(0,c.useState)(Math.floor(e/12)*12),f=Array.from({length:12},(e,t)=>s+t);return(0,l.jsxs)(`div`,{style:{padding:`8px`,backgroundColor:`var(--pdp-surface-bg, #ffffff)`,borderRadius:`var(--pdp-border-radius, 8px)`},children:[(0,l.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:`12px`},children:[(0,l.jsx)(`button`,{type:`button`,onClick:()=>a===`years`?d(e=>e-12):null,style:{background:`none`,border:`none`,cursor:`pointer`,fontSize:`16px`,color:`var(--pdp-text-primary)`},children:`‹`}),(0,l.jsxs)(`div`,{style:{display:`flex`,gap:`8px`},children:[(0,l.jsx)(`button`,{type:`button`,onClick:()=>o(`months`),style:{fontWeight:a===`months`?700:400,background:`none`,border:`none`,cursor:`pointer`,color:`var(--pdp-primary-color, #0284c7)`},children:u[t]}),(0,l.jsx)(`button`,{type:`button`,onClick:()=>o(`years`),style:{fontWeight:a===`years`?700:400,background:`none`,border:`none`,cursor:`pointer`,color:`var(--pdp-primary-color, #0284c7)`},children:P(e)})]}),(0,l.jsx)(`button`,{type:`button`,onClick:()=>a===`years`?d(e=>e+12):null,style:{background:`none`,border:`none`,cursor:`pointer`,fontSize:`16px`,color:`var(--pdp-text-primary)`},children:`›`})]}),a===`months`&&(0,l.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(3, 1fr)`,gap:`8px`},children:u.map((e,r)=>(0,l.jsx)(`button`,{type:`button`,onClick:()=>{n(r),i()},style:{padding:`8px 4px`,borderRadius:`6px`,border:`none`,cursor:`pointer`,backgroundColor:t===r?`var(--pdp-primary-color, #0284c7)`:`transparent`,color:t===r?`#ffffff`:`var(--pdp-text-primary, #0f172a)`,fontSize:`13px`},children:e},e))}),a===`years`&&(0,l.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(3, 1fr)`,gap:`8px`},children:f.map(t=>(0,l.jsx)(`button`,{type:`button`,onClick:()=>{r(t),o(`months`)},style:{padding:`8px 4px`,borderRadius:`6px`,border:`none`,cursor:`pointer`,backgroundColor:e===t?`var(--pdp-primary-color, #0284c7)`:`transparent`,color:e===t?`#ffffff`:`var(--pdp-text-primary, #0f172a)`,fontSize:`13px`},children:P(t)},t))})]})};function W(e,t=`persian`){let n=e<10?`0${e}`:`${e}`;return t===`persian`?P(n):n}function G(){let e=new Date;return{hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds()}}function K(e){return{hour:Math.max(0,Math.min(23,e.hour)),minute:Math.max(0,Math.min(59,e.minute)),second:e.second===void 0?void 0:Math.max(0,Math.min(59,e.second))}}function ie(e,t=!1,n=`persian`){if(!e)return``;let r=W(e.hour,n),i=W(e.minute,n);return t&&e.second!==void 0?`${r}:${i}:${W(e.second,n)}`:`${r}:${i}`}var ae=({selectedDate:e,selectedRange:t,selectedDates:n,selectedTime:r,mode:i=`single`,digitType:a=`persian`,showStatusText:o=!0,showActions:s=!0,onToday:c,onClear:u,onConfirm:d,classNames:f,styles:p})=>{let m=()=>{let o=`هیچ تاریخی انتخاب نشده است`;if(i===`single`&&e)o=I(e,`dddd D MMMM YYYY`,{digitType:a}),r&&(o+=` - ${ie(r,!1,a)}`);else if(i===`range`){let[e,n]=t||[null,null];e&&n?o=`${I(e,`YYYY/MM/DD`,{digitType:a})} تا ${I(n,`YYYY/MM/DD`,{digitType:a})}`:e&&(o=`شروع: ${I(e,`YYYY/MM/DD`,{digitType:a})} (پایان را انتخاب کنید)`)}else i===`multiple`&&n&&n.length>0&&(o=`${a===`persian`?P(n.length):n.length} روز انتخاب شده`);return o};return(0,l.jsxs)(`div`,{className:f?.footer,style:{marginTop:`8px`,paddingTop:`8px`,borderTop:`1px solid var(--pdp-surface-border, #e2e8f0)`,display:`flex`,flexDirection:`column`,gap:`6px`,...p?.footer},children:[o&&(0,l.jsx)(`div`,{"aria-live":`polite`,style:{fontSize:`12px`,color:`var(--pdp-text-secondary, #475569)`,textAlign:`center`,minHeight:`18px`,fontWeight:500},children:m()}),s&&(0,l.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,gap:`8px`},children:[(0,l.jsxs)(`div`,{style:{display:`flex`,gap:`4px`},children:[c&&(0,l.jsx)(`button`,{type:`button`,onClick:c,style:{padding:`3px 8px`,fontSize:`11px`,borderRadius:`4px`,border:`1px solid var(--pdp-surface-border, #e2e8f0)`,backgroundColor:`transparent`,color:`var(--pdp-text-primary, #0f172a)`,cursor:`pointer`},children:`امروز`}),u&&(0,l.jsx)(`button`,{type:`button`,onClick:u,style:{padding:`3px 8px`,fontSize:`11px`,borderRadius:`4px`,border:`1px solid var(--pdp-surface-border, #e2e8f0)`,backgroundColor:`transparent`,color:`var(--pdp-text-muted, #94a3b8)`,cursor:`pointer`},children:`پاک کردن`})]}),d&&(0,l.jsx)(`button`,{type:`button`,onClick:d,style:{padding:`4px 12px`,fontSize:`12px`,fontWeight:600,borderRadius:`6px`,border:`none`,backgroundColor:`var(--pdp-primary-color, #0284c7)`,color:`var(--pdp-primary-contrast-text, #ffffff)`,cursor:`pointer`},children:`تایید`})]})]})},oe=({value:e,defaultValue:t,onChange:n,minuteStep:r=1,hourStep:i=1,showSeconds:a=!1,digitType:o=`persian`,disabled:s=!1,styles:u,classNames:d})=>{let[f,p]=c.default.useState(t??G()),m=e===void 0?f:e??G(),h=(0,c.useCallback)(t=>{let r=K(t);e===void 0&&p(r),n?.(r)},[e,n]),g=e=>{let t=(m.hour+e*i+24)%24;h({...m,hour:t})},_=e=>{let t=(m.minute+e*r+60)%60;h({...m,minute:t})},v=e=>{if(!a)return;let t=((m.second??0)+e+60)%60;h({...m,second:t})},y={background:`none`,border:`none`,cursor:s?`not-allowed`:`pointer`,color:`var(--pdp-primary-color, #0284c7)`,fontSize:`12px`,padding:`2px 6px`,lineHeight:1},b={display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`},x={fontSize:`15px`,fontWeight:600,color:`var(--pdp-text-primary, #0f172a)`,minWidth:`24px`,textAlign:`center`};return(0,l.jsxs)(`div`,{role:`group`,"aria-label":`Time Selection`,className:d?.timePicker,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,gap:`6px`,padding:`8px 12px`,borderTop:`1px solid var(--pdp-surface-border, #e2e8f0)`,backgroundColor:`var(--pdp-header-bg, #f8fafc)`,borderRadius:`0 0 var(--pdp-border-radius, 8px) var(--pdp-border-radius, 8px)`,direction:`ltr`,...u?.timePicker},children:[(0,l.jsxs)(`div`,{style:b,children:[(0,l.jsx)(`button`,{type:`button`,disabled:s,onClick:()=>g(1),style:y,"aria-label":`Increase Hour`,children:`▼`}),(0,l.jsx)(`span`,{style:x,children:W(m.hour,o)}),(0,l.jsx)(`button`,{type:`button`,disabled:s,onClick:()=>g(-1),style:y,"aria-label":`Decrease Hour`,children:`▲`})]}),(0,l.jsx)(`span`,{style:{fontWeight:700,color:`var(--pdp-text-secondary, #475569)`},children:`:`}),(0,l.jsxs)(`div`,{style:b,children:[(0,l.jsx)(`button`,{type:`button`,disabled:s,onClick:()=>_(1),style:y,"aria-label":`Increase Minute`,children:`▲`}),(0,l.jsx)(`span`,{style:x,children:W(m.minute,o)}),(0,l.jsx)(`button`,{type:`button`,disabled:s,onClick:()=>_(-1),style:y,"aria-label":`Decrease Minute`,children:`▼`})]}),a&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`span`,{style:{fontWeight:700,color:`var(--pdp-text-secondary, #475569)`},children:`:`}),(0,l.jsxs)(`div`,{style:b,children:[(0,l.jsx)(`button`,{type:`button`,disabled:s,onClick:()=>v(1),style:y,"aria-label":`Increase Second`,children:`▲`}),(0,l.jsx)(`span`,{style:x,children:W(m.second??0,o)}),(0,l.jsx)(`button`,{type:`button`,disabled:s,onClick:()=>v(-1),style:y,"aria-label":`Decrease Second`,children:`▼`})]})]})]})};function q(e=`persian`){let t=t=>e===`persian`?P(t):`${t}`;return[{id:`today`,label:`امروز`,getValue:()=>v()},{id:`this_week`,label:`این هفته`,getValue:()=>D(v())},{id:`last_7_days`,label:`${t(7)} روز گذشته`,getValue:()=>{let e=v();return[C(e,-6),e]}},{id:`this_month`,label:`این ماه`,getValue:()=>O(v())},{id:`last_month`,label:`ماه گذشته`,getValue:()=>{let e=v(),t=e.year,n=e.month-1;n<0&&(n=11,--t);let r=h(t,n);return[{year:t,month:n,day:1},{year:t,month:n,day:r}]}},{id:`last_30_days`,label:`${t(30)} روز گذشته`,getValue:()=>{let e=v();return[C(e,-29),e]}}]}var se=q(`persian`),ce=({presets:e,onSelectPreset:t,selectedValue:n,orientation:r=`vertical`,digitType:i=`persian`,disabled:a=!1,classNames:o,styles:s})=>{let u=(0,c.useMemo)(()=>e??q(i),[e,i]),d=e=>{if(!n)return!1;let t=e.getValue();if(!Array.isArray(t)&&!Array.isArray(n))return y(t,n);if(Array.isArray(t)&&Array.isArray(n)){let[e,r]=t,[i,a]=n;return!e||!r||!i||!a?!1:y(e,i)&&y(r,a)}return!1},f={display:`flex`,flexDirection:r===`vertical`?`column`:`row`,gap:`4px`,padding:`8px`,backgroundColor:`var(--pdp-header-bg, #f8fafc)`,borderLeft:r===`vertical`?`1px solid var(--pdp-surface-border, #e2e8f0)`:`none`,borderBottom:r===`horizontal`?`1px solid var(--pdp-surface-border, #e2e8f0)`:`none`,overflowX:r===`horizontal`?`auto`:`visible`,maxHeight:r===`vertical`?`280px`:`none`,overflowY:r===`vertical`?`auto`:`visible`,minWidth:r===`vertical`?`110px`:`auto`,...s?.presetsBar};return(0,l.jsx)(`div`,{role:`group`,"aria-label":`کلیدهای میانبر تاریخ`,className:o?.presetsBar,style:f,children:u.map(e=>{let n=d(e);return(0,l.jsx)(`button`,{type:`button`,disabled:a,onClick:()=>t(e.getValue()),style:{padding:`6px 10px`,fontSize:`12px`,fontWeight:n?600:400,textAlign:`right`,border:`none`,borderRadius:`var(--pdp-border-radius, 6px)`,cursor:a?`not-allowed`:`pointer`,backgroundColor:n?`var(--pdp-primary-color, #0284c7)`:`transparent`,color:n?`var(--pdp-primary-contrast-text, #ffffff)`:`var(--pdp-text-primary, #0f172a)`,whiteSpace:`nowrap`,transition:`background-color 0.15s ease, color 0.15s ease`},children:e.label},e.id)})})};function J(e,t=`persian`){let n=F(e).replace(/\D/g,``).slice(0,8),r=``;return n.length>0&&(r=n.slice(0,4)),n.length>=5&&(r+=`/${n.slice(4,6)}`),n.length>=7&&(r+=`/${n.slice(6,8)}`),t===`persian`?P(r):r}function Y(e,t,n,r){let i=F(e).trim();if(!i)return{isValid:!0,date:null};let a=i.split(`/`);if(a.length!==3||a[0].length!==4||a[1].length!==2||a[2].length!==2)return{isValid:!1,date:null,error:`INVALID_FORMAT`};let o=parseInt(a[0],10),s=parseInt(a[1],10),c=parseInt(a[2],10);if(s<1||s>12)return{isValid:!1,date:null,error:`INVALID_MONTH`};let l=s-1,u=h(o,l);if(c<1||c>u)return{isValid:!1,date:null,error:`INVALID_DAY`};let d={year:o,month:l,day:c};return t&&T(d,t)<0?{isValid:!1,date:d,error:`OUT_OF_MIN_BOUNDS`}:n&&T(d,n)>0?{isValid:!1,date:d,error:`OUT_OF_MAX_BOUNDS`}:r&&r(d)?{isValid:!1,date:d,error:`DISABLED_DATE`}:{isValid:!0,date:d}}var le=({value:e,defaultValue:t=null,onChange:n,onValidationError:r,digitType:i=`persian`,minDate:a,maxDate:o,isDateDisabled:s,clearable:u=!0,placeholder:d=`۱۴۰۵/۰۱/۱۵`,disabled:f=!1,style:p,...m})=>{let[h,g]=(0,c.useState)(t),_=e===void 0?h:e,[v,y]=(0,c.useState)(()=>_?I(_,`YYYY/MM/DD`,{digitType:i}):``),[b,x]=(0,c.useState)(!1),S=(0,c.useRef)(null);(0,c.useEffect)(()=>{e!==void 0&&(y(e?I(e,`YYYY/MM/DD`,{digitType:i}):``),x(!1))},[e,i]);let C=t=>{let c=t.target.value,l=J(c,i);if(y(l),l.length===10||l.length===0){let t=Y(l,a,o,s);t.isValid?(x(!1),r?.(null),e===void 0&&g(t.date),n?.(t.date)):(x(!0),r?.(t.error))}else x(!1),r?.(null)},w=(0,c.useCallback)(()=>{y(``),x(!1),r?.(null),e===void 0&&g(null),n?.(null),S.current?.focus()},[e,n,r]);return(0,l.jsxs)(`div`,{style:{position:`relative`,display:`inline-flex`,alignItems:`center`,direction:`rtl`},children:[(0,l.jsx)(`input`,{ref:S,type:`text`,inputMode:`numeric`,disabled:f,placeholder:i===`persian`?d:`1405/01/15`,value:v,onChange:C,style:{width:`180px`,padding:`8px 12px`,paddingLeft:u&&v?`32px`:`12px`,borderRadius:`var(--pdp-border-radius, 8px)`,border:`1px solid ${b?`#ef4444`:`var(--pdp-surface-border, #e2e8f0)`}`,backgroundColor:`var(--pdp-surface-bg, #ffffff)`,color:`var(--pdp-text-primary, #0f172a)`,fontSize:`14px`,fontFamily:`inherit`,outline:`none`,textAlign:`center`,letterSpacing:`1px`,transition:`border-color 0.15s ease`,...p},...m}),u&&v&&!f&&(0,l.jsx)(`button`,{type:`button`,"aria-label":`پاک کردن`,onClick:w,style:{position:`absolute`,left:`8px`,background:`none`,border:`none`,cursor:`pointer`,color:`var(--pdp-text-muted, #94a3b8)`,fontSize:`14px`,lineHeight:1,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:`2px`},children:`✕`})]})};function ue(e,t){return!t||t.length===0?[]:t.filter(t=>y(t.date,e))}var X={"0-1":`جشن نوروز / سال نو`,"0-2":`عید نوروز`,"0-3":`عید نوروز`,"0-4":`عید نوروز`,"0-12":`روز جمهوری اسلامی ایران`,"0-13":`روز طبیعت (سیزده‌بدر)`,"2-14":`رحلت امام خمینی`,"2-15":`قیام ۱۵ خرداد`,"10-22":`پیروزی انقلاب اسلامی`,"11-29":`روز ملی شدن صنعت نفت`};function de(e){return _(e.year,e.month,e.day).getDay()===5}function fe(e,t){if(t&&t.length>0){let n=t.find(t=>t.date.year===e.year&&t.date.month===e.month&&t.date.day===e.day);if(n)return{title:n.title,type:`custom`,isOff:n.isOff??!0}}let n=`${e.month}-${e.day}`;return X[n]?{title:X[n],type:`solar`,isOff:!0}:de(e)?{title:`جمعه (تعطیل پایان هفته)`,type:`solar`,isOff:!0}:null}function pe({variant:e=`inline`,placeholder:t=`انتخاب تاریخ...`,digitType:n=`persian`,className:r,style:i,classNames:a,styles:o,showFooter:s=!1,showStatusText:d=!0,showActions:f=!0,onConfirm:p,defaultValue:m,enableTime:h=!1,timeValue:g,defaultTimeValue:_,onTimeChange:v,minuteStep:b=1,hourStep:S=1,showSeconds:C=!1,enablePresets:w=!1,presets:T,presetsOrientation:D=`vertical`,numberOfMonths:O=1,useMaskedInput:A=!1,events:j,showHolidays:N=!1,customHolidays:ee,...F}){let[L,R]=(0,c.useState)(e===`inline`),[z,B]=(0,c.useState)(!1),te=(0,c.useRef)(null),V=e===`modal`,[W,K]=(0,c.useState)(()=>_??G()),q=g===void 0?W:g??G(),se=(0,c.useCallback)(e=>{g===void 0&&K(e),v?.(e)},[g,v]),{selected:J,viewYear:Y,viewMonth:X,grid:de,goToPrevMonth:pe,goToNextMonth:me,setView:Z,goToToday:he,selectDate:Q,setHoverDate:ge,hoverDate:_e,clear:ve}=k({defaultValue:m,...F}),ye=F.mode===`single`?J:null,be=t=>{Q(t),e===`popover`&&F.mode===`single`&&!h&&R(!1)},{handleKeyDown:xe,getCellTabIndex:Se,setFocusedDate:Ce}=M({viewYear:Y,viewMonth:X,selectedDate:ye,onSelectDate:be,onViewChange:Z,isRtl:!0});(0,c.useEffect)(()=>{if(!V||!L)return;let e=document.body.style.overflow;document.body.style.overflow=`hidden`;let t=e=>{e.key===`Escape`&&R(!1)};return window.addEventListener(`keydown`,t),()=>{document.body.style.overflow=e,window.removeEventListener(`keydown`,t)}},[V,L]);let we=t=>{if(F.mode===`single`&&!Array.isArray(t))Q(t),Z(t.year,t.month),e===`popover`&&!h&&R(!1);else if(F.mode===`range`&&Array.isArray(t)){let[e,n]=t;e&&n&&(Q(e),Q(n),Z(e.year,e.month))}},$=(0,c.useMemo)(()=>X===11?{year:Y+1,month:0}:{year:Y,month:X+1},[Y,X]),Te=(0,c.useMemo)(()=>{if(O!==2)return[];let e=x({year:$.year,month:$.month,firstDayOfWeek:F.firstDayOfWeek??0,minDate:F.minDate,maxDate:F.maxDate,isDateDisabled:F.isDateDisabled});if(F.mode!==`range`)return e;let[t,n]=J||[null,null],r=n??(t&&_e?_e:null);return e.map(e=>{let n=t?y(e.jalali,t):!1,i=r?y(e.jalali,r):!1,a=!1;return t&&r&&(a=E(e.jalali,t,r)),{...e,isSelected:n||i,isInRange:a,isRangeStart:n,isRangeEnd:i}})},[O,$,F,J,_e]),Ee=(0,c.useMemo)(()=>{if(!J)return``;if(F.mode===`single`){let e=I(J,`YYYY/MM/DD`,{digitType:n});return h&&q?`${e} ${ie(q,C,n)}`:e}if(F.mode===`range`){let[e,t]=J||[null,null];if(e&&t)return`${I(e,`YYYY/MM/DD`,{digitType:n})} - ${I(t,`YYYY/MM/DD`,{digitType:n})}`;if(e)return I(e,`YYYY/MM/DD`,{digitType:n})}return``},[J,F.mode,n,h,q,C]),De=(e,t,r,i=!0,s=!0)=>(0,l.jsxs)(`div`,{style:{minWidth:`270px`},children:[(0,l.jsx)(ne,{year:e,month:t,onPrevMonth:i?pe:()=>{},onNextMonth:s?me:()=>{},onTogglePicker:()=>O===1&&B(!0),onGoToToday:he,classNames:a,styles:o}),(0,l.jsx)(H,{firstDayOfWeek:F.firstDayOfWeek,classNames:a,styles:o}),(0,l.jsx)(`div`,{role:`grid`,"aria-label":`${u[t]} ${P(e)}`,className:a?.grid,style:{display:`grid`,gridTemplateColumns:`repeat(7, var(--pdp-cell-size, 36px))`,gap:`4px`,...o?.grid},children:r.map((e,t)=>{let r=N?fe(e.jalali,ee):null,i=ue(e.jalali,j);return(0,l.jsx)(U,{cell:e,digitType:n,isHoliday:!!r,holidayTitle:r?.title,events:i,classNames:a,styles:o,tabIndex:Se(e.jalali),onSelect:be,onHover:ge,onFocus:Ce},t)})})]}),Oe=(0,l.jsxs)(`div`,{role:V?`dialog`:`region`,"aria-modal":V?!0:void 0,"aria-label":`تقویم شمسی`,onKeyDown:xe,onClick:e=>V&&e.stopPropagation(),className:a?.calendar,style:{position:e===`popover`?`absolute`:V?`relative`:`static`,top:e===`popover`?`calc(100% + 4px)`:void 0,right:e===`popover`?0:void 0,zIndex:V?1001:50,padding:`16px`,backgroundColor:`var(--pdp-surface-bg, #ffffff)`,borderRadius:`var(--pdp-border-radius, 12px)`,border:`1px solid var(--pdp-surface-border, #e2e8f0)`,boxShadow:V?`0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3)`:`var(--pdp-shadow)`,width:`fit-content`,userSelect:`none`,display:`flex`,flexDirection:D===`horizontal`?`column`:`row`,gap:`12px`,...o?.calendar},children:[V&&(0,l.jsx)(`button`,{type:`button`,"aria-label":`بستن`,onClick:()=>R(!1),style:{position:`absolute`,top:`10px`,left:`10px`,background:`none`,border:`none`,cursor:`pointer`,fontSize:`16px`,color:`var(--pdp-text-muted, #94a3b8)`,lineHeight:1,zIndex:10},children:`✕`}),w&&(0,l.jsx)(ce,{presets:T,orientation:D,digitType:n,selectedValue:J,onSelectPreset:we,classNames:a,styles:o}),(0,l.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`8px`},children:z?(0,l.jsx)(re,{currentYear:Y,currentMonth:X,onSelectMonth:e=>Z(Y,e),onSelectYear:e=>Z(e,X),onClose:()=>B(!1)}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{style:{display:`flex`,gap:`16px`,alignItems:`flex-start`},children:[De(Y,X,de,!0,O===1),O===2&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`div`,{style:{width:`1px`,backgroundColor:`var(--pdp-surface-border, #e2e8f0)`,alignSelf:`stretch`}}),De($.year,$.month,Te,!1,!0)]})]}),h&&(0,l.jsx)(oe,{value:q,onChange:se,minuteStep:b,hourStep:S,showSeconds:C,digitType:n,classNames:a,styles:o}),s&&(0,l.jsx)(ae,{mode:F.mode,digitType:n,showStatusText:d,showActions:f,selectedDate:F.mode===`single`?J:null,selectedRange:F.mode===`range`?J:void 0,selectedDates:F.mode===`multiple`?J:void 0,selectedTime:h?q:void 0,onToday:he,onClear:ve,onConfirm:()=>{e!==`inline`&&R(!1),p?.()},classNames:a,styles:o})]})})]});return(0,l.jsxs)(`div`,{ref:te,className:r??a?.root,style:{position:`relative`,display:`inline-block`,...i,...o?.root},children:[e!==`inline`&&(A&&F.mode===`single`&&e===`popover`?(0,l.jsx)(le,{value:ye,digitType:n,placeholder:t,onChange:e=>{e?(Q(e),Z(e.year,e.month)):ve()},onClick:()=>R(!0),className:a?.input,style:o?.input}):(0,l.jsx)(`input`,{type:`text`,readOnly:!0,placeholder:t,value:Ee,onClick:()=>R(!0),className:a?.input,style:{padding:`8px 12px`,borderRadius:`var(--pdp-border-radius, 8px)`,border:`1px solid var(--pdp-surface-border, #e2e8f0)`,backgroundColor:`var(--pdp-surface-bg, #ffffff)`,color:`var(--pdp-text-primary, #0f172a)`,cursor:`pointer`,textAlign:`right`,direction:`rtl`,fontSize:`14px`,minWidth:h?`200px`:O===2?`240px`:`150px`,...o?.input}})),L&&(V?(0,l.jsx)(`div`,{role:`presentation`,onClick:()=>R(!1),className:a?.modalBackdrop,style:{position:`fixed`,top:0,left:0,right:0,bottom:0,backgroundColor:`rgba(15, 23, 42, 0.6)`,backdropFilter:`blur(4px)`,zIndex:1e3,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:`16px`,direction:`rtl`,...o?.modalBackdrop},children:Oe}):Oe)]})}var me=({value:e,defaultValue:t=[null,null],onChange:n,initialViewDate:r,firstDayOfWeek:i=0,digitType:a=`persian`,minDate:o,maxDate:s,isDateDisabled:d})=>{let[f,p]=(0,c.useState)(t),m=e===void 0?f:e,[h,g]=(0,c.useState)(null),_=(0,c.useMemo)(()=>v(),[]),[b,S]=(0,c.useState)(()=>r||(m[0]?{year:m[0].year,month:m[0].month}:{year:_.year,month:_.month})),C=(0,c.useMemo)(()=>b.month===11?{year:b.year+1,month:0}:{year:b.year,month:b.month+1},[b]),w=()=>{S(e=>e.month===0?{year:e.year-1,month:11}:{year:e.year,month:e.month-1})},D=()=>{S(e=>e.month===11?{year:e.year+1,month:0}:{year:e.year,month:e.month+1})},O=(0,c.useCallback)(t=>{let[r,i]=m,a;!r||r&&i?a=[t,null]:(a=T(t,r)<0?[t,r]:[r,t],g(null)),e===void 0&&p(a),n?.(a)},[m,e,n]),k=(0,c.useCallback)((e,t)=>{let n=x({year:e,month:t,firstDayOfWeek:i,minDate:o,maxDate:s,isDateDisabled:d}),[r,a]=m,c=a??(r&&h?h:null);return n.map(e=>{let t=r?y(e.jalali,r):!1,n=c?y(e.jalali,c):!1,i=!1;return r&&c&&(i=E(e.jalali,r,c)),{...e,isSelected:t||n,isInRange:i,isRangeStart:t,isRangeEnd:n}})},[i,o,s,d,m,h]),A=(0,c.useMemo)(()=>k(b.year,b.month),[k,b.year,b.month]),j=(0,c.useMemo)(()=>k(C.year,C.month),[k,C.year,C.month]),M=(e,t,n,r)=>(0,l.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`8px`,minWidth:`270px`},children:[(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`0 4px`,height:`32px`},children:[r?(0,l.jsx)(`button`,{type:`button`,"aria-label":`ماه قبل`,onClick:w,style:{width:`28px`,height:`28px`,borderRadius:`6px`,border:`1px solid var(--pdp-surface-border, #e2e8f0)`,backgroundColor:`var(--pdp-surface-bg, #ffffff)`,color:`var(--pdp-text-primary, #0f172a)`,cursor:`pointer`},children:`›`}):(0,l.jsx)(`div`,{style:{width:`28px`}}),(0,l.jsxs)(`div`,{style:{fontWeight:600,fontSize:`14px`,color:`var(--pdp-text-primary, #0f172a)`},children:[u[t],` `,P(e)]}),r?(0,l.jsx)(`div`,{style:{width:`28px`}}):(0,l.jsx)(`button`,{type:`button`,"aria-label":`ماه بعد`,onClick:D,style:{width:`28px`,height:`28px`,borderRadius:`6px`,border:`1px solid var(--pdp-surface-border, #e2e8f0)`,backgroundColor:`var(--pdp-surface-bg, #ffffff)`,color:`var(--pdp-text-primary, #0f172a)`,cursor:`pointer`},children:`‹`})]}),(0,l.jsx)(H,{firstDayOfWeek:i}),(0,l.jsx)(`div`,{role:`grid`,"aria-label":`${u[t]} ${P(e)}`,style:{display:`grid`,gridTemplateColumns:`repeat(7, var(--pdp-cell-size, 36px))`,gap:`4px`},children:n.map((e,t)=>(0,l.jsx)(U,{cell:e,digitType:a,tabIndex:0,onSelect:O,onHover:g},t))})]});return(0,l.jsxs)(`div`,{role:`region`,"aria-label":`تقویم دوقلو شمسی`,style:{display:`flex`,flexWrap:`wrap`,gap:`24px`,padding:`16px`,backgroundColor:`var(--pdp-surface-bg, #ffffff)`,borderRadius:`var(--pdp-border-radius, 8px)`,border:`1px solid var(--pdp-surface-border, #e2e8f0)`,boxShadow:`var(--pdp-shadow)`,width:`fit-content`,direction:`rtl`},children:[M(b.year,b.month,A,!0),(0,l.jsx)(`div`,{style:{width:`1px`,backgroundColor:`var(--pdp-surface-border, #e2e8f0)`}}),M(C.year,C.month,j,!1)]})};exports.DEFAULT_DATE_PICKER_PRESETS=se,exports.DatePickerThemeProvider=te,exports.DayCell=U,exports.DualMonthCalendar=me,exports.Header=ne,exports.JALALI_MONTH_NAMES_EN=d,exports.JalaliDatePicker=pe,exports.MaskedDateInput=le,exports.MonthYearPicker=re,exports.PERSIAN_MONTH_NAMES=u,exports.PERSIAN_WEEK_DAYS_LONG=p,exports.PERSIAN_WEEK_DAYS_SHORT=f,exports.PresetsBar=ce,exports.TimePicker=oe,exports.Weekdays=H,exports.addDaysToJalali=C,exports.addJalaliDays=w,exports.applyDateMask=J,exports.calculateNextFocusedDate=A,exports.clampTime=K,exports.compareJalaliDates=T,exports.darkThemeTokens=R,exports.formatJalaliDate=I,exports.formatTimeSegment=W,exports.formatTimeString=ie,exports.generateJalaliCalendarGrid=x,exports.getAriaDayLabel=j,exports.getCurrentTime=G,exports.getDaysInJalaliMonth=h,exports.getDefaultJalaliPresets=q,exports.getEventsForDate=ue,exports.getJalaliDayOfWeek=S,exports.getJalaliMonthRange=O,exports.getJalaliWeekRange=D,exports.getTodayJalali=v,exports.gregorianToJalali=g,exports.isJalaliDateBetween=E,exports.isJalaliLeapYear=m,exports.isSameJalaliDay=y,exports.jalaliToGregorian=_,exports.lightThemeTokens=L,exports.parseAndValidateJalaliString=Y,exports.toJalaliDate=b,exports.toLatinDigits=F,exports.toPersianDigits=P,exports.tokensToCssVariables=z,exports.useCalendarKeyboard=M,exports.useDatePickerTheme=V,exports.useJalaliDatePicker=k;
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../src/core/constants.ts","../src/core/jalali-math.ts","../src/core/calendar-grid.ts","../src/core/jalali-helpers.ts","../src/hooks/useJalaliDatePicker.ts","../src/a11y/keyboard-navigation.ts","../src/a11y/aria-helpers.ts","../src/a11y/useCalendarKeyboard.ts","../src/formatters/persian-digits.ts","../src/formatters/jalali-formatter.ts","../src/theme/tokens.ts","../src/theme/ThemeProvider.tsx","../src/components/Header.tsx","../src/components/Weekdays.tsx","../src/components/DayCell.tsx","../src/components/MonthYearPicker.tsx","../src/plugins/time-picker/time-utils.ts","../src/components/footer/CalendarFooter.tsx","../src/plugins/time-picker/TimePicker.tsx","../src/plugins/presets/default-presets.ts","../src/plugins/presets/PresetsBar.tsx","../src/components/masked-input/mask-utils.ts","../src/components/masked-input/MaskedDateInput.tsx","../src/events/event-utils.ts","../src/holidays/iran-holidays.ts","../src/components/JalaliDatePicker.tsx","../src/components/dual-calendar/DualMonthCalendar.tsx"],"sourcesContent":["/**\n * Persian (Farsi) month names.\n */\nexport const PERSIAN_MONTH_NAMES = [\n \"فروردین\",\n \"اردیبهشت\",\n \"خرداد\",\n \"تیر\",\n \"مرداد\",\n \"شهریور\",\n \"مهر\",\n \"آبان\",\n \"آذر\",\n \"دی\",\n \"بهمن\",\n \"اسفند\",\n] as const;\n\n/**\n * Phonetic English month names for Jalali calendar.\n */\nexport const JALALI_MONTH_NAMES_EN = [\n \"Farvardin\",\n \"Ordibehesht\",\n \"Khordad\",\n \"Tir\",\n \"Mordad\",\n \"Shahrivar\",\n \"Mehr\",\n \"Aban\",\n \"Azar\",\n \"Dey\",\n \"Bahman\",\n \"Esfand\",\n] as const;\n\n/**\n * Persian weekday headers starting from Saturday (شنبه).\n */\nexport const PERSIAN_WEEK_DAYS_SHORT = [\n \"ش\",\n \"ی\",\n \"د\",\n \"س\",\n \"چ\",\n \"پ\",\n \"ج\",\n] as const;\nexport const PERSIAN_WEEK_DAYS_LONG = [\n \"شنبه\",\n \"یکشنبه\",\n \"دوشنبه\",\n \"سه‌شنبه\",\n \"چهارشنبه\",\n \"پنج‌شنبه\",\n \"جمعه\",\n] as const;\n","import type { JalaliDate, JalaliMonthIndex } from \"./types\";\n\n/**\n * Determines if a Jalali year is a leap year (کبیسه).\n * Uses the Birashk 2820-year cycle algorithm.\n */\nexport function isJalaliLeapYear(year: number): boolean {\n const breaks = [\n -61, 9, 38, 199, 426, 686, 756, 818, 1111, 1181, 1210, 1635, 2060, 2097,\n 2192, 2262, 2324, 2394, 2456, 3178,\n ];\n\n let jp = breaks[0];\n let jump = 0;\n\n if (year < jp || year >= breaks[breaks.length - 1]) {\n throw new Error(`Jalali year ${year} is outside supported range.`);\n }\n\n for (let i = 1; i < breaks.length; i++) {\n const jm = breaks[i];\n jump = jm - jp;\n if (year < jm) break;\n jp = jm;\n }\n\n let n = year - jp;\n if (jump - n < 6) n = n - jump + ((jump + 4) / 33) * 33;\n let leap = ((n + 1) % 33) - 1;\n if (leap === -1) leap = 4;\n\n return leap % 4 === 0;\n}\n\n/**\n * Returns the number of days in a specific Jalali month.\n */\nexport function getDaysInJalaliMonth(\n year: number,\n month: JalaliMonthIndex,\n): number {\n if (month < 0 || month > 11) {\n throw new RangeError(\n \"Month index must be between 0 (Farvardin) and 11 (Esfand).\",\n );\n }\n // Months 0 to 5 (Farvardin - Shahrivar) have 31 days\n if (month <= 5) return 31;\n // Months 6 to 10 (Mehr - Bahman) have 30 days\n if (month <= 10) return 30;\n // Month 11 (Esfand) has 30 in leap years, 29 in regular years\n return isJalaliLeapYear(year) ? 30 : 29;\n}\n\n/**\n * Converts a Gregorian date (Year, Month, Day) to Jalali date.\n */\nexport function gregorianToJalali(\n gy: number,\n gm: number,\n gd: number,\n): JalaliDate {\n const g_d_m = [\n 0,\n 31,\n (gy % 4 === 0 && gy % 100 !== 0) || gy % 400 === 0 ? 29 : 28,\n 31,\n 30,\n 31,\n 30,\n 31,\n 31,\n 30,\n 31,\n 30,\n 31,\n ];\n let jy: number;\n let jm: number;\n let jd: number;\n\n let gy2 = gm > 2 ? gy + 1 : gy;\n let days =\n 355666 +\n 365 * gy +\n Math.floor((gy2 + 3) / 4) -\n Math.floor((gy2 + 99) / 100) +\n Math.floor((gy2 + 399) / 400) +\n gd;\n\n for (let i = 0; i < gm; ++i) days += g_d_m[i];\n\n jy = -1595 + 33 * Math.floor(days / 12053);\n days %= 12053;\n\n jy += 4 * Math.floor(days / 1461);\n days %= 1461;\n\n if (days > 365) {\n jy += Math.floor((days - 1) / 365);\n days = (days - 1) % 365;\n }\n\n if (days < 186) {\n jm = Math.floor(days / 31);\n jd = 1 + (days % 31);\n } else {\n jm = 6 + Math.floor((days - 186) / 30);\n jd = 1 + ((days - 186) % 30);\n }\n\n return { year: jy, month: jm as JalaliMonthIndex, day: jd };\n}\n\n/**\n * Converts a Jalali date to a Gregorian Date.\n */\nexport function jalaliToGregorian(\n jy: number,\n jm: JalaliMonthIndex,\n jd: number,\n): Date {\n let gy: number;\n let gm: number;\n let gd: number;\n\n let jy2 = jy + 1595;\n let days =\n -355668 +\n 365 * jy2 +\n Math.floor(jy2 / 33) * 8 +\n Math.floor(((jy2 % 33) + 3) / 4) +\n jd +\n (jm < 6 ? jm * 31 : (jm - 6) * 30 + 186);\n\n gy = 400 * Math.floor(days / 146097);\n days %= 146097;\n\n if (days > 36524) {\n gy += 100 * Math.floor(--days / 36524);\n days %= 36524;\n if (days >= 365) days++;\n }\n\n gy += 4 * Math.floor(days / 1461);\n days %= 1461;\n\n if (days > 365) {\n gy += Math.floor((days - 1) / 365);\n days = (days - 1) % 365;\n }\n\n gd = days + 1;\n const sal_a = [\n 0,\n 31,\n (gy % 4 === 0 && gy % 100 !== 0) || gy % 400 === 0 ? 29 : 28,\n 31,\n 30,\n 31,\n 30,\n 31,\n 31,\n 30,\n 31,\n 30,\n 31,\n ];\n\n for (gm = 0; gm < 13 && gd > sal_a[gm]; gm++) {\n gd -= sal_a[gm];\n }\n\n const result = new Date(gy, gm - 1, gd);\n result.setHours(0, 0, 0, 0);\n return result;\n}\n\n/**\n * Returns today's date in Jalali format.\n */\nexport function getTodayJalali(): JalaliDate {\n const now = new Date();\n return gregorianToJalali(\n now.getFullYear(),\n now.getMonth() + 1,\n now.getDate(),\n );\n}\n\n/**\n * Checks if two Jalali dates are identical.\n */\nexport function isSameJalaliDay(\n a?: JalaliDate | null,\n b?: JalaliDate | null,\n): boolean {\n if (!a || !b) return false;\n return a.year === b.year && a.month === b.month && a.day === b.day;\n}\n","import type {\n JalaliCalendarCell,\n JalaliGridOptions,\n JalaliDate,\n JalaliMonthIndex,\n} from \"./types\";\nimport {\n jalaliToGregorian,\n gregorianToJalali,\n getDaysInJalaliMonth,\n getTodayJalali,\n isSameJalaliDay,\n} from \"./jalali-math\";\n\n/**\n * Normalizes input date (Date or JalaliDate) into JalaliDate object.\n */\nexport function toJalaliDate(input: Date | JalaliDate): JalaliDate {\n if (input instanceof Date) {\n return gregorianToJalali(\n input.getFullYear(),\n input.getMonth() + 1,\n input.getDate(),\n );\n }\n return input;\n}\n\n/**\n * Generates a 42-cell (6 rows x 7 columns) matrix for a given Jalali month.\n */\nexport function generateJalaliCalendarGrid(\n options: JalaliGridOptions,\n): JalaliCalendarCell[] {\n const {\n year,\n month,\n firstDayOfWeek = 0, // 0 = Saturday (شنبه)\n selectedDate,\n minDate,\n maxDate,\n isDateDisabled,\n } = options;\n\n const cells: JalaliCalendarCell[] = [];\n const todayJalali = getTodayJalali();\n const activeSelected = selectedDate ? toJalaliDate(selectedDate) : null;\n const minJalali = minDate ? toJalaliDate(minDate) : null;\n const maxJalali = maxDate ? toJalaliDate(maxDate) : null;\n\n // Convert Jalali 1st of month to Gregorian to read weekday\n const firstDayGregorian = jalaliToGregorian(year, month, 1);\n\n // JS getDay(): 0=Sun, 1=Mon, 2=Tue, 3=Wed, 4=Thu, 5=Fri, 6=Sat\n // Map standard JS getDay() to Jalali index: 6(Sat)->0, 0(Sun)->1, ..., 5(Fri)->6\n const jsDay = firstDayGregorian.getDay();\n const rawJalaliWeekDay = (jsDay + 1) % 7;\n\n const leadingPaddingCount = (rawJalaliWeekDay - firstDayOfWeek + 7) % 7;\n\n // 1. Previous month trailing days\n const prevMonth = (month === 0 ? 11 : month - 1) as JalaliMonthIndex;\n const prevYear = month === 0 ? year - 1 : year;\n const daysInPrevMonth = getDaysInJalaliMonth(prevYear, prevMonth);\n\n for (let i = leadingPaddingCount - 1; i >= 0; i--) {\n const day = daysInPrevMonth - i;\n const jDate: JalaliDate = { year: prevYear, month: prevMonth, day };\n cells.push(buildCell(jDate, false));\n }\n\n // 2. Current month days\n const totalDays = getDaysInJalaliMonth(year, month);\n for (let d = 1; d <= totalDays; d++) {\n const jDate: JalaliDate = { year, month, day: d };\n cells.push(buildCell(jDate, true));\n }\n\n // 3. Next month leading days (completing 42 cells)\n const nextMonth = (month === 11 ? 0 : month + 1) as JalaliMonthIndex;\n const nextYear = month === 11 ? year + 1 : year;\n const trailingPaddingCount = 42 - cells.length;\n\n for (let d = 1; d <= trailingPaddingCount; d++) {\n const jDate: JalaliDate = { year: nextYear, month: nextMonth, day: d };\n cells.push(buildCell(jDate, false));\n }\n\n function buildCell(\n jDate: JalaliDate,\n isCurrentMonth: boolean,\n ): JalaliCalendarCell {\n const gregDate = jalaliToGregorian(jDate.year, jDate.month, jDate.day);\n const isToday = isSameJalaliDay(jDate, todayJalali);\n const isSelected = activeSelected\n ? isSameJalaliDay(jDate, activeSelected)\n : false;\n\n let isDisabled = false;\n if (minJalali) {\n const minG = jalaliToGregorian(\n minJalali.year,\n minJalali.month,\n minJalali.day,\n );\n if (gregDate.getTime() < minG.getTime()) isDisabled = true;\n }\n if (maxJalali) {\n const maxG = jalaliToGregorian(\n maxJalali.year,\n maxJalali.month,\n maxJalali.day,\n );\n if (gregDate.getTime() > maxG.getTime()) isDisabled = true;\n }\n if (isDateDisabled && isDateDisabled(jDate, gregDate)) {\n isDisabled = true;\n }\n\n return {\n jalali: jDate,\n gregorianDate: gregDate,\n dayNumber: jDate.day,\n isCurrentMonth,\n isToday,\n isSelected,\n isDisabled,\n };\n }\n\n return cells;\n}\n","import type { JalaliDate, JalaliDayOfWeek, JalaliMonthIndex } from \"./types\";\nimport {\n jalaliToGregorian,\n gregorianToJalali,\n getDaysInJalaliMonth,\n} from \"./jalali-math\";\n\n/**\n * Calculates day of week in Jalali calendar (0 = شنبه, ..., 6 = جمعه).\n */\nexport function getJalaliDayOfWeek(\n year: number,\n month: number,\n day: number,\n): JalaliDayOfWeek {\n const g = jalaliToGregorian(year, month as JalaliMonthIndex, day);\n const jsDay = g.getDay(); // 0 = Sunday, 6 = Saturday\n return ((jsDay + 1) % 7) as JalaliDayOfWeek;\n}\n\n/**\n * Adds or subtracts days to/from a Jalali date across month/year boundaries.\n */\nexport function addDaysToJalali(date: JalaliDate, days: number): JalaliDate {\n const g = jalaliToGregorian(date.year, date.month, date.day);\n g.setDate(g.getDate() + days);\n // تبدیل getMonth() از 0-indexed به 1-indexed برای gregorianToJalali\n return gregorianToJalali(g.getFullYear(), g.getMonth() + 1, g.getDate());\n}\n\n/**\n * Alias for addDaysToJalali\n */\nexport const addJalaliDays = addDaysToJalali;\n\n/**\n * Compares two Jalali dates:\n * - Returns -1 if d1 < d2\n * - Returns 1 if d1 > d2\n * - Returns 0 if d1 == d2\n */\nexport function compareJalaliDates(d1: JalaliDate, d2: JalaliDate): number {\n if (d1.year !== d2.year) return d1.year < d2.year ? -1 : 1;\n if (d1.month !== d2.month) return d1.month < d2.month ? -1 : 1;\n if (d1.day !== d2.day) return d1.day < d2.day ? -1 : 1;\n return 0;\n}\n\n/**\n * Checks if a target date falls strictly or inclusively between two dates.\n */\nexport function isJalaliDateBetween(\n target: JalaliDate,\n start: JalaliDate,\n end: JalaliDate,\n inclusive = true,\n): boolean {\n const minDate = compareJalaliDates(start, end) <= 0 ? start : end;\n const maxDate = compareJalaliDates(start, end) <= 0 ? end : start;\n\n const cmpMin = compareJalaliDates(target, minDate);\n const cmpMax = compareJalaliDates(target, maxDate);\n\n if (inclusive) {\n return cmpMin >= 0 && cmpMax <= 0;\n }\n return cmpMin > 0 && cmpMax < 0;\n}\n\n/**\n * Calculates the full Jalali week range starting Saturday and ending Friday.\n */\nexport function getJalaliWeekRange(date: JalaliDate): [JalaliDate, JalaliDate] {\n const dayOfWeek = getJalaliDayOfWeek(date.year, date.month, date.day);\n const startOfWeek = addDaysToJalali(date, -dayOfWeek); // شنبه\n const endOfWeek = addDaysToJalali(startOfWeek, 6); // جمعه\n return [startOfWeek, endOfWeek];\n}\n\n/**\n * Calculates full month range from day 1 to last day of that month.\n */\nexport function getJalaliMonthRange(\n date: JalaliDate,\n): [JalaliDate, JalaliDate] {\n const daysInMonth = getDaysInJalaliMonth(date.year, date.month);\n const start: JalaliDate = { year: date.year, month: date.month, day: 1 };\n const end: JalaliDate = {\n year: date.year,\n month: date.month,\n day: daysInMonth,\n };\n return [start, end];\n}\n","import { useState, useMemo, useCallback } from \"react\";\nimport type {\n JalaliDate,\n JalaliMonthIndex,\n JalaliCalendarCell,\n} from \"../core/types\";\nimport type {\n UseJalaliDatePickerOptions,\n UseJalaliDatePickerReturn,\n SelectionMode,\n DatePickerValue,\n JalaliDateRange,\n} from \"./types\";\nimport { getTodayJalali, isSameJalaliDay } from \"../core/jalali-math\";\nimport { generateJalaliCalendarGrid } from \"../core/calendar-grid\";\nimport {\n compareJalaliDates,\n isJalaliDateBetween,\n} from \"../core/jalali-helpers\";\n\nexport function useJalaliDatePicker<M extends SelectionMode = \"single\">(\n options: UseJalaliDatePickerOptions<M> = {},\n): UseJalaliDatePickerReturn<M> {\n const {\n mode = \"single\" as M,\n value: controlledValue,\n defaultValue,\n onChange,\n initialViewDate,\n firstDayOfWeek = 0,\n minDate,\n maxDate,\n isDateDisabled,\n } = options;\n\n // 1. Selection State (Controlled vs Uncontrolled)\n const [internalValue, setInternalValue] = useState<DatePickerValue<M>>(() => {\n if (defaultValue !== undefined) return defaultValue;\n if (mode === \"single\") return null as DatePickerValue<M>;\n if (mode === \"range\") return [null, null] as DatePickerValue<M>;\n return [] as unknown as DatePickerValue<M>;\n });\n\n const selected = (\n controlledValue !== undefined ? controlledValue : internalValue\n ) as DatePickerValue<M>;\n\n // 2. Range Hover State (for dynamic preview)\n const [hoverDate, setHoverDate] = useState<JalaliDate | null>(null);\n\n // 3. Active View (Month & Year)\n const today = useMemo(() => getTodayJalali(), []);\n const [viewState, setViewState] = useState<{\n year: number;\n month: JalaliMonthIndex;\n }>(() => {\n if (initialViewDate) return initialViewDate;\n if (mode === \"single\" && selected)\n return {\n year: (selected as JalaliDate).year,\n month: (selected as JalaliDate).month,\n };\n if (mode === \"range\" && (selected as JalaliDateRange)?.[0]) {\n const start = (selected as JalaliDateRange)[0]!;\n return { year: start.year, month: start.month };\n }\n return { year: today.year, month: today.month };\n });\n\n // 4. View Navigation\n const goToNextMonth = useCallback(() => {\n setViewState((prev) => {\n if (prev.month === 11) {\n return { year: prev.year + 1, month: 0 };\n }\n return { year: prev.year, month: (prev.month + 1) as JalaliMonthIndex };\n });\n }, []);\n\n const goToPrevMonth = useCallback(() => {\n setViewState((prev) => {\n if (prev.month === 0) {\n return { year: prev.year - 1, month: 11 };\n }\n return { year: prev.year, month: (prev.month - 1) as JalaliMonthIndex };\n });\n }, []);\n\n const setView = useCallback((year: number, month: JalaliMonthIndex) => {\n setViewState({ year, month });\n }, []);\n\n const goToToday = useCallback(() => {\n setViewState({ year: today.year, month: today.month });\n }, [today]);\n\n // 5. Selection Checks\n const isDateSelected = useCallback(\n (target: JalaliDate): boolean => {\n if (mode === \"single\") {\n return isSameJalaliDay(selected as JalaliDate | null, target);\n }\n if (mode === \"range\") {\n const [start, end] = (selected as JalaliDateRange) || [null, null];\n return isSameJalaliDay(start, target) || isSameJalaliDay(end, target);\n }\n if (mode === \"multiple\") {\n const list = (selected as JalaliDate[]) || [];\n return list.some((d) => isSameJalaliDay(d, target));\n }\n return false;\n },\n [mode, selected],\n );\n\n // 6. Selection Handler\n const updateSelection = useCallback(\n (newValue: DatePickerValue<M>) => {\n if (controlledValue === undefined) {\n setInternalValue(newValue);\n }\n onChange?.(newValue);\n },\n [controlledValue, onChange],\n );\n\n const selectDate = useCallback(\n (target: JalaliDate) => {\n if (mode === \"single\") {\n updateSelection(target as DatePickerValue<M>);\n } else if (mode === \"multiple\") {\n const currentList = (selected as JalaliDate[]) || [];\n const exists = currentList.some((d) => isSameJalaliDay(d, target));\n const updated = exists\n ? currentList.filter((d) => !isSameJalaliDay(d, target))\n : [...currentList, target].sort(compareJalaliDates);\n updateSelection(updated as unknown as DatePickerValue<M>);\n } else if (mode === \"range\") {\n const [start, end] = (selected as JalaliDateRange) || [null, null];\n\n // Step 1: Start fresh range\n if (!start || (start && end)) {\n updateSelection([target, null] as unknown as DatePickerValue<M>);\n }\n // Step 2: Complete existing range\n else {\n if (compareJalaliDates(target, start) < 0) {\n // Target is earlier than start: make target the start date\n updateSelection([target, start] as unknown as DatePickerValue<M>);\n } else {\n updateSelection([start, target] as unknown as DatePickerValue<M>);\n }\n setHoverDate(null);\n }\n }\n },\n [mode, selected, updateSelection],\n );\n\n const clear = useCallback(() => {\n if (mode === \"single\") updateSelection(null as DatePickerValue<M>);\n else if (mode === \"range\")\n updateSelection([null, null] as unknown as DatePickerValue<M>);\n else updateSelection([] as unknown as DatePickerValue<M>);\n }, [mode, updateSelection]);\n\n // 7. Month Grid Construction with Range & Multiple Metadata\n const rawGrid = useMemo(() => {\n return generateJalaliCalendarGrid({\n year: viewState.year,\n month: viewState.month,\n firstDayOfWeek,\n minDate,\n maxDate,\n isDateDisabled,\n });\n }, [\n viewState.year,\n viewState.month,\n firstDayOfWeek,\n minDate,\n maxDate,\n isDateDisabled,\n ]);\n\n // Enrich cells with active selection/range flags\n const grid = useMemo((): JalaliCalendarCell[] => {\n const rangeStart =\n mode === \"range\" ? (selected as JalaliDateRange)?.[0] : null;\n const rangeEnd =\n mode === \"range\" ? (selected as JalaliDateRange)?.[1] : null;\n const effectiveEnd =\n rangeEnd ?? (rangeStart && hoverDate ? hoverDate : null);\n\n return rawGrid.map((cell) => {\n const isSelected = isDateSelected(cell.jalali);\n let isInRange = false;\n let isRangeStart = false;\n let isRangeEnd = false;\n\n if (mode === \"range\" && rangeStart) {\n isRangeStart = isSameJalaliDay(cell.jalali, rangeStart);\n isRangeEnd = effectiveEnd\n ? isSameJalaliDay(cell.jalali, effectiveEnd)\n : false;\n\n if (effectiveEnd) {\n isInRange = isJalaliDateBetween(\n cell.jalali,\n rangeStart,\n effectiveEnd,\n );\n }\n }\n\n return {\n ...cell,\n isSelected,\n isInRange,\n isRangeStart,\n isRangeEnd,\n };\n });\n }, [rawGrid, mode, selected, hoverDate, isDateSelected]);\n\n return {\n selected,\n viewYear: viewState.year,\n viewMonth: viewState.month,\n grid,\n goToPrevMonth,\n goToNextMonth,\n setView,\n goToToday,\n selectDate,\n setHoverDate,\n clear,\n isDateSelected,\n hoverDate,\n };\n}\n","import type { JalaliMonthIndex } from \"../core/types\";\nimport { getDaysInJalaliMonth } from \"../core/jalali-math\";\nimport type { NavigateOptions, NavigationResult } from \"./types\";\n\nexport function calculateNextFocusedDate(\n options: NavigateOptions,\n): NavigationResult {\n const { currentFocused, key, isRtl = true } = options;\n let { year, month, day } = currentFocused;\n let viewChanged = false;\n let handled = true;\n\n // Handle RTL vs LTR arrow directions\n const stepLeft = isRtl ? 1 : -1;\n const stepRight = isRtl ? -1 : 1;\n\n switch (key) {\n case \"ArrowRight\":\n day += stepRight;\n break;\n\n case \"ArrowLeft\":\n day += stepLeft;\n break;\n\n case \"ArrowUp\":\n day -= 7;\n break;\n\n case \"ArrowDown\":\n day += 7;\n break;\n\n case \"Home\":\n day = 1;\n break;\n\n case \"End\":\n day = getDaysInJalaliMonth(year, month);\n break;\n\n case \"PageUp\":\n // Previous Month\n if (month === 0) {\n year -= 1;\n month = 11;\n } else {\n month = (month - 1) as JalaliMonthIndex;\n }\n viewChanged = true;\n break;\n\n case \"PageDown\":\n // Next Month\n if (month === 11) {\n year += 1;\n month = 0;\n } else {\n month = (month + 1) as JalaliMonthIndex;\n }\n viewChanged = true;\n break;\n\n default:\n handled = false;\n return { nextDate: currentFocused, viewChanged: false, handled: false };\n }\n\n // Normalize days falling outside current month boundary\n while (day < 1) {\n if (month === 0) {\n year -= 1;\n month = 11;\n } else {\n month = (month - 1) as JalaliMonthIndex;\n }\n day += getDaysInJalaliMonth(year, month);\n viewChanged = true;\n }\n\n while (day > getDaysInJalaliMonth(year, month)) {\n day -= getDaysInJalaliMonth(year, month);\n if (month === 11) {\n year += 1;\n month = 0;\n } else {\n month = (month + 1) as JalaliMonthIndex;\n }\n viewChanged = true;\n }\n\n return {\n nextDate: { year, month, day },\n viewChanged,\n handled,\n };\n}\n","import type { JalaliDate } from \"../core/types\";\nimport { PERSIAN_MONTH_NAMES, PERSIAN_WEEK_DAYS_LONG } from \"../core/constants\";\nimport { jalaliToGregorian } from \"../core/jalali-math\";\n\n/**\n * Creates an accessible full Persian string for screen readers.\n * Example: \"شنبه، ۱ فروردین ۱۴۰۵\"\n */\nexport function getAriaDayLabel(date: JalaliDate): string {\n const gregorian = jalaliToGregorian(date.year, date.month, date.day);\n const jsDay = gregorian.getDay();\n const jalaliDayOfWeek = (jsDay + 1) % 7; // 0 = Sat, 1 = Sun, ...\n\n const weekDayName = PERSIAN_WEEK_DAYS_LONG[jalaliDayOfWeek];\n const monthName = PERSIAN_MONTH_NAMES[date.month];\n\n return `${weekDayName}، ${date.day} ${monthName} ${date.year}`;\n}\n","import { useState, useCallback } from \"react\";\nimport type { JalaliDate } from \"../core/types\";\nimport { calculateNextFocusedDate } from \"./keyboard-navigation\";\nimport { isSameJalaliDay } from \"../core/jalali-math\";\nimport type { UseCalendarKeyboardProps } from \"./types\";\n\nexport function useCalendarKeyboard(props: UseCalendarKeyboardProps) {\n const {\n viewYear,\n viewMonth,\n selectedDate,\n onSelectDate,\n onViewChange,\n isRtl = true,\n } = props;\n\n const [focusedDate, setFocusedDate] = useState<JalaliDate>(() => {\n return selectedDate ?? { year: viewYear, month: viewMonth, day: 1 };\n });\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n onSelectDate(focusedDate);\n return;\n }\n\n const result = calculateNextFocusedDate({\n currentFocused: focusedDate,\n key: e.key,\n isRtl,\n });\n\n if (result.handled) {\n e.preventDefault();\n setFocusedDate(result.nextDate);\n\n if (result.viewChanged) {\n onViewChange(result.nextDate.year, result.nextDate.month);\n }\n }\n },\n [focusedDate, isRtl, onSelectDate, onViewChange],\n );\n\n const getCellTabIndex = useCallback(\n (cellDate: JalaliDate): number => {\n return isSameJalaliDay(cellDate, focusedDate) ? 0 : -1;\n },\n [focusedDate],\n );\n\n return {\n focusedDate,\n setFocusedDate,\n handleKeyDown,\n getCellTabIndex,\n };\n}\n","const PERSIAN_DIGITS = [\"۰\", \"۱\", \"۲\", \"۳\", \"۴\", \"۵\", \"۶\", \"۷\", \"۸\", \"۹\"];\nconst LATIN_DIGITS: Record<string, string> = {\n \"۰\": \"0\",\n \"۱\": \"1\",\n \"۲\": \"2\",\n \"۳\": \"3\",\n \"۴\": \"4\",\n \"۵\": \"5\",\n \"۶\": \"6\",\n \"۷\": \"7\",\n \"۸\": \"8\",\n \"۹\": \"9\",\n \"٠\": \"0\",\n \"١\": \"1\",\n \"٢\": \"2\",\n \"٣\": \"3\",\n \"٤\": \"4\", // Arabic-indic fallbacks\n \"٥\": \"5\",\n \"٦\": \"6\",\n \"٧\": \"7\",\n \"٨\": \"8\",\n \"٩\": \"9\",\n};\n\n/**\n * Converts Latin digits (0-9) to Persian digits (۰-۹).\n */\nexport function toPersianDigits(input: string | number): string {\n return String(input).replace(/[0-9]/g, (w) => PERSIAN_DIGITS[+w]);\n}\n\n/**\n * Converts Persian/Arabic digits to standard ASCII Latin digits (0-9).\n */\nexport function toLatinDigits(input: string): string {\n return input.replace(/[۰-۹٠-٩]/g, (char) => LATIN_DIGITS[char] ?? char);\n}\n","import type { JalaliDate } from \"../core/types\";\nimport { PERSIAN_MONTH_NAMES, PERSIAN_WEEK_DAYS_LONG } from \"../core/constants\";\nimport { jalaliToGregorian } from \"../core/jalali-math\";\nimport { toPersianDigits } from \"./persian-digits\";\n\nexport interface FormatJalaliOptions {\n /** Output digits format. Defaults to 'persian'. */\n digitType?: \"persian\" | \"latin\";\n}\n\n/**\n * Formats a JalaliDate using standard format pattern tokens:\n * - YYYY: 4-digit year (1405)\n * - YY: 2-digit year (05)\n * - MMMM: Full month name (فروردین)\n * - MM: 2-digit month (01-12)\n * - M: 1-digit month (1-12)\n * - dddd: Full weekday name (شنبه)\n * - DD: 2-digit day (01-31)\n * - D: 1-digit day (1-31)\n */\nexport function formatJalaliDate(\n date: JalaliDate | null | undefined,\n pattern = \"YYYY/MM/DD\",\n options: FormatJalaliOptions = {},\n): string {\n if (!date) return \"\";\n\n const { digitType = \"persian\" } = options;\n\n const gregorian = jalaliToGregorian(date.year, date.month, date.day);\n const jsDay = gregorian.getDay();\n const jalaliDayOfWeek = (jsDay + 1) % 7;\n\n const yearStr = String(date.year);\n const shortYearStr = yearStr.slice(-2);\n const monthNum = date.month + 1;\n const monthStr = monthNum < 10 ? `0${monthNum}` : String(monthNum);\n const monthName = PERSIAN_MONTH_NAMES[date.month];\n const dayStr = date.day < 10 ? `0${date.day}` : String(date.day);\n const weekdayName = PERSIAN_WEEK_DAYS_LONG[jalaliDayOfWeek];\n\n let formatted = pattern\n .replace(/\\bYYYY\\b/g, yearStr)\n .replace(/\\bYY\\b/g, shortYearStr)\n .replace(/\\bMMMM\\b/g, monthName)\n .replace(/\\bMM\\b/g, monthStr)\n .replace(/\\bM\\b/g, String(monthNum))\n .replace(/\\bdddd\\b/g, weekdayName)\n .replace(/\\bDD\\b/g, dayStr)\n .replace(/\\bD\\b/g, String(date.day));\n\n if (digitType === \"persian\") {\n // Convert numeric matches while preserving month/weekday strings\n formatted = formatted.replace(/\\d+/g, (num) => toPersianDigits(num));\n }\n\n return formatted;\n}\n","import type { DatePickerTokens } from \"./types\";\n\nexport const lightThemeTokens: DatePickerTokens = {\n primaryColor: \"#0284c7\", // Sky-600\n primaryHover: \"#0369a1\",\n primaryActive: \"#075985\",\n primaryContrastText: \"#ffffff\",\n\n rangeBetweenBg: \"#e0f2fe\", // Sky-100\n rangeBetweenText: \"#0369a1\",\n\n surfaceBg: \"#ffffff\",\n surfaceBorder: \"#e2e8f0\",\n headerBg: \"#f8fafc\",\n\n textPrimary: \"#0f172a\",\n textSecondary: \"#475569\",\n textMuted: \"#94a3b8\",\n textDisabled: \"#cbd5e1\",\n\n todayIndicatorColor: \"#0284c7\",\n\n borderRadius: \"8px\",\n cellSize: \"36px\",\n shadow: \"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)\",\n fontFamily: \"inherit\",\n};\n\nexport const darkThemeTokens: DatePickerTokens = {\n primaryColor: \"#38bdf8\", // Sky-400\n primaryHover: \"#7dd3fc\",\n primaryActive: \"#bae6fd\",\n primaryContrastText: \"#0f172a\",\n\n rangeBetweenBg: \"#082f49\", // Sky-950\n rangeBetweenText: \"#7dd3fc\",\n\n surfaceBg: \"#0f172a\",\n surfaceBorder: \"#334155\",\n headerBg: \"#1e293b\",\n\n textPrimary: \"#f8fafc\",\n textSecondary: \"#cbd5e1\",\n textMuted: \"#64748b\",\n textDisabled: \"#475569\",\n\n todayIndicatorColor: \"#38bdf8\",\n\n borderRadius: \"8px\",\n cellSize: \"36px\",\n shadow: \"0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5)\",\n fontFamily: \"inherit\",\n};\n\n/**\n * Maps camelCase tokens to kebab-case CSS variables for injection.\n */\nexport function tokensToCssVariables(\n tokens: Partial<DatePickerTokens>,\n): Record<string, string> {\n const vars: Record<string, string> = {};\n for (const [key, value] of Object.entries(tokens)) {\n if (value !== undefined) {\n const cssVarName = `--pdp-${key.replace(/([A-Z])/g, \"-$1\").toLowerCase()}`;\n vars[cssVarName] = value;\n }\n }\n return vars;\n}\n","import React, { createContext, useContext, useMemo } from \"react\";\nimport {\n lightThemeTokens,\n darkThemeTokens,\n tokensToCssVariables,\n} from \"./tokens\";\nimport type { DatePickerThemeProviderProps, ThemeContextValue } from \"./types\";\n\nconst ThemeContext = createContext<ThemeContextValue>({\n tokens: lightThemeTokens,\n mode: \"light\",\n});\n\nexport const DatePickerThemeProvider: React.FC<\n DatePickerThemeProviderProps\n> = ({ mode = \"light\", customTokens, children }) => {\n const tokens = useMemo(() => {\n const base = mode === \"dark\" ? darkThemeTokens : lightThemeTokens;\n return { ...base, ...customTokens };\n }, [mode, customTokens]);\n\n const cssVariables = useMemo(() => tokensToCssVariables(tokens), [tokens]);\n\n return (\n <ThemeContext.Provider value={{ tokens, mode }}>\n <div\n className=\"pdp-theme-root\"\n dir=\"rtl\"\n style={{\n ...(cssVariables as React.CSSProperties),\n display: \"inline-block\",\n fontFamily: tokens.fontFamily,\n }}\n >\n {children}\n </div>\n </ThemeContext.Provider>\n );\n};\n\nexport const useDatePickerTheme = (): ThemeContextValue =>\n useContext(ThemeContext);\n","import React from \"react\";\nimport type { JalaliMonthIndex } from \"../core/types\";\nimport { PERSIAN_MONTH_NAMES } from \"../core/constants\";\nimport { toPersianDigits } from \"../formatters/persian-digits\";\nimport type {\n DatePickerClassNames,\n DatePickerStyles,\n} from \"../theme/style-slots\";\n\nexport interface HeaderProps {\n year: number;\n month: JalaliMonthIndex;\n onPrevMonth: () => void;\n onNextMonth: () => void;\n onTogglePicker: () => void;\n onGoToToday: () => void;\n classNames?: DatePickerClassNames;\n styles?: DatePickerStyles;\n}\n\nexport const Header: React.FC<HeaderProps> = ({\n year,\n month,\n onPrevMonth,\n onNextMonth,\n onTogglePicker,\n classNames,\n styles,\n}) => {\n return (\n <div\n className={classNames?.header}\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n marginBottom: \"12px\",\n padding: \"0 4px\",\n height: \"28px\",\n ...styles?.header,\n }}\n >\n <button\n type=\"button\"\n aria-label=\"ماه قبل\"\n onClick={onPrevMonth}\n className={classNames?.navButton}\n style={{\n width: \"28px\",\n height: \"28px\",\n borderRadius: \"6px\",\n border: \"1px solid var(--pdp-surface-border, #e2e8f0)\",\n backgroundColor: \"var(--pdp-surface-bg, #ffffff)\",\n color: \"var(--pdp-text-primary, #0f172a)\",\n cursor: \"pointer\",\n ...styles?.navButton,\n }}\n >\n ›\n </button>\n\n <button\n type=\"button\"\n onClick={onTogglePicker}\n className={classNames?.headerTitle}\n style={{\n background: \"none\",\n border: \"none\",\n cursor: \"pointer\",\n fontSize: \"15px\",\n fontWeight: 600,\n color: \"var(--pdp-text-primary, #0f172a)\",\n display: \"flex\",\n gap: \"6px\",\n ...styles?.headerTitle,\n }}\n >\n <span>{PERSIAN_MONTH_NAMES[month]}</span>\n <span>{toPersianDigits(year)}</span>\n </button>\n\n <button\n type=\"button\"\n aria-label=\"ماه بعد\"\n onClick={onNextMonth}\n className={classNames?.navButton}\n style={{\n width: \"28px\",\n height: \"28px\",\n borderRadius: \"6px\",\n border: \"1px solid var(--pdp-surface-border, #e2e8f0)\",\n backgroundColor: \"var(--pdp-surface-bg, #ffffff)\",\n color: \"var(--pdp-text-primary, #0f172a)\",\n cursor: \"pointer\",\n ...styles?.navButton,\n }}\n >\n ‹\n </button>\n </div>\n );\n};\n","import React from \"react\";\nimport type { JalaliDayOfWeek } from \"../core/types\";\nimport type {\n DatePickerClassNames,\n DatePickerStyles,\n} from \"../theme/style-slots\";\nimport { PERSIAN_WEEK_DAYS_SHORT } from \"../core/constants\";\n\nexport interface WeekdaysProps {\n firstDayOfWeek?: JalaliDayOfWeek;\n classNames?: DatePickerClassNames;\n styles?: DatePickerStyles;\n}\n\nexport const Weekdays: React.FC<WeekdaysProps> = ({\n firstDayOfWeek = 0,\n classNames,\n styles,\n}) => {\n const orderedWeekdays = [\n ...PERSIAN_WEEK_DAYS_SHORT.slice(firstDayOfWeek),\n ...PERSIAN_WEEK_DAYS_SHORT.slice(0, firstDayOfWeek),\n ];\n\n return (\n <div\n role=\"row\"\n aria-label=\"روزهای هفته\"\n className={classNames?.weekdays}\n style={{\n display: \"grid\",\n gridTemplateColumns: \"repeat(7, var(--pdp-cell-size, 36px))\",\n gap: \"4px\",\n marginBottom: \"6px\",\n textAlign: \"center\",\n ...styles?.weekdays,\n }}\n >\n {orderedWeekdays.map((name, idx) => (\n <div\n key={idx}\n role=\"columnheader\"\n className={classNames?.weekdayCell}\n style={{\n fontSize: \"12px\",\n fontWeight: 600,\n color: \"var(--pdp-text-muted, #94a3b8)\",\n userSelect: \"none\",\n ...styles?.weekdayCell,\n }}\n >\n {name}\n </div>\n ))}\n </div>\n );\n};\n","import React, { useState } from \"react\";\nimport type { JalaliCalendarCell, JalaliDate } from \"../core/types\";\nimport { toPersianDigits } from \"../formatters/persian-digits\";\nimport { getAriaDayLabel } from \"../a11y/aria-helpers\";\nimport type { CalendarEvent } from \"../events/types\";\nimport type {\n DatePickerClassNames,\n DatePickerStyles,\n} from \"../theme/style-slots\";\n\nexport interface DayCellProps {\n cell: JalaliCalendarCell;\n tabIndex: number;\n digitType?: \"persian\" | \"latin\";\n isHoliday?: boolean;\n holidayTitle?: string;\n events?: CalendarEvent[];\n classNames?: DatePickerClassNames;\n styles?: DatePickerStyles;\n onSelect: (date: JalaliDate) => void;\n onHover?: (date: JalaliDate | null) => void;\n onFocus?: (date: JalaliDate) => void;\n}\n\nexport const DayCell: React.FC<DayCellProps> = ({\n cell,\n tabIndex,\n digitType = \"persian\",\n isHoliday = false,\n holidayTitle,\n events = [],\n classNames,\n styles,\n onSelect,\n onHover,\n onFocus,\n}) => {\n const {\n jalali,\n isCurrentMonth,\n isToday,\n isSelected,\n isDisabled,\n isInRange,\n isRangeStart,\n isRangeEnd,\n } = cell;\n\n const [isHovered, setIsHovered] = useState(false);\n\n const dayDisplay =\n digitType === \"persian\" ? toPersianDigits(cell.dayNumber) : cell.dayNumber;\n let ariaLabel = getAriaDayLabel(jalali);\n\n if (isHoliday && holidayTitle) {\n ariaLabel += ` (${holidayTitle})`;\n }\n\n // Base Dynamic Styles\n let backgroundColor = \"transparent\";\n let textColor = isCurrentMonth\n ? isHoliday\n ? \"var(--pdp-holiday-color, #ef4444)\"\n : \"var(--pdp-text-primary, #0f172a)\"\n : \"var(--pdp-text-disabled, #cbd5e1)\";\n\n if (isInRange && !isSelected) {\n backgroundColor = \"var(--pdp-range-between-bg, #e0f2fe)\";\n textColor = \"var(--pdp-range-between-text, #0369a1)\";\n }\n\n if (isSelected || isRangeStart || isRangeEnd) {\n backgroundColor = \"var(--pdp-primary-color, #0284c7)\";\n textColor = \"var(--pdp-primary-contrast-text, #ffffff)\";\n }\n\n // Aggregate dynamic classNames\n const combinedClasses = [\n classNames?.dayCell,\n isToday && classNames?.todayCell,\n isSelected && classNames?.selectedCell,\n isInRange && !isSelected && classNames?.rangeBetweenCell,\n isDisabled && classNames?.disabledCell,\n isHoliday && classNames?.holidayCell,\n ]\n .filter(Boolean)\n .join(\" \");\n\n // Aggregate dynamic custom styles\n const combinedStyles: React.CSSProperties = {\n width: \"var(--pdp-cell-size, 36px)\",\n height: \"var(--pdp-cell-size, 36px)\",\n display: \"inline-flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius:\n isRangeStart || isRangeEnd || (!isInRange && isSelected)\n ? \"var(--pdp-border-radius, 8px)\"\n : \"4px\",\n border:\n isToday && !isSelected\n ? \"1px solid var(--pdp-today-indicator-color, #0284c7)\"\n : \"none\",\n backgroundColor,\n color: textColor,\n fontWeight: isToday || isSelected || isHoliday ? 700 : 400,\n fontSize: \"14px\",\n cursor: isDisabled ? \"not-allowed\" : \"pointer\",\n opacity: isDisabled ? 0.4 : 1,\n transition: \"background-color 0.15s ease, color 0.15s ease\",\n outline: \"none\",\n position: \"relative\",\n ...styles?.dayCell,\n ...(isToday ? styles?.todayCell : {}),\n ...(isSelected ? styles?.selectedCell : {}),\n ...(isInRange && !isSelected ? styles?.rangeBetweenCell : {}),\n ...(isDisabled ? styles?.disabledCell : {}),\n ...(isHoliday ? styles?.holidayCell : {}),\n };\n\n const hasEvents = events.length > 0;\n const primaryBadgeColor = hasEvents\n ? (events[0].color ?? \"var(--pdp-primary-color, #0284c7)\")\n : undefined;\n\n return (\n <div\n style={{ position: \"relative\", display: \"inline-flex\" }}\n onMouseEnter={() => {\n setIsHovered(true);\n if (!isDisabled) onHover?.(jalali);\n }}\n onMouseLeave={() => {\n setIsHovered(false);\n onHover?.(null);\n }}\n >\n <button\n type=\"button\"\n role=\"gridcell\"\n tabIndex={isDisabled ? -1 : tabIndex}\n aria-selected={isSelected || isRangeStart || isRangeEnd}\n aria-disabled={isDisabled}\n aria-label={ariaLabel}\n disabled={isDisabled}\n onClick={() => !isDisabled && onSelect(jalali)}\n onFocus={() => !isDisabled && onFocus?.(jalali)}\n className={combinedClasses || undefined}\n style={combinedStyles}\n >\n <span style={{ lineHeight: 1 }}>{dayDisplay}</span>\n\n {hasEvents && !isSelected && (\n <div\n className={classNames?.eventBadge}\n style={{\n display: \"flex\",\n gap: \"2px\",\n position: \"absolute\",\n bottom: \"3px\",\n ...styles?.eventBadge,\n }}\n >\n {events.slice(0, 3).map((ev, idx) => (\n <span\n key={idx}\n style={{\n width: \"4px\",\n height: \"4px\",\n borderRadius: \"50%\",\n backgroundColor: ev.color ?? primaryBadgeColor,\n display: \"inline-block\",\n }}\n />\n ))}\n </div>\n )}\n </button>\n\n {/* Hover Tooltip */}\n {isHovered && (hasEvents || (isHoliday && holidayTitle)) && (\n <div\n role=\"tooltip\"\n style={{\n position: \"absolute\",\n bottom: \"calc(100% + 6px)\",\n left: \"50%\",\n transform: \"translateX(-50%)\",\n zIndex: 100,\n backgroundColor: \"#0f172a\",\n color: \"#f8fafc\",\n padding: \"6px 10px\",\n borderRadius: \"6px\",\n fontSize: \"11px\",\n whiteSpace: \"nowrap\",\n boxShadow: \"0 4px 6px -1px rgb(0 0 0 / 0.3)\",\n pointerEvents: \"none\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"2px\",\n minWidth: \"max-content\",\n maxWidth: \"200px\",\n textAlign: \"center\",\n }}\n >\n {isHoliday && holidayTitle && (\n <div style={{ color: \"#f87171\", fontWeight: 600 }}>\n {holidayTitle}\n </div>\n )}\n {events.map((ev) => (\n <div\n key={ev.id}\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: \"4px\",\n justifyContent: \"center\",\n }}\n >\n {ev.color && (\n <span\n style={{\n width: \"6px\",\n height: \"6px\",\n borderRadius: \"50%\",\n backgroundColor: ev.color,\n display: \"inline-block\",\n }}\n />\n )}\n <span style={{ fontWeight: 500 }}>{ev.title}</span>\n </div>\n ))}\n <div\n style={{\n position: \"absolute\",\n top: \"100%\",\n left: \"50%\",\n transform: \"translateX(-50%)\",\n borderWidth: \"4px\",\n borderStyle: \"solid\",\n borderColor: \"#0f172a transparent transparent transparent\",\n }}\n />\n </div>\n )}\n </div>\n );\n};\n","import React, { useState } from \"react\";\nimport type { JalaliMonthIndex } from \"../core/types\";\nimport { PERSIAN_MONTH_NAMES } from \"../core/constants\";\nimport { toPersianDigits } from \"../formatters/persian-digits\";\n\nexport interface MonthYearPickerProps {\n currentYear: number;\n currentMonth: JalaliMonthIndex;\n onSelectMonth: (month: JalaliMonthIndex) => void;\n onSelectYear: (year: number) => void;\n onClose: () => void;\n}\n\nexport const MonthYearPicker: React.FC<MonthYearPickerProps> = ({\n currentYear,\n currentMonth,\n onSelectMonth,\n onSelectYear,\n onClose,\n}) => {\n const [viewMode, setViewMode] = useState<\"months\" | \"years\">(\"months\");\n const [yearPageStart, setYearPageStart] = useState(\n Math.floor(currentYear / 12) * 12,\n );\n\n const years = Array.from({ length: 12 }, (_, i) => yearPageStart + i);\n\n return (\n <div\n style={{\n padding: \"8px\",\n backgroundColor: \"var(--pdp-surface-bg, #ffffff)\",\n borderRadius: \"var(--pdp-border-radius, 8px)\",\n }}\n >\n {/* Header Selector Switch */}\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n marginBottom: \"12px\",\n }}\n >\n <button\n type=\"button\"\n onClick={() =>\n viewMode === \"years\" ? setYearPageStart((y) => y - 12) : null\n }\n style={{\n background: \"none\",\n border: \"none\",\n cursor: \"pointer\",\n fontSize: \"16px\",\n color: \"var(--pdp-text-primary)\",\n }}\n >\n ‹\n </button>\n\n <div style={{ display: \"flex\", gap: \"8px\" }}>\n <button\n type=\"button\"\n onClick={() => setViewMode(\"months\")}\n style={{\n fontWeight: viewMode === \"months\" ? 700 : 400,\n background: \"none\",\n border: \"none\",\n cursor: \"pointer\",\n color: \"var(--pdp-primary-color, #0284c7)\",\n }}\n >\n {PERSIAN_MONTH_NAMES[currentMonth]}\n </button>\n <button\n type=\"button\"\n onClick={() => setViewMode(\"years\")}\n style={{\n fontWeight: viewMode === \"years\" ? 700 : 400,\n background: \"none\",\n border: \"none\",\n cursor: \"pointer\",\n color: \"var(--pdp-primary-color, #0284c7)\",\n }}\n >\n {toPersianDigits(currentYear)}\n </button>\n </div>\n\n <button\n type=\"button\"\n onClick={() =>\n viewMode === \"years\" ? setYearPageStart((y) => y + 12) : null\n }\n style={{\n background: \"none\",\n border: \"none\",\n cursor: \"pointer\",\n fontSize: \"16px\",\n color: \"var(--pdp-text-primary)\",\n }}\n >\n ›\n </button>\n </div>\n\n {/* Grid of Months */}\n {viewMode === \"months\" && (\n <div\n style={{\n display: \"grid\",\n gridTemplateColumns: \"repeat(3, 1fr)\",\n gap: \"8px\",\n }}\n >\n {PERSIAN_MONTH_NAMES.map((name, index) => (\n <button\n key={name}\n type=\"button\"\n onClick={() => {\n onSelectMonth(index as JalaliMonthIndex);\n onClose();\n }}\n style={{\n padding: \"8px 4px\",\n borderRadius: \"6px\",\n border: \"none\",\n cursor: \"pointer\",\n backgroundColor:\n currentMonth === index\n ? \"var(--pdp-primary-color, #0284c7)\"\n : \"transparent\",\n color:\n currentMonth === index\n ? \"#ffffff\"\n : \"var(--pdp-text-primary, #0f172a)\",\n fontSize: \"13px\",\n }}\n >\n {name}\n </button>\n ))}\n </div>\n )}\n\n {/* Grid of Years */}\n {viewMode === \"years\" && (\n <div\n style={{\n display: \"grid\",\n gridTemplateColumns: \"repeat(3, 1fr)\",\n gap: \"8px\",\n }}\n >\n {years.map((yr) => (\n <button\n key={yr}\n type=\"button\"\n onClick={() => {\n onSelectYear(yr);\n setViewMode(\"months\");\n }}\n style={{\n padding: \"8px 4px\",\n borderRadius: \"6px\",\n border: \"none\",\n cursor: \"pointer\",\n backgroundColor:\n currentYear === yr\n ? \"var(--pdp-primary-color, #0284c7)\"\n : \"transparent\",\n color:\n currentYear === yr\n ? \"#ffffff\"\n : \"var(--pdp-text-primary, #0f172a)\",\n fontSize: \"13px\",\n }}\n >\n {toPersianDigits(yr)}\n </button>\n ))}\n </div>\n )}\n </div>\n );\n};\n","import type { JalaliTime } from \"./types\";\nimport { toPersianDigits } from \"../../formatters/persian-digits\";\n\n/**\n * Formats a single time segment (e.g. hour/minute) as a 2-digit padded string.\n */\nexport function formatTimeSegment(\n val: number,\n digitType: \"persian\" | \"latin\" = \"persian\",\n): string {\n const padded = val < 10 ? `0${val}` : `${val}`;\n return digitType === \"persian\" ? toPersianDigits(padded) : padded;\n}\n\n/**\n * Retrieves the current local machine time as a JalaliTime structure.\n */\nexport function getCurrentTime(): JalaliTime {\n const now = new Date();\n return {\n hour: now.getHours(),\n minute: now.getMinutes(),\n second: now.getSeconds(),\n };\n}\n\n/**\n * Clamps hour, minute, and second within valid boundary ranges.\n */\nexport function clampTime(time: JalaliTime): JalaliTime {\n return {\n hour: Math.max(0, Math.min(23, time.hour)),\n minute: Math.max(0, Math.min(59, time.minute)),\n second:\n time.second !== undefined\n ? Math.max(0, Math.min(59, time.second))\n : undefined,\n };\n}\n\n/**\n * Formats a JalaliTime object into a display string (e.g., \"14:30\" or \"۱۴:۳۰\").\n */\nexport function formatTimeString(\n time: JalaliTime | null | undefined,\n showSeconds = false,\n digitType: \"persian\" | \"latin\" = \"persian\",\n): string {\n if (!time) return \"\";\n const h = formatTimeSegment(time.hour, digitType);\n const m = formatTimeSegment(time.minute, digitType);\n if (showSeconds && time.second !== undefined) {\n const s = formatTimeSegment(time.second, digitType);\n return `${h}:${m}:${s}`;\n }\n return `${h}:${m}`;\n}\n","import React from \"react\";\nimport type { CalendarFooterProps } from \"./types\";\nimport { formatJalaliDate } from \"../../formatters/jalali-formatter\";\nimport { formatTimeString } from \"../../plugins/time-picker/time-utils\";\nimport { toPersianDigits } from \"../../formatters/persian-digits\";\nimport type {\n DatePickerClassNames,\n DatePickerStyles,\n} from \"../../theme/style-slots\";\n\nexport interface ExtendedCalendarFooterProps extends CalendarFooterProps {\n classNames?: DatePickerClassNames;\n styles?: DatePickerStyles;\n}\n\nexport const CalendarFooter: React.FC<ExtendedCalendarFooterProps> = ({\n selectedDate,\n selectedRange,\n selectedDates,\n selectedTime,\n mode = \"single\",\n digitType = \"persian\",\n showStatusText = true,\n showActions = true,\n onToday,\n onClear,\n onConfirm,\n classNames,\n styles,\n}) => {\n const getStatusText = (): string => {\n let text = \"هیچ تاریخی انتخاب نشده است\";\n\n if (mode === \"single\" && selectedDate) {\n text = formatJalaliDate(selectedDate, \"dddd D MMMM YYYY\", { digitType });\n if (selectedTime) {\n text += ` - ${formatTimeString(selectedTime, false, digitType)}`;\n }\n } else if (mode === \"range\") {\n const [start, end] = selectedRange || [null, null];\n if (start && end) {\n text = `${formatJalaliDate(start, \"YYYY/MM/DD\", { digitType })} تا ${formatJalaliDate(end, \"YYYY/MM/DD\", { digitType })}`;\n } else if (start) {\n text = `شروع: ${formatJalaliDate(start, \"YYYY/MM/DD\", { digitType })} (پایان را انتخاب کنید)`;\n }\n } else if (\n mode === \"multiple\" &&\n selectedDates &&\n selectedDates.length > 0\n ) {\n const countStr =\n digitType === \"persian\"\n ? toPersianDigits(selectedDates.length)\n : selectedDates.length;\n text = `${countStr} روز انتخاب شده`;\n }\n\n return text;\n };\n\n return (\n <div\n className={classNames?.footer}\n style={{\n marginTop: \"8px\",\n paddingTop: \"8px\",\n borderTop: \"1px solid var(--pdp-surface-border, #e2e8f0)\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"6px\",\n ...styles?.footer,\n }}\n >\n {showStatusText && (\n <div\n aria-live=\"polite\"\n style={{\n fontSize: \"12px\",\n color: \"var(--pdp-text-secondary, #475569)\",\n textAlign: \"center\",\n minHeight: \"18px\",\n fontWeight: 500,\n }}\n >\n {getStatusText()}\n </div>\n )}\n\n {showActions && (\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n gap: \"8px\",\n }}\n >\n <div style={{ display: \"flex\", gap: \"4px\" }}>\n {onToday && (\n <button\n type=\"button\"\n onClick={onToday}\n style={{\n padding: \"3px 8px\",\n fontSize: \"11px\",\n borderRadius: \"4px\",\n border: \"1px solid var(--pdp-surface-border, #e2e8f0)\",\n backgroundColor: \"transparent\",\n color: \"var(--pdp-text-primary, #0f172a)\",\n cursor: \"pointer\",\n }}\n >\n امروز\n </button>\n )}\n {onClear && (\n <button\n type=\"button\"\n onClick={onClear}\n style={{\n padding: \"3px 8px\",\n fontSize: \"11px\",\n borderRadius: \"4px\",\n border: \"1px solid var(--pdp-surface-border, #e2e8f0)\",\n backgroundColor: \"transparent\",\n color: \"var(--pdp-text-muted, #94a3b8)\",\n cursor: \"pointer\",\n }}\n >\n پاک کردن\n </button>\n )}\n </div>\n\n {onConfirm && (\n <button\n type=\"button\"\n onClick={onConfirm}\n style={{\n padding: \"4px 12px\",\n fontSize: \"12px\",\n fontWeight: 600,\n borderRadius: \"6px\",\n border: \"none\",\n backgroundColor: \"var(--pdp-primary-color, #0284c7)\",\n color: \"var(--pdp-primary-contrast-text, #ffffff)\",\n cursor: \"pointer\",\n }}\n >\n تایید\n </button>\n )}\n </div>\n )}\n </div>\n );\n};\n","import React, { useCallback } from \"react\";\nimport type { TimePickerProps, JalaliTime } from \"./types\";\nimport { formatTimeSegment, getCurrentTime, clampTime } from \"./time-utils\";\n\nexport const TimePicker: React.FC<TimePickerProps> = ({\n value,\n defaultValue,\n onChange,\n minuteStep = 1,\n hourStep = 1,\n showSeconds = false,\n digitType = \"persian\",\n disabled = false,\n styles,\n classNames,\n}) => {\n // Internal state for uncontrolled usage\n const [internalTime, setInternalTime] = React.useState<JalaliTime>(\n defaultValue ?? getCurrentTime(),\n );\n\n // Active time resolution (controlled vs uncontrolled)\n const activeTime =\n value !== undefined ? (value ?? getCurrentTime()) : internalTime;\n\n // Handles state updates and triggers onChange\n const updateTime = useCallback(\n (newTime: JalaliTime) => {\n const clamped = clampTime(newTime);\n if (value === undefined) {\n setInternalTime(clamped);\n }\n onChange?.(clamped);\n },\n [value, onChange],\n );\n\n // Hour increment / decrement\n const changeHour = (delta: number) => {\n const newHour = (activeTime.hour + delta * hourStep + 24) % 24;\n updateTime({ ...activeTime, hour: newHour });\n };\n\n // Minute increment / decrement\n const changeMinute = (delta: number) => {\n const newMinute = (activeTime.minute + delta * minuteStep + 60) % 60;\n updateTime({ ...activeTime, minute: newMinute });\n };\n\n // Second increment / decrement\n const changeSecond = (delta: number) => {\n if (!showSeconds) return;\n const currentSec = activeTime.second ?? 0;\n const newSecond = (currentSec + delta + 60) % 60;\n updateTime({ ...activeTime, second: newSecond });\n };\n\n const buttonStyle: React.CSSProperties = {\n background: \"none\",\n border: \"none\",\n cursor: disabled ? \"not-allowed\" : \"pointer\",\n color: \"var(--pdp-primary-color, #0284c7)\",\n fontSize: \"12px\",\n padding: \"2px 6px\",\n lineHeight: 1,\n };\n\n const segmentStyle: React.CSSProperties = {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n\n const digitStyle: React.CSSProperties = {\n fontSize: \"15px\",\n fontWeight: 600,\n color: \"var(--pdp-text-primary, #0f172a)\",\n minWidth: \"24px\",\n textAlign: \"center\",\n };\n\n return (\n <div\n role=\"group\"\n aria-label=\"Time Selection\"\n className={classNames?.timePicker}\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: \"6px\",\n padding: \"8px 12px\",\n borderTop: \"1px solid var(--pdp-surface-border, #e2e8f0)\",\n backgroundColor: \"var(--pdp-header-bg, #f8fafc)\",\n borderRadius:\n \"0 0 var(--pdp-border-radius, 8px) var(--pdp-border-radius, 8px)\",\n direction: \"ltr\", // Preserves standard (HH:MM:SS) layout direction ,\n ...styles?.timePicker,\n }}\n >\n {/* Hours Column */}\n <div style={segmentStyle}>\n <button\n type=\"button\"\n disabled={disabled}\n onClick={() => changeHour(1)}\n style={buttonStyle}\n aria-label=\"Increase Hour\"\n >\n ▼\n </button>\n <span style={digitStyle}>\n {formatTimeSegment(activeTime.hour, digitType)}\n </span>\n <button\n type=\"button\"\n disabled={disabled}\n onClick={() => changeHour(-1)}\n style={buttonStyle}\n aria-label=\"Decrease Hour\"\n >\n ▲\n </button>\n </div>\n\n <span\n style={{ fontWeight: 700, color: \"var(--pdp-text-secondary, #475569)\" }}\n >\n :\n </span>\n\n {/* Minutes Column */}\n <div style={segmentStyle}>\n <button\n type=\"button\"\n disabled={disabled}\n onClick={() => changeMinute(1)}\n style={buttonStyle}\n aria-label=\"Increase Minute\"\n >\n ▲\n </button>\n <span style={digitStyle}>\n {formatTimeSegment(activeTime.minute, digitType)}\n </span>\n <button\n type=\"button\"\n disabled={disabled}\n onClick={() => changeMinute(-1)}\n style={buttonStyle}\n aria-label=\"Decrease Minute\"\n >\n ▼\n </button>\n </div>\n\n {/* Seconds Column (Optional) */}\n {showSeconds && (\n <>\n <span\n style={{\n fontWeight: 700,\n color: \"var(--pdp-text-secondary, #475569)\",\n }}\n >\n :\n </span>\n <div style={segmentStyle}>\n <button\n type=\"button\"\n disabled={disabled}\n onClick={() => changeSecond(1)}\n style={buttonStyle}\n aria-label=\"Increase Second\"\n >\n ▲\n </button>\n <span style={digitStyle}>\n {formatTimeSegment(activeTime.second ?? 0, digitType)}\n </span>\n <button\n type=\"button\"\n disabled={disabled}\n onClick={() => changeSecond(-1)}\n style={buttonStyle}\n aria-label=\"Decrease Second\"\n >\n ▼\n </button>\n </div>\n </>\n )}\n </div>\n );\n};\n","import type { DatePickerPreset } from \"./types\";\nimport { getTodayJalali, getDaysInJalaliMonth } from \"../../core/jalali-math\";\nimport {\n addDaysToJalali,\n getJalaliWeekRange,\n getJalaliMonthRange,\n} from \"../../core/jalali-helpers\";\nimport type { JalaliMonthIndex } from \"../../core/types\";\nimport { toPersianDigits } from \"../../formatters/persian-digits\";\n\n// Re-export helpers so tests importing from presets find them directly\nexport { addDaysToJalali, getJalaliWeekRange, getJalaliMonthRange };\n\nexport function getDefaultJalaliPresets(\n digitType: \"persian\" | \"latin\" = \"persian\",\n): DatePickerPreset[] {\n const formatNum = (n: number | string) =>\n digitType === \"persian\" ? toPersianDigits(n) : `${n}`;\n\n return [\n {\n id: \"today\",\n label: \"امروز\",\n getValue: () => getTodayJalali(),\n },\n {\n id: \"this_week\",\n label: \"این هفته\",\n getValue: () => getJalaliWeekRange(getTodayJalali()),\n },\n {\n id: \"last_7_days\",\n label: `${formatNum(7)} روز گذشته`,\n getValue: () => {\n const today = getTodayJalali();\n return [addDaysToJalali(today, -6), today];\n },\n },\n {\n id: \"this_month\",\n label: \"این ماه\",\n getValue: () => getJalaliMonthRange(getTodayJalali()),\n },\n {\n id: \"last_month\",\n label: \"ماه گذشته\",\n getValue: () => {\n const today = getTodayJalali();\n let prevYear = today.year;\n let prevMonth = (today.month - 1) as JalaliMonthIndex;\n\n if (prevMonth < 0) {\n prevMonth = 11;\n prevYear -= 1;\n }\n\n const daysInPrevMonth = getDaysInJalaliMonth(prevYear, prevMonth);\n return [\n { year: prevYear, month: prevMonth, day: 1 },\n { year: prevYear, month: prevMonth, day: daysInPrevMonth },\n ];\n },\n },\n {\n id: \"last_30_days\",\n label: `${formatNum(30)} روز گذشته`,\n getValue: () => {\n const today = getTodayJalali();\n return [addDaysToJalali(today, -29), today];\n },\n },\n ];\n}\n\nexport const DEFAULT_DATE_PICKER_PRESETS = getDefaultJalaliPresets(\"persian\");\n","import React, { useMemo } from \"react\";\nimport type { PresetsBarProps, DatePickerPreset } from \"./types\";\nimport { getDefaultJalaliPresets } from \"./default-presets\";\nimport { isSameJalaliDay } from \"../../core/jalali-math\";\nimport type { JalaliDate } from \"../../core/types\";\nimport type { JalaliDateRange } from \"../../hooks/types\";\n\nexport const PresetsBar: React.FC<PresetsBarProps> = ({\n presets,\n onSelectPreset,\n selectedValue,\n orientation = \"vertical\",\n digitType = \"persian\",\n disabled = false,\n classNames,\n styles,\n}) => {\n const activePresets: DatePickerPreset[] = useMemo(() => {\n return presets ?? getDefaultJalaliPresets(digitType);\n }, [presets, digitType]);\n\n const isPresetActive = (preset: DatePickerPreset): boolean => {\n if (!selectedValue) return false;\n const val = preset.getValue();\n\n if (!Array.isArray(val) && !Array.isArray(selectedValue)) {\n return isSameJalaliDay(val as JalaliDate, selectedValue as JalaliDate);\n }\n\n if (Array.isArray(val) && Array.isArray(selectedValue)) {\n const [vStart, vEnd] = val as JalaliDateRange;\n const [sStart, sEnd] = selectedValue as JalaliDateRange;\n if (!vStart || !vEnd || !sStart || !sEnd) return false;\n return isSameJalaliDay(vStart, sStart) && isSameJalaliDay(vEnd, sEnd);\n }\n\n return false;\n };\n\n const containerStyle: React.CSSProperties = {\n display: \"flex\",\n flexDirection: orientation === \"vertical\" ? \"column\" : \"row\",\n gap: \"4px\",\n padding: \"8px\",\n backgroundColor: \"var(--pdp-header-bg, #f8fafc)\",\n borderLeft:\n orientation === \"vertical\"\n ? \"1px solid var(--pdp-surface-border, #e2e8f0)\"\n : \"none\",\n borderBottom:\n orientation === \"horizontal\"\n ? \"1px solid var(--pdp-surface-border, #e2e8f0)\"\n : \"none\",\n overflowX: orientation === \"horizontal\" ? \"auto\" : \"visible\",\n maxHeight: orientation === \"vertical\" ? \"280px\" : \"none\",\n overflowY: orientation === \"vertical\" ? \"auto\" : \"visible\",\n minWidth: orientation === \"vertical\" ? \"110px\" : \"auto\",\n ...styles?.presetsBar,\n };\n\n return (\n <div\n role=\"group\"\n aria-label=\"کلیدهای میانبر تاریخ\"\n className={classNames?.presetsBar}\n style={containerStyle}\n >\n {activePresets.map((preset: DatePickerPreset) => {\n const active = isPresetActive(preset);\n return (\n <button\n key={preset.id}\n type=\"button\"\n disabled={disabled}\n onClick={() => onSelectPreset(preset.getValue())}\n style={{\n padding: \"6px 10px\",\n fontSize: \"12px\",\n fontWeight: active ? 600 : 400,\n textAlign: \"right\",\n border: \"none\",\n borderRadius: \"var(--pdp-border-radius, 6px)\",\n cursor: disabled ? \"not-allowed\" : \"pointer\",\n backgroundColor: active\n ? \"var(--pdp-primary-color, #0284c7)\"\n : \"transparent\",\n color: active\n ? \"var(--pdp-primary-contrast-text, #ffffff)\"\n : \"var(--pdp-text-primary, #0f172a)\",\n whiteSpace: \"nowrap\",\n transition: \"background-color 0.15s ease, color 0.15s ease\",\n }}\n >\n {preset.label}\n </button>\n );\n })}\n </div>\n );\n};\n","import type { JalaliDate, JalaliMonthIndex } from \"../../core/types\";\nimport type { DateParseResult } from \"./types\";\nimport {\n toLatinDigits,\n toPersianDigits,\n} from \"../../formatters/persian-digits\";\nimport { getDaysInJalaliMonth } from \"../../core/jalali-math\";\nimport { compareJalaliDates } from \"../../core/jalali-helpers\";\n\n/**\n * Strips all non-digit characters and applies the 'YYYY/MM/DD' mask structure.\n */\nexport function applyDateMask(\n rawInput: string,\n digitType: \"persian\" | \"latin\" = \"persian\",\n): string {\n // Normalize all Persian/Arabic digits to ASCII 0-9\n const cleanDigits = toLatinDigits(rawInput).replace(/\\D/g, \"\").slice(0, 8);\n\n let masked = \"\";\n if (cleanDigits.length > 0) {\n masked = cleanDigits.slice(0, 4); // Year (YYYY)\n }\n if (cleanDigits.length >= 5) {\n masked += `/${cleanDigits.slice(4, 6)}`; // Month (MM)\n }\n if (cleanDigits.length >= 7) {\n masked += `/${cleanDigits.slice(6, 8)}`; // Day (DD)\n }\n\n return digitType === \"persian\" ? toPersianDigits(masked) : masked;\n}\n\n/**\n * Validates and parses a masked string into a valid JalaliDate object.\n */\nexport function parseAndValidateJalaliString(\n input: string,\n minDate?: JalaliDate,\n maxDate?: JalaliDate,\n isDateDisabled?: (date: JalaliDate) => boolean,\n): DateParseResult {\n const normalized = toLatinDigits(input).trim();\n\n if (!normalized) {\n return { isValid: true, date: null };\n }\n\n const parts = normalized.split(\"/\");\n if (\n parts.length !== 3 ||\n parts[0].length !== 4 ||\n parts[1].length !== 2 ||\n parts[2].length !== 2\n ) {\n return { isValid: false, date: null, error: \"INVALID_FORMAT\" };\n }\n\n const year = parseInt(parts[0], 10);\n const monthNum = parseInt(parts[1], 10);\n const day = parseInt(parts[2], 10);\n\n // Validate Month Range (1 to 12)\n if (monthNum < 1 || monthNum > 12) {\n return { isValid: false, date: null, error: \"INVALID_MONTH\" };\n }\n\n const monthIndex = (monthNum - 1) as JalaliMonthIndex;\n const maxDays = getDaysInJalaliMonth(year, monthIndex);\n\n // Validate Day Range (1 to 29/30/31 based on month & leap year)\n if (day < 1 || day > maxDays) {\n return { isValid: false, date: null, error: \"INVALID_DAY\" };\n }\n\n const jalaliDate: JalaliDate = { year, month: monthIndex, day };\n\n // Min / Max range validations\n if (minDate && compareJalaliDates(jalaliDate, minDate) < 0) {\n return { isValid: false, date: jalaliDate, error: \"OUT_OF_MIN_BOUNDS\" };\n }\n\n if (maxDate && compareJalaliDates(jalaliDate, maxDate) > 0) {\n return { isValid: false, date: jalaliDate, error: \"OUT_OF_MAX_BOUNDS\" };\n }\n\n // Custom disable rule\n if (isDateDisabled && isDateDisabled(jalaliDate)) {\n return { isValid: false, date: jalaliDate, error: \"DISABLED_DATE\" };\n }\n\n return { isValid: true, date: jalaliDate };\n}\n","import React, { useState, useEffect, useCallback, useRef } from \"react\";\nimport type { MaskedDateInputProps, DateValidationError } from \"./types\";\nimport { applyDateMask, parseAndValidateJalaliString } from \"./mask-utils\";\nimport { formatJalaliDate } from \"../../formatters/jalali-formatter\";\nimport type { JalaliDate } from \"../../core/types\";\n\nexport const MaskedDateInput: React.FC<MaskedDateInputProps> = ({\n value,\n defaultValue = null,\n onChange,\n onValidationError,\n digitType = \"persian\",\n minDate,\n maxDate,\n isDateDisabled,\n clearable = true,\n placeholder = \"۱۴۰۵/۰۱/۱۵\",\n disabled = false,\n style,\n ...restProps\n}) => {\n const [internalValue, setInternalValue] = useState<JalaliDate | null>(\n defaultValue,\n );\n const activeDate = value !== undefined ? value : internalValue;\n\n const [text, setText] = useState<string>(() => {\n return activeDate\n ? formatJalaliDate(activeDate, \"YYYY/MM/DD\", { digitType })\n : \"\";\n });\n\n const [hasError, setHasError] = useState<boolean>(false);\n const inputRef = useRef<HTMLInputElement>(null);\n\n // Sync text input with incoming controlled value updates\n useEffect(() => {\n if (value !== undefined) {\n setText(\n value ? formatJalaliDate(value, \"YYYY/MM/DD\", { digitType }) : \"\",\n );\n setHasError(false);\n }\n }, [value, digitType]);\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const rawVal = e.target.value;\n const maskedVal = applyDateMask(rawVal, digitType);\n setText(maskedVal);\n\n // Validate only if complete date is typed (10 chars: YYYY/MM/DD) or empty\n if (maskedVal.length === 10 || maskedVal.length === 0) {\n const result = parseAndValidateJalaliString(\n maskedVal,\n minDate,\n maxDate,\n isDateDisabled,\n );\n\n if (result.isValid) {\n setHasError(false);\n onValidationError?.(null);\n if (value === undefined) {\n setInternalValue(result.date);\n }\n onChange?.(result.date);\n } else {\n setHasError(true);\n onValidationError?.(result.error as DateValidationError);\n }\n } else {\n // Incomplete state\n setHasError(false);\n onValidationError?.(null);\n }\n };\n\n const handleClear = useCallback(() => {\n setText(\"\");\n setHasError(false);\n onValidationError?.(null);\n if (value === undefined) {\n setInternalValue(null);\n }\n onChange?.(null);\n inputRef.current?.focus();\n }, [value, onChange, onValidationError]);\n\n return (\n <div\n style={{\n position: \"relative\",\n display: \"inline-flex\",\n alignItems: \"center\",\n direction: \"rtl\",\n }}\n >\n <input\n ref={inputRef}\n type=\"text\"\n inputMode=\"numeric\"\n disabled={disabled}\n placeholder={digitType === \"persian\" ? placeholder : \"1405/01/15\"}\n value={text}\n onChange={handleInputChange}\n style={{\n width: \"180px\",\n padding: \"8px 12px\",\n paddingLeft: clearable && text ? \"32px\" : \"12px\",\n borderRadius: \"var(--pdp-border-radius, 8px)\",\n border: `1px solid ${hasError ? \"#ef4444\" : \"var(--pdp-surface-border, #e2e8f0)\"}`,\n backgroundColor: \"var(--pdp-surface-bg, #ffffff)\",\n color: \"var(--pdp-text-primary, #0f172a)\",\n fontSize: \"14px\",\n fontFamily: \"inherit\",\n outline: \"none\",\n textAlign: \"center\",\n letterSpacing: \"1px\",\n transition: \"border-color 0.15s ease\",\n ...style,\n }}\n {...restProps}\n />\n\n {/* Clear Button */}\n {clearable && text && !disabled && (\n <button\n type=\"button\"\n aria-label=\"پاک کردن\"\n onClick={handleClear}\n style={{\n position: \"absolute\",\n left: \"8px\",\n background: \"none\",\n border: \"none\",\n cursor: \"pointer\",\n color: \"var(--pdp-text-muted, #94a3b8)\",\n fontSize: \"14px\",\n lineHeight: 1,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: \"2px\",\n }}\n >\n ✕\n </button>\n )}\n </div>\n );\n};\n","import type { JalaliDate } from \"../core/types\";\nimport { isSameJalaliDay } from \"../core/jalali-math\";\nimport type { CalendarEvent } from \"./types\";\n\n/**\n * Filters and returns all events matching a specific Jalali date.\n */\nexport function getEventsForDate(\n date: JalaliDate,\n events?: CalendarEvent[],\n): CalendarEvent[] {\n if (!events || events.length === 0) return [];\n return events.filter((e) => isSameJalaliDay(e.date, date));\n}\n","import type { JalaliDate } from \"../core/types\";\nimport type { OfficialHoliday, CustomHolidayRule } from \"./types\";\nimport { jalaliToGregorian } from \"../core/jalali-math\";\n\n/**\n * Fixed Solar Calendar Holidays in Iran:\n * Key format: `${monthIndex}-${day}` (Month index is 0-based: 0 = Farvardin, 11 = Esfand)\n */\nconst FIXED_SOLAR_HOLIDAYS: Record<string, string> = {\n \"0-1\": \"جشن نوروز / سال نو\",\n \"0-2\": \"عید نوروز\",\n \"0-3\": \"عید نوروز\",\n \"0-4\": \"عید نوروز\",\n \"0-12\": \"روز جمهوری اسلامی ایران\",\n \"0-13\": \"روز طبیعت (سیزده‌بدر)\",\n \"2-14\": \"رحلت امام خمینی\",\n \"2-15\": \"قیام ۱۵ خرداد\",\n \"10-22\": \"پیروزی انقلاب اسلامی\",\n \"11-29\": \"روز ملی شدن صنعت نفت\",\n};\n\n/**\n * Checks if a given Jalali date is Friday (جمعه).\n */\nexport function isJalaliFriday(date: JalaliDate): boolean {\n const g = jalaliToGregorian(date.year, date.month, date.day);\n return g.getDay() === 5; // In JS Date.getDay(), 5 represents Friday\n}\n\n/**\n * Resolves holiday info for a JalaliDate based purely on solar calendar rules and custom overrides.\n */\nexport function getOfficialHoliday(\n date: JalaliDate,\n customHolidays?: CustomHolidayRule[],\n): OfficialHoliday | null {\n // 1. Check Custom User-Defined Holidays\n if (customHolidays && customHolidays.length > 0) {\n const custom = customHolidays.find(\n (h) =>\n h.date.year === date.year &&\n h.date.month === date.month &&\n h.date.day === date.day,\n );\n if (custom) {\n return {\n title: custom.title,\n type: \"custom\",\n isOff: custom.isOff ?? true,\n };\n }\n }\n\n // 2. Check Fixed Solar Holidays (O(1) Hash Map Lookup)\n const solarKey = `${date.month}-${date.day}`;\n if (FIXED_SOLAR_HOLIDAYS[solarKey]) {\n return {\n title: FIXED_SOLAR_HOLIDAYS[solarKey],\n type: \"solar\",\n isOff: true,\n };\n }\n\n // 3. Check Friday (End of Week)\n if (isJalaliFriday(date)) {\n return { title: \"جمعه (تعطیل پایان هفته)\", type: \"solar\", isOff: true };\n }\n\n return null;\n}\n","import React, {\n useState,\n useRef,\n useCallback,\n useMemo,\n useEffect,\n} from \"react\";\nimport { useJalaliDatePicker } from \"../hooks/useJalaliDatePicker\";\nimport { useCalendarKeyboard } from \"../a11y/useCalendarKeyboard\";\nimport type {\n UseJalaliDatePickerOptions,\n SelectionMode,\n JalaliDateRange,\n} from \"../hooks/types\";\nimport { Header } from \"./Header\";\nimport { Weekdays } from \"./Weekdays\";\nimport { DayCell } from \"./DayCell\";\nimport { MonthYearPicker } from \"./MonthYearPicker\";\nimport type {\n JalaliDate,\n JalaliMonthIndex,\n JalaliCalendarCell,\n} from \"../core/types\";\nimport { formatJalaliDate } from \"../formatters/jalali-formatter\";\nimport { PERSIAN_MONTH_NAMES } from \"../core/constants\";\nimport { toPersianDigits } from \"../formatters/persian-digits\";\nimport { CalendarFooter } from \"./footer/CalendarFooter\";\nimport { TimePicker } from \"../plugins/time-picker/TimePicker\";\nimport type { JalaliTime } from \"../plugins/time-picker/types\";\nimport {\n formatTimeString,\n getCurrentTime,\n} from \"../plugins/time-picker/time-utils\";\nimport { PresetsBar } from \"../plugins/presets/PresetsBar\";\nimport type { DatePickerPreset, PresetValue } from \"../plugins/presets/types\";\nimport { MaskedDateInput } from \"./masked-input/MaskedDateInput\";\nimport { generateJalaliCalendarGrid } from \"../core/calendar-grid\";\nimport { isJalaliDateBetween } from \"../core/jalali-helpers\";\nimport { isSameJalaliDay } from \"../core/jalali-math\";\nimport type { CalendarEvent } from \"../events/types\";\nimport { getEventsForDate } from \"../events/event-utils\";\nimport { getOfficialHoliday } from \"../holidays\";\nimport type { CustomHolidayRule } from \"../holidays/types\";\nimport type {\n DatePickerClassNames,\n DatePickerStyles,\n} from \"../theme/style-slots\";\n\nexport interface JalaliDatePickerProps<\n M extends SelectionMode = \"single\",\n> extends UseJalaliDatePickerOptions<M> {\n /** Output digit presentation ('persian' or 'latin') */\n digitType?: \"persian\" | \"latin\";\n /** Layout presentation style: 'inline', 'popover' dropdown, or 'modal' dialog */\n variant?: \"inline\" | \"popover\" | \"modal\";\n /** Placeholder text for popover and modal input trigger */\n placeholder?: string;\n\n // --- Granular Style & Class Customization ---\n /** Root wrapper CSS class */\n className?: string;\n /** Root wrapper inline styles */\n style?: React.CSSProperties;\n /** Slot-based CSS class mapping */\n classNames?: DatePickerClassNames;\n /** Slot-based inline styles mapping */\n styles?: DatePickerStyles;\n\n // --- Built-in Footer & Status Props ---\n /** Whether to render the built-in footer status & actions (default: false) */\n showFooter?: boolean;\n /** Toggle status text inside footer (default: true) */\n showStatusText?: boolean;\n /** Toggle action buttons (Today, Clear, Confirm) inside footer (default: true) */\n showActions?: boolean;\n /** Callback fired when user clicks Confirm in footer */\n onConfirm?: () => void;\n\n // --- Time Picker Integration Props ---\n /** Enable embedded time picker below calendar grid */\n enableTime?: boolean;\n /** Controlled time value */\n timeValue?: JalaliTime | null;\n /** Default uncontrolled time value */\n defaultTimeValue?: JalaliTime;\n /** Callback fired when selected time changes */\n onTimeChange?: (time: JalaliTime) => void;\n /** Step increment for minutes (default: 1) */\n minuteStep?: number;\n /** Step increment for hours (default: 1) */\n hourStep?: number;\n /** Show seconds segment in time picker */\n showSeconds?: boolean;\n\n // --- Shortcuts & Presets Props ---\n /** Enable shortcut presets bar */\n enablePresets?: boolean;\n /** Custom presets array */\n presets?: DatePickerPreset[];\n /** Orientation of presets bar ('vertical' or 'horizontal') */\n presetsOrientation?: \"vertical\" | \"horizontal\";\n\n // --- Dual Calendar View Props ---\n /** Number of months shown side-by-side (1 or 2, default: 1) */\n numberOfMonths?: 1 | 2;\n\n // --- Masked Input Integration ---\n /** Use live-masked typing input when variant is 'popover' */\n useMaskedInput?: boolean;\n\n // --- Events & Badges Props ---\n /** Array of registered calendar events with badges and tooltips */\n events?: CalendarEvent[];\n\n // --- Holidays Props ---\n /** Highlight Iranian national solar holidays and Fridays in red (default: false) */\n showHolidays?: boolean;\n /** Custom additional holidays array */\n customHolidays?: CustomHolidayRule[];\n}\n\nexport function JalaliDatePicker<M extends SelectionMode = \"single\">({\n variant = \"inline\",\n placeholder = \"انتخاب تاریخ...\",\n digitType = \"persian\",\n className,\n style,\n classNames,\n styles,\n showFooter = false,\n showStatusText = true,\n showActions = true,\n onConfirm,\n defaultValue,\n // Time Picker\n enableTime = false,\n timeValue,\n defaultTimeValue,\n onTimeChange,\n minuteStep = 1,\n hourStep = 1,\n showSeconds = false,\n // Presets\n enablePresets = false,\n presets,\n presetsOrientation = \"vertical\",\n // Multi Month\n numberOfMonths = 1,\n // Masked Input\n useMaskedInput = false,\n // Events\n events,\n // Holidays\n showHolidays = false,\n customHolidays,\n\n ...hookOptions\n}: JalaliDatePickerProps<M>) {\n const [isOpen, setIsOpen] = useState(variant === \"inline\");\n const [showMonthYearPicker, setShowMonthYearPicker] = useState(false);\n const containerRef = useRef<HTMLDivElement>(null);\n const isModal = variant === \"modal\";\n\n // 1. Time State Management\n const [internalTime, setInternalTime] = useState<JalaliTime>(\n () => defaultTimeValue ?? getCurrentTime(),\n );\n const activeTime =\n timeValue !== undefined ? (timeValue ?? getCurrentTime()) : internalTime;\n\n const handleTimeChange = useCallback(\n (newTime: JalaliTime) => {\n if (timeValue === undefined) {\n setInternalTime(newTime);\n }\n onTimeChange?.(newTime);\n },\n [timeValue, onTimeChange],\n );\n\n // 2. Date State Management via Hook\n const {\n selected,\n viewYear,\n viewMonth,\n grid,\n goToPrevMonth,\n goToNextMonth,\n setView,\n goToToday,\n selectDate,\n setHoverDate,\n hoverDate,\n clear,\n } = useJalaliDatePicker({\n defaultValue,\n ...hookOptions,\n });\n\n const singleSelectedDate =\n hookOptions.mode === \"single\" ? (selected as JalaliDate | null) : null;\n\n const handleDateSelect = (d: JalaliDate) => {\n selectDate(d);\n if (variant === \"popover\" && hookOptions.mode === \"single\" && !enableTime) {\n setIsOpen(false);\n }\n };\n\n // Keyboard navigation\n const { handleKeyDown, getCellTabIndex, setFocusedDate } =\n useCalendarKeyboard({\n viewYear,\n viewMonth,\n selectedDate: singleSelectedDate,\n onSelectDate: handleDateSelect,\n onViewChange: setView,\n isRtl: true,\n });\n\n // 3. Modal ESC & Body Scroll Lock\n useEffect(() => {\n if (!isModal || !isOpen) return;\n\n const originalOverflow = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n\n const handleGlobalKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n setIsOpen(false);\n }\n };\n\n window.addEventListener(\"keydown\", handleGlobalKeyDown);\n return () => {\n document.body.style.overflow = originalOverflow;\n window.removeEventListener(\"keydown\", handleGlobalKeyDown);\n };\n }, [isModal, isOpen]);\n\n // 4. Preset Selection Handler\n const handlePresetSelect = (presetVal: PresetValue) => {\n if (hookOptions.mode === \"single\" && !Array.isArray(presetVal)) {\n selectDate(presetVal as JalaliDate);\n setView(presetVal.year, presetVal.month);\n if (variant === \"popover\" && !enableTime) setIsOpen(false);\n } else if (hookOptions.mode === \"range\" && Array.isArray(presetVal)) {\n const [start, end] = presetVal as JalaliDateRange;\n if (start && end) {\n selectDate(start);\n selectDate(end);\n setView(start.year, start.month);\n }\n }\n };\n\n // 5. Multi-Month calculations\n const nextMonthState = useMemo<{\n year: number;\n month: JalaliMonthIndex;\n }>(() => {\n if (viewMonth === 11) {\n return { year: viewYear + 1, month: 0 };\n }\n return { year: viewYear, month: (viewMonth + 1) as JalaliMonthIndex };\n }, [viewYear, viewMonth]);\n\n const secondGrid = useMemo<JalaliCalendarCell[]>(() => {\n if (numberOfMonths !== 2) return [];\n\n const rawGrid = generateJalaliCalendarGrid({\n year: nextMonthState.year,\n month: nextMonthState.month,\n firstDayOfWeek: hookOptions.firstDayOfWeek ?? 0,\n minDate: hookOptions.minDate,\n maxDate: hookOptions.maxDate,\n isDateDisabled: hookOptions.isDateDisabled,\n });\n\n if (hookOptions.mode !== \"range\") return rawGrid;\n\n const [start, end] = (selected as JalaliDateRange) || [null, null];\n const effectiveEnd = end ?? (start && hoverDate ? hoverDate : null);\n\n return rawGrid.map((cell) => {\n const isStart = start ? isSameJalaliDay(cell.jalali, start) : false;\n const isEnd = effectiveEnd\n ? isSameJalaliDay(cell.jalali, effectiveEnd)\n : false;\n let inRange = false;\n if (start && effectiveEnd) {\n inRange = isJalaliDateBetween(cell.jalali, start, effectiveEnd);\n }\n return {\n ...cell,\n isSelected: isStart || isEnd,\n isInRange: inRange,\n isRangeStart: isStart,\n isRangeEnd: isEnd,\n };\n });\n }, [numberOfMonths, nextMonthState, hookOptions, selected, hoverDate]);\n\n // 6. Input Value String Formatter\n const formattedInputValue = useMemo(() => {\n if (!selected) return \"\";\n if (hookOptions.mode === \"single\") {\n const datePart = formatJalaliDate(selected as JalaliDate, \"YYYY/MM/DD\", {\n digitType,\n });\n if (enableTime && activeTime) {\n const timePart = formatTimeString(activeTime, showSeconds, digitType);\n return `${datePart} ${timePart}`;\n }\n return datePart;\n }\n if (hookOptions.mode === \"range\") {\n const [start, end] = (selected as JalaliDateRange) || [null, null];\n if (start && end) {\n return `${formatJalaliDate(start, \"YYYY/MM/DD\", { digitType })} - ${formatJalaliDate(end, \"YYYY/MM/DD\", { digitType })}`;\n }\n if (start) {\n return formatJalaliDate(start, \"YYYY/MM/DD\", { digitType });\n }\n }\n return \"\";\n }, [\n selected,\n hookOptions.mode,\n digitType,\n enableTime,\n activeTime,\n showSeconds,\n ]);\n\n // Calendar Pane Renderer\n const renderCalendarPane = (\n y: number,\n m: JalaliMonthIndex,\n paneGrid: JalaliCalendarCell[],\n showPrevArrow: boolean = true,\n showNextArrow: boolean = true,\n ) => (\n <div style={{ minWidth: \"270px\" }}>\n <Header\n year={y}\n month={m}\n onPrevMonth={showPrevArrow ? goToPrevMonth : () => {}}\n onNextMonth={showNextArrow ? goToNextMonth : () => {}}\n onTogglePicker={() =>\n numberOfMonths === 1 && setShowMonthYearPicker(true)\n }\n onGoToToday={goToToday}\n classNames={classNames}\n styles={styles}\n />\n\n <Weekdays\n firstDayOfWeek={hookOptions.firstDayOfWeek}\n classNames={classNames}\n styles={styles}\n />\n\n <div\n role=\"grid\"\n aria-label={`${PERSIAN_MONTH_NAMES[m]} ${toPersianDigits(y)}`}\n className={classNames?.grid}\n style={{\n display: \"grid\",\n gridTemplateColumns: \"repeat(7, var(--pdp-cell-size, 36px))\",\n gap: \"4px\",\n ...styles?.grid,\n }}\n >\n {paneGrid.map((cell, index) => {\n const holidayInfo = showHolidays\n ? getOfficialHoliday(cell.jalali, customHolidays)\n : null;\n\n const dayEvents = getEventsForDate(cell.jalali, events);\n\n return (\n <DayCell\n key={index}\n cell={cell}\n digitType={digitType}\n isHoliday={Boolean(holidayInfo)}\n holidayTitle={holidayInfo?.title}\n events={dayEvents}\n classNames={classNames}\n styles={styles}\n tabIndex={getCellTabIndex(cell.jalali)}\n onSelect={handleDateSelect}\n onHover={setHoverDate}\n onFocus={setFocusedDate}\n />\n );\n })}\n </div>\n </div>\n );\n\n // Core Calendar Box\n const calendarContent = (\n <div\n role={isModal ? \"dialog\" : \"region\"}\n aria-modal={isModal ? true : undefined}\n aria-label=\"تقویم شمسی\"\n onKeyDown={handleKeyDown}\n onClick={(e) => isModal && e.stopPropagation()}\n className={classNames?.calendar}\n style={{\n position:\n variant === \"popover\" ? \"absolute\" : isModal ? \"relative\" : \"static\",\n top: variant === \"popover\" ? \"calc(100% + 4px)\" : undefined,\n right: variant === \"popover\" ? 0 : undefined,\n zIndex: isModal ? 1001 : 50,\n padding: \"16px\",\n backgroundColor: \"var(--pdp-surface-bg, #ffffff)\",\n borderRadius: \"var(--pdp-border-radius, 12px)\",\n border: \"1px solid var(--pdp-surface-border, #e2e8f0)\",\n boxShadow: isModal\n ? \"0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3)\"\n : \"var(--pdp-shadow)\",\n width: \"fit-content\",\n userSelect: \"none\",\n display: \"flex\",\n flexDirection: presetsOrientation === \"horizontal\" ? \"column\" : \"row\",\n gap: \"12px\",\n ...styles?.calendar,\n }}\n >\n {/* Modal Close Button */}\n {isModal && (\n <button\n type=\"button\"\n aria-label=\"بستن\"\n onClick={() => setIsOpen(false)}\n style={{\n position: \"absolute\",\n top: \"10px\",\n left: \"10px\",\n background: \"none\",\n border: \"none\",\n cursor: \"pointer\",\n fontSize: \"16px\",\n color: \"var(--pdp-text-muted, #94a3b8)\",\n lineHeight: 1,\n zIndex: 10,\n }}\n >\n ✕\n </button>\n )}\n\n {/* Shortcuts Presets Bar */}\n {enablePresets && (\n <PresetsBar\n presets={presets}\n orientation={presetsOrientation}\n digitType={digitType}\n selectedValue={selected as PresetValue}\n onSelectPreset={handlePresetSelect}\n classNames={classNames}\n styles={styles}\n />\n )}\n\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: \"8px\" }}>\n {showMonthYearPicker ? (\n <MonthYearPicker\n currentYear={viewYear}\n currentMonth={viewMonth}\n onSelectMonth={(m) => setView(viewYear, m)}\n onSelectYear={(y) => setView(y, viewMonth)}\n onClose={() => setShowMonthYearPicker(false)}\n />\n ) : (\n <>\n {/* Multi-Month Calendar Panes */}\n <div\n style={{\n display: \"flex\",\n gap: \"16px\",\n alignItems: \"flex-start\",\n }}\n >\n {renderCalendarPane(\n viewYear,\n viewMonth,\n grid,\n true,\n numberOfMonths === 1,\n )}\n\n {numberOfMonths === 2 && (\n <>\n <div\n style={{\n width: \"1px\",\n backgroundColor: \"var(--pdp-surface-border, #e2e8f0)\",\n alignSelf: \"stretch\",\n }}\n />\n {renderCalendarPane(\n nextMonthState.year,\n nextMonthState.month,\n secondGrid,\n false,\n true,\n )}\n </>\n )}\n </div>\n\n {/* Embedded Time Picker */}\n {enableTime && (\n <TimePicker\n value={activeTime}\n onChange={handleTimeChange}\n minuteStep={minuteStep}\n hourStep={hourStep}\n showSeconds={showSeconds}\n digitType={digitType}\n classNames={classNames}\n styles={styles}\n />\n )}\n\n {/* Built-in Status & Actions Footer */}\n {showFooter && (\n <CalendarFooter\n mode={hookOptions.mode}\n digitType={digitType}\n showStatusText={showStatusText}\n showActions={showActions}\n selectedDate={\n hookOptions.mode === \"single\"\n ? (selected as JalaliDate | null)\n : null\n }\n selectedRange={\n hookOptions.mode === \"range\"\n ? (selected as JalaliDateRange)\n : undefined\n }\n selectedDates={\n hookOptions.mode === \"multiple\"\n ? (selected as JalaliDate[])\n : undefined\n }\n selectedTime={enableTime ? activeTime : undefined}\n onToday={goToToday}\n onClear={clear}\n onConfirm={() => {\n if (variant !== \"inline\") setIsOpen(false);\n onConfirm?.();\n }}\n classNames={classNames}\n styles={styles}\n />\n )}\n </>\n )}\n </div>\n </div>\n );\n\n return (\n <div\n ref={containerRef}\n className={className ?? classNames?.root}\n style={{\n position: \"relative\",\n display: \"inline-block\",\n ...style,\n ...styles?.root,\n }}\n >\n {/* Popover / Modal Trigger Input */}\n {variant !== \"inline\" &&\n (useMaskedInput &&\n hookOptions.mode === \"single\" &&\n variant === \"popover\" ? (\n <MaskedDateInput\n value={singleSelectedDate}\n digitType={digitType}\n placeholder={placeholder}\n onChange={(d) => {\n if (d) {\n selectDate(d);\n setView(d.year, d.month);\n } else {\n clear();\n }\n }}\n onClick={() => setIsOpen(true)}\n className={classNames?.input}\n style={styles?.input}\n />\n ) : (\n <input\n type=\"text\"\n readOnly\n placeholder={placeholder}\n value={formattedInputValue}\n onClick={() => setIsOpen(true)}\n className={classNames?.input}\n style={{\n padding: \"8px 12px\",\n borderRadius: \"var(--pdp-border-radius, 8px)\",\n border: \"1px solid var(--pdp-surface-border, #e2e8f0)\",\n backgroundColor: \"var(--pdp-surface-bg, #ffffff)\",\n color: \"var(--pdp-text-primary, #0f172a)\",\n cursor: \"pointer\",\n textAlign: \"right\",\n direction: \"rtl\",\n fontSize: \"14px\",\n minWidth: enableTime\n ? \"200px\"\n : numberOfMonths === 2\n ? \"240px\"\n : \"150px\",\n ...styles?.input,\n }}\n />\n ))}\n\n {/* Render Modal Overlay with Backdrop vs Standard Container */}\n {isOpen &&\n (isModal ? (\n <div\n role=\"presentation\"\n onClick={() => setIsOpen(false)}\n className={classNames?.modalBackdrop}\n style={{\n position: \"fixed\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: \"rgba(15, 23, 42, 0.6)\",\n backdropFilter: \"blur(4px)\",\n zIndex: 1000,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: \"16px\",\n direction: \"rtl\",\n ...styles?.modalBackdrop,\n }}\n >\n {calendarContent}\n </div>\n ) : (\n calendarContent\n ))}\n </div>\n );\n}\n","import React, { useState, useMemo, useCallback } from \"react\";\nimport type { DualMonthCalendarProps } from \"./types\";\nimport type {\n JalaliDate,\n JalaliMonthIndex,\n JalaliCalendarCell,\n} from \"../../core/types\";\nimport type { JalaliDateRange } from \"../../hooks/types\";\nimport { getTodayJalali, isSameJalaliDay } from \"../../core/jalali-math\";\nimport { generateJalaliCalendarGrid } from \"../../core/calendar-grid\";\nimport {\n compareJalaliDates,\n isJalaliDateBetween,\n} from \"../../core/jalali-helpers\";\nimport { PERSIAN_MONTH_NAMES } from \"../../core/constants\";\nimport { toPersianDigits } from \"../../formatters/persian-digits\";\nimport { Weekdays } from \"../Weekdays\";\nimport { DayCell } from \"../DayCell\";\n\nexport const DualMonthCalendar: React.FC<DualMonthCalendarProps> = ({\n value,\n defaultValue = [null, null],\n onChange,\n initialViewDate,\n firstDayOfWeek = 0,\n digitType = \"persian\",\n minDate,\n maxDate,\n isDateDisabled,\n}) => {\n // 1. Selection State (Controlled vs Uncontrolled)\n const [internalRange, setInternalRange] =\n useState<JalaliDateRange>(defaultValue);\n const activeRange = value !== undefined ? value : internalRange;\n\n // 2. Hover state for range preview\n const [hoveredDate, setHoveredDate] = useState<JalaliDate | null>(null);\n\n // 3. View state for First Month (Left)\n const today = useMemo(() => getTodayJalali(), []);\n const [viewState, setViewState] = useState<{\n year: number;\n month: JalaliMonthIndex;\n }>(() => {\n if (initialViewDate) return initialViewDate;\n if (activeRange[0])\n return { year: activeRange[0].year, month: activeRange[0].month };\n return { year: today.year, month: today.month };\n });\n\n // Calculate Second Month (Right)\n const nextMonthState = useMemo<{\n year: number;\n month: JalaliMonthIndex;\n }>(() => {\n if (viewState.month === 11) {\n return { year: viewState.year + 1, month: 0 };\n }\n return {\n year: viewState.year,\n month: (viewState.month + 1) as JalaliMonthIndex,\n };\n }, [viewState]);\n\n // 4. Synchronized Navigation (moves both months together)\n const handlePrevMonth = () => {\n setViewState((prev) => {\n if (prev.month === 0) return { year: prev.year - 1, month: 11 };\n return { year: prev.year, month: (prev.month - 1) as JalaliMonthIndex };\n });\n };\n\n const handleNextMonth = () => {\n setViewState((prev) => {\n if (prev.month === 11) return { year: prev.year + 1, month: 0 };\n return { year: prev.year, month: (prev.month + 1) as JalaliMonthIndex };\n });\n };\n\n // 5. Date Selection Handler\n const handleDateSelect = useCallback(\n (target: JalaliDate) => {\n const [start, end] = activeRange;\n let newRange: JalaliDateRange;\n\n if (!start || (start && end)) {\n newRange = [target, null];\n } else {\n if (compareJalaliDates(target, start) < 0) {\n newRange = [target, start];\n } else {\n newRange = [start, target];\n }\n setHoveredDate(null);\n }\n\n if (value === undefined) {\n setInternalRange(newRange);\n }\n onChange?.(newRange);\n },\n [activeRange, value, onChange],\n );\n\n // 6. Enrich cells with cross-month range metadata\n const enrichGridCells = useCallback(\n (year: number, month: JalaliMonthIndex): JalaliCalendarCell[] => {\n const rawGrid = generateJalaliCalendarGrid({\n year,\n month,\n firstDayOfWeek,\n minDate,\n maxDate,\n isDateDisabled,\n });\n\n const [start, end] = activeRange;\n const effectiveEnd = end ?? (start && hoveredDate ? hoveredDate : null);\n\n return rawGrid.map((cell) => {\n const isStart = start ? isSameJalaliDay(cell.jalali, start) : false;\n const isEnd = effectiveEnd\n ? isSameJalaliDay(cell.jalali, effectiveEnd)\n : false;\n let inRange = false;\n\n if (start && effectiveEnd) {\n inRange = isJalaliDateBetween(cell.jalali, start, effectiveEnd);\n }\n\n return {\n ...cell,\n isSelected: isStart || isEnd,\n isInRange: inRange,\n isRangeStart: isStart,\n isRangeEnd: isEnd,\n };\n });\n },\n [\n firstDayOfWeek,\n minDate,\n maxDate,\n isDateDisabled,\n activeRange,\n hoveredDate,\n ],\n );\n\n const leftGrid = useMemo(\n () => enrichGridCells(viewState.year, viewState.month),\n [enrichGridCells, viewState.year, viewState.month],\n );\n\n const rightGrid = useMemo(\n () => enrichGridCells(nextMonthState.year, nextMonthState.month),\n [enrichGridCells, nextMonthState.year, nextMonthState.month],\n );\n\n const renderMonthPane = (\n year: number,\n month: JalaliMonthIndex,\n grid: JalaliCalendarCell[],\n isLeftPane: boolean,\n ) => (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"8px\",\n minWidth: \"270px\",\n }}\n >\n {/* Pane Header */}\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n padding: \"0 4px\",\n height: \"32px\",\n }}\n >\n {isLeftPane ? (\n <button\n type=\"button\"\n aria-label=\"ماه قبل\"\n onClick={handlePrevMonth}\n style={{\n width: \"28px\",\n height: \"28px\",\n borderRadius: \"6px\",\n border: \"1px solid var(--pdp-surface-border, #e2e8f0)\",\n backgroundColor: \"var(--pdp-surface-bg, #ffffff)\",\n color: \"var(--pdp-text-primary, #0f172a)\",\n cursor: \"pointer\",\n }}\n >\n ›\n </button>\n ) : (\n <div style={{ width: \"28px\" }} />\n )}\n\n <div\n style={{\n fontWeight: 600,\n fontSize: \"14px\",\n color: \"var(--pdp-text-primary, #0f172a)\",\n }}\n >\n {PERSIAN_MONTH_NAMES[month]} {toPersianDigits(year)}\n </div>\n\n {!isLeftPane ? (\n <button\n type=\"button\"\n aria-label=\"ماه بعد\"\n onClick={handleNextMonth}\n style={{\n width: \"28px\",\n height: \"28px\",\n borderRadius: \"6px\",\n border: \"1px solid var(--pdp-surface-border, #e2e8f0)\",\n backgroundColor: \"var(--pdp-surface-bg, #ffffff)\",\n color: \"var(--pdp-text-primary, #0f172a)\",\n cursor: \"pointer\",\n }}\n >\n ‹\n </button>\n ) : (\n <div style={{ width: \"28px\" }} />\n )}\n </div>\n\n <Weekdays firstDayOfWeek={firstDayOfWeek} />\n\n {/* Grid */}\n <div\n role=\"grid\"\n aria-label={`${PERSIAN_MONTH_NAMES[month]} ${toPersianDigits(year)}`}\n style={{\n display: \"grid\",\n gridTemplateColumns: \"repeat(7, var(--pdp-cell-size, 36px))\",\n gap: \"4px\",\n }}\n >\n {grid.map((cell, idx) => (\n <DayCell\n key={idx}\n cell={cell}\n digitType={digitType}\n tabIndex={0}\n onSelect={handleDateSelect}\n onHover={setHoveredDate}\n />\n ))}\n </div>\n </div>\n );\n\n return (\n <div\n role=\"region\"\n aria-label=\"تقویم دوقلو شمسی\"\n style={{\n display: \"flex\",\n flexWrap: \"wrap\",\n gap: \"24px\",\n padding: \"16px\",\n backgroundColor: \"var(--pdp-surface-bg, #ffffff)\",\n borderRadius: \"var(--pdp-border-radius, 8px)\",\n border: \"1px solid var(--pdp-surface-border, #e2e8f0)\",\n boxShadow: \"var(--pdp-shadow)\",\n width: \"fit-content\",\n direction: \"rtl\",\n }}\n >\n {renderMonthPane(viewState.year, viewState.month, leftGrid, true)}\n <div\n style={{\n width: \"1px\",\n backgroundColor: \"var(--pdp-surface-border, #e2e8f0)\",\n }}\n />\n {renderMonthPane(\n nextMonthState.year,\n nextMonthState.month,\n rightGrid,\n false,\n )}\n </div>\n );\n};\n"],"mappings":"0nBAGA,IAAa,EAAsB,CACjC,UACA,WACA,QACA,MACA,QACA,SACA,MACA,OACA,MACA,KACA,OACA,OACF,EAKa,EAAwB,CACnC,YACA,cACA,UACA,MACA,SACA,YACA,OACA,OACA,OACA,MACA,SACA,QACF,EAKa,EAA0B,CACrC,IACA,IACA,IACA,IACA,IACA,IACA,GACF,EACa,EAAyB,CACpC,OACA,SACA,SACA,UACA,WACA,WACA,MACF,EClDA,SAAgB,EAAiB,EAAuB,CACtD,IAAM,EAAS,CACb,IAAK,EAAG,GAAI,IAAK,IAAK,IAAK,IAAK,IAAK,KAAM,KAAM,KAAM,KAAM,KAAM,KACnE,KAAM,KAAM,KAAM,KAAM,KAAM,IAChC,EAEI,EAAK,EAAO,GACZ,EAAO,EAEX,GAAI,EAAO,GAAM,GAAQ,EAAO,EAAO,OAAS,GAC9C,MAAU,MAAM,eAAe,EAAK,6BAA6B,EAGnE,IAAK,IAAI,EAAI,EAAG,EAAI,EAAO,OAAQ,IAAK,CACtC,IAAM,EAAK,EAAO,GAElB,GADA,EAAO,EAAK,EACR,EAAO,EAAI,MACf,EAAK,CACP,CAEA,IAAI,EAAI,EAAO,EACX,EAAO,EAAI,IAAG,EAAI,EAAI,GAAS,EAAO,GAAK,GAAM,IACrD,IAAI,G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