maz-ui 3.46.1-beta.6 → 3.47.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/components/MazAccordion.mjs +30 -30
  2. package/components/MazAvatar.mjs +1 -1
  3. package/components/MazBottomSheet.mjs +1 -1
  4. package/components/MazBtn.mjs +1 -1
  5. package/components/MazCard.mjs +1 -1
  6. package/components/MazCardSpotlight.mjs +15 -15
  7. package/components/MazCarousel.mjs +1 -1
  8. package/components/MazCheckbox.d.ts +1 -6
  9. package/components/MazChecklist.d.ts +76 -0
  10. package/components/MazChecklist.mjs +4 -0
  11. package/components/MazDialog.d.ts +1 -6
  12. package/components/MazDialog.mjs +1 -1
  13. package/components/MazDialogPromise.d.ts +2 -0
  14. package/components/MazDialogPromise.mjs +1 -1
  15. package/components/MazDrawer.mjs +1 -1
  16. package/components/MazDropdown.mjs +1 -1
  17. package/components/MazDropzone.d.ts +1 -22
  18. package/components/MazDropzone.mjs +1 -1
  19. package/components/MazFullscreenLoader.d.ts +4 -5
  20. package/components/MazFullscreenLoader.mjs +29 -20
  21. package/components/MazGallery.mjs +1 -1
  22. package/components/MazInput.d.ts +1 -8
  23. package/components/MazInput.mjs +1 -1
  24. package/components/MazInputCode.d.ts +1 -4
  25. package/components/MazInputNumber.mjs +1 -1
  26. package/components/MazInputPrice.mjs +1 -1
  27. package/components/MazInputTags.mjs +1 -1
  28. package/components/MazLazyImg.d.ts +2 -0
  29. package/components/MazLazyImg.mjs +1 -1
  30. package/components/MazPagination.mjs +1 -1
  31. package/components/MazPhoneNumberInput.d.ts +1 -20
  32. package/components/MazPhoneNumberInput.mjs +1 -1
  33. package/components/MazPicker.d.ts +1 -1
  34. package/components/MazPicker.mjs +1 -1
  35. package/components/MazPullToRefresh.mjs +1 -1
  36. package/components/MazRadio.d.ts +1 -6
  37. package/components/MazRadioButtons.d.ts +1 -6
  38. package/components/MazSelect.d.ts +1 -10
  39. package/components/MazSelect.mjs +1 -1
  40. package/components/MazSpinner.d.ts +13 -23
  41. package/components/MazSpinner.mjs +13 -16
  42. package/components/MazTable.d.ts +34 -6
  43. package/components/MazTable.mjs +1 -1
  44. package/components/assets/MazAccordion.css +1 -1
  45. package/components/assets/MazBtn.css +1 -1
  46. package/components/assets/MazCardSpotlight.css +1 -1
  47. package/components/assets/MazChecklist.css +1 -0
  48. package/components/assets/MazDialog.css +1 -1
  49. package/components/assets/MazDialogPromise.css +1 -1
  50. package/components/assets/MazDropdown.css +1 -1
  51. package/components/assets/MazInputNumber.css +1 -1
  52. package/components/assets/MazInputTags.css +1 -1
  53. package/components/assets/MazLazyImg.css +1 -1
  54. package/components/assets/MazPagination.css +1 -1
  55. package/components/assets/MazPhoneNumberInput.css +1 -1
  56. package/components/assets/MazPicker.css +1 -1
  57. package/components/assets/MazSpinner.css +1 -1
  58. package/components/assets/MazTabsBar.css +1 -1
  59. package/components/chunks/{MazAvatar-BmaVqPui.mjs → MazAvatar-DFoZvWmg.mjs} +1 -1
  60. package/components/chunks/{MazBottomSheet-DeAah_or.mjs → MazBottomSheet-DqK0EOsq.mjs} +1 -1
  61. package/components/chunks/{MazBtn-zMzxqcCs.mjs → MazBtn-BRUaoP8j.mjs} +11 -11
  62. package/components/chunks/MazBtn-BRnLMzhy.mjs +118 -0
  63. package/components/chunks/MazBtn-BhnOApJu.mjs +118 -0
  64. package/components/chunks/{MazBtn-CESOVC-a.mjs → MazBtn-C28vKP_v.mjs} +2 -2
  65. package/components/chunks/{MazBtn-BXvObcWn.mjs → MazBtn-CnqRnXh_.mjs} +3 -3
  66. package/components/chunks/{MazBtn-CRpqDW12.mjs → MazBtn-CweCwE_4.mjs} +3 -3
  67. package/components/chunks/{MazBtn-C4xZC-A2.mjs → MazBtn-D6Jxw9Nr.mjs} +3 -3
  68. package/components/chunks/MazBtn-D7IKoL2c.mjs +118 -0
  69. package/components/chunks/{MazBtn-C2htID_X.mjs → MazBtn-DlD5m7T4.mjs} +3 -3
  70. package/components/chunks/{MazBtn-CEFfMm7k.mjs → MazBtn-Dt8lr0GH.mjs} +3 -3
  71. package/components/chunks/{MazBtn-C5IbN0rp.mjs → MazBtn-DzBXfedt.mjs} +11 -11
  72. package/components/chunks/MazBtn-Mu18egu5.mjs +118 -0
  73. package/components/chunks/{MazBtn-C2dJYsnq.mjs → MazBtn-TkePGm5o.mjs} +3 -3
  74. package/components/chunks/{MazBtn-BV212IYv.mjs → MazBtn-igor8wRn.mjs} +3 -3
  75. package/components/chunks/{MazCard-BF-2_gZV.mjs → MazCard-CfkvpcGL.mjs} +1 -1
  76. package/components/chunks/{MazCarousel-DVBUt8NL.mjs → MazCarousel-BEl86YGW.mjs} +1 -1
  77. package/components/chunks/{MazCheckbox-CEfJco3U.mjs → MazCheckbox-BKCo6EzO.mjs} +1 -1
  78. package/components/chunks/{MazCheckbox-CeVxgVY8.mjs → MazCheckbox-Byqz8JJB.mjs} +1 -1
  79. package/components/chunks/{MazCheckbox-mgtQBs4K.mjs → MazCheckbox-CI8ml-P8.mjs} +1 -1
  80. package/components/chunks/MazChecklist-BLxsNHMP.mjs +484 -0
  81. package/components/chunks/{MazDialog-fn7vXgBg.mjs → MazDialog-CPgFpAlq.mjs} +50 -54
  82. package/components/chunks/{MazDialogPromise-C8dpQb5k.mjs → MazDialogPromise-BCCdkrea.mjs} +122 -119
  83. package/components/chunks/{MazDropzone-D32tLLpO.mjs → MazDropzone-DKFkgqqD.mjs} +1 -1
  84. package/components/chunks/{MazGallery-CXJsK5ve.mjs → MazGallery-BKL7gfrz.mjs} +2 -2
  85. package/components/chunks/{MazGallery-BOmH2smL.mjs → MazGallery-BMFwld84.mjs} +1 -1
  86. package/components/chunks/{MazIcon-BXX3RaoN.mjs → MazIcon-D8V8ixhf.mjs} +1 -1
  87. package/components/chunks/{MazInput-Dnwxraz4.mjs → MazInput-CBiCdd0F.mjs} +1 -1
  88. package/components/chunks/MazInput-Dx2cCzFS.mjs +290 -0
  89. package/components/chunks/{MazInput-AcA93-8Q.mjs → MazInput-O6Q41Fm0.mjs} +2 -2
  90. package/components/chunks/{MazInputNumber-OY_UqCMs.mjs → MazInputNumber-DYPVUz4k.mjs} +2 -2
  91. package/components/chunks/{MazInputPrice-DvVAZa12.mjs → MazInputPrice-DZD7ZZpm.mjs} +1 -1
  92. package/components/chunks/{MazInputTags-DKlGT2IB.mjs → MazInputTags-CxXBsTdM.mjs} +2 -2
  93. package/components/chunks/{MazLazyImg-i-z6hcwF.mjs → MazLazyImg-B-6PQWEi.mjs} +9 -8
  94. package/components/chunks/{MazLazyImg-RHZ9wOy2.mjs → MazLazyImg-C03sUOXs.mjs} +6 -5
  95. package/components/chunks/{MazLoadingBar-By1umvdC.mjs → MazLoadingBar-Di2OIrPD.mjs} +1 -1
  96. package/components/chunks/{MazPagination-BL9LU84U.mjs → MazPagination-CHTMRRqE.mjs} +2 -2
  97. package/components/chunks/{MazPhoneNumberInput-C7gUk5lg.mjs → MazPhoneNumberInput-C4TX1tGw.mjs} +112 -111
  98. package/components/chunks/{MazPicker-Dhm3u2MN.mjs → MazPicker-BcQ_-AJH.mjs} +3 -3
  99. package/components/chunks/{MazPickerMonthSwitcher-ck8cl1-N.mjs → MazPickerMonthSwitcher-hCAkEd5r.mjs} +1 -1
  100. package/components/chunks/{MazPickerShortcuts-hEpUqVC-.mjs → MazPickerShortcuts-vpLyw1de.mjs} +1 -1
  101. package/components/chunks/{MazPickerYearSwitcher-CmMxOc69.mjs → MazPickerYearSwitcher-DvC79vrt.mjs} +1 -1
  102. package/components/chunks/{MazPullToRefresh-CdVBfDl9.mjs → MazPullToRefresh-CFQX0soS.mjs} +1 -1
  103. package/components/chunks/{MazSelect-ed445MXs.mjs → MazSelect-BXzgSKmL.mjs} +2 -2
  104. package/components/chunks/{MazSelect-CGsMRdr7.mjs → MazSelect-Baj2BQH7.mjs} +3 -3
  105. package/components/chunks/MazSpinner-B5lezvu4.mjs +34 -0
  106. package/components/chunks/MazSpinner-B8akphXs.mjs +34 -0
  107. package/components/chunks/MazSpinner-Bvb-lKER.mjs +34 -0
  108. package/components/chunks/MazSpinner-C-z3-68w.mjs +34 -0
  109. package/components/chunks/MazSpinner-C1SiKhfK.mjs +34 -0
  110. package/components/chunks/MazSpinner-CAbYLlEZ.mjs +34 -0
  111. package/components/chunks/MazSpinner-Cb3_S0zT.mjs +34 -0
  112. package/components/chunks/MazSpinner-Cg26sBU2.mjs +34 -0
  113. package/components/chunks/MazSpinner-Cqp-BMvL.mjs +34 -0
  114. package/components/chunks/MazSpinner-CsEQ9EXb.mjs +34 -0
  115. package/components/chunks/MazSpinner-CvT-9sC7.mjs +34 -0
  116. package/components/chunks/MazSpinner-DH6C15pU.mjs +34 -0
  117. package/components/chunks/MazSpinner-DjM6ktPY.mjs +34 -0
  118. package/components/chunks/MazSpinner-DlMKBtyt.mjs +34 -0
  119. package/components/chunks/{MazSpinner-BCOeuzTB.mjs → MazSpinner-Du5o8JC_.mjs} +15 -14
  120. package/components/chunks/MazSpinner-DwSGm0-X.mjs +34 -0
  121. package/components/chunks/MazSpinner-Dyf9yb51.mjs +34 -0
  122. package/components/chunks/MazSpinner-M4r0cykl.mjs +34 -0
  123. package/components/chunks/MazSpinner-QHjOczon.mjs +34 -0
  124. package/components/chunks/MazSpinner-XB6tX3Ld.mjs +34 -0
  125. package/components/chunks/MazSpinner-cqcpf_FX.mjs +34 -0
  126. package/components/chunks/MazSpinner-f6pBzqbu.mjs +34 -0
  127. package/components/chunks/MazSpinner-yPkPj7Q8.mjs +34 -0
  128. package/components/chunks/MazSpinner-yr9xVdAa.mjs +34 -0
  129. package/components/chunks/{MazTable-QwG-Kh88.mjs → MazTable-CulBGLaj.mjs} +1 -1
  130. package/components/chunks/{MazTableCell-BSNyqTSX.mjs → MazTableCell-BXDbkEJq.mjs} +1 -1
  131. package/components/chunks/{MazTableRow-CgubMdrX.mjs → MazTableRow-Ds3CDEit.mjs} +1 -1
  132. package/components/chunks/{MazTableTitle-h4dattYD.mjs → MazTableTitle-uirsgvk_.mjs} +1 -1
  133. package/components/chunks/{MazTransitionExpand-BvqRDM9d.mjs → MazTransitionExpand-4Ll_5LDO.mjs} +1 -1
  134. package/components/index.d.ts +1 -0
  135. package/components/index.mjs +1 -0
  136. package/css/main.css +1 -1
  137. package/modules/assets/MazBtn.css +1 -1
  138. package/modules/assets/MazSpinner.css +1 -1
  139. package/modules/assets/index.css +1 -1
  140. package/modules/chunks/{MazBtn-DvffpPyV.mjs → MazBtn-CTqI4qhg.mjs} +3 -3
  141. package/modules/chunks/{MazBtn-DeAZcD0R.cjs → MazBtn-D_CpNgpD.cjs} +2 -2
  142. package/modules/chunks/{MazIcon-D2B0umvn.mjs → MazIcon-BB0DMfOc.mjs} +1 -1
  143. package/modules/chunks/{MazIcon-BiwOZEZl.cjs → MazIcon-BtomZnkQ.cjs} +1 -1
  144. package/modules/chunks/MazSpinner-BASKjaLe.cjs +1 -0
  145. package/modules/chunks/MazSpinner-CDJhmIRl.mjs +34 -0
  146. package/modules/chunks/index-BIX1NMzX.cjs +149 -0
  147. package/modules/chunks/{index-C34aEXzu.mjs → index-C2yAjM0P.mjs} +1166 -968
  148. package/modules/index.cjs +1 -1
  149. package/modules/index.mjs +37 -35
  150. package/nuxt/index.d.mts +20 -20
  151. package/nuxt/index.d.ts +20 -20
  152. package/nuxt/index.json +1 -1
  153. package/nuxt/index.mjs +26 -5
  154. package/package.json +10 -10
  155. package/resolvers/index.cjs +1 -1
  156. package/resolvers/index.mjs +3 -1
  157. package/types/components/MazCheckbox.vue.d.ts +1 -6
  158. package/types/components/MazChecklist.vue.d.ts +76 -0
  159. package/types/components/MazDialog.vue.d.ts +1 -6
  160. package/types/components/MazDialogPromise.vue.d.ts +2 -0
  161. package/types/components/MazDropzone.vue.d.ts +1 -22
  162. package/types/components/MazFullscreenLoader.vue.d.ts +4 -5
  163. package/types/components/MazInput.vue.d.ts +1 -8
  164. package/types/components/MazInputCode.vue.d.ts +1 -4
  165. package/types/components/MazLazyImg.vue.d.ts +2 -0
  166. package/types/components/MazPhoneNumberInput.vue.d.ts +1 -20
  167. package/types/components/MazPicker.vue.d.ts +1 -1
  168. package/types/components/MazRadio.vue.d.ts +1 -6
  169. package/types/components/MazRadioButtons.vue.d.ts +1 -6
  170. package/types/components/MazSelect.vue.d.ts +1 -10
  171. package/types/components/MazSpinner.vue.d.ts +13 -23
  172. package/types/components/MazTable.vue.d.ts +34 -6
  173. package/types/components/index.d.ts +1 -0
  174. package/types/modules/composables/index.d.ts +1 -0
  175. package/types/modules/composables/useLanguageDisplayNames.d.ts +17 -0
  176. package/types/modules/helpers/idle-timeout/types.d.ts +5 -3
  177. package/types/modules/helpers/normalize-string.d.ts +1 -2
  178. package/components/chunks/MazBtn-CLFly8Ie.mjs +0 -118
  179. package/components/chunks/MazBtn-D2H26ExI.mjs +0 -118
  180. package/components/chunks/MazBtn-y4vRRWDg.mjs +0 -118
  181. package/components/chunks/MazSpinner-5w4SkOOl.mjs +0 -37
  182. package/components/chunks/MazSpinner-Akyx5wgU.mjs +0 -37
  183. package/components/chunks/MazSpinner-B2dsE23u.mjs +0 -37
  184. package/components/chunks/MazSpinner-BakExtKd.mjs +0 -37
  185. package/components/chunks/MazSpinner-ByWRmwig.mjs +0 -37
  186. package/components/chunks/MazSpinner-C9meLNrb.mjs +0 -37
  187. package/components/chunks/MazSpinner-CKOy0M1T.mjs +0 -37
  188. package/components/chunks/MazSpinner-CL6orjX7.mjs +0 -37
  189. package/components/chunks/MazSpinner-CQTq0J6f.mjs +0 -37
  190. package/components/chunks/MazSpinner-CQbd8Ovn.mjs +0 -37
  191. package/components/chunks/MazSpinner-CeZk8jA9.mjs +0 -37
  192. package/components/chunks/MazSpinner-Coq7N5iG.mjs +0 -37
  193. package/components/chunks/MazSpinner-CqS3onAE.mjs +0 -37
  194. package/components/chunks/MazSpinner-D1zj-581.mjs +0 -37
  195. package/components/chunks/MazSpinner-D2pssr8S.mjs +0 -37
  196. package/components/chunks/MazSpinner-DJ2t85tY.mjs +0 -37
  197. package/components/chunks/MazSpinner-DbaTlD5B.mjs +0 -37
  198. package/components/chunks/MazSpinner-DgJ9tVv_.mjs +0 -37
  199. package/components/chunks/MazSpinner-DoKvoICM.mjs +0 -37
  200. package/components/chunks/MazSpinner-Dscrgjm1.mjs +0 -41
  201. package/components/chunks/MazSpinner-Oy4E193R.mjs +0 -37
  202. package/components/chunks/MazSpinner-SgVUnAHk.mjs +0 -37
  203. package/modules/chunks/MazSpinner-CZIYnX05.cjs +0 -1
  204. package/modules/chunks/MazSpinner-Csgl_Uho.mjs +0 -37
  205. package/modules/chunks/index-B6Pf_QhC.cjs +0 -149
@@ -1,149 +0,0 @@
1
- "use strict";require('../assets/index.css');var At=Object.defineProperty;var St=(o,e,t)=>e in o?At(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var m=(o,e,t)=>St(o,typeof e!="symbol"?e+"":e,t);const n=require("vue");function Z(o,e){const t=n.inject(o,e);if(!t)throw new TypeError(`[maz-ui](injectStrict) Could not resolve ${o}`);return t}function xt(){return Z("aos")}function Vt(o){const e={};for(const[t,s]of Object.entries(o))e[t]=Number.parseInt(s,10);return e}function x(){return typeof document<"u"}function De(o={}){const{internalWindow:e=x()?window:void 0,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:s=Number.POSITIVE_INFINITY,includeScrollbar:r=!0}=o,i=n.ref(t),a=n.ref(s);function l(){e&&(r?(i.value=e.innerWidth,a.value=e.innerHeight):(i.value=e.document.documentElement.clientWidth,a.value=e.document.documentElement.clientHeight))}return l(),n.onMounted(()=>{e&&window.addEventListener("resize",l,{passive:!0})}),n.onUnmounted(()=>{e&&window.removeEventListener("resize",l)}),{width:i,height:a}}function Ot({initialWidth:o=0,initialHeight:e,includeScrollbar:t,internalWindow:s,listenOrientation:r,breakpoints:i,mediumBreakPoint:a="md",largeBreakPoint:l="lg"}){const{width:u}=De({initialWidth:o,initialHeight:e,includeScrollbar:t,internalWindow:s,listenOrientation:r}),c=Vt(i),h=n.computed(()=>u.value>=c[l]),p=n.computed(()=>u.value>=c[a]&&u.value<c[l]),w=n.computed(()=>u.value>=0&&u.value<c[a]);return{width:u,numericBreakpoints:c,isSmallScreen:w,isLargeScreen:h,isMediumScreen:p,breakpoints:i}}function Dt(){return Z("dialog")}function Be(o,e,t){const s={maxAttempts:20,interval:100,...t};let r=0;function i(){const a=o();a!=null?e(a):r<s.maxAttempts?(r++,setTimeout(i,s.interval)):console.warn(s.errorMessage||`[maz-ui](checkAvailability) Nothing found after ${s.maxAttempts} attempts for ref ${a}`)}i()}function $e(o){const e=n.toValue(o);return Array.isArray(e)?Object.freeze([...e]):typeof e=="object"&&e!==null?Object.freeze({...e}):e}function ke(o){return o==null||typeof o=="string"||typeof o=="number"||typeof o=="boolean"||typeof o=="symbol"||typeof o=="bigint"}function Bt(o,e){if(o.length!==e.length)return!1;for(const[t,s]of o.entries())if(!G(s,e[t]))return!1;return!0}function $t(o,e){const t=Object.keys(o),s=Object.keys(e);if(t.length!==s.length)return!1;for(const r of t)if(!s.includes(r)||!G(o[r],e[r]))return!1;return!0}function G(o,e){return ke(o)||ke(e)?o===e:o instanceof Date&&e instanceof Date?o.getTime()===e.getTime():typeof o!=typeof e||Array.isArray(o)!==Array.isArray(e)?!1:Array.isArray(o)&&Array.isArray(e)?Bt(o,e):typeof o=="object"&&typeof e=="object"?$t(o,e):!1}function Pt(o,e,t){const s={};return async function(...r){s[o]||(s[o]={timer:null,promise:null});const i=s[o];return i.timer&&clearTimeout(i.timer),i.promise=new Promise((a,l)=>{i.timer=setTimeout(async()=>{try{a(await e(...r))}catch(u){l(u)}finally{delete s[o]}},t)}),i.promise}}function Mt(o,e,t){const s={};return async(...r)=>{const i=Date.now();return s[o]||(s[o]={promise:null,lastCall:0,lastArgs:[]}),i-s[o].lastCall>=t?(s[o].lastCall=i,e(...r)):(s[o].lastArgs=r,s[o].promise||(s[o].promise=new Promise(a=>{setTimeout(async()=>{s[o].lastCall=Date.now();const l=await e(...s[o].lastArgs);s[o].promise=null,a(l)},t-(i-s[o].lastCall))})),s[o].promise)}}const H={mode:"lazy",scrollToErrorSelector:".has-field-error",debounceTime:300,throttleTime:1e3};function Pe(o,e){return Object.keys(e).includes(o)}function Le(o=H.scrollToErrorSelector){const e=document.querySelector(o);e&&e.scrollIntoView({behavior:"smooth",block:"center"})}function Nt(o,e){const t={};for(const[s,r]of Object.entries(o)){const i=r;t[s]=e[s].error&&i[0]?i[0].message:void 0}return t}function Te(o){return o==null||o===""}function Ht({name:o,hasValidation:e,debouncedFields:t,throttledFields:s}){if(e){if(t!=null&&t[o]&&(s!=null&&s[o]))throw new Error(`The field "${o}" cannot be both debounced and throttled`);return t!=null&&t[o]?Pt(o,X,typeof t[o]=="number"?t[o]:H.debounceTime):s!=null&&s[o]?Mt(o,X,typeof s[o]=="number"?s[o]:H.throttleTime):X}}function Me({name:o,schema:e,initialValue:t,fieldState:s,options:r}){const i=e?Pe(o,e):!1,a=Ht({name:o,hasValidation:i,debouncedFields:r==null?void 0:r.debouncedFields,throttledFields:r==null?void 0:r.throttledFields});return{blurred:!1,dirty:!1,errors:[],error:!1,valid:!i,validating:!1,validated:!1,initialValue:$e(t),validateFunction:a,mode:i?(r==null?void 0:r.mode)??(s==null?void 0:s.mode)??H.mode:void 0}}function Ft({schema:o,payload:e,options:t}){const s={};for(const r in o){const i=r;s[i]=Me({name:i,schema:o,options:t,fieldState:s[i],initialValue:e==null?void 0:e[i]})}return s}function qt({fieldsStates:o,payload:e,schema:t,options:s,updateMode:r=!1}){for(const i in t){const a=i;o[a]=Ne({name:a,fieldState:o[a],payload:e,schema:t,options:s,updateMode:r})}}function Ne({name:o,fieldState:e,payload:t,schema:s,options:r,updateMode:i=!0}){const{initialValue:a,mode:l,...u}=Me({name:o,schema:s,initialValue:r.defaultValue??t[o],fieldState:e,options:r}),c=i?l??e.mode??H.mode:e.mode;return{...e,initialValue:a,mode:c,...e!=null&&e.mode&&c!==e.mode?u:{}}}function jt(o){const e={};for(const[t,{errors:s}]of Object.entries(o))e[t]=s;return e}function _t(o){return o instanceof HTMLInputElement||o instanceof HTMLSelectElement||o instanceof HTMLTextAreaElement?[o]:o.querySelectorAll("input, select, textarea")}function Ut({interactiveElements:o,onBlurHandler:e,mode:t}){o.forEach(s=>{Q(["eager","blur","progressive"],t)&&s.addEventListener("blur",e)})}function Wt({interactiveElements:o,onBlurHandler:e}){o.forEach(t=>{t.removeEventListener("blur",e)})}async function Rt(o,e,t){const s=await Qt(e),i=await(await qe("safeParseAsync"))(s.entries[o],t??"");return{result:i,isValid:i.success}}async function X({name:o,fieldState:e,schema:t,payload:s,setError:r=!0,setErrorIfInvalidAndNotEmpty:i=!1}){if(await n.nextTick(),e.validating=!0,!t[o]){e.valid=!0,e.validating=!1,e.validated=!0,e.errors=[],e.error=!1;return}const{result:a,isValid:l}=await Rt(o,t,s[o]);e.valid=l,(r||i&&!l&&!Te(s[o]))&&(e.error=!l),e.errors=a.issues??[],e.validating=!1,e.validated=!0}function He({name:o,fieldState:e,payload:t,schema:s}){var i;const r={name:o,fieldState:e,payload:t,schema:s,setError:e.mode==="progressive"?e.valid||e.blurred:!0};return(i=e.validateFunction)==null?void 0:i.call(e,r)}function Kt({fieldsStates:o,payload:e,showErrors:t=!0,schema:s}){return Promise.all(Object.keys(o).map(r=>X({name:r,setError:t,fieldState:o[r],payload:e,schema:s,setErrorIfInvalidAndNotEmpty:o[r].mode==="lazy"})))}function Fe({eventName:o,fieldState:e,isSubmitted:t}){const{dirty:s,blurred:r,mode:i,valid:a}=e;return o==="blur"&&(Q(["lazy","aggressive"],i)||a)||o==="input"&&i==="blur"||!i?!1:t||i==="eager"&&r||i==="blur"&&r||i==="aggressive"&&s||i==="lazy"&&s||i==="progressive"}function Yt({name:o,force:e=!1,payload:t,fieldState:s,schema:r,isSubmitted:i}){const a=t[o],l=!Te(a)&&!G(a,s.initialValue);if(s.dirty=l,s.blurred=s.blurred||(s.mode==="eager"?l:!0),!!(e||Fe({eventName:"blur",fieldState:s,isSubmitted:i})))return He({name:o,fieldState:s,schema:r,payload:t})}function Xt({name:o,payload:e,fieldState:t,schema:s,isSubmitted:r,forceValidation:i=!1}){const a=e[o];t.validated=!1;const l=!Te(a)&&!G(a,t.initialValue);if(t.dirty=l,!!(i||Fe({eventName:"input",fieldState:t,isSubmitted:r})))return He({name:o,fieldState:t,schema:s,payload:e})}function Ce(o){const e=n.getCurrentInstance();if(!e)throw new Error(`${o} must be called within setup()`);return e}function Zt(o,e){var r;const s=((r=Ce(e).formContexts)==null?void 0:r.get(o))??n.inject(o);if(!s)throw new Error("useFormField must be used within a form (useFormValidator)");return s}function Gt({ref:o,fieldState:e,onBlurHandler:t}){if(!(o||Q(["aggressive","lazy"],e.mode)))return{onBlur:t}}const ve={};async function qe(o){if(ve[o])return ve[o];const e=await Promise.resolve().then(()=>require("./index-CXVZhyjw.cjs"));return ve[o]=e[o],e[o]}async function Qt(o){return(await qe("objectAsync"))(o)}function Q(o,e){return e?o.includes(e):!1}function Jt(o,e){const t={formIdentifier:"main-form-validator",...e},{fieldsStates:s,payload:r,options:i,internalSchema:a,errorMessages:l,isSubmitted:u}=Zt(t.formIdentifier,"useFormField"),c=Pe(o,a.value)?(e==null?void 0:e.mode)??i.mode:void 0;t.mode=c;const h=n.computed(()=>s.value[o]);if(s.value[o]=Ne({name:o,fieldState:h.value,payload:r.value,schema:a.value,options:{...i,...t}}),t.defaultValue!==void 0&&!G(r.value[o],t.defaultValue)){const T=t.defaultValue;r.value[o]=T,s.value[o].initialValue=$e(T)}c&&X({name:o,fieldState:h.value,payload:r.value,schema:a.value,setError:c==="aggressive",setErrorIfInvalidAndNotEmpty:c==="lazy"});function p(){Yt({name:o,fieldState:h.value,payload:r.value,schema:a.value,isSubmitted:u.value})}const w=n.computed(()=>Gt({ref:t.ref,onBlurHandler:p,fieldState:h.value}));if(t.ref&&Q(["eager","blur","progressive"],c)){let T=[];const S=L=>{T=_t(L),Ut({interactiveElements:T,onBlurHandler:p,mode:c})};n.onMounted(()=>{const L=Ce(`useFormField of ${o}`);Be(()=>L.refs[t.ref],d=>{const y=d instanceof HTMLElement?d:d==null?void 0:d.$el;y&&S(y)},{errorMessage:`[maz-ui](useFormField) No element found for ref ${t.ref} for field ${o}`})}),n.onUnmounted(()=>{Wt({interactiveElements:T,onBlurHandler:p})})}return{hasError:n.computed(()=>h.value.error),errors:n.computed(()=>h.value.errors),errorMessage:n.computed(()=>l.value[o]),isValid:n.computed(()=>h.value.valid),isDirty:n.computed(()=>h.value.dirty),isBlurred:n.computed(()=>h.value.blurred),isValidated:n.computed(()=>h.value.validated),isValidating:n.computed(()=>h.value.validating),mode:n.computed(()=>h.value.mode),value:n.computed({get:()=>r.value[o],set:T=>r.value[o]=T}),validationEvents:w}}function eo({schema:o,defaultValues:e,model:t,options:s}){const r=Ce("useFormValidator"),i={mode:H.mode,scrollToError:H.scrollToErrorSelector,debouncedFields:null,throttledFields:null,identifier:"main-form-validator",...s},a=n.ref(e),l=n.ref({...a.value,...t==null?void 0:t.value}),u=n.ref(o),c=n.ref(Ft({schema:u.value,payload:l.value,options:i})),h=n.ref(!1),p=n.ref(!1),w=n.computed(()=>Object.values(c.value).every(({valid:E})=>E)),T=n.computed(()=>Object.values(c.value).some(({dirty:E})=>E)),S=n.computed(()=>jt(c.value)),L=n.computed(()=>Nt(S.value,c.value));t&&n.watch(l,E=>{t.value={...a.value,...E}},{deep:!0}),n.watch(a,E=>{l.value={...E,...l.value}},{deep:!0}),n.watch(u,E=>{qt({schema:E,fieldsStates:c.value,payload:l.value,options:i}),d()},{deep:!0}),d();function d(E=i.mode==="aggressive"){return Kt({fieldsStates:c.value,payload:l.value,schema:u.value,showErrors:E})}const y=[];async function z(E){await n.nextTick();const V=n.watch(()=>l.value[E],()=>{const B=c.value[E];Xt({name:E,fieldState:B,payload:l.value,schema:u.value,isSubmitted:p.value,forceValidation:Q(["aggressive","lazy","progressive"],B.mode)})},{deep:typeof u.value[E]=="object"});y.push(V)}function g(){for(const E of y)E();for(const E of Object.keys(u.value))z(E)}function I(E,V){return async B=>{if(B==null||B.preventDefault(),h.value)return;p.value=!0,h.value=!0,await d(!0);const M=typeof V=="string"?V:i.scrollToError;let N;return w.value?N=await E(l.value):typeof M!="boolean"&&Le(M),h.value=!1,N}}const O={fieldsStates:c,payload:l,options:i,internalSchema:u,errorMessages:L,isSubmitted:p};return r.formContexts??(r.formContexts=new Map),r.formContexts.set(i.identifier,O),n.provide(i.identifier,O),g(),{identifier:i.identifier,isDirty:T,isSubmitting:h,isSubmitted:p,isValid:w,errors:S,model:l,fieldsStates:c,validateForm:d,scrollToError:Le,handleSubmit:I,errorMessages:L}}class je{constructor(e,t){m(this,"defaultOptions",{element:void 0,timeout:60*1e3*5,once:!1,immediate:!0});m(this,"options");m(this,"timeoutHandler");m(this,"isIdle",!1);m(this,"isDestroy",!1);m(this,"startTime",0);m(this,"remainingTime",0);m(this,"lastClientX",-1);m(this,"lastClientY",-1);m(this,"eventNames",["DOMMouseScroll","mousedown","mousemove","mousewheel","MSPointerDown","MSPointerMove","keydown","touchmove","touchstart","wheel","click"]);m(this,"handleEvent",e=>{try{if(this.remainingTime>0)return;if(e.type==="mousemove"){const{clientX:t,clientY:s}=e;if(t===void 0&&s===void 0||t===this.lastClientX&&s===this.lastClientY)return;this.lastClientX=t,this.lastClientY=s}this.resetTimeout(),this.callback({isIdle:this.isIdle,eventType:e.type})}catch(t){throw new Error(`[IdleTimeout](handleEvent) ${t}`)}});this.callback=e,this.options={...this.defaultOptions,...t},x()&&this.start()}get element(){return this.options.element??document.body}start(){if(!x()){console.warn("[IdleTimeout](start) you should run this method on client side");return}for(const e of this.eventNames)this.element.addEventListener(e,this.handleEvent);this.resetTimeout(),this.options.immediate&&this.callback({isIdle:!1})}pause(){const e=this.startTime+this.options.timeout-Date.now();e<=0||(this.remainingTime=e,this.timeoutHandler&&(clearTimeout(this.timeoutHandler),this.timeoutHandler=void 0))}resume(){this.remainingTime<=0||(this.resetTimeout(),this.callback({isIdle:this.isIdle}),this.remainingTime=0)}reset(){this.isDestroy=!1,this.isIdle=!1,this.remainingTime=0,this.resetTimeout(),this.callback({isIdle:this.isIdle})}destroy(){if(!x()){console.warn("[IdleTimeout](destroy) you should run this method on client side");return}this.isDestroy=!0;for(const e of this.eventNames)this.element.removeEventListener(e,this.handleEvent);this.timeoutHandler&&clearTimeout(this.timeoutHandler)}resetTimeout(){this.isIdle=!1,this.timeoutHandler&&(clearTimeout(this.timeoutHandler),this.timeoutHandler=void 0),this.timeoutHandler=setTimeout(this.handleTimeout.bind(this),this.remainingTime||this.options.timeout),this.startTime=Date.now()}handleTimeout(){this.isIdle=!0,this.callback({isIdle:this.isIdle}),this.options.once&&this.destroy()}get destroyed(){return this.isDestroy}get timeout(){return this.options.timeout}set timeout(e){this.options.timeout=e}get idle(){return this.isIdle}set idle(e){e?this.handleTimeout():this.reset(),this.callback({isIdle:this.isIdle})}}function to({callback:o,options:e}){return new je(o,e)}function oo({componentName:o,providedId:e}){const t=n.useId();return n.computed(()=>e??`${o}-${t}`)}function _e(o){const e=o.join(", ").match(/\b\w+\b/g);return e?e.length:0}function no(o,e=150){const t=_e([o]);return Math.ceil(t/e)}function so(o){const e=n.computed(()=>{var a;return typeof o.velocity=="number"?o.velocity:((a=o.velocity)==null?void 0:a.value)??150}),t=n.computed(()=>{var a;return typeof o.contentSelector=="string"?o.contentSelector:(a=o.contentSelector)==null?void 0:a.value}),s=n.computed(()=>{var a,l,u;if(typeof((a=o.contentRef)==null?void 0:a.value)=="object")return(l=o.contentRef.value)==null?void 0:l.textContent;if(t.value&&typeof document<"u"){const c=document.querySelector(t.value);if(c)return c.textContent}return typeof o.content=="string"?o.content:(u=o.content)==null?void 0:u.value}),r=n.computed(()=>no(s.value,e.value)),i=n.computed(()=>_e([s.value]));return{content:s,wordCount:i,velocity:e,duration:r}}const ro={removeAccents:!0,caseSensitive:!1,replaceSpaces:!0,removeSpecialCharacters:!1,trim:!0,normalizeSpaces:!0,removeNumbers:!1,customNormalizationForms:["NFC","NFKD"]};function ye(o,e){const t={...ro,...e},s={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Î:"I",Ï:"I",í:"I",î:"i",ï:"i",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ç:"C",ç:"c",ÿ:"y",Ñ:"N",ñ:"n",ó:"o"};let r=o.toString();if(t.trim&&(r=r.trim()),t.normalizeSpaces&&(r=r.replaceAll(/\s+/g," ")),t.replaceSpaces&&(r=r.replaceAll(" ","-")),t.removeNumbers&&(r=r.replaceAll(/\d/g,"")),t.removeAccents&&(r=r.replaceAll(/[ÀÁÂÃÄÅÇÈÉÊËÎÏÑÔÕÖØÙÚÛÜàáâãäåçèéêëíîïñóôõöøùúûüÿ]/g,i=>s[i]||i),r=r.replaceAll(/[\u0300-\u036F]/g,"")),t.caseSensitive===!1&&(r=r.toLowerCase()),t.removeSpecialCharacters&&(r=r.replaceAll(/[^\dA-Z-]/gi,"")),t.trim&&(r=r.trim()),t.customNormalizationForms)for(const i of t.customNormalizationForms)r=r.normalize(i);return r}function io(o,e){const t=o.length,s=e.length,r=[];for(let i=0;i<=t;i++)r[i]=[i];for(let i=0;i<=s;i++)r[0][i]=i;for(let i=1;i<=t;i++)for(let a=1;a<=s;a++){const l=o[i-1]===e[a-1]?0:1;r[i][a]=Math.min(r[i-1][a]+1,r[i][a-1]+1,r[i-1][a-1]+l)}return r[t][s]}function Ue(o,e){const t=io(o,e),s=Math.max(o.length,e.length);return 1-t/s}function ao(o,e,t=.75){return Ue(o,e)>=t}function lo(o,e,t=.75){const s=n.computed(()=>ye(typeof o=="string"?o:o.value)),r=n.computed(()=>ye(typeof e=="string"?e:e.value)),i=n.computed(()=>typeof t=="number"?t:t.value),a=n.computed(()=>Ue(s.value,r.value));return{isMatching:n.computed(()=>ao(s.value,r.value,i.value)),score:a}}const co={preventDefaultOnTouchMove:!1,preventDefaultOnMouseWheel:!1,threshold:50,immediate:!1,triggerOnEnd:!1};class We{constructor(e){m(this,"element");m(this,"xStart");m(this,"yStart");m(this,"xEnd");m(this,"yEnd");m(this,"xDiff");m(this,"yDiff");m(this,"onToucheStartCallback");m(this,"onToucheMoveCallback");m(this,"onToucheEndCallback");m(this,"onMouseWheelCallback");m(this,"start");m(this,"stop");m(this,"options");this.inputOption=e,this.options={...co,...e},this.onToucheStartCallback=this.toucheStartHandler.bind(this),this.onToucheMoveCallback=this.handleTouchMove.bind(this),this.onToucheEndCallback=this.handleTouchEnd.bind(this),this.onMouseWheelCallback=this.handleMouseWheel.bind(this),this.start=this.startListening.bind(this),this.stop=this.stopListening.bind(this),this.options.element&&this.setElement(this.options.element),this.options.immediate&&this.start()}startListening(){this.setElement(this.options.element),this.element.addEventListener("touchstart",this.onToucheStartCallback,{passive:!0}),this.element.addEventListener("touchmove",this.onToucheMoveCallback,{passive:!0}),this.options.triggerOnEnd&&this.element.addEventListener("touchend",this.onToucheEndCallback,{passive:!0}),this.options.preventDefaultOnMouseWheel&&this.element.addEventListener("mousewheel",this.onMouseWheelCallback,{passive:!1})}stopListening(){this.element.removeEventListener("touchstart",this.onToucheStartCallback),this.element.removeEventListener("touchmove",this.onToucheMoveCallback),this.element.removeEventListener("touchend",this.onToucheEndCallback),this.options.preventDefaultOnMouseWheel&&this.element.removeEventListener("mousewheel",this.onMouseWheelCallback)}setElement(e){if(!e){console.error("[maz-ui][SwipeHandler](setElement) Element should be provided. Its can be a string selector or an HTMLElement");return}if(typeof e=="string"){const t=document.querySelector(e);if(!(t instanceof HTMLElement)){console.error("[maz-ui][SwipeHandler](setElement) String selector for element is not found");return}this.element=t}else this.element=e}handleMouseWheel(e){e.preventDefault()}toucheStartHandler(e){this.xStart=e.touches[0].clientX,this.yStart=e.touches[0].clientY,this.emitValuesChanged()}emitValuesChanged(){var e,t;(t=(e=this.options).onValuesChanged)==null||t.call(e,{xStart:this.xStart,yStart:this.yStart,xEnd:this.xEnd,yEnd:this.yEnd,xDiff:this.xDiff,yDiff:this.yDiff})}handleTouchMove(e){this.options.preventDefaultOnTouchMove&&e.cancelable&&e.preventDefault(),this.xEnd=e.touches[0].clientX,this.yEnd=e.touches[0].clientY,!(!this.xStart||!this.yStart)&&(this.xDiff=this.xStart-this.xEnd,this.yDiff=this.yStart-this.yEnd,this.emitValuesChanged(),this.options.triggerOnEnd||this.runCallbacks(e))}handleTouchEnd(e){this.runCallbacks(e),this.emitValuesChanged()}runCallbacks(e){var t,s,r,i,a,l,u,c;typeof this.xDiff!="number"||typeof this.yDiff!="number"||Math.abs(this.xDiff)<this.options.threshold&&Math.abs(this.yDiff)<this.options.threshold||(Math.abs(this.xDiff)>Math.abs(this.yDiff)?this.xDiff>0?(s=(t=this.options).onLeft)==null||s.call(t,e):(i=(r=this.options).onRight)==null||i.call(r,e):this.yDiff>0?(l=(a=this.options).onUp)==null||l.call(a,e):(c=(u=this.options).onDown)==null||c.call(u,e),this.resetValues())}resetValues(){this.xStart=void 0,this.yStart=void 0,this.xEnd=void 0,this.yEnd=void 0,this.xDiff=void 0,this.yDiff=void 0,this.emitValuesChanged()}}function uo(o){const e=n.ref(),t=n.ref(),s=n.ref(),r=n.ref(),i=n.ref(),a=n.ref(),l=n.computed(()=>n.toValue(o.element)),u=new We({...o,element:l.value,onValuesChanged(c){e.value=c.xDiff,t.value=c.yDiff,s.value=c.xStart,r.value=c.xEnd,i.value=c.yStart,a.value=c.yEnd}});return{xDiff:e,yDiff:t,xStart:s,xEnd:r,yStart:i,yEnd:a,start:()=>{l.value&&(u.options.element=l.value),u.start()},stop:u.stop}}const mo={darkClass:"dark",lightClass:"light",storageThemeKey:"theme",storageThemeValueDark:"dark",storageThemeValueLight:"light",storageThemeValueSystem:"system",watchChanges:!0},J=n.ref("system"),P=n.ref("system");function Ie(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function ee({darkClass:o,lightClass:e,storageThemeKey:t,storageThemeValueDark:s,setLocalStorageValue:r=!0,setSelectedTheme:i=!0}){x()&&(document.documentElement.classList.remove(e),document.documentElement.classList.add(o),J.value=s,i&&(P.value=s),r&&(localStorage[t]=s))}function te({darkClass:o,lightClass:e,storageThemeKey:t,storageThemeValueLight:s,setLocalStorageValue:r=!0,setSelectedTheme:i=!0}){x()&&(document.documentElement.classList.remove(o),document.documentElement.classList.add(e),J.value=s,i&&(P.value=s),r&&(localStorage[t]=s))}function Re({setLocalStorageValue:o=!0,...e}){if(x())return document.documentElement.classList.remove(e.darkClass),document.documentElement.classList.remove(e.lightClass),J.value=e.storageThemeValueSystem,P.value=e.storageThemeValueSystem,o&&(localStorage[e.storageThemeKey]=e.storageThemeValueSystem),be(e)}function Ke(o){if(!o.defaultTheme)return console.error("[maz-ui](useThemeHandler) No default theme set");if(!["light","dark"].includes(o.defaultTheme))return console.error('[maz-ui](useThemeHandler) Default theme must be "light" or "dark"');switch(o.defaultTheme){case"dark":return ee({...o,setLocalStorageValue:!1,setSelectedTheme:!0});case"light":return te({...o,setLocalStorageValue:!1,setSelectedTheme:!0})}}function be(o){return x()?!localStorage[o.storageThemeKey]&&o.defaultTheme?Ke(o):localStorage[o.storageThemeKey]===o.storageThemeValueDark||!localStorage[o.storageThemeKey]&&Ie()||localStorage[o.storageThemeKey]===o.storageThemeValueSystem&&Ie()?ee({...o,setLocalStorageValue:!1,setSelectedTheme:!1}):te({...o,setLocalStorageValue:!1,setSelectedTheme:!1}):void 0}function pe({theme:o,...e}){return o==="system"?Re(e):o==="dark"?ee(e):te(e)}function fo(o){return J.value===o.storageThemeValueDark?te(o):ee(o)}function ho(o){const e={...mo,...o};function t(){be(e)}return n.onMounted(()=>{localStorage[e.storageThemeKey]&&(P.value=localStorage[e.storageThemeKey]),e.watchChanges&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t)}),n.onBeforeUnmount(()=>{e.watchChanges&&window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",t)}),n.watch(P,s=>{switch(localStorage[e.storageThemeKey]=s,s){case e.storageThemeValueDark:{ee(e);break}case e.storageThemeValueLight:{te(e);break}case e.storageThemeValueSystem:{Re(e);break}}}),{autoSetTheme:()=>be(e),toggleTheme:()=>fo(e),setSystemTheme:()=>pe({...e,theme:"system"}),setDarkTheme:()=>pe({...e,theme:"dark"}),setLightTheme:()=>pe({...e,theme:"light"}),setDefaultTheme:()=>Ke(e),hasDarkTheme:n.computed(()=>P.value===e.storageThemeValueDark),hasLightTheme:n.computed(()=>P.value===e.storageThemeValueLight),hasSystemTheme:n.computed(()=>P.value===e.storageThemeValueSystem),theme:J,selectedTheme:P}}function Ye({timeout:o=1e3,callback:e,remainingTimeUpdate:t=200,callbackOffsetTime:s=0}){const r=n.ref(o),i=n.ref(o);let a;function l(w){typeof w=="number"&&(i.value=w),typeof w=="number"&&(r.value=w),u()}function u(){a||(a=setInterval(()=>{i.value-=t,i.value<=0&&(p(),setTimeout(()=>e==null?void 0:e(),s))},t))}function c(){a&&(clearInterval(a),a=void 0)}function h(){!a&&i.value>0&&u()}function p(){setTimeout(()=>i.value=r.value,s*2),c()}return{remainingTime:i,start:l,pause:c,resume:h,stop:p}}function vo(){return Z("toast")}class Xe{constructor(e,t){m(this,"eventHandlerFunction");m(this,"event","visibilitychange");m(this,"timeoutHandler");m(this,"options");m(this,"defaultOptions",{timeout:5e3,once:!1,immediate:!0});m(this,"isVisible",!1);this.callback=e,this.options={...this.defaultOptions,...t},this.eventHandlerFunction=this.eventHandler.bind(this),x()&&this.start()}start(){if(!x()){console.warn("[UserVisibility](start) you should run this method on client side");return}this.options.immediate&&this.emitCallback(),this.addEventListener()}emitCallback(){this.isVisible=document.visibilityState==="visible",this.callback({isVisible:this.isVisible}),this.options.once&&this.destroy()}eventHandler(){document.visibilityState==="visible"&&!this.isVisible?(this.clearTimeout(),this.emitCallback()):document.visibilityState==="hidden"&&this.initTimeout()}clearTimeout(){this.timeoutHandler&&(clearTimeout(this.timeoutHandler),this.timeoutHandler=void 0)}initTimeout(){this.clearTimeout(),this.timeoutHandler=setTimeout(this.emitCallback.bind(this),this.options.timeout)}addEventListener(){document.addEventListener(this.event,this.eventHandlerFunction)}removeEventListener(){document.removeEventListener(this.event,this.eventHandlerFunction)}destroy(){this.removeEventListener(),this.timeoutHandler&&clearTimeout(this.timeoutHandler)}}function po({callback:o,options:e}){return new Xe(o,e)}function go(){return Z("wait")}const le="__maz-click-outside__";function Ze(){return document.ontouchstart===null?"touchstart":"click"}async function Ge(o,e){try{Qe(o);const t=e.instance,s=e.value,r=typeof s=="function";if(!r)throw new Error("[maz-ui](vClickOutside) the callback should be a function");await n.nextTick(),o[le]=a=>{if((!o||a.target&&!o.contains(a.target))&&s&&r)return s.call(t,a)};const i=Ze();document.addEventListener(i,o[le],{passive:!0})}catch(t){console.error("[maz-ui](vClickOutside)",t)}}function Qe(o){try{const e=Ze();document.removeEventListener(e,o[le],!1),delete o[le]}catch(e){console.error("[maz-ui](vClickOutside)",e)}}function yo(o,e){try{if(e.value===e.oldValue)return;Ge(o,e)}catch(t){console.error("[maz-ui](vClickOutside)",t)}}const Je={mounted:Ge,updated:yo,unmounted:Qe},et={install:o=>{o.directive("click-outside",Je)}};function tt(o,e,t){var a;o.stopPropagation();const s=typeof t.value=="function"?t.value:t.value.handler,r=typeof t.value=="object"?t.value.exclude:void 0;let i=!1;if(r&&r.length>0){for(const l of r)if(!i&&o.target instanceof HTMLElement){const u=(a=document.querySelector(l))==null?void 0:a.getAttribute("id");i=o.target.getAttribute("id")===u}}!e.contains(o.target)&&!i&&(s==null||s())}function ot(){return document.ontouchstart===null?"touchstart":"click"}function bo(o,e){const t=ot();document.removeEventListener(t,s=>tt(s,o,e))}function wo(o,e){if(typeof e.value!="function"&&typeof e.value=="object"&&typeof e.value.handler!="function"){console.error("[maz-ui](vClosable) v-closable directive requires a handler function");return}const t=ot();document.addEventListener(t,s=>tt(s,o,e))}const nt={mounted:wo,unmounted:bo},st={install:o=>{o.directive("closable",nt)}},we={position:"top"};class rt{constructor(e={}){m(this,"options");this.options={...we,...e}}getPosition({modifiers:e,value:t}){return e.top?"top":e.bottom?"bottom":e.left?"left":e.right?"right":typeof t=="string"?"top":t.position??this.options.position}getText({value:e}){return typeof e=="string"?e:e.text}getOpen({value:e}){return typeof e=="string"?!1:e.open??!1}getColor({value:e}){return typeof e=="string"?"default":e.color??"default"}create(e,t){e.setAttribute("data-tooltip",this.getText(t)),e.classList.add("m-tooltip");const s=this.getPosition(t);e.classList.add(`m-tooltip--${s}`),e.classList.add(`m-tooltip--${this.getColor(t)}`),this.getOpen(t)&&e.classList.add("m-tooltip--open")}update(e,t){this.remove(e,t),this.create(e,t)}remove(e,t){e.removeAttribute("data-tooltip"),e.classList.remove("m-tooltip"),e.classList.remove("m-tooltip--top"),e.classList.remove("m-tooltip--bottom"),e.classList.remove("m-tooltip--left"),e.classList.remove("m-tooltip--right"),e.classList.remove("m-tooltip--open"),e.classList.remove(`m-tooltip--${this.getColor(t)}`)}}let se;const Eo={beforeMount(o,e){const t=typeof e.value=="object"?e.value:{};return se=new rt(t),se.create(o,e)},updated(o,e){return se.update(o,e)},unmounted(o,e){return se.remove(o,e)}},it={install:(o,e=we)=>{const t={...we,...e},s=new rt(t);o.directive("tooltip",{beforeMount:s.create.bind(s),updated:s.update.bind(s),unmounted:s.remove.bind(s)})}};function ce(o,e){let t=e==null?void 0:e.element;function s(){t&&n.render(null,t)}const r={...e==null?void 0:e.props,...e!=null&&e.addDestroyInProps?{destroy:s}:{}},i=n.createVNode(o,r,e==null?void 0:e.children);return e!=null&&e.app?(i.appContext=e.app._context,t?n.render(i,t):typeof document<"u"&&(t=document.createElement("div"),n.render(i,t))):(t=t??document.body,n.render(i,t)),{vNode:i,destroy:s,el:t}}const To=["onKeypress"],Co={class:"m-fullscreen-img-scroller"},zo=["src","alt"],ko=n.defineComponent({__name:"MazFullscreenImg",props:{src:{},clickedElementBounds:{default:void 0},offset:{default:void 0},animation:{default:()=>({duration:300,easing:"ease-in-out"})},openInstanceClass:{default:"m-fullscreen-img-instance"},clickedElement:{},destroy:{type:Function,default:void 0},alt:{default:void 0},zoom:{type:Boolean,default:!0}},emits:["close","previous","next","before-close"],setup(o,{emit:e}){const t=o,s=e,r=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./MazSpinner-CZIYnX05.cjs"))),i=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./x-mark-DW2WXkoF.cjs"))),a=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./chevron-left-Byr9GkwI.cjs"))),l=n.ref(!1),u=n.ref(!1),c=n.ref(!1),h=n.ref(!1),p=n.ref(!1),w=n.ref(t.clickedElement),T=n.computed(()=>t.clickedElement.getBoundingClientRect()),S=n.computed(()=>T.value.height<T.value.width),L=n.ref(t.src),d=n.ref(t.alt),y=n.ref(),z=n.ref(),g=n.computed(()=>p.value?"--is-zoomed maz-cursor-zoom-out":"maz-cursor-zoom-in");function I(){l.value=!0,u.value=!1,c.value=!0}n.watch(()=>c.value,f=>{f&&me()});function O(){s("before-close"),v()}function E(f){f.key==="Escape"&&(f.preventDefault(),O()),(f.key==="ArrowLeft"||f.key==="ArrowRight")&&(f.preventDefault(),R(f.key==="ArrowRight"?"next":"previous"))}function V(){document.documentElement.classList.add("--m-fullscreen-open")}function B(){document.documentElement.classList.remove("--m-fullscreen-open")}function M(){return[...document.querySelectorAll(".m-fullscreen-img-instance")]}function N(f,b){return b<0?f.length-1:b>=f.length?0:b}async function oe(f,b){f.classList.remove(t.openInstanceClass),b.classList.add(t.openInstanceClass);const k=b.getAttribute("data-src"),A=b.getAttribute("data-alt");d.value=A,k&&(L.value=k),l.value=!1,l.value||(u.value=!0)}function R(f){const b=document.querySelector(`.m-fullscreen-img-instance.${t.openInstanceClass}`);if(b){const k=M(),A=k.indexOf(b),$=f==="next"?A+1:A-1,D=k[N(k,$)];w.value=D,D&&oe(b,D),s(f),p.value?F(z.value):j()}}function F(f){S.value?(f.style.width=`${window.innerWidth}px`,f.style.removeProperty("height")):(f.style.height=`${window.innerHeight}px`,f.style.removeProperty("width")),f.style.removeProperty("top"),f.style.removeProperty("left")}async function de(){const f=z.value;p.value?(p.value=!p.value,j()):(p.value=!p.value,F(f))}function K(f){var b;return(b=z.value)==null?void 0:b.animate(f,{duration:t.animation.duration,easing:t.animation.easing})}function ne(f=t.offset??0){const b=(w.value instanceof HTMLImageElement?w.value.naturalWidth:w.value.clientWidth)||1,k=(w.value instanceof HTMLImageElement?w.value.naturalHeight:w.value.clientHeight)||1,A=window.innerWidth,$=window.innerHeight,D=Math.min((A-2*f)/b,($-2*f)/k),fe=(A-b*D)/2,he=($-k*D)/2;return{centerX:fe,centerY:he,originalWidth:b,originalHeight:k,scale:D}}function q({trigger:f}){const{originalWidth:b,originalHeight:k,scale:A,centerX:$,centerY:D}=ne(),{top:fe,left:he,width:Lt,height:It}=T.value,ze=[{top:`${fe}px`,left:`${he}px`,width:`${Lt}px`,height:`${It}px`,opacity:0},{top:`${D}px`,left:`${$}px`,width:`${b*A}px`,height:`${k*A}px`,opacity:1}];return{frames:f==="open"?ze:ze.reverse()}}function j(){const{centerX:f,centerY:b,originalHeight:k,originalWidth:A,scale:$}=ne(),D={top:`${b}px`,left:`${f}px`,width:`${A*$}px`,height:`${k*$}px`};if(!z.value)throw console.error("[maz-ui](vFullscreenImg) ImgElement is not defined");Object.assign(z.value.style,D)}function me(){const{frames:f}=q({trigger:"open"}),b=K(f);if(!b)throw console.error("[maz-ui](vFullscreenImg) open animation is not defined");b.onfinish=()=>{j()}}function v(){const{frames:f}=q({trigger:"close"}),b=K(f);if(!b)throw console.error("[maz-ui](vFullscreenImg) close animation is not defined");b.onfinish=()=>{var k,A;s("close"),(k=y.value)==null||k.remove(),(A=t.destroy)==null||A.call(t)}}function C(){p.value||j()}return n.onMounted(()=>{u.value=!0,document.addEventListener("keydown",E),window.addEventListener("resize",C),V(),h.value=M().length>1}),n.onBeforeUnmount(()=>{document.removeEventListener("keydown",E),window.removeEventListener("resize",C),B()}),(f,b)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"FullscreenImgElement",ref:y,role:"button",class:"m-fullscreen-img",tabindex:"0",onClick:n.withModifiers(O,["stop"]),onKeypress:n.withKeys(n.withModifiers(O,["prevent"]),["esc"])},[n.withDirectives(n.createVNode(n.unref(r),{class:"m-fullscreen-img-loader maz-h-16"},null,512),[[n.vShow,u.value]]),c.value&&h.value?(n.openBlock(),n.createElementBlock("button",{key:0,type:"button",class:"m-fullscreen-btn --next",onClick:b[0]||(b[0]=n.withModifiers(k=>R("next"),["stop"]))},[n.createVNode(n.unref(a),{class:"maz-rotate-180 maz-text-3xl"})])):n.createCommentVNode("v-if",!0),c.value&&h.value?(n.openBlock(),n.createElementBlock("button",{key:1,type:"button",class:"m-fullscreen-btn --previous",onClick:b[1]||(b[1]=n.withModifiers(k=>R("previous"),["stop"]))},[n.createVNode(n.unref(a),{class:"maz-text-3xl"})])):n.createCommentVNode("v-if",!0),n.createElementVNode("button",{type:"button",class:"m-fullscreen-btn --close",onClick:O},[n.createVNode(n.unref(i),{class:"maz-text-3xl"})]),n.createElementVNode("div",Co,[n.createCommentVNode(" eslint-disable-next-line vuejs-accessibility/no-static-element-interactions, vuejs-accessibility/click-events-have-key-events "),n.createElementVNode("img",{ref_key:"ImgElement",ref:z,src:L.value,alt:d.value??void 0,tabindex:"0",class:n.normalizeClass([g.value]),onLoad:I,onClick:b[2]||(b[2]=n.withModifiers(k=>f.zoom?de():void 0,["stop"]))},null,42,zo)])],40,To))}}),ue=(o,e)=>{const t=o.__vccOpts||o;for(const[s,r]of e)t[s]=r;return t},Lo=ue(ko,[["__scopeId","data-v-42226ee7"]]),Ae="m-fullscreen-is-open";class Io{constructor(){m(this,"options");m(this,"defaultOptions",{scaleOnHover:!1,blurOnHover:!1,disabled:!1,zoom:!0,offset:80,animation:{duration:300,easing:"ease-in-out"}});m(this,"mouseEnterListener");m(this,"mouseLeaveListener");m(this,"renderPreviewListener")}buildOptions(e,t){const s=typeof t.value=="object"?t.value:{src:t.value,alt:void 0},r=(s==null?void 0:s.src)??this.getImgSrc(e),i=(s==null?void 0:s.alt)??this.getImgAlt(e);return{...this.defaultOptions,...s,src:r,alt:i}}get allInstances(){return[...document.querySelectorAll(".m-fullscreen-img-instance")]}getImgSrc(e){var s;const t=((s=this.options)==null?void 0:s.src)||e.getAttribute("src")||e.getAttribute("data-src");if(!t)throw new Error('[maz-ui](fullscreen-img) src of image must be provided by `v-fullscreen=""`, `v-fullscreen="{ src: "" }"`, `src=""` or `data-src=""` atributes');return t}getImgAlt(e){var t;return((t=this.options)==null?void 0:t.alt)||e.getAttribute("alt")||e.getAttribute("data-alt")}create(e,t){if(this.options=this.buildOptions(e,t),this.options.disabled)return;e.style.cursor="move",(this.options.scaleOnHover||this.options.blurOnHover)&&(e.style.transition="all 200ms ease-in-out"),e.classList.add("m-fullscreen-img-instance"),e.setAttribute("data-src",this.getImgSrc(e));const s=this.getImgAlt(e);s&&e.setAttribute("data-alt",s),this.mouseEnterListener=()=>this.mouseEnter(e),this.mouseLeaveListener=()=>this.mouseLeave(e),this.renderPreviewListener=()=>this.renderPreview(e),e.addEventListener("mouseenter",this.mouseEnterListener),e.addEventListener("mouseleave",this.mouseLeaveListener),e.addEventListener("click",this.renderPreviewListener)}update(e,t){this.options=this.buildOptions(e,t)}remove(e){e.removeEventListener("mouseenter",this.mouseEnterListener),e.removeEventListener("mouseleave",this.mouseLeaveListener),e.removeEventListener("click",this.renderPreviewListener),e.classList.remove("m-fullscreen-img-instance"),e.style.cursor=""}renderPreview(e){return e.classList.add(Ae),ce(Lo,{props:{...this.options,openInstanceClass:Ae,clickedElement:e,clickedElementBounds:e.getBoundingClientRect()},addDestroyInProps:!0})}mouseLeave(e){this.options.scaleOnHover&&(e.style.transform=""),this.options.blurOnHover&&(e.style.filter=""),e.style.zIndex=""}mouseEnter(e){e.style.zIndex="1",this.options.scaleOnHover&&(e.style.transform="scale(1.04)"),this.options.blurOnHover&&(e.style.filter="blur(3px)")}}let re;const at={mounted(o,e){return re=new Io,re.create(o,e)},updated(o,e){return re.update(o,e)},unmounted(o){return re.remove(o)}},lt={install(o){o.directive("fullscreen-img",at)}},Ao="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Ee={baseClass:"m-lazy-img",loadedClass:"m-lazy-loaded",loadingClass:"m-lazy-loading",errorClass:"m-lazy-error",noPhotoClass:"m-lazy-no-photo",noPhoto:!1,observerOnce:!0,loadOnce:!1,noUseErrorPhoto:!1,observerOptions:{threshold:.1}};class ct{constructor(e={}){m(this,"observers",[]);m(this,"defaultOptions",Ee);m(this,"options");m(this,"onImgLoadedCallback");m(this,"onImgErrorCallback");m(this,"hasImgLoaded",!1);this.options=this.buildOptions(e),this.onImgLoadedCallback=this.imageIsLoaded.bind(this),this.onImgErrorCallback=this.imageHasError.bind(this)}async loadErrorPhoto(){const{default:e}=await Promise.resolve().then(()=>require("./no-photography-CLNgmzDi.cjs"));return e}buildOptions(e){return{...this.defaultOptions,...e,observerOptions:{...this.defaultOptions.observerOptions,...e.observerOptions}}}removeClass(e,t){e.classList.remove(t)}addClass(e,t){e.classList.add(t)}removeAllStateClasses(e){this.removeClass(e,this.options.loadedClass),this.removeClass(e,this.options.loadingClass),this.removeClass(e,this.options.errorClass),this.removeClass(e,this.options.noPhotoClass)}setBaseClass(e){this.addClass(e,this.options.baseClass)}imageIsLoading(e){var t,s;this.addClass(e,this.options.loadingClass),(s=(t=this.options).onLoading)==null||s.call(t,e)}imageHasNoPhoto(e){this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.noPhotoClass),this.setDefaultPhoto(e)}imageIsLoaded(e){var t,s;this.hasImgLoaded=!0,this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.loadedClass),(s=(t=this.options).onLoaded)==null||s.call(t,e)}imageHasError(e){var t,s;this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.errorClass),(s=(t=this.options).onError)==null||s.call(t,e),this.setDefaultPhoto(e)}getSrc(e){return typeof e.value=="object"?e.value.src:e.value}getImageUrl(e,t){const s=this.getImgElement(e).getAttribute("data-lazy-src");return s||this.getSrc(t)}async setPictureSourceUrls(e){const t=e.querySelectorAll("source");if(t.length>0)for await(const s of t){const r=s.getAttribute("data-lazy-srcset");if(r)s.srcset=r;else return this.imageHasError(e)}else this.imageHasError(e)}hasBgImgMode(e){return e.arg==="bg-image"}isPictureElement(e){return e instanceof HTMLPictureElement}getImgElement(e){return this.isPictureElement(e)?e.querySelector("img"):e}async setDefaultPhoto(e){if(this.options.noUseErrorPhoto)return;const t=this.options.fallbackSrc??this.options.errorPhoto;typeof t=="string"&&this.addClass(e,this.options.noPhotoClass);const s=t??await this.loadErrorPhoto(),r=e.querySelectorAll("source");if(r.length>0)for await(const i of r)i.srcset=s;else this.setImgSrc(e,s)}addEventListenerToImg(e){const t=this.getImgElement(e);t.addEventListener("load",()=>this.onImgLoadedCallback(e),{once:!0}),t.addEventListener("error",s=>this.onImgErrorCallback(e,s),{once:!0})}async loadImage(e,t){if(this.imageIsLoading(e),this.isPictureElement(e))this.addEventListenerToImg(e),await this.setPictureSourceUrls(e);else{const s=this.getImageUrl(e,t);if(!s)return this.imageHasError(e);this.hasBgImgMode(t)?(e.style.backgroundImage=`url('${s}')`,this.imageIsLoaded(e)):(this.addEventListenerToImg(e),this.setImgSrc(e,s))}}setImgSrc(e,t){const s=this.getImgElement(e);s.src=t}handleIntersectionObserver(e,t,s,r){var i,a;this.observers.push(r);for(const l of s)if(l.isIntersecting){if((a=(i=this.options).onIntersecting)==null||a.call(i,l.target),this.options.observerOnce&&r.unobserve(e),this.options.loadOnce&&this.hasImgLoaded)return;this.loadImage(e,t)}}createObserver(e,t){const s=(a,l)=>{this.handleIntersectionObserver(e,t,a,l)},r=this.options.observerOptions;new IntersectionObserver(s,r).observe(e)}async imageHandler(e,t,s){if(s==="update")for await(const r of this.observers)r.unobserve(e);window.IntersectionObserver?this.createObserver(e,t):this.loadImage(e,t)}async bindUpdateHandler(e,t,s){if(this.options.noPhoto)return this.imageHasNoPhoto(e);await this.imageHandler(e,t,s)}async add(e,t){if(this.hasBgImgMode(t)&&this.isPictureElement(e))throw new Error(`[MazLazyImg] You can't use the "bg-image" mode with "<picture />" element`);setTimeout(()=>this.setBaseClass(e),0),e.getAttribute("src")||this.setImgSrc(e,Ao),await this.bindUpdateHandler(e,t,"bind")}async update(e,t){t.value!==t.oldValue&&(this.hasImgLoaded=!1,this.removeAllStateClasses(e),await this.bindUpdateHandler(e,t,"update"))}remove(e,t){this.hasImgLoaded=!1,this.hasBgImgMode(t)&&(e.style.backgroundImage=""),this.removeAllStateClasses(e);for(const s of this.observers)s.unobserve(e);this.observers=[]}}let ie;const So={created(o,e){const t=typeof e.value=="object"?e.value:{};ie=new ct(t),ie.add(o,e)},updated(o,e){ie.update(o,e)},unmounted(o,e){ie.remove(o,e)}},ut={install(o,e={}){const t={...Ee,...e,observerOptions:{...Ee.observerOptions,...e.observerOptions}},s=new ct(t);o.directive("lazy-img",{created:s.add.bind(s),updated:s.update.bind(s),unmounted:s.remove.bind(s)})}},xo=`
2
- .maz-zoom-img {
3
- position: fixed;
4
- top: 0;
5
- bottom: 0;
6
- left: 0;
7
- right: 0;
8
- padding: 1rem;
9
- z-index: 1050;
10
- background-color: hsla(238, 15%, 40%, 0.7);
11
- display: flex;
12
- align-items: center;
13
- justify-content: center;
14
- flex-direction: column;
15
- }
16
-
17
- .maz-zoom-img,
18
- .maz-zoom-img * {
19
- box-sizing: border-box;
20
- }
21
-
22
- .maz-zoom-img .maz-zoom-img__wrapper {
23
- position: relative;
24
- display: flex;
25
- justify-content: center;
26
- align-items: center;
27
- min-width: 0;
28
- min-height: 0;
29
- max-width: 100%;
30
- max-height: 100%;
31
- transition: all 300ms ease-in-out;
32
- opacity: 0;
33
- transform: scale(0.5);
34
- }
35
-
36
- .maz-zoom-img.maz-animate .maz-zoom-img__wrapper {
37
- opacity: 1;
38
- transform: scale(1);
39
- }
40
-
41
- .maz-zoom-img.maz-animate .maz-zoom-img__loader {
42
- position: absolute;
43
- top: 0;
44
- bottom: 0;
45
- left: 0;
46
- right: 0;
47
- display: flex;
48
- align-items: center;
49
- justify-content: center;
50
- background-color: hsla(238, 15%, 40%, 0.7);
51
- border-radius: 1rem;
52
- z-index: 2;
53
- min-width: 60px;
54
- min-height: 60px;
55
- }
56
- .maz-zoom-img.maz-animate .maz-zoom-img__loader[hidden] {
57
- display: none;
58
- }
59
-
60
- @-webkit-keyframes spin {
61
- 0% { transform: rotate(0deg); }
62
- 100% { transform: rotate(360deg); }
63
- }
64
-
65
- @keyframes spin {
66
- 0% { transform: rotate(0deg); }
67
- 100% { transform: rotate(360deg); }
68
- }
69
-
70
- .maz-zoom-img.maz-animate .maz-zoom-img__loader__svg {
71
- animation: spin .6s linear infinite;
72
- }
73
-
74
- .maz-zoom-img img {
75
- max-width: 100%;
76
- max-height: 100%;
77
- min-width: 0;
78
- border-radius: 1rem;
79
- }
80
-
81
- .maz-zoom-img .maz-zoom-btn {
82
- margin: 0 auto;
83
- border: none;
84
- background-color: hsla(0, 0%, 7%, 0.5);
85
- box-shadow: 0 0 0.5rem 0 hsla(0, 0%, 0%, 0.2);
86
- height: 2.2rem;
87
- min-height: 2.2rem;
88
- width: 2.2rem;
89
- min-width: 2.2rem;
90
- display: flex;
91
- align-items: center;
92
- justify-content: center;
93
- border-radius: 2.2rem;
94
- cursor: pointer;
95
- flex: 0 0 auto;
96
- outline: none;
97
- }
98
-
99
- .maz-zoom-img .maz-zoom-btn svg {
100
- fill: white;
101
- }
102
-
103
- .maz-zoom-img .maz-zoom-btn.maz-zoom-btn--close {
104
- position: absolute;
105
- top: 0.5rem;
106
- right: 0.5rem;
107
- z-index: 1;
108
- }
109
-
110
- .maz-zoom-img .maz-zoom-btn.maz-zoom-btn--previous {
111
- position: absolute;
112
- left: 0.5rem;
113
- z-index: 1;
114
- }
115
-
116
- .maz-zoom-img .maz-zoom-btn.maz-zoom-btn--next {
117
- position: absolute;
118
- right: 0.5rem;
119
- z-index: 1;
120
- }
121
-
122
- .maz-zoom-img .maz-zoom-btn:hover {
123
- background-color: hsl(0, 0%, 0%);
124
- }`,Se={close:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>',next:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>',previous:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></svg>',spinner:'<svg width="40px" height="40px" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor" x="0px" y="0px" viewBox="0 0 50 50" xml:space="preserve" class="maz-zoom-img__loader__svg" data-v-6d1cb50c=""><path d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z"></path></svg>'};class Vo{constructor(e){m(this,"options");m(this,"loader");m(this,"wrapper");m(this,"img");m(this,"keydownHandler");m(this,"onImgLoadedCallback");m(this,"buttonsAdded");m(this,"defaultOptions",{scale:!0,blur:!0,disabled:!1});m(this,"mouseEnterListener");m(this,"mouseLeaveListener");m(this,"renderPreviewListener");if(!e.value)throw new Error('[MazUI](zoom-img) Image path must be defined. Ex: `v-zoom-img="<PATH_TO_IMAGE>"`');if(typeof e.value=="object"&&!e.value.src)throw new Error("[maz-ui](zoom-img) src of image must be provided");this.buttonsAdded=!1,this.options=this.buildOptions(e),this.keydownHandler=this.keydownLister.bind(this),this.loader=this.getLoader(),this.wrapper=document.createElement("div"),this.wrapper.classList.add("maz-zoom-img__wrapper"),this.wrapper.prepend(this.loader),this.img=document.createElement("img"),this.onImgLoadedCallback=this.onImgLoaded.bind(this),this.imgEventHandler(!0)}buildOptions(e){return{...this.defaultOptions,...typeof e.value=="object"?e.value:{src:e.value}}}get allInstances(){return[...document.querySelectorAll(".maz-zoom-img-instance")]}create(e){this.options.disabled||(e.style.cursor="pointer",setTimeout(()=>e.classList.add("maz-zoom-img-instance")),e.setAttribute("data-zoom-src",this.options.src),this.options.alt&&e.setAttribute("data-zoom-alt",this.options.alt),e.style.transition="all 300ms ease-in-out",this.mouseEnterListener=()=>this.mouseEnter(e),this.mouseLeaveListener=()=>this.mouseLeave(e),this.renderPreviewListener=()=>this.renderPreview(e,this.options),e.addEventListener("mouseenter",this.mouseEnterListener),e.addEventListener("mouseleave",this.mouseLeaveListener),e.addEventListener("click",this.renderPreviewListener))}update(e){this.options=this.buildOptions(e)}remove(e){this.imgEventHandler(!1),e.removeEventListener("mouseenter",this.mouseEnterListener),e.removeEventListener("mouseleave",this.mouseLeaveListener),e.removeEventListener("click",this.renderPreviewListener),e.classList.remove("maz-zoom-img-instance"),e.removeAttribute("data-zoom-src"),e.removeAttribute("data-zoom-alt"),e.style.cursor=""}renderPreview(e,t){e.classList.add("maz-is-open"),this.addStyle(xo);const s=document.createElement("div");s.classList.add("maz-zoom-img"),s.setAttribute("id","MazImgPreviewFullsize"),s.addEventListener("click",r=>{s.isEqualNode(r.target)&&this.closePreview()}),typeof t=="object"&&(this.img.setAttribute("src",t.src),t.alt&&this.img.setAttribute("alt",t.alt),this.img.id="MazImgElement"),this.wrapper.append(this.img),s.append(this.wrapper),document.body.append(s),this.keyboardEventHandler(!0),setTimeout(()=>{s&&s.classList.add("maz-animate")},100)}onImgLoaded(){this.wrapper.style.width=`${this.img.width}px`,this.wrapper.style.minWidth="200px",this.loader.hidden=!0;const e=this.getButton(),t=[],s=this.allInstances.length>1;if(!this.buttonsAdded){if(this.buttonsAdded=!0,s){const r=this.getButton("previous"),i=this.getButton("next");t.push(r,i)}this.wrapper.append(e),s&&(this.wrapper.prepend(t[0]),this.wrapper.append(t[1]))}}getLoader(){const e=document.createElement("div");return e.classList.add("maz-zoom-img__loader"),e.innerHTML=Se.spinner,e}mouseLeave(e){this.options.scale&&(e.style.transform=""),this.options.blur&&(e.style.filter=""),e.style.zIndex=""}mouseEnter(e){e.style.zIndex="1",this.options.scale&&(e.style.transform="scale(1.1)"),this.options.blur&&(e.style.filter="blur(2px)")}keydownLister(e){e.preventDefault(),(e.key==="Escape"||e.key===" ")&&this.closePreview(),(e.key==="ArrowLeft"||e.key==="ArrowRight")&&this.nextPreviousImage(e.key==="ArrowRight")}getButton(e="close"){const t=document.createElement("button");t.innerHTML=Se[e];const s=e==="close"?this.closePreview():this.allInstances?this.nextPreviousImage(e==="next"):null;return t.addEventListener("click",()=>s),t.classList.add("maz-zoom-btn"),t.classList.add(`maz-zoom-btn--${e}`),t}closePreview(){const e=document.querySelector("#MazImgPreviewFullsize"),t=document.querySelector("#MazPreviewStyle"),s=document.querySelector(".maz-zoom-img-instance.maz-is-open");s&&s.classList.remove("maz-is-open"),e&&e.classList.remove("maz-animate"),this.keyboardEventHandler(!1),setTimeout(()=>{e&&e.remove(),t&&t.remove()},300)}getNewInstanceIndex(e){return e<0?this.allInstances.length-1:e>=this.allInstances.length?0:e}nextPreviousImage(e){const t=e,s=document.querySelector(".maz-zoom-img-instance.maz-is-open");if(s){const r=this.allInstances.indexOf(s),i=t?r+1:r-1,a=this.allInstances[this.getNewInstanceIndex(i)];a&&this.useNextInstance(s,a)}}useNextInstance(e,t){e.classList.remove("maz-is-open"),t.classList.add("maz-is-open");const s=t.getAttribute("data-zoom-src"),r=t.getAttribute("data-zoom-alt");this.wrapper.style.width="",this.loader.hidden=!1,s&&this.img.setAttribute("src",s),r&&this.img.setAttribute("alt",r)}addStyle(e){const t=document.createElement("style");t.id="MazPreviewStyle",t.textContent=e,document.head.append(t)}keyboardEventHandler(e){if(e)return document.addEventListener("keydown",this.keydownHandler);document.removeEventListener("keydown",this.keydownHandler)}imgEventHandler(e){if(e)return this.img.addEventListener("load",this.onImgLoadedCallback);this.img.removeEventListener("load",this.onImgLoadedCallback)}}let ae;const dt={created(o,e){ae=new Vo(e),ae.create(o)},updated(o,e){ae.update(e)},unmounted(o){ae.remove(o)}},mt={install(o){o.directive("zoom-img",dt)}},Oo=[st,mt,ut,et,lt,it],Do={install(o){for(const e of Oo)e.install(o,{})}};function ft(o){return o?(o=o.toString(),o.charAt(0).toUpperCase()+o.slice(1)):""}const Bo={style:"currency",minimumFractionDigits:2,round:!1};function $o(o,e,t){let s=Number(o);return t.round&&(s=Math.floor(s),t.minimumFractionDigits=0),new Intl.NumberFormat(e,t).format(s)}function Po(o,e,t){if(o===void 0)throw new TypeError("[maz-ui](FilterCurrency) The `number` attribute is required.");if(e===void 0)throw new TypeError("[maz-ui](FilterCurrency) The `locale` attribute is required.");if(typeof e!="string")throw new TypeError("[maz-ui](FilterCurrency) The `locale` attribute must be a string.");if(t.currency===void 0)throw new TypeError("[maz-ui](FilterCurrency) The `options.currency` attribute is required.")}function ht(o,e,t){const s={...Bo,...t};Po(o,e,s);try{return $o(o,e,s)}catch(r){throw new Error(`[maz-ui](FilterCurrency) ${r}`)}}const Mo={month:"short",day:"numeric",year:"numeric"};function vt(o,e,t){if(e===void 0)throw new TypeError("[maz-ui](FilterDate) The `locale` attribute is required.");if(typeof e!="string")throw new TypeError("[maz-ui](FilterDate) The `locale` attribute must be a string.");const s=t??Mo;try{const r=o instanceof Date?o:new Date(o);return new Intl.DateTimeFormat(e,s).format(r)}catch(r){throw new Error(`[maz-ui](FilterDate) ${r}`)}}const No={minimumFractionDigits:2};function pt(o,e,t){const s={...No,...t};if(o===void 0)throw new TypeError("[maz-ui](FilterNumber) The `number` attribute is required.");if(e===void 0)throw new TypeError("[maz-ui](FilterNumber) The `locale` attribute is required.");if(typeof e!="string")throw new TypeError("[maz-ui](FilterNumber) The `locale` attribute must be a string.");try{return new Intl.NumberFormat(e,s).format(Number(o))}catch(r){throw new Error(`[maz-ui](FilterNumber) ${r}`)}}const Ho={capitalize:ft,currency:ht,date:vt,number:pt},Fo={install(o){o.provide("filters",Ho)}};function gt(o){return!!o}function qo(o){return[...o].map(e=>{const t=e.codePointAt(0);return t?t%32+127461:void 0}).filter(gt).map(e=>String.fromCodePoint(e)).join("")}function jo(o,e){let t;return function(...s){clearTimeout(t),t=setTimeout(()=>{o.apply(this,s)},e)}}class _o{constructor({src:e,identifier:t,once:s=!0,async:r=!0,defer:i=!0}){m(this,"src");m(this,"script");m(this,"once");m(this,"async");m(this,"defer");m(this,"identifier");if(typeof window>"u")throw new TypeError("[ScriptLoader]: Is supported only on browser side");if(!e)throw new Error('[ScriptLoader]: You should provide the attribut "src"');if(!t)throw new Error('[ScriptLoader]: You should provide the attribut "identifier"');this.src=e,this.identifier=t,this.once=s,this.async=r,this.defer=i}removeTag(e){var t;typeof e=="string"?(t=document.head.querySelector(`[data-identifier="${e}"]`))==null||t.remove():e.remove()}load(){const e=window,t=document.head.querySelectorAll(`[data-identifier="${this.identifier}"]`);if(this.once&&e[this.identifier]&&t.length>0)return this.script=e[this.identifier],Promise.resolve(this.script);if(!this.once&&t.length>0)for(const s of t)this.removeTag(s);return this.injectScript()}injectScript(){const e=window;return new Promise((t,s)=>{try{const r=document.createElement("script");r.src=this.src,r.async=this.async,r.defer=this.defer,r.dataset.identifier=this.identifier,r.addEventListener("error",i=>s(new Error(`[ScriptLoader](injectScript) ${i.message}`))),r.addEventListener("load",i=>(this.script=i,e[this.identifier]=i,t(i))),document.head.append(r)}catch(r){throw new Error(`[ScriptLoader](init) ${r}`)}})}}function yt(o){return new Promise(e=>setTimeout(e,o))}function Uo(o,e){let t=!1,s,r;return function(...i){t?(clearTimeout(s),s=setTimeout(()=>{Date.now()-r>=e&&(o.apply(this,i),r=Date.now())},Math.max(e-(Date.now()-r),0))):(o.apply(this,i),r=Date.now(),t=!0)}}const ge={delay:100,observer:{root:void 0,rootMargin:"0px",threshold:.2},animation:{once:!0,duration:300,delay:0}};class bt{constructor(e){m(this,"options");this.options={delay:(e==null?void 0:e.delay)??ge.delay,observer:{...ge.observer,...e==null?void 0:e.observer},animation:{...ge.animation,...e==null?void 0:e.animation}}}handleIntersect(e,t){for(const s of e){const i=s.target.getAttribute("data-maz-aos-children")==="true",a=s.target.getAttribute("data-maz-aos")?[s.target]:[];if(i){const l=[...document.querySelectorAll("[data-maz-aos-anchor]")].map(u=>u.getAttribute("data-maz-aos-anchor")===`#${s.target.id}`?u:void 0);for(const u of l)u&&a.push(u)}for(const l of a){const u=l.getAttribute("data-maz-aos-once"),c=typeof u=="string"?u==="true":this.options.animation.once;if(typeof this.options.observer.threshold=="number"&&s.intersectionRatio>this.options.observer.threshold){const h=l.getAttribute("data-maz-aos-duration"),p=l.getAttribute("data-maz-aos-delay");if(h||(l.style.transitionDuration=`${this.options.animation.duration}ms`,setTimeout(()=>{l.style.transitionDuration="0"},1e3)),p||(l.style.transitionDelay=`${this.options.animation.delay}ms`,setTimeout(()=>{l.style.transitionDelay="0"},1e3)),l.classList.add("maz-aos-animate"),c){const w=l.getAttribute("data-maz-aos-anchor");if(w){const T=document.querySelector(w);T&&t.unobserve(T)}t.unobserve(l)}}else l.classList.remove("maz-aos-animate")}}}async handleObserver(){await yt(this.options.delay);const e=new IntersectionObserver(this.handleIntersect.bind(this),this.options.observer);for(const t of document.querySelectorAll("[data-maz-aos]")){const s=t.getAttribute("data-maz-aos-anchor");if(s){const r=document.querySelector(s);r?(r.setAttribute("data-maz-aos-children","true"),e.observe(r)):console.warn(`[maz-ui](aos) no element found with selector "${s}"`)}else e.observe(t)}}runAnimations(){if(x())return this.handleObserver();console.warn("[MazAos](runAnimations) should be executed on client side")}}let Y;const Wo={install:(o,e)=>{Y=new bt(e),o.provide("aos",Y),x()&&(e!=null&&e.router?e.router.afterEach(async()=>{Y.runAnimations()}):Y.runAnimations())}};function Ro(){return Y}const xe="--backdrop-present",Ko=n.defineComponent({inheritAttrs:!1,__name:"MazBackdrop",props:{modelValue:{type:Boolean,default:!1},teleportSelector:{default:"body"},beforeClose:{type:Function,default:void 0},persistent:{type:Boolean,default:!1},noCloseOnEscKey:{type:Boolean,default:!1},transitionName:{default:"backdrop-anim"},backdropClass:{default:void 0},backdropContentClass:{default:void 0}},emits:["open","close","update:model-value","before-close"],setup(o,{expose:e,emit:t}){const s=o,r=t;function i(){document.documentElement.classList.add(xe)}async function a(){document.querySelector(".m-backdrop.--present")||document.documentElement.classList.remove(xe)}const l=n.ref(s.modelValue);function u(){c(!1)}async function c(d){var y;d||(r("before-close"),await((y=s.beforeClose)==null?void 0:y.call(s))),l.value=d}function h(){r("open")}function p(){r("update:model-value",!1),r("close"),L()}function w(){s.persistent||u()}function T(d){!s.noCloseOnEscKey&&d.key==="Escape"&&!s.persistent&&u()}function S(){i(),document.addEventListener("keyup",T,!1)}function L(){document.removeEventListener("keyup",T),a()}return n.onMounted(()=>{s.modelValue?S():L()}),n.watch(()=>s.modelValue,d=>{l.value=d,d?S():L()}),e({onBackdropAnimationEnter:h,onBackdropAnimationLeave:p,onBackdropClicked:w,close:u,present:l,toggleModal:c,onKeyPress:T}),(d,y)=>(n.openBlock(),n.createBlock(n.Teleport,{to:d.teleportSelector},[n.createVNode(n.Transition,{appear:"",name:d.transitionName,onAfterEnter:h,onAfterLeave:p},{default:n.withCtx(()=>[l.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["m-backdrop --present",[d.backdropClass]]),tabindex:"-1",role:"dialog"},[n.createElementVNode("button",{class:n.normalizeClass(["m-backdrop-overlay",{"--disabled":d.persistent}]),tabindex:"-1",onClick:n.withModifiers(w,["self"])},null,2),n.createElementVNode("div",n.mergeProps({class:["m-backdrop-content",d.backdropContentClass]},d.$attrs,{role:"document",tabindex:"0"}),[n.renderSlot(d.$slots,"default",{close:u})],16)],2)):n.createCommentVNode("v-if",!0)]),_:3},8,["name"])],8,["to"]))}}),Yo={key:0,id:"dialogTitle",class:"maz-my-0 maz-text-xl maz-font-semibold"},Xo={id:"dialogDesc",class:"m-dialog-content"},Zo={key:0,class:"m-dialog-footer"},Go=n.defineComponent({__name:"MazDialog",props:{modelValue:{type:Boolean},title:{default:void 0},noClose:{type:Boolean,default:!1},width:{default:"500px"},maxWidth:{default:"95vw"},maxHeight:{default:"95vh"},scrollable:{type:Boolean,default:!1},persistent:{type:Boolean,default:!1},teleportSelector:{},beforeClose:{},noCloseOnEscKey:{type:Boolean},transitionName:{},backdropClass:{},backdropContentClass:{}},emits:["open","close","update:model-value"],setup(o,{expose:e}){const t=o,s=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./MazBtn-DeAZcD0R.cjs"))),r=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./x-mark-DW2WXkoF.cjs"))),i=n.useAttrs(),a=n.ref();e({close:()=>{var c,h;return(h=(c=a.value)==null?void 0:c.close)==null?void 0:h.call(c)}});const l=n.computed(()=>({...i,class:void 0,style:void 0})),u=n.computed(()=>({class:i.class,style:i.style}));return(c,h)=>(n.openBlock(),n.createBlock(Ko,n.mergeProps({...l.value,...t},{ref_key:"backdrop",ref:a,persistent:c.persistent,"model-value":c.modelValue,"transition-name":"modal-anim","aria-labelledby":"dialogTitle","aria-describedby":"dialogDesc",onClose:h[0]||(h[0]=p=>c.$emit("close",p)),onOpen:h[1]||(h[1]=p=>c.$emit("open",p)),"onUpdate:modelValue":h[2]||(h[2]=p=>c.$emit("update:model-value",p))}),{default:n.withCtx(({close:p})=>[n.createElementVNode("div",n.mergeProps({class:["m-dialog",{"--scrollable":c.scrollable}],role:"dialog","aria-modal":"true",style:[{width:c.width,maxWidth:c.maxWidth,maxHeight:c.maxHeight}]},u.value),[n.createCommentVNode(`
125
- @slot Header slot
126
- @binding {Function} close close function
127
- `),n.renderSlot(c.$slots,"header",{close:p},()=>[n.createElementVNode("div",{class:n.normalizeClass(["m-dialog-header",{"--has-title":c.$slots.title||c.title}])},[c.$slots.title||c.title?(n.openBlock(),n.createElementBlock("h2",Yo,[n.createCommentVNode(`
128
- @slot Title slot in the header
129
- `),n.renderSlot(c.$slots,"title",{},()=>[n.createTextVNode(n.toDisplayString(c.title),1)],!0)])):n.createCommentVNode("v-if",!0),!c.noClose&&!c.persistent?(n.openBlock(),n.createBlock(n.unref(s),{key:1,class:"m-dialog-closebtn",color:"transparent",onClick:p},{default:n.withCtx(()=>[n.createVNode(n.unref(r),{class:"maz-text-lg"})]),_:2},1032,["onClick"])):n.createCommentVNode("v-if",!0)],2)],!0),n.createElementVNode("div",Xo,[n.createCommentVNode(`
130
- @slot Default content
131
- @binding {Function} close close function
132
- `),n.renderSlot(c.$slots,"default",{close:p},void 0,!0)]),c.$slots.footer?(n.openBlock(),n.createElementBlock("div",Zo,[n.createCommentVNode(`
133
- @slot Footer slot
134
- @binding {Function} close close function
135
- `),n.renderSlot(c.$slots,"footer",{close:p},void 0,!0)])):n.createCommentVNode("v-if",!0)],16)]),_:3},16,["persistent","model-value"]))}}),Qo=ue(Go,[["__scopeId","data-v-948f8cae"]]),_={cancelText:"Cancel",confirmText:"Confirm",cancelButton:{text:"Cancel",color:"danger"},confirmButton:{text:"Confirm",color:"success"}},Jo=n.ref(_),U=n.ref([]);function en(o,e){return new Promise((t,s)=>{U.value=[...U.value,{id:o,isActive:!0,resolve:async r=>{t(r),await(e==null?void 0:e())},reject:async r=>{s(r),await(e==null?void 0:e())}}]})}function wt(o){return U.value=U.value.filter(({id:e})=>e!==o),U.value}function Ve(o,e,t){var s;e&&((s=e[o])==null||s.call(e,t),e.isActive=!1,setTimeout(()=>{wt(e.id)},500))}function Et(){return{data:Jo,dialogState:U,showDialogAndWaitChoice:en,removeDialogFromState:wt,rejectDialog:async(o,e="cancel",t)=>(await(t==null?void 0:t()),Ve("reject",o,e)),resolveDialog:async(o,e="accept",t)=>(await(t==null?void 0:t()),Ve("resolve",o,e))}}const tn={class:"maz-flex maz-items-center maz-gap-2"},on=n.defineComponent({__name:"MazDialogPromise",props:{data:{default:void 0},message:{},identifier:{},buttons:{default:void 0},modelValue:{type:Boolean},title:{},noClose:{type:Boolean},width:{},maxWidth:{},maxHeight:{},scrollable:{type:Boolean},persistent:{type:Boolean},teleportSelector:{},beforeClose:{},noCloseOnEscKey:{type:Boolean},transitionName:{},backdropClass:{},backdropContentClass:{},cancelText:{},cancelButton:{type:[Boolean,Object]},confirmText:{},confirmButton:{type:[Boolean,Object]}},emits:["open","close"],setup(o,{expose:e}){const t=o,s=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./MazBtn-DeAZcD0R.cjs"))),{dialogState:r,rejectDialog:i,resolveDialog:a,data:l}=Et(),u=n.computed(()=>{var d;return t.buttons??((d=t.data)==null?void 0:d.buttons)??l.value.buttons}),c=n.computed(()=>{var y,z,g,I;if(((y=l.value)==null?void 0:y.cancelButton)??((z=t.data)==null?void 0:z.cancelButton)??_.cancelButton)return{..._.cancelButton,...(g=l.value)==null?void 0:g.cancelButton,...(I=t.data)==null?void 0:I.cancelButton}}),h=n.computed(()=>{var y,z,g,I;if(((y=l.value)==null?void 0:y.confirmButton)??((z=t.data)==null?void 0:z.confirmButton)??_.confirmButton)return{..._.confirmButton,...(g=l.value)==null?void 0:g.confirmButton,...(I=t.data)==null?void 0:I.confirmButton}}),p=n.computed(()=>({..._,...l.value,...t.data})),w=n.computed(()=>r.value.find(({id:d})=>d===t.identifier)),T=n.ref();e({close:()=>{var d,y;return(y=(d=T.value)==null?void 0:d.close)==null?void 0:y.call(d)}});function S(d){return"type"in d&&(d.type==="resolve"||d.type==="reject")}function L(d,y){return S(y)?y.type==="resolve"?a(d,y.response):i(d,y.response):a(d,void 0,y.action)}return(d,y)=>{var z;return n.openBlock(),n.createBlock(Qo,n.mergeProps({ref_key:"dialog",ref:T},{...d.$attrs,...t},{"model-value":((z=w.value)==null?void 0:z.isActive)??d.modelValue??!1,onClose:y[2]||(y[2]=g=>d.$emit("close",g)),onOpen:y[3]||(y[3]=g=>d.$emit("open",g)),"onUpdate:modelValue":y[4]||(y[4]=g=>n.unref(i)(w.value))}),{title:n.withCtx(()=>[n.createCommentVNode(`
136
- @slot title slot - Place your title
137
- `),n.renderSlot(d.$slots,"title",{},()=>{var g;return[n.createTextVNode(n.toDisplayString(d.title||((g=p.value)==null?void 0:g.title)),1)]})]),default:n.withCtx(()=>[n.createCommentVNode(`
138
- @slot Default slot - Place your content
139
- @binding {Function} resolve resolve function
140
- @binding {Function} reject reject function
141
- `),n.renderSlot(d.$slots,"default",{resolve:g=>n.unref(a)(w.value,g),reject:g=>n.unref(i)(w.value,g)},()=>{var g;return[n.createTextVNode(n.toDisplayString(d.message||((g=p.value)==null?void 0:g.message)),1)]})]),footer:n.withCtx(()=>[n.createCommentVNode(`
142
- @slot Footer slot
143
- @binding {Function} resolve resolve function
144
- @binding {Function} reject reject function
145
- `),n.renderSlot(d.$slots,"footer-button",{resolve:g=>n.unref(a)(w.value,g),reject:g=>n.unref(i)(w.value,g)},()=>[n.createElementVNode("div",tn,[u.value?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(u.value,(g,I)=>(n.openBlock(),n.createBlock(n.unref(s),n.mergeProps({key:I,ref_for:!0},{...g,type:"button"},{onClick:O=>L(w.value,g)}),{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(g.text),1)]),_:2},1040,["onClick"]))),128)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[c.value?(n.openBlock(),n.createBlock(n.unref(s),n.mergeProps({key:0},c.value,{onClick:y[0]||(y[0]=g=>n.unref(i)(w.value))}),{default:n.withCtx(()=>[n.createCommentVNode(`
146
- @slot cancel-text slot - Place your cancel text
147
- `),n.renderSlot(d.$slots,"cancel-text",{},()=>{var g;return[n.createTextVNode(n.toDisplayString(c.value.text||((g=p.value)==null?void 0:g.cancelText)),1)]})]),_:3},16)):n.createCommentVNode("v-if",!0),h.value?(n.openBlock(),n.createBlock(n.unref(s),n.mergeProps({key:1},h.value,{onClick:y[1]||(y[1]=g=>n.unref(a)(w.value))}),{default:n.withCtx(()=>[n.createCommentVNode(`
148
- @slot confirm-text slot - Place your confirm text
149
- `),n.renderSlot(d.$slots,"confirm-text",{},()=>[n.createTextVNode(n.toDisplayString(h.value.text||p.value.confirmText),1)])]),_:3},16)):n.createCommentVNode("v-if",!0)],64))])])]),_:3},16,["model-value"])}}}),Oe={identifier:"main-dialog"};class Tt{constructor(e,t=Oe){this.app=e,this.globalOptions=t}open(e){const t={...Oe,...this.globalOptions,...e},{destroy:s,vNode:r}=ce(on,{props:t,app:this.app}),{showDialogAndWaitChoice:i}=Et();function a(){var u,c,h;(c=(u=r.component)==null?void 0:u.exposed)==null||c.close(),(h=t.promiseCallback)==null||h.call(t),setTimeout(()=>{s()},700)}return{promise:i(t.identifier,()=>{a()}),destroy:s,close:a}}}const nn={install(o,e){o.provide("dialog",new Tt(o,e))}},sn={class:"m-toast__message-wrapper"},rn={class:"m-toast__message"},an={class:"maz-flex maz-items-center maz-gap-2"},ln={key:0},cn={key:4,class:"progress-bar maz-absolute maz-inset-x-0 maz-bottom-0 maz-h-1"},un=n.defineComponent({__name:"MazToast",props:{message:{default:void 0},position:{default:"bottom-right"},maxToasts:{type:[Number,Boolean],default:!1},timeout:{type:[Number,Boolean],default:1e4},queue:{type:Boolean},noPauseOnHover:{type:Boolean},type:{default:"info"},link:{default:void 0},action:{default:void 0},persistent:{type:Boolean},icon:{type:Boolean,default:!0}},emits:["close","click","open"],setup(o,{expose:e,emit:t}){const s=o,r=t,i=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./MazBtn-DeAZcD0R.cjs"))),a=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./x-mark-DW2WXkoF.cjs"))),l=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./arrow-top-right-on-square-PZtr8Zs0.cjs"))),u=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./exclamation-triangle-BtW3be9S.cjs"))),c=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./exclamation-circle-BXs0Yj0f.cjs"))),h=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./information-circle-89FseEuJ.cjs"))),p=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./check-circle-D3i-p-t3.cjs"))),w=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./link-CUxj8BQ5.cjs"))),T=n.ref(),S=n.computed(()=>{if(s.icon)switch(s.type){case"danger":return u;case"info":return h;case"success":return p;case"warning":return c;default:return}}),L=n.computed(()=>s.position.includes("top")?"top":"bottom"),d=n.computed(()=>s.position.includes("left")?"left":s.position.includes("right")?"right":"center"),y=n.computed(()=>d.value!=="center"?d.value==="right"?"m-slide-right":"m-slide-left":L.value==="top"?"m-slide-top":"m-slide-bottom"),z=n.ref(!1),g=n.ref(!1),I=n.ref(),O=`m-toast-container --${L.value} --${d.value}`,E=`.${O.replaceAll(" ",".")}`,V=Ye({callback:q,timeout:typeof s.timeout=="number"?s.timeout:0,callbackOffsetTime:200});function B(){const v=document.querySelector(E);if(!v&&!v){const C=document.body,f=document.createElement("div");f.className=O,C.append(f)}}function M(){const v=document.querySelector(E);return!s.queue&&s.maxToasts===!1?!1:typeof s.maxToasts=="number"&&v?s.maxToasts<=v.childElementCount:v&&v.childElementCount>0}function N(){if(M()){I.value=setTimeout(N,250);return}const v=document.querySelector(E);T.value&&v&&v.prepend(T.value),g.value=!0,typeof s.timeout=="number"&&s.timeout>0&&V.start()}const oe=n.ref("100%");function R(){switch(s.type){case"danger":return"maz-bg-danger-700";case"info":return"maz-bg-info-700";case"success":return"maz-bg-success-700";case"warning":return"maz-bg-warning-700";default:return"maz-bg-secondary"}}n.watch(V.remainingTime,v=>{if(typeof s.timeout=="number"){const C=100*v/s.timeout;oe.value=`${C}%`}});function F(v){r("click",v),s.persistent||q()}async function de(v,C){var f;z.value=!0,await v(),z.value=!1,(f=s.action)!=null&&f.closeToast&&F(C)}function K(v){s.noPauseOnHover||(v?V.pause():V.resume())}function ne(){V.stop(),I.value&&clearTimeout(I.value)}function q(){ne(),g.value=!1}e({closeToast:q});function j(){r("open")}function me(){var C;r("close"),(C=T.value)==null||C.remove();const v=document.querySelector(E);v&&!(v!=null&&v.hasChildNodes())&&v.remove()}return n.onMounted(()=>{B(),N()}),(v,C)=>(n.openBlock(),n.createBlock(n.Transition,{name:y.value,onAfterLeave:me,onAfterEnter:j,persisted:""},{default:n.withCtx(()=>[n.withDirectives(n.createElementVNode("button",{ref_key:"Toaster",ref:T,class:n.normalizeClass(["m-toast",[`--${v.type}`,`--${L.value}`,`--${d.value}`,{"maz-pb-1":typeof v.timeout=="number"&&v.timeout>0,"--persistent":v.persistent}]]),role:"alert",onMouseover:C[2]||(C[2]=f=>K(!0)),onMouseleave:C[3]||(C[3]=f=>K(!1)),onClick:C[4]||(C[4]=n.withModifiers(f=>{var b;return v.link&&!((b=v.link)!=null&&b.closeToast)?void 0:F(f)},["stop"]))},[S.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(S.value),{key:0,class:"maz-text-2xl"})):n.createCommentVNode("v-if",!0),n.createElementVNode("div",sn,[n.createElementVNode("p",rn,n.toDisplayString(v.message),1)]),v.action?(n.openBlock(),n.createBlock(n.unref(i),{key:1,"data-test":"action-btn",color:v.type,pastel:"",loading:z.value,size:"sm",onClick:C[0]||(C[0]=n.withModifiers(f=>v.action?de(v.action.func,f):void 0,["stop"]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(v.action.text),1)]),_:1},8,["color","loading"])):n.createCommentVNode("v-if",!0),v.link?(n.openBlock(),n.createBlock(n.unref(i),{key:2,"data-test":"link-btn",color:v.type,pastel:"",size:"xs",href:v.link.href,target:v.link.target??"_self"},{default:n.withCtx(()=>{var f;return[n.createElementVNode("div",an,[v.link.text?(n.openBlock(),n.createElementBlock("span",ln,n.toDisplayString(v.link.text),1)):n.createCommentVNode("v-if",!0),((f=v.link)==null?void 0:f.target)==="_blank"?(n.openBlock(),n.createBlock(n.unref(l),{key:1,class:"maz-text-xl"})):(n.openBlock(),n.createBlock(n.unref(w),{key:2,class:"maz-text-xl"}))])]}),_:1},8,["color","href","target"])):n.createCommentVNode("v-if",!0),v.persistent?n.createCommentVNode("v-if",!0):(n.openBlock(),n.createElementBlock("button",{key:3,class:"--close",onClick:C[1]||(C[1]=n.withModifiers(f=>F(f),["stop"]))},[n.createVNode(n.unref(a),{class:"--icon maz-text-xl"})])),typeof v.timeout=="number"&&v.timeout>0?(n.openBlock(),n.createElementBlock("div",cn,[n.createElementVNode("div",{style:n.normalizeStyle({width:oe.value}),class:n.normalizeClass(["maz-h-full !maz-transition-all !maz-duration-200 !maz-ease-linear",R()])},null,6)])):n.createCommentVNode("v-if",!0)],34),[[n.vShow,g.value]])]),_:1},8,["name"]))}}),dn=ue(un,[["__scopeId","data-v-309639e4"]]),mn={position:"bottom-right",timeout:1e4,persistent:!1,icon:!0};class Ct{constructor(e,t){this.app=e,this.globalOptions=t}show(e,t){const s={...mn,...this.globalOptions,...t,message:e},{destroy:r,vNode:i}=ce(dn,{props:s,app:this.app});return{destroy:r,close:()=>{var a,l;return(l=(a=i.component)==null?void 0:a.exposed)==null?void 0:l.closeToast()}}}getLocalOptions(e,t){return{type:e,...t}}message(e,t){return this.show(e,this.getLocalOptions("theme",t))}success(e,t){return this.show(e,this.getLocalOptions("success",t))}error(e,t){return this.show(e,this.getLocalOptions("danger",t))}info(e,t){return this.show(e,this.getLocalOptions("info",t))}warning(e,t){return this.show(e,this.getLocalOptions("warning",t))}}function fn(o,e){return new Ct(o,e)}const hn={install(o,e){o.provide("toast",fn(o,e))}},W="";function vn(o){return o.filter((e,t,s)=>t===s.indexOf(e))}function pn(o){return(e=W)=>typeof e=="function"?o.findIndex((...t)=>e(...t))>-1:o.includes(e)}const gn=o=>o.length>0;function yn(o){return(e=W)=>vn([...o,e])}function bn(o){return(e=W)=>o.filter(t=>t!==e)}class zt{constructor(){m(this,"_loaders",n.ref([]))}get loaders(){return n.computed(()=>this._loaders.value)}stop(e=W){this._loaders.value=bn(this._loaders.value)(e)}start(e=W){return this._loaders.value=yn(this._loaders.value)(e),()=>this.stop(e)}get anyLoading(){return n.computed(()=>gn(this._loaders.value))}isLoading(e=W){return n.computed(()=>pn(this._loaders.value)(e)).value}}const kt=new zt,wn={install:o=>{o.provide("wait",kt)}};exports.AosHandler=bt;exports.DialogHandler=Tt;exports.IdleTimeout=je;exports.ScriptLoader=_o;exports.Swipe=We;exports.ToasterHandler=Ct;exports.UserVisibility=Xe;exports.WaitHandler=zt;exports._export_sfc=ue;exports.capitalize=ft;exports.checkAvailability=Be;exports.countryCodeToUnicodeFlag=qo;exports.currency=ht;exports.date=vt;exports.debounce=jo;exports.directive=Je;exports.directive$1=nt;exports.directive$2=Eo;exports.directive$3=at;exports.directive$4=So;exports.getInstance=Ro;exports.injectStrict=Z;exports.installDialog=nn;exports.installFilters=Fo;exports.installToaster=hn;exports.instance=kt;exports.isClient=x;exports.mount=ce;exports.normalizeString=ye;exports.number=pt;exports.plugin=Do;exports.plugin$1=et;exports.plugin$2=st;exports.plugin$3=it;exports.plugin$4=lt;exports.plugin$5=ut;exports.plugin$6=mt;exports.plugin$7=Wo;exports.plugin$8=wn;exports.sleep=yt;exports.throttle=Uo;exports.truthyFilter=gt;exports.useAos=xt;exports.useBreakpoints=Ot;exports.useDialog=Dt;exports.useFormField=Jt;exports.useFormValidator=eo;exports.useIdleTimeout=to;exports.useInstanceUniqId=oo;exports.useReadingTime=so;exports.useStringMatching=lo;exports.useSwipe=uo;exports.useThemeHandler=ho;exports.useTimer=Ye;exports.useToast=vo;exports.useUserVisibility=po;exports.useWait=go;exports.useWindowSize=De;exports.vZoomImg=dt;