PageSourceSearch

https://app.opus1.io/releases/20261001T232935Z-57ecc7b471fc/async/16509.34e01d1c.js

js opus1.io collected 2026-10-03 21:41:20 UTC 99,750 bytes, 2 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c0fac312-b941-4902-8631-f26827b25927",e._sentryDebugIdIdentifier="sentry-dbid-c0fac312-b941-4902-8631-f26827b25927")}catch(e){}}();var _global="u">typeof window?window:"u">typeof global?global:"u">typeof self?self:{};_global.SENTRY_RELEASE={id:"57ecc7b471fce630a9a83e03af7702d6977a38be"};"use strict";(self.webpackChunkopus1io=self.webpackChunkopus1io||[]).push([["16509"],{2488:function(e,n,t){var i=t(48689),a=t(7091),l=t(26871);n.A=()=>(0,l.oz)(i.ACTION_UPDATE,a.RESOURCE_BUSINESS)},17124:function(e,n,t){var i=t(84577);function a(){var e=(0,i._)(["\n    color: #888;\n    font-weight: 500;\n    margin-top: 10px;\n    margin-bottom: 10px;\n"]);return a=function(){return e},e}n.A=t(17378).Ay.div(a())},51081:function(e,n,t){t.d(n,{Fv:function(){return f},KK:function(){return h},N$:function(){return m},_:function(){return v}});var i=t(71893),a=t(55456);t(45336),t(23446),t(82963),t(84560),t(60726),t(13467),t(76449);var l=t(74848);t(96540);var r=t(84941),s=t(24930),o=t(17535),c=t(8756),d=t(36596),u=t(53894),p=t(61963),m="invalid",h="no_items",v="loading",f="done_loading";n.Ay=e=>{var n,{title:t,reportName:y,isOpen:g,onClosed:b=()=>{},cleanupDataFn:C=e=>e.replace(/\\|\n|\r|,|"|'|  +/g,""),toggle:x,status:S,headers:T,items:A=[],invalidStatusMessage:w,children:N}=e,P=(0,u.A)();return S===f&&(n=A.map(e=>Object.keys(e).reduce((n,t)=>{var l=e[t];if("string"==typeof l){var r=l.replace(/"/g,'""'),s=C&&"function"==typeof C?C(r):r;return(0,a._)((0,i._)({},n),{[t]:s})}return(0,a._)((0,i._)({},n),{[t]:l})},{}))),(0,l.jsxs)(d.A,{centered:!0,isOpen:g,onClosed:b,toggle:x,modalName:"".concat(y,"-csv-export"),wrapClassName:"modal-primary modal-fit-content",size:"lg",children:[(0,l.jsx)(s.A,{toggle:x,children:t}),(0,l.jsxs)(o.A,{children:[S===m&&(0,l.jsx)("p",{className:"text-danger",children:w||"Requested time period must be no more than 12 months, please update your filters and try again"}),S===h&&(0,l.jsx)("p",{className:"text-danger",children:"No items found, please update your filters and try again"}),S===v&&(0,l.jsxs)("p",{className:"d-flex flex-column align-items-center",children:[(0,l.jsx)(p.A,{}),"".concat((A||[]).length," items loaded")]}),S===f&&(0,l.jsx)("p",{children:"Successfully loaded ".concat((A||[]).length," items")}),N]}),S===f&&(0,l.jsx)(c.A,{children:(0,l.jsx)(r.CSVLink,{id:"download-".concat(y,"-csv"),className:"btn btn-primary btn-rounded",filename:"".concat(y,"_report_").concat(P().format("LLL z").replaceAll(" ","_"),".csv"),headers:T,data:n,enclosingCharacter:'"',children:"Download CSV"})})]})}},47339:function(e,n,t){t.r(n),t.d(n,{default:function(){return ie}}),t(93632),t(5409);var i=t(74848),a=t(96540),l=t(52956),r=t(56347),s=t(65596),o=t(41374),c=t(71893),d=t(55456),u=t(84577);t(42273),t(45336),t(79936),t(60726),t(23446),t(38263);var p=t(5556),m=t.n(p),h=t(17378),v=t(50541);t(85417);var f=t(50926),y=t(50595),g=t(15257),b=t(4301),C=t(7091),x=t(48689),S=t(59003),T=t(60411),A=t(10769),w=t(89511),N=t(86095);function P(){var e=(0,u._)(["\n    width: 250px;\n    min-width: 365px;\n    height: 450px;\n    padding: 0 15px;\n    margin-bottom: 25px;\n"]);return P=function(){return e},e}function D(){var e=(0,u._)(["\n    position: relative;\n    -webkit-box-shadow: 0px 0px 20px 3px rgba(60, 70, 85, 0.1);\n    -moz-box-shadow: 0px 0px 20px 3px rgba(60, 70, 85, 0.1);\n    box-shadow: 0px 0px 20px 3px rgba(60, 70, 85, 0.1);\n    height: inherit;\n    background: white;\n"]);return D=function(){return e},e}function j(){var e=(0,u._)(["\n    bottom: 10px;\n    position: absolute;\n    right: 20px;\n    display: flex;\n"]);return j=function(){return e},e}function E(){var e=(0,u._)(["\n    padding: 0px 6px;\n    &:not(:last-child) {\n        margin-right: 5px;\n    }\n    padding: 2px 8px !important;\n    font-size: 10px !important;\n"]);return E=function(){return e},e}function _(){var e=(0,u._)(["\n    position: absolute;\n    top: 10px;\n    right: 10px;\n    color: #ffffff;\n    width: 50px;\n    height: 50px;\n    padding: 6px;\n    border-radius: 50%;\n    z-index: 1;\n    display: flex;
1\n    align-items: center;\n    text-align: center;\n    font-size: 11px;\n    background: rgb(126, 55, 148);\n    box-sizing: border-box;\n    font-weight: 700;\n"]);return _=function(){return e},e}function k(){var e=(0,u._)(["\n    width: 100%;\n"]);return k=function(){return e},e}function R(){var e=(0,u._)(["\n    padding: 20px 20px 0 20px;\n    height: 50%;\n    overflow: scroll;\n    -webkit-overflow-scrolling: touch;\n    margin-bottom: 20px;\n    width: 100%;\n    bottom: 15px;\n    position: absolute;\n    background-color: #ffffff;\n"]);return R=function(){return e},e}function O(){var e=(0,u._)(["\n    margin: 0;\n    color: #333333;\n    display: -ms-flexbox;\n    -ms-flex-pack: justify;\n    font-family: 'Montserrat', tahoma;\n    font-size: 18px;\n    font-weight: 600;\n    overflow: hidden;\n    white-space: nowrap;\n    text-overflow: ellipsis;\n"]);return O=function(){return e},e}function I(){var e=(0,u._)(["\n    color: #666666;\n    margin-top: 10px;\n    font-size: 14px !important;\n    line-height: 1.5em;\n    font-family: 'Montserrat', tahoma;\n"]);return I=function(){return e},e}function U(){var e=(0,u._)(["\n    padding-left: 6px;\n    display: flex;\n    flex-flow: row wrap-reverse;\n    width: 100%;\n    position: absolute;\n    height: 50px;\n    z-index: 1;\n    top: 135px;\n"]);return U=function(){return e},e}function V(){var e=(0,u._)(["\n    height: fit-content;\n    margin-right: 3px;\n"]);return V=function(){return e},e}var L=h.Ay.div(P()),B=h.Ay.div(D()),M=h.Ay.div(j()),F=(0,h.Ay)(b.Sh)(E()),W=h.Ay.div(_()),q=h.Ay.img(k()),H=h.Ay.div(R()),z=h.Ay.h4(O()),Y=h.Ay.p(I()),G=h.Ay.div(U()),$=(0,h.Ay)(g.mH)(V()),K=e=>{var{}=e,n=(0,y._)({},e),{service:t,index:a}=n,l=null;return l=t.mainPhoto?(0,S.Ay)(t.mainPhoto,400,225,"service"):(0,S.Ay)(A.I,400,225,"service"),(0,i.jsx)(L,{className:"service-card",children:(0,i.jsxs)(B,{children:[(0,i.jsxs)("div",{children:[t.requiresBooking&&t.durationMinutes&&(0,i.jsx)(W,{children:"".concat(t.durationMinutes," Mins")}),(0,i.jsx)(q,{src:l}),t.tags&&(0,i.jsx)(G,{children:t.tags.slice(0,5).sort().map((e,n)=>(0,i.jsx)($,{children:e},n))})]}),(0,i.jsxs)(H,{children:[(0,i.jsx)(z,{className:"service-name",children:t.name}),t.deactivated&&(0,i.jsx)(N.A,{text:"This service has been deactivated",className:"mb-2"}),(0,i.jsx)(Y,{children:t.shortDescription})]}),(0,i.jsxs)(M,{children:[t.hasSessions&&(0,i.jsx)(T.A,{action:x.ACTION_UPDATE,resource:C.RESOURCE_SERVICE,children:(0,i.jsx)(F,{className:"sessions-service btn-cancel",onClick:()=>(0,w.Lm)(t.id,t.eventType),children:t.eventType?"Events":"Classes"})}),t.requiresBooking&&(0,i.jsx)(T.A,{action:x.ACTION_CREATE,resource:C.RESOURCE_SERVICE,children:(0,i.jsx)(F,{onClick:()=>n.batchDuplicate(t),className:"batch-duplicate-service btn-cancel",children:"Batch Duplicate"})}),(0,i.jsx)(T.A,{action:x.ACTION_CREATE,resource:C.RESOURCE_SERVICE,children:(0,i.jsx)(F,{className:"duplicate-service btn-cancel",onClick:()=>n.duplicate(t.id),children:"Duplicate"})}),(0,i.jsx)(T.A,{action:x.ACTION_UPDATE,resource:C.RESOURCE_SERVICE,children:(0,i.jsx)(F,{className:"update-service btn-cancel",onClick:()=>n.edit(t.id),children:"Update"})}),(0,i.jsx)(T.A,{action:x.ACTION_DELETE,resource:C.RESOURCE_SERVICE,children:(0,i.jsx)(F,{className:"remove-service btn-cancel",onClick:()=>n.remove(t.id),children:"Remove"})})]})]})})},J=t(95345);function Q(){var e=(0,u._)(["\n    min-width: 100%;\n    display: flex;\n    align-items: center;\n    border-bottom: 1px solid #e9eef3;\n    position: relative;\n    padding: 15px 0;\n"]);return Q=function(){return e},e}function Z(){var e=(0,u._)(["\n    float: left !important;\n    margin-right: 10px;\n    width: 100px;\n    height: 75px;\n    object-fit: cover;\n"]);return Z=function(){return e},e}function X(){var e=(0,u._)(["\n    overflow: hidden;\n    width: 60%;\n    min-height: 75px;\n    @media (max-width: 850px) {\n        width: unset;\n        margin-right: 10px;\n    }\n"]);return X=function(){return e},e}function ee(){var e=(0,u._)(["\n    margin: 0;\n    color: #333333;\n    display: -ms-flexbox;\n    -ms-flex-pack: justify;\n    font-family: 'Montserrat', tahoma;\n    font-size: 18px;\n    font-weight: 600;\n    overflow: hidden;\n    white-space: wrap;\n    text-overflow: ellipsis;\n    @media only screen and (max-width: 400px) {\n        font-size: 15px;\n        font-weight: 500;\n    }\n"]);return ee=function(){return e},e}function en(){var e=(0,u._)(["\n    /* margin-top: 20px; */\n    min-height: 44px;\n    flex-wrap: wrap;
1\n    align-items: end;\n    display: flex;\n    overflow: hidden;\n    -webkit-overflow-scrolling: touch;\n    bottom: 0;\n    @media (max-width: 850px) {\n        margin-top: 6px;\n        min-height: auto;\n    }\n"]);return en=function(){return e},e}function et(){var e=(0,u._)(["\n    right: 25px;\n    bottom: 25px;\n    position: absolute;\n    display: flex;\n    @media (max-width: 850px) {\n        padding-top: 4px;\n        position: unset;\n    }\n"]);return et=function(){return e},e}function ei(){var e=(0,u._)(["\n    margin-right: 5px;\n\n    @media only screen and (max-width: 400px) {\n        font-size: 9px;\n    }\n"]);return ei=function(){return e},e}function ea(){var e=(0,u._)(["\n    margin-right: 3px;\n    margin-bottom: 3px;\n    height: fit-content;\n    @media only screen and (max-width: 400px) {\n        font-size: 9px;\n    }\n"]);return ea=function(){return e},e}function el(){var e=(0,u._)(["\n    display: flex;\n    @media screen and (max-width: 500px) {\n        display: none !important;\n    }\n"]);return el=function(){return e},e}function er(){var e=(0,u._)(["\n    font-size: 12px;\n    color: #8e99af;\n    font-weight: 600;\n    line-height: 1.1;\n    min-height: 15px;\n    @media (max-width: 850px) {\n        min-height: auto;\n    }\n"]);return er=function(){return e},e}function es(){var e=(0,u._)(["\n    width: 100%;\n    margin-top: 10px;\n    margin-bottom: 5px;\n"]);return es=function(){return e},e}var eo=h.Ay.div(Q()),ec=h.Ay.img(Z()),ed=h.Ay.div(X()),eu=h.Ay.h4(ee()),ep=h.Ay.div(en()),em=h.Ay.div(et()),eh=(0,h.Ay)(b.Sh)(ei()),ev=(0,h.Ay)(g.mH)(ea()),ef=h.Ay.div(el()),ey=h.Ay.div(er()),eg=h.Ay.div(es()),eb=e=>{var{className:n,service:t,duplicate:a,batchDuplicate:l,edit:r,remove:s,toggleSelect:o,selected:c}=e,d=null;return d=t.mainPhoto?(0,S.Ay)(t.mainPhoto,400,300,"service"):(0,S.Ay)(A.I,400,300,"service"),(0,i.jsxs)(eo,{className:n,children:[(0,i.jsx)(ec,{src:d}),(0,i.jsxs)(ed,{children:[(0,i.jsx)(eu,{className:"name",children:t.name}),(0,i.jsx)(ey,{children:(null==t?void 0:t.requiresBooking)&&(null==t?void 0:t.durationMinutes)?"".concat(t.durationMinutes," Mins"):""}),(0,i.jsxs)(ep,{children:[t.deactivated&&(0,i.jsx)(eg,{children:(0,i.jsx)(N.A,{text:"This service has been deactivated"})}),t.tags&&t.tags.map((e,n)=>(0,i.jsx)(ev,{children:e},n))]}),(0,i.jsxs)(em,{children:[t.hasSessions&&(0,i.jsx)(T.A,{action:x.ACTION_UPDATE,resource:C.RESOURCE_SERVICE,children:(0,i.jsx)(eh,{className:"sessions-service btn-cancel",onClick:()=>(0,w.Lm)(t.id,t.eventType),children:t.eventType?"Events":"Classes"})}),t.requiresBooking&&(0,i.jsx)(T.A,{action:x.ACTION_CREATE,resource:C.RESOURCE_SERVICE,children:(0,i.jsx)(eh,{onClick:()=>l(t),className:"batch-duplicate-service btn-cancel",children:"Batch Duplicate"})}),(0,i.jsx)(T.A,{action:x.ACTION_CREATE,resource:C.RESOURCE_SERVICE,children:(0,i.jsx)(eh,{onClick:()=>a(t.id),className:"duplicate-service btn-cancel",children:"Duplicate"})}),(0,i.jsx)(T.A,{action:x.ACTION_UPDATE,resource:C.RESOURCE_SERVICE,children:(0,i.jsx)(eh,{onClick:()=>r(t.id),className:"update-service btn-cancel",children:"Update"})}),(0,i.jsx)(T.A,{action:x.ACTION_DELETE,resource:C.RESOURCE_SERVICE,children:(0,i.jsx)(eh,{onClick:()=>s(t.id),className:"remove-service btn-cancel",children:"Remove"})}),(0,i.jsx)(ef,{children:(0,i.jsx)(T.A,{action:x.ACTION_UPDATE,resource:C.RESOURCE_SERVICE,children:(0,i.jsx)(J.A,{className:"mb-0 ml-2",checkedColor:"#4555a4",isChecked:c,onClick:()=>o(t)})})})]})]})]})},eC=t(21002),ex=t(22694),eS=t(94362),eT=t(61734),eA=t(69530),ew=t(38566),eN=t(50613),eP=t(60469),eD=t(50467);t(521);class ej extends a.Component{UNSAFE_componentWillReceiveProps(e){var{isNotShowing:n}=this.props,{isNotShowing:t,onHide:i,value:a}=e;!n&&t&&i&&i(a)}render(){var{className:e,errors:n,isRequired:t,isNotShowing:a,title:l,value:r,textAddon:s,icon:o,style:c,labelStyle:d}=this.props;if(a)return null;var u=l.toLowerCase().split(" ").join("-");return(0,i.jsx)("div",{className:"event-section ".concat(e),style:c,children:(0,i.jsxs)("label",{htmlFor:u,style:d,children:[l||(0,i.jsx)("br",{})," ",t&&"*",(0,i.jsxs)("div",{className:this.props.icon&&"icon-field",children:[o&&(0,i.jsx)("span",{className:"icon",children:(0,i.jsx)("i",{className:"material-icons ".concat(s&&"txt-center"),children:o})}),this.renderChildren()]}),t&&!r&&(0,i.jsx)("div",{className:"text-danger",children:"required"}),n]})})}constructor(...e){super(...e),(0,eD._)(this,"renderChildren",()=>a.Children.map(this.props.children,e=>a.cloneElement(e,(0,d._)((0,c._)({},e.props),{value:e.props.value||this.props.value,onChange:e.props.onChange||this.props.onChange,className:"".concat(e.props.className," field")}))))}}ej.propTypes={className:m().string,children:m().object,errors:m().arrayOf(m().any),isRequired:m().bool,isNotShowing:m().bool,onCh
1ange:m().func,onHide:m().func,title:m().string,value:m().any},ej.defaultProps={children:[],className:"",errors:[],isRequired:!1,isNotShowing:!1,onChange:null,onHide:null,value:null,title:""};var eE=t(90089),e_=t(44123);t(69861),t(5127),t(65857),t(33676),t(97857),t(4810),t(60865),t(3101),t(39112),t(75516),t(2070),t(96030),t(92167),t(47786),t(19808),t(56059),t(78736),t(68121),t(79389),t(75927),t(72859),t(15441),t(16028),t(3182),t(91625),t(34678),t(41455);var ek=t(86123),eR=t(25167),eO=t(69348),eI=t(57682),eU=t(11387),eV=t.n(eU),eL=t(6251),eB=t(2543),eM=t(35979),eF=t(43271),eW=t(53115),eq=t(48810),eH=t(36596),ez=t(12163),eY=t(77999),eG=t(37762),e$=t(93092);t(13467),t(39938),t(3409);var eK=t(59532),eJ=t.n(eK),eQ=t(19919),eZ=t.n(eQ),eX=t(70537),e0=t(53444),e1=t(17124),e6=t(39343),e2=t(6702),e5=t(73673),e3=t(71913),e8=t(6683),e4=t(27045),e9=t(40254),e7=t(59769),ne=t(9690),nn=t(28842),nt=t(5578),ni=t(10400),na=t(16517),nl=t(84028);function nr(){var e=(0,u._)(["\n    width: 100%;\n"]);return nr=function(){return e},e}function ns(){var e=(0,u._)(["\n    width: 180px;\n    margin-right: 25px;\n    margin-bottom: 0;\n"]);return ns=function(){return e},e}function no(){var e=(0,u._)(["\n    height: fit-content;\n    padding: 8px;\n    align-self: center;\n"]);return no=function(){return e},e}function nc(){var e=(0,u._)(["\n    font-size: 11px;\n    padding: 2px 6px;\n    border-radius: 4px;\n    cursor: pointer;\n    background: var(--bs-secondary-bg-subtle, #e9ecef);\n    color: var(--bs-secondary, #6c757d);\n    border: 1px solid var(--bs-gray-400, #ced4da);\n\n    &:hover {\n        background: var(--bs-gray-300, #dee2e6);\n    }\n"]);return nc=function(){return e},e}var nd=(0,h.Ay)(ez.A)(nr()),nu=(0,h.Ay)(ez.A)(ns()),np=(0,h.Ay)(eX.A)(no()),nm="money",nh="rate",nv="number",nf=e=>{var{inputGroups:n,setInputGroups:t,numberType:a=nv}=e,r=(0,l.useSelector)(e=>e.app.business.defaultCurrency),s=null,o=null,u=null,p=null;return a===nm&&(s=(0,e6.PH)(r),o="money-bill-wave",u="Price update patterns"),a===nh&&(s=eZ()({allowLeadingZeroes:!1,includeThousandsSeparator:!1,allowDecimal:!0,requireDecimal:!1,prefix:"",suffix:" %",decimalLimit:3}),o="percent",u="Rate update patterns"),a===nv&&(s=eZ()({allowLeadingZeroes:!1,includeThousandsSeparator:!1,allowDecimal:!1,requireDecimal:!1,prefix:"",suffix:""}),p="tune",u="Number update patterns"),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"mb-2",children:u}),n.map((e,a)=>(0,i.jsxs)("div",{className:"d-flex flex-row",children:[(0,i.jsx)(nu,{field:{id:"from-input-group",title:"From:",faIcon:o,materialIcon:p},children:(0,i.jsx)(eJ(),{id:"input-group-from-".concat(e.id),value:e.from,className:"form-control number-type-from-".concat(a),onChange:e=>{var i;return i=e.target.value,void([i]=i.split(" "),i=Number(i),t(n.map((e,n)=>n===a?(0,d._)((0,c._)({},e),{from:i}):e)))},mask:s})}),(0,i.jsx)(nu,{field:{id:"to-input-group",title:"To:",faIcon:o,materialIcon:p},children:(0,i.jsx)(eJ(),{id:"input-group-to-".concat(e.id),value:e.to,className:"form-control number-type-to-".concat(a),onChange:e=>{var i;return i=e.target.value,void([i]=i.split(" "),i=Number(i),t(n.map((e,n)=>n===a?(0,d._)((0,c._)({},e),{to:i}):e)))},mask:s})}),(0,i.jsx)(np,{fasIcon:"trash-alt fa-fw delete-status",onClick:()=>{t(n.filter((e,n)=>n!==a))},tooltip:"remove"})]},e.id)),(0,i.jsxs)(eP.A,{onMouseDown:e=>e.preventDefault(),className:"btn btn-rounded btn-primary btn-icon btn-sm mt-2 mb-2",type:"button",onClick:()=>t([...n,{id:(0,ek.A)(),from:0,to:0}]),id:"btn-add-price-update-pattern",children:[(0,i.jsx)(eX.A,{farIcon:"plus"}),"Add more patterns"]})]})},ny=e=>(0,i.jsx)(nf,(0,d._)((0,c._)({},e),{numberType:nm})),ng=h.Ay.span(nc()),nb=e=>{var{label:n,newToggleValue:t,setNewToggleValue:a}=e;return(0,i.jsx)(e5.A,{id:"toggle",label:n,onChange:()=>a(!t),isChecked:t})},nC=[{value:ne.SUBSCRIPTION_SCOPE_SIBLING,label:"Siblings only (peers)"},{value:ne.SUBSCRIPTION_SCOPE_HOUSEHOLD,label:"Household (includes account managers)"}],nx=[{label:"Expires 30 days after purchase",value:30},{label:"Expires 60 days after purchase",value:60},{label:"Expires 90 days after purchase",value:90},{label:"Expires 180 days after purchase",value:180},{label:"Expires 365 days after purchase",value:365}],nS=e=>(0,nl.fv)(e)||"(no expiration)",nT={price:ny,pricePerVisit:ny,signupPrice:ny,signupWaivedIfMember:nb,deposit:ny,householdDiscount:e=>{var{discountTransformations:n,setDiscountTransformations:t}=e,a=(0,l.useSelector)(e=>e.app.business.defaultCurrency),r=(0,l.useSelector)(e=>{var n;return null==(n=e.app.business)?void 0:n.variableRatePlanDefaultHouseholdDiscountTarget}),s=(0,e6.PH)(a),o=eZ()({allowLeadingZeroes:!1,includeThousandsSeparator:!1,allowDecimal:!0,requireDecimal
1:!1,prefix:"",suffix:" %",decimalLimit:3}),d=r||ne.DISCOUNT_ON_PLAN,u=(e,n)=>{t(t=>t.map((t,i)=>i===e?(0,c._)({},t,n):t))},p=e=>{var n=String(e||"").split(" ")[0],t=parseFloat(n=n.replace(/[^0-9.]/g,""));return Number.isNaN(t)?0:t},m=e=>e===ne.DISCOUNT_ON_PLAN?ne.DISCOUNT_ON_PER_LESSON_BASIS:ne.DISCOUNT_ON_PLAN,h=n.some(e=>e.toType===ne.DISCOUNT_TYPE_FLAT&&e.discountTarget===ne.DISCOUNT_ON_PER_LESSON_BASIS);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"mb-2",children:"Discount transformation rules"}),(0,i.jsx)("div",{className:"text-muted small mb-2",children:'Click the icon to toggle between $ and %. Use 0 in "From" to add a new discount, or in "To" to remove.'}),n.map((e,a)=>(0,i.jsxs)("div",{className:"d-flex flex-row align-items-center mb-2",children:[(0,i.jsx)("span",{className:"text-muted",style:{lineHeight:"38px",marginRight:"12px"},children:"From:"}),(0,i.jsx)(nu,{field:{id:"from-input-".concat(a),faIcon:e.fromType===ne.DISCOUNT_TYPE_FLAT?"money-bill-wave":"percent"},onIconClick:()=>{u(a,{fromType:e.fromType===ne.DISCOUNT_TYPE_FLAT?ne.DISCOUNT_TYPE_PERCENT:ne.DISCOUNT_TYPE_FLAT,fromAmount:0})},children:(0,i.jsx)(eJ(),{id:"discount-transform-from-".concat(e.id),value:e.fromAmount,className:"form-control",onChange:e=>{u(a,{fromAmount:p(e.target.value)})},mask:e.fromType===ne.DISCOUNT_TYPE_FLAT?s:o})}),e.fromType===ne.DISCOUNT_TYPE_FLAT&&(0,i.jsx)(ng,{onClick:()=>{var e;(e=n[a]).fromType===ne.DISCOUNT_TYPE_FLAT&&u(a,{fromDiscountTarget:m(e.fromDiscountTarget)})},title:"Click to toggle - match plans with this target",className:"ms-2",children:e.fromDiscountTarget===ne.DISCOUNT_ON_PER_LESSON_BASIS?"per lesson":"plan total"}),e.fromType===ne.DISCOUNT_TYPE_PERCENT&&(0,i.jsx)(ng,{style:{opacity:.6,cursor:"not-allowed"},title:"Percentage discounts always use plan total",className:"ms-2",children:"plan total"}),(0,i.jsx)(eX.A,{fasIcon:"arrow-right",className:"mx-3 text-muted",style:{lineHeight:"38px"}}),(0,i.jsx)("span",{className:"text-muted",style:{lineHeight:"38px",marginRight:"12px"},children:"To:"}),(0,i.jsx)(nu,{field:{id:"to-input-".concat(a),faIcon:e.toType===ne.DISCOUNT_TYPE_FLAT?"money-bill-wave":"percent"},onIconClick:()=>{var n,t;return t={toType:n=e.toType===ne.DISCOUNT_TYPE_FLAT?ne.DISCOUNT_TYPE_PERCENT:ne.DISCOUNT_TYPE_FLAT,toAmount:0},void(n===ne.DISCOUNT_TYPE_PERCENT&&(t.discountTarget=ne.DISCOUNT_ON_PLAN),u(
1a,t))},children:(0,i.jsx)(eJ(),{id:"discount-transform-to-".concat(e.id),value:e.toAmount,className:"form-control",onChange:e=>{u(a,{toAmount:p(e.target.value)})},mask:e.toType===ne.DISCOUNT_TYPE_FLAT?s:o})}),e.toType===ne.DISCOUNT_TYPE_FLAT&&(0,i.jsx)(ng,{onClick:()=>{var e;(e=n[a]).toType===ne.DISCOUNT_TYPE_FLAT&&u(a,{discountTarget:m(e.discountTarget)})},title:"Click to toggle target (per-lesson requires variable rate plan)",className:"ms-2",children:e.discountTarget===ne.DISCOUNT_ON_PER_LESSON_BASIS?"per lesson":"plan total"}),e.toType===ne.DISCOUNT_TYPE_PERCENT&&(0,i.jsx)(ng,{style:{opacity:.6,cursor:"not-allowed"},title:"Percentage discounts always apply to plan total",className:"ms-2",children:"plan total"}),(0,i.jsx)(np,{fasIcon:"trash-alt fa-fw delete-status",onClick:()=>{t(e=>e.filter((e,n)=>n!==a))},tooltip:"remove"})]},e.id)),(0,i.jsxs)(eP.A,{onMouseDown:e=>e.preventDefault(),className:"btn btn-rounded btn-primary btn-icon btn-sm mt-2 mb-2",type:"button",onClick:()=>t(e=>[...e,{id:(0,ek.A)(),fromType:ne.DISCOUNT_TYPE_FLAT,fromAmount:0,fromDiscountTarget:d,toType:ne.DISCOUNT_TYPE_FLAT,toAmount:0,discountTarget:d}]),id:"btn-add-discount-transformation",children:[(0,i.jsx)(eX.A,{farIcon:"plus"}),"Add more rules"]}),h&&(0,i.jsx)(N.A,{className:"mt-2",text:"Per-lesson target requires a variable rate plan. Non-variable-rate plans will be skipped."})]})},householdDiscountScope:e=>{var{newTextValue:n,setNewTextValue:t}=e;return(0,i.jsx)(eL.Ay,{classNamePrefix:"react-select",id:(0,eY.mU)({instanceId:"subscription-scope"}),styles:eY.K6,options:nC,value:nC.find(e=>e.value===n),onChange:e=>t((null==e?void 0:e.value)||ne.SUBSCRIPTION_SCOPE_SIBLING),placeholder:"Select eligibility scope..."})},enabledForSelfBooking:nb,creditValidityDays:e=>{var{newToggleValue:n,setNewToggleValue:t,newValue:a,setNewValue:l}=e;return(0,i.jsxs)("div",{className:"mb-4",children:[(0,i.jsx)(e5.A,{label:"Should this lesson pack ever expire?",onChange:()=>{var e=!0!==n;t(e),e?null==a&&l(90):l(null)},id:"credit-validity-enabled",isChecked:!0===n}),!0===n&&(0,i.jsx)(nd,{field:{id:"credit-validity-days",title:"Expiration",faIcon:"clock"},children:(0,i.jsx)(eL.Ay,{classNamePrefix:"react-select",id:(0,eY.mU)({instanceId:"batch-credit-validity-days"}),styles:eY.K6,options:nx,value:nx.find(e=>e.value===a),onChange:e=>{var n;return l(null!=(n=null==e?void 0:e.value)?n:null)}})})]})},taxRate:e=>(0,i.jsx)(nf,(0,d._)((0,c._)({},e),{numberType:nh})),holdPossible:nb,useBillingPolicyForRegistrationAndDiscounts:nb,autoPayDeltaDays:e=>{var{newValue:n,setNewValue:t}=e,[a,l]=(0,e7.A)(!!n);return(0,i.jsxs)("div",{className:"mb-4",children:[(0,i.jsx)(e5.A,{label:"Should the monthly invoice auto-pay be processed a certain number of days before or after due date?",onChange:()=>{var e=!a;l(),e||t(0)},id:"auto-pay-delta-days",isChecked:a}),a&&(0,i.jsx)(e9.k,{initialValue:n,onChange:e=>{e!==n&&t(e)}})]})},latePaymentDays:nf,latePaymentAmount:ny,requiresTermsAndConditionsAcceptance:nb,makesMember:nb,makesLifetimeMember:nb,countStaffCanceledVisits:nb,recurringInvoiceNote:e=>{var{label:n,newTextValue:t,setNewTextValue:a}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{children:n}),(0,i.jsx)("textarea",{id:"input",onChange:e=>a(e.target.value),value:t,label:"Input",placeholder:"Recurring invoice note",className:"form-control mt-2"})]})},visitPreEnrollHoldDays:nf},nA={enabledForSelfBooking:"Enable/disable for self booking (multi-visit plans)",creditValidityDays:"Lesson pack credit expiration (multi-visit plans)"},nw=e=>{var{service:n,plan:t,visitPackSelfBookingEnabled:i}=e;return t.canBePurchasedWithoutBooking&&t.paymentType!==na.iR&&(0,ni.YK)({plan:t})===ni.oL&&(0,nn.B)({serviceType:(0,eG.Y)(n),plan:t,visitPackSelfBookingEnabled:i})},nN=e=>e.canBePurchasedWithoutBooking&&e.paymentType!==na.iR&&(0,ni.YK)({plan:e})===ni.oL&&!e.visitPreEnroll,nP={householdDiscount:{title:"Household discount",planAttribute:"discountPolicy",extraContext:{householdDiscountTransformation:!0}},householdDiscountScope:{title:"Household discount eligibility scope",planAttribute:"discountPolicy",extraContext:{householdDiscountScope:!0}}},nD=(e,n)=>{var t=e.find(e=>n?e.from===n:0===e.from);return t?t.to:n},nj=e=>
1{var{selectedPlanAttribute:n,plan:t,inputGroups:a,newToggleValue:l,newValue:r,newTextValue:s,discountTransformations:o}=e,c=nA[n.value]||(null==(A=e0.wQ.properties[n.value])?void 0:A.title)||(0,f.Cv)(n.value),d=e=>e,u=e=>e;if(["price","pricePerVisit","signupPrice","deposit"].includes(n.value)&&(d=e=>"".concat((0,e2.og)(null,e||0)),u=()=>"".concat((0,e2.og)(null,nD(a,t[n.value])))),n.value in nP){({title:c}=nP[n.value]);var{planAttribute:p,extraContext:m}=nP[n.value];if("discountPolicy"===p&&m.householdDiscountTransformation){var h,v,y,g,b,C,x,S,T,A,w,N,P=null==(w=t.discountPolicy)?void 0:w.discountType,D=(null==(N=t.discountPolicy)?void 0:N.discountRate)||0;d=P&&0!==D?P===ne.DISCOUNT_TYPE_FLAT?()=>(0,e2.og)(null,D):()=>"".concat(D,"%"):()=>"(no discount)";var j=(h=o||[],b=(null==(v=t.discountPolicy)?void 0:v.discountType)||null,C=(null==(y=t.discountPolicy)?void 0:y.discountRate)||0,x=(null==(g=t.discountPolicy)?void 0:g.discountTarget)||null,S=null,T=null,h.forEach(e=>{var{fromType:n,fromAmount:t,fromDiscountTarget:i}=e;if(0===t)b&&0!==C||(T={matched:!0,toType:e.toType,toAmount:e.toAmount,toTarget:e.discountTarget});else if(b===n&&C===t&&(!i||i===x)){var a=b!==e.toType||null===e.toType?e.discountTarget:x,l={matched:!0,toType:e.toType,toAmount:e.toAmount,toTarget:a};i===x?S=l:i||(T=l)}}),S||T||{matched:!1});if(j.matched)if(j.toType&&0!==j.toAmount)if(j.toType===ne.DISCOUNT_TYPE_FLAT){var E=j.toTarget===ne.DISCOUNT_ON_PER_LESSON_BASIS?" per lesson":"";u=()=>"".concat((0,e2.og)(null,j.toAmount)).concat(E)}else u=()=>"".concat(j.toAmount,"%");else{var _=!P||0===D;u=()=>_?"(no change)":"(remove discount)"}else u=()=>"(no matching rule)"}else if("discountPolicy"===p&&m.householdDiscountScope){var k,R=(null==(k=t.discountPolicy)?void 0:k.subscriptionScope)||ne.SUBSCRIPTION_SCOPE_SIBLING,O={[ne.SUBSCRIPTION_SCOPE_SIBLING]:"Siblings only",[ne.SUBSCRIPTION_SCOPE_HOUSEHOLD]:"Household"};d=()=>O[R]||R,u=()=>O[s]||s||"(not set)"}}return["latePaymentAmount"].includes(n.value)&&(d=e=>0===e||null==e?"(disabled)":"".concat((0,e2.og)(null,e||0)),u=()=>{var e=nD(a,t[n.value]);return 0===e||null==e?"(disabled)":"".concat((0,e2.og)(null,e))}),["signupWaivedIfMember","enabledForSelfBooking","requiresTermsAndConditionsAcceptance","makesMember","holdPossible","useBillingPolicyForRegistrationAndDiscounts","makesLifetimeMember","countStaffCanceledVisits"].includes(n.value)&&(d=e=>"".concat(e?"Yes":"No"),u=()=>"".concat(l?"Yes":"No")),["taxRate"].includes(n.value)&&(d=e=>"".concat(e," %"),u=()=>"".concat(nD(a,t[n.value])," %")),["latePaymentDays"].includes(n.value)&&(u=()=>"".concat(nD(a,t[n.value]))),["autoPayDeltaDays"].includes(n.value)&&(d=e=>{if(!e)return"0 days (on due date)";var n=Math.abs(e);return"".concat(n," day(s) ").concat(e<0?"before":"after")},u=()=>{if(!r)return"0 days (on due date)";var e=Math.abs(r);return"".concat(e," day(s) ").concat(r<0?"before":"after")}),["recurringInvoiceNote"].includes(n.value)&&(d=e=>"".concat(e||"(none)"),u=()=>"".concat(s||"(none)")),"creditValidityDays"===n.value&&(d=e=>nS(e),u=()=>null==l?"(choose expiration setting above)":l?null==r?"(select expiration)":nS(r):"(no expiration)"),(0,i.jsx)("li",{children:"".concat(t.name," - ").concat(c,": ").concat(d(t[n.value])," ➔ ").concat(u(),"\n    ")})},nE=e=>{var{services:n,paymentPlanBatchUpdateState:t,setPaymentPlanBatchUpdateState:r}=e,{selectedPlanAttribute:s,paymentPlanNameFilter:o,inputGroups:u,newValueBoolean:p,newValue:m,newTextValue:h,discountTransformations:v}=t,y=(0,l.useSelector)(e=>e.app.business),g=(0,l.useSelector)(e=>{var n;return null==(n=e.app.business)?void 0:n.variableRatePlanDefaultHouseholdDiscountTarget}),b=(null==y?void 0:y.tuitionPolicyEnabled)===!0,C=(0,nt.yH)(y,nt.t0),x=C&&n.some(e=>e.plans.some(n=>nw({service:e,plan:n,visitPackSelfBookingEnabled:C}))),S=n.some(e=>e.plans.some(e=>nN(e))),T=(0,a.useCallback)(e=>{r(n=>(0,d._)((0,c._)({},n),{selectedPlanAttribute:e}))},[r]),A=(0,a.useCallback)(e=>{r(n=>(0,d._)((0,c._)({},n),{inputGroups:e}))},[r]),w=(0,a.useCallback)(e=>{r(n=>(0,d._)((0,c._)({},n),{discountTransformations:"function"==typeof e?e(n.discountTransformations):e}))},[r]),N=s&&nT[s.value],P=()=>!0,D=(0,f.EL)(o);o&&D?P=e=>e.match(D):o&&(P=e=>e.includes(o)),(0,a.useEffect)(()=>
1{if(s){r(e=>(0,d._)((0,c._)({},e),{newValueBoolean:"creditValidityDays"===s.value&&null,newValue:"creditValidityDays"===s.value?null:0,newTextValue:""})),A((0,eB.cloneDeep)([{id:(0,ek.A)(),from:0,to:0}]));var e=g||ne.DISCOUNT_ON_PLAN;w([{id:(0,ek.A)(),fromType:ne.DISCOUNT_TYPE_FLAT,fromAmount:0,fromDiscountTarget:e,toType:ne.DISCOUNT_TYPE_FLAT,toAmount:0,discountTarget:e}])}},[s,A,w,r,g]),(0,a.useEffect)(()=>{(b||(null==s?void 0:s.value)!=="useBillingPolicyForRegistrationAndDiscounts")&&(x||(null==s?void 0:s.value)!=="enabledForSelfBooking")&&(S||(null==s?void 0:s.value)!=="creditValidityDays")||T(null)},[b,x,S,s,T]);var j=n.map(e=>e.plans.filter(n=>P(n.name)&&n.canBeDeleted&&((null==s?void 0:s.value)!=="enabledForSelfBooking"||nw({service:e,plan:n,visitPackSelfBookingEnabled:C}))&&((null==s?void 0:s.value)!=="creditValidityDays"||nN(n)))).flat().length>0,E=(null==n?void 0:n.length)&&(0,eG.Y)(n[0]),_=Object.keys(nT).filter(e=>(E===e8.Yc||"holdPossible"!==e)&&(b||"useBillingPolicyForRegistrationAndDiscounts"!==e)&&(x||"enabledForSelfBooking"!==e)&&(S||"creditValidityDays"!==e)).map(e=>{var n,t=nA[e]||(null==(n=e0.wQ.properties[e])?void 0:n.title)||"".concat((0,f.Cv)(e),"?");return e in nP&&({title:t}=nP[e]),{label:t,value:e}});return(0,i.jsxs)("div",{children:[(0,i.jsx)(nd,{field:{id:"batch-update-service-attribute",title:"Payment plan settings to batch update",faIcon:"clipboard"},children:(0,i.jsx)(eL.Ay,{classNamePrefix:"react-select",id:(0,eY.mU)({instanceId:"payment-plan-attribute"}),isClearable:!0,styles:eY.K6,options:_,onChange:e=>T(e)})}),s&&(0,i.jsx)(nd,{field:{id:"plan-name-filter",title:"Payment plan name filter",placeholder:"(optional) will match all plans if empty",faIcon:"clipboard"},value:o,onChange:e=>{var n;return n=e.target.value,void r(e=>(0,d._)((0,c._)({},e),{paymentPlanNameFilter:n}))}}),N?(0,i.jsx)(N,{inputGroups:u,setInputGroups:A,newToggleValue:p,setNewToggleValue:e=>{r(n=>(0,d._)((0,c._)({},n),{newValueBoolean:e}))},newValue:m,setNewValue:e=>{r(n=>(0,d._)((0,c._)({},n),{newValue:e}))},newTextValue:h,setNewTextValue:e=>{r(n=>(0,d._)((0,c._)({},n),{newTextValue:e}))},discountTransformations:v,setDiscountTransformations:w,label:(null==s?void 0:s.value)?nA[s.value]||(0,f.Cv)(null==s?void 0:s.value):null}):null,s&&j&&(0,i.jsxs)(e1.A,{children:["latePaymentAmount"===s.value&&(0,i.jsx)(e4.c,{className:"mb-2",text:"The late payment amount can be disabled by setting it to 0"}),(0,i.jsx)("p",{children:"The following changes will be applied:"}),n.map(e=>{var n=e.plans.filter(e=>P(e.name)&&e.canBeDeleted).filter(n=>((e,n)=>{if("enabledForSelfBooking"===s.value)return nw({service:e,plan:n,visitPackSelfBookingEnabled:C});if("creditValidityDays"===s.value)return nN(n);if(s.value in nP){var{planAttribute:t,extraContext:i}=nP[s.value];if("discountPolicy"===t&&i.householdDiscountScope)return!!n.discountPolicy}return!0})(e,n));return(0,i.jsxs)(a.Fragment,{children:[(0,i.jsx)("b",{children:e.name}),(0,i.jsx)("ul",{children:n.map(e=>(0,i.jsx)(nj,{selectedPlanAttribute:s,plan:e,inputGroups:u,newToggleValue:p,newValue:m,newTextValue:h,discountTransformations:v},e.id||e.name))})]},e.id)})]}),s&&!j&&(0,i.jsx)(e1.A,{children:(0,i.jsx)(e3.K,{text:"No matching payment plans found"})})]})};function n_(){var e=(0,u._)(["\n    width: 100%;\n"]);return n_=function(){return e},e}function nk(){var e=(0,u._)(["\n    background: none;\n    #react-select-service-attributes {\n        width: calc(100% - 38px);\n    }\n"]);return nk=function(){return e},e}var nR=(0,h.Ay)(ez.A)(n_()),nO=h.Ay.div(nk()),nI=["description","shortDescription","calendarColor","mainPhoto","photos","setupDurationMinutes","cleanupDurationMinutes","selfBookingAvailabilityMode","smsReminderTemplate","visibleByClients","visibleByVisitors","allowsJoinOnline","selfBookingClientNoteRequired","selfBookingClientNotePlaceholder","restrictCreditUsageWithStaff","scheduleOptimizationStrategy","enforceScheduleOptimizationForSelfBooking","maxSchedulingGapMinutes","tags","spotlight","cancellationPolicy","termsAndConditions","confirmationEmail","reminderEmail","cancellationEmail","sendFollowUpEmail","followUpEmail","enrollmentWindowNotBeforeMinutes","enrollmentWindowNotAfterMinutes","notificationPeriodHours","smsNotificationPeriodHours","clientLifecycleStatusOnBook","clientLifecycleStatusOnAttended","clientLifecycleStatusOnCancel","clientLifecycleStatusOnWaitlistAdded","clientLifecycleStatusOnWaitlistRemoved","cancellationWindowHours","notBeforeAgeMonths","
1notAfterAgeMonths","trackConversionTo","automateConversion","automateConversionEmail","disableSelfCancellation","disableUseCredits","weeklyCheckShortTermToleranceThresholdDays","weeklyCheckShortTermToleranceThresholdMaxCount","weeklyCheckLongTermToleranceThresholdMaxCount","staffVisitCancellationServiceCreditValidityDays","visitCancellationServiceCreditSubscriptionCap","visitCancellationServiceCreditValidityDays","visitCancellationServiceCreditValidityFromOriginalDate","lateVisitCancellationServiceCreditSubscriptionCap","lateVisitCancellationServiceCreditValidityDays","lateVisitCancellationServiceCreditValidityFromOriginalDate","staffVisitCancellationCashCredit","visitCancellationServiceCreditSubscriptionCapPeriod","enrollmentWindowGracePeriodDays","allowStaffToClientCancelUnpaid","allowClientToSelfCancelUnpaid","creditOnlyValidOncePaid","slotIntervalMinutes","slotStartSnap","shouldRemindCreditUsage","shouldRemindCreditUsageIntervalDays","shouldRemindCreditUsageExpirationBeforeDays","usageCreditReminderTemplate","usageCreditReminderSmsTemplate"],nU=["shouldRemindCreditUsageIntervalDays","shouldRemindCreditUsageExpirationBeforeDays"],nV=["termsAndConditions"],nL=[{id:(0,ek.A)(),from:0,to:0}],nB=["visitCancellationServiceCreditValidityFromOriginalDate","lateVisitCancellationServiceCreditValidityFromOriginalDate"],nM=e=>{var n,{toggle:t,isOpen:r,services:s}=e,u=(0,l.useSelector)(e=>e.app.business.name),p=(0,l.useSelector)(e=>{var n;return null==(n=e.app.business)?void 0:n.defaultCurrency}),m=(0,l.useSelector)(e=>e.app.business.lessonMateFeatureEnabled),[h,v]=(0,a.useState)({}),[f,y]=(0,a.useState)(!1),[g,C]=(0,a.useState)([]),[x,S]=(0,a.useState)({isOpen:!1,mode:null,summaryLines:[],previewLines:[],warnings:[],variables:null}),[T,A]=(0,a.useState)({selectedPlanAttribute:null,paymentPlanNameFilter:null,inputGroups:nL,newToggleValue:!0,newValue:0,newValueBoolean:!1,newTextValue:"",discountTarget:null,discountTransformations:[]}),[w]=(0,ew.A)(ex.Uy,{successMessage:null,failureMessage:"Error batch updating services"}),[N]=(0,ew.A)(ex.hf,{successMessage:null,failureMessage:"Error batch updating services"}),{data:P,error:D,loading:j}=(0,eN.A)({query:ex.pF,variables:{business:u,id:(null==s?void 0:s.length)&&s[0].id},skip:(null==s?void 0:s.length)===0,processor:e=>e.service}),E=e=>{var n,t,i=(0,eB.cloneDeep)(e);return i.shouldRemindCreditUsage?(i.shouldRemindCreditUsageIntervalDays=null!=(n=i.shouldRemindCreditUsageIntervalDays)?n:eM.w.properties.shouldRemindCreditUsageIntervalDays.default,i.shouldRemindCreditUsageExpirationBeforeDays=null!=(t=i.shouldRemindCreditUsageExpirationBeforeDays)?t:eM.w.properties.shouldRemindCreditUsageExpirationBeforeDays.default):(delete i.shouldRemindCreditUsageIntervalDays,delete i.shouldRemindCreditUsageExpirationBeforeDays),i};(0,a.useEffect)(()=>{if(P&&g&&g.length){var e,n,t=(0,eW.populateData)(P);("visitCancellationServiceCreditSubscriptionPeriodCap"in t||"visitCancellationServiceCreditSubscriptionPeriodCapDays"in t)&&(t.visitCancellationServiceCreditSubscriptionCapPeriod={cap:null!=(e=t.visitCancellationServiceCreditSubscriptionPeriodCap)?e:0,days:null!=(n=t.visitCancellationServiceCreditSubscriptionPeriodCapDays)?n:0});var i={};g.forEach(e=>{i[e.value]=t[e.value]}),"staffVisitCancellationCashCredit"in i&&null==i.staffVisitCancellationCashCredit&&(i.staffVisitCancellationCashCredit=0),v(E(i))}},[P,g]);var _=P&&(0,eG.Y)(P),k=(0,a.useMemo)(()=>(m?[...nI,"disableLessonMateRequest"]:nI).filter(e=>!(_!==e8.Yc&&["scheduleOptimizationStrategy","enforceScheduleOptimizationForSelfBooking","maxSchedulingGapMinutes"].includes(e)||_!==e8.fW&&["clientLifecycleStatusOnWaitlistAdded","clientLifecycleStatusOnWaitlistRemoved","enrollmentWindowGracePeriodDays"].includes(e)||![e8.Yc,e8.fW].includes(_)&&["allowStaffToClientCancelUnpaid","allowClientToSelfCancelUnpaid","creditOnlyValidOncePaid","shouldRemindCreditUsage","shouldRemindCreditUsageIntervalDays","shouldRemindCreditUsageExpirationBeforeDays","usageCreditReminderTemplate","usageCreditReminderSmsTemplate"].includes(e))).map(e=>({label:eM.w.properties[e].title,value:e})),[m,_]);(0,a.useEffect)(()=>{var e=(g||[]).map(e=>e.value),n=e.includes("scheduleOptimizationStrategy")||e.includes("enforceScheduleOptimizationForSelfBooking")||e.includes("maxSchedulingGapMinutes");!(e.includes("scheduleOptimizationStrategy")&&e.includes("enforceScheduleOptimizationForSelfBooking")&&e.includes("maxSchedulingGapMinutes"))&&n&&h.scheduleOptimizationStrategy!==na.bw&&C(e=>Array.from(new Set([...e,k.find(e=>"scheduleOptimizationStrategy"===e.value),k.find(e=>"enforceScheduleOptimizationForSelfBooking"===e.value),k.find(e=>"maxSchedulingGapMinutes"===e.value)]))),e.includes("shouldRemindCreditUsage")&&!e.some(e=>["shouldRemindCreditUsageIntervalDays","shouldRemindCreditUsageExpirationBeforeDays"].includes(e))&&C(e=>[...e,k.find(e=>"shouldRemindCreditUsage"===e.value),k.find(e=>"shouldRemindCreditUsageExpirationBeforeDays"===e.value),k.find(e=>"shouldRemindCreditUsageIntervalDays"===e.value)])},[g,h.scheduleOptimizationStrategy,k,h.shouldRemindCreditUsage]);var R=!0,O=!1,{selectedPlanAttribute:I}=T;(g||[]).map(e=>e.value).includes("paymentPlans")&&(R=!1,k.length=0,O=!0);var U=()=>{S({isOpen:!1,mode:null,summaryLines:[],previewLines:[],warnings:[],variables:null})},V=()=>{var e=(0,eB.cloneDeep)(eM.w);return delete e.title,e.required=[],e.properties={}
1,(g||[]).forEach(n=>{e.properties[n.value]=(0,eB.cloneDeep)(eM.w.properties[n.value])}),h.shouldRemindCreditUsage||(delete e.properties.shouldRemindCreditUsageIntervalDays,delete e.properties.shouldRemindCreditUsageExpirationBeforeDays),e},L=(0,a.useMemo)(()=>(0,eF.BL)(eM.o,{defaultCurrency:p||"USD"}),[p]);g&&0===g.length&&k.unshift({label:"Payment plans",value:"paymentPlans"});var B=new Set((s||[]).map(e=>(0,eG.Y)(e)));s&&0!==s.length&&1!==s.length||(n="Please refine your service selection - Only two or more services can be batch updated"),B.size>1&&(n="Please refine your service selection - only services of the same type can be batch updated"),D&&(n="There was an error loading the reference service");var M=V(),F=(0,eB.isEqual)(Object.keys(h).sort(),Object.keys(M.properties).sort()),W=(g||[]).filter(e=>!nV.includes(e.value)).length,q=(g||[]).some(e=>"paymentPlans"===e.value),H=q&&(e=>{var{selectedPlanAttribute:n,paymentPlanBatchUpdateState:t}=e;if(!(null==n?void 0:n.value))return!1;if("creditValidityDays"===n.value){var{newValueBoolean:i,newValue:a}=t;if(null==i||!0===i&&null==a)return!1}return!0})({selectedPlanAttribute:I,paymentPlanBatchUpdateState:T});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(eH.A,{isOpen:r,toggle:t,modalName:"service-batch-update",size:"lg",children:[(0,i.jsx)(eI.default,{toggle:t,children:"Batch Update Services"}),(0,i.jsxs)(eR.default,{children:[j&&(0,i.jsx)(e$.A,{}),!!n&&n,!n&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(nO,{children:(0,i.jsx)(nR,{field:{id:"batch-update-service-attribute",title:"Attribute(s) to batch update",faIcon:"clipboard"},children:(0,i.jsx)(eL.Ay,{classNamePrefix:"react-select",id:(0,eY.mU)({instanceId:"service-attributes"}),styles:eY.K6,isMulti:!0,options:k.filter(e=>!nU.includes(e.value)),onChange:e=>{C(e||[]),v(E(h))}})})}),R&&F&&(0,i.jsx)(eV(),{liveValidate:!0,idPrefix:"form",safeRenderCompletion:!0,schema:V(),uiSchema:L,formData:h,showErrorList:!1,onChange:e=>{var{formData:n}=e;v(E(n))},formContext:{serviceType:P&&(0,eG.Y)(P)},validate:(e,n)=>(!e.shouldRemindCreditUsage||e.shouldRemindCreditUsageIntervalDays||e.shouldRemindCreditUsageExpirationBeforeDays||n.shouldRemindCreditUsage.addError("Interval days or expiration days is required"),n),children:(0,i.jsx)("div",{})}),O&&(0,i.jsx)(nE,{services:s,paymentPlanBatchUpdateState:T,setPaymentPlanBatchUpdateState:A}),(0,i.jsx)("hr",{}),s&&s.length>0&&"".concat(s.length," services will be updated")]})]}),(0,i.jsxs)(eO.default,{children:[(0,i.jsx)(b.O6,{id:"btn-cancel",className:"btn btn-primary btn-rounded",onClick:t,children:"Cancel"}),(0,i.jsx)(eP.A,{id:"btn-create",className:"btn btn-secondary btn-rounded",onClick:()=>(0,o._)(function*(){if(R){y(!0);try{var e=(a=(0,eF.kd)(h,{},(0,eG.Y)(P)),(0,c._)({business:u,serviceIds:null==s?void 0:s.map(e=>e.id)},a.variables)),n=(g||[]).map(e=>e.value).some(e=>nB.includes(e)),t=[],i=null;if(n){var a,l,r,o=yield w({variables:(0,d._)((0,c._)({},e),{dryRun:!0})}),p=null==o||null==(l=o.data)?void 0:l.batchUpdateServices;t=(null==p?void 0:p.warnings)||[],i=null==p||null==(r=p.updatedServices)?void 0:r.length}var m=(g||[]).map(e=>{var n;return null==(n=eM.w.properties[e.value])?void 0:n.title}).filter(Boolean),v=(null==s?void 0:s.length)||0,f=Number.isInteger(i)?i:null,b=Number.isInteger(f)&&v>=f?v-f:null,C=Number.isInteger(f)?"".concat(f," service").concat(1===f?"":"s"):null,x=Number.isInteger(b)?"".concat(b," service").concat(1===b?"":"s"):null,A=["".concat(v," services selected"),m.length>0?"Updating: ".concat(m.join(", ")):null,n&&Number.isInteger(f)?"Proceed will update ".concat(C," and skip ").concat(x,"."):null].filter(Boolean),N=n?[Number.isInteger(f)?"".concat(f," of ").concat(v," services eligible for update"):null,Number.isInteger(b)?"".concat(x," will be skipped"):null].filter(Boolean):[];S({isOpen:!0,mode:"services",summaryLines:A,previewLines:N,warnings:t,variables:e})}finally{y(!1)}return}if(O){var D,j,E=(()=>{var{selectedPlanAttribute:e}=T;if(!(null==e?void 0:e.value))return(0,eq.WS)({title:"Please select a payment plan setting to update"}),null;var{paymentPlanNameFilter:n,newValue:t,newValueBoolean:i,newTextValue:a,discountTarget:l,discountTransformations:r}=T,o=(r||[]).map(e=>{var n,t,i,a,l,r,s,o;return{fromType:0===e.fromAmount?null:null!=(n=null==(l=e.fromType)?void 0:l.toUpperCase())?n:null,fromAmount:e.fromAmount,fromDiscountTarget:0===e.fromAmount?null:null!=(t=null==(r=e.fromDiscountTarget)?void 0:r.toUpperCase())?t:null,toType:0===e.toAmount?null:null!=(i=null==(s=e.toType)?void 0:s.toUpperCase())?i:null,toAmount:e.toAmount,discountTarget:null!=(a=null==(o=e.discountTarget)?void 0:o.toUpperCase())?a:null}});return{business:u,serviceIds:null==s?void 0:s.map(e=>e.id),paymentPlanNameFilter:n,attributeToUpdate:e.value,newValue:t,newValueGroup:(T.inputGroups||[]).map(e=>({amountFrom:e.from,amountTo:e.to})),newValueBoolean:i,newTextValue:a,discountTarget:l,discountTransformations:o}})();if(!E)return;var _=(null==(D=T.selectedPlanAttribute)?void 0:D.label)||(null==(j=T.selectedPlanAttribute)?void 0:j.value);S({isOpen:!0,mode:"paymentPlans",summaryLines:["".concat((null==s?void 0:s.length)||0," services selected"),_?"Payment plan setting: ".concat(_):null,T.paymentPlanNameFilter?"Plan name filter: ".concat(T.paymentPlanNameFilter):"Plan name filter: all plans"].filter(
1Boolean),previewLines:[],warnings:[],variables:E})}})(),disabled:!!n||(q?!H:0===W),loading:f,children:"Batch Update"})]})]}),(0,i.jsxs)(eH.A,{isOpen:x.isOpen,toggle:U,modalName:"service-batch-update-confirm",size:"md",children:[(0,i.jsx)(eI.default,{toggle:U,children:"Confirm Batch Update"}),(0,i.jsxs)(eR.default,{children:[(0,i.jsx)("strong",{children:"Do you want to proceed with this batch update?"}),x.summaryLines.map(e=>(0,i.jsx)("p",{children:e},e)),x.previewLines.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("hr",{}),(0,i.jsx)("strong",{children:"Previewed changes"}),(0,i.jsx)("ul",{children:x.previewLines.map(e=>(0,i.jsx)("li",{children:e},e))})]}),x.warnings.length>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("hr",{}),(0,i.jsxs)("strong",{children:["Warnings (",x.warnings.length,")"]}),(0,i.jsx)("ul",{children:x.warnings.map(e=>(0,i.jsx)("li",{children:e},e))})]})]}),(0,i.jsxs)(eO.default,{children:[(0,i.jsx)(b.O6,{className:"btn btn-primary btn-rounded",onClick:U,children:"Back"}),(0,i.jsx)(eP.A,{className:"btn btn-secondary btn-rounded",onClick:()=>(0,o._)(function*(){if(x.isOpen&&x.variables){y(!0);try{if("services"===x.mode){var e,n,i,a,l=yield w({variables:x.variables}),r=(null==l||null==(a=l.data)||null==(i=a.batchUpdateServices)?void 0:i.warnings)||[];r.length>0?(0,eq.WS)({title:"Batch update completed with warnings",message:r.join("\n")}):(0,eq.VX)({title:"Services batch updated successfully"}),U(),t();return}var s=yield N({variables:x.variables}),o=(null==s||null==(n=s.data)||null==(e=n.batchUpdateServicePaymentPlans)?void 0:e.warnings)||[];o.length>0?(0,eq.WS)({title:"Batch update completed with warnings",message:o.join("\n")}):(0,eq.VX)({title:"Services batch updated successfully"}),U(),t()}finally{y(!1)}}})(),loading:f,children:"Proceed"})]})]})]})},nF=t(78258),nW=t(96729);function nq(){var e=(0,u._)(["\n    mutation batchDuplicateServices(\n        $business: String!\n        $serviceId: ID!\n        $duplicateItems: [String]!\n        $duplicateKey: String!\n    ) {\n        batchDuplicateServices(\n            business: $business\n            serviceId: $serviceId\n            duplicateItems: $duplicateItems\n            duplicateKey: $duplicateKey\n        ) {\n            error\n            status\n        }\n    }\n"]);return nq=function(){return e},e}function nH(){var e=(0,u._)(["\n    width: 100%;\n"]);return nH=function(){return e},e}var nz=(0,nF.J1)(nq()),nY=(0,h.Ay)(ez.A)(nH()),nG=e=>{var{toggle:n,isOpen:t,service:r}=e,s=(0,l.useSelector)(e=>e.app.business.name),[c,d]=(0,a.useState)(!1),[u,p]=(0,eA.A)("services:batchDuplicate",[]),[m,h]=(0,eA.A)("services:batchDuplicateKey",""),[v,f]=(0,a.useState)(null),[y]=(0,ew.A)(nz,{successMessage:"Service batch duplicated",failureMessage:"Error batch duplicating service"});return(0,a.useEffect)(()=>{(null==u?void 0:u.length)?m&&(!m||r.name.includes(m))?u.includes(m)?f("The reference key cannot be in the item list"):f(null):f("Enter a valid reference key, which is in the base service name"):f(null)},[u,m,f,r.name]),(0,i.jsxs)(eH.A,{isOpen:t,toggle:n,modalName:"service-batch-update",size:"lg",children:[(0,i.jsx)(eI.default,{toggle:n,children:"Batch Duplicate Services"}),(0,i.jsxs)(eR.default,{children:[(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("p",{children:["This facilitates the creation of multiple services based on ",(0,i.jsx)("b",{children:r.name})," as a template"]}),(0,i.jsx)(nY,{field:{id:"batch-update-service-attribute",title:"Specify the list of items to duplicate for:",subtitle:"For example, instruments: Guitar, Violin, Voice etc. (CASE MATTERS)",faIcon:"clipboard"},children:(0,i.jsx)(nW.Ay,{id:"service-batch-duplicate-items-select",styles:eY.K6,isMulti:!0,placeholder:"Items",value:null==u?void 0:u.map(e=>({label:e,value:e})),options:null==u?void 0:u.map(e=>({label:e,value:e})),onChange:e=>{p(e?e.map(e=>e.value):[])}})}),(0,i.jsx)(ez.A,{field:{id:"batch-update-service-attribute",title:"Specify the word to find and replace",subtitle:'For example: "Piano" if the original service contains "Piano". The word to find and replace cannot be in the item list. (CASE MATTERS)',faIcon:"clipboard",value:m},onChange:e=>h(e.target.value)})]}),v&&(0,i.jsx)("p",{className:"text-danger",children:v}),!v&&(null==u?void 0:u.length)>0&&(0,i.jsxs)(e1.A,{children:["".concat(r.name," will be duplicated into:"),(0,i.jsx)("br",{}),(0,i.jsx)("ul",{children:null==u?void 0:u.map(e=>(0,i.jsx)("li",{children:r.name.replace(m,e)}))}),"For each service, ".concat(m," will be replaced by ").concat(null==u?void 0:u.join(", "),", in the service name, tags, short and long descriptions, plan names and descriptions, and email templates"),(0,i.jsx)("br",{}),(0,i.jsx)("b",{children:"Please make sure to validate all your service settings before batch duplicating"})]})]}
1),(0,i.jsxs)(eO.default,{children:[(0,i.jsx)(b.O6,{id:"btn-cancel",className:"btn btn-primary btn-rounded",onClick:n,children:"Cancel"}),(0,i.jsx)(eP.A,{id:"btn-create",className:"btn btn-secondary btn-rounded",onClick:()=>(0,o._)(function*(){d(!0);try{yield y({variables:{business:s,serviceId:r.id,duplicateItems:u,duplicateKey:m},update:(e,n)=>{"ok"===n.data.batchDuplicateServices.status&&(e.evict({id:"ROOT_QUERY",fieldName:"services"}),e.gc())}}),n()}finally{d(!1)}})(),disabled:v||!u||(null==u?void 0:u.length)===0||!m,loading:c,children:"Batch Duplicate"})]})]})};function n$(){var e=(0,u._)(["\n    display: flex;\n    box-shadow: ",";\n    padding: 0px;\n    border-radius: 3px;\n    flex-wrap: wrap;\n    justify-content: center;\n"]);return n$=function(){return e},e}function nK(){var e=(0,u._)(["\n    cursor: pointer;\n    i {\n        margin: 0 !important;\n    }\n    @media screen and (max-width: 500px) {\n        display: none !important;\n    }\n"]);return nK=function(){return e},e}function nJ(){var e=(0,u._)(["\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    @media screen and (max-width: 500px) {\n        display: none !important;\n    }\n"]);return nJ=function(){return e},e}function nQ(){var e=(0,u._)(["\n    display: flex;\n    flex-direction: column;\n    margin-right: 25px;\n    flex-grow: 1;\n"]);return nQ=function(){return e},e}function nZ(){var e=(0,u._)(["\n    display: flex;\n    justify-content: end;\n    padding: 0 58px;\n    @media screen and (max-width: 600px) {\n        padding: 8px;\n    }\n"]);return nZ=function(){return e},e}function nX(){var e=(0,u._)(["\n    font-size: 18px;\n    color: #212121;\n    height: fit-content;\n    width: fit-content;\n"]);return nX=function(){return e},e}var n0=h.Ay.ul(n$(),e=>e.listView?"0px 0px 20px 3px rgba(60, 70, 85, 0.1)":"none"),n1=h.Ay.div(nK()),n6=h.Ay.div(nJ()),n2=h.Ay.div(nQ()),n5=h.Ay.div(nZ()),n3=h.Ay.i(nX()),n8={menu:e=>(0,d._)((0,c._)({},e),{"z-index":"2"}),control:e=>(0,d._)((0,c._)({},e),{borderTopLeftRadius:"0px",borderBottomLeftRadius:"0px",borderTopRightRadius:"11px",borderBottomRightRadius:"11px"})},n4=e=>{var n,{search:t,onSelectedServicesChange:r,filteredTags:s,setFilteredTags:c}=e,d=(0,l.useSelector)(e=>e.app.business.name),[u,p]=(0,eA.A)("servicesList.listView",!0),[m,h]=(0,eA.A)("servicesList.showDeactivated",!0),[y,g]=(0,a.useState)(!1),[b,S]=(0,a.useState)(!1),[A,N]=(0,a.useState)({status:!1,message:"",title:"",callback:null}),[P,D]=(0,a.useState)(!1),[j,E]=(0,a.useState)(!1),[_,k]=(0,a.useState)(null),[R,O]=(0,a.useState)([]),[I]=(0,ew.A)(ex.NO,{successMessage:"Service removed successfully",failureMessage:"Service removal failed"}),[U]=(0,ew.A)(ex.GN,{successMessage:"Service duplicated successfully",failureMessage:"Service duplication failed"}),{data:V,loading:L,error:B}=(0,eN.A)({query:ex.YE,variables:{business:d},processor:e=>[...e.services].sort((e,n)=>{var t=e.name.toLowerCase(),i=n.name.toLowerCase();return t<i?-1:+(t>i)})});(0,a.useEffect)(()=>{O([])},[t,s]);var M=e=>(0,o._)(function*(){g(!0);try{yield U({variables:{business:d,id:e},update:(e,n)=>{"ok"===n.data.duplicateService.status&&(e.evict({id:"ROOT_QUERY",fieldName:"services"}),e.gc())}})}catch(e){(0,f.Fk)(e)}g(!1)})(),F=e=>(0,o._)(function*(){S(!0);try{yield I({variables:{business:d,id:e},update:(n,t)=>{"ok"===t.data.deleteService.status&&(n.evict({id:"Service:".concat(e)}),n.gc())}})}catch(e){(0,f.Fk)(e)}S(!1)})(),W=e=>{var n=[];O(n=R.includes(e.id)?R.filter(n=>n!==e.id):[...R,e.id]),null==r||r(n)},q=e=>{(0,w._V)(e)},H=e=>{(0,w.Lm)(e)};if(L||b||y)return(0,i.jsx)(eT.A,{});if(B)return(0,i.jsxs)(eS.A,{className:"alert alert-danger alert-bordered",children:[(0,i.jsx)("strong",{children:"Error"}),"Unable to access data - Networking problem?"]});var z=V;if(t&&0===t.indexOf("#")&&t.length>1)z=V.filter(e=>{for(var n,i=0;i<(null==e||null==(n=e.tags)?void 0:n.length);i+=1)if(e.tags[i].toLowerCase().includes(t.toLowerCase()))return!0;return!1});else t&&(z=V.filter(e=>e.name.toLowerCase().includes(t.toLowerCase())));return(s||[]).length>0&&(z=V.filter(e=>{for(var n=0;n<s.length;n+=1)if(!e.tags||e.tags&&!e.tags.includes(s[n].label))return!1;return!0})),m||(z=z.filter(e=>!e.deactivated)),(0,i.jsxs)("div",{children:[P&&(0,i.jsx)(nM,{isOpen:P,toggle:()=>D(!P),services:R.length>0?z.filter(e=>R.includes(e.id)):z}),j&&(0,i.jsx)(nG,{isOpen:j,toggle:()=>{E(!j)},service:_}),(0,i.jsx)(eC.A,{isOpen:A.status,toggle:()=>N({status:!1}),onConfirmation:A.callback,title:A.title,message:A.message,size:"lg"}),(0,i.jsxs)("div",{className:"d-flex mb-2 justify-content-start",style:{marginTop:"-25px"},children:[(0,i.jsxs)(n2,{children:[(0,i.jsx)(ej,{style:{width:"100%"},labelStyle:{margin:0,width:"100%"},className:"event-service",icon:"more",value:s,title:"",onChange:e=>{c(e||[])},children:(0,i.jsx)(eE.ad,{placeholder:"Filter a tag",isMulti:!0,styles:n8,id:"react-select-".concat(e_._F),classNamePrefix:"react-select"})}),(0,i.jsx)("small",{className:"form-text text-muted",children:"Search by service tag"})]}),(0,i.jsxs)(n6,{children:[(0,i.jsx)(v.A,{placement:"bottom",trigger:["hover"],overlay:(0,i.jsx)("span",{children:"Filter and/or Select multiple services for batch update"}),children:(0,i.jsx)(eP.A,{onMouseDown:e=>e.preventDefault(),onClick:()=>D(!0),type:"button",className:"btn btn-primary rounded mr-2",id:"service-list-batch-update",children:"Batch update"})}),(0,i.jsx)(n1,{id:"toggle-services-view",className:"profile-styles",onClick:()=>p(!u),children:u?(0,i.jsx)(n3,{className:"fa-light fa-cards-blank  active"}):(0,i.jsx)(n3,{className:"fal fa-list"})})]})]}),(0,i.jsx)("div",{className:"d-flex mb-2",children:(0,i.jsx)(e5.A,{label:"Show deactivated services",isChecked:m,onChange:()=>h(!m)})}),u&&(0,i.jsxs)("div",{className:"row",children:[(0,i.jsx)("div",{className:"col-8"}),(0,i.jsx)(n5,{className:"col-4",children:(0,i.jsx)(T.A,{action:x.ACTION_UPDATE,resource:C.RESOURCE_SERVICE,children:(0,i.jsx)(J.A,{isChecked:(null==z?void 0:z.length)&&(null==(n=z||[])?void 0:n.every(e=>null==R?void 0:R.includes(null==e?void 0:e.id))),className:"mr-0 select-all-client-in-roster",onClick:e=>{var n,t;return n=z,void(O(t=e.target.checked?n.map(e=>e.id):[]),null==r||r(t))}
1,labelFirst:!0,checkedColor:"#303f9f",textColor:"#9B9B9B",text:"Select All",styles:{gap:"2px"}})})})]}),(0,i.jsx)(n0,{listView:u,className:"list-unstyled",children:z.map((e,n)=>u?(0,i.jsx)(eb,{className:"service-list-item",index:n,service:e,duplicate:M,batchDuplicate:e=>{k(e),E(!0)},goToSessions:H,edit:q,remove:()=>N({status:!0,callback:()=>F(e.id),title:"Remove Service",message:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e3.A,{text:"Deleting a service will automatically remove that service from staff availabilities and pay rates, potentially impacting self-booking and payroll.",className:"mb-2"}),(0,i.jsx)(e3.A,{text:"This action is irreversible. Are you sure you want to continue?"})]})}),selected:R.includes(e.id),toggleSelect:W},e.id):(0,i.jsx)(K,{index:n,service:e,duplicate:M,batchDuplicate:()=>{k(e),E(!0)},edit:q,goToSessions:H,remove:()=>N({status:!0,callback:()=>F(e.id),title:"Remove Service",message:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e3.A,{text:"Deleting a service will automatically remove that service from staff availabilities and pay rates, potentially impacting self-booking and payroll.",className:"mb-2"}),(0,i.jsx)(e3.A,{text:"This action is irreversible. Are you sure you want to continue?"})]})})},e.id))})]})};n4.propTypes={search:m().string.isRequired,onSelectedServicesChange:m().func,filteredTags:m().array,setFilteredTags:m().func},n4.defaultProps={onSelectedServicesChange:()=>{},filteredTags:[],setFilteredTags:()=>{}};var n9=t(26871);t(11516);var n7=t(24930),te=t(17535),tn=t(8756),tt=t(20615),ti=t(92739);function ta(){var e=(0,u._)(["\n            flex-direction: column;\n        "]);return ta=function(){return e},e}function tl(){var e=(0,u._)(["\n            width: unset;\n            min-height: 200px;\n        "]);return tl=function(){return e},e}function tr(){var e=(0,u._)(["\n    max-width: 700px !important;\n    .modal-body {\n        display: flex;\n        flex-direction: column;\n        ",";\n    }\n    .service-type-item {\n        box-sizing: border-box;\n        box-shadow: 0px 1px 8px -1px #c9c9c9;\n        border-radius: 4px;\n        flex: 1;\n        margin: 8px;\n        padding: 16px;\n        text-align: center;\n        min-height: 200px;\n        justify-content: center;\n        align-items: center;\n        display: flex;\n        flex-direction: column;\n        cursor: pointer;\n        font-weight: 700;\n        border: 2px solid;\n        border-color: transparent;\n\n        ",";\n\n        &.selected {\n            border: 2px solid;\n            color: ",";\n\n            .service-type-description {\n                color: ",";\n            }\n        }\n\n        .service-type-name {\n            font-size: 18px;\n            margin-bottom: 6px;\n            font-weight: 600;\n            width: 100%;\n            text-align: left;\n        }\n        .service-type-description {\n            font-size: 14px;\n            color: #666666;\n            text-align: left;\n        }\n    }\n"]);return tr=function(){return e},e}var ts=(0,h.Ay)(eH.A)(tr(),tt.$_.mobile(ta()),tt.$_.mobile(tl()),e=>{var{uiPrimaryColor:n}=e;return n},e=>{var{uiPrimaryColor:n}=e;return n}),to=[{id:e8.Yc,name:"Appointment (e.g. Private Lessons)",description:"Usually used for Private Lessons, appointment based services are designed for single or multiple visits at a specific location / room, for one or more clients with one or more staff. Appointment booking is based on staff availabilities. Example: Piano lesson 30 mins"},{id:e8.fW,name:"Group Class (e.g. Courses, Workshops)",description:"Usually used for Group Classes, group class based services are designed for classes / courses / workshops, where multiple clients can attend each scheduled date. Multiple classes of the same service can be scheduled in advance and clients can enroll into the class of their choice. Example: Group Music Class with classes on Mondays 9am, Tuesday 7pm, Wednesday 1pm"},{id:e8.ll,name:"Event (e.g. Recitals, Showcases, Concerts)",description:"Event based services are designed for performing events such as Recitals / Showcases / Concerts and other performances etc. Multiple dates per Event can be scheduled, performers can be enrolled and assigned a performance slot, as well as additional customizable attributes."},{id:e8.je,name:"Subscription Only (e.g. Equipment Rental, Membership Fees)",description:"Subscription only services are designed for subscriptions that are not associated with either appointments or sessions. It allows to charge a client on a regular basis without requiring them to be enrolled into a session or have an appointment booked. Example: equipment rental, monthly or yearly membership etc."}],tc=e=>{var{isOpen:n,toggle:t,onContinue:r}=e,s=(0,l.useSelector)(e=>e.app.business.uiPrimaryColor),[o,c]=(0,a.useState)();
1return(0,i.jsxs)(ts,{isOpen:n,toggle:t,modalName:"select-service-type",className:"event-update-modal",uiPrimaryColor:s,children:[(0,i.jsx)(n7.A,{toggle:t,children:"Choose a service type"}),(0,i.jsx)(te.A,{children:to.map((e,n)=>(0,i.jsxs)("div",{id:"service-type-item-".concat((0,ti.io)(e.id)),className:"service-type-item ".concat(n===o?"selected":""),onClick:()=>c(n),children:[(0,i.jsx)("h4",{className:"service-type-name",children:e.name}),(0,i.jsx)("small",{className:"service-type-description",children:e.description})]},e.id))}),(0,i.jsxs)(tn.A,{children:[(0,i.jsx)("button",{type:"button",id:"btn-select-service-cancel",className:"btn btn-danger btn-rounded",onClick:t,children:"Cancel"}),(0,i.jsx)("button",{type:"button",id:"btn-select-service-continue",className:"btn btn-primary btn-rounded",onClick:()=>{r(to[o].id)},disabled:void 0===o,children:"Continue"})]})]})};tc.propTypes={isOpen:m().bool,toggle:m().func,onContinue:m().func},tc.defaultProps={isOpen:!1,toggle:void 0,onContinue:()=>{}};var td=t(66512),tu=t(2488),tp=t(4124),tm=t.n(tp),th=t(55808),tv=t.n(th),tf=t(82847),ty=t(51081);t(89773),t(82963),t(84560);var tg=e=>{var n=e.split(".").pop();if(!n)throw Error("Invalid path: ".concat(e));return n},tb=(e,n)=>{var t,i=tg(e),a=null==(t=eM.w.properties)?void 0:t[i];return(null==a?void 0:a.title)||n},tC=(e,n)=>{var t,i=tg(e),a=null==(t=e0.wQ.properties)?void 0:t[i];return(null==a?void 0:a.title)||n},tx=new Set(["plans.signupPrice","plans.signupWaivedIfMember","plans.discountPolicy.discountType","plans.discountPolicy.discountRate","plans.discountPolicy.discountTarget","plans.discountPolicy.subscriptionScope"]),tS=new Set(["plans.price","plans.deposit","plans.taxRate"]),tT=new Set(Array.from(tx).map(e=>e.replace("plans.","").split(".").map(ti.ND).join(""))),tA=[{label:tb("id","ID"),type:"string",path:"id"},{label:tb("name","Name"),type:"string",path:"name"},{label:tb("description","Description"),type:"string",path:"description"},{label:tb("shortDescription","Short Description"),type:"string",path:"shortDescription"},{label:tb("business","Business"),type:"string",path:"business"},{label:tb("calendarColor","Calendar Color"),type:"string",path:"calendarColor"},{label:tb("tags","Tags"),type:"array",path:"tags"},{label:tb("photos","Photos"),type:"array",path:"photos"},{label:tb("mainPhoto","Main Photo"),type:"string",path:"mainPhoto"},{label:tb("durationMinutes","Duration (Minutes)"),type:"number",path:"durationMinutes"},{label:tb("setupDurationMinutes","Setup Duration (Minutes)"),type:"number",path:"setupDurationMinutes"},{label:tb("cleanupDurationMinutes","Cleanup Duration (Minutes)"),type:"number",path:"cleanupDurationMinutes"},{label:tb("slotIntervalMinutes","Slot Interval (Minutes)"),type:"number",path:"slotIntervalMinutes"},{label:tb("slotStartSnap","Slot Start Snap"),type:"number",path:"slotStartSnap"},{label:tb("maximumClients","Maximum Clients"),type:"number",path:"maximumClients"},{label:tb("maximumWaitlistClients","Maximum Waitlist Clients"),type:"number",path:"maximumWaitlistClients"},{label:tb("priority","Priority"),type:"number",path:"priority"},{label:tb("notBeforeAgeMonths","Not Before Age (Months)"),type:"number",path:"notBeforeAgeMonths"},{label:tb("notAfterAgeMonths","Not After Age (Months)"),type:"number",path:"notAfterAgeMonths"},{label:tb("notificationPeriodHours","Notification Period (Hours)"),type:"number",path:"notificationPeriodHours"},{label:tb("smsNotificationPeriodHours","SMS Notification Period (Hours)"),type:"number",path:"smsNotificationPeriodHours"},{label:tb("cancellationWindowHours","Cancellation Window (Hours)"),type:"number",path:"cancellationWindowHours"},{label:tb("enrollmentWindowNotBeforeMinutes","Enrollment Window Not Before (Minutes)"),type:"number",path:"enrollmentWindowNotBeforeMinutes"},{label:tb("enrollmentWindowNotAfterMinutes","Enrollment Window Not After (Minutes)"),type:"number",path:"enrollmentWindowNotAfterMinutes"},{label:tb("enrollmentWindowGracePeriodDays","Enrollment Window Grace Period (Days)"),type:"number",path:"enrollmentWindowGracePeriodDays"},{label:tb("maxSchedulingGapMinutes","Max Scheduling Gap (Minutes)"),t
1ype:"number",path:"maxSchedulingGapMinutes"},{label:tb("shouldRemindCreditUsageIntervalDays","Should Remind Credit Usage Interval (Days)"),type:"number",path:"shouldRemindCreditUsageIntervalDays"},{label:tb("shouldRemindCreditUsageExpirationBeforeDays","Should Remind Credit Usage Expiration Before (Days)"),type:"number",path:"shouldRemindCreditUsageExpirationBeforeDays"},{label:tb("autoHoldDays","Auto Hold Days"),type:"number",path:"autoHoldDays"},{label:tb("visitCancellationCashCredit","Visit Cancellation Cash Credit"),type:"number",path:"visitCancellationCashCredit"},{label:tb("lateVisitCancellationCashCredit","Late Visit Cancellation Cash Credit"),type:"number",path:"lateVisitCancellationCashCredit"},{label:tb("staffVisitCancellationCashCredit","Staff Visit Cancellation Cash Credit"),type:"number",path:"staffVisitCancellationCashCredit"},{label:tb("visitCancellationServiceCreditSubscriptionCap","Visit Cancellation Service Credit Subscription Cap"),type:"number",path:"visitCancellationServiceCreditSubscriptionCap"},{label:tb("visitCancellationServiceCreditValidityDays","Visit Cancellation Service Credit Validity Days"),type:"number",path:"visitCancellationServiceCreditValidityDays"},{label:"Visit Cancellation Service Credit Subscription Period Cap",type:"number",path:"visitCancellationServiceCreditSubscriptionPeriodCap"},{label:"Visit Cancellation Service Credit Subscription Period Cap Days",type:"number",path:"visitCancellationServiceCreditSubscriptionPeriodCapDays"},{label:tb("lateVisitCancellationServiceCreditSubscriptionCap","Late Visit Cancellation Service Credit Subscription Cap"),type:"number",path:"lateVisitCancellationServiceCreditSubscriptionCap"},{label:tb("lateVisitCancellationServiceCreditValidityDays","Late Visit Cancellation Service Credit Validity Days"),type:"number",path:"lateVisitCancellationServiceCreditValidityDays"},{label:tb("staffVisitCancellationServiceCreditValidityDays","Staff Visit Cancellation Service Credit Validity Days"),type:"number",path:"staffVisitCancellationServiceCreditValidityDays"},{label:tb("weeklyCheckShortTermToleranceThresholdDays","Weekly Check Short Term Tolerance Threshold Days"),type:"number",path:"weeklyCheckShortTermToleranceThresholdDays"},{label:tb("weeklyCheckShortTermToleranceThresholdMaxCount","Weekly Check Short Term Tolerance Threshold Max Count"),type:"number",path:"weeklyCheckShortTermToleranceThresholdMaxCount"},{label:tb("weeklyCheckLongTermToleranceThresholdMaxCount","Weekly Check Long Term Tolerance Threshold Max Count"),type:"number",path:"weeklyCheckLongTermToleranceThresholdMaxCount"},{label:tb("hasSessions","Has Group Classes"),type:"boolean",path:"hasSessions"},{label:tb("requiresBooking","Requires Booking"),type:"boolean",path:"requiresBooking"},{label:tb("eventType","Event Type"),type:"boolean",path:"eventType"},{label:tb("allowsJoinOnline","Allows Join Online"),type:"boolean",path:"allowsJoinOnline"},{label:tb("spotlight","Spotlight"),type:"boolean",path:"spotlight"},{label:tb("deactivated","Deactivated"),type:"boolean",path:"deactivated"},{label:tb("visibleByClients","Visible By Clients"),type:"boolean",path:"visibleByClients"},{label:tb("visibleByVisitors","Visible By Visitors"),type:"boolean",path:"visibleByVisitors"},{label:tb("disableSelfCancellation","Disable Self Cancellation"),type:"boolean",path:"disableSelfCancellation"},{label:tb("disableUseCredits","Disable Use Credits"),type:"boolean",path:"disableUseCredits"},{label:tb("disableLessonMateRequest","Disable Lesson Mate Request"),type:"boolean",path:"disableLessonMateRequest"},{label:tb("allowStaffToClientCancelUnpaid","Allow Staff To Client Cancel Unpaid"),type:"boolean",path:"allowStaffToClientCancelUnpaid"},{label:tb("allowClientToSelfCancelUnpaid","Allow Client To Self Cancel Unpaid"),type:"boolean",path:"allowClientToSelfCancelUnpaid"},{label:tb("creditOnlyValidOncePaid","Credit Only Valid Once Paid"),type:"boolean",path:"creditOnlyValidOncePaid"},{label:tb("restrictCreditUsageWithStaff","Restrict Credit Usage With Staff"),type:"boolean",path:"restrictCreditUsageWithStaff"},{label:tb("autoHold","Auto Hold"),type:"boolean",path:"autoHold"},{label:tb("automateConversion","Automate Conversion"),type:"boolean",path:"automateConversion"},{label:tb("enforceScheduleOptimizationForSelfBooking","Enforce Schedule Optimization For Self Booking"),type:"boolean",path:"enforceScheduleOptimizationForSelfBooking"},{label:tb("sendSessionEndEmail","Send Class End Email"),type:"boolean",path:"sendSessionEndEmail"},{label:tb("sendFollowUpEmail","Send Follow Up Email"),type:"boolean",path:"sendFollowUpEmail"},{label:tb("shouldRemindCreditUsage","Should Remind Credit Usage"),type:"boolean",path:"shouldRemindCreditUsage"},{label:tb("selfBookingClientNoteRequired","Self Booking Client Note Required"),type:"boolean",path:"selfBookingClientNoteRequired"},{label:tb("requiresPaymentMethodForWaitlist","Requires Payment Method For Waitlist"),type:"boolean",path:"requiresPaymentMethodForWaitlist"},{label:tb("alternativeBookingLink","Alternative Booking Link"),type:"string",path:"alternativeBookingLink"},{label:tb("visitCancellationConsequence","Visit Cancellation Consequence"),type:"string",path:"visit
1CancellationConsequence"},{label:tb("lateVisitCancellationConsequence","Late Visit Cancellation Consequence"),type:"string",path:"lateVisitCancellationConsequence"},{label:tb("staffVisitCancellationConsequence","Staff Visit Cancellation Consequence"),type:"string",path:"staffVisitCancellationConsequence"},{label:tb("visitCancellationServiceCreditName","Visit Cancellation Service Credit Name"),type:"string",path:"visitCancellationServiceCreditName"},{label:tb("lateVisitCancellationServiceCreditName","Late Visit Cancellation Service Credit Name"),type:"string",path:"lateVisitCancellationServiceCreditName"},{label:tb("staffVisitCancellationServiceCreditName","Staff Visit Cancellation Service Credit Name"),type:"string",path:"staffVisitCancellationServiceCreditName"},{label:tb("visitCancellationServiceCreditService","Visit Cancellation Service Credit Service"),type:"string",path:"visitCancellationServiceCreditService"},{label:tb("lateVisitCancellationServiceCreditService","Late Visit Cancellation Service Credit Service"),type:"string",path:"lateVisitCancellationServiceCreditService"},{label:tb("staffVisitCancellationServiceCreditService","Staff Visit Cancellation Service Credit Service"),type:"string",path:"staffVisitCancellationServiceCreditService"},{label:tb("autoHoldService","Auto Hold Service"),type:"string",path:"autoHoldService"},{label:tb("termsAndConditionsRevision","Terms And Conditions Revision"),type:"string",path:"termsAndConditionsRevision"},{label:tb("selfBookingAvailabilityMode","Self Booking Availability Mode"),type:"string",path:"selfBookingAvailabilityMode"},{label:tb("scheduleOptimizationStrategy","Schedule Optimization Strategy"),type:"string",path:"scheduleOptimizationStrategy"},{label:tb("clientLifecycleStatusOnBook","Client Lifecycle Status On Book"),type:"string",path:"clientLifecycleStatusOnBook"},{label:tb("clientLifecycleStatusOnAttended","Client Lifecycle Status On Attended"),type:"string",path:"clientLifecycleStatusOnAttended"},{label:tb("clientLifecycleStatusOnCancel","Client Lifecycle Status On Cancel"),type:"string",path:"clientLifecycleStatusOnCancel"},{label:tb("clientLifecycleStatusOnWaitlistAdded","Client Lifecycle Status On Waitlist Added"),type:"string",path:"clientLifecycleStatusOnWaitlistAdded"},{label:tb("clientLifecycleStatusOnWaitlistRemoved","Client Lifecycle Status On Waitlist Removed"),type:"string",path:"clientLifecycleStatusOnWaitlistRemoved"},{label:tb("waitlistPolicy","Waitlist Policy"),type:"string",path:"waitlistPolicy"},{label:tb("cancellationPolicy","Cancellation Policy"),type:"string",path:"cancellationPolicy"},{label:tb("confirmationEmail","Confirmation Email"),type:"string",path:"confirmationEmail"},{label:tb("reminderEmail","Reminder Email"),type:"string",path:"reminderEmail"},{label:tb("cancellationEmail","Cancellation Email"),type:"string",path:"cancellationEmail"},{label:tb("sessionEndEmail","Class End Email"),type:"string",path:"sessionEndEmail"},{label:tb("automateConversionEmail","Automate Conversion Email"),type:"string",path:"automateConversionEmail"},{label:tb("followUpEmail","Follow Up Email"),type:"string",path:"followUpEmail"},{label:tb("usageCreditReminderTemplate","Usage Credit Reminder Template"),type:"string",path:"usageCreditReminderTemplate"},{label:tb("termsAcceptanceReminderTemplate","Terms Acceptance Reminder Template"),type:"string",path:"termsAcceptanceReminderTemplate"},{label:tb("usageCreditReminderSmsTemplate","Usage Credit Reminder SMS Template"),type:"string",path:"usageCreditReminderSmsTemplate"},{label:tb("smsReminderTemplate","SMS Reminder Template"),type:"string",path:"smsReminderTemplate"},{label:tb("selfBookingClientNotePlaceholder","Self Booking Client Note Placeholder"),type:"string",path:"selfBookingClientNotePlaceholder"},{label:tb("trackConversionTo","Track Conversion To"),type:"array",path:"trackConversionTo"},{label:tC("plans","Plans"),type:"array",path:"plans",children:[{label:tC("name","Name"),type:"string",path:"plans.name"},{label:tC("newName","New Name (for renaming during import)"),type:"string",path:"plans.newName"},{label:tC("description","Description"),type:"string",path:"plans.description"},{label:tC("price","Price"),type:"number",path:"plans.price"},{label:tC("pricePerVisit","Price Per Visit"),type:"number",path:"plans.pricePerVisit"},{label:tC("signupPrice","Signup Price"),type:"number",path:"plans.signupPrice"},{label:tC("deposit","Deposit"),type:"number",path:"plans.deposit"},{label:tC("latePaymentAmount","Late Payment Amount"),type:"number",path:"plans.latePaymentAmount"},{label:tC("visits","Visits"),type:"number",path:"plans.visits"},{label:tC("maxHoldNumber","Max Hold Number"),type:"number",path:"plans.maxHoldNumber"},{label:tC("maxHoldPeriod","Max Hold Period"),type:"string",path:"plans.maxHoldPeriod"},{label:tC("dueMinusDays","Due Minus Days"),type:"number",path:"plans.dueMinusDays"},{label:tC("latePaymentDays","Late Payment Days"),type:"number",path:"plans.latePaymentDays"},{label:tC("taxRate","Tax Rate"),type:"number",path:"plans.taxRate"},{label:tC("currency","Currency"),type:"string",path:"plans.currency"},{label:tC("paymentType","Payment Type"),type:"string",path:"plans.paymentType"},{label:tC("planType","Plan Type"),type:"string",path:"plans.planType"},{label:tC("paymentInterval","Payment Interval"),type:"string",path:"plans.paymentInterval"},{label:tC("dueType","Due Type"),type:"string",path:"plans.dueType"},{label:tC("startType","Start Type"),type:"string",path:"plans.startType"},{label:tC("visitInterval","Visit Interval"),type:"string",path:"plans.visitInterval"},{label:tC("recurringInvoiceNote","Recurring Invoice Note"),type:"string",path:"plans.recurringInvoiceNote"},{label:tC("assignedClientTags","Assigned Client Tags"),type:"array",path:"plans.assignedClientTags"},{label:tC("locations","Locations"),type:"array",path:"plans.locations"},{label:"Enabled For Self Booking",type:"boolean",path:"plans.enabledForSelfBooking"},{label:"Can Be Deleted",type:"boolean",path:"plans.canBeDeleted"},{label:tC("canBePurchasedWithoutBooking","Can Be Purchased Without Booking"),type:"boolean",path:"plans.canBePurchasedWithoutBooking"},{label:tC("holdPossible","Hold Possible"),type:"boolean",path:"plans.holdPossible"},{label:tC("makesMember","Makes Member"),type:"boolean",path:"plans.makesMember"},{label:tC("makesLifetimeMember","Makes Lifetime Member"),type:"boolean",path:"plans.makesLifetimeMember"},{label:tC("onlyPayableWithCredit","Only Payable With Credit"),type:"boolean",path:"plans.onlyPayableWithCredit"},{label:tC("signupWaivedIfMember","Signup Waived If Member"),type:"boolean",path:"plans.signupWaivedIfMember"},{label:tC("useBillingPolicyForRegistrationAndDiscounts","Use the tuition policy for registration and discounts"),type:"boolean",path:"plans.useBillingPolicyForRegistrationAndDiscounts"},{label:tC("spotlight","Spotlight"),type:"boolean",path:"plans.spotlight"},{label:tC("visitPreEnroll","Visit Pre Enroll"),type:"boolean",path:"plans.visitPreEnroll"},{label:tC("requiresPaymentMethodForFreePlan","Requires Payment Method For Free Plan"),type:"boolean",path:"plans.requiresPaymentMethodForFreePlan"},{label:tC("requiresTermsAndConditionsAcceptance","Requires Terms And Conditions Acceptance"),type:"boolean",path:"plans.requiresTermsAndConditionsAcceptance"},{label:tC("sessionConversionTracking","Class Conversion Tracking"),type:"boolean",path:"plans.sessionConversionTracking"},{label:tC("countStaffCanceledVisits","Count Staff Canceled Visits"),type:"boolean",path:"plans.countStaffCanceledVisits"},{label:tC("autoPayDeltaDays","Auto Pay Delta Days"),type:"number",path:"plans.autoPayDeltaDays"},{label:tC("clientLifecycleStatusOnBook","Client Lifecycle Status On Book"),type:"string",path:"plans.clientLifecycleStatusOnBook"},{label:tC("clientLifecycleStatusOnAttended","Client Lifecycle Status On Attended"),type:"string",path:"plans.clientLifecycleStatusOnAttended"},{label:tC("clientLifecycleStatusOnCancel","Client Lifecycle Status On Cancel"),type:"string",path:"plans.clientLifecycleStatusOnCancel"},{label:"Discount Policy",type:"object",path:"plans.discountPolicy",children:[{label:tC("householdDiscountType","Discount Type"),type:"string",path:"plans.discountPolicy.discountType"},{label:tC("householdDiscountRate","Discount Rate"),type:"number",path:"plans.discountPolicy.discountRate"},{label:tC("householdDiscountTarget","Discount Target"),type:"string",path:"plans.discountPolicy.discountTarget"},{label:tC("householdDiscountSubscriptionScope","Subscription Scope"),type:"string",path:"plans.discountPolicy.subscriptionScope"}]}]},{label:tb("lateCancellationType","Late Cancellation Type"),type:"string",path:"lateCancellationType"},{label:tb("lateCancellationCriteria","Late Cancellation Criteria"),type:"array",path:"lateCancellationCriteria",children:[{label:"Cancellation Type",type:"string",path:"lateCancellationCriteria.cancellationType"},{label:"Days",type:"array",path:"lateCancellationCriteria.days"},{label:"Time Of Day",type:"string",path:"lateCancellationCriteria.timeOfDay"}]}],tw=e=>{var n=[],t=e=>
1{e.forEach(e=>{e.children&&0!==e.children.length?t(e.children):n.push(e.path)})};return t(e),n},tN=e=>{var n=new Set(e);return tE.forEach(e=>n.add(e)),Array.from(n).some(e=>e.startsWith("plans.")&&"plans.name"!==e)&&n.add("plans.name"),Array.from(n)},tP=["termsAndConditionsRevision","lateVisitCancellationServiceCreditService","staffVisitCancellationServiceCreditService","visitCancellationServiceCreditService","autoHoldService"],tD=["trackConversionTo"],tj=function(e,n){var t,i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a={},l=(e,n)=>n.split(".").reduce((e,n)=>{if(null!=e)return e[n]},e),r=(e,n)=>{if(null==n){a[e]="";return}Array.isArray(n)?0===n.length?a[e]="":"object"!=typeof n[0]?a[e]=n.join(", "):a[e]=n:"object"==typeof n&&null!==n&&n.id?a[e]=n.id:a[e]=n};return n.forEach(n=>{if(n.startsWith("plans.")){var t=n.replace("plans.","");(e.plans||[]).forEach((e,s)=>{var o,c=!0===e.useBillingPolicyForRegistrationAndDiscounts,d=l(e,t);if("locations"===t){a[o="plan".concat(s+1,"Locations")]=d?d.map(e=>e.id).join(", "):"";return}if(t.startsWith("discountPolicy.")){var u=t.replace("discountPolicy.",""),p=(0,ti.ND)(u);o="plan".concat(s+1,"DiscountPolicy").concat(p)}else{var m=(0,ti.ND)(t);o="plan".concat(s+1).concat(m)}var h="PAYMENT_TYPE_TUITION_TABLE"===e.paymentType;c&&i&&tx.has(n)||h&&i&&tS.has(n)?r(o,""):r(o,d)})}else if(n.startsWith("lateCancellationCriteria.")){var s=n.replace("lateCancellationCriteria.","");(e.lateCancellationCriteria||[]).forEach((e,n)=>{var t=l(e,s),i=(0,ti.ND)(s);r("lcc".concat(n+1).concat(i),t)})}else{var o=l(e,n);tP.includes(n)||tD.includes(n)?a[n]=o:r(n,o)}}),(t=e=>{Object.keys(e).forEach(n=>{var i=e[n];!0===i?e[n]="TRUE":!1===i?e[n]="FALSE":null===i||"object"!=typeof i||Array.isArray(i)?Array.isArray(i)&&i.forEach(e=>{e&&"object"==typeof e&&t(e)}):t(i)})})(a),tP.forEach(e=>{if(n.includes(e)){var t;a[e]=(null==(t=a[e])?void 0:t.id)?a[e].id:""}}),tD.forEach(e=>{if(n.includes(e)&&a[e]){var t;a[e]=null==(t=a[e])?void 0:t.map(e=>e.id).join(", ")}}),a},tE=["id","name"],t_=(e,n)=>!!tE.includes(e)||"plans.name"===e&&n.some(e=>e.startsWith("plans.")&&"plans.name"!==e);t(43831),t(56015),t(36322);var tk=t(60680),tR=t.n(tk),tO=t(56554);function tI(){var e=(0,u._)(["\n    max-height: 600px;\n    overflow-y: auto;\n    border: 1px solid #e1e5e9;\n    // border-radius: 8px;\n    background: #fff;\n"]);return tI=function(){return e},e}function tU(){var e=(0,u._)(["\n    display: flex;\n    align-items: center;\n    padding: 8px 12px;\n    border-bottom: 1px solid #e1e5e9;\n    transition: background-color 0.2s ease;\n    margin-left: ","px;\n\n    &:hover {\n        background: ",";\n    }\n\n    &:last-child {\n        border-bottom: none;\n    }\n"]);return tU=function(){return e},e}function tV(){var e=(0,u._)(["\n    font-size: 14px;\n    color: ",";\n    flex: ",";\n    cursor: pointer;\n"]);return tV=function(){return e},e}function tL(){var e=(0,u._)(["\n    background: none;\n    border: none;\n    margin-right: 8px;\n    cursor: pointer;\n    color: #666;\n    transition: transform 0.2s ease;\n    transform: ",";\n    z-index: 1;\n    position: relative;\n    padding: 2px;\n\n    &:hover {\n        color: #333;\n    }\n\n    i {\n        font-size: 12px;\n    }\n"]);return tL=function(){return e},e}function tB(){var e=(0,u._)(["\n    height: 100%;\n    margin-bottom: 0 !important;\n"]);return tB=function(){return e},e}function tM(){var e=(0,u._)(["\n    font-size: 12px;\n    color: #666;\n    margin-bottom: 8px;\n"]);return tM=function(){return e},e}function tF(){var e=(0,u._)(["\n    margin-bottom: 12px;\n"]);return tF=function(){return e},e}function tW(){var e=(0,u._)(["\n    font-size: 12px;\n    color: #666;\n    margin-top: 4px;\n"]);return tW=function(){return e},e}function tq(){var e=(0,u._)(["\n    padding: 20px;\n    text-align: center;\n    color: #666;\n    font-style: italic;\n"]);return tq=function(){return e},e}function tH(){var e=(0,u._)(["\n    background-color: #fff3cd;\n    padding: 1px 2px;\n    border-radius: 2px;\n"]);return tH=function(){return e},e}var tz=h.Ay.div(tI()),tY=h.Ay.div(tU(),e=>2*e.depth,e=>e.isSelected?"#e9ecef":"#f8f9fa"),tG=h.Ay.span(tV(),e=>0===e.depth?"#333":"#666",e=>e.hasExpandButton?"1":"none"),t$=h.Ay.button(tL(),e=>e.isExpanded?"rotate(90deg)":"rotate(0deg)"),tK=(0,h.Ay)(J.A)(tB()),tJ=h.Ay.div(tM()),tQ=h.Ay.div(tF()),tZ=h.Ay.div(tW()),tX=h.Ay.div(tq()),t0=h.Ay.span(tH()),t1=tw(tA),t6=e=>{var{selectedFields:n,onFieldsChange:t}=e,[l,r]=(0,a.useState)(new Set),[s,o]=(0,a.useState)(""),u=(0,tO.A)(s,250),p=(0,a.useCallback)(e=>{var n=[],t=e=>
1{e.forEach(e=>{e.children&&0!==e.children.length?t(e.children):n.push(e.path)})};return t(e),n},[]),m=(0,a.useMemo)(()=>t1.length>0&&t1.every(e=>n.includes(e)),[n]),h=(0,a.useMemo)(()=>{if(!u.trim())return tA;var e=u.toLowerCase(),n=t=>t.filter(t=>{var i=t.label.toLowerCase().includes(e)||t.path.toLowerCase().includes(e),a=!!t.children&&n(t.children).length>0;return i||a}).map(e=>{if(e.children){var t=n(e.children);if(t.length>0)return(0,d._)((0,c._)({},e),{children:t})}return e});return n(tA)},[u]),v=(0,a.useMemo)(()=>p(h),[h,p]),f=(0,a.useCallback)((e,n)=>{if(!n.trim())return e;var t=RegExp("(".concat(tR()(n),")"),"gi");return e.split(t).map((e,n)=>t.test(e)?(0,i.jsx)(t0,{children:e},n):e)},[]),y=(0,a.useCallback)(e=>{r(n=>{var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t})},[]),g=(0,a.useCallback)((e,i)=>{if(!t_(e,n)){var a=new Set(n);if("object"===i.type||"array"===i.type&&i.children&&i.children.length>0){var l=p(i.children||[]),r=l.every(e=>a.has(e));a.delete(e),r?l.forEach(e=>{tE.includes(e)||a.delete(e)}):l.forEach(e=>a.add(e))}else a.has(e)?a.delete(e):a.add(e);t(Array.from(a))}},[n,t,p]),b=(0,a.useCallback)(()=>{t(t1)},[t,t1]),C=(0,a.useCallback)(()=>{t(tE)},[t]),x=(0,a.useCallback)(e=>"object"===e.type||"array"===e.type&&e.children&&e.children.length>0?{isSelected:p(e.children).every(e=>n.includes(e))}:{isSelected:n.includes(e.path)},[n,p]),S=(0,a.useCallback)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=l.has(e.path),{isSelected:r}=x(e),o=e.children&&e.children.length>0,c=t_(e.path,n),d=u.trim()&&o&&e.children.some(e=>e.label.toLowerCase().includes(u.toLowerCase())||e.path.toLowerCase().includes(u.toLowerCase()));return(0,i.jsxs)("div",{children:[(0,i.jsxs)(tY,{depth:t,isSelected:r,children:[o&&(0,i.jsx)(t$,{isExpanded:a||d,onClick:n=>{n.stopPropagation(),n.preventDefault(),y(e.path)},children:(0,i.jsx)("i",{className:"fas fa-chevron-right"})}),(0,i.jsx)(tK,{isChecked:r,onClick:n=>{c||g(e.path,e)},checkedColor:"#303f9f",isDisabled:c,text:(0,i.jsxs)(tG,{depth:t,hasExpandButton:o,style:{cursor:c?"not-allowed":"pointer"},children:[f(e.label,s),c&&(0,i.jsx)("span",{style:{fontSize:"12px",marginLeft:"4px"},children:"(required)"})]})})]}),o&&(a||d)&&(0,i.jsx)("div",{style:{marginLeft:"18px",paddingLeft:"8px"},children:e.children.map(e=>S(e,t+1))})]},e.path)},[l,n,g,y,u,f,x]);return(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{style:{marginBottom:"12px"},children:[(0,i.jsx)(eP.A,{className:"btn btn-primary btn-rounded mr-2",onClick:b,disabled:m,children:"Select All"}),(0,i.jsx)(eP.A,{className:"btn btn-primary btn-rounded",onClick:C,disabled:0===n.length,children:"Clear All"})]}),(0,i.jsxs)(tQ,{children:[(0,i.jsx)("input",{type:"text",className:"form-control",placeholder:"Search fields... (e.g., 'price', 'plans', 'cancellation')",value:s,onChange:e=>o(e.target.value)}),s.trim()&&(0,i.jsxs)(tZ,{children:["Found ",v.length," matching fields"]})]}),(0,i.jsxs)(tJ,{children:[n.length," of ",t1.length," fields selected"]}),(0,i.jsx)(tz,{children:h.length>0?h.map(e=>S(e)):(0,i.jsxs)(tX,{children:['No fields match "',s,'"']})})]})};function t2(){var e=(0,u._)(["\n    query servicesForCSVExport(\n        $business: String!\n        $serviceIds: [ID]\n        $tags: [String]\n    ) {\n        services(business: $business, serviceIds: $serviceIds, tags: $tags) {\n            id\n            name\n            allowClientToSelfCancelUnpaid\n            allowStaffToClientCancelUnpaid\n            allowsDropIn\n            allowsJoinOnline\n            alternativeBookingLink\n            autoHold\n            autoHoldDays\n            autoHoldService {\n                id\n            }\n            automateConversion\n            automateConversionEmail\n            business\n            calendarColor\n            cancellationEmail\n            cancellationPolicy\n            cancellationWindowHours\n            cleanupDurationMinutes\n            clientLifecycleStatusOnAttended\n            clientLifecycleStatusOnBook\n            clientLifecycleStatusOnCancel\n            clientLifecycleStatusOnWaitlistAdded\n            clientLifecycleStatusOnWaitlistRemoved\n            confirmationEmail\n            creditOnlyValidOncePaid\n            deactivated\n            description\n            disableLessonMateRequest\n            disableSelfCancellation\n            disableUseCredits\n            durationMinutes\n            enforceScheduleOptimizationForSelfBooking\n            enrollmentWindowGracePeriodDays\n            enrollmentWindowNotAfterMinutes\n            enrollmentWindowNotBeforeMinutes\n            eventType\n            followUpEmail\n            hasSe
1ssions\n            hiddenAt\n            lateCancellationType\n            lateVisitCancellationCashCredit\n            lateVisitCancellationConsequence\n            lateVisitCancellationServiceCreditName\n            lateVisitCancellationServiceCreditService {\n                id\n            }\n            lateVisitCancellationServiceCreditSubscriptionCap\n            lateVisitCancellationServiceCreditValidityDays\n            mainPhoto\n            maxSchedulingGapMinutes\n            maximumClients\n            maximumWaitlistClients\n            notAfterAgeMonths\n            notBeforeAgeMonths\n            notificationPeriodHours\n            photos\n            priority\n            reminderEmail\n            requiresBooking\n            requiresPaymentMethodForWaitlist\n            restrictCreditUsageWithStaff\n            scheduleOptimizationStrategy\n            selfBookingAvailabilityMode\n            selfBookingClientNotePlaceholder\n            selfBookingClientNoteRequired\n            sendFollowUpEmail\n            sendSessionEndEmail\n            sessionEndEmail\n            setupDurationMinutes\n            shortDescription\n            shouldRemindCreditUsage\n            shouldRemindCreditUsageExpirationBeforeDays\n            shouldRemindCreditUsageIntervalDays\n            slotIntervalMinutes\n            slotStartSnap\n            smsNotificationPeriodHours\n            smsReminderTemplate\n            snapDurationMinutes\n            spotlight\n            staffVisitCancellationCashCredit\n            staffVisitCancellationConsequence\n            staffVisitCancellationServiceCreditName\n            staffVisitCancellationServiceCreditService {\n                id\n            }\n            staffVisitCancellationServiceCreditValidityDays\n            tags\n            termsAcceptanceReminderTemplate\n            termsAndConditionsRevision {\n                id\n            }\n            trackConversionTo {\n                id\n            }\n            usageCreditReminderSmsTemplate\n            usageCreditReminderTemplate\n            visibleByClients\n            visibleByVisitors\n            visitCancellationCashCredit\n            visitCancellationConsequence\n            visitCancellationServiceCreditName\n            visitCancellationServiceCreditService {\n                id\n            }\n            visitCancellationServiceCreditSubscriptionCap\n            visitCancellationServiceCreditSubscriptionPeriodCap\n            visitCancellationServiceCreditSubscriptionPeriodCapDays\n            visitCancellationServiceCreditValidityDays\n            waitlistPolicy\n            weeklyCheckLongTermToleranceThresholdMaxCount\n            weeklyCheckShortTermToleranceThresholdDays\n            weeklyCheckShortTermToleranceThresholdMaxCount\n            plans {\n                assignedClientTags\n                autoPayDeltaDays\n                canBeDeleted\n                canBePurchasedWithoutBooking\n                clientLifecycleStatusOnAttended\n                clientLifecycleStatusOnBook\n                clientLifecycleStatusOnCancel\n                countStaffCanceledVisits\n                currency\n                deposit\n                description\n                discountPolicy {\n                    discountType\n                    discountRate\n                    discountTarget\n                    subscriptionScope\n                }\n                dueMinusDays\n                dueType\n                enabledForSelfBooking\n                holdPossible\n                latePaymentAmount\n                latePaymentDays\n                locations {\n                    id\n                }\n                makesLifetimeMember\n                makesMember\n                maxHoldNumber\n                maxHoldPeriod\n                name\n                onlyPayableWithCredit\n                paymentInterval\n                paymentType\n                planType\n                price\n                pricePerVisit\n                recurringInvoiceNote\n                requiresPaymentMethodForFreePlan\n                requiresTermsAndConditionsAcceptance\n                sessionConversionTracking\n                signupPrice\n                signupWaivedIfMember\n                useBillingPolicyForRegistrationAndDiscounts\n                spotlight\
1n                startType\n                taxRate\n                visitInterval\n                visitPreEnroll\n                visits\n            }\n            lateCancellationCriteria {\n                cancellationType\n                days\n                timeOfDay\n            }\n        }\n    }\n"]);return t2=function(){return e},e}function t5(){var e=(0,u._)(["\n    margin-bottom: 20px;\n"]);return t5=function(){return e},e}function t3(){var e=(0,u._)(["\n    color: #666;\n    font-size: 14px;\n    margin-bottom: 16px;\n"]);return t3=function(){return e},e}var t8=(0,nF.J1)(t2()),t4=h.Ay.div(t5()),t9=h.Ay.p(t3());function t7(e){var n,t,r,{isOpen:s,toggle:o,searchFilter:c,selectedServiceIds:d,tagsFilter:u=[]}=e,p=(0,l.useSelector)(e=>e.app.business.name),m=(0,l.useSelector)(e=>{var n;return(null==(n=e.app.business)?void 0:n.tuitionPolicyEnabled)===!0}),[h,v]=(0,a.useState)(null),[f,y]=(0,a.useState)(tN(tw(tA))),[g,b]=(0,a.useState)(!1),[C,x]=(0,tf.A)(t8,{onCompleted:e=>{v(e.services)},onError:e=>{console.error("Error fetching services:",e),v([])},context:{}}),S=!!x&&"loading"in x&&x.loading,T=(0,a.useCallback)(()=>{"function"==typeof C?C({variables:{business:p,serviceIds:(null==d?void 0:d.length)>0?d:null,tags:(null==u?void 0:u.length)>0?u.map(e=>e.label):null}}):console.error("executeQuery is not a function")},[C,p,d,u]);(0,a.useEffect)(()=>{s&&null===h&&!S&&T()},[s,h,S,T]);var A=f.filter(e=>m||"plans.useBillingPolicyForRegistrationAndDiscounts"!==e),w=c?(h||[]).filter(e=>e.name.toLowerCase().includes(c.toLowerCase())):h||[],N=(n=[],t=(e,t,i)=>{for(var a=function(i){l.forEach(a=>{if(a==="".concat(e,".discountPolicy.discountType")){var l="".concat(t).concat(i+1,"DiscountPolicyDiscountType"),r="".concat(t,"_").concat(i+1,"_discount_policy_discount_type");n.push({key:l,label:r})}else if(a==="".concat(e,".discountPolicy.discountRate")){var s="".concat(t).concat(i+1,"DiscountPolicyDiscountRate"),o="".concat(t,"_").concat(i+1,"_discount_policy_discount_rate");n.push({key:s,label:o})}else if(a==="".concat(e,".discountPolicy.discountTarget")){var c="".concat(t).concat(i+1,"DiscountPolicyDiscountTarget"),d="".concat(t,"_").concat(i+1,"_discount_policy_discount_target");n.push({key:c,label:d})}else if(a==="".concat(e,".discountPolicy.subscriptionScope")){var u="".concat(t).concat(i+1,"DiscountPolicySubscriptionScope"),p="".concat(t,"_").concat(i+1,"_discount_policy_subscription_scope");n.push({key:u,label:p})}else{var m=a.split(".")[1];if(m){var h="".concat(t).concat(i+1).concat(tv()(m)),v="".concat(t,"_").concat(i+1,"_").concat(tm()(m));n.push({key:h,label:v})}}})},l=A.filter(n=>n.startsWith("".concat(e,"."))),r=0;r<i;r+=1)a(r)},A.forEach(e=>{"plans"===e||"lateCancellationCriteria"===e||e.startsWith("plans.")||e.startsWith("lateCancellationCriteria.")||n.push({key:e,label:tm()(e)})}),A.some(e=>e.startsWith("plans."))&&t("plans","plan",Math.max(...(w||[]).map(e=>{var n;return(null==(n=e.plans)?void 0:n.length)||0}),1)),A.some(e=>e.startsWith("lateCancellationCriteria."))&&t("lateCancellationCriteria","lcc",Math.max(...(w||[]).map(e=>{var n;return(null==(n=e.lateCancellationCriteria)?void 0:n.length)||0}),1)),n),P=w.map(e=>tj(e,A,m));m&&(N=N.filter(e=>{var{key:n}=e,t=(e=>{if(!e.startsWith("plan"))return null;for(var n=4;n<e.length;){var t=e.charCodeAt(n);if(t<48||t>57)break;n+=1}return 4===n?null:e.slice(n)})(n);return!(t&&tT.has(t))||P.some(e=>{var t=e[n];return""!==t&&null!=t})})),r=S?ty._:null===h||0===(w||[]).length?ty.KK:ty.Fv;var D=(null==d?void 0:d.length)>0?"Export ".concat(d.length," selected services as CSV"):c?"Export ".concat((null==w?void 0:w.length)||0,' services matching "').concat(c,'" as CSV'):"Export all services as CSV",j=()=>{b(!1),o()},E=(0,a.useCallback)(e=>{y(tN(e))},[]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(eH.A,{isOpen:s,toggle:o,size:"lg",onClosed:()=>{v(null),b(!1),y(tN(tw(tA)))},modalName:"services-export",wrapClassName:"modal-primary",children:[(0,i.jsx)(n7.A,{toggle:o,children:"Export Services"}),(0,i.jsx)(te.A,{children:(0,i.jsxs)(t4,{children:[(0,i.jsx)(t9,{children:"All fields are selected by default. You can deselect fields you don't want to include in your export. ID and Name fields are required and cannot be deselected."}),(0,i.jsx)(t6,{selectedFields:f,onFieldsChange:E})]})}),(0,i.jsx)(tn.A,{children:(0,i.jsx)(eP.A,{primary:!0,onClick:()=>{null===h&&T(),b(!0)},disabled:0===f.length,className:"btn btn-primary btn-rounded",children:"Export CSV"})})]}),g&&(0,i.jsx)(ty.Ay,{isOpen:g,onClosed:j,toggle:j,status:r,cleanupDataFn:null,headers:N,items:P,title:D,reportName:"services",invali
1dStatusMessage:"No services available for export"})]})}var ie=()=>{var[e,n]=(0,a.useState)(!1),[t,o]=(0,a.useState)([]),[c,d]=(0,a.useState)(!1),[u,p]=(0,eA.A)("servicesList.searchValue",""),[m,h]=(0,eA.A)("servicesList.filteredTags",[]),v=(0,r.W6)(),f=(0,l.useDispatch)();(0,td.A)("Services");var y=()=>{d(!c)};return(0,i.jsxs)("div",{children:[(0,i.jsx)(tc,{isOpen:e,toggle:()=>n(e=>!e),onContinue:e=>{f({type:"serviceEditor@INIT_FORM_DATA",payload:{serviceType:e,formData:{}}}),v.push("/services/create")}}),(0,i.jsx)(t7,{isOpen:c,toggle:y,searchFilter:u,selectedServiceIds:t,tagsFilter:m}),(0,i.jsx)(s.A,{title:"Services",description:"",children:(0,i.jsx)("div",{className:"row",children:(0,i.jsxs)("div",{className:"col-12 col-md-12 col-xl-12",children:[(0,i.jsxs)("div",{className:"form-group",children:[(0,i.jsxs)("div",{className:"input-group",children:[(0,i.jsx)("span",{className:"input-group-addon rounded-left",children:(0,i.jsx)("i",{className:"fa fa-search"})}),(0,i.jsx)("input",{type:"text",className:"form-control search-services",placeholder:"Search services...",value:u,onChange:e=>p(e.target.value)}),(0,i.jsxs)("div",{className:"input-group-append",children:[(0,n9.oz)(x.ACTION_CREATE,C.RESOURCE_STAFF)&&(0,i.jsx)("button",{type:"button",className:"btn btn-primary",id:"btn-add-service",onClick:()=>n(!0),onMouseDown:e=>e.preventDefault(),children:"Add Service"}),(0,tu.A)()&&(0,i.jsx)("button",{type:"button",className:"btn btn-secondary ml-2 btn-rounded",id:"btn-export-services",onClick:y,onMouseDown:e=>e.preventDefault(),children:"Export CSV"})]})]}),(0,i.jsx)("small",{className:"form-text text-muted",children:"Search by service name"})]}),(0,i.jsx)("ul",{className:"list-group",id:"all-services",children:(0,i.jsx)(n4,{search:u.toLowerCase(),onSelectedServicesChange:o,filteredTags:m,setFilteredTags:h})})]})})})]})}},94362:function(e,n,t){t.d(n,{A:function(){return a}});var i=t(74848);t(96540);var a=e=>{var{className:n,children:t}=e;return(0,i.jsx)("div",{className:n,role:"alert",children:t})}},82847:function(e,n,t){var i=t(71893),a=t(55456),l=t(18542);t(93632);var r=t(96540),s=t(77969),o=t(62193),c=t.n(o),d=t(48810),u=t(50926);n.A=(e,n)=>{var{processor:t=e=>e,onError:o,errorTitle:p="Error fetching data",doLogError:m=!0,context:h}=n,v=(0,l._)(n,["processor","onError","errorTitle","doLogError","context"]),f=(0,r.useCallback)(e=>{(0,d.UG)({title:p,message:e.message}),m&&(e.message="error fetching data: ".concat(e.message),(0,u.Fk)(e)),o&&o(e)},[o,m,p]),[y,g]=(0,s._)(e,(0,a._)((0,i._)({},v),{context:h,onError:f})),{loading:b,error:C,data:x,previousData:S}=g,T=(0,l._)(g,["loading","error","data","previousData"]),A=x,w=S;try{A&&!c()(A)&&(A=t(A)),w&&!c()(w)&&(w=t(w))}catch(e){f(e),A=null}return[y,(0,i._)({data:A,previousData:w,error:C,loading:b},T)]}}}]);
2//# sourceMappingURL=16509.34e01d1c.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.