@oneclick.dev/cms-core-modules 0.0.61 → 0.0.63

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 (46) hide show
  1. package/dist/{ContentEditor-BAepN3Yd.js → ContentEditor-DKFCmfOs.js} +1 -1
  2. package/dist/{ContentEditor-BPjWW3d1.mjs → ContentEditor-owdOIage.mjs} +1 -1
  3. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-DRVxQswt.js +1 -0
  4. package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-BJitmbPE.mjs → NewReservationDialog.vue_vue_type_script_setup_true_lang-DkgDWC2i.mjs} +130 -125
  5. package/dist/{Overview-DtWvKB3W.mjs → Overview-DiBYtvEX.mjs} +124 -119
  6. package/dist/Overview-qP1guKjx.js +1 -0
  7. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-B7ks5mbf.mjs +2332 -0
  8. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Vxubki_v.js +349 -0
  9. package/dist/{TableView-_2cP-w_7.js → TableView-BqhL_P45.js} +100 -100
  10. package/dist/{TableView-DlhHyuUZ.mjs → TableView-Dbl8qcUy.mjs} +14991 -14728
  11. package/dist/agenda-DFNJ8C1N.mjs +1136 -0
  12. package/dist/agenda-MjkwV63A.js +1 -0
  13. package/dist/floating-ui.dom-CBBY0Ism.js +1 -0
  14. package/dist/floating-ui.dom-xfqXu4GA.mjs +1138 -0
  15. package/dist/{index-DTago6vW-Bhr8E1Y6.js → index-CgfL8UKf-DAN7RkzR.js} +10 -10
  16. package/dist/{index-DTago6vW-CnomHQ_S.mjs → index-CgfL8UKf-DUUg9HDA.mjs} +904 -875
  17. package/dist/index-DBDq-h4j.js +245 -0
  18. package/dist/{index-BDaVYdkD.mjs → index-X0L4AHBR.mjs} +2406 -2394
  19. package/dist/index-YMaY4uuk-BgpTtr73.js +1 -0
  20. package/dist/{index-YMaY4uuk-BshejgNP.mjs → index-YMaY4uuk-C_xV5K9Z.mjs} +13 -14
  21. package/dist/index.cjs.js +1 -1
  22. package/dist/index.mjs +6 -6
  23. package/dist/orders-Bqa3Z3tH.mjs +356 -0
  24. package/dist/orders-D5GJOZXN.js +1 -0
  25. package/dist/src/appointments/components/edit/EventDialog/ApproveReservationDialog.vue.d.ts +8 -0
  26. package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +39 -9
  27. package/dist/src/appointments/components/edit/EventDialog/CancelReservationDialog.vue.d.ts +2 -2
  28. package/dist/src/appointments/components/edit/EventDialog/RejectReservationDialog.vue.d.ts +8 -0
  29. package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +36 -8
  30. package/dist/src/appointments/components/edit/dashboard/BookingsList.vue.d.ts +46 -9
  31. package/dist/src/appointments/components/edit/dashboard/Timeline.vue.d.ts +19 -0
  32. package/dist/src/appointments/pages/edit/orders.vue.d.ts +39 -9
  33. package/package.json +1 -1
  34. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-D50uTpZY.js +0 -1
  35. package/dist/Overview-B_99j5eA.js +0 -1
  36. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CI8YgHdU.js +0 -345
  37. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-P-MWwcVh.mjs +0 -2093
  38. package/dist/agenda-D81m29_4.mjs +0 -1135
  39. package/dist/agenda-uzPPxgsW.js +0 -1
  40. package/dist/floating-ui.dom-C82nbomj.js +0 -1
  41. package/dist/floating-ui.dom-ouSgPqty.mjs +0 -1133
  42. package/dist/index-DfV8-6ON.js +0 -245
  43. package/dist/index-YMaY4uuk-BxVT7IpO.js +0 -1
  44. package/dist/orders-Bh8w0ueq.mjs +0 -346
  45. package/dist/orders-Dt0zMz97.js +0 -1
  46. package/dist/src/appointments/components/edit/EventDialog/ResendConfirmationDialog.vue.d.ts +0 -4
@@ -1,345 +0,0 @@
1
- "use strict";const e=require("vue"),w=require("lucide-vue-next"),S=require("@oneclick.dev/cms-kit"),re=require("./index-ijdf0d9-.js");function I(n){return Array.isArray?Array.isArray(n):fe(n)==="[object Array]"}function be(n){if(typeof n=="string")return n;let t=n+"";return t=="0"&&1/n==-1/0?"-0":t}function ke(n){return n==null?"":be(n)}function F(n){return typeof n=="string"}function pe(n){return typeof n=="number"}function Be(n){return n===!0||n===!1||Me(n)&&fe(n)=="[object Boolean]"}function me(n){return typeof n=="object"}function Me(n){return me(n)&&n!==null}function M(n){return n!=null}function J(n){return!n.trim().length}function fe(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}const $e="Incorrect 'index' type",Fe=n=>`Invalid value for key ${n}`,Se=n=>`Pattern length exceeds max of ${n}.`,Ie=n=>`Missing ${n} property in key`,Te=n=>`Property 'weight' in key '${n}' must be a positive integer`,ae=Object.prototype.hasOwnProperty;class Re{constructor(t){this._keys=[],this._keyMap={};let o=0;t.forEach(s=>{let a=he(s);this._keys.push(a),this._keyMap[a.id]=a,o+=a.weight}),this._keys.forEach(s=>{s.weight/=o})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function he(n){let t=null,o=null,s=null,a=1,l=null;if(F(n)||I(n))s=n,t=ie(n),o=X(n);else{if(!ae.call(n,"name"))throw new Error(Ie("name"));const i=n.name;if(s=i,ae.call(n,"weight")&&(a=n.weight,a<=0))throw new Error(Te(i));t=ie(i),o=X(i),l=n.getFn}return{path:t,id:o,weight:a,src:s,getFn:l}}function ie(n){return I(n)?n:n.split(".")}function X(n){return I(n)?n.join("."):n}function Oe(n,t){let o=[],s=!1;const a=(l,i,c)=>{if(M(l))if(!i[c])o.push(l);else{let u=i[c];const d=l[u];if(!M(d))return;if(c===i.length-1&&(F(d)||pe(d)||Be(d)))o.push(ke(d));else if(I(d)){s=!0;for(let r=0,p=d.length;r<p;r+=1)a(d[r],i,c+1)}else i.length&&a(d,i,c+1)}};return a(n,F(t)?t.split("."):t,0),s?o:o[0]}const Le={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Pe={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(n,t)=>n.score===t.score?n.idx<t.idx?-1:1:n.score<t.score?-1:1},je={location:0,threshold:.6,distance:100},ze={useExtendedSearch:!1,getFn:Oe,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var g={...Pe,...Le,...je,...ze};const Ue=/[^ ]+/g;function We(n=1,t=3){const o=new Map,s=Math.pow(10,t);return{get(a){const l=a.match(Ue).length;if(o.has(l))return o.get(l);const i=1/Math.pow(l,.5*n),c=parseFloat(Math.round(i*s)/s);return o.set(l,c),c},clear(){o.clear()}}}class oe{constructor({getFn:t=g.getFn,fieldNormWeight:o=g.fieldNormWeight}={}){this.norm=We(o,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((o,s)=>{this._keysMap[o.id]=s})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,F(this.docs[0])?this.docs.forEach((t,o)=>{this._addString(t,o)}):this.docs.forEach((t,o)=>{this._addObject(t,o)}),this.norm.clear())}add(t){const o=this.size();F(t)?this._addString(t,o):this._addObject(t,o)}removeAt(t){this.records.splice(t,1);for(let o=t,s=this.size();o<s;o+=1)this.records[o].i-=1}getValueForItemAtKeyId(t,o){return t[this._keysMap[o]]}size(){return this.records.length}_addString(t,o){if(!M(t)||J(t))return;let s={v:t,i:o,n:this.norm.get(t)};this.records.push(s)}_addObject(t,o){let s={i:o,$:{}};this.keys.forEach((a,l)=>{let i=a.getFn?a.getFn(t):this.getFn(t,a.path);if(M(i)){if(I(i)){let c=[];const u=[{nestedArrIndex:-1,value:i}];for(;u.length;){const{nestedArrIndex:d,value:r}=u.pop();if(M(r))if(F(r)&&!J(r)){let p={v:r,i:d,n:this.norm.get(r)};c.push(p)}else I(r)&&r.forEach((p,h)=>{u.push({nestedArrIndex:h,value:p})})}s.$[l]=c}else if(F(i)&&!J(i)){let c={v:i,n:this.norm.get(i)};s.$[l]=c}}}),this.records.push(s)}toJSON(){return{keys:this.keys,records:this.records}}}function ge(n,t,{getFn:o=g.getFn,fieldNormWeight:s=g.fieldNormWeight}={}){const a=new oe({getFn:o,fieldNormWeight:s});return a.setKeys(n.map(he)),a.setSources(t),a.create(),a}function He(n,{getFn:t=g.getFn,fieldNormWeight:o=g.fieldNormWeight}={}){const{keys:s,records:a}=n,l=new oe({getFn:t,fieldNormWeight:o});return l.setKeys(s),l.setIndexRecords(a),l}function H(n,{errors:t=0,currentLocation:o=0,expectedLocation:s=0,distance:a=g.distance,ignoreLocation:l=g.ignoreLocation}={}){const i=t/n.length;if(l)return i;const c=Math.abs(s-o);return a?i+c/a:c?1:i}function Ke(n=[],t=g.minMatchCharLength){let o=[],s=-1,a=-1,l=0;for(let i=n.length;l<i;l+=1){let c=n[l];c&&s===-1?s=l:!c&&s!==-1&&(a=l-1,a-s+1>=t&&o.push([s,a]),s=-1)}return n[l-1]&&l-s>=t&&o.push([s,l-1]),o}const P=32;function Ge(n,t,o,{location:s=g.location,distance:a=g.distance,threshold:l=g.threshold,findAllMatches:i=g.findAllMatches,minMatchCharLength:c=g.minMatchCharLength,includeMatches:u=g.includeMatches,ignoreLocation:d=g.ignoreLocation}={}){if(t.length>P)throw new Error(Se(P));const r=t.length,p=n.length,h=Math.max(0,Math.min(s,p));let f=l,v=h;const C=c>1||u,_=C?Array(p):[];let V;for(;(V=n.indexOf(t,v))>-1;){let A=H(t,{currentLocation:V,expectedLocation:h,distance:a,ignoreLocation:d});if(f=Math.min(A,f),v=V+r,C){let D=0;for(;D<r;)_[V+D]=1,D+=1}}v=-1;let y=[],N=1,b=r+p;const R=1<<r-1;for(let A=0;A<r;A+=1){let D=0,$=b;for(;D<$;)H(t,{errors:A,currentLocation:h+$,expectedLocation:h,distance:a,ignoreLocation:d})<=f?D=$:b=$,$=Math.floor((b-D)/2+D);b=$;let x=Math.max(1,h-$+1),m=i?p:Math.min(h+$,p)+r,k=Array(m+2);k[m+1]=(1<<A)-1;for(let B=m;B>=x;B-=1){let O=B-1,j=o[n.charAt(O)];if(C&&(_[O]=+!!j),k[B]=(k[B+1]<<1|1)&j,A&&(k[B]|=(y[B+1]|y[B])<<1|1|y[B+1]),k[B]&R&&(N=H(t,{errors:A,currentLocation:O,expectedLocation:h,distance:a,ignoreLocation:d}),N<=f)){if(f=N,v=O,v<=h)break;x=Math.max(1,2*h-v)}}if(H(t,{errors:A+1,currentLocation:h,expectedLocation:h,distance:a,ignoreLocation:d})>f)break;y=k}const E={isMatch:v>=0,score:Math.max(.001,N)};if(C){const A=Ke(_,c);A.length?u&&(E.indices=A):E.isMatch=!1}return E}function Ye(n){let t={};for(let o=0,s=n.length;o<s;o+=1){const a=n.charAt(o);t[a]=(t[a]||0)|1<<s-o-1}return t}const K=String.prototype.normalize?(n=>n.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(n=>n);class ve{constructor(t,{location:o=g.location,threshold:s=g.threshold,distance:a=g.distance,includeMatches:l=g.includeMatches,findAllMatches:i=g.findAllMatches,minMatchCharLength:c=g.minMatchCharLength,isCaseSensitive:u=g.isCaseSensitive,ignoreDiacritics:d=g.ignoreDiacritics,ignoreLocation:r=g.ignoreLocation}={}){if(this.options={location:o,threshold:s,distance:a,includeMatches:l,findAllMatches:i,minMatchCharLength:c,isCaseSensitive:u,ignoreDiacritics:d,ignoreLocation:r},t=u?t:t.toLowerCase(),t=d?K(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const p=(f,v)=>{this.chunks.push({pattern:f,alphabet:Ye(f),startIndex:v})},h=this.pattern.length;if(h>P){let f=0;const v=h%P,C=h-v;for(;f<C;)p(this.pattern.substr(f,P),f),f+=P;if(v){const _=h-P;p(this.pattern.substr(_),_)}}else p(this.pattern,0)}searchIn(t){const{isCaseSensitive:o,ignoreDiacritics:s,includeMatches:a}=this.options;if(t=o?t:t.toLowerCase(),t=s?K(t):t,this.pattern===t){let C={isMatch:!0,score:0};return a&&(C.indices=[[0,t.length-1]]),C}const{location:l,distance:i,threshold:c,findAllMatches:u,minMatchCharLength:d,ignoreLocation:r}=this.options;let p=[],h=0,f=!1;this.chunks.forEach(({pattern:C,alphabet:_,startIndex:V})=>{const{isMatch:y,score:N,indices:b}=Ge(t,C,_,{location:l+V,distance:i,threshold:c,findAllMatches:u,minMatchCharLength:d,includeMatches:a,ignoreLocation:r});y&&(f=!0),h+=N,y&&b&&(p=[...p,...b])});let v={isMatch:f,score:f?h/this.chunks.length:1};return f&&a&&(v.indices=p),v}}class T{constructor(t){this.pattern=t}static isMultiMatch(t){return le(t,this.multiRegex)}static isSingleMatch(t){return le(t,this.singleRegex)}search(){}}function le(n,t){const o=n.match(t);return o?o[1]:null}class Qe extends T{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const o=t===this.pattern;return{isMatch:o,score:o?0:1,indices:[0,this.pattern.length-1]}}}class Je extends T{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const s=t.indexOf(this.pattern)===-1;return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}}class Xe extends T{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const o=t.startsWith(this.pattern);return{isMatch:o,score:o?0:1,indices:[0,this.pattern.length-1]}}}class Ze extends T{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const o=!t.startsWith(this.pattern);return{isMatch:o,score:o?0:1,indices:[0,t.length-1]}}}class qe extends T{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const o=t.endsWith(this.pattern);return{isMatch:o,score:o?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class et extends T{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const o=!t.endsWith(this.pattern);return{isMatch:o,score:o?0:1,indices:[0,t.length-1]}}}class xe extends T{constructor(t,{location:o=g.location,threshold:s=g.threshold,distance:a=g.distance,includeMatches:l=g.includeMatches,findAllMatches:i=g.findAllMatches,minMatchCharLength:c=g.minMatchCharLength,isCaseSensitive:u=g.isCaseSensitive,ignoreDiacritics:d=g.ignoreDiacritics,ignoreLocation:r=g.ignoreLocation}={}){super(t),this._bitapSearch=new ve(t,{location:o,threshold:s,distance:a,includeMatches:l,findAllMatches:i,minMatchCharLength:c,isCaseSensitive:u,ignoreDiacritics:d,ignoreLocation:r})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class Ce extends T{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let o=0,s;const a=[],l=this.pattern.length;for(;(s=t.indexOf(this.pattern,o))>-1;)o=s+l,a.push([s,o-1]);const i=!!a.length;return{isMatch:i,score:i?0:1,indices:a}}}const Z=[Qe,Ce,Xe,Ze,et,qe,Je,xe],ce=Z.length,tt=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,nt="|";function ot(n,t={}){return n.split(nt).map(o=>{let s=o.trim().split(tt).filter(l=>l&&!!l.trim()),a=[];for(let l=0,i=s.length;l<i;l+=1){const c=s[l];let u=!1,d=-1;for(;!u&&++d<ce;){const r=Z[d];let p=r.isMultiMatch(c);p&&(a.push(new r(p,t)),u=!0)}if(!u)for(d=-1;++d<ce;){const r=Z[d];let p=r.isSingleMatch(c);if(p){a.push(new r(p,t));break}}}return a})}const st=new Set([xe.type,Ce.type]);class rt{constructor(t,{isCaseSensitive:o=g.isCaseSensitive,ignoreDiacritics:s=g.ignoreDiacritics,includeMatches:a=g.includeMatches,minMatchCharLength:l=g.minMatchCharLength,ignoreLocation:i=g.ignoreLocation,findAllMatches:c=g.findAllMatches,location:u=g.location,threshold:d=g.threshold,distance:r=g.distance}={}){this.query=null,this.options={isCaseSensitive:o,ignoreDiacritics:s,includeMatches:a,minMatchCharLength:l,findAllMatches:c,ignoreLocation:i,location:u,threshold:d,distance:r},t=o?t:t.toLowerCase(),t=s?K(t):t,this.pattern=t,this.query=ot(this.pattern,this.options)}static condition(t,o){return o.useExtendedSearch}searchIn(t){const o=this.query;if(!o)return{isMatch:!1,score:1};const{includeMatches:s,isCaseSensitive:a,ignoreDiacritics:l}=this.options;t=a?t:t.toLowerCase(),t=l?K(t):t;let i=0,c=[],u=0;for(let d=0,r=o.length;d<r;d+=1){const p=o[d];c.length=0,i=0;for(let h=0,f=p.length;h<f;h+=1){const v=p[h],{isMatch:C,indices:_,score:V}=v.search(t);if(C){if(i+=1,u+=V,s){const y=v.constructor.type;st.has(y)?c=[...c,..._]:c.push(_)}}else{u=0,i=0,c.length=0;break}}if(i){let h={isMatch:!0,score:u/i};return s&&(h.indices=c),h}}return{isMatch:!1,score:1}}}const q=[];function at(...n){q.push(...n)}function ee(n,t){for(let o=0,s=q.length;o<s;o+=1){let a=q[o];if(a.condition(n,t))return new a(n,t)}return new ve(n,t)}const G={AND:"$and",OR:"$or"},te={PATH:"$path",PATTERN:"$val"},ne=n=>!!(n[G.AND]||n[G.OR]),it=n=>!!n[te.PATH],lt=n=>!I(n)&&me(n)&&!ne(n),ue=n=>({[G.AND]:Object.keys(n).map(t=>({[t]:n[t]}))});function De(n,t,{auto:o=!0}={}){const s=a=>{let l=Object.keys(a);const i=it(a);if(!i&&l.length>1&&!ne(a))return s(ue(a));if(lt(a)){const u=i?a[te.PATH]:l[0],d=i?a[te.PATTERN]:a[u];if(!F(d))throw new Error(Fe(u));const r={keyId:X(u),pattern:d};return o&&(r.searcher=ee(d,t)),r}let c={children:[],operator:l[0]};return l.forEach(u=>{const d=a[u];I(d)&&d.forEach(r=>{c.children.push(s(r))})}),c};return ne(n)||(n=ue(n)),s(n)}function ct(n,{ignoreFieldNorm:t=g.ignoreFieldNorm}){n.forEach(o=>{let s=1;o.matches.forEach(({key:a,norm:l,score:i})=>{const c=a?a.weight:null;s*=Math.pow(i===0&&c?Number.EPSILON:i,(c||1)*(t?1:l))}),o.score=s})}function ut(n,t){const o=n.matches;t.matches=[],M(o)&&o.forEach(s=>{if(!M(s.indices)||!s.indices.length)return;const{indices:a,value:l}=s;let i={indices:a,value:l};s.key&&(i.key=s.key.src),s.idx>-1&&(i.refIndex=s.idx),t.matches.push(i)})}function dt(n,t){t.score=n.score}function pt(n,t,{includeMatches:o=g.includeMatches,includeScore:s=g.includeScore}={}){const a=[];return o&&a.push(ut),s&&a.push(dt),n.map(l=>{const{idx:i}=l,c={item:t[i],refIndex:i};return a.length&&a.forEach(u=>{u(l,c)}),c})}class z{constructor(t,o={},s){this.options={...g,...o},this.options.useExtendedSearch,this._keyStore=new Re(this.options.keys),this.setCollection(t,s)}setCollection(t,o){if(this._docs=t,o&&!(o instanceof oe))throw new Error($e);this._myIndex=o||ge(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){M(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const o=[];for(let s=0,a=this._docs.length;s<a;s+=1){const l=this._docs[s];t(l,s)&&(this.removeAt(s),s-=1,a-=1,o.push(l))}return o}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:o=-1}={}){const{includeMatches:s,includeScore:a,shouldSort:l,sortFn:i,ignoreFieldNorm:c}=this.options;let u=F(t)?F(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return ct(u,{ignoreFieldNorm:c}),l&&u.sort(i),pe(o)&&o>-1&&(u=u.slice(0,o)),pt(u,this._docs,{includeMatches:s,includeScore:a})}_searchStringList(t){const o=ee(t,this.options),{records:s}=this._myIndex,a=[];return s.forEach(({v:l,i,n:c})=>{if(!M(l))return;const{isMatch:u,score:d,indices:r}=o.searchIn(l);u&&a.push({item:l,idx:i,matches:[{score:d,value:l,norm:c,indices:r}]})}),a}_searchLogical(t){const o=De(t,this.options),s=(c,u,d)=>{if(!c.children){const{keyId:p,searcher:h}=c,f=this._findMatches({key:this._keyStore.get(p),value:this._myIndex.getValueForItemAtKeyId(u,p),searcher:h});return f&&f.length?[{idx:d,item:u,matches:f}]:[]}const r=[];for(let p=0,h=c.children.length;p<h;p+=1){const f=c.children[p],v=s(f,u,d);if(v.length)r.push(...v);else if(c.operator===G.AND)return[]}return r},a=this._myIndex.records,l={},i=[];return a.forEach(({$:c,i:u})=>{if(M(c)){let d=s(o,c,u);d.length&&(l[u]||(l[u]={idx:u,item:c,matches:[]},i.push(l[u])),d.forEach(({matches:r})=>{l[u].matches.push(...r)}))}}),i}_searchObjectList(t){const o=ee(t,this.options),{keys:s,records:a}=this._myIndex,l=[];return a.forEach(({$:i,i:c})=>{if(!M(i))return;let u=[];s.forEach((d,r)=>{u.push(...this._findMatches({key:d,value:i[r],searcher:o}))}),u.length&&l.push({idx:c,item:i,matches:u})}),l}_findMatches({key:t,value:o,searcher:s}){if(!M(o))return[];let a=[];if(I(o))o.forEach(({v:l,i,n:c})=>{if(!M(l))return;const{isMatch:u,score:d,indices:r}=s.searchIn(l);u&&a.push({score:d,key:t,value:l,idx:i,norm:c,indices:r})});else{const{v:l,n:i}=o,{isMatch:c,score:u,indices:d}=s.searchIn(l);c&&a.push({score:u,key:t,value:l,norm:i,indices:d})}return a}}z.version="7.1.0";z.createIndex=ge;z.parseIndex=He;z.config=g;z.parseQuery=De;at(rt);const L=n=>n==null?"—":`€${n.toFixed(2)}`,mt=n=>{if(!n)return"—";if(n<60)return`${n} min`;const t=Math.floor(n/60),o=n%60;return o>0?`${t}h ${o}min`:`${t}h`},ft=n=>{switch(n){case"confirmed":return"Confirmed";case"completed":return"Completed";case"pending":return"Pending";case"cancelled":return"Cancelled";default:return n||"Unknown"}},de=n=>{switch(n){case"confirmed":case"completed":return"#16a34a";case"pending":return"#ca8a04";case"cancelled":return"#dc2626";default:return"#6b7280"}},ht=(n,t={})=>{const o=`${n.customerInfo?.firstName||""} ${n.customerInfo?.lastName||""}`.trim()||"Unknown Customer",s=n.id?.slice(0,8)||"—",a=new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),l=`
2
- <!DOCTYPE html>
3
- <html lang="en">
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>Reservation ${s}</title>
8
- <style>
9
- * {
10
- margin: 0;
11
- padding: 0;
12
- box-sizing: border-box;
13
- }
14
-
15
- body {
16
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
17
- line-height: 1.6;
18
- color: #1f2937;
19
- background: #fff;
20
- padding: 40px;
21
- max-width: 800px;
22
- margin: 0 auto;
23
- }
24
-
25
- .header {
26
- display: flex;
27
- justify-content: space-between;
28
- align-items: flex-start;
29
- margin-bottom: 40px;
30
- padding-bottom: 20px;
31
- border-bottom: 2px solid #e5e7eb;
32
- }
33
-
34
- .company-info {
35
- display: flex;
36
- align-items: center;
37
- gap: 16px;
38
- }
39
-
40
- .company-logo {
41
- max-height: 50px;
42
- max-width: 150px;
43
- object-fit: contain;
44
- }
45
-
46
- .company-name {
47
- font-size: 24px;
48
- font-weight: 700;
49
- color: #111827;
50
- }
51
-
52
- .document-info {
53
- text-align: right;
54
- }
55
-
56
- .document-title {
57
- font-size: 28px;
58
- font-weight: 700;
59
- color: #111827;
60
- margin-bottom: 8px;
61
- }
62
-
63
- .booking-id {
64
- font-size: 14px;
65
- color: #6b7280;
66
- }
67
-
68
- .status-badge {
69
- display: inline-block;
70
- padding: 4px 12px;
71
- border-radius: 9999px;
72
- font-size: 12px;
73
- font-weight: 600;
74
- text-transform: uppercase;
75
- margin-top: 8px;
76
- }
77
-
78
- .section {
79
- margin-bottom: 32px;
80
- }
81
-
82
- .section-title {
83
- font-size: 12px;
84
- font-weight: 600;
85
- text-transform: uppercase;
86
- letter-spacing: 0.05em;
87
- color: #6b7280;
88
- margin-bottom: 12px;
89
- }
90
-
91
- .section-content {
92
- background: #f9fafb;
93
- border-radius: 8px;
94
- padding: 20px;
95
- }
96
-
97
- .customer-name {
98
- font-size: 18px;
99
- font-weight: 600;
100
- margin-bottom: 8px;
101
- }
102
-
103
- .contact-info {
104
- font-size: 14px;
105
- color: #4b5563;
106
- }
107
-
108
- .contact-info a {
109
- color: #4b5563;
110
- text-decoration: none;
111
- }
112
-
113
- .grid {
114
- display: grid;
115
- grid-template-columns: 1fr 1fr;
116
- gap: 16px;
117
- }
118
-
119
- .info-card {
120
- background: #f9fafb;
121
- border-radius: 8px;
122
- padding: 16px;
123
- }
124
-
125
- .info-label {
126
- font-size: 12px;
127
- color: #6b7280;
128
- margin-bottom: 4px;
129
- }
130
-
131
- .info-value {
132
- font-size: 16px;
133
- font-weight: 600;
134
- }
135
-
136
- .package-row {
137
- display: flex;
138
- justify-content: space-between;
139
- align-items: flex-start;
140
- }
141
-
142
- .package-name {
143
- font-size: 16px;
144
- font-weight: 600;
145
- }
146
-
147
- .package-duration {
148
- font-size: 14px;
149
- color: #6b7280;
150
- }
151
-
152
- .package-price {
153
- font-size: 16px;
154
- font-weight: 600;
155
- }
156
-
157
- .payment-row {
158
- display: flex;
159
- justify-content: space-between;
160
- padding: 8px 0;
161
- font-size: 14px;
162
- }
163
-
164
- .payment-label {
165
- color: #6b7280;
166
- }
167
-
168
- .payment-value {
169
- font-weight: 500;
170
- }
171
-
172
- .payment-value.green {
173
- color: #16a34a;
174
- }
175
-
176
- .payment-value.orange {
177
- color: #ea580c;
178
- }
179
-
180
- .payment-divider {
181
- border-top: 1px solid #e5e7eb;
182
- margin: 12px 0;
183
- }
184
-
185
- .payment-total {
186
- font-size: 16px;
187
- font-weight: 600;
188
- }
189
-
190
- .footer {
191
- margin-top: 60px;
192
- padding-top: 20px;
193
- border-top: 1px solid #e5e7eb;
194
- text-align: center;
195
- font-size: 12px;
196
- color: #9ca3af;
197
- }
198
-
199
- @media print {
200
- body {
201
- padding: 20px;
202
- }
203
-
204
- .no-print {
205
- display: none;
206
- }
207
- }
208
- </style>
209
- </head>
210
- <body>
211
- <div class="header">
212
- <div class="company-info">
213
- ${t.companyLogo?`<img src="${t.companyLogo}" alt="Logo" class="company-logo" />`:""}
214
- ${t.companyName?`<span class="company-name">${t.companyName}</span>`:""}
215
- </div>
216
- <div class="document-info">
217
- <div class="document-title">Reservation</div>
218
- <div class="booking-id">Booking #${s}</div>
219
- <div
220
- class="status-badge"
221
- style="background-color: ${de(n.status)}20; color: ${de(n.status)};"
222
- >
223
- ${ft(n.status)}
224
- </div>
225
- </div>
226
- </div>
227
-
228
- <div class="section">
229
- <div class="section-title">Customer</div>
230
- <div class="section-content">
231
- <div class="customer-name">${o}</div>
232
- <div class="contact-info">
233
- ${n.customerInfo?.email?`<div>Email: <a href="mailto:${n.customerInfo.email}">${n.customerInfo.email}</a></div>`:""}
234
- ${n.customerInfo?.phone?`<div>Phone: <a href="tel:${n.customerInfo.phone}">${n.customerInfo.phone}</a></div>`:""}
235
- </div>
236
- </div>
237
- </div>
238
-
239
- <div class="section">
240
- <div class="section-title">Reservation Details</div>
241
- <div class="grid">
242
- <div class="info-card">
243
- <div class="info-label">Date</div>
244
- <div class="info-value">${t.date||"—"}</div>
245
- </div>
246
- <div class="info-card">
247
- <div class="info-label">Time</div>
248
- <div class="info-value">${n.startTime} - ${n.endTime}</div>
249
- </div>
250
- <div class="info-card">
251
- <div class="info-label">Spots</div>
252
- <div class="info-value">${n.spots||1} ${(n.spots||1)===1?"person":"people"}</div>
253
- </div>
254
- ${t.resourceName?`
255
- <div class="info-card">
256
- <div class="info-label">Resource</div>
257
- <div class="info-value">${t.resourceName}</div>
258
- </div>
259
- `:""}
260
- ${t.agendaName?`
261
- <div class="info-card">
262
- <div class="info-label">Service</div>
263
- <div class="info-value">${t.agendaName}</div>
264
- </div>
265
- `:""}
266
- </div>
267
- </div>
268
-
269
- ${n.pricingOption?`
270
- <div class="section">
271
- <div class="section-title">Package</div>
272
- <div class="section-content">
273
- <div class="package-row">
274
- <div>
275
- <div class="package-name">${n.pricingOption.name}</div>
276
- <div class="package-duration">${mt(n.pricingOption.duration)}</div>
277
- </div>
278
- <div class="package-price">${L(n.pricingOption.price)}</div>
279
- </div>
280
- </div>
281
- </div>
282
- `:""}
283
-
284
- <div class="section">
285
- <div class="section-title">Payment Summary</div>
286
- <div class="section-content">
287
- <div class="payment-row">
288
- <span class="payment-label">Base price</span>
289
- <span class="payment-value">${L(n.reservationBasePrice)}</span>
290
- </div>
291
- ${n.reservationAddOnsPrice?`
292
- <div class="payment-row">
293
- <span class="payment-label">Add-ons</span>
294
- <span class="payment-value">${L(n.reservationAddOnsPrice)}</span>
295
- </div>
296
- `:""}
297
- ${n.discount?`
298
- <div class="payment-row">
299
- <span class="payment-label">Discount</span>
300
- <span class="payment-value green">-${L(n.discount)}</span>
301
- </div>
302
- `:""}
303
-
304
- <div class="payment-divider"></div>
305
-
306
- <div class="payment-row payment-total">
307
- <span>Reservation Total</span>
308
- <span>${L(n.reservationPrice)}</span>
309
- </div>
310
-
311
- ${n.amountPaid!==void 0||n.amountDue!==void 0?`
312
- <div class="payment-divider"></div>
313
-
314
- ${n.amountPaid!==void 0?`
315
- <div class="payment-row">
316
- <span class="payment-label">Amount paid</span>
317
- <span class="payment-value green">${L(n.amountPaid)}</span>
318
- </div>
319
- `:""}
320
-
321
- ${n.amountDue!==void 0&&n.amountDue>0?`
322
- <div class="payment-row">
323
- <span class="payment-label">Amount due</span>
324
- <span class="payment-value orange">${L(n.amountDue)}</span>
325
- </div>
326
- `:""}
327
- `:""}
328
- </div>
329
- </div>
330
-
331
- <div class="footer">
332
- <p>Generated on ${a}</p>
333
- ${t.companyName?`<p>${t.companyName}</p>`:""}
334
- </div>
335
- </body>
336
- </html>
337
- `,i=window.open("","_blank");i&&(i.document.write(l),i.document.close(),i.onload=()=>{i.print()})},gt={class:"grid gap-4 py-4"},vt={class:"grid gap-2"},xt={class:"grid gap-2"},Ct={class:"grid gap-2"},Dt=e.defineComponent({__name:"CancelReservationDialog",emits:["cancel"],setup(n,{expose:t,emit:o}){const{config:s}=S.useModule(),{sendMail:a}=S.useMailer(s.mailAccount),l=o,i=e.ref(!1),c=e.ref(""),u=e.ref(""),d=e.ref(""),r=h=>{i.value=!0,h&&(c.value=h.customerInfo?.email,u.value="Cancellation of your reservation - "+new Date(h.date)?.toDateString(),d.value=`Dear ${h.customerInfo?.firstName??""} ${h.customerInfo?.lastName??""},
338
-
339
- We are writing to inform you that your reservation scheduled for ${new Date(h.date)?.toDateString()} at ${h.startTime} has been cancelled.
340
-
341
- Please accept our sincere apologies for any inconvenience this may cause. We would be happy to help you find an alternative time that works for you.`)},p=()=>{if(!c.value||!u.value||!d.value)return alert("Please fill in all the fields.");a({to:c.value,subject:u.value,body:d.value}),i.value=!1;const{$confetti:h}=useNuxtApp();h(),l("cancel")};return t({openDialog:r}),(h,f)=>{const v=e.resolveComponent("DialogTitle"),C=e.resolveComponent("DialogDescription"),_=e.resolveComponent("DialogHeader"),V=e.resolveComponent("Label"),y=e.resolveComponent("Input"),N=e.resolveComponent("Textarea"),b=e.resolveComponent("Button"),R=e.resolveComponent("DialogFooter"),E=e.resolveComponent("DialogScrollContent"),A=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(A,{open:i.value,"onUpdate:open":f[4]||(f[4]=D=>i.value=D)},{default:e.withCtx(()=>[e.createVNode(E,{class:"sm:max-w-3xl"},{default:e.withCtx(()=>[e.createVNode(_,null,{default:e.withCtx(()=>[e.createVNode(v,null,{default:e.withCtx(()=>[...f[5]||(f[5]=[e.createTextVNode(" Cancel Reservation ",-1)])]),_:1}),e.createVNode(C)]),_:1}),e.createElementVNode("div",gt,[e.createElementVNode("div",vt,[e.createVNode(V,null,{default:e.withCtx(()=>[...f[6]||(f[6]=[e.createTextVNode("To:",-1)])]),_:1}),e.createVNode(y,{modelValue:c.value,"onUpdate:modelValue":f[0]||(f[0]=D=>c.value=D)},null,8,["modelValue"])]),e.createElementVNode("div",xt,[e.createVNode(V,null,{default:e.withCtx(()=>[...f[7]||(f[7]=[e.createTextVNode("Subject:",-1)])]),_:1}),e.createVNode(y,{modelValue:u.value,"onUpdate:modelValue":f[1]||(f[1]=D=>u.value=D)},null,8,["modelValue"])]),e.createElementVNode("div",Ct,[e.createVNode(V,null,{default:e.withCtx(()=>[...f[8]||(f[8]=[e.createTextVNode("Body:",-1)])]),_:1}),e.createVNode(N,{modelValue:d.value,"onUpdate:modelValue":f[2]||(f[2]=D=>d.value=D)},null,8,["modelValue"])])]),e.createVNode(R,null,{default:e.withCtx(()=>[e.createVNode(b,{variant:"outline",onClick:f[3]||(f[3]=D=>i.value=!1)},{default:e.withCtx(()=>[...f[9]||(f[9]=[e.createTextVNode("Close",-1)])]),_:1}),e.createVNode(b,{variant:"destructive",onClick:p},{default:e.withCtx(()=>[...f[10]||(f[10]=[e.createTextVNode("Cancel reservation",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}}),_t={class:"grid gap-4 py-4"},yt={class:"grid gap-2"},Nt={class:"grid gap-2"},Et={class:"grid gap-2"},Vt=e.defineComponent({__name:"ResendConfirmationDialog",setup(n,{expose:t}){const{config:o}=S.useModule(),{sendMail:s}=S.useMailer(o.mailAccount),a=e.ref(!1),l=e.ref(""),i=e.ref(""),c=e.ref(""),u=r=>{a.value=!0,r&&(l.value=r.customerInfo?.email,i.value="Confirmation: Your reservation for "+new Date(r.date)?.toDateString(),c.value=`Dear ${r.customerInfo?.firstName??""} ${r.customerInfo?.lastName??""},
342
-
343
- This email confirms your reservation for ${new Date(r.date)?.toDateString()} at ${r.startTime}.
344
-
345
- We've got everything ready for you and look forward to your visit! If you need to make any changes or have special requests, please let us know.`)},d=()=>{if(!l.value||!i.value||!c.value)return alert("Please fill in all the fields.");s({to:l.value,subject:i.value,body:c.value}),a.value=!1;const{$confetti:r}=useNuxtApp();r()};return t({openDialog:u}),(r,p)=>{const h=e.resolveComponent("DialogTitle"),f=e.resolveComponent("DialogDescription"),v=e.resolveComponent("DialogHeader"),C=e.resolveComponent("Label"),_=e.resolveComponent("Input"),V=e.resolveComponent("Textarea"),y=e.resolveComponent("Button"),N=e.resolveComponent("DialogFooter"),b=e.resolveComponent("DialogScrollContent"),R=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(R,{open:a.value,"onUpdate:open":p[4]||(p[4]=E=>a.value=E)},{default:e.withCtx(()=>[e.createVNode(b,{class:"sm:max-w-3xl"},{default:e.withCtx(()=>[e.createVNode(v,null,{default:e.withCtx(()=>[e.createVNode(h,null,{default:e.withCtx(()=>[...p[5]||(p[5]=[e.createTextVNode(" (Re)send Confirmation Mail ",-1)])]),_:1}),e.createVNode(f)]),_:1}),e.createElementVNode("div",_t,[e.createElementVNode("div",yt,[e.createVNode(C,null,{default:e.withCtx(()=>[...p[6]||(p[6]=[e.createTextVNode("To:",-1)])]),_:1}),e.createVNode(_,{modelValue:l.value,"onUpdate:modelValue":p[0]||(p[0]=E=>l.value=E)},null,8,["modelValue"])]),e.createElementVNode("div",Nt,[e.createVNode(C,null,{default:e.withCtx(()=>[...p[7]||(p[7]=[e.createTextVNode("Subject:",-1)])]),_:1}),e.createVNode(_,{modelValue:i.value,"onUpdate:modelValue":p[1]||(p[1]=E=>i.value=E)},null,8,["modelValue"])]),e.createElementVNode("div",Et,[e.createVNode(C,null,{default:e.withCtx(()=>[...p[8]||(p[8]=[e.createTextVNode("Body:",-1)])]),_:1}),e.createVNode(V,{modelValue:c.value,"onUpdate:modelValue":p[2]||(p[2]=E=>c.value=E)},null,8,["modelValue"])])]),e.createVNode(N,null,{default:e.withCtx(()=>[e.createVNode(y,{variant:"outline",onClick:p[3]||(p[3]=E=>a.value=!1)},{default:e.withCtx(()=>[...p[9]||(p[9]=[e.createTextVNode("Close",-1)])]),_:1}),e.createVNode(y,{onClick:d},{default:e.withCtx(()=>[...p[10]||(p[10]=[e.createTextVNode("Send Mail",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}}),At=e.defineComponent({__name:"TransferReservationDialog",setup(n,{expose:t}){const{config:o}=S.useModule(),s=e.ref(!1);return t({openDialog:()=>{s.value=!0}}),(l,i)=>{const c=e.resolveComponent("DialogTitle"),u=e.resolveComponent("DialogDescription"),d=e.resolveComponent("DialogHeader"),r=e.resolveComponent("Button"),p=e.resolveComponent("DialogFooter"),h=e.resolveComponent("DialogScrollContent"),f=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(f,{open:s.value,"onUpdate:open":i[2]||(i[2]=v=>s.value=v)},{default:e.withCtx(()=>[e.createVNode(h,{class:"sm:max-w-3xl"},{default:e.withCtx(()=>[e.createVNode(d,null,{default:e.withCtx(()=>[e.createVNode(c,null,{default:e.withCtx(()=>[...i[3]||(i[3]=[e.createTextVNode(" Transfer Reservation ",-1)])]),_:1}),e.createVNode(u)]),_:1}),i[6]||(i[6]=e.createElementVNode("div",{class:"py-4"},null,-1)),e.createVNode(p,null,{default:e.withCtx(()=>[e.createVNode(r,{variant:"outline",onClick:i[0]||(i[0]=v=>s.value=!1)},{default:e.withCtx(()=>[...i[4]||(i[4]=[e.createTextVNode("Close",-1)])]),_:1}),e.createVNode(r,{onClick:i[1]||(i[1]=v=>s.value=!1)},{default:e.withCtx(()=>[...i[5]||(i[5]=[e.createTextVNode("Transfer reservation",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}}),wt={key:0,class:"space-y-6 py-4"},bt={class:"space-y-3"},kt={class:"bg-muted/30 rounded-lg p-4 space-y-3"},Bt={class:"flex items-center gap-3"},Mt={class:"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center"},$t={class:"font-medium"},Ft={class:"grid gap-2 text-sm"},St={key:0,class:"flex items-center gap-2 text-muted-foreground"},It=["href"],Tt={key:1,class:"flex items-center gap-2 text-muted-foreground"},Rt=["href"],Ot={class:"space-y-3"},Lt={class:"grid grid-cols-2 gap-3"},Pt={class:"bg-muted/30 rounded-lg p-3"},jt={class:"flex items-center gap-2 text-muted-foreground mb-1"},zt={class:"font-medium"},Ut={class:"bg-muted/30 rounded-lg p-3"},Wt={class:"flex items-center gap-2 text-muted-foreground mb-1"},Ht={class:"font-medium"},Kt={key:0,class:"space-y-3"},Gt={class:"bg-muted/30 rounded-lg p-4"},Yt={class:"flex items-start justify-between"},Qt={class:"flex items-start gap-3"},Jt={class:"h-9 w-9 rounded-lg bg-primary/10 flex items-center justify-center mt-0.5"},Xt={class:"font-medium"},Zt={class:"text-sm text-muted-foreground"},qt={class:"font-semibold"},en={class:"space-y-3"},tn={class:"bg-muted/30 rounded-lg p-4 space-y-3"},nn={class:"space-y-2 text-sm"},on={class:"flex justify-between"},sn={key:0,class:"flex justify-between"},rn={key:1,class:"flex justify-between text-green-600 dark:text-green-400"},an={class:"flex justify-between font-semibold"},ln={key:1,class:"space-y-2 text-sm"},cn={key:0,class:"flex justify-between"},un={class:"text-muted-foreground flex items-center gap-1.5"},dn={class:"text-green-600 dark:text-green-400"},pn={key:1,class:"flex justify-between"},mn={class:"text-muted-foreground flex items-center gap-1.5"},fn={class:"text-orange-600 dark:text-orange-400 font-medium"},hn=e.defineComponent({__name:"ReservationDetailDialog",emits:["cancelled"],setup(n,{expose:t,emit:o}){const{hasPermission:s}=S.useModulePermissions(),{config:a}=S.useModule(),l=S.useFirebaseIntegration(a.project),{confirm:i}=S.useConfirmation(),c=e.inject("event",e.ref(null)),u=o,d=e.ref(!1),r=e.ref(null),p=e.ref(!1),h=e.ref(null),f=e.ref(null),v=e.ref(null),C=x=>{r.value=x,d.value=!0},_=e.computed(()=>r.value?.customerInfo&&`${r.value.customerInfo.firstName} ${r.value.customerInfo.lastName}`.trim()||"Unknown Customer"),V=e.computed(()=>{let x=r.value?.status;const m=r.value?.reservationStatus;switch(["needs_approval","rejected","approved"].includes(m)&&(x=m),x){case"needs_approval":return{label:"needs approval",class:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400"};case"rejected":return{label:"rejected",class:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"};case"approved":return{label:"approved",class:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"};case"pending":return{label:"pending",class:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"};case"cancelled":return{label:"cancelled",class:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"};case"confirmed":return{label:"confirmed",class:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"};default:return{label:x||"unknown",class:"bg-muted text-muted-foreground"}}}),y=e.computed(()=>r.value?.status==="cancelled"),N=x=>x==null||typeof x!="number"?"—":`€${x?.toFixed(2)}`,b=x=>{if(!x)return"—";if(x<60)return`${x} min`;const m=Math.floor(x/60),k=x%60;return k>0?`${m}h ${k}min`:`${m}h`},R=()=>{if(!r.value)return;let x="";const m=c?.value?.date;if(m)try{x=new Date(m).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}catch{x=m}const k={date:x,resourceName:c?.value?.resource?.name};ht(r.value,k)},E=()=>{f.value?.openDialog(r.value)},A=()=>{h.value?.openDialog(r.value)},D=async()=>{if(r.value?.id){p.value=!0;try{await l.update(a.reservationsCollection,r.value.id,{status:"cancelled",cancelledAt:new Date().toISOString()}),r.value.status="cancelled",re.toast.success("Reservation cancelled successfully"),u("cancelled",r.value.id),d.value=!1}catch(x){console.error("Error cancelling reservation:",x),re.toast.error("Failed to cancel reservation")}finally{p.value=!1}}},$=()=>{console.log("Cancel with coupon:",r.value?.id)};return t({openDialog:C}),(x,m)=>{const k=e.resolveComponent("DialogTitle"),U=e.resolveComponent("DialogDescription"),B=e.resolveComponent("DialogHeader"),O=e.resolveComponent("Separator"),j=e.resolveComponent("Button"),_e=e.resolveComponent("DropdownMenuTrigger"),Y=e.resolveComponent("DropdownMenuLabel"),W=e.resolveComponent("DropdownMenuItem"),Q=e.resolveComponent("DropdownMenuGroup"),se=e.resolveComponent("DropdownMenuSeparator"),ye=e.resolveComponent("DropdownMenuContent"),Ne=e.resolveComponent("DropdownMenu"),Ee=e.resolveComponent("DialogFooter"),Ve=e.resolveComponent("DialogScrollContent"),Ae=e.resolveComponent("Dialog");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(Ae,{open:d.value,"onUpdate:open":m[0]||(m[0]=we=>d.value=we)},{default:e.withCtx(()=>[e.createVNode(Ve,{class:"sm:max-w-xl"},{default:e.withCtx(()=>[e.createVNode(B,null,{default:e.withCtx(()=>[e.createVNode(k,{class:"flex items-center gap-3"},{default:e.withCtx(()=>[m[1]||(m[1]=e.createElementVNode("span",null,"Reservation Details",-1)),e.createElementVNode("span",{class:e.normalizeClass(["px-2.5 py-1 text-xs font-medium rounded-full",V.value.class])},e.toDisplayString(V.value.label),3)]),_:1}),e.createVNode(U,null,{default:e.withCtx(()=>[e.createTextVNode(" Booking #"+e.toDisplayString(r.value?.id?.slice(0,8)||"—"),1)]),_:1})]),_:1}),r.value?(e.openBlock(),e.createElementBlock("div",wt,[e.createElementVNode("div",bt,[m[2]||(m[2]=e.createElementVNode("h3",{class:"text-sm font-semibold text-muted-foreground uppercase tracking-wide"},"Customer",-1)),e.createElementVNode("div",kt,[e.createElementVNode("div",Bt,[e.createElementVNode("div",Mt,[e.createVNode(e.unref(w.User),{size:20,class:"text-primary"})]),e.createElementVNode("div",null,[e.createElementVNode("p",$t,e.toDisplayString(_.value),1)])]),e.createElementVNode("div",Ft,[r.value.customerInfo?.email?(e.openBlock(),e.createElementBlock("div",St,[e.createVNode(e.unref(w.Mail),{size:14}),e.createElementVNode("a",{href:`mailto:${r.value.customerInfo.email}`,class:"hover:text-foreground transition-colors"},e.toDisplayString(r.value.customerInfo.email),9,It)])):e.createCommentVNode("",!0),r.value.customerInfo?.phone?(e.openBlock(),e.createElementBlock("div",Tt,[e.createVNode(e.unref(w.Phone),{size:14}),e.createElementVNode("a",{href:`tel:${r.value.customerInfo.phone}`,class:"hover:text-foreground transition-colors"},e.toDisplayString(r.value.customerInfo.phone),9,Rt)])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",Ot,[m[5]||(m[5]=e.createElementVNode("h3",{class:"text-sm font-semibold text-muted-foreground uppercase tracking-wide"},"Reservation",-1)),e.createElementVNode("div",Lt,[e.createElementVNode("div",Pt,[e.createElementVNode("div",jt,[e.createVNode(e.unref(w.Clock),{size:14}),m[3]||(m[3]=e.createElementVNode("span",{class:"text-xs"},"Time",-1))]),e.createElementVNode("p",zt,e.toDisplayString(r.value.startTime)+" - "+e.toDisplayString(r.value.endTime),1)]),e.createElementVNode("div",Ut,[e.createElementVNode("div",Wt,[e.createVNode(e.unref(w.Users),{size:14}),m[4]||(m[4]=e.createElementVNode("span",{class:"text-xs"},"Spots",-1))]),e.createElementVNode("p",Ht,e.toDisplayString(r.value.spots||1)+" "+e.toDisplayString(r.value.spots===1?"person":"people"),1)])])]),r.value.pricingOption?(e.openBlock(),e.createElementBlock("div",Kt,[m[6]||(m[6]=e.createElementVNode("h3",{class:"text-sm font-semibold text-muted-foreground uppercase tracking-wide"},"Package",-1)),e.createElementVNode("div",Gt,[e.createElementVNode("div",Yt,[e.createElementVNode("div",Qt,[e.createElementVNode("div",Jt,[e.createVNode(e.unref(w.Tag),{size:18,class:"text-primary"})]),e.createElementVNode("div",null,[e.createElementVNode("p",Xt,e.toDisplayString(r.value.pricingOption.name),1),e.createElementVNode("p",Zt,e.toDisplayString(b(r.value.pricingOption.duration)),1)])]),e.createElementVNode("p",qt,e.toDisplayString(N(r.value.pricingOption.price)),1)])])])):e.createCommentVNode("",!0),e.createElementVNode("div",en,[m[13]||(m[13]=e.createElementVNode("h3",{class:"text-sm font-semibold text-muted-foreground uppercase tracking-wide"},"Payment",-1)),e.createElementVNode("div",tn,[e.createElementVNode("div",nn,[e.createElementVNode("div",on,[m[7]||(m[7]=e.createElementVNode("span",{class:"text-muted-foreground"},"Base price",-1)),e.createElementVNode("span",null,e.toDisplayString(N(r.value.reservationBasePrice)),1)]),r.value.reservationAddOnsPrice?(e.openBlock(),e.createElementBlock("div",sn,[m[8]||(m[8]=e.createElementVNode("span",{class:"text-muted-foreground"},"Add-ons",-1)),e.createElementVNode("span",null,e.toDisplayString(N(r.value.reservationAddOnsPrice)),1)])):e.createCommentVNode("",!0),r.value.discount?(e.openBlock(),e.createElementBlock("div",rn,[m[9]||(m[9]=e.createElementVNode("span",null,"Discount",-1)),e.createElementVNode("span",null,"-"+e.toDisplayString(N(r.value.discount)),1)])):e.createCommentVNode("",!0)]),e.createVNode(O),e.createElementVNode("div",an,[m[10]||(m[10]=e.createElementVNode("span",null,"Reservation Total",-1)),e.createElementVNode("span",null,e.toDisplayString(N(r.value.reservationPrice)),1)]),r.value.amountPaid!==void 0||r.value.amountDue!==void 0?(e.openBlock(),e.createBlock(O,{key:0})):e.createCommentVNode("",!0),r.value.amountPaid!==void 0||r.value.amountDue!==void 0?(e.openBlock(),e.createElementBlock("div",ln,[r.value.amountPaid!==void 0?(e.openBlock(),e.createElementBlock("div",cn,[e.createElementVNode("span",un,[e.createVNode(e.unref(w.CreditCard),{size:14}),m[11]||(m[11]=e.createTextVNode(" Amount paid ",-1))]),e.createElementVNode("span",dn,e.toDisplayString(N(r.value.amountPaid)),1)])):e.createCommentVNode("",!0),r.value.amountDue!==void 0&&r.value.amountDue>0?(e.openBlock(),e.createElementBlock("div",pn,[e.createElementVNode("span",mn,[e.createVNode(e.unref(w.Receipt),{size:14}),m[12]||(m[12]=e.createTextVNode(" Amount due ",-1))]),e.createElementVNode("span",fn,e.toDisplayString(N(r.value.amountDue)),1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0),e.createVNode(Ee,{class:"gap-2 sm:justify-between"},{default:e.withCtx(()=>[r.value.reservationStatus==="needs_approval"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(j,{variant:"destructive",onClick:E},{default:e.withCtx(()=>[e.createVNode(e.unref(w.Ban),{size:16}),m[14]||(m[14]=e.createTextVNode(" Reject Reservation ",-1))]),_:1}),e.createVNode(j,{onClick:E},{default:e.withCtx(()=>[e.createVNode(e.unref(w.ClockCheck),{size:16}),m[15]||(m[15]=e.createTextVNode(" Approve Reservation ",-1))]),_:1})],64)):r.value.status==="confirmed"?(e.openBlock(),e.createBlock(Ne,{key:1},{default:e.withCtx(()=>[e.createVNode(_e,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(j,{variant:"outline",class:"gap-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(w.MoreHorizontal),{size:16}),m[16]||(m[16]=e.createTextVNode(" Actions ",-1))]),_:1})]),_:1}),e.createVNode(ye,{class:"w-60",align:"start"},{default:e.withCtx(()=>[e.createVNode(Y,{class:"text-xs text-muted-foreground font-normal"},{default:e.withCtx(()=>[...m[17]||(m[17]=[e.createTextVNode(" Reservation Actions ",-1)])]),_:1}),e.createVNode(Q,null,{default:e.withCtx(()=>[e.createVNode(W,{onClick:R,class:"gap-2 cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(e.unref(w.Download),{size:16,class:"text-muted-foreground"}),m[18]||(m[18]=e.createElementVNode("span",null,"Download PDF",-1))]),_:1})]),_:1}),e.createVNode(se),e.createVNode(Q,null,{default:e.withCtx(()=>[e.createVNode(Y,{class:"text-xs text-muted-foreground font-normal"},{default:e.withCtx(()=>[...m[19]||(m[19]=[e.createTextVNode(" Communication ",-1)])]),_:1}),e.createVNode(W,{onClick:E,class:"gap-2 cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(e.unref(w.MailCheck),{size:16,class:"text-muted-foreground"}),m[20]||(m[20]=e.createElementVNode("span",null,"(Re)send Confirmation Mail",-1))]),_:1})]),_:1}),e.unref(s)("manage-reservations")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(se),e.createVNode(Q,null,{default:e.withCtx(()=>[e.createVNode(Y,{class:"text-xs text-muted-foreground font-normal"},{default:e.withCtx(()=>[...m[21]||(m[21]=[e.createTextVNode(" Cancellation ",-1)])]),_:1}),e.createVNode(W,{onClick:A,class:"gap-2 cursor-pointer",variant:"destructive",disabled:y.value},{default:e.withCtx(()=>[e.createVNode(e.unref(w.XCircle),{size:16}),m[22]||(m[22]=e.createElementVNode("span",null,"Cancel Reservation",-1))]),_:1},8,["disabled"]),r.value?.reservationPrice&&r.value.reservationPrice>0?(e.openBlock(),e.createBlock(W,{key:0,onClick:$,class:"gap-2 cursor-pointer text-orange-600 dark:text-orange-400 focus:text-orange-600 dark:focus:text-orange-400",disabled:y.value},{default:e.withCtx(()=>[e.createVNode(e.unref(w.Gift),{class:"text-inherit",size:16}),m[23]||(m[23]=e.createElementVNode("span",null,"Cancel & Send Coupon",-1))]),_:1},8,["disabled"])):e.createCommentVNode("",!0)]),_:1})],64)):e.createCommentVNode("",!0)]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1})]),_:1},8,["open"]),e.createVNode(Dt,{ref_key:"cancelReservationDialog",ref:h,onCancel:D},null,512),e.createVNode(Vt,{ref_key:"resendConfirmationDialog",ref:f},null,512),e.createVNode(At,{ref_key:"transferReservationDialog",ref:v},null,512)],64)}}});exports.Fuse=z;exports._sfc_main=hn;