!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="15dba793-b58c-4012-a754-1bac6b32196e",e._sentryDebugIdIdentifier="sentry-dbid-15dba793-b58c-4012-a754-1bac6b32196e")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4456],{15926:function(e,t,i){i.d(t,{Z:function(){return n.Zb}});var n=i(4191)},85439:function(e,t,i){i.d(t,{Fg:function(){return o.F},T8:function(){return n.T8},TK:function(){return n.TK},XW:function(){return r.XW9},Zb:function(){return n.Zb},_4:function(){return r._4V},f6:function(){return o.Z}});var n=i(4191),o=i(23009),r=i(99206)},14799:function(e,t,i){i.d(t,{l:function(){return n.lY}});var n=i(42024)},55490:function(e,t,i){i.d(t,{m:function(){return n.m}});var n=i(18429)},19164:function(e,t,i){i.d(t,{b:function(){return n.Z}});var n=i(1899)},7489:function(e,t,i){i.d(t,{Q:function(){return n.Qm},g:function(){return o.go}});var n=i(4191),o=i(52043)},91914:function(e,t,i){i.d(t,{f:function(){return n.Z}});var n=i(23009)},34892:function(e,t,i){i.d(t,{F:function(){return n.F},f:function(){return n.Z}});var n=i(23009)},28039:function(e,t,i){i.d(t,{e:function(){return n.es}});var n=i(81770)},86153:function(e,t,i){i.d(t,{t:function(){return n.t}});var n=i(798)},92799:function(e,t,i){i.d(t,{c0:function(){return n.c0}});var n=i(73822)},46908:function(e,t,i){i.d(t,{i:function(){return n.i}});var n=i(87966)},41273:function(e,t,i){i.d(t,{g:function(){return d},A:function(){return l}});var n=i(82907),o=i(50192);class r extends Error{constructor(e,t,i,n,o){super(n),this.data=e,this.code=o,this.config=i,this.headers=t}}class s extends r{constructor(e,t,i,n="권한이 필요합니다.",o="REGRANT_PERMISSION"){super(e,t,i,n,o)}}var a=i(57350);let l=n.default.create({baseURL:a.n});function d(e){return(0,o.IZ)(e)&&e.config.isRecatchAxios}l.interceptors.request.use(e=>(e.isRecatchAxios=!0,e)),l.interceptors.response.use(e=>e,e=>e.isAxiosError&&e.response&&406===e.response.status?Promise.reject(new s(e.response.data,e.response.headers,e.response.config,e.response.data.message,e.response.data.code||e.response.status.toString())):Promise.reject(e))},37145:function(e,t,i){var n=i(80432);i(91781);var o=i(55670),r=i(80642),s=i(57485);let a=o.ZP.div.withConfig({componentId:"sc-659edb1c-0"})(["display:flex;flex-direction:column;gap:4px;"]),l=o.ZP.div.withConfig({componentId:"sc-659edb1c-1"})(["padding-left:24px;"]),d=(0,o.ZP)(s.g).withConfig({componentId:"sc-659edb1c-2"})(["padding-left:24px;color:",";"],e=>{let{theme:t}=e;return t.colorErrorText});t.Z=function(e){let{isSelected:t,name:i,errorMessage:o,children:s,onChange:c}=e;return(0,n.jsxs)(a,{children:[(0,n.jsx)(r.ZP,{checked:t,onChange:c,children:i}),(0,n.jsx)(l,{children:s}),o&&(0,n.jsx)(d,{children:o})]})}},96839:function(e,t,i){i.d(t,{Z:function(){return eA}});var n=i(80432),o=i(55670),r=i(3056),s=i(14026),a=i(89473),l=i(18095),d=i(64369),c=i(66677),u=i(47069),p=i(37543),g=i(61999),h=i(77743),m=i(12355),f=i(34338),x=i(34904),b=i(1209),y=i(3777),v=i(41051),C=i(50576),w=i(93360),j=i(1439),T=i(63110),I=i(4191),F=i(52043),M=i(71196),N=i(79295),k=i(33384),E=i(42024),S=i(46908),P=i(16803);function Z(e){let{customForm:t}=e,i=(0,S.i)({formFields:t.fields.filter(y.ED),initialValues:t.fields});return(0,n.jsx)(E.if,{customForm:t,formInputValuesManager:i})}var D=function(e){let{formValuesManager:t}=e,{t:i}=(0,x.$G)(T.l.form),o=(0,r.useRef)(null),s=(0,r.useRef)(null),a=(0,r.useRef)(!1),l=(0,r.useMemo)(()=>t.values$,[t.values$]),d=(0,r.useCallback)(e=>{t.setTitle(e.target.value)},[t]),u=(0,r.useCallback)(e=>{t.setDescription(e.target.value)},[t]),p=(0,r.useCallback)(e=>{t.setSubmitText(e.target.value)},[t]),g=(0,r.useCallback)(()=>{if(!o.current)return;let e=window.innerHeight-189;o.current.clientHeight>e&&(o.current.style.maxHeight="".concat(e,"px"))},[]);(0,r.useEffect)(()=>(window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)),[g]);let h=(0,r.useCallback)(()=>{a.current||(setTimeout(()=>{var e;return null===(e=s.current)||void 0===e?void 0:e.focus()},100),a.current=!0)},[]);return(0,r.useEffect)(()=>(window.addEventListener("focus",h,{once:!0,capture:!0}),()=>window.removeEventListener("focus",h,{capture:!0})),[h]),(0,n.jsx)(c.W,{observable:l,loader:()=>(0,n.jsx)(I.TK,{}),builder:e=>{var r,a,l,c,g,h;let m=(0,P.c)(e);return(0,n.jsxs)(R,{children:[(0,n.jsxs)(_,{children:[(0,n.jsxs)(G,{width:"500px",children:[(0,n.jsx)(O,{children:i("formSetting")}),(0,n.jsx)(I.T8,{label:i("title"),children:(0,n.jsx)(M.default,{ref:s,autoFocus:!0,value:null!==(c=null===(r=e.metadata)||void 0===r?void 0:r.title)&&void 0!==c?c:"",placeholder:i("formTitle"),onChange:d})}),(0,n.jsx)(I.T8,{label:i("description"),children:(0,n.jsx)(M.default,{value:null!==(g=null===(a=e.metadata)||void 0===a?void 0:a.description)&&void 0!==g?g:"",placeholder:i("formDescription"),onChange:u})}),(0,n.jsx)(I.T8,{label:i("buttonText"),children:(0,n.jsx)(M.default,{value:null!==(h=null===(l=e.metadata)||void 0===l?void 0:l.submitText)&&void 0!==h?h:i("submit"),placeholder:i("inputSubmitButtonText"),onChange:p})})]}),(0,n.jsxs)(q,{width:"500px",children:[(0,n.jsx)(z,{children:i("questions")}),(0,n.jsx)(A,{}),(0,n.jsx)(k.vu,{isActivated:!0,formValuesManager:t.customFormFieldsManager})]})]}),(0,n.jsx)("div",{children:(0,n.jsx)($,{ref:o,children:(0,n.jsx)(Z,{customForm:m})})})]})}})};let R=o.ZP.div.withConfig({componentId:"sc-7384ae31-0"})(["display:flex;gap:24px;height:100%;"]),_=o.ZP.div.withConfig({componentId:"sc-7384ae31-1"})(["display:flex;flex-direction:column;gap:16px;padding-bottom:200px;"]),O=(0,o.ZP)(F.go).withConfig({componentId:"sc-7384ae31-2"})(["font-size:","px;font-weight:600;"],e=>{let{theme:t}=e;return t.fontSizeLG}),G=(0,o.ZP)(I.Zb).withConfig({componentId:"sc-7384ae31-3"})(["display:flex;flex-direction:column;gap:24px;padding:20px;height:unset;"]),q=(0,o.ZP)(I.Zb).withConfig({componentId:"sc-7384ae31-4"})(["display:flex;flex-direction:column;gap:24px;padding:20px 0;height:unset;"]),z=(0,o.ZP)(O).withConfig({componentId:"sc-7384ae31-5"})(["padding:0 20px;"]),A=(0,o.ZP)(N.Z).withConfig({componentId:"sc-7384ae31-6"})(["margin:0;"]),$=o.ZP.div.withConfig({componentId:"sc-7384ae31-7"})(["position:sticky;top:","px;display:flex;flex-direction:column;flex-shrink:1;width:330px;max-height:calc(100vh - 231px);align-items:center;margin-bottom:24px;border-radius:20px;padding-top:16px;border:1px solid ",";background:",";overflow:auto;-ms-overflow-style:none;scrollbar-width:none;::-webkit-scrollbar{display:none;}.recatch__form-maker__custom-form-view{min-height:unset;}"],189,e=>{let{theme:t}=e;return t.colorBorderSecondary},e=>{let{theme:t}=e;return t.colorBgContainer});var L=i(60183),B=i(78232),U=i(2854),W=i(33503),V=i(91914),H=i(70870),Y=i(48032),Q=i(49456);function X(e){let{customFormValuesManager:t,onSubmit:i}=e,o=(0,r.useMemo)(()=>t.values$,[t.values$]),s=(0,Y.P)(o);return s?(0,n.jsx)(J,{formValues:s,onSubmit:i}):null}function J(e){var t;let{formValues:i,onSubmit:o}=e,r=(0,P.c)(i),s=null===(t=i.metadata)||void 0===t?void 0:t.formStyle,a=(0,S.i)({formFields:r.fields.filter(y.ED),initialValues:r.fields});return(0,n.jsx)(V.f,{defaultMode:null==s?void 0:s.theme,seedToken:(null==s?void 0:s.primaryColor)?{colorPrimary:s.primaryColor}:void 0,token:(null==s?void 0:s.primaryColor)?{colorPrimary:s.primaryColor}:void 0,children:(0,n.jsx)(K,{children:(0,n.jsx)(E.if,{customForm:r,customFormStyles:s?Q.N.toModuleConfig(s).customFormStyles:void 0,formInputValuesManager:a,onSubmit:()=>{a.validateValues()&&(null==o||o(a.values))}})})})}let K=o.ZP.div.withConfig({componentId:"sc-eb36a27c-0"})(["width:100%;background:",";border-radius:20px;box-shadow:0px 0px 2px 1px rgba(0,0,0,0.04),0px 0px 8px 0px rgba(0,0,0,0.04);"],e=>{let{theme:t}=e;return t.colorBgContainer});var ee=function(e){let{t:t}=(0,x.$G)(T.l.entryNode),i=(0,r.useMemo)(()=>e.customFormManager.values$.pipe((0,d.U)(e=>{var t,i;return null===(i=e.metadata)||void 0===i?void 0:null===(t=i.formStyle)||void 0===t?void 0:t.theme})),[e.customFormManager.values$]);return(0,n.jsxs)(et,{children:[(0,n.jsx)(ei,{icon:(0,n.jsx)(U.Z,{}),onClick:e.onTestClick,children:t("routingTest")}),(0,n.jsxs)(en,{className:"recatch__workflow__flow__custom-form-view",children:[(0,n.jsx)(c.W,{observable:i,loadedFunc:()=>!0,loader:()=>null,builder:t=>(0,n.jsx)(V.f,{defaultMode:t,children:(0,n.jsx)(eo,{className:"nowheel",children:(0,n.jsx)(X,{customFormValuesManager:e.customFormManager})})})}),(0,n.jsx)(H.O,{type:"source",position:B.Ly.Right,$next:!!e.data.next}),(0,n.jsx)(er,{className:"recatch_workflow__custom-form-setting-button",icon:(0,n.jsx)(W.Z,{}),size:"large",onClick:e.onCustomFormSettingButtonClick})]})]})};let et=o.ZP.div.withConfig({componentId:"sc-d4110ac5-0"})(["display:flex;flex-direction:column;align-items:flex-start;"]),ei=(0,o.ZP)(m.ZP).withConfig({componentId:"sc-d4110ac5-1"})(["margin-bottom:7px;color:",";"],e=>{let{theme:t}=e;return t.colorTextSecondary}),en=o.ZP.div.withConfig({componentId:"sc-d4110ac5-2"})(["position:relative;&:hover{.recatch_workflow__custom-form-setting-button{display:inline-flex !important;}}"]),eo=o.ZP.div.withConfig({componentId:"sc-d4110ac5-3"})(["width:360px;max-height:670px;overflow:overlay;background:",";border-radius:20px;box-shadow:0px 0px 2px 1px rgba(0,0,0,0.04),0px 0px 8px 0px rgba(0,0,0,0.04);& > div{background:unset;border-radius:unset;box-shadow:unset;}"],e=>{let{theme:t}=e;return t.colorBgContainer}),er=(0,o.ZP)(m.ZP).withConfig({componentId:"sc-d4110ac5-4"})(["position:absolute;top:-15px;right:-15px;display:none !important;"]);var es=function(e){let{customFormManager:t,onTestClick:i}=e;return(0,n.jsx)(X,{customFormValuesManager:t,onSubmit:i})},ea=i(34675),el=i(69672),ed=i(23009),ec=i(48609),eu=function(e){let{formValuesManager:t}=e,{t:i}=(0,x.$G)(el.lS.form),{token:o}=(0,ed.F)(),{featureFlags:{showWatermarkCheckbox:s}}=(0,j.Ty)(),a=(0,r.useMemo)(()=>t.values$.pipe((0,d.U)(e=>{var t;return null!==(t=e.metadata)&&void 0!==t?t:{title:"",description:"",submitText:""}})),[t.values$]),l=(0,r.useCallback)(e=>{t.setTitle(e.target.value)},[t]),u=(0,r.useCallback)(e=>{t.setDescription(e.target.value)},[t]),p=(0,r.useCallback)(e=>{t.setSubmitText(e.target.value)},[t]),g=(0,r.useCallback)(e=>{t.setIsWatermarkHidden(e.target.checked)},[t]);return(0,n.jsxs)(ep,{children:[(0,n.jsx)(I.T8,{label:i("title"),labelPadding:"0 0 4px 0",labelColor:o.colorText,children:(0,n.jsx)(c.W,{observable:a,loader:()=>null,selectors:["title"],builder:e=>(0,n.jsx)(M.default.TextArea,{autoFocus:!0,value:e.title,placeholder:i("formTitle"),rows:3,onChange:l})})}),(0,n.jsx)(I.T8,{label:i("description"),labelPadding:"0 0 4px 0",labelColor:o.colorText,children:(0,n.jsx)(c.W,{observable:a,loader:()=>null,selectors:["description"],builder:e=>(0,n.jsx)(M.default.TextArea,{value:e.description,placeholder:i("formDescription"),rows:3,onChange:u})})}),(0,n.jsx)(I.T8,{label:i("buttonText"),labelPadding:"0 0 4px 0",labelColor:o.colorText,children:(0,n.jsx)(c.W,{observable:a,loader:()=>null,selectors:["submitText"],builder:e=>(0,n.jsx)(M.default,{value:e.submitText,placeholder:i("inputSubmitButtonText"),onChange:p})})}),s&&(0,n.jsx)(c.W,{observable:a,loader:()=>null,selectors:["isWatermarkHidden"],builder:e=>(0,n.jsx)(ec.Z,{checked:e.isWatermarkHidden,onChange:g,children:i("hideWatermark")})})]})};let ep=o.ZP.div.withConfig({componentId:"sc-460fd919-0"})(["padding:20px;display:flex;flex-direction:column;gap:20px;"]);function eg(e){let{formValuesManager:t}=e;return(0,n.jsx)(eh,{children:(0,n.jsx)(em,{children:(0,n.jsx)(X,{customFormValuesManager:t})})})}let eh=o.zo.div.withConfig({componentId:"sc-e8f9dbb4-0"})(["padding:127px 0;width:100%;min-height:100%;display:flex;justify-content:center;box-sizing:border-box;margin:auto;"]),em=o.zo.div.withConfig({componentId:"sc-e8f9dbb4-1"})(["width:400px;"]);var ef=function(e){let{formValuesManager:t}=e,{featureFlags:{makeEmailFieldOptional:i}}=(0,j.Ty)();return(0,n.jsx)(ex,{children:i?(0,n.jsx)(k.DF,{isActivated:!0,formValuesManager:t.customFormFieldsManager}):(0,n.jsx)(k.vu,{isActivated:!0,formValuesManager:t.customFormFieldsManager})})};let ex=o.ZP.div.withConfig({componentId:"sc-a75e1de-0"})(["padding:20px 0;"]);var eb=i(99206),ey=i(80642),ev=i(52905),eC=i(40082),ew=i(70604),ej=i(53518),eT=i(33511),eI=function(e){let{formValuesManager:t}=e,{t:i}=(0,x.$G)(el.lS.form),o=(0,r.useMemo)(()=>t.values$.pipe((0,d.U)(e=>{var t;return null===(t=e.metadata)||void 0===t?void 0:t.formStyle}),(0,ew.h)(ej.L)),[t.values$]);(0,r.useEffect)(()=>{t.setDefaultFormStyleIfNeeded()},[t]);let s=()=>t.setTheme("light"),a=()=>t.setTheme("dark");return(0,n.jsxs)(eF,{children:[(0,n.jsx)(eM,{children:(0,n.jsx)(c.W,{observable:o,loader:()=>null,selectors:["theme"],builder:e=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(I.T8,{label:i("light"),children:(0,n.jsx)(eN,{$url:eb.uth,$selected:"light"===e.theme,onClick:s})}),(0,n.jsx)(I.T8,{label:i("dark"),children:(0,n.jsx)(eN,{$url:eb.YDN,$selected:"dark"===e.theme,onClick:a})})]})})}),(0,n.jsx)(c.W,{observable:o,loader:()=>null,selectors:["size","buttonSize","customSelected"],builder:e=>{let o=e.customSelected,r=eT.h.getPresetNameFromSize(e.size);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(I.T8,{label:i("size"),children:(0,n.jsx)(ek,{optionType:"button",options:[{label:i("small"),value:"small"},{label:i("medium"),value:"medium"},{label:i("large"),value:"large"},{label:i("custom"),value:"custom"}],value:o?"custom":r,onChange:e=>t.setFormSizePreset(e.target.value)})}),o&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(eM,{children:[(0,n.jsx)(I.T8,{label:i("titleFontSize"),children:(0,n.jsx)(eE,{min:0,value:e.size.titleFontSize,onChange:e=>"number"==typeof e&&t.updateFormSize({titleFontSize:e})})}),(0,n.jsx)(I.T8,{label:i("descriptionFontSize"),children:(0,n.jsx)(eE,{min:0,value:e.size.descriptionFontSize,onChange:e=>"number"==typeof e&&t.updateFormSize({descriptionFontSize:e})})})]}),(0,n.jsxs)(eM,{children:[(0,n.jsx)(I.T8,{label:i("questionFontSize"),children:(0,n.jsx)(eE,{min:0,value:e.size.questionFontSize,onChange:e=>"number"==typeof e&&t.updateFormSize({questionFontSize:e})})}),(0,n.jsx)(eS,{label:i("spacing"),tooltip:(0,n.jsxs)(eP,{children:[(0,n.jsx)(eZ,{$url:eb.Ece}),(0,n.jsx)("div",{children:i("spacingDescription")})]}),tooltipPlacement:"right",children:(0,n.jsx)(eE,{min:0,value:e.size.gap,onChange:e=>"number"==typeof e&&t.updateFormSize({gap:e})})})]}),(0,n.jsx)(I.T8,{label:i("buttonSize"),children:(0,n.jsx)(ek,{optionType:"button",options:[{label:i("small"),value:"small"},{label:i("medium"),value:"medium"},{label:i("large"),value:"large"}],value:e.buttonSize,onChange:e=>t.setButtonSize(e.target.value)})})]})]})}}),(0,n.jsxs)(eM,{children:[(0,n.jsx)(I.T8,{label:i("primaryColor"),children:(0,n.jsx)(c.W,{observable:o,loader:()=>null,selectors:["primaryColor"],builder:e=>(0,n.jsx)(eR,{value:e.primaryColor,onChange:(e,i)=>t.setPrimaryColor(i)})})}),(0,n.jsx)(eD,{})]})]})};let eF=o.ZP.div.withConfig({componentId:"sc-62f08c35-0"})(["padding:20px;display:flex;flex-direction:column;gap:20px;"]),eM=o.ZP.div.withConfig({componentId:"sc-62f08c35-1"})(["display:flex;gap:16px;"]),eN=o.ZP.div.withConfig({componentId:"sc-62f08c35-2"})(["height:78px;background:url(",") no-repeat center / cover;border:",";border-radius:6px;box-sizing:border-box;cursor:pointer;"],e=>{let{$url:t}=e;return t},e=>{let{theme:t,$selected:i}=e;return"".concat(i?"2px":"1px"," solid ").concat(i?t.colorPrimary:t.colorBorderSecondary)}),ek=(0,o.ZP)(ey.ZP.Group).withConfig({componentId:"sc-62f08c35-3"})(["display:flex;.recatch-ant-radio-button-wrapper{flex:1;text-align:center;padding:0;}"]),eE=(0,o.ZP)(ev.Z).withConfig({componentId:"sc-62f08c35-4"})(["width:100%;"]),eS=(0,o.ZP)(I.T8).withConfig({componentId:"sc-62f08c35-5"})(["justify-content:flex-start;align-items:center;gap:4px;.custom-form-field-tooltip-button{color:",";}"],e=>{let{theme:t}=e;return t.colorTextPlaceholder}),eP=o.ZP.div.withConfig({componentId:"sc-62f08c35-6"})(["display:flex;flex-direction:column;gap:8px;width:170px;"]),eZ=o.ZP.div.withConfig({componentId:"sc-62f08c35-7"})(["width:100%;height:90px;background:url(",") no-repeat center / cover;border-radius:5px;"],e=>{let{$url:t}=e;return t}),eD=o.ZP.div.withConfig({componentId:"sc-62f08c35-8"})(["width:100%;"]),eR=(0,o.ZP)(eC.Z).withConfig({componentId:"sc-62f08c35-9"})([".recatch-ant-color-picker-color-block{width:100%;}"]);var e_=function(e){let{formValuesManager:t}=e,{t:i}=(0,x.$G)(el.lS.form),[o,s]=(0,r.useState)("0"),a=(0,r.useMemo)(()=>[{key:"0",label:(0,n.jsx)(I.YG.Label,{label:i("formSetting"),hasError:!1}),forceRender:!0,children:(0,n.jsx)(eq,{children:(0,n.jsx)(eu,{formValuesManager:t})})},{key:"1",label:(0,n.jsx)(I.YG.Label,{label:i("questions"),hasError:!1}),forceRender:!0,children:(0,n.jsx)(eq,{children:(0,n.jsx)(ef,{formValuesManager:t})})},{key:"2",label:(0,n.jsx)(I.YG.Label,{label:i("style"),hasError:!1}),forceRender:!1,children:(0,n.jsx)(eq,{children:(0,n.jsx)(eI,{formValuesManager:t})})}],[t,i]);return(0,n.jsxs)(eO,{children:[(0,n.jsx)(eG,{centered:!0,activeKey:o,items:a,onTabClick:s}),(0,n.jsx)(ez,{children:(0,n.jsx)(eg,{formValuesManager:t})})]})};let eO=o.zo.div.withConfig({componentId:"sc-dcccf5c4-0"})(["width:100%;flex:1;display:flex;overflow:hidden;"]),eG=(0,o.zo)(I.YG).withConfig({componentId:"sc-dcccf5c4-1"})(["flex-shrink:0;display:flex;flex-direction:column;gap:23px;width:400px;background-color:",";z-index:1;"],e=>{let{theme:t}=e;return t.colorBgElevated}),eq=o.zo.div.withConfig({componentId:"sc-dcccf5c4-2"})(["height:100%;overflow:overlay;"]),ez=o.zo.div.withConfig({componentId:"sc-dcccf5c4-3"})(["flex:1;overflow:overlay;"]);function eA(e){let{inboundRouterFacade:t,teamSlug:i,step:o,user$:f,primaryCalendar$:I,calendarsByAccount$:F,notCalendarTokens$:M,editingGroupId:N,createMultiUseBookingPage:k,onStepChange:E,appIntegrationConnectButtonRenderer:S,getMeAsTeamMember$:P,getTeamMembers$:Z,onRouterDeleteComplete:R,onConfirmGoBack:_,onConfirmSubmissionNavigation:O,onCopySuccess:G}=e,[q,z]=(0,r.useState)(!1),[A,$]=(0,r.useState)(!1),[B,U]=p.Z.useModal(),[W,V]=g.ZP.useMessage({top:125}),[H,Y]=h.ZP.useNotification({top:200}),{t:Q}=(0,x.$G)(T.l.editPageLayout),{sendEvent:X}=(0,b.X)(),{sendSavedEvent:J}=function(e){let{sendEvents:t}=(0,b.X)(),[i,n]=(0,r.useState)(e.history.length-1),o=(e,t)=>e.filter(e=>!t.find(t=>JSON.stringify(t)===JSON.stringify(e))).map(e=>({eventName:b.M.WorkflowEditPage.WORKFLOW_FORM_QUESTION_ADDED,properties:{questionType:e.type,questionValue:e.label,questionOptions:(0,y.Js)(e)?e.options.map(e=>e.label):null,questionRequired:e.required}})),s=()=>{let t=[],r=e.history[i],s=e.history[e.history.length-1];if(r.customForm&&s.customForm){let e=o(s.customForm.fields,r.customForm.fields);e&&t.push(...e)}return n(e.history.length-1),t};return{sendSavedEvent:()=>{t(s())}}}(t),{useCases:{inboundRouterUseCase:K},featureFlags:{customFormStyleEnbaled:et}}=(0,j.Ty)(),ei=(e,t)=>{E(e,t)},en=(e,t)=>{null==G||G(),X(b.M.WorkflowEditPage.WORKFLOW_EMBED_CODE_SNIPPET_COPIED,{workflowId:e,useRecatchForm:!0,dataCollectionOn:t})},eo=async()=>{try{z(!0);let{status:e,message:i}=await t.saveRouter();if("failed"===e){if("fillWebsiteUrl"===i.content||"invalidUrl"===i.content||"fillFormClass"===i.content||"checkFormInput"===i.content)return W.open({type:"error",content:Q(i.content)}),"failed";if("unusedConditions"===i.content||"unconnectedNodes"===i.content)return H.info({message:Q(i.content),description:(0,n.jsxs)(eH,{children:[(0,n.jsx)(eQ,{children:Q("checkSave")}),(0,n.jsxs)(eY,{children:[(0,n.jsx)(eX,{type:"link",size:"small",onClick:()=>H.destroy(),children:Q("cancel")}),(0,n.jsx)(eX,{type:"primary",size:"small",onClick:()=>{i.nodeIds&&t.workflowManager.removeNoNextConditions(i.nodeIds),t.removeUnconnectedNodes(),eo(),H.destroy()},children:Q("save")})]})]}),placement:"top"}),"failed";{if("assignGroup"===i.content)return H.open({type:"error",message:Q(i.content),description:Q("connectInboundLead"),placement:"top"}),"failed";if("apiError"===i.content)return W.open({type:"error",content:Q(i.content)}),"failed";if("empty-label"===i.content||"empty-options"===i.content||"empty-option-answer"===i.content)return W.open({type:"error",content:Q("pleaseCheckIfAllRequiredFieldsAreFilledCorrectlyInTheFormSettings")}),"failed";if("disqualified-message-empty"!==i.content&&"disqualified-link-empty"!==i.content&&"disqualified-link-invalid"!==i.content)return W.open({type:"error",content:Q("saveFailed")}),"failed";let e=i.content;return W.open({type:"error",content:Q({"disqualified-message-empty":"disqualifiedMessageEmpty","disqualified-link-empty":"disqualifiedLinkEmpty","disqualified-link-invalid":"disqualifiedLinkInvalid"}[e])}),E("flow"),"failed"}}return W.open({type:"success",content:Q("saved")}),J(),"success"}finally{z(!1)}},er=()=>{B.confirm({title:Q("deleteRouterTitle"),content:Q("deleteRouterDescription"),okText:Q("deleteRouterOkText"),okType:"danger",cancelText:Q("deleteRouterCancelText"),centered:!0,onOk:async()=>{let e=t.routerId;await K.deleteRouter(e),await X(b.M.RouterPage.ROUTER_PAGE_DELETED,{routerId:e}),R()}})},el=e=>{t.hasChanges()?B.confirm({title:Q("thereAreUnsavedChanges"),content:"",centered:!0,closable:!0,maskClosable:!0,footer:[(0,n.jsxs)(eV,{children:[(0,n.jsx)(m.ZP,{onClick:e,children:Q("exit")}),(0,n.jsx)(c.W,{observable:ep,loader:()=>null,selectors:["hasError"],builder:t=>{let{hasError:i}=t;return(0,n.jsx)(m.ZP,{type:"primary",loading:q,disabled:"loading"===i||i,onClick:async()=>{let t=await eo();"success"===t&&e(),"failed"===t&&p.Z.destroyAll()},children:Q("saveAndExit")})}})]},"footer")]}):e()},ed=()=>{el(()=>_())},ec=()=>{el(()=>O())},eu=()=>{$(!A)},ep=(0,r.useMemo)(()=>(0,s.a)([t.title$,(0,a.T)((0,l.of)("loading"),t.hasError$),t.hasInValidDateRange$]).pipe((0,d.U)(e=>{let[t,i,n]=e;return{title:t,hasError:i,hasInvalidDate:n}})),[t.title$,t.hasError$,t.hasInValidDateRange$]);return(0,n.jsxs)(e$,{children:[U,V,Y,(0,n.jsxs)(eL,{children:[(0,n.jsxs)(eB,{children:[(0,n.jsx)(c.W,{observable:ep,loader:()=>null,selectors:["title","hasError","hasInvalidDate"],builder:e=>{let{title:i,hasError:o,hasInvalidDate:r}=e;return(0,n.jsx)(v.Z,{routerTitle:i,isSaveLoading:q,isSaveDisabled:"loading"===o||o,setRouterTitle:t.updateTitle,onRouterSave:eo,onRouterDelete:er,onGoBackButtonClick:ed,onEmbedButtonClick:eu,onSubmissionsButtonClick:ec,saveButtonTooltipText:r?Q("meetingDateRangeIsExpired"):""})}}),(0,n.jsx)(eJ,{shouldAbsolutePosition:et?"result"!==o:"flow"===o,children:(0,n.jsx)(C.Z,{step:o,stepsLabel:{form:Q("buildForm"),flow:Q("routeLeads"),result:Q("setMeetings")},workflowManager:t.workflowManager,onStepChange:ei})})]}),"form"===o&&(et?(0,n.jsx)(e_,{formValuesManager:t.customFormManager}):(0,n.jsx)(eU,{children:(0,n.jsx)(D,{formValuesManager:t.customFormManager})})),(0,n.jsx)(eW,{$isVisible:"flow"===o||"result"===o,children:(0,n.jsx)(w.Z,{routerId:t.inboundRouter.id,workflowManager:t.workflowManager,user$:f,primaryCalendar$:I,calendarsByAccount$:F,notCalendarTokens$:M,step:"flow"===o?"flow":"result"===o?"result":"others",editingGroupId:N,nodeRenderers:{nodeBoxNode:e=>{var i,o;let{formField:r,getLabelOfOption:s}=e;return(0,n.jsx)(L.Q3,{formField:{...r,name:null!==(o=null===(i=t.getFormMakerFieldByFormFieldName(r.name))||void 0===i?void 0:i.label)&&void 0!==o?o:r.name},getLabelOfOption:s})},conditionsNode:e=>{var i;let{nodeProps:o,getLabelOfOption:r,onSave:s,onRemove:a}=e;if(!ea.My.isConditionsNodeData(o.data))return null;let l=t.getFormMakerFieldByFormFieldName(o.data.label);return(0,n.jsx)(L.qR,{...o,data:{...o.data,label:null!==(i=null==l?void 0:l.label)&&void 0!==i?i:o.data.label},getLabelOfOption:r,onSave:s,onRemove:a})},entryNode:e=>{let{nodeProps:i,onTestClick:o}=e;return(0,n.jsx)(ee,{...i,customFormManager:t.customFormManager,customForm:t.getCustomForm(),onTestClick:o,onCustomFormSettingButtonClick:()=>ei("form")})}},getLabelOfOption:(e,i)=>{let n=t.getFormMakerFieldByFormFieldName(e);if(n&&(0,y.Js)(n)){var o,r;return null!==(r=null===(o=n.options.find(e=>{let{value:t}=e;return i===t}))||void 0===o?void 0:o.label)&&void 0!==r?r:i}return i},routingTestFormRenderer:e=>{let{onTestClick:i}=e;return(0,n.jsx)(es,{customFormManager:t.customFormManager,onTestClick:i})},createMultiUseBookingPage:k,onStepChange:ei,getTeamMembers$:Z,getMeAsTeamMember$:P,appIntegrationConnectButtonRenderer:S})}),A&&(0,n.jsx)(u.XW,{teamSlug:i,bookingPageOrRouterId:t.inboundRouter.id,isModalOpen:!!A,onOpenStateChange:eu,onLinkCopySuccess:e=>{null==G||G(),X(b.M.WorkflowEditPage.WORKFLOW_EMBED_SHARE_LINK_COPIED,{workflowId:e})},onSnippetCopySuccess:(e,t,i)=>en(e,i)},t.inboundRouter.id)]})]})}let e$=o.ZP.div.withConfig({componentId:"sc-deab415a-0"})(["display:flex;flex-direction:column;height:100vh;background-color:",";.recatch__embed-snippet-settings-view{padding:24px;border-radius:12px;}"],e=>{let{theme:t}=e;return t.colorBgLayout}),eL=o.ZP.div.withConfig({componentId:"sc-deab415a-1"})(["flex:1;display:flex;flex-direction:column;overflow:auto;"]),eB=o.ZP.div.withConfig({componentId:"sc-deab415a-2"})(["position:sticky;top:0;z-index:1;"]),eU=o.ZP.div.withConfig({componentId:"sc-deab415a-3"})(["flex:1;margin:0 auto;"]),eW=o.ZP.div.withConfig({componentId:"sc-deab415a-4"})(["flex:",";visibility:",";overflow:hidden;"],e=>{let{$isVisible:t}=e;return t?1:0},e=>{let{$isVisible:t}=e;return t?"visible":"hidden"}),eV=o.ZP.div.withConfig({componentId:"sc-deab415a-5"})(["margin-top:12px;display:flex;justify-content:flex-end;gap:8px;"]),eH=o.ZP.div.withConfig({componentId:"sc-deab415a-6"})(["display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex:1 0 0;"]),eY=o.ZP.div.withConfig({componentId:"sc-deab415a-7"})(["display:flex;padding-top:12px;align-items:center;gap:8px;"]),eQ=(0,o.ZP)(f.Z).withConfig({componentId:"sc-deab415a-8"})(["align-self:stretch;"]),eX=(0,o.ZP)(m.ZP).withConfig({componentId:"sc-deab415a-9"})(["margin-top:12px;"]),eJ=o.ZP.div.withConfig({componentId:"sc-deab415a-10"})([""," padding:12px;width:100%;box-sizing:border-box;"],e=>{let{shouldAbsolutePosition:t}=e;return t&&(0,o.iv)(["position:absolute;"])})},41051:function(e,t,i){var n=i(80432),o=i(12355),r=i(79295),s=i(95100),a=i(52479),l=i(79497),d=i(55670),c=i(7489),u=i(34904),p=i(81333),g=i(63110);t.Z=function(e){let{routerTitle:t,isSaveLoading:i,isSaveDisabled:d,saveButtonTooltipText:m="",setRouterTitle:f,onRouterSave:x,onRouterDelete:b,onGoBackButtonClick:y,onEmbedButtonClick:v,onSubmissionsButtonClick:C}=e,{t:w}=(0,u.$G)(g.l.editPageLayout);return(0,n.jsx)(c.Q,{title:(0,n.jsx)(h,{ellipsis:!0,editable:{icon:(0,n.jsx)(o.ZP,{type:"text",size:"small",icon:(0,n.jsx)(a.Z,{})}),tooltip:!1,onChange:f},children:t}),menus:[(0,n.jsx)(o.ZP,{icon:(0,n.jsx)(l.Z,{}),onClick:()=>{b()}}),(0,n.jsx)(r.Z,{type:"vertical",style:{margin:"auto 5px",height:24}}),(0,n.jsx)(o.ZP,{onClick:()=>{C()},icon:(0,n.jsx)(p.Z,{}),children:w("submissions")}),(0,n.jsx)(s.Z,{placement:"bottom",title:m,children:(0,n.jsx)(o.ZP,{disabled:d,loading:i,onClick:()=>{x()},children:w("save")})}),(0,n.jsx)(o.ZP,{className:"recatch__edit-page-header__share-button",type:"primary",onClick:()=>{v()},children:w("share")})],onGoBackButtonClick:()=>{y()}})};let h=(0,d.ZP)(c.g).withConfig({componentId:"sc-f91d265e-0"})(["margin:0 !important;width:100%;font-size:","px;"],e=>{let{theme:t}=e;return t.fontSizeLG})},66362:function(e,t,i){i.d(t,{Z:function(){return V}});var n=i(80432),o=i(55670),r=i(3056),s=i(14026),a=i(89473),l=i(18095),d=i(64369),c=i(66677),u=i(47069),p=i(37543),g=i(61999),h=i(77743),m=i(12355),f=i(34338),x=i(34904),b=i(1209),y=i(41051),v=i(50576),C=i(94257),w=i(93360),j=i(1439),T=i(63110),I=i(71196),F=i(58287),M=i(79295),N=i(56207),k=i(90284),E=i(48609),S=i(85439),P=i(48538),Z=i(14799),D=i(16506),R=i(41782);let _=o.ZP.div.withConfig({componentId:"sc-aa45e4c6-0"})(["display:flex;flex-direction:column;gap:20px;align-items:center;padding-bottom:200px;"]),O=(0,o.ZP)(S.Zb).withConfig({componentId:"sc-aa45e4c6-1"})(["display:flex;flex-direction:column;gap:20px;width:500px;padding:20px;box-sizing:border-box;.recatch-ant-form-item-label{padding-bottom:6px;}"]),G=(0,o.ZP)(O).withConfig({componentId:"sc-aa45e4c6-2"})(["gap:24px;.recatch-ant-form-item-label{padding-bottom:4px;}"]),q=(0,o.ZP)(f.Z.Text).withConfig({componentId:"sc-aa45e4c6-3"})(["font-size:","px;"],e=>{let{theme:t}=e;return t.fontSizeLG}),z=(0,o.ZP)(M.Z).withConfig({componentId:"sc-aa45e4c6-4"})(["margin:0;"]),A=o.ZP.div.withConfig({componentId:"sc-aa45e4c6-5"})(["display:flex;flex-direction:column;gap:6px;"]),$=o.ZP.div.withConfig({componentId:"sc-aa45e4c6-6"})(["display:flex;flex-direction:column;align-items:center;"]),L=o.ZP.div.withConfig({componentId:"sc-aa45e4c6-7"})(["display:flex;flex-direction:column;align-items:flex-end;gap:6px;"]),B=o.ZP.img.withConfig({componentId:"sc-aa45e4c6-8"})(["width:650px;"]),U=(0,o.ZP)(k.Z).withConfig({componentId:"sc-aa45e4c6-9"})(["color:",";font-size:14px;"],e=>{let{theme:t}=e;return t.colorTextSecondary});var W=function(e){let{formValuesManager:t}=e,{t:i,i18n:o}=(0,x.$G)(T.l.form),{token:s,isDarkMode:a}=(0,S.Fg)(),l=(0,r.useMemo)(()=>t.values$,[t.values$]),d=(0,r.useCallback)(()=>{t.values.email||t.setEmailField({id:(0,P.Z)(),name:"email",type:"text"})},[t]),u=(0,r.useCallback)(()=>{t.values.phone||t.setPhoneField({id:(0,P.Z)(),name:"phone",type:"text"})},[t]),p=(0,r.useCallback)(()=>{t.values.company||t.setCompanyField({id:(0,P.Z)(),name:"company",type:"text"})},[t]),g=(0,r.useCallback)(async()=>{t.addField()},[t]),h=(0,r.useCallback)(()=>{let e=[];return t.values.email||e.push({key:"email",label:"email",onClick:d}),t.values.phone||e.push({key:"phone",label:"phone",onClick:u}),t.values.company||e.push({key:"company",label:"company",onClick:p}),e.push({key:"new",label:i("addManually"),onClick:g}),e},[t.values.email,t.values.phone,t.values.company,i,g,d,u,p]),f=(0,r.useCallback)(e=>{t.setUrl(e.target.value)},[t]),b=(0,r.useCallback)(e=>{t.setFormSelector(e.target.value)},[t]),y=(0,r.useCallback)(e=>{t.switchNameField(e.target.checked)},[t]),v=(0,r.useCallback)(e=>{t.setFirstName({...e,type:"text"})},[t]),C=(0,r.useCallback)(e=>{t.setLastName({...e,type:"text"})},[t]),w=(0,r.useCallback)(e=>{t.setName({...e,type:"text"})},[t]),j=(0,r.useCallback)(e=>{t.setEmailField({...e,type:"text"})},[t]),M=(0,r.useCallback)(()=>{t.setEmailField()},[t]),k=(0,r.useCallback)(e=>{t.setPhoneField({...e,type:"text"})},[t]),W=(0,r.useCallback)(()=>{t.setPhoneField()},[t]),V=(0,r.useCallback)(e=>{t.setCompanyField({...e,type:"text"})},[t]),H=(0,r.useCallback)(()=>{t.setCompanyField()},[t]),Y=(0,r.useCallback)((e,i,n)=>{let o=n.slice();o[i]=e,t.setFields(o)},[t]),Q=(0,r.useCallback)((e,i)=>{let n=[...e.slice(0,i),...e.slice(i+1,e.length)];t.setFields(n)},[t]),X=(0,r.useCallback)(e=>{switch(e){case"empty":return i("pleaseProvideAFieldName");case"duplicated":return i("thisNameAlreadyExists");default:return}},[i]);return(0,n.jsx)(S.f6,{defaultMode:a?"dark":"light",children:(0,n.jsx)(c.W,{observable:l,loader:()=>(0,n.jsx)(S.TK,{}),builder:e=>(0,n.jsxs)(_,{children:[(0,n.jsx)(B,{src:"ko"===o.language?S.XW:S._4}),(0,n.jsxs)(G,{children:[(0,n.jsx)(q,{strong:!0,children:i("mapFormDetails")}),(0,n.jsx)(S.T8,{required:!0,label:i("websiteUrl"),labelStrong:!0,labelColor:s.colorText,children:(0,n.jsx)(I.default,{value:e.url,onChange:f})}),(0,n.jsx)(S.T8,{required:!0,label:i("formClass"),labelStrong:!0,labelColor:s.colorText,children:(0,n.jsx)(I.default,{value:e.formSelector,onChange:b})})]}),(0,n.jsx)(O,{children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(q,{strong:!0,children:i("mapFormInputs")}),(0,n.jsxs)(A,{children:[(0,R.S)(e.name)?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(S.T8,{required:!0,label:"Name",error:X(t.getFirstNameError()),labelStrong:!0,labelColor:s.colorText,children:(0,n.jsx)(D.Z,{value:e.name.firstName,typeDisabled:!0,error:!!t.getFirstNameError(),onChange:v})}),(0,n.jsx)(S.T8,{required:!0,error:X(t.getLastNameError()),labelStrong:!0,labelColor:s.colorText,children:(0,n.jsx)(D.Z,{value:e.name.lastName,typeDisabled:!0,error:!!t.getLastNameError(),onChange:C})})]}):(0,n.jsx)(S.T8,{required:!0,label:"Name",error:X(t.getNameError()),labelStrong:!0,labelColor:s.colorText,children:(0,n.jsx)(D.Z,{value:e.name,typeDisabled:!0,error:!!t.getNameError(),onChange:w})}),(0,n.jsx)(E.Z,{checked:(0,R.S)(e.name),onChange:y,children:i("mapFirstNameAndLastNameFieldsSeparately")})]}),e.email&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(z,{}),(0,n.jsxs)(L,{children:[(0,n.jsx)(S.T8,{label:"Email",error:X(t.getEmailFieldError()),labelStrong:!0,labelColor:s.colorText,children:(0,n.jsx)(D.Z,{value:e.email,typeDisabled:!0,error:!!t.getEmailFieldError(),onChange:j})}),(0,n.jsx)(m.ZP,{type:"text",onClick:M,children:i("delete")})]})]}),e.phone&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(z,{}),(0,n.jsxs)(L,{children:[(0,n.jsx)(S.T8,{label:"Phone",error:X(t.getPhoneFieldError()),labelStrong:!0,labelColor:s.colorText,children:(0,n.jsx)(D.Z,{value:e.phone,typeDisabled:!0,error:!!t.getPhoneFieldError(),onChange:k})}),(0,n.jsx)(m.ZP,{type:"text",onClick:W,children:i("delete")})]})]}),e.company&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(z,{}),(0,n.jsxs)(L,{children:[(0,n.jsx)(S.T8,{label:"Company",error:X(t.getCompanyFieldError()),labelStrong:!0,labelColor:s.colorText,labelSuffix:(0,n.jsx)(Z.l,{children:(0,n.jsx)(U,{})}),children:(0,n.jsx)(D.Z,{value:e.company,typeDisabled:!0,error:!!t.getCompanyFieldError(),onChange:V})}),(0,n.jsx)(m.ZP,{type:"text",onClick:H,children:i("delete")})]})]}),e.fields.map((o,s)=>(0,n.jsxs)(r.Fragment,{children:[(0,n.jsx)(z,{}),(0,n.jsxs)(L,{children:[(0,n.jsx)(S.T8,{error:X(t.getFieldsError()[s]),children:(0,n.jsx)(D.Z,{value:o,error:!!t.getFieldsError()[s],onChange:t=>Y(t,s,e.fields)})}),(0,n.jsx)(m.ZP,{type:"text",onClick:()=>Q(e.fields,s),children:i("delete")})]})]},o.id)),e.email&&e.phone&&e.company?(0,n.jsx)($,{children:(0,n.jsxs)(m.ZP,{type:"text",onClick:g,children:[(0,n.jsx)(N.Z,{}),(0,n.jsx)("span",{children:i("addNewInputField")})]})}):(0,n.jsx)($,{children:(0,n.jsx)(F.Z,{menu:{items:h()},trigger:["click"],children:(0,n.jsxs)(m.ZP,{type:"text",children:[(0,n.jsx)(N.Z,{}),(0,n.jsx)("span",{children:i("addNewInputField")})]})})})]})})]})})})};function V(e){var t;let{inboundRouterFacade:i,teamSlug:o,step:f,user$:I,primaryCalendar$:F,calendarsByAccount$:M,notCalendarTokens$:N,editingGroupId:k,createMultiUseBookingPage:E,onStepChange:S,appIntegrationConnectButtonRenderer:P,getMeAsTeamMember$:Z,getTeamMembers$:D,onRouterDeleteComplete:R,onConfirmGoBack:_,onConfirmSubmissionNavigation:O,onCopySuccess:G}=e,[q,z]=(0,r.useState)(!1),[A,$]=(0,r.useState)(!1),[L,B]=p.Z.useModal(),[U,V]=g.ZP.useMessage({top:190}),[er,es]=h.ZP.useNotification({top:200}),{t:ea}=(0,x.$G)(T.l.editPageLayout),{sendEvent:el}=(0,b.X)(),{useCases:{inboundRouterUseCase:ed},featureFlags:{makeEmailFieldOptional:ec}}=(0,j.Ty)(),eu=(0,r.useMemo)(()=>(0,s.a)([i.title$,(0,a.T)((0,l.of)("loading"),i.hasError$),i.hasInValidDateRange$]).pipe((0,d.U)(e=>{let[t,i,n]=e;return{title:t,hasError:i,hasInvalidDate:n}})),[i.title$,i.hasError$,i.hasInValidDateRange$]),ep=(e,t)=>{S(e,t)},eg=(e,t)=>{null==G||G(),el(b.M.WorkflowEditPage.WORKFLOW_EMBED_CODE_SNIPPET_COPIED,{workflowId:e,useRecatchForm:!1,dataCollectionOn:t})},eh=async()=>{try{z(!0);let{status:e,message:t}=await i.saveRouter();if("failed"===e){if("fillWebsiteUrl"===t.content||"invalidUrl"===t.content||"fillFormClass"===t.content||"checkFormInput"===t.content)return U.open({type:"error",content:ea(t.content)}),"failed";if("unusedConditions"===t.content||"unconnectedNodes"===t.content)return er.info({message:ea(t.content),description:(0,n.jsxs)(ee,{children:[(0,n.jsx)(ei,{children:ea("checkSave")}),(0,n.jsxs)(et,{children:[(0,n.jsx)(en,{type:"link",size:"small",onClick:()=>er.destroy(),children:ea("cancel")}),(0,n.jsx)(en,{type:"primary",size:"small",onClick:()=>{t.nodeIds&&i.workflowManager.removeNoNextConditions(t.nodeIds),i.removeUnconnectedNodes(),eh(),er.destroy()},children:ea("save")})]})]}),placement:"top"}),"failed";{if("assignGroup"===t.content)return er.open({type:"error",message:ea(t.content),description:ea("connectInboundLead"),placement:"top"}),"failed";if("apiError"===t.content)return U.open({type:"error",content:ea("apiError")}),"failed";if("disqualified-message-empty"!==t.content&&"disqualified-link-empty"!==t.content&&"disqualified-link-invalid"!==t.content)return U.open({type:"error",content:ea("saveFailed")}),"failed";let e=t.content;return U.open({type:"error",content:ea({"disqualified-message-empty":"disqualifiedMessageEmpty","disqualified-link-empty":"disqualifiedLinkEmpty","disqualified-link-invalid":"disqualifiedLinkInvalid"}[e])}),S("flow"),"failed"}}return U.open({type:"success",content:ea("saved")}),"success"}finally{z(!1)}},em=()=>{L.confirm({title:ea("deleteRouterTitle"),content:ea("deleteRouterDescription"),okText:ea("deleteRouterOkText"),okType:"danger",cancelText:ea("deleteRouterCancelText"),centered:!0,onOk:async()=>{let e=i.routerId;await ed.deleteRouter(e),await el(b.M.RouterPage.ROUTER_PAGE_DELETED,{routerId:e}),R()}})},ef=e=>{i.hasChanges()?L.confirm({title:ea("thereAreUnsavedChanges"),content:"",centered:!0,closable:!0,maskClosable:!0,footer:[(0,n.jsxs)(K,{children:[(0,n.jsx)(m.ZP,{onClick:e,children:ea("exit")}),(0,n.jsx)(c.W,{observable:eu,loader:()=>null,selectors:["hasError"],builder:t=>{let{hasError:i}=t;return(0,n.jsx)(m.ZP,{type:"primary",loading:q,disabled:"loading"===i||i,onClick:async()=>{let t=await eh();"success"===t&&e(),"failed"===t&&p.Z.destroyAll()},children:ea("saveAndExit")})}})]},"footer")]}):e()},ex=()=>{ef(()=>_())},eb=()=>{ef(()=>O())},ey=()=>{$(!A)};return(0,n.jsxs)(H,{children:[B,V,es,(0,n.jsxs)(Y,{children:[(0,n.jsxs)(Q,{children:[(0,n.jsx)(c.W,{observable:eu,loader:()=>null,selectors:["title","hasError","hasInvalidDate"],builder:e=>{let{title:t,hasError:o,hasInvalidDate:r}=e;return(0,n.jsx)(y.Z,{routerTitle:t,isSaveLoading:q,isSaveDisabled:"loading"===o||o,setRouterTitle:i.updateTitle,onRouterSave:eh,onRouterDelete:em,onGoBackButtonClick:ex,onEmbedButtonClick:ey,onSubmissionsButtonClick:eb,saveButtonTooltipText:r?ea("meetingDateRangeIsExpired"):""})}}),(0,n.jsx)(eo,{shouldAbsolutePosition:"flow"===f,children:(0,n.jsx)(v.Z,{step:f,workflowManager:i.workflowManager,onStepChange:ep})})]}),"form"===f&&(0,n.jsx)(X,{children:ec?(0,n.jsx)(W,{formValuesManager:i.formValuesManager}):(0,n.jsx)(C.Z,{formValuesManager:i.formValuesManager})}),(0,n.jsx)(J,{$isVisible:"flow"===f||"result"===f,children:(0,n.jsx)(w.Z,{routerId:i.inboundRouter.id,workflowManager:i.workflowManager,user$:I,primaryCalendar$:F,calendarsByAccount$:M,notCalendarTokens$:N,step:"flow"===f?"flow":"result"===f?"result":"others",editingGroupId:k,createMultiUseBookingPage:E,onStepChange:ep,getTeamMembers$:D,getMeAsTeamMember$:Z,appIntegrationConnectButtonRenderer:P})}),A&&(0,n.jsx)(u.vQ,{teamSlug:o,bookingPageOrRouterId:i.inboundRouter.id,fixedFormClassName:null===(t=i.inboundRouter.formValues)||void 0===t?void 0:t.formSelector,isModalOpen:!!A,onOpenStateChange:ey,onCopySuccess:(e,t,i,n)=>eg(e,n)},i.inboundRouter.id)]})]})}let H=o.ZP.div.withConfig({componentId:"sc-27b17e09-0"})(["display:flex;flex-direction:column;height:100vh;.recatch__embed-snippet-settings-view{padding:24px;border-radius:12px;}"]),Y=o.ZP.div.withConfig({componentId:"sc-27b17e09-1"})(["flex:1;display:flex;flex-direction:column;overflow:auto;background-color:",";"],e=>{let{theme:t}=e;return t.colorBgLayout}),Q=o.ZP.div.withConfig({componentId:"sc-27b17e09-2"})(["position:sticky;top:0;z-index:1;"]),X=o.ZP.div.withConfig({componentId:"sc-27b17e09-3"})(["margin:auto;width:500px;height:100vh;padding-bottom:200px;"]),J=o.ZP.div.withConfig({componentId:"sc-27b17e09-4"})(["flex:1;visibility:",";overflow:hidden;"],e=>{let{$isVisible:t}=e;return t?"visible":"hidden"}),K=o.ZP.div.withConfig({componentId:"sc-27b17e09-5"})(["margin-top:12px;display:flex;justify-content:flex-end;gap:8px;"]),ee=o.ZP.div.withConfig({componentId:"sc-27b17e09-6"})(["display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex:1 0 0;"]),et=o.ZP.div.withConfig({componentId:"sc-27b17e09-7"})(["display:flex;padding-top:12px;align-items:center;gap:8px;"]),ei=(0,o.ZP)(f.Z).withConfig({componentId:"sc-27b17e09-8"})(["align-self:stretch;"]),en=(0,o.ZP)(m.ZP).withConfig({componentId:"sc-27b17e09-9"})(["margin-top:12px;"]),eo=o.ZP.div.withConfig({componentId:"sc-27b17e09-10"})([""," padding:16px;width:100%;box-sizing:border-box;"],e=>{let{shouldAbsolutePosition:t}=e;return t&&(0,o.iv)(["position:absolute;"])})},50576:function(e,t,i){var n=i(80432),o=i(12355),r=i(10578),s=i(3056),a=i(34904),l=i(55670),d=i(36580),c=i(1795),u=i(64369),p=i(48032),g=i(63110);t.Z=function(e){let{step:t,workflowManager:i,stepsLabel:r,onStepChange:l}=e,{t:y}=(0,a.$G)(g.l.editPageLayout),v=(0,s.useCallback)(()=>{if("result"===t)return;let e=i.getGroups()[0];e&&"creating"!==e&&(l("result",e.id),i.enterEditingGroupMode())},[l,t,i]),C=(0,s.useMemo)(()=>i.getGroups$().pipe((0,u.U)(e=>e.length>0)),[i]),w=(0,p.P)(C,null),j=(0,s.useMemo)(()=>{var e,o,s;return[{key:"form",title:null!==(e=null==r?void 0:r.form)&&void 0!==e?e:y("connectForm"),onClick:()=>{"form"!==t&&(l("form"),i.leaveEditingGroupMode())}},{key:"flow",title:null!==(o=null==r?void 0:r.flow)&&void 0!==o?o:y("routeLeads"),onClick:()=>{"flow"!==t&&(l("flow"),i.leaveEditingGroupMode())}},{key:"result",title:null!==(s=null==r?void 0:r.result)&&void 0!==s?s:y("setMeetings"),onClick:v}].map(e=>({...e,title:(0,n.jsx)(x,{$active:t===e.key,type:"text",size:"small",disabled:!w&&"result"===e.key,children:e.title})}))},[v,w,l,t,null==r?void 0:r.flow,null==r?void 0:r.form,null==r?void 0:r.result,y,i]),T=j.length-1,I=j.findIndex(e=>e.key===t),F=j[0].key,M=j[T].key;return null===w?null:(0,n.jsx)(h,{children:(0,n.jsxs)(m,{children:[(0,n.jsx)(o.ZP,{shape:"circle",icon:(0,n.jsx)(d.Z,{}),disabled:t===F,onClick:()=>{if(I>0){let e=j[I-1].key;"result"===e?v():(l(e),i.leaveEditingGroupMode())}}}),(0,n.jsx)(b,{separator:(0,n.jsx)(f,{children:">"}),items:j}),(0,n.jsx)(o.ZP,{shape:"circle",icon:(0,n.jsx)(c.Z,{}),type:"primary",disabled:t===M||"flow"===t&&!w,onClick:()=>{if(I<T){let e=j[I+1].key;"result"===e?v():(l(e),i.leaveEditingGroupMode())}}})]})})};let h=l.ZP.div.withConfig({componentId:"sc-a6f1fca9-0"})(["display:flex;justify-content:center;width:100%;"]),m=l.ZP.div.withConfig({componentId:"sc-a6f1fca9-1"})(["display:flex;justify-content:space-between;align-items:center;background-color:",";backdrop-filter:blur(5px);border-radius:1090px;padding:8px;"],e=>{let{theme:t}=e;return t.colorBgElevated}),f=l.ZP.div.withConfig({componentId:"sc-a6f1fca9-2"})(["margin:0 4px;"]),x=(0,l.ZP)(o.ZP).withConfig({componentId:"sc-a6f1fca9-3"})(["padding:0 4px !important;margin:0 -4px;border:0;color:"," !important;"],e=>{let{$active:t,theme:i}=e;return t?i.colorTextBase:i.colorTextTertiary}),b=(0,l.ZP)(r.Z).withConfig({componentId:"sc-a6f1fca9-4"})(["padding:0 32px;"])},94257:function(e,t,i){var n=i(80432),o=i(71196),r=i(12355),s=i(58287),a=i(34338),l=i(79295),d=i(3056),c=i(34904),u=i(56207),p=i(90284),g=i(48609),h=i(85439),m=i(55670),f=i(66677),x=i(48538),b=i(14799),y=i(16506),v=i(63110),C=i(41782);let w=m.ZP.div.withConfig({componentId:"sc-518fc37d-0"})(["display:flex;flex-direction:column;gap:20px;align-items:center;padding-bottom:200px;"]),j=(0,m.ZP)(h.Zb).withConfig({componentId:"sc-518fc37d-1"})(["display:flex;flex-direction:column;gap:20px;width:500px;padding:20px;box-sizing:border-box;.recatch-ant-form-item-label{padding-bottom:6px;}"]),T=(0,m.ZP)(j).withConfig({componentId:"sc-518fc37d-2"})(["gap:24px;.recatch-ant-form-item-label{padding-bottom:4px;}"]),I=(0,m.ZP)(a.Z.Text).withConfig({componentId:"sc-518fc37d-3"})(["font-size:","px;"],e=>{let{theme:t}=e;return t.fontSizeLG}),F=(0,m.ZP)(l.Z).withConfig({componentId:"sc-518fc37d-4"})(["margin:0;"]),M=m.ZP.div.withConfig({componentId:"sc-518fc37d-5"})(["display:flex;flex-direction:column;gap:6px;"]),N=m.ZP.div.withConfig({componentId:"sc-518fc37d-6"})(["display:flex;flex-direction:column;align-items:center;"]),k=m.ZP.div.withConfig({componentId:"sc-518fc37d-7"})(["display:flex;flex-direction:column;align-items:flex-end;gap:6px;"]),E=m.ZP.img.withConfig({componentId:"sc-518fc37d-8"})(["width:650px;"]),S=(0,m.ZP)(p.Z).withConfig({componentId:"sc-518fc37d-9"})(["color:",";font-size:14px;"],e=>{let{theme:t}=e;return t.colorTextSecondary});t.Z=function(e){let{formValuesManager:t}=e,{t:i,i18n:a}=(0,c.$G)(v.l.form),{token:l,isDarkMode:p}=(0,h.Fg)(),m=(0,d.useMemo)(()=>t.values$,[t.values$]),P=(0,d.useCallback)(()=>{t.values.phone||t.setPhoneField({id:(0,x.Z)(),name:"phone",type:"text"})},[t]),Z=(0,d.useCallback)(()=>{t.values.company||t.setCompanyField({id:(0,x.Z)(),name:"company",type:"text"})},[t]),D=(0,d.useCallback)(async()=>{t.addField()},[t]),R=(0,d.useCallback)(()=>{let e=[];return t.values.phone||e.push({key:"phone",label:"phone",onClick:P}),t.values.company||e.push({key:"company",label:"company",onClick:Z}),e.push({key:"new",label:i("addManually"),onClick:D}),e},[D,Z,P,t.values.company,t.values.phone,i]),_=(0,d.useCallback)(e=>{t.setUrl(e.target.value)},[t]),O=(0,d.useCallback)(e=>{t.setFormSelector(e.target.value)},[t]),G=(0,d.useCallback)(e=>{t.switchNameField(e.target.checked)},[t]),q=(0,d.useCallback)(e=>{t.setFirstName({...e,type:"text"})},[t]),z=(0,d.useCallback)(e=>{t.setLastName({...e,type:"text"})},[t]),A=(0,d.useCallback)(e=>{t.setName({...e,type:"text"})},[t]),$=(0,d.useCallback)(e=>{t.setEmailField({...e,type:"text"})},[t]),L=(0,d.useCallback)(e=>{t.setPhoneField({...e,type:"text"})},[t]),B=(0,d.useCallback)(()=>{t.setPhoneField()},[t]),U=(0,d.useCallback)(e=>{t.setCompanyField({...e,type:"text"})},[t]),W=(0,d.useCallback)(()=>{t.setCompanyField()},[t]),V=(0,d.useCallback)((e,i,n)=>{let o=n.slice();o[i]=e,t.setFields(o)},[t]),H=(0,d.useCallback)((e,i)=>{let n=[...e.slice(0,i),...e.slice(i+1,e.length)];t.setFields(n)},[t]),Y=(0,d.useCallback)(e=>{switch(e){case"empty":return i("pleaseProvideAFieldName");case"duplicated":return i("thisNameAlreadyExists");default:return}},[i]);return(0,n.jsx)(h.f6,{defaultMode:p?"dark":"light",children:(0,n.jsx)(f.W,{observable:m,loader:()=>(0,n.jsx)(h.TK,{}),builder:e=>(0,n.jsxs)(w,{children:[(0,n.jsx)(E,{src:"ko"===a.language?h.XW:h._4}),(0,n.jsxs)(T,{children:[(0,n.jsx)(I,{strong:!0,children:i("mapFormDetails")}),(0,n.jsx)(h.T8,{required:!0,label:i("websiteUrl"),labelStrong:!0,labelColor:l.colorText,children:(0,n.jsx)(o.default,{value:e.url,onChange:_})}),(0,n.jsx)(h.T8,{required:!0,label:i("formClass"),labelStrong:!0,labelColor:l.colorText,children:(0,n.jsx)(o.default,{value:e.formSelector,onChange:O})})]}),(0,n.jsx)(j,{children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(I,{strong:!0,children:i("mapFormInputs")}),(0,n.jsxs)(M,{children:[(0,C.S)(e.name)?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(h.T8,{required:!0,label:"Name",error:Y(t.getFirstNameError()),labelStrong:!0,labelColor:l.colorText,children:(0,n.jsx)(y.Z,{value:e.name.firstName,typeDisabled:!0,error:!!t.getFirstNameError(),onChange:q})}),(0,n.jsx)(h.T8,{required:!0,error:Y(t.getLastNameError()),labelStrong:!0,labelColor:l.colorText,children:(0,n.jsx)(y.Z,{value:e.name.lastName,typeDisabled:!0,error:!!t.getLastNameError(),onChange:z})})]}):(0,n.jsx)(h.T8,{required:!0,label:"Name",error:Y(t.getNameError()),labelStrong:!0,labelColor:l.colorText,children:(0,n.jsx)(y.Z,{value:e.name,typeDisabled:!0,error:!!t.getNameError(),onChange:A})}),(0,n.jsx)(g.Z,{checked:(0,C.S)(e.name),onChange:G,children:i("mapFirstNameAndLastNameFieldsSeparately")})]}),(0,n.jsx)(F,{}),(0,n.jsx)(h.T8,{required:!0,label:"Email",error:Y(t.getEmailFieldError()),labelStrong:!0,labelColor:l.colorText,children:(0,n.jsx)(y.Z,{value:e.email,typeDisabled:!0,error:!!t.getEmailFieldError(),onChange:$})}),e.phone&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(F,{}),(0,n.jsxs)(k,{children:[(0,n.jsx)(h.T8,{label:"Phone",error:Y(t.getPhoneFieldError()),labelStrong:!0,labelColor:l.colorText,children:(0,n.jsx)(y.Z,{value:e.phone,typeDisabled:!0,error:!!t.getPhoneFieldError(),onChange:L})}),(0,n.jsx)(r.ZP,{type:"text",onClick:B,children:i("delete")})]})]}),e.company&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(F,{}),(0,n.jsxs)(k,{children:[(0,n.jsx)(h.T8,{label:"Company",error:Y(t.getCompanyFieldError()),labelStrong:!0,labelColor:l.colorText,labelSuffix:(0,n.jsx)(b.l,{children:(0,n.jsx)(S,{})}),children:(0,n.jsx)(y.Z,{value:e.company,typeDisabled:!0,error:!!t.getCompanyFieldError(),onChange:U})}),(0,n.jsx)(r.ZP,{type:"text",onClick:W,children:i("delete")})]})]}),e.fields.map((o,s)=>(0,n.jsxs)(d.Fragment,{children:[(0,n.jsx)(F,{}),(0,n.jsxs)(k,{children:[(0,n.jsx)(h.T8,{error:Y(t.getFieldsError()[s]),children:(0,n.jsx)(y.Z,{value:o,error:!!t.getFieldsError()[s],onChange:t=>V(t,s,e.fields)})}),(0,n.jsx)(r.ZP,{type:"text",onClick:()=>H(e.fields,s),children:i("delete")})]})]},o.id)),e.phone&&e.company?(0,n.jsx)(N,{children:(0,n.jsxs)(r.ZP,{type:"text",onClick:D,children:[(0,n.jsx)(u.Z,{}),(0,n.jsx)("span",{children:i("addNewInputField")})]})}):(0,n.jsx)(N,{children:(0,n.jsx)(s.Z,{menu:{items:R()},trigger:["click"],children:(0,n.jsxs)(r.ZP,{type:"text",children:[(0,n.jsx)(u.Z,{}),(0,n.jsx)("span",{children:i("addNewInputField")})]})})})]})})]})})})}},16506:function(e,t,i){var n=i(80432),o=i(55670),r=i(31777),s=i(15438),a=i(71196),l=i(3056),d=i(34904),c=i(48538),u=i(63110),p=i(79912);let g=o.ZP.div.withConfig({componentId:"sc-c7cac01d-0"})(["display:flex;flex-direction:column;gap:6px;"]),h=o.ZP.div.withConfig({componentId:"sc-c7cac01d-1"})(["display:flex;gap:16px;"]),m=o.ZP.div.withConfig({componentId:"sc-c7cac01d-2"})(["flex:1;display:flex;align-items:center;gap:8px;"]),f=(0,o.ZP)(a.default).withConfig({componentId:"sc-c7cac01d-3"})(["flex:1;"]),x=(0,o.ZP)(s.default).withConfig({componentId:"sc-c7cac01d-4"})(["flex:1;"]),b=o.ZP.div.withConfig({componentId:"sc-c7cac01d-5"})(["display:flex;gap:8px;"]),y=(0,o.ZP)(r.MQ).withConfig({componentId:"sc-c7cac01d-6"})(["display:flex;align-items:center;height:32px;"]),v=o.ZP.div.withConfig({componentId:"sc-c7cac01d-7"})(["flex:1;display:flex;flex-direction:column;gap:6px;"]);t.Z=function(e){var t;let{value:i,typeDisabled:o,error:a,onChange:C}=e,{t:w}=(0,d.$G)(u.l.form),{isDarkMode:j}=(0,r.Fg)(),T=(0,l.useMemo)(()=>[{value:"text",label:"text / email / tel"},{value:"number",label:"number"},{value:"checkbox",label:"checkbox"},{value:"select",label:"select / radio"}],[]),I=(0,l.useMemo)(()=>"value",[]),F=(0,l.useMemo)(()=>"text",[]),M=(0,l.useCallback)(e=>{let t=e.target.value;i?null==C||C({...i,name:t}):null==C||C({id:(0,c.Z)(),name:t,type:F})},[F,C,i]),N=(0,l.useCallback)(e=>{i?null==C||C({...i,type:e}):null==C||C({id:(0,c.Z)(),type:e,name:I})},[I,C,i]),k=(0,l.useCallback)(e=>{i?null==C||C({...i,options:e}):null==C||C({id:(0,c.Z)(),options:e,name:I,type:"select"})},[I,C,i]);return(0,n.jsx)(r.f6,{defaultMode:j?"dark":"light",children:(0,n.jsxs)(g,{children:[(0,n.jsxs)(h,{children:[(0,n.jsxs)(m,{children:[(0,n.jsx)(r.MQ,{children:"name"}),(0,n.jsx)(f,{value:null==i?void 0:i.name,onChange:M,status:a?"error":void 0})]}),(0,n.jsxs)(m,{children:[(0,n.jsx)(r.MQ,{children:"type"}),(0,n.jsx)(x,{defaultValue:null==i?void 0:i.type,onChange:N,options:T,disabled:o})]})]}),i&&(0,p.O6)(i)&&(0,n.jsxs)(b,{children:[(0,n.jsx)(y,{children:"option"}),(0,n.jsxs)(v,{children:[(0,n.jsx)(s.default,{mode:"tags",value:i.options,onChange:k,status:(null===(t=i.options)||void 0===t?void 0:t.length)>0?void 0:"error"}),(0,n.jsx)(r.Q1,{children:w("addAllValuesForThisOptionToSetConditions")})]})]})]})})}},70870:function(e,t,i){i.d(t,{C:function(){return r},O:function(){return s}});var n=i(78232),o=i(55670);let r=(0,o.ZP)(n.HH).withConfig({componentId:"sc-e7cdc3c8-0"})([""," left:-10px !important;width:7px !important;height:7px !important;padding:5px !important;border:none !important;background-color:"," !important;&:after{content:'';display:block;width:7px;height:7px;box-sizing:border-box;border-radius:50%;background-color:",";border:none;}"],e=>{let{top:t}=e;return(0,o.iv)(["top:","px !important;"],t)},e=>{let{theme:t}=e;return t.colorFillSecondary},e=>{let{theme:t}=e;return t.colorTextTertiary}),s=(0,o.ZP)(n.HH).withConfig({componentId:"sc-e7cdc3c8-1"})(["position:absolute !important;right:-8px !important;width:7px !important;height:7px !important;padding:5px !important;border:none !important;background-color:"," !important;&:after{content:'';display:block;width:7px;height:7px;box-sizing:border-box;border-radius:50%;","}"],e=>{let{theme:t}=e;return t.colorFillSecondary},e=>{let{$next:t,$highlight:i}=e;return i?(0,o.iv)(["background-color:",";border:none;"],e=>{let{theme:t}=e;return t.colorSuccessText}):t?(0,o.iv)(["background-color:",";border:none;"],e=>{let{theme:t}=e;return t.colorTextTertiary}):(0,o.iv)(["background-color:",";border:1px solid ",";"],e=>{let{theme:t}=e;return t.colorBgContainer},e=>{let{theme:t}=e;return t.colorTextTertiary})})},60183:function(e,t,i){i.d(t,{qR:function(){return ez},ZR:function(){return e6},Q3:function(){return T}});var n=i(80432),o=i(34338),r=i(55670),s=i(34892),a=i(78232),l=i(34904),d=i(57485),c=i(79912);let u={[c.WE.NUMBER]:{[c.jT.IS]:"=",[c.jT.IS_NOT]:"≠",[c.jT.GT]:">",[c.jT.GT_AND_EQUAL]:"≥",[c.jT.LT]:"<",[c.jT.LT_AND_EQUAL]:"≤",[c.jT.BETWEEN]:"≤",[c.jT.NOT_BETWEEN]:"<"},[c.WE.TEXT]:{[c.jT.IS]:"=",[c.jT.IS_NOT]:"≠",[c.jT.CONTAINS]:"contains",[c.jT.NOT_CONTAINS]:"not contain",[c.jT.STARTS_WITH]:"starts with",[c.jT.ENDS_WITH]:"ends with",[c.jT.IS_EMPTY]:"is empty",[c.jT.IS_NOT_EMPTY]:"is not empty"},[c.WE.SELECT]:{[c.jT.IS]:"=",[c.jT.IS_NOT]:"≠",[c.jT.ANY_IN]:"in",[c.jT.NOT_IN]:"not in"},[c.WE.CHECKBOX]:{[c.jT.IS]:"",[c.jT.IS_NOT]:""}};var p=i(63110);let g=(0,r.ZP)(d.g).withConfig({componentId:"sc-4750c7e1-0"})(["color:",";"],e=>{let{theme:t,$dimmed:i,$connected:n,$highlight:o}=e;return o?t.colorSuccessText:n?i?t.colorTextSecondary:t.colorText:t.colorTextTertiary}),h=(0,r.ZP)(d.g).withConfig({componentId:"sc-4750c7e1-1"})(["word-break:break-all;color:",";"],e=>{let{theme:t,$connected:i,$highlight:n}=e;return n?t.colorSuccessText:i?t.colorText:t.colorTextTertiary}),m=(0,r.ZP)(d.g).withConfig({componentId:"sc-4750c7e1-2"})(["display:flex;gap:4px;"]);var f=function(e){let{type:t,condition:i,getLabelOfOption:o=e=>e}=e,{t:r}=(0,l.$G)(p.l.condition);if("number"===t&&(0,c.D4)(i)){if((0,c.Qu)(i)){let e=Math.min(...i.value),o=Math.max(...i.value);return(0,n.jsxs)(m,{children:[i.operator===c.jT.BETWEEN&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(h,{$connected:!!i.next,$highlight:i.passed,children:e}),(0,n.jsx)(g,{$connected:!!i.next,$highlight:i.passed,children:u[t][i.operator]}),(0,n.jsx)(g,{$dimmed:!0,$highlight:i.passed,children:"x"}),(0,n.jsx)(g,{$connected:!!i.next,$highlight:i.passed,children:u[t][i.operator]}),(0,n.jsx)(h,{$connected:!!i.next,$highlight:i.passed,children:o})]}),i.operator===c.jT.NOT_BETWEEN&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(g,{$dimmed:!0,$highlight:i.passed,children:"x"}),(0,n.jsx)(g,{$connected:!!i.next,$highlight:i.passed,children:u[t][i.operator]}),(0,n.jsx)(h,{$connected:!!i.next,$highlight:i.passed,children:e}),(0,n.jsx)(g,{$dimmed:!0,$highlight:i.passed,children:","}),(0,n.jsx)(h,{$connected:!!i.next,$highlight:i.passed,children:o}),(0,n.jsx)(g,{$connected:!!i.next,$highlight:i.passed,children:u[t][i.operator]}),(0,n.jsx)(g,{$dimmed:!0,$highlight:i.passed,children:"x"})]})]})}return(0,n.jsxs)(m,{children:[(0,n.jsx)(g,{$connected:!!i.next,$highlight:i.passed,children:u[t][i.operator]}),(0,n.jsx)(h,{$connected:!!i.next,$highlight:i.passed,children:i.value})]})}return"text"===t&&(0,c.po)(i)?(0,c.X7)(i)?(0,n.jsx)(h,{$connected:!!i.next,$highlight:i.passed,children:u[t][i.operator]}):(0,n.jsxs)(m,{children:[(0,n.jsx)(g,{$dimmed:!0,$connected:!!i.next,$highlight:i.passed,children:u[t][i.operator]}),(0,n.jsx)(h,{$connected:!!i.next,$highlight:i.passed,children:i.value})]}):"select"===t&&(0,c.p3)(i)?Array.isArray(i.value)?(0,n.jsxs)(m,{children:[(0,n.jsx)(g,{$dimmed:!0,$connected:!!i.next,$highlight:i.passed,children:u[t][i.operator]}),(0,n.jsx)("span",{children:i.value.map((e,t)=>(0,n.jsx)(h,{$connected:!!i.next,$highlight:i.passed,children:"".concat(o(e)).concat(i.value.length-1===t?"":", ")}))})]}):(0,n.jsxs)(m,{children:[(0,n.jsx)(g,{$dimmed:!0,$connected:!!i.next,$highlight:i.passed,children:u[t][i.operator]}),(0,n.jsx)(h,{$connected:!!i.next,$highlight:i.passed,children:o(i.value)})]}):"checkbox"===t&&(0,c.Zp)(i)?"is"===i.operator&&i.value?(0,n.jsx)(m,{children:(0,n.jsx)(g,{$connected:!!i.next,$highlight:i.passed,children:r("checkboxTypeIsOn")})}):(0,n.jsx)(m,{children:(0,n.jsx)(g,{$connected:!!i.next,$highlight:i.passed,children:r("checkboxTypeIsOff")})}):null},x=i(91907),b=i(70870);let y=r.ZP.div.withConfig({componentId:"sc-c0d5ca28-0"})(["position:relative;min-width:150px;max-width:300px;background-color:",";border:1px solid ",";border-radius:6px;transition:opacity 0.1s ease-in-out;"],e=>{let{theme:t}=e;return t.colorBgElevated},e=>{let{theme:t}=e;return t.colorBorderSecondary}),v=r.ZP.div.withConfig({componentId:"sc-c0d5ca28-1"})(["position:relative;padding-left:10px;"]),C=r.ZP.div.withConfig({componentId:"sc-c0d5ca28-2"})(["position:absolute;top:10px;left:-10px;width:7px;height:7px;padding:5px;border:none;border-radius:50%;background-color:rgba(255,255,255,0.1);:after{content:'';display:block;width:7px;height:7px;box-sizing:border-box;border-radius:50%;background-color:",";border:none;}"],e=>{let{theme:t}=e;return t.colorTextTertiary}),w=(0,r.ZP)(o.Z).withConfig({componentId:"sc-c0d5ca28-3"})(["padding:8px 10px;border-bottom:1px solid ",";"],e=>{let{theme:t}=e;return t.colorBorderSecondary}),j=r.ZP.div.withConfig({componentId:"sc-c0d5ca28-4"})(["display:flex;flex-direction:column;padding:8px 0;gap:8px;"]);var T=function(e){let{formField:t,getLabelOfOption:i}=e,{isDarkMode:o}=(0,s.F)(),r=(0,x.Se)(t);return(0,n.jsx)(s.f,{defaultMode:o?"dark":"light",children:(0,n.jsxs)(y,{children:[(0,n.jsx)(w,{children:t.name}),(0,n.jsxs)(j,{children:[(0,n.jsx)(C,{}),null==r?void 0:r.map((e,o)=>(0,n.jsxs)(v,{children:[(0,n.jsx)(f,{type:t.type,condition:e,getLabelOfOption:i}),(0,n.jsx)(b.O,{type:"source",id:o.toString(),position:a.Ly.Right})]},o))]})]})})},I=i(12355),F=i(37543),M=i(33503),N=i(79497),k=i(3056),E=i(71031),S=i(81839),P=i(20264),Z=i(56207),D=function(e){let{onClick:t}=e,{t:i}=(0,l.$G)(p.l.nodeSettingModal),{isDarkMode:o}=(0,s.F)();return(0,n.jsx)(s.f,{defaultMode:o?"dark":"light",children:(0,n.jsx)(R,{children:(0,n.jsx)(_,{children:(0,n.jsx)(I.ZP,{type:"text",size:"small",icon:(0,n.jsx)(Z.Z,{}),onClick:t,children:i("addCondition")})})})})};let R=r.ZP.div.withConfig({componentId:"sc-35a398ae-0"})(["padding:6px 0;height:0;opacity:0;transition:all 0.1s ease-in-out;&:hover{height:24px;opacity:1;}"]),_=r.ZP.div.withConfig({componentId:"sc-35a398ae-1"})(["display:flex;justify-content:center;padding:0 12px;&::after,&::before{width:50%;transform:translateY(50%);content:'';border-color:",";border-style:dashed;border-width:1px 0 0;}"],e=>{let{theme:t}=e;return t.colorBorder});var O=i(32385),G=i(43618),q=i(61672),z=i(79096),A=i(5942),$=i(52905),L=i(15438),B=function(e){let{nodeType:t,defaultOperator:i,onChange:o}=e,{t:r}=(0,l.$G)(p.l.condition),s={[c.WE.NUMBER]:{[c.jT.IS]:r("numberTypeIsEqualTo"),[c.jT.IS_NOT]:r("numberTypeIsNotEqualTo"),[c.jT.GT]:r("numberTypeGreaterThan"),[c.jT.GT_AND_EQUAL]:r("numberTypeGreaterThanOrEqualTo"),[c.jT.LT]:r("numberTypeLessThan"),[c.jT.LT_AND_EQUAL]:r("numberTypeLessThanOrEqualTo"),[c.jT.BETWEEN]:r("numberTypeIsBetween"),[c.jT.NOT_BETWEEN]:r("numberTypeIsNotBetween")},[c.WE.TEXT]:{[c.jT.IS]:r("textTypeIs"),[c.jT.IS_NOT]:r("textTypeIsNot"),[c.jT.CONTAINS]:r("textTypeContains"),[c.jT.NOT_CONTAINS]:r("textTypeDoesNotContain"),[c.jT.STARTS_WITH]:r("textTypeStartsWith"),[c.jT.ENDS_WITH]:r("textTypeEndsWith"),[c.jT.IS_EMPTY]:r("textTypeIsEmpty"),[c.jT.IS_NOT_EMPTY]:r("textTypeIsNotEmpty")},[c.WE.SELECT]:{[c.jT.IS]:r("selectTypeIs"),[c.jT.IS_NOT]:r("selectTypeIsNot"),[c.jT.ANY_IN]:r("selectTypeAnyIn"),[c.jT.NOT_IN]:r("selectTypeNotIn")}};return(0,n.jsx)(L.default,{defaultValue:i,onChange:o,popupMatchSelectWidth:!1,children:Object.entries(s[t]).map((e,t)=>{let[i,o]=e;return(0,n.jsx)(L.default.Option,{value:i,children:o},t.toString())})})};let U=(0,r.ZP)(E.Z.Item).withConfig({componentId:"sc-769c858e-0"})(["margin:0;"]),W=(0,r.ZP)($.Z).withConfig({componentId:"sc-769c858e-1"})(["width:100%;"]),V=r.ZP.div.withConfig({componentId:"sc-769c858e-2"})(["display:flex;align-items:center;gap:","px;"],e=>{let{gap:t}=e;return t});var H=function(e){let{formListField:t}=e,{t:i}=(0,l.$G)(p.l.condition),o=E.Z.useFormInstance(),r=(0,k.useCallback)(()=>(0,n.jsx)(E.Z.Item,{name:[t.name,"value",0],validateTrigger:["onChange","onBlur"],rules:[{required:!0,message:"값을 입력해주세요."},{pattern:/^[0-9]+$/,message:"숫자만 입력할 수 있습니다."}],noStyle:!0,children:(0,n.jsx)(W,{type:"number",min:0})}),[t.name]),s=(0,k.useCallback)(()=>(0,n.jsx)(E.Z.Item,{noStyle:!0,name:[t.name,"operator"],children:(0,n.jsx)(B,{nodeType:c.WE.NUMBER,defaultOperator:o.getFieldValue(["conditions",t.name,"operator"])})}),[o,t.name]);return(0,n.jsx)(U,{children:(0,n.jsx)(V,{gap:8,children:(0,n.jsx)(l.cC,{components:{value:(0,n.jsx)(r,{}),operator:(0,n.jsx)(s,{})},children:i("numberConditionBasic")})})})},Y=i(87423);let Q=(0,r.ZP)(E.Z.Item).withConfig({componentId:"sc-19eb1af9-0"})(["margin:0;"]),X=(0,r.ZP)($.Z).withConfig({componentId:"sc-19eb1af9-1"})(["width:100%;"]),J=r.ZP.div.withConfig({componentId:"sc-19eb1af9-2"})(["display:flex;align-items:center;gap:","px;"],e=>{let{gap:t}=e;return t}),K=(0,r.ZP)(Y.Q).withConfig({componentId:"sc-19eb1af9-3"})(["flex-shrink:0;"]);var ee=function(e){let{formListField:t}=e,{t:i}=(0,l.$G)(p.l.condition),o=E.Z.useFormInstance(),r=(0,k.useCallback)(()=>(0,n.jsx)(E.Z.Item,{name:[t.name,"value",0],validateTrigger:["onChange","onBlur"],rules:[{required:!0,message:"값을 입력해주세요."},{pattern:/^[0-9]+$/,message:"숫자만 입력할 수 있습니다."}],normalize:Number,noStyle:!0,children:(0,n.jsx)(X,{type:"number",min:0})}),[t.name]),s=(0,k.useCallback)(()=>(0,n.jsx)(E.Z.Item,{name:[t.name,"value",1],validateTrigger:["onChange","onBlur"],rules:[{required:!0,message:"값을 입력해주세요."},{pattern:/^[0-9]+$/,message:"숫자만 입력할 수 있습니다."}],normalize:Number,noStyle:!0,children:(0,n.jsx)(X,{type:"number",min:0})}),[t.name]),a=(0,k.useCallback)(()=>(0,n.jsx)(E.Z.Item,{noStyle:!0,name:[t.name,"operator"],children:(0,n.jsx)(B,{nodeType:c.WE.NUMBER,defaultOperator:o.getFieldValue(["conditions",t.name,"operator"])})}),[o,t.name]);return(0,n.jsx)(Q,{validateFirst:"parallel",children:(0,n.jsx)(J,{gap:8,children:(0,n.jsx)(l.cC,{components:{min:(0,n.jsx)(r,{}),max:(0,n.jsx)(s,{}),operator:(0,n.jsx)(a,{}),copula:(0,n.jsx)(K,{})},children:i("numberConditionBetween")})})})};let et=r.ZP.div.withConfig({componentId:"sc-d0f15b2c-0"})(["display:flex;justify-content:flex-start;align-items:center;gap:8px;"]),ei=r.ZP.div.withConfig({componentId:"sc-d0f15b2c-1"})(["display:flex;align-items:center;gap:","px;flex-shrink:0;"],e=>{let{gap:t}=e;return t}),en=(0,r.ZP)(A.g).withConfig({componentId:"sc-d0f15b2c-2"})(["flex-shrink:0;max-width:160px;"]),eo=(0,r.ZP)(A.Q).withConfig({componentId:"sc-d0f15b2c-3"})(["flex-shrink:0;"]),er=(0,r.ZP)(ei).withConfig({componentId:"sc-d0f15b2c-4"})(["flex-shrink:0;"]);var es=function(e){let{fieldName:t,formListField:i}=e,{t:o}=(0,l.$G)(p.l.condition),r=E.Z.useFormInstance(),s=E.Z.useWatch(["conditions",i.name,"operator"],r);return(0,n.jsxs)(et,{children:[(0,n.jsx)(er,{gap:6,children:(0,n.jsx)(l.cC,{values:{name:t},components:{copula:(0,n.jsx)(eo,{}),name:(0,n.jsx)(en,{})},children:o("conditionPrefix")})}),s===c.jT.BETWEEN||s===c.jT.NOT_BETWEEN?(0,n.jsx)(ee,{formListField:i}):(0,n.jsx)(H,{formListField:i})]})},ea=i(71196);let el=r.ZP.div.withConfig({componentId:"sc-a134639c-0"})(["display:flex;justify-content:flex-start;align-items:center;gap:8px;"]),ed=r.ZP.div.withConfig({componentId:"sc-a134639c-1"})(["display:flex;align-items:center;gap:","px;"],e=>{let{gap:t}=e;return t}),ec=(0,r.ZP)(E.Z.Item).withConfig({componentId:"sc-a134639c-2"})(["margin:0;width:100%;"]),eu=(0,r.ZP)(ea.default).withConfig({componentId:"sc-a134639c-3"})(["flex:1;width:100%;"]),ep=(0,r.ZP)(A.g).withConfig({componentId:"sc-a134639c-4"})(["flex-shrink:0;max-width:160px;"]),eg=(0,r.ZP)(A.Q).withConfig({componentId:"sc-a134639c-5"})(["flex-shrink:0;"]),eh=(0,r.ZP)(ed).withConfig({componentId:"sc-a134639c-6"})(["flex-shrink:0;"]),em=r.ZP.div.withConfig({componentId:"sc-a134639c-7"})([".recatch-ant-select{width:unset;}"]);var ef=function(e){let{fieldName:t,formListField:i}=e,{t:o}=(0,l.$G)(p.l.condition),r=E.Z.useFormInstance(),s=E.Z.useWatch(["conditions",i.name,"operator"],r),a=(0,k.useCallback)(()=>s!==c.jT.IS_EMPTY&&s!==c.jT.IS_NOT_EMPTY?(0,n.jsx)(E.Z.Item,{name:[i.name,"value"],validateTrigger:["onChange","onBlur","onWatch"],rules:[{required:!0,message:"값을 입력해주세요."}],noStyle:!0,children:(0,n.jsx)(eu,{})}):(0,n.jsx)(n.Fragment,{}),[i.name,s]),d=(0,k.useCallback)(()=>(0,n.jsx)(em,{children:(0,n.jsx)(E.Z.Item,{noStyle:!0,name:[i.name,"operator"],children:(0,n.jsx)(B,{nodeType:c.WE.TEXT,defaultOperator:r.getFieldValue(["conditions",i.name,"operator"])})})}),[r,i.name]);return(0,n.jsxs)(el,{children:[(0,n.jsx)(eh,{gap:6,children:(0,n.jsx)(l.cC,{values:{name:t},components:{copula:(0,n.jsx)(eg,{}),name:(0,n.jsx)(ep,{})},children:o("conditionPrefix")})}),(0,n.jsx)(ec,{children:(0,n.jsx)(ed,{gap:8,children:(0,n.jsx)(l.cC,{components:{value:(0,n.jsx)(a,{}),operator:(0,n.jsx)(d,{})},children:o("textCondition")})})})]})};let ex=r.ZP.div.withConfig({componentId:"sc-864cbb22-0"})(["display:flex;justify-content:flex-start;align-items:center;gap:8px;"]),eb=r.ZP.div.withConfig({componentId:"sc-864cbb22-1"})(["display:flex;align-items:center;gap:","px;"],e=>{let{gap:t}=e;return t}),ey=(0,r.ZP)(E.Z.Item).withConfig({componentId:"sc-864cbb22-2"})(["margin:0;flex:1;overflow:hidden;"]),ev=(0,r.ZP)(A.g).withConfig({componentId:"sc-864cbb22-3"})(["flex-shrink:0;max-width:160px;"]),eC=(0,r.ZP)(A.Q).withConfig({componentId:"sc-864cbb22-4"})(["flex-shrink:0;"]),ew=(0,r.ZP)(eb).withConfig({componentId:"sc-864cbb22-5"})(["flex-shrink:0;"]),ej=r.ZP.div.withConfig({componentId:"sc-864cbb22-6"})(["display:flex;flex-direction:column;"]);var eT=function(e){let{fieldName:t,formListField:i,options:o,getLabelOfOption:r=e=>e}=e,{t:s}=(0,l.$G)(p.l.condition),a=E.Z.useFormInstance(),d=(0,k.useCallback)(()=>(0,n.jsx)(E.Z.Item,{name:[i.name,"value"],validateTrigger:["onChange","onBlur"],rules:[{required:!0,message:"값을 입력해주세요."}],noStyle:!0,children:(0,n.jsx)(L.default,{mode:"multiple",allowClear:!1,popupMatchSelectWidth:!1,style:{width:"100%",overflow:"hidden"},children:null==o?void 0:o.map(e=>(0,n.jsx)(L.default.Option,{value:e,children:r(e)},e))})}),[i.name,r,o]),u=(0,k.useCallback)(()=>(0,n.jsx)(E.Z.Item,{noStyle:!0,name:[i.name,"operator"],children:(0,n.jsx)(ej,{children:(0,n.jsx)(B,{nodeType:c.WE.SELECT,defaultOperator:a.getFieldValue(["conditions",i.name,"operator"])})})}),[a,i.name]);return(0,n.jsxs)(ex,{children:[(0,n.jsx)(ew,{gap:6,children:(0,n.jsx)(l.cC,{values:{name:t},components:{copula:(0,n.jsx)(eC,{}),name:(0,n.jsx)(ev,{})},children:s("conditionPrefix")})}),(0,n.jsx)(ey,{children:(0,n.jsx)(eb,{gap:8,children:(0,n.jsx)(l.cC,{components:{value:(0,n.jsx)(d,{}),operator:(0,n.jsx)(u,{})},children:s("selectCondition")})})})]})},eI=function(e){let{fieldName:t,formField:i,formListField:o,getLabelOfOption:r}=e;return(0,c.lI)(i)?(0,n.jsx)(es,{fieldName:t,formListField:o}):(0,c.E0)(i)?(0,n.jsx)(ef,{fieldName:t,formListField:o}):(0,c.O6)(i)?(0,n.jsx)(eT,{fieldName:t,options:i.options,formListField:o,getLabelOfOption:r}):null},eF=function(e){let{order:t,fieldName:i,formField:o,formListField:r,getLabelOfOption:s,onHover:a,onRemove:l,isDeleteDisabled:d}=e,{setDragRef:c}=(0,G.c0)({type:"sortable-item",data:{...r,id:"".concat(r.key)}}),{setDropRef:u}=(0,G.LW)({type:"sortable-item",containerId:"".concat(r.key),onDrop:()=>null,onHover:a});return(0,n.jsxs)(eM,{ref:e=>c(u(e)),children:[(0,n.jsxs)(eN,{children:[(0,n.jsx)(I.ZP,{type:"text",icon:(0,n.jsx)(z.Z,{})}),(0,n.jsx)(q.Z,{children:t})]}),(0,n.jsx)(ek,{children:(0,n.jsx)(eI,{fieldName:i,formField:o,formListField:r,getLabelOfOption:s})}),(0,n.jsx)(eE,{type:"text",icon:(0,n.jsx)(P.Z,{}),disabled:d,onClick:()=>l(r.name)})]})};let eM=r.ZP.div.withConfig({componentId:"sc-9a5bde8f-0"})(["display:flex;justify-content:space-between;overflow:hidden;align-items:center;padding-right:12px;"]),eN=r.ZP.div.withConfig({componentId:"sc-9a5bde8f-1"})(["display:flex;align-items:center;flex-shrink:0;"]),ek=r.ZP.div.withConfig({componentId:"sc-9a5bde8f-2"})(["flex:1;overflow:hidden;display:flex;flex-direction:column;"]),eE=(0,r.ZP)(I.ZP).withConfig({componentId:"sc-9a5bde8f-3"})(["flex-shrink:0;"]);function eS(e){let{formListFields:t,fieldData:i,getLabelOfOption:o,move:r,remove:s,add:a,getDefaultValue:l}=e,d=(0,k.useCallback)((e,i)=>{r(t.findIndex(t=>t.key===e.key),t.findIndex(e=>"".concat(e.key)===i))},[t,r]),c=(0,k.useCallback)(()=>a(l(t.length-1),t.length),[a,t.length,l]);return(0,n.jsxs)(n.Fragment,{children:[t.map((e,r)=>(0,n.jsx)(eF,{order:r+1,fieldName:i.label,formField:i.formField,formListField:e,isDeleteDisabled:1===t.length,getLabelOfOption:o,onHover:d,onRemove:s},e.key)),(0,n.jsx)(D,{onClick:c})]})}var eP=function(e){let{nodeId:t,fieldData:i,getLabelOfOption:o,onSave:r,onClose:a}=e,{t:d}=(0,l.$G)(p.l.nodeSettingModal),[c]=E.Z.useForm(),{isDarkMode:u}=(0,s.F)(),{type:g,name:h}=i.formField,[m,f]=(0,k.useState)(!1),x=e=>({value:void 0,operator:c.getFieldValue(["conditions",e,"operator"])});return(0,n.jsx)(s.f,{defaultMode:u?"dark":"light",children:(0,n.jsx)(eZ,{children:(0,n.jsxs)(E.Z,{form:c,layout:"vertical",onFieldsChange:e=>{if(e.some(e=>e.errors&&e.errors.length>0))return f(!1);f(!0)},initialValues:{fieldType:g,fieldName:h,conditions:(0,O.O7)(i.conditions)},children:[(0,n.jsxs)(eD,{children:[(0,n.jsx)(eR,{children:d("title")}),(0,n.jsx)(I.ZP,{type:"text",size:"small",icon:(0,n.jsx)(eG,{children:(0,n.jsx)(P.Z,{})}),onClick:a})]}),(0,n.jsx)(e_,{children:(0,n.jsx)(S.Z,{type:"info",message:d("modalInfo"),style:{color:"#8DC5F8"}})}),(0,n.jsx)(eO,{children:(0,n.jsx)(E.Z.List,{name:"conditions",children:(e,t)=>{let{add:r,remove:s,move:a}=t;return(0,n.jsx)(eS,{formListFields:e,fieldData:i,getLabelOfOption:o,move:a,remove:s,add:r,getDefaultValue:x})}})}),(0,n.jsxs)(eq,{children:[(0,n.jsx)(I.ZP,{type:"text",onClick:a,children:d("cancel")}),(0,n.jsx)(I.ZP,{type:"primary",disabled:!m,onClick:()=>{c.validateFields().then(()=>{let e=c.getFieldsValue(!0);r(t,(0,O.Qd)(g,e.conditions)),a()}).catch(e=>{throw e})},children:d("save")})]})]})})})};let eZ=r.ZP.div.withConfig({componentId:"sc-ae726065-0"})(["width:100%;min-width:540px;max-width:600px;background-color:",";box-shadow:0px 0px 50px rgba(0,0,0,0.3);border-radius:8px;"],e=>{let{theme:t}=e;return t.colorBgElevated}),eD=r.ZP.div.withConfig({componentId:"sc-ae726065-1"})(["display:flex;justify-content:space-between;padding:16px 24px 8px;"]),eR=(0,r.ZP)(o.Z).withConfig({componentId:"sc-ae726065-2"})(["font-size:","px;font-weight:600;"],e=>{let{theme:t}=e;return t.fontSizeLG}),e_=r.ZP.div.withConfig({componentId:"sc-ae726065-3"})(["padding:0 16px;"]),eO=r.ZP.div.withConfig({componentId:"sc-ae726065-4"})(["display:flex;flex-direction:column;padding:12px 0px;gap:8px;"]),eG=r.ZP.div.withConfig({componentId:"sc-ae726065-5"})(["margin:0 auto;width:14px;"]),eq=r.ZP.div.withConfig({componentId:"sc-ae726065-6"})(["display:flex;justify-content:end;padding:0 24px 24px;gap:8px;"]);var ez=function(e){var t;let[i,o]=(0,k.useState)(!1),{isDarkMode:r}=(0,s.F)(),l=t=>{e.onRemove(t)},{getLabelOfOption:d}=e,u=d?t=>d(e.data.formField.name,t):void 0;return(0,n.jsx)(s.f,{defaultMode:r?"dark":"light",children:(0,n.jsxs)(eL,{children:[(0,n.jsxs)(eA,{className:"button-setting",children:[e.data.formField.type!==c.WE.CHECKBOX&&(0,n.jsx)(I.ZP,{type:"text",icon:(0,n.jsx)(M.Z,{}),onClick:()=>o(!i)}),(0,n.jsx)(I.ZP,{type:"text",icon:(0,n.jsx)(N.Z,{}),onClick:()=>l(e.id)})]}),(0,n.jsx)(eB,{children:e.data.label}),(0,n.jsx)(b.C,{type:"target",position:a.Ly.Left,top:20}),(0,n.jsx)(eU,{children:e.data.conditions.map((t,i)=>(0,n.jsxs)(eW,{children:[(0,n.jsx)(f,{type:e.data.formField.type,condition:t,getLabelOfOption:u}),(0,n.jsx)(b.O,{type:"source",id:i.toString(),position:a.Ly.Right,$next:!!t.next,$highlight:!!t.passed})]},i))}),("number"===(t=e.data).formField.type||"select"===t.formField.type||"text"===t.formField.type)&&(0,n.jsx)(F.Z,{open:i,footer:null,closable:!1,destroyOnClose:!0,width:600,modalRender:e=>(0,n.jsx)(e$,{children:e}),children:(0,n.jsx)(eP,{nodeId:e.id,fieldData:e.data,getLabelOfOption:u,onSave:(t,i)=>{e.onSave(t,i)},onClose:()=>o(!1)})})]})})};let eA=r.ZP.div.withConfig({componentId:"sc-262c6b9e-0"})(["position:absolute;top:-16px;right:-16px;background-color:",";border-radius:8px;border:1px solid ",";padding:4px;"],e=>{let{theme:t}=e;return t.colorBgElevated},e=>{let{theme:t}=e;return t.colorBorder}),e$=r.ZP.div.withConfig({componentId:"sc-262c6b9e-1"})([".recatch-ant-modal-content{padding:0;background:'none';}"]),eL=r.ZP.div.withConfig({componentId:"sc-262c6b9e-2"})(["position:relative;min-width:150px;max-width:300px;background-color:",";border:1px solid ",";border-radius:6px;transition:opacity 0.1s ease-in-out;.button-setting{opacity:0;}&:hover{.button-setting{opacity:1;}}"],e=>{let{theme:t}=e;return t.colorBgElevated},e=>{let{theme:t}=e;return t.colorBorderSecondary}),eB=(0,r.ZP)(o.Z).withConfig({componentId:"sc-262c6b9e-3"})(["padding:8px 10px;border-bottom:1px solid ",";"],e=>{let{theme:t}=e;return t.colorBorderSecondary}),eU=r.ZP.div.withConfig({componentId:"sc-262c6b9e-4"})(["display:flex;flex-direction:column;padding:8px 0;gap:8px;"]),eW=r.ZP.div.withConfig({componentId:"sc-262c6b9e-5"})(["position:relative;padding:0 10px;"]);var eV=i(4191),eH=i(52043),eY=i(23009),eQ=i(87883),eX=i(86424),eJ=i(47705),eK=i(1340),e0=i(5703),e1=i(18095),e2=i(75894),e5=i(1439),e4=i(37145),e6=function(e){let{data:t,teamMembers:i,editingGroupId:o,errors:r,warnings:s,onAddGroup:d,onDisqualifiedResultChange:c,onGroupClick:u,onAttendeesChange:g,onGroupRemove:h}=e,{t:m}=(0,l.$G)(p.l.flow),[f,x]=F.Z.useModal(),{isDarkMode:y}=(0,eY.F)(),{featureFlags:{useNewAccessRequestStepAddition:v}}=(0,e5.Ty)(),C=(e,t)=>{e.stopPropagation(),u(t)},w=(e,t)=>{e.stopPropagation(),f.confirm({title:m("deleteGroup"),content:m("deleteGroupConfirmation"),okText:m("delete"),cancelText:m("cancel"),closable:!0,onOk:()=>h(t)})},j=(0,k.useCallback)(()=>(0,e1.of)(i),[i]),T=i.reduce((e,t)=>({...e,[t.userId]:t}),{}),E=void 0!==o?"__editing-group__":"";return(0,n.jsx)(eY.Z,{defaultMode:y?"dark":"light",children:(0,n.jsxs)(e3,{children:[x,(0,n.jsx)(tr,{className:E}),(0,n.jsxs)(e7,{children:[(0,n.jsx)(e8,{className:E,children:m("assignMeetings")}),(0,n.jsxs)(e9,{children:[0===t.groups.length?(0,n.jsx)(tc,{children:m("emptyGroupMessage")}):t.groups.map((e,t)=>{var i,l,d,c,u,p,h,f;if("creating"===e)return(0,n.jsx)(eV.TK,{},"creating-group-".concat(t));let x=null!==(p=null==r?void 0:null===(l=r.groupErrors)||void 0===l?void 0:null===(i=l[e.id])||void 0===i?void 0:i.calendarToAddEvent)&&void 0!==p?p:null==r?void 0:null===(c=r.groupErrors)||void 0===c?void 0:null===(d=c[e.id])||void 0===d?void 0:d.calendarsToCheckConflict,y=e=>(null==e?void 0:e.type)==="noPermission"||(null==e?void 0:e.type)==="noTokenOnServer",F=e=>{if(void 0===e)return!1;if("type"in e)return y(e);if("object"==typeof e)for(let t in e){let i=e[t];if(i&&y(i))return!0}return!1};return(0,n.jsxs)(tt,{className:"recatch__workflow__flow__group",highlight:o===e.id,onClick:t=>C(t,e),$hasWarning:null!==(h=null==s?void 0:s[e.id])&&void 0!==h&&h,$hasError:F(x),children:[(0,n.jsxs)(tn,{className:"button-setting",children:[(0,n.jsx)(I.ZP,{type:"text",icon:(0,n.jsx)(M.Z,{})}),(0,n.jsx)(I.ZP,{type:"text",icon:(0,n.jsx)(N.Z,{}),onClick:t=>w(t,e)})]}),(0,n.jsxs)(ti,{$hasWarning:null!==(f=null==s?void 0:s[e.id])&&void 0!==f&&f,$hasError:F(x),children:[(F(x)||(null==s?void 0:s[e.id]))&&(0,n.jsx)(eX.Z,{}),m("assigneeGroup")," ",t+1]}),(0,n.jsx)(to,{onClick:e=>e.stopPropagation(),children:(0,n.jsx)(eK.P,{organizer:"roundRobin"===e.meetingType?void 0:(null===(u=e.organizers[0])||void 0===u?void 0:u.id)?T[e.organizers[0].id]:void 0,attendees:(0,e0.Z)([...e.organizers.map(e=>{let{id:t}=e;return T[t].email}),...e.attendees.map(e=>{let{email:t}=e;return t})]),showChangeOrganizerButton:!1,isActiveMember:v?e=>("ADMIN"===e.teamMemberRole||"MEMBER"===e.teamMemberRole)&&"ACTIVE"===e.teamMemberStatus:()=>!0,getTeamMembers$:j,onChange:e=>g(t,e)})}),(0,n.jsx)(b.C,{type:"target",id:e.id,position:a.Ly.Left})]},e.id)}),(0,n.jsx)(I.ZP,{icon:(0,n.jsx)(Z.Z,{}),className:E,onClick:d,children:m("addAssigneeGroup")})]}),(0,n.jsx)(ts,{className:E}),(0,n.jsxs)(ta,{children:[(0,n.jsx)(e8,{className:E,children:m("disqualifiedTitle")}),(0,n.jsx)(tl,{className:E,placement:"topRight",title:m("disqualifiedHelpTitle"),content:m("disqualifiedHelpDescription"),overlayStyle:{width:240},children:(0,n.jsx)(I.ZP,{ghost:!0,icon:(0,n.jsx)(eJ.Z,{}),size:"small"})})]}),(0,n.jsxs)(td,{onClick:e=>{e.stopPropagation()},children:[(0,n.jsx)(b.C,{type:"target",id:e2.M.DISQUALIFIED_HANDLE_ID,position:a.Ly.Left}),(0,n.jsx)(e4.Z,{name:m("disqualifiedOutputMessageTitle"),isSelected:"message"===t.disqualifiedResultSettings.selectedType,errorMessage:(null==r?void 0:r.disqualifiedResult)==="disqualified-message-empty"?m("disqualifiedMessageEmpty"):void 0,onChange:()=>{c({type:"message",data:t.disqualifiedResultSettings.message})},children:(0,n.jsx)(ea.default.TextArea,{className:"nodrag",placeholder:m("disqualifiedOutputMessagePlaceholder"),value:t.disqualifiedResultSettings.message,status:(null==r?void 0:r.disqualifiedResult)==="disqualified-message-empty"?"error":void 0,onChange:e=>{c({type:"message",data:e.target.value})}})}),(0,n.jsx)(e4.Z,{name:m("disqualifiedOutputRedirectUrlTitle"),isSelected:"redirect"===t.disqualifiedResultSettings.selectedType,errorMessage:(null==r?void 0:r.disqualifiedResult)==="disqualified-link-empty"?m("disqualifiedLinkEmpty"):(null==r?void 0:r.disqualifiedResult)==="disqualified-link-invalid"?m("disqualifiedLinkInvalid"):void 0,onChange:()=>{c({type:"redirect",data:t.disqualifiedResultSettings.redirectUrl})},children:(0,n.jsx)(ea.default,{className:"nodrag",placeholder:"https://",value:t.disqualifiedResultSettings.redirectUrl,status:(null==r?void 0:r.disqualifiedResult)==="disqualified-link-empty"||(null==r?void 0:r.disqualifiedResult)==="disqualified-link-invalid"?"error":void 0,onChange:e=>{c({type:"redirect",data:e.target.value})}})})]})]})]})})};let e3=r.ZP.div.withConfig({componentId:"sc-2738c5d1-0"})(["width:","px;display:flex;transition:visibility 0.3s;.__editing-group__{visibility:hidden;}"],265),e7=r.ZP.div.withConfig({componentId:"sc-2738c5d1-1"})(["padding:24px 0;flex:1;display:flex;flex-direction:column;align-items:center;"]),e8=(0,r.ZP)(eH.MQ).withConfig({componentId:"sc-2738c5d1-2"})(["margin-bottom:12px;font-weight:600;"]),e9=r.ZP.div.withConfig({componentId:"sc-2738c5d1-3"})(["position:relative;width:200px;display:flex;flex-direction:column;gap:6px;"]),te=r.ZP.div.withConfig({componentId:"sc-2738c5d1-4"})(["background:",";border:1px solid ",";border-radius:6px;"],e=>{let{theme:t}=e;return t.colorBgElevated},e=>{let{theme:t}=e;return t.colorBorderSecondary}),tt=(0,r.ZP)(te).withConfig({componentId:"sc-2738c5d1-5"})(["position:relative;padding:8px;box-sizing:border-box;border:1px solid ",";.button-setting{opacity:0;}&:hover{.button-setting{opacity:1;}}",""],e=>{let{$hasError:t,$hasWarning:i,theme:n}=e;return t?n.colorError:i?n.colorWarning:n.colorBorder},e=>{let{highlight:t,$hasWarning:i,$hasError:n}=e;return t&&(0,r.iv)(["border:1px solid ",";"],e=>{let{theme:t}=e;return n?t.colorError:i?t.colorWarning:t.colorTextSecondary})}),ti=(0,r.ZP)(eH.go).withConfig({componentId:"sc-2738c5d1-6"})(["display:flex;gap:8px;color:",";"],e=>{let{theme:t,$hasError:i,$hasWarning:n}=e;return i?t.colorError:n?t.colorWarning:t.colorTextPrimary}),tn=r.ZP.div.withConfig({componentId:"sc-2738c5d1-7"})(["position:absolute;top:-16px;right:-16px;background-color:",";border-radius:8px;border:1px solid ",";padding:4px;"],e=>{let{theme:t}=e;return t.colorBgElevated},e=>{let{theme:t}=e;return t.colorBorder}),to=r.ZP.div.withConfig({componentId:"sc-2738c5d1-8"})([".recatch-ant-select-selection-overflow{overflow:hidden;}"]),tr=r.ZP.div.withConfig({componentId:"sc-2738c5d1-9"})(["width:1px;background:linear-gradient( 180deg,rgba(255,255,255,0) 0%,rgba(255,255,255,0.16) 14.44%,rgba(255,255,255,0.16) 88.19%,rgba(255,255,255,0) 100% );"]),ts=r.ZP.div.withConfig({componentId:"sc-2738c5d1-10"})(["margin:32px 0;width:240px;height:1px;background:linear-gradient( 90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,0.16) 14.44%,rgba(255,255,255,0.16) 88.19%,rgba(255,255,255,0) 100% );"]),ta=r.ZP.div.withConfig({componentId:"sc-2738c5d1-11"})(["position:relative;display:flex;justify-content:center;width:200px;"]),tl=(0,r.ZP)(eQ.Z).withConfig({componentId:"sc-2738c5d1-12"})(["position:absolute;top:0;right:0;"]),td=(0,r.ZP)(te).withConfig({componentId:"sc-2738c5d1-13"})(["position:relative;width:200px;padding:8px;display:flex;flex-direction:column;gap:10px;box-sizing:border-box;"]),tc=(0,r.ZP)(eH.gH).withConfig({componentId:"sc-2738c5d1-14"})(["text-align:center;padding-bottom:6px;"])},93360:function(e,t,i){i.d(t,{Z:function(){return ie},k:function(){return t8}});var n=i(80432),o=i(78232);i(91781);var r=i(36580),s=i(55670),a=i(4191),l=i(23009),d=i(3056),c=i(14026),u=i(12355),p=i(66677),g=i(798),h=i(64369),m=i(70604),f=i(52255),x=i(18095),b=i(53845),y=i(53518),v=i(34904),C=i(51431),w=i(28039),j=i(33384),T=i(7925),I=i(15926),F=i(21073),M=i(86424),N=i(84503),k=e=>{let{label:t,hasError:i,hasWarning:o=!1}=e;return(0,n.jsxs)(E,{children:[(0,n.jsx)("span",{children:t}),i?(0,n.jsx)(S,{}):o?(0,n.jsx)(P,{}):null]})};let E=s.ZP.div.withConfig({componentId:"sc-2abd90d-0"})(["display:inline-flex;align-items:center;.anticon{position:absolute;left:calc(100% + 2px);font-size:16px;}"]),S=(0,s.ZP)(M.Z).withConfig({componentId:"sc-2abd90d-1"})(["svg{color:",";}"],e=>{let{theme:t}=e;return t.colorError}),P=(0,s.ZP)(N.Z).withConfig({componentId:"sc-2abd90d-2"})(["svg{color:",";}"],e=>{let{theme:t}=e;return t.colorWarning});var Z=function(e){let{formValuesManager:t,calendarsByAccount$:i,notCalendarTokens$:o,getTeamMembers$:r,slackIntegrationButtonRenderer:s,onDoneButtonClick:a}=e,{t:l}=(0,v.$G)(F.lS.meetingSetting),{featureFlags:{useNewAccessRequestStepAddition:u,selectSpecificRecordTypeInForm:g}}=(0,F.Ty)(),h=(0,d.useMemo)(()=>(0,c.a)([t.errors$,t.warnings$.pipe((0,C.O)({invalidRange:!1}))]),[t.errors$,t.warnings$]);return(0,n.jsx)(D,{children:(0,n.jsx)(T.Z,{centered:!0,items:[{key:"1",label:(0,n.jsx)(p.W,{observable:t.errors$,loader:()=>null,selectors:["meetingMethods","organizersAndAttendees"],builder:e=>{let{meetingMethods:t,organizersAndAttendees:i}=e;return(0,n.jsx)(k,{label:l("basicSettings"),hasError:!!(t||i)})}}),children:(0,n.jsx)(R,{children:(0,n.jsx)(j.Qr,{hideTitle:!0,formValuesManager:t,isActiveMember:u?e=>("ADMIN"===e.teamMemberRole||"MEMBER"===e.teamMemberRole)&&"ACTIVE"===e.teamMemberStatus:()=>!0,getTeamMembers$:r})})},{key:"2",label:(0,n.jsx)(p.W,{observable:h,loader:()=>null,builder:e=>{let[{calendarToAddEvent:t,calendarsToCheckConflict:i},{invalidRange:o}]=e;return(0,n.jsx)(k,{label:l("attendees"),hasError:!!(t||i),hasWarning:o})}}),children:(0,n.jsx)(R,{children:(0,n.jsx)(j.pZ,{formValuesManager:t,calendarsByAccount$:i,onDoneButtonClick:a,weeklyCalendarRenderer:e=>(0,n.jsx)(w.e,{...e})})})},{key:"3",label:l("notification"),children:(0,n.jsx)(R,{children:(0,n.jsx)(j.I8,{formValuesManager:t,notCalendarTokens$:o,slackIntegrationButtonRenderer:()=>s(async()=>{}),onNotificationSelect:()=>{}})})},...[g?{key:"4",label:l("recordType"),children:(0,n.jsx)(R,{children:(0,n.jsx)(j.qq,{formValuesManager:t})})}:null].filter(e=>e)]})})};let D=(0,s.ZP)(I.Z).withConfig({componentId:"sc-552df728-0"})(["margin-bottom:200px;overflow:hidden;.recatch-ant-tabs-nav{margin:0;}"]),R=s.ZP.div.withConfig({componentId:"sc-552df728-1"})(["height:100%;padding-top:32px;padding-bottom:80px;box-sizing:border-box;overflow:overlay;"]);var _=i(86805),O=i(71196),G=i(57485),q=i(63110),z=i(37145),A=function(e){let{value:t,error:i,onChange:o}=e,{t:r}=(0,v.$G)(q.l.flow),[s,a]=(0,d.useState)("message"===t.type?t.data:""),[l,c]=(0,d.useState)("redirect"===t.type?t.data:"");return(0,n.jsxs)($,{children:[(0,n.jsx)(L,{strong:!0,children:r("uponFromSubmission")}),(0,n.jsxs)(_.Z,{direction:"vertical",children:[(0,n.jsx)(z.Z,{name:r("disqualifiedOutputMessageTitle"),isSelected:"message"===t.type,errorMessage:(null==i?void 0:i.type)==="message"?null==i?void 0:i.errorMessage:void 0,onChange:()=>{o({...t,type:"message",data:s})},children:(0,n.jsx)(O.default.TextArea,{className:"nodrag",placeholder:r("disqualifiedOutputMessagePlaceholder"),value:s,status:(null==i?void 0:i.type)==="message"?"error":void 0,onChange:e=>{a(e.target.value),"message"===t.type&&o({...t,data:e.target.value})}})}),(0,n.jsx)(z.Z,{name:r("disqualifiedOutputRedirectUrlTitle"),isSelected:"redirect"===t.type,errorMessage:(null==i?void 0:i.type)==="redirect"?null==i?void 0:i.errorMessage:void 0,onChange:()=>{o({...t,type:"redirect",data:l})},children:(0,n.jsx)(O.default,{className:"nodrag",placeholder:"https://",value:l,status:(null==i?void 0:i.type)==="redirect"?"error":void 0,onChange:e=>{c(e.target.value),"redirect"===t.type&&o({...t,data:e.target.value})}})})]})]})};let $=s.ZP.div.withConfig({componentId:"sc-a7a06fc3-0"})(["display:flex;flex-direction:column;gap:16px;padding:0 20px;"]),L=(0,s.ZP)(G.g).withConfig({componentId:"sc-a7a06fc3-1"})(["font-size:16px;line-height:24px;"]);var B=i(19189),U=i(1439);let W={"disqualified-link-empty":"disqualifiedLinkEmpty","disqualified-link-invalid":"disqualifiedLinkInvalid","disqualified-message-empty":"disqualifiedMessageEmpty"},V={"disqualified-link-empty":"redirect","disqualified-link-invalid":"redirect","disqualified-message-empty":"message"};var H=function(e){var t,i;let{result:o,errorCode:r,onChange:s}=e,{t:a}=(0,v.$G)(F.lS.meetingSetting),{t:l}=(0,v.$G)(F.lS.flow),{dealRecordTypes:c}=function(){let{repositories:{recordTypeRepository:e}}=(0,U.Ty)(),[t,i]=(0,d.useState)([]),{t:n}=(0,v.$G)(q.l.flow);return(0,d.useEffect)(()=>{e.getAll({entityId:"deal",isV2:!0}).then(e=>{i(e.filter(e=>e.dealPipeline||e.id===B.S).map(e=>e.id===B.S?{...e,title:n("lead")}:e))})},[e,n]),{dealRecordTypes:t}}(),u=r&&V[r]===o.type?{type:V[r],errorMessage:l(W[r])}:void 0;return(0,n.jsx)(Y,{children:(0,n.jsx)(T.Z,{centered:!0,items:[{key:"1",label:(0,n.jsx)(k,{label:a("basic"),hasError:!!u}),children:(0,n.jsx)(Q,{children:(0,n.jsx)(A,{value:o,error:u,onChange:e=>{s({...o,type:e.type,data:e.data})}})})},{key:"2",label:(0,n.jsx)(k,{label:a("recordType"),hasError:!1}),children:(0,n.jsx)(Q,{children:(0,n.jsx)(j.kh,{recordTypes:c,selectedRecordTypeId:null===(t=o.formSubmissionMapping)||void 0===t?void 0:t.recordTypeId,selectedStageId:null===(i=o.formSubmissionMapping)||void 0===i?void 0:i.stageId,onChangeRecordType:(e,t)=>{s({...o,formSubmissionMapping:{recordTypeId:e,stageId:t}})}})})}]})})};let Y=(0,s.ZP)(I.Z).withConfig({componentId:"sc-cb7eb1f7-0"})(["margin-bottom:200px;overflow:hidden;.recatch-ant-tabs-nav{margin:0;}"]),Q=s.ZP.div.withConfig({componentId:"sc-cb7eb1f7-1"})(["height:100%;padding-top:32px;padding-bottom:80px;box-sizing:border-box;overflow:overlay;"]);var X=i(75894);let J=e=>(0,d.useMemo)(()=>e.values$.pipe((0,h.U)(e=>null==e?void 0:e.nodes.find(e=>X.M.isResultNodeData(e.data))),(0,m.h)(y.L),(0,h.U)(e=>({type:e.data.disqualifiedResultSettings.selectedType,data:"message"===e.data.disqualifiedResultSettings.selectedType?e.data.disqualifiedResultSettings.message:e.data.disqualifiedResultSettings.redirectUrl,formSubmissionMapping:e.data.disqualifiedResultSettings.formSubmissionMapping})),(0,f.x)((e,t)=>JSON.stringify(e)===JSON.stringify(t))),[e.values$]),K=e=>(0,d.useMemo)(()=>e.errors$.pipe((0,h.U)(e=>null==e?void 0:e.disqualifiedResult),(0,f.x)((e,t)=>JSON.stringify(e)===JSON.stringify(t))),[e.errors$]);var ee=function(e){let{calendarsByAccount:t,teamMembers:i,notCalendarTokens$:o,workflowManager:r,editingGroupId:s,slackIntegrationButtonRenderer:a,onDoneButtonClick:l}=e,u=(0,d.useMemo)(()=>(0,x.of)(t),[t]),h=(0,d.useCallback)(()=>(0,x.of)(i),[i]),m=(0,d.useMemo)(()=>r.getGroups$(),[r]),f=J(r),y=K(r),v=(0,d.useMemo)(()=>(0,c.a)([m,f,y]),[y,f,m]),C=e=>{r.setDisqualifiedResult(e)};return(0,n.jsx)(p.W,{observable:v,loader:()=>(0,n.jsx)(b.T,{}),builder:e=>{let[t,i,d]=e;if(i&&!s)return(0,n.jsx)(et,{children:(0,n.jsx)(H,{result:i,errorCode:d,onChange:C})});let c=t.findIndex(e=>"creating"!==e&&e.id===s);if(-1===c)return null;let p=r.getGroupValuesManager(t[c].id);return p instanceof g.v&&(0,n.jsx)(et,{children:(0,n.jsx)(Z,{formValuesManager:p,calendarsByAccount$:u,notCalendarTokens$:o,getTeamMembers$:h,slackIntegrationButtonRenderer:a,onDoneButtonClick:l},c)})}})};let et=s.ZP.div.withConfig({componentId:"sc-cc04c6aa-0"})(["padding:0 10px;width:100%;box-sizing:border-box;"]);var ei=i(91662),en=i(14403),eo=i(77743),er=i(61999),es=i(37543),ea=i(73822),el=i(1209),ed=i(34892),ec=i(92799);let eu=s.ZP.div.withConfig({componentId:"sc-2d1ee033-0"})(["position:absolute;top:",";height:200px;transform:translateX(",");transition:top 0.2s;cursor:grab;&:hover{top:-60px;}&:active{cursor:grabbing;}"],e=>{let{stuckOut:t}=e;return t?"-10px":0},e=>{let{left:t}=e;return t});var ep=function(e){let{node:t,name:i,left:o,stuckOut:r}=e,{isDragging:s,setDragRef:a}=(0,ec.c0)({data:{name:i,id:i},type:t8});return s?null:(0,n.jsx)(eu,{left:o,stuckOut:r,ref:a,children:t})};let eg=s.ZP.div.withConfig({componentId:"sc-d69cc664-0"})(["padding:40px 30px 0 30px;width:",";height:120px;display:flex;justify-content:space-between;background:",";border:1px solid ",";border-radius:8px 8px 0 0;box-sizing:border-box;"],e=>{let{width:t}=e;return t},e=>{let{theme:t}=e;return t.colorBgLayout},e=>{let{theme:t}=e;return t.colorBorder}),eh=s.ZP.div.withConfig({componentId:"sc-d69cc664-1"})(["position:relative;width:0;"]);var em=function(e){let{width:t,names:i,nodes:o}=e,{isDarkMode:r}=(0,ed.F)();return(0,n.jsx)(ed.f,{defaultMode:r?"dark":"light",children:(0,n.jsx)(eg,{width:t,children:o.map((e,t)=>(0,n.jsx)(eh,{children:(0,n.jsx)(ep,{node:e,name:i[t],left:"".concat(-t/(o.length-1)*100,"%"),stuckOut:t%2==1})},t))})})},ef=i(60183),ex=i(34338),eb=i(2854),ey=i(70870),ev=function(e){let{t}=(0,v.$G)(q.l.entryNode),{isDarkMode:i}=(0,ed.F)();return(0,n.jsx)(ed.f,{defaultMode:i?"dark":"light",children:(0,n.jsxs)(ew,{children:[(0,n.jsx)(eC,{children:t("inboundLead")}),(0,n.jsx)(u.ZP,{type:"primary",icon:(0,n.jsx)(eb.Z,{}),onClick:e.onTestClick,children:t("routingTest")}),(0,n.jsx)(ey.O,{type:"source",position:o.Ly.Right,$next:!!e.data.next})]})})};let eC=(0,s.ZP)(ex.Z).withConfig({componentId:"sc-e9093e12-0"})(["color:",";text-align:center;font-size:","px;font-weight:600;"],e=>{let{theme:t}=e;return t.colorText},e=>{let{theme:t}=e;return t.fontSizeLG}),ew=s.ZP.div.withConfig({componentId:"sc-e9093e12-1"})(["position:relative;min-width:150px;max-width:300px;background-color:",";border:1px solid ",";border-radius:6px;transition:opacity 0.1s ease-in-out;padding:12px;display:flex;flex-direction:column;gap:12px;"],e=>{let{theme:t}=e;return t.colorBgElevated},e=>{let{theme:t}=e;return t.colorBorderSecondary});var ej=i(90631);function eT(e){let{id:t,sourceX:i,sourceY:r,targetX:s,targetY:a,sourcePosition:l,targetPosition:d,style:c={},markerEnd:u}=e,{token:p}=(0,ej.F)(),[g]=(0,o.OQ)({sourceX:i,sourceY:r,sourcePosition:l,targetX:s,targetY:a,targetPosition:d}),h={stroke:p.colorSuccessText,...c};return(0,n.jsx)(o.u5,{path:g,markerEnd:u,style:h})}let eI=s.ZP.div.withConfig({componentId:"sc-4452f497-0"})(["display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex:1 0 0;"]),eF=(0,s.ZP)(ex.Z).withConfig({componentId:"sc-4452f497-1"})(["align-self:stretch;"]),eM=(0,s.ZP)(u.ZP).withConfig({componentId:"sc-4452f497-2"})(["margin-top:12px;"]);var eN=function(e){let{type:t,content:i,onClick:o}=e,{t:r}=(0,v.$G)(q.l.testResult);return(0,n.jsx)(eI,{children:"group"===t?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eF,{children:r("theMeetingWasAssignedTo",{groupName:"".concat(i)})}),(0,n.jsx)(eM,{size:"small",onClick:o,children:r("previewBookingScreen")})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eF,{children:r("theMeetingWasNotAssigned")}),"message"===t&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eF,{children:r("theMessageWasDisplayed",{message:"".concat(i)})}),(0,n.jsx)(eM,{size:"small",onClick:o,children:r("previewMessage")})]}),"redirect"===t&&(0,n.jsx)(eF,{children:r("theUserWasRedirecteTo",{redirectUrl:"".concat(i)})})]})})},ek=i(13235),eE=i(99206),eS=i(41554),eP=i(153),eZ=i(49266),eD=i(12568),eR=i.n(eD),e_=i(56800),eO=function(){let{t:e}=(0,v.$G)(q.l.calendar),t=[e("january"),e("february"),e("march"),e("april"),e("may"),e("june"),e("july"),e("august"),e("september"),e("october"),e("november"),e("december")],i=(0,d.useMemo)(()=>{let e=new Date,t=eR()(e).add(1,"month").startOf("day").toDate();return new e_.C0(e,t)},[]),o=t[i.startDate.getMonth()],r=t[i.endDate.getMonth()],s=o===r,a=i.startDate.getFullYear(),l=i.endDate.getFullYear(),c=a===l,p=i.getDates(),g=new Date,h=[e("weekDaySun"),e("weekDayMon"),e("weekDayTue"),e("weekDayWed"),e("weekDayThu"),e("weekDayFri"),e("weekDaySat")];return(0,n.jsxs)(ez,{className:"time-slots-wrapper",children:[(0,n.jsxs)(eA,{children:[(0,n.jsxs)(e$,{children:[(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eL,{children:o}),(!c||s)&&(0,n.jsx)(eB,{children:a}),!s&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(eL,{children:[" - ",r]}),(0,n.jsx)(eB,{children:l})]})]}),(0,n.jsx)(u.ZP,{type:"text",size:"small",icon:(0,n.jsx)(eS.Z,{})})]}),(0,n.jsx)(eW,{children:(0,n.jsxs)(eU,{children:[(0,n.jsx)(u.ZP,{type:"text",size:"small",children:(0,n.jsx)(ex.Z.Text,{children:e("today")})}),(0,n.jsx)(u.ZP,{type:"text",size:"small",icon:(0,n.jsx)(eP.Z,{})}),(0,n.jsx)(u.ZP,{type:"text",size:"small",icon:(0,n.jsx)(eZ.Z,{})})]})})]}),(0,n.jsx)(eG,{className:"time-slots-container",children:(0,n.jsx)(eq,{children:p.map(e=>(0,n.jsxs)(eV,{$countToShow:7,$scrollContainerWidth:"".concat(608,"px"),$scrollContainerPadding:0,children:[(0,n.jsx)(eH,{children:(0,n.jsx)(eY,{$isToday:e_._I.isSameDay(g,e),children:h[e.getDay()]})}),(0,n.jsx)(eH,{children:(0,n.jsx)(eQ,{$isToday:e_._I.isSameDay(g,e),children:e.getDate()})})]},"header-".concat(e)))})})]})};let eG=s.ZP.div.withConfig({componentId:"sc-5752b5d2-0"})(["display:flex;position:sticky;top:0;left:0;z-index:1;"]),eq=s.ZP.div.withConfig({componentId:"sc-5752b5d2-1"})(["display:flex;gap:8px;height:68px;padding-top:8px;background:",";"],e=>{let{theme:t}=e;return t.colorBgContainer}),ez=s.ZP.div.withConfig({componentId:"sc-5752b5d2-2"})(["display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%;height:100%;padding-top:12px;padding-left:16px;padding-right:16px;box-sizing:border-box;overflow:hidden;"]),eA=s.ZP.div.withConfig({componentId:"sc-5752b5d2-3"})(["display:flex;justify-content:space-between;align-items:center;width:100%;"]),e$=s.ZP.div.withConfig({componentId:"sc-5752b5d2-4"})(["display:flex;align-items:center;gap:8px;"]),eL=(0,s.ZP)(ex.Z.Text).withConfig({componentId:"sc-5752b5d2-5"})(["font-size:20px;line-height:100%;text-align:center;"]),eB=(0,s.ZP)(ex.Z.Text).withConfig({componentId:"sc-5752b5d2-6"})(["font-size:20px;line-height:100%;opacity:0.6;"]),eU=s.ZP.div.withConfig({componentId:"sc-5752b5d2-7"})(["display:flex;> *{flex-shrink:0;}"]),eW=s.ZP.div.withConfig({componentId:"sc-5752b5d2-8"})(["display:flex;gap:12px;"]),eV=s.ZP.div.withConfig({componentId:"sc-5752b5d2-9"})(["display:flex;flex-direction:column;justify-content:center;gap:4px;padding:6px 0;width:calc( "," );flex-shrink:0;"],e=>{let{$scrollContainerWidth:t,$scrollContainerPadding:i,$countToShow:n}=e;return"(".concat(t," - ").concat(i,"px) / ").concat(n," - 8px + 8px / ").concat(n)}),eH=s.ZP.div.withConfig({componentId:"sc-5752b5d2-10"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;"]),eY=(0,s.ZP)(ex.Z.Text).withConfig({componentId:"sc-5752b5d2-11"})(["font-size:12px;color:",";"],e=>{let{$isToday:t,theme:i}=e;return t?i.colorTextBase:i.colorText}),eQ=(0,s.ZP)(ex.Z.Text).withConfig({componentId:"sc-5752b5d2-12"})(["position:relative;padding:0 3px;font-size:20px;font-weight:",";line-height:1.3;color:",";",""],e=>{let{$isToday:t}=e;return t?600:400},e=>{let{$isToday:t,theme:i}=e;return t?i.colorBgContainer:i.colorText},e=>{let{$isToday:t}=e;return t&&(0,s.iv)(["border-radius:5px;background-color:",";"],e=>{let{theme:t}=e;return t.colorTextBase})});var eX=i(61672),eJ=i(91090),eK=i(20264),e0=i(99260),e1=i(30217),e2=i(22706),e5=i(76055),e4=function(e){var t,i;let{multiUseBookingPage:o,teamMembers:r,onCloseButtonClick:s}=e,{t:a}=(0,v.$G)(q.l.embed),{token:l}=(0,ej.F)(),c=r.reduce((e,t)=>({...e,[t.userId]:t}),{}),u="roundRobin"===o.meetingType?(e=>{let t=Math.floor(Math.random()*e.length),i=e.find((e,i)=>i===t);if(i)return c[i.id]})(o.organizers):(null===(t=o.organizers[0])||void 0===t?void 0:t.id)?c[o.organizers[0].id]:void 0,p=o.organizers.find(e=>e.id===(null==u?void 0:u.userId)),g=(e=>{let t=Math.floor(Math.random()*e.length);return e[t]})(null!==(i=null==p?void 0:p.meetingMethods)&&void 0!==i?i:[]),h=(0,d.useCallback)(()=>{var e;return(0,n.jsxs)(eX.Z,{color:l.colorFillSecondary,children:[null!==(e=null==g?void 0:g.length)&&void 0!==e?e:0," ",a("minutes")]})},[null==g?void 0:g.length,a,l.colorFillSecondary]),m=(0,d.useCallback)(()=>(0,n.jsx)(eX.Z,{color:l.colorFillSecondary,children:g&&(0,n.jsx)(e2.vj,{type:g.type,customLink:(0,e5.Ko)(g)?g.value:void 0,fontSize:14,color:l.colorText})}),[g,l.colorFillSecondary,l.colorText]);return(0,n.jsxs)(e7,{children:[(0,n.jsx)(e8,{type:"text",icon:(0,n.jsx)(eK.Z,{}),onClick:s}),(0,n.jsx)(te,{shape:"square",size:80,src:(0,e1.g)(o.organizers[0].id),icon:(0,n.jsx)(e0.Z,{})}),(0,n.jsxs)(tt,{children:[(0,n.jsx)(e9,{strong:!0,children:null==u?void 0:u.displayName}),(0,n.jsxs)(e6,{children:[(0,n.jsx)(ti,{children:(0,n.jsx)(v.cC,{components:{meet:(0,n.jsx)(m,{}),length:(0,n.jsx)(h,{}),text:(0,n.jsx)(ex.Z.Text,{})},children:a("meetingTimeDescription")})}),(0,n.jsx)(tn,{children:(0,n.jsx)(ex.Z.Paragraph,{children:p&&p.description})})]})]})]})};function e6(e){let{className:t,children:i}=e;return(0,n.jsx)(e3,{className:t,children:i})}let e3=s.ZP.div.withConfig({componentId:"sc-38a628f4-0"})(["padding:14px;border-radius:0 16px 16px 16px;background:",";box-shadow:0px 1px 5px rgba(6,29,64,0.04),0px 1px 20px rgba(4,19,56,0.05);box-sizing:border-box;"],e=>{let{theme:t}=e;return t.colorBgElevated}),e7=s.ZP.div.withConfig({componentId:"sc-38a628f4-1"})(["padding:20px 32px;display:flex;gap:20px;width:640px;box-sizing:border-box;margin:auto 0;.recatch-ant-tag{margin:0;padding:2px 6px;max-width:300px;color:",";font-size:","px;overflow:auto;}"],e=>{let{theme:t}=e;return t.colorText},e=>{let{theme:t}=e;return t.fontSize}),e8=(0,s.ZP)(u.ZP).withConfig({componentId:"sc-38a628f4-2"})(["position:absolute;top:8px;right:8px;"]),e9=(0,s.ZP)(ex.Z.Text).withConfig({componentId:"sc-38a628f4-3"})(["font-size:","px;"],e=>{let{theme:t}=e;return t.fontSizeLG}),te=(0,s.ZP)(eJ.C).withConfig({componentId:"sc-38a628f4-4"})(["flex-shrink:0;border-radius:12px !important;"]),tt=s.ZP.div.withConfig({componentId:"sc-38a628f4-5"})(["flex:1;display:flex;flex-direction:column;gap:6px;"]),ti=s.ZP.div.withConfig({componentId:"sc-38a628f4-6"})(["display:flex;align-items:center;flex-wrap:wrap;gap:4px;padding-bottom:12px;"]),tn=s.ZP.div.withConfig({componentId:"sc-38a628f4-7"})(["max-height:66px;overflow:auto;white-space:pre-wrap;"]);var to=function(e){let{teamMembers:t,multiUseBookingPage:i,onCloseButtonClick:o}=e,{i18n:r}=(0,v.$G)(),{isDarkMode:s}=(0,l.F)(),a="ko"===r.language?s?eE.Gb6:eE.nzj:s?eE.yPr:eE.rCi;return(0,n.jsx)(tl,{children:(0,n.jsx)(tr,{children:(0,n.jsxs)(ts,{children:[i instanceof ek.Q&&(0,n.jsx)(e4,{teamMembers:t,multiUseBookingPage:i,onCloseButtonClick:o}),(0,n.jsx)(eO,{}),(0,n.jsx)(ta,{src:a,alt:"booking-preview"})]})})})};let tr=s.ZP.div.withConfig({componentId:"sc-74b64b7c-0"})(["position:relative;display:flex;flex-direction:column;height:100%;overflow:auto;z-index:10000;-ms-overflow-style:none;scrollbar-width:none;::-webkit-scrollbar{display:none;}> *:first-child{flex-shrink:0;}"]),ts=s.ZP.div.withConfig({componentId:"sc-74b64b7c-1"})(["position:relative;width:100%;display:flex;flex-direction:column;align-items:center;background:",";"],e=>{let{theme:t}=e;return t.colorBgContainer}),ta=s.ZP.img.withConfig({componentId:"sc-74b64b7c-2"})(["width:100%;"]),tl=s.ZP.div.withConfig({componentId:"sc-74b64b7c-3"})(["max-height:100%;border-radius:20px;overflow:hidden;"]);var td=i(5530),tc=function(e){let{message:t}=e;return(0,n.jsxs)(tu,{children:[(0,n.jsx)(tg,{children:(0,n.jsx)(td.Z,{})}),(0,n.jsx)(tp,{children:t})]})};let tu=s.ZP.div.withConfig({componentId:"sc-739f8d84-0"})(["display:flex;width:300px;height:300px;padding:32px 20px 24px 20px;flex-direction:column;justify-content:center;align-items:center;gap:24px;flex-shrink:0;border-radius:20px;background:",";box-shadow:0px 5px 30px 0px rgba(0,0,0,0.1);"],e=>{let{theme:t}=e;return t.colorBgElevated}),tp=(0,s.ZP)(ex.Z).withConfig({componentId:"sc-739f8d84-1"})(["font-size:","px;"],e=>{let{theme:t}=e;return t.fontSizeXL}),tg=s.ZP.div.withConfig({componentId:"sc-739f8d84-2"})(["display:flex;align-items:center;justify-content:center;svg{font-size:74px;padding:3px;color:",";}"],e=>{let{theme:t}=e;return t.colorSuccess});var th=i(71031),tm=i(52905),tf=i(48609),tx=i(15438),tb=i(79912),ty=function(e){let{formFields:t,onTestClick:i}=e,{t:o}=(0,v.$G)(q.l.entryNode);return(0,n.jsx)(tF,{children:(0,n.jsxs)(th.Z,{layout:"vertical",onFinish:e=>{i(e)},children:[(0,n.jsx)(tw,{children:(0,n.jsx)(tj,{children:o("routingTest")})}),(0,n.jsx)(tT,{children:t.map(e=>{var t;let i="fullName"===e.reservedFieldName||"firstName"===e.reservedFieldName||"lastName"===e.reservedFieldName||"email"===e.reservedFieldName;return(0,n.jsxs)(tv,{label:(0,n.jsx)(tC,{required:i,children:e.name}),children:[(0,tb.E0)(e)&&(0,n.jsx)(tv,{name:e.name,rules:[{...i&&{required:!0,message:""}}],children:(0,n.jsx)(O.default,{size:"large"})}),(0,tb.lI)(e)&&(0,n.jsx)(tv,{name:e.name,children:(0,n.jsx)(tm.Z,{size:"large",type:"number",style:{width:"100%"}})}),(0,tb.Pr)(e)&&(0,n.jsx)(tv,{name:e.name,valuePropName:"checked",children:(0,n.jsx)(tf.Z,{children:e.name})}),(0,tb.O6)(e)&&(0,n.jsx)(tv,{name:e.name,children:(0,n.jsx)(tx.default,{options:null===(t=e.options)||void 0===t?void 0:t.map(e=>({value:e,label:e}))})})]},e.name)})}),(0,n.jsx)(tI,{children:(0,n.jsx)(u.ZP,{size:"large",type:"primary",htmlType:"submit",children:o("requestADemo")})})]})})};let tv=(0,s.ZP)(th.Z.Item).withConfig({componentId:"sc-5b6d4fd1-0"})(["margin:0;.recatch-ant-form-item-label{padding-bottom:4px;}"]),tC=s.ZP.label.withConfig({componentId:"sc-5b6d4fd1-1"})(["position:relative;color:",";",""],e=>{let{theme:t}=e;return t.colorTextSecondary},e=>{let{required:t}=e;return t&&(0,s.iv)(["::after{position:absolute;content:'*';transform:translateX(2px);color:",";}"],e=>{let{theme:t}=e;return t.colorError})}),tw=s.ZP.div.withConfig({componentId:"sc-5b6d4fd1-2"})(["display:flex;align-items:center;justify-content:center;padding:10px;"]),tj=(0,s.ZP)(ex.Z.Text).withConfig({componentId:"sc-5b6d4fd1-3"})(["font-size:","px;font-weight:","px;font-weight:600;"],e=>{let{theme:t}=e;return t.fontSizeHeading4},e=>{let{theme:t}=e;return t.lineHeightHeading4}),tT=s.ZP.div.withConfig({componentId:"sc-5b6d4fd1-4"})(["display:flex;flex-direction:column;padding:16px;gap:16px;"]),tI=s.ZP.div.withConfig({componentId:"sc-5b6d4fd1-5"})(["display:flex;flex-direction:column;padding:16px;"]),tF=s.ZP.div.withConfig({componentId:"sc-5b6d4fd1-6"})(["background-color:",";border-radius:20px;border:1px solid rgba(255,255,255,0.1);"],e=>{let{theme:t}=e;return t.colorBgLayout});function tM(e){let{edgeProps:{sourceX:t,sourceY:i,targetX:r,targetY:s,sourcePosition:a,targetPosition:l,style:d={},markerEnd:c}}=e,[u]=(0,o.OQ)({sourceX:t,sourceY:i,sourcePosition:a,targetX:r,targetY:s,targetPosition:l});return(0,n.jsx)(o.u5,{path:u,markerEnd:c,style:d})}var tN=i(52043),tk=i(87883),tE=i(33503),tS=i(79497),tP=i(56207),tZ=i(47705),tD=i(1340),tR=i(5703),t_=function(e){let{data:t,teamMembers:i,editingResultSetting:r,errors:s,warnings:c,onAddGroup:p,onDisqualifiedClick:g,onGroupClick:h,onAttendeesChange:m,onGroupRemove:f}=e,{t:b}=(0,v.$G)(q.l.flow),[y,C]=es.Z.useModal(),{isDarkMode:w}=(0,l.F)(),{featureFlags:{useNewAccessRequestStepAddition:j}}=(0,U.Ty)(),T=(e,t)=>{e.stopPropagation(),h(t)},I=(e,t)=>{e.stopPropagation(),y.confirm({title:b("deleteGroup"),content:b("deleteGroupConfirmation"),okText:b("delete"),cancelText:b("cancel"),closable:!0,onOk:()=>f(t)})},F=(0,d.useCallback)(()=>(0,x.of)(i),[i]),N=i.reduce((e,t)=>({...e,[t.userId]:t}),{}),k=r?"__editing-group__":"";return(0,n.jsx)(l.Z,{defaultMode:w?"dark":"light",children:(0,n.jsxs)(tO,{children:[C,(0,n.jsx)(tW,{className:k}),(0,n.jsxs)(tG,{children:[(0,n.jsx)(tq,{className:k,children:b("assignMeetings")}),(0,n.jsxs)(tz,{children:[0===t.groups.length?(0,n.jsx)(tX,{children:b("emptyGroupMessage")}):t.groups.map((e,t)=>{var i,l,d,p,g,h,f,x;if("creating"===e)return(0,n.jsx)(a.TK,{},"creating-group-".concat(t));let y=null!==(h=null==s?void 0:null===(l=s.groupErrors)||void 0===l?void 0:null===(i=l[e.id])||void 0===i?void 0:i.calendarToAddEvent)&&void 0!==h?h:null==s?void 0:null===(p=s.groupErrors)||void 0===p?void 0:null===(d=p[e.id])||void 0===d?void 0:d.calendarsToCheckConflict,v=e=>(null==e?void 0:e.type)==="noPermission"||(null==e?void 0:e.type)==="noTokenOnServer",C=e=>{if(void 0===e)return!1;if("type"in e)return v(e);if("object"==typeof e)for(let t in e){let i=e[t];if(i&&v(i))return!0}return!1};return(0,n.jsxs)(t$,{className:"recatch__workflow__flow__group",highlight:(null==r?void 0:r.groupId)===e.id,onClick:t=>T(t,e),$hasWarning:null!==(f=null==c?void 0:c[e.id])&&void 0!==f&&f,$hasError:C(y),children:[(0,n.jsxs)(tB,{className:"button-setting",children:[(0,n.jsx)(u.ZP,{type:"text",icon:(0,n.jsx)(tE.Z,{})}),(0,n.jsx)(u.ZP,{type:"text",icon:(0,n.jsx)(tS.Z,{}),onClick:t=>I(t,e)})]}),(0,n.jsxs)(tL,{$hasWarning:null!==(x=null==c?void 0:c[e.id])&&void 0!==x&&x,$hasError:C(y),children:[(C(y)||(null==c?void 0:c[e.id]))&&(0,n.jsx)(M.Z,{}),b("assigneeGroup")," ",t+1]}),(0,n.jsx)(tU,{onClick:e=>e.stopPropagation(),children:(0,n.jsx)(tD.P,{organizer:"roundRobin"===e.meetingType?void 0:(null===(g=e.organizers[0])||void 0===g?void 0:g.id)?N[e.organizers[0].id]:void 0,attendees:(0,tR.Z)([...e.organizers.map(e=>{let{id:t}=e;return N[t].email}),...e.attendees.map(e=>{let{email:t}=e;return t})]),showChangeOrganizerButton:!1,isActiveMember:j?e=>("ADMIN"===e.teamMemberRole||"MEMBER"===e.teamMemberRole)&&"ACTIVE"===e.teamMemberStatus:()=>!0,getTeamMembers$:F,onChange:e=>m(t,e)})}),(0,n.jsx)(ey.C,{type:"target",id:e.id,position:o.Ly.Left})]},e.id)}),(0,n.jsx)(u.ZP,{icon:(0,n.jsx)(tP.Z,{}),className:k,onClick:p,children:b("addAssigneeGroup")})]}),(0,n.jsx)(tV,{className:k}),(0,n.jsxs)(tH,{children:[(0,n.jsx)(tq,{className:k,children:b("disqualifiedTitle")}),(0,n.jsx)(tY,{className:k,placement:"topRight",title:b("disqualifiedHelpTitle"),content:b("disqualifiedHelpDescription"),overlayStyle:{width:240},children:(0,n.jsx)(u.ZP,{icon:(0,n.jsx)(tK,{}),size:"small"})})]}),(0,n.jsxs)(tQ,{$highlight:(null==r?void 0:r.type)==="disqualified",$hasError:!!(null==s?void 0:s.disqualifiedResult),onClick:e=>{e.stopPropagation(),g()},children:[(0,n.jsx)(ey.C,{type:"target",id:X.M.DISQUALIFIED_HANDLE_ID,position:o.Ly.Left}),(0,n.jsxs)(tJ,{children:[(0,n.jsx)(tN.go,{children:"message"===t.disqualifiedResultSettings.selectedType?b("disqualifiedOutputMessageTitle"):b("disqualifiedOutputRedirectUrlTitle")}),(0,n.jsx)(tN.Q1,{children:"message"===t.disqualifiedResultSettings.selectedType?t.disqualifiedResultSettings.message:t.disqualifiedResultSettings.redirectUrl})]}),(0,n.jsx)(tB,{className:"button-setting",children:(0,n.jsx)(u.ZP,{type:"text",icon:(0,n.jsx)(tE.Z,{})})})]})]})]})})};let tO=s.ZP.div.withConfig({componentId:"sc-ca9b721b-0"})(["width:","px;display:flex;transition:visibility 0.3s;.__editing-group__{visibility:hidden;}"],265),tG=s.ZP.div.withConfig({componentId:"sc-ca9b721b-1"})(["padding:24px 0;flex:1;display:flex;flex-direction:column;align-items:center;"]),tq=(0,s.ZP)(tN.MQ).withConfig({componentId:"sc-ca9b721b-2"})(["margin-bottom:12px;font-weight:600;"]),tz=s.ZP.div.withConfig({componentId:"sc-ca9b721b-3"})(["position:relative;width:200px;display:flex;flex-direction:column;gap:6px;"]),tA=s.ZP.div.withConfig({componentId:"sc-ca9b721b-4"})(["background:",";border:1px solid ",";border-radius:6px;.button-setting{opacity:0;}&:hover{.button-setting{opacity:1;}}"],e=>{let{theme:t}=e;return t.colorBgElevated},e=>{let{theme:t}=e;return t.colorBorderSecondary}),t$=(0,s.ZP)(tA).withConfig({componentId:"sc-ca9b721b-5"})(["position:relative;padding:8px;box-sizing:border-box;border:1px solid ",";",""],e=>{let{$hasError:t,$hasWarning:i,theme:n}=e;return t?n.colorError:i?n.colorWarning:n.colorBorder},e=>{let{highlight:t,$hasWarning:i,$hasError:n}=e;return t&&(0,s.iv)(["border:1px solid ",";"],e=>{let{theme:t}=e;return n?t.colorError:i?t.colorWarning:t.colorTextSecondary})}),tL=(0,s.ZP)(tN.go).withConfig({componentId:"sc-ca9b721b-6"})(["display:flex;gap:8px;color:",";"],e=>{let{theme:t,$hasError:i,$hasWarning:n}=e;return i?t.colorError:n?t.colorWarning:t.colorTextPrimary}),tB=s.ZP.div.withConfig({componentId:"sc-ca9b721b-7"})(["position:absolute;top:-16px;right:-16px;background-color:",";border-radius:8px;border:1px solid ",";padding:4px;"],e=>{let{theme:t}=e;return t.colorBgElevated},e=>{let{theme:t}=e;return t.colorBorder}),tU=s.ZP.div.withConfig({componentId:"sc-ca9b721b-8"})([".recatch-ant-select-selection-overflow{overflow:hidden;}"]),tW=s.ZP.div.withConfig({componentId:"sc-ca9b721b-9"})(["width:1px;background:linear-gradient( 180deg,rgba(255,255,255,0) 0%,rgba(255,255,255,0.16) 14.44%,rgba(255,255,255,0.16) 88.19%,rgba(255,255,255,0) 100% );"]),tV=s.ZP.div.withConfig({componentId:"sc-ca9b721b-10"})(["margin:32px 0;width:240px;height:1px;background:linear-gradient( 90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,0.16) 14.44%,rgba(255,255,255,0.16) 88.19%,rgba(255,255,255,0) 100% );"]),tH=s.ZP.div.withConfig({componentId:"sc-ca9b721b-11"})(["position:relative;display:flex;justify-content:center;width:200px;"]),tY=(0,s.ZP)(tk.Z).withConfig({componentId:"sc-ca9b721b-12"})(["position:absolute;top:0;right:0;"]),tQ=(0,s.ZP)(tA).withConfig({componentId:"sc-ca9b721b-13"})(["position:relative;width:200px;padding:8px;display:flex;flex-direction:column;gap:10px;box-sizing:border-box;border:1px solid ",";"],e=>{let{$hasError:t,$highlight:i,theme:n}=e;return t?n.colorError:i?n.colorTextSecondary:n.colorBorder}),tX=(0,s.ZP)(tN.gH).withConfig({componentId:"sc-ca9b721b-14"})(["text-align:center;padding-bottom:6px;"]),tJ=s.ZP.div.withConfig({componentId:"sc-ca9b721b-15"})(["display:flex;flex-direction:column;padding:0 4px;"]),tK=(0,s.ZP)(tZ.Z).withConfig({componentId:"sc-ca9b721b-16"})(["color:",";"],e=>{let{theme:t}=e;return t.colorPrimary}),t0="recatch-form-node",t1=e=>e.type.includes("mouse");function t2(e){var t;let{routerId:i,workflowManager:r,user$:s,primaryCalendar$:a,calendarsByAccount$:l,step:u,editingGroupId:g,nodeRenderers:{nodeBoxNode:f=e=>{let{formField:t,getLabelOfOption:i}=e;return(0,n.jsx)(ef.Q3,{formField:t,getLabelOfOption:i})},conditionsNode:x=e=>{let{nodeProps:t,getLabelOfOption:i,onSave:o,onRemove:r}=e;return(0,n.jsx)(ef.qR,{...t,getLabelOfOption:i,onSave:o,onRemove:r})},entryNode:w=e=>{let{nodeProps:t,onTestClick:i}=e;return(0,n.jsx)(ev,{...t,onTestClick:i})}}={},getLabelOfOption:j=(e,t)=>t,routingTestFormRenderer:T=ty,createMultiUseBookingPage:I,onStepChange:F,getTeamMembers$:M,getMeAsTeamMember$:N}=e,{t:k}=(0,v.$G)(q.l.testResult),[E,S]=(0,d.useState)(null),[P,Z]=(0,d.useState)(!1),[D,R]=(0,d.useState)(),[_,O]=(0,d.useState)(),[G,z]=(0,d.useState)(!1),[A,$]=(0,d.useState)(!1),[L,B]=eo.ZP.useNotification({top:200}),{featureFlags:{selectSpecificRecordTypeInForm:W}}=(0,U.Ty)(),[,V]=er.ZP.useMessage({top:190}),H=(0,d.useRef)({connected:!0,startX:0,startY:0}),{sendEvent:Y}=(0,el.X)(),Q=(0,d.useMemo)(()=>r.getFormFields$(),[r]),J=(0,d.useMemo)(()=>(0,ei.D)((0,en.z)(M())),[M]),K=(0,d.useMemo)(()=>(0,c.a)([s,a,l,M()]),[s,a,l,M]),ee=(0,d.useMemo)(()=>r.values$.pipe((0,m.h)(y.L),(0,h.U)(e=>{let{edges:t}=e;return t.filter(e=>e.target===X.M.RESULT_NODE_ID&&e.targetHandle!==X.M.DISQUALIFIED_HANDLE_ID)})),[r]),et=e=>{H.current={connected:!1,startX:e.clientX,startY:e.clientY}},ed=(0,d.useCallback)(()=>{"result"===u&&(F("flow"),r.leaveEditingGroupMode())},[F,u,r]),ec=(0,d.useCallback)((e,t)=>{H.current.connected=!0,r.disconnect([e]),r.connect(t)},[r]),eu=(0,d.useCallback)((e,t)=>{if(t1(e)){let i=Math.abs(H.current.startX-e.clientX)>20||Math.abs(H.current.startY-e.clientY)>20;!1===H.current.connected&&i&&r.disconnect([t])}H.current.connected=!0},[r]),ep=(0,d.useCallback)(async()=>{let e=await (0,en.z)(N()),t=await (0,en.z)(a),i=r.addCreatingGroup(),n=await I({calendarToAddEvent:t,createdBy:e});r.setGroup(i,n)},[I,N,a,r]),eg=(0,d.useCallback)(e=>{r.setDisqualifiedResult(e)},[r]),eh=(0,d.useCallback)((e,t)=>{r.setConditions(e,t)},[r]),ex=(0,d.useCallback)(e=>{r.removeNode(e)},[r]),eb=(0,d.useCallback)(e=>(0,n.jsx)(x,{nodeProps:e,getLabelOfOption:j,onSave:eh,onRemove:ex}),[x,j,ex,eh]),ey=(0,d.useCallback)(e=>{F("result",e.id),r.enterEditingGroupMode()},[F,r]),eC=(0,d.useCallback)(e=>{r.removeGroup(e.id)},[r]),ew=(0,d.useCallback)(async(e,t)=>{let i=r.getGroups()[e];if("string"==typeof i)return;let n=r.getGroupValuesManager(i.id);n.changeAttendeesAndOrganizers(t);let o=n.getDataToCopy(),s=i.copyWith(o);r.updateGroup(s)},[r]),ej=(0,d.useMemo)(()=>(0,c.a)([J,r.errors$.pipe((0,C.O)(void 0)),r.warnings$.pipe((0,C.O)(void 0))]),[J,r]),eI=(0,d.useCallback)(()=>{F("result"),r.enterEditingGroupMode()},[F,r]),eF=(0,d.useMemo)(()=>!("result"!==u),[u]),eM=(0,d.useCallback)(e=>(0,n.jsx)(p.W,{observable:ej,loader:()=>null,builder:t=>{let[i,o,r]=t;return W?(0,n.jsx)(t_,{...e,teamMembers:i,editingResultSetting:eF?{type:g?"group":"disqualified",groupId:g}:void 0,connectedEdgesToGroup$:ee,errors:o,onAddGroup:ep,onDisqualifiedClick:eI,onGroupClick:ey,onAttendeesChange:ew,onGroupRemove:eC,warnings:r}):(0,n.jsx)(ef.ZR,{...e,teamMembers:i,editingGroupId:g,connectedEdgesToGroup$:ee,errors:o,onAddGroup:ep,onDisqualifiedResultChange:eg,onGroupClick:ey,onAttendeesChange:ew,onGroupRemove:eC,warnings:r})}}),[ee,g,ep,ew,eI,eg,ey,eC,eF,ej,W]),ek=(0,d.useCallback)(()=>{var e;if(!(null===(e=r.values)||void 0===e?void 0:e.nodes.find(e=>e.id===X.M.ENTRY_NODE_ID)).data.next){L.open({type:"error",message:k("assignGroup"),description:k("connectInboundLead"),placement:"top"});return}Z(!0),Y(el.M.RouterPage.MEETING_ASSIGNMENT_ROUTING_TEST_CLICKED,{routerId:i})},[L,i,Y,k,null===(t=r.values)||void 0===t?void 0:t.nodes]),eE=(0,d.useCallback)(e=>(0,n.jsx)(w,{nodeProps:e,onTestClick:ek}),[w,ek]),eS=(0,d.useCallback)((e,t,i)=>{if(!t||!i||!E)return;let n=E.getBoundingClientRect(),o=i.x-n.left,s=i.y-n.top;r.addNode(e.name,{x:o,y:s},!0)},[E,r]),eP=(0,d.useCallback)(()=>{z(!0),L.destroy()},[L]),eZ=(0,d.useCallback)(()=>{$(!0),L.destroy()},[L]),eD=(0,d.useCallback)(e=>{let t;let o=r.routingTest(e),s=o[o.length-1];if("group"===s.type){let e=r.getGroups(),i=e.findIndex(e=>"string"!=typeof e&&e.id===s.id);R(e[i]),t=(0,n.jsx)(eN,{type:s.type,content:"".concat(k("group")," ").concat(i+1),onClick:eP})}"disqualified"===s.type&&(O(s.value),t=(0,n.jsx)(eN,{type:s.dqType,content:s.value,onClick:eZ})),L.success({message:k("routingTestResult"),description:t,placement:"top"}),Z(!1),Y(el.M.RouterPage.MEETING_ASSIGNMENT_ROUTING_TEST_RESULT_VIEWED,{routerId:i,bookingPageId:"group"===s.type?s.id:void 0,disqualifiedType:"disqualified"===s.type?s.dqType:void 0})},[eP,eZ,L,i,Y,k,r]),{setDropRef:eR}=(0,ea.LW)({type:t0,containerId:"".concat(t0,"-container"),onDrop:eS}),e_=(0,d.useMemo)(()=>({[X.M.TEXT_NODE_TYPE]:eb,[X.M.NUMBER_NODE_TYPE]:eb,[X.M.SELECT_NODE_TYPE]:eb,[X.M.CHECKBOX_NODE_TYPE]:eb,[X.M.RESULT_NODE_TYPE]:eM,[X.M.ENTRY_NODE_TYPE]:eE}),[eb,eE,eM]),eO=(0,d.useCallback)(e=>(0,n.jsx)(tM,{edgeProps:e}),[]),eG=(0,d.useMemo)(()=>({[X.M.NORMAL_EDGE_TYPE]:eO,[X.M.HIGHLIGHT_EDGE_TYPE]:eT}),[eO]),[eq,ez]=(0,d.useState)(!0);return(0,n.jsxs)(n.Fragment,{children:[B,V,eq&&(0,n.jsx)(t7,{}),(0,n.jsx)(p.W,{observable:K,loader:()=>null,builder:e=>{let[t,i,s,a]=e;return(0,n.jsx)(o.x$,{onInit:e=>{r.init({reactFlowInstance:e,editingGroupId:g,user:t,teamMembers:a,calendarsByAccount:s,primaryCalendar:i,defaultGroupFormFieldLabels:{name:k("name"),email:k("email")}}),ez(!1)},defaultNodes:[],defaultEdges:[],nodeTypes:e_,edgeTypes:eG,panOnDrag:!eF,zoomOnScroll:!eF,zoomOnDoubleClick:!eF,zoomOnPinch:!eF,ref:e=>{S(e),eR(e)},proOptions:{hideAttribution:!0},onClick:ed,onConnect:r.connect,onEdgesDelete:r.disconnect,onEdgeUpdateStart:et,onEdgeUpdate:ec,onEdgeUpdateEnd:eu,style:{cursor:eF?"pointer":"auto"}})}}),(0,n.jsx)(es.Z,{open:P,onCancel:()=>Z(!1),width:400,centered:!0,closable:!1,footer:null,destroyOnClose:!0,modalRender:e=>(0,n.jsx)(t3,{children:e}),children:(0,n.jsx)(p.W,{observable:Q,loader:()=>(0,n.jsx)(b.T,{}),builder:e=>(0,n.jsx)(T,{formFields:e,getLabelOfOption:j,onTestClick:eD})})}),(0,n.jsx)(es.Z,{open:!!(G&&(null==D?void 0:D.id)),onCancel:()=>z(!1),closable:!1,centered:!0,width:640,footer:null,modalRender:e=>(0,n.jsx)(t3,{children:e}),children:(0,n.jsx)(p.W,{observable:J,loader:()=>(0,n.jsx)(b.T,{}),builder:e=>D&&(0,n.jsx)(to,{teamMembers:e,multiUseBookingPage:D,onCloseButtonClick:()=>z(!1)})})}),(0,n.jsx)(es.Z,{open:A,onCancel:()=>$(!1),closable:!1,centered:!0,width:300,footer:null,destroyOnClose:!0,modalRender:e=>(0,n.jsx)(t3,{children:e}),children:_&&(0,n.jsx)(tc,{message:_})}),(0,n.jsx)(t4,{visible:!eF&&"others"!==u,children:(0,n.jsx)(p.W,{observable:Q,loader:()=>(0,n.jsx)(b.T,{}),builder:e=>(0,n.jsx)(t6,{formFieldsCount:e.length,children:(0,n.jsx)(em,{width:"100%",names:e.map(e=>e.name),nodes:e.map(e=>(0,n.jsx)(f,{formField:e,getLabelOfOption:t=>j(e.name,t)}))})})})})]})}function t5(e){return(0,n.jsx)(ea.WG,{isActivated:!e.isEditingResult&&"flow"===e.step,children:(0,n.jsx)(t2,{...e})})}let t4=s.ZP.div.withConfig({componentId:"sc-676d85ff-0"})(["position:absolute;bottom:0;left:0;width:100%;display:flex;justify-content:center;pointer-events:none;visibility:",";"],e=>{let{visible:t}=e;return t?"visible":"hidden"}),t6=s.ZP.div.withConfig({componentId:"sc-676d85ff-1"})(["max-width:1000px;width:","px;height:120px;pointer-events:all;"],e=>{let{formFieldsCount:t}=e;return t>1?150*t:212}),t3=s.ZP.div.withConfig({componentId:"sc-676d85ff-2"})(["margin:0 auto;.recatch-ant-modal-content{padding:0;background-color:transparent;}"]),t7=s.ZP.div.withConfig({componentId:"sc-676d85ff-3"})(["position:fixed;width:100vw;height:100vh;background:red;opacity:0;z-index:100;"]),t8="recatch-form-node";function t9(e){let{routerId:t,workflowManager:i,user$:o,primaryCalendar$:s,calendarsByAccount$:l,notCalendarTokens$:g,step:h,editingGroupId:m,nodeRenderers:f,routingTestFormRenderer:x,getLabelOfOption:b,createMultiUseBookingPage:y,onStepChange:v,getTeamMembers$:C,getMeAsTeamMember$:w,appIntegrationConnectButtonRenderer:j}=e,T=(0,d.useMemo)(()=>(0,c.a)([o,l,C()]),[o,l,C]),I=(0,d.useMemo)(()=>"result"===h,[h]),F=(0,d.useCallback)(()=>{v("flow"),i.leaveEditingGroupMode()},[v,i]);return(0,n.jsxs)(ii,{$isEditingResult:I,children:[(0,n.jsx)(it,{}),(0,n.jsx)(io,{children:(0,n.jsx)(t5,{routerId:t,isEditingResult:I,workflowManager:i,user$:o,primaryCalendar$:s,calendarsByAccount$:l,step:h,editingGroupId:m,nodeRenderers:f,routingTestFormRenderer:x,getLabelOfOption:b,createMultiUseBookingPage:y,onStepChange:v,getTeamMembers$:C,getMeAsTeamMember$:w})}),(0,n.jsx)(ir,{children:(0,n.jsx)(is,{className:"group-settings-wrapper",children:(0,n.jsx)(p.W,{observable:T,loader:()=>(0,n.jsx)(a.TK,{}),builder:e=>{let[,t,o]=e;return(0,n.jsx)(ee,{editingGroupId:m,calendarsByAccount:t,teamMembers:o,notCalendarTokens$:g,workflowManager:i,onDoneButtonClick:()=>{},slackIntegrationButtonRenderer:e=>j({provider:"slack",service:"notification",onClick:e})})}})})}),I&&(0,n.jsx)(ia,{children:(0,n.jsx)(u.ZP,{icon:(0,n.jsx)(r.Z,{}),onClick:F})})]})}function ie(e){let{isDarkMode:t}=(0,l.F)();return(0,n.jsx)(o.tV,{children:(0,n.jsx)(l.Z,{defaultMode:t?"dark":"light",children:(0,n.jsx)(t9,{...e})})})}let it=(0,s.vJ)(["body{overflow:hidden;}"]),ii=s.ZP.div.withConfig({componentId:"sc-e919a246-0"})(["width:100%;height:100%;display:flex;background:",";transition:transform 0.2s;"," .react-flow__node-recatch-result-node{z-index:-1 !important;}"],e=>{let{theme:t}=e;return t.colorBgLayout},e=>{let{$isEditingResult:t}=e;return t&&(0,s.iv)(["transform:translateX(calc(-","px - 50%));"],240)}),io=s.ZP.div.withConfig({componentId:"sc-e919a246-1"})(["flex-shrink:0;width:100%;"]),ir=s.ZP.div.withConfig({componentId:"sc-e919a246-2"})(["flex-shrink:0;width:100%;display:flex;justify-content:center;transform:translateX(calc(","px - 50%));z-index:-1;"],240),is=s.ZP.div.withConfig({componentId:"sc-e919a246-3"})(["padding:20px 0 200px 0;width:","px;display:flex;flex-direction:column;gap:23px;align-items:center;box-sizing:border-box;overflow:auto;"],480),ia=s.ZP.div.withConfig({componentId:"sc-e919a246-4"})(["position:fixed;top:15px;right:200px;"])},68003:function(e,t,i){i.d(t,{J:function(){return h}});var n=i(80432),o=i(3056),r=i(91662),s=i(66677),a=i(53845),l=i(55142),d=i(1439),c=i(51068),u=i(96839),p=i(66362);function g(e){let{teamSlug:t,routerId:i,step:o,user$:r,primaryCalendar$:s,calendarsByAccount$:a,notCalendarTokens$:d,editingGroupId:g,createMultiUseBookingPage:h,saveMultiUseBookingPage:m,onStepChange:f,appIntegrationConnectButtonRenderer:x,getMeAsTeamMember$:b,getTeamMembers$:y,onRouterDeleteComplete:v,onConfirmGoBack:C,onConfirmSubmissionNavigation:w,onCopySuccess:j}=e,T=(0,l.h)();return T instanceof c.XK?(0,n.jsx)(u.Z,{inboundRouterFacade:T,teamSlug:t,routerId:i,step:o,user$:r,primaryCalendar$:s,calendarsByAccount$:a,notCalendarTokens$:d,editingGroupId:g,createMultiUseBookingPage:h,saveMultiUseBookingPage:m,onStepChange:f,getTeamMembers$:y,getMeAsTeamMember$:b,appIntegrationConnectButtonRenderer:x,onRouterDeleteComplete:v,onConfirmGoBack:C,onConfirmSubmissionNavigation:w,onCopySuccess:j}):T instanceof c.on?(0,n.jsx)(p.Z,{inboundRouterFacade:T,teamSlug:t,routerId:i,step:o,user$:r,primaryCalendar$:s,calendarsByAccount$:a,notCalendarTokens$:d,editingGroupId:g,createMultiUseBookingPage:h,saveMultiUseBookingPage:m,onStepChange:f,getTeamMembers$:y,getMeAsTeamMember$:b,appIntegrationConnectButtonRenderer:x,onRouterDeleteComplete:v,onConfirmGoBack:C,onConfirmSubmissionNavigation:w,onCopySuccess:j}):null}function h(e){let{useCases:{inboundRouterUseCase:t}}=(0,d.Ty)(),i=(0,o.useMemo)(()=>(0,r.D)(t.getRouter(e.routerId)),[t,e.routerId]);return(0,n.jsx)(s.W,{observable:i,loader:()=>(0,n.jsx)(a.T,{}),builder:t=>(0,n.jsx)(l.Z,{inboundRouter:t,saveMultiUseBookingPage:e.saveMultiUseBookingPage,children:(0,n.jsx)(g,{...e})})})}},19623:function(e,t,i){i.d(t,{dn:function(){return w}}),i(94257),i(93360),i(66362),i(96839);var n=i(80432),o=i(71196),r=i(19027),s=i(37543),a=i(12355),l=i(3056),d=i(34904),c=i(55670),u=i(66531),p=i(86424),g=i(63110);let h=(0,c.ZP)(s.Z).withConfig({componentId:"sc-1bc1e6e9-0"})([".recatch-ant-modal-header{margin-bottom:24px;}.recatch-ant-modal-footer{margin-top:20px;}.recatch-ant-modal-content{padding:24px 20px;}"]),m=(0,c.ZP)(a.ZP).withConfig({componentId:"sc-1bc1e6e9-1"})(["width:100%;"]),f=c.ZP.div.withConfig({componentId:"sc-1bc1e6e9-2"})(["display:flex;flex-direction:column;padding:8px,20px,20px,20px;gap:20px;"]),x=c.ZP.div.withConfig({componentId:"sc-1bc1e6e9-3"})(["display:flex;flex-direction:column;gap:2px;"]),b=c.ZP.div.withConfig({componentId:"sc-1bc1e6e9-4"})(["display:flex;flex-direction:column;gap:10px;"]),y=c.ZP.div.withConfig({componentId:"sc-1bc1e6e9-5"})(["display:flex;flex-direction:column;gap:4px;"]),v=c.ZP.div.withConfig({componentId:"sc-1bc1e6e9-6"})(["display:flex;gap:4px;color:",";"],e=>{let{theme:t}=e;return t.colorTextTertiary}),C=(0,c.ZP)(u.Q1).withConfig({componentId:"sc-1bc1e6e9-7"})(["padding-left:20px;"]);var w=function(e){let{isModalOpen:t,defaultTitle:i,fixedOption:s,onOkButtonClick:a,onOpenStateChange:c}=e,{t:w}=(0,d.$G)(g.l.routersPage),[j,T]=(0,l.useState)(null!=i?i:w("newWorkflow")),[I,F]=(0,l.useState)(null!=s?s:"custom"),[M,N]=(0,l.useState)(!1),k=(0,l.useCallback)(()=>{c(!1)},[c]),E=(0,l.useCallback)(async()=>{N(!0),await a({title:j,formType:I}),c(!1),N(!1)},[I,a,c,j]);return(0,n.jsx)(h,{destroyOnClose:!0,open:t,centered:!0,title:w("createWorkflow"),onOk:E,onCancel:k,confirmLoading:M,width:360,footer:(0,n.jsx)(m,{type:"primary",onClick:E,className:"recatch__workflow__create-workflow-modal__create-button",children:w("proceed")}),children:(0,n.jsxs)(f,{children:[(0,n.jsxs)(x,{children:[(0,n.jsx)(u.MQ,{children:w("workflowName")}),(0,n.jsx)(o.default,{value:j,onChange:e=>{T(e.target.value)}})]}),!s&&(0,n.jsxs)(b,{children:[(0,n.jsxs)(y,{children:[(0,n.jsx)(u.MQ,{children:w("formType")}),(0,n.jsx)(r.Z,{block:!0,size:"large",options:[{label:(0,n.jsx)(u.go,{children:w("createForm")}),value:"custom"},{label:(0,n.jsx)(u.go,{children:w("connectForm")}),value:"mapping"}],value:I,onChange:e=>{("custom"===e||"mapping"===e)&&F(e)}})]}),(0,n.jsxs)(y,{children:[(0,n.jsxs)(v,{children:[(0,n.jsx)(p.Z,{}),(0,n.jsx)(u.Q1,{children:w("custom"===I?"whatIsRecatchForm":"whatIsConnectForm")})]}),(0,n.jsx)(C,{children:w("custom"===I?"recatchFormDescription":"connectFormDescription")})]})]})]})})},j=i(34338),T=i(79295);i(4191),i(99206),i(52043),c.ZP.div.withConfig({componentId:"sc-d5baa2ac-0"})(["padding:16px 16px 12px;display:flex;flex-direction:column;gap:4px;background:",";border-radius:10px;cursor:pointer;border:2px solid transparent;&:hover{border:",";}"],e=>{let{theme:t}=e;return t.colorBgElevated},e=>{let{theme:t}=e;return"2px solid ".concat(t.colorBorder)}),c.ZP.div.withConfig({componentId:"sc-d5baa2ac-1"})(["display:flex;justify-content:space-between;"]),(0,c.ZP)(j.Z.Text).withConfig({componentId:"sc-d5baa2ac-2"})(["font-size:","px;"],e=>{let{theme:t}=e;return t.fontSizeLG}),c.ZP.div.withConfig({componentId:"sc-d5baa2ac-3"})(["display:flex;align-items:center;gap:12px;height:32px;"]),(0,c.ZP)(a.ZP).withConfig({componentId:"sc-d5baa2ac-4"})(["display:flex;align-items:center;justify-content:center;"]),c.ZP.div.withConfig({componentId:"sc-d5baa2ac-5"})(["display:flex;align-items:center;gap:6px;"]),(0,c.ZP)(T.Z).withConfig({componentId:"sc-d5baa2ac-6"})(["margin:0 3px;"]),c.ZP.div.withConfig({componentId:"sc-d5baa2ac-7"})(["color:",";font-size:14px;"],e=>{let{theme:t}=e;return t.colorTextTertiary}),i(68003)},49456:function(e,t,i){i.d(t,{N:function(){return o}});var n=i(33511);class o{static fromModuleConfig(e){var t;let i=e.customFormStyles;if(!this.isValidCustomFormStyles(i)||void 0===e.theme)return;let o=this.sizeFactory(i),r=n.h.getPresetNameFromSize(o);return{theme:e.theme,customSelected:"custom"===r,size:o,buttonSize:this.getButtonPresetNameFromStyle(i),primaryColor:null!==(t=e.primaryColor)&&void 0!==t?t:n.h.getDefaultCustomFormStyleUI().primaryColor}}static toModuleConfig(e){return{theme:e.theme,primaryColor:e.primaryColor,customFormStyles:{title:{fontSize:e.size.titleFontSize},description:{fontSize:e.size.descriptionFontSize},field:{fontSize:e.size.questionFontSize},container:{paddingTop:e.size.gap},titleAndDescContainer:{paddingLeft:e.size.gap,paddingRight:e.size.gap},fieldsContainer:{padding:e.size.gap,gap:e.size.gap},submitButtonContainer:{padding:e.size.gap,paddingTop:e.size.gap},...this.getButtonStyleFromPresetName(e.buttonSize)}}}static isValidCustomFormStyles(e){return!!(e&&e.container&&e.title&&e.description&&e.titleAndDescContainer&&e.field&&e.fieldsContainer&&e.submitButton&&e.submitButtonContainer)}static sizeFactory(e){return this.checkSize(e,16,14,14,16)?n.h.getSizeFromPresetName("small"):this.checkSize(e,20,15,15,20)?n.h.getSizeFromPresetName("medium"):this.checkSize(e,24,17,17,25)?n.h.getSizeFromPresetName("large"):{titleFontSize:this.parseStyleValue(e.title.fontSize,16),descriptionFontSize:this.parseStyleValue(e.description.fontSize,14),questionFontSize:this.parseStyleValue(e.field.fontSize,14),gap:this.hasValidGap(e)?this.parseStyleValue(e.container.paddingTop,16):16}}static parseStyleValue(e,t){if("number"==typeof e)return e;let i=parseInt(e);return isNaN(i)?t:i}static checkSize(e,t,i,n,o){return this.isEqual(e.title.fontSize,t)&&this.isEqual(e.description.fontSize,i)&&this.isEqual(e.field.fontSize,n)&&this.isEqual(e.container.paddingTop,o)&&this.hasValidGap(e)}static hasValidGap(e){return this.isSame(e.container.paddingTop,e.titleAndDescContainer.paddingLeft)&&this.isSame(e.container.paddingTop,e.titleAndDescContainer.paddingRight)&&this.isSame(e.container.paddingTop,e.fieldsContainer.padding)&&this.isSame(e.container.paddingTop,e.fieldsContainer.gap)&&this.isSame(e.container.paddingTop,e.submitButtonContainer.padding)&&this.isSame(e.container.paddingTop,e.submitButtonContainer.paddingTop)}static isEqual(e,t){return e===t||e==="".concat(t,"px")}static isSame(e,t){return"number"==typeof e&&"number"==typeof t||"string"==typeof e&&"string"==typeof t?e===t:"number"==typeof e?"".concat(e,"px")===t:"number"==typeof t&&e==="".concat(t,"px")}static getButtonStyleFromPresetName(e){switch(e){case"small":return{submitButton:{height:40,fontSize:16}};case"medium":return{submitButton:{height:46,fontSize:17}};case"large":return{submitButton:{height:50,fontSize:18}}}}static getButtonPresetNameFromStyle(e){if(e.submitButton){if(40===e.submitButton.height&&16===e.submitButton.fontSize)return"small";if(46===e.submitButton.height&&17===e.submitButton.fontSize)return"medium";if(50===e.submitButton.height&&18===e.submitButton.fontSize)return"large"}return"small"}}},1439:function(e,t,i){i.d(t,{Ln:function(){return C},Ty:function(){return w}});var n=i(80432),o=i(3056),r=i(42362),s=i(77464),a=i(28861);let l=i(57350).B?{apiKey:"AIzaSyDVya4XaOkLObXeZ_Okqb34cP6EG5sVmD4",authDomain:"login.recatch.cc",projectId:"recatch-prod",storageBucket:"recatch-prod.appspot.com",messagingSenderId:"1034739457799",appId:"1:1034739457799:web:7c195d6fca71a544e52fa2",measurementId:"G-1WL4PWT0PM"}:{apiKey:"AIzaSyCZqdZKqfirSVz2E0S0vIRB6xjqAQ6a3gE",authDomain:"login.crackapp.co",databaseURL:"https://crack-370906-default-rtdb.asia-southeast1.firebasedatabase.app",projectId:"crack-370906",storageBucket:"crack-370906.appspot.com",messagingSenderId:"359066739900",appId:"1:359066739900:web:bbe7b4254f075cace45cb9"},d=(0,a.C6)().length?(0,a.Mq)():(0,a.ZF)(l),c=(0,r.v0)(d);(0,s.ad)(d);var u=i(92777),p=i(57803),g=i(33203),h=i(41273);class m extends Error{constructor(){super("Not logged in"),Object.setPrototypeOf(this,new.target.prototype)}}let f=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!c.currentUser)throw new m;return await c.currentUser.getIdToken(e)},x=new g.Z(h.A),b=new p.Z(x),y=new u.Z(b,f),v=(0,o.createContext)({useCases:{inboundRouterUseCase:y},featureFlags:{useNewAccessRequestStepAddition:!1,customFormStyleEnbaled:!1,showWatermarkCheckbox:!1,selectSpecificRecordTypeInForm:!1,makeEmailFieldOptional:!1},repositories:{calendarListRepository:{getByUser:async e=>{throw Error("Not implemented")}},recordTypeRepository:{getAll:async()=>{throw Error("Not implemented")}}}});function C(e){let{diContainer:t,children:i}=e,r=w(),{Provider:s}=v,a=(0,o.useMemo)(()=>({useCases:{...r.useCases,...null==t?void 0:t.useCases},featureFlags:{...r.featureFlags,...null==t?void 0:t.featureFlags},repositories:{...r.repositories,...null==t?void 0:t.repositories}}),[null==t?void 0:t.featureFlags,null==t?void 0:t.useCases,null==t?void 0:t.repositories,r.featureFlags,r.useCases,r.repositories]);return(0,n.jsx)(s,{value:a,children:i})}function w(){return(0,o.useContext)(v)}},21073:function(e,t,i){i.d(t,{NF:function(){return c.N},h_:function(){return d.h},a3:function(){return s},lS:function(){return l.lS},Ty:function(){return a.Ty}}),i(19623);var n=i(80432),o=i(19164),r=i(63110);function s(e){let{children:t}=e;return(0,n.jsx)(o.b,{resources:r.M,children:t})}var a=i(1439);i(51068);var l=i(69672);i(34675),i(32385),i(8489),i(16803);var d=i(33511),c=i(49456)},63110:function(e,t,i){i.d(t,{l:function(){return n},M:function(){return o}});let n={routersPage:"inbound-router/routersPage",form:"inbound-router/form",flow:"inbound-router/flow",editPageLayout:"inbound-router/editPageLayout",condition:"inbound-router/condition",entryNode:"inbound-router/entryNode",testResult:"inbound-router/testResult",embed:"inbound-router/embed",calendar:"inbound-router/calendar",nodeSettingModal:"inbound-router/nodeSettingModal",meetingSetting:"inbound-router/meetingSetting"},o={ko:{[n.routersPage]:{myRouters:"내 라우터",allRouters:"모든 라우터",createRouter:"라우터 만들기",addToYourWebsite:"웹사이트에 추가하기",delete:"삭제",youCantDeleteARouterCreatedBySomeoneElse:"다른 사람이 만든 라우터는 삭제할 수 없습니다.",nameYourRouter:"라우터의 이름을 입력하세요.",createWorkflow:"워크플로우 설정",workflowName:"워크플로우의 이름",formType:"폼 형태",whatIsRecatchForm:"리캐치 폼이 무엇인가요?",recatchFormDescription:"잠재 고객의 정보를 수집할 수 있는 설문 폼입니다. 쉽고 빠르게 만들어서 링크로 공유하거나 홈페이지에 임베딩할 수 있습니다.",whatIsConnectForm:"기존 폼 연동이 무엇인가요?",connectFormDescription:"홈페이지에 이미 만들어둔 폼에 리캐치 예약 페이지를 연동하는 방식입니다. 자체 구축 뿐 아니라 웹플로우, 아임웹 등 웹빌더를 통해 만들어진 폼을 모두 포함합니다.",createForm:"리캐치 폼 만들기",connectForm:"기존 폼 연동하기",newWorkflow:"새로운 워크플로우",proceed:"시작하기",defaultRouterTitle:"{{name}}님의 라우터",pleaseAddRouterTitle:"타이틀을 입력해 주세요.",automatedPrioritizationTitle:"고객을 만나는 최적의 플로우를 만들어보세요.",automatedPrioritizationDescription:"우선순위에 따라 리드를 다르게, 하지만 효율적으로 응대해보세요.",disqualifiedOutputMessagePlaceholder:"제출이 완료되었습니다",deleteRouterTitle:"리드 라우터를 삭제하시겠습니까?",deleteRouterDescription:"이 작업은 되돌릴 수 없습니다.",deleteRouterOkText:"OK",deleteRouterCancelText:"Cancel"},[n.form]:{thisNameAlreadyExists:"name이 중복되었습니다.",pleaseProvideAFieldName:"name을 입력해주세요.",addManually:"직접 추가",mapFormDetails:"내 폼과 리캐치 연동하기",websiteUrl:"폼이 있는 웹페이지 주소",formClass:"폼의 class",mapFormInputs:"입력창과 리캐치 배정 규칙 연동하기",mapFirstNameAndLastNameFieldsSeparately:"성과 이름을 따로 연동합니다.",delete:"삭제하기",addNewInputField:"새 입력창 추가",addAllValuesForThisOptionToSetConditions:"조건을 설정하고싶은 option의 value를 입력하세요",formSetting:"폼 설정",title:"폼 제목",description:"폼 설명",buttonText:"버튼 문구",hideWatermark:"하단 워터마크 숨기기",submit:"제출하기",formTitle:"폼의 제목을 입력해 주세요",formDescription:"폼 설명을 입력해 주세요",inputSubmitButtonText:"버튼 문구를 입력해 주세요",questions:"질문지",pleaseAddYourAnswer:"답변을 입력해 주세요.",pleaseAddAValidEmail:"올바른 이메일을 입력해 주세요.",style:"스타일",light:"라이트",dark:"다크",size:"사이즈",small:"작게",medium:"보통",large:"크게",custom:"사용자 지정",titleFontSize:"제목 폰트 사이즈",descriptionFontSize:"설명 폰트 사이즈",questionFontSize:"질문 폰트 사이즈",spacing:"여백",spacingDescription:"폼의 가장자리와 질문 사이의 너비를 의미합니다.",buttonSize:"버튼 사이즈",primaryColor:"주요 색상"},[n.flow]:{assignMeetings:"미팅 배정",assigneeGroup:"담당자 그룹",addAssigneeGroup:"담당자 그룹 추가",disqualifiedTitle:"미팅 미배정",disqualifiedOutputMessageTitle:"메시지 출력",disqualifiedOutputMessagePlaceholder:"제출이 완료되었습니다",disqualifiedOutputRedirectUrlTitle:"아래 링크로 보내기",disqualifiedHelpTitle:"어떨때 사용하나요?",disqualifiedHelpDescription:"‘담당자 그룹’에 연결한 조건에 해당하지 않는 고객은 미팅 예약 화면 대신, 아래 선택한 화면을 보게 됩니다.",deleteGroup:"이 그룹을 삭제하시겠습니까?",deleteGroupConfirmation:"이 그룹과 연결된 조건과 이 그룹의 예약 페이지 설정도 삭제됩니다.",delete:"삭제하기",cancel:"취소하기",quotaAndQualifyNoteNormal:"정해진 미팅 배정 횟수 초과 시, 자동적으로 미팅 미배정에 연결됩니다.",quotaAndQualifyNoteExceeded:"정해진 배정 횟수 초과로 미팅 배정이 작동하지 않으며, 미팅 미배정으로 연결됩니다.",youCanOnlyConnectToTheFirstGroup:"첫번째 그룹만 연결이 가능합니다.",disqualifiedMessageEmpty:"메세지를 입력해주세요.",disqualifiedLinkEmpty:"URL을 입력해 주세요.",disqualifiedLinkInvalid:"유효하지 않은 URL입니다.",emptyGroupMessage:"폼 답변에 따라 원하는 담당자 그룹에 미팅을 배정할 수 있는 기능입니다.",uponFromSubmission:"폼 제출 완료시",lead:"리드"},[n.editPageLayout]:{submissions:"응답 데이터",save:"저장하기",share:"공유하기",prev:"이전 단계",next:"다음 단계",connectForm:"폼 연동하기",installation:"설치",thereAreUnsavedChanges:"아직 저장되지 않은 수정사항이 있습니다.",exit:"나가기",saveAndExit:"저장하고 나가기",unusedConditions:"사용하지 않는 조건은 사라집니다.",unconnectedNodes:"사용하지 않는 조건은 사라집니다.",checkSave:"저장하시겠습니까?",cancel:"취소하기",invalidConnection:"잘못된 연결입니다.",invalidUrl:"유효한 URL이 아닙니다.",fillFormClass:"폼 class를 채워주세요.",checkFormInput:"폼 연동 인풋을 확인해주세요.",assignGroup:"미팅을 배정해주세요.",connectInboundLead:"고객 문의가 미팅 배정까지 연결되지 않았습니다.",fillWebsiteUrl:"웹페이지 주소를 채워주세요.",deleteRouterTitle:"리드 라우터를 삭제하시겠습니까?",deleteRouterDescription:"이 작업은 되돌릴 수 없습니다.",deleteRouterOkText:"OK",deleteRouterCancelText:"Cancel",apiError:"서버 저장에 실패했습니다.",saved:"저장되었습니다.",saveFailed:"저장에 실패했습니다.",pleaseCheckIfAllRequiredFieldsAreFilledCorrectlyInTheFormSettings:"폼 설정에서 비어있는 필수 입력 항목을 다시 확인해보세요.",buildForm:"폼 만들기",routeLeads:"라우터로 리드 분류하기",setMeetings:"미팅 설정하기",disqualifiedMessageEmpty:"미팅 미배정 메시지를 입력해주세요.",disqualifiedLinkEmpty:"URL을 입력해주세요.",disqualifiedLinkInvalid:"유효하지 않은 URL입니다.",meetingDateRangeIsExpired:"설정해둔 ‘예약 기한'이 지나 예약이 잡히지 않고 있습니다."},[n.condition]:{numberTypeIsEqualTo:"이면",numberTypeIsNotEqualTo:"이 아니면",numberTypeGreaterThan:"보다 크면",numberTypeGreaterThanOrEqualTo:"보다 크거나 같으면",numberTypeLessThan:"보다 작으면",numberTypeLessThanOrEqualTo:"보다 작거나 같으면",numberTypeIsBetween:"사이면",numberTypeIsNotBetween:"사이가 아니면",textTypeIs:"이면",textTypeIsNot:"이(가) 아니면",textTypeContains:"을(를) 포함하면",textTypeDoesNotContain:"을(를) 포함하지 않으면",textTypeStartsWith:"로 시작하면",textTypeEndsWith:"로 끝나면",textTypeIsEmpty:"비어 있으면",textTypeIsNotEmpty:"비어 있지 않으면",selectTypeIs:"이면",selectTypeIsNot:"이 아니면",selectTypeAnyIn:"중 있으면",selectTypeNotIn:"중 없으면",checkboxTypeIsOn:"선택하면",checkboxTypeIsOff:"선택하지 않으면",conditionPrefix:"<name>{{name}}</name> <copula>이(가)</copula>",textCondition:"<value /><operator />",numberConditionBasic:"<value /><operator />",numberConditionBetween:"<min /><copula>와(과)</copula><max /><operator />",selectCondition:"<value /><operator />"},[n.entryNode]:{routingTest:"라우팅 테스트",customerInquiry:"고객 문의",requestADemo:"문의하기",inboundLead:"고객 문의"},[n.testResult]:{routingTestResult:"라우팅 테스트 결과",theMeetingWasAssignedTo:"{{groupName}}에 배정되었습니다.",theMeetingWasNotAssigned:"미팅을 배정하지 않았습니다.",theMessageWasDisplayed:"‘{{message}}' 메시지를 출력했습니다.",theUserWasRedirecteTo:"{{redirectUrl}} 로 리다이렉트 되었습니다.",previewBookingScreen:"예약화면 미리보기",previewMessage:"메시지 미리보기",group:"그룹",assignGroup:"미팅을 배정해주세요.",connectInboundLead:"고객 문의가 미팅 배정까지 연결되지 않았습니다.",name:"이름",email:"이메일"},[n.embed]:{minutes:"분",meetingTimeDescription:"<meet></meet><text> 에서 </text><length></length><text> 동안 진행됩니다.</text>",meetingTimeDescriptionWithoutLocation:"<length></length><text> 동안 진행됩니다.</text>",thisBookingPageIsExpired:"예약 기간이 만료되었습니다.",closeConfirmModalComment:"<comment>지금 나가면</comment><comment>담당자 연락이 늦어질 수 있습니다.</comment><comment>정말 나가시겠습니까?</comment>",closeConfirmModalCancel:"나가기",closeConfirmModalContinue:"계속 예약하기"},[n.calendar]:{january:"1월",february:"2월",march:"3월",april:"4월",may:"5월",june:"6월",july:"7월",august:"8월",september:"9월",october:"10월",november:"11월",december:"12월",jan:"1월",feb:"2월",mar:"3월",apr:"4월",mayShort:"5월",jun:"6월",jul:"7월",aug:"8월",sep:"9월",oct:"10월",nov:"11월",dec:"12월",weekDaySun:"일",weekDayMon:"월",weekDayTue:"화",weekDayWed:"수",weekDayThu:"목",weekDayFri:"금",weekDaySat:"토",time1am:"오전 1시",time2am:"오전 2시",time3am:"오전 3시",time4am:"오전 4시",time5am:"오전 5시",time6am:"오전 6시",time7am:"오전 7시",time8am:"오전 8시",time9am:"오전 9시",time10am:"오전 10시",time11am:"오전 11시",time12pm:"오후 12시",time1pm:"오후 1시",time2pm:"오후 2시",time3pm:"오후 3시",time4pm:"오후 4시",time5pm:"오후 5시",time6pm:"오후 6시",time7pm:"오후 7시",time8pm:"오후 8시",time9pm:"오후 9시",time10pm:"오후 10시",time11pm:"오후 11시",today:"오늘",showAvailability:"빈 일정 보기",eventBlockDateRangeTimeString:"{{startA}} {{startHours}}:{{startMinutes}}-{{endA}} {{endHours}}:{{endMinutes}}",draggedEventBlockDateRangeTimeString:"{{startA}} {{startHours}}:{{startMinutes}} - {{endA}} {{endHours}}:{{endMinutes}}",cannotSelectPastTime:"과거 시간은 선택할 수 없습니다."},[n.nodeSettingModal]:{title:"조건 설정",modalInfo:"위에 있는 조건부터 순차적으로 확인합니다.",addCondition:"조건 추가",cancel:"취소",save:"저장"},[n.meetingSetting]:{assigneeGroup:"담당자 그룹",assigneeInvalidMessage:"담당자를 추가해주세요.",assigneeAssignRule:"담당자 배정 방식",description:"설명",descriptionPlaceholder:"예약 페이지에서 잠재 고객에게 전달할 메세지",meetingLength:"길이",meetingLengthInvalidMessage:"길이를 입력해주세요.",minutes:"분",reminders:"알림",integration:"앱 연결",nextGroup:"다음 그룹",setDateRangeAndBuffers:"기한 및 여유시간 설정",days:"일",hours:"시간",limitMeetingDateRange:"예약 기한 제한",limitMeetingDateRangeDescription:"기간만 예약을 받습니다.",preventShortNotice:"당일 예약 방지",preventShortNoticeDescription1:"예약 시점 기준",preventShortNoticeDescription2:"후부터 예약을 받습니다.",beforeBuffer:"미팅 전 여유 시간",beforeBufferDescription1:"미팅 전",beforeBufferDescription2:"동안 예약을 받지 않습니다.",afterBuffer:"미팅 후 여유 시간",afterBufferDescription1:"미팅 후",afterBufferDescription2:"동안 예약을 받지 않습니다.",basicSettings:"기본 설정",attendees:"참석자",notification:"알림",basic:"기본",recordType:"리드 / 딜 배정"}},en:{[n.routersPage]:{myRouters:"Personal",allRouters:"Team",createRouter:"Create Router",addToYourWebsite:"Add to your website",delete:"Delete",youCantDeleteARouterCreatedBySomeoneElse:"You can't delete a router created by someone else.",nameYourRouter:"Name your router",createWorkflow:"Create Workflow",workflowName:"Workflow Name",formType:"Form Type",whatIsRecatchForm:"What is Re:catch Form?",recatchFormDescription:"Re:catch Form is a simple web form which you can utilize to collect customer information. Try this option to quickly build a simple form that you can embed on website or share as link.",whatIsConnectForm:"What does Connect Existing Form mean?",connectFormDescription:"If you already have a working web form in your website - whether that’s custom built or on a web builder (i.e. Webflow, Framer, etc.) - choose this option to build your workflow on top of your existing web form.",createForm:"Create Form",connectForm:"Connect Form",newWorkflow:"New Workflow",proceed:"Proceed",defaultRouterTitle:"{{name}}'s Router",pleaseAddRouterTitle:"Please add router title.",automatedPrioritizationTitle:"Automated Prioritization",automatedPrioritizationDescription:"Don't lose leads, but also don't consume all of them.<br />Route your sales reps to the most qualified meetings to<br />have the highest chance in their winning scenario.",disqualifiedOutputMessagePlaceholder:"Successfully submitted!",deleteRouterTitle:"Are you sure you want to delete this lead router?",deleteRouterDescription:"This cannot be undone.",deleteRouterOkText:"OK",deleteRouterCancelText:"Cancel"},[n.form]:{thisNameAlreadyExists:"This name already exists.",pleaseProvideAFieldName:"Please provide a field name.",addManually:"Add manually",mapFormDetails:"Map Form Inputs",websiteUrl:"Website URL",formClass:"Form class",mapFormInputs:"Map Form Inputs",mapFirstNameAndLastNameFieldsSeparately:"Map First name and Last name fields separately",delete:"Delete",addNewInputField:"Add new input field",addAllValuesForThisOptionToSetConditions:"Add all values for this option to set conditions.",formSetting:"Form Setting",title:"Form title",description:"Form description",buttonText:"Button text",hideWatermark:"Hide watermark",submit:"Submit",formTitle:"Form title",formDescription:"Form description",inputSubmitButtonText:"Form submit button text",questions:"Questions",pleaseAddYourAnswer:"Please add your answer.",pleaseAddAValidEmail:"Please add a valid email.",style:"Style",light:"Light",dark:"Dark",size:"Size",small:"Small",medium:"Medium",large:"Large",custom:"Custom",titleFontSize:"Title font size",descriptionFontSize:"Description font size",questionFontSize:"Question font size",spacing:"Spacing",spacingDescription:"Spacing is the the width between the form’s border and the question.",buttonSize:"Button size",primaryColor:"Primary color"},[n.flow]:{assignMeetings:"Assign meetings",assigneeGroup:"Assignee Group",addAssigneeGroup:"Add assignee group",disqualifiedTitle:"Disqualified",disqualifiedOutputMessageTitle:"Display a message",disqualifiedOutputMessagePlaceholder:"Successfully submitted!",disqualifiedOutputRedirectUrlTitle:"Redirect to a URL",disqualifiedHelpTitle:'How to use "Disqualified"',disqualifiedHelpDescription:"If your lead is not included in conditions that are connected to an Assignee Group, they will see the following screen.",deleteGroup:"Are you sure you want to delete this group?",deleteGroupConfirmation:"All conditions and booking page settings for this group will be deleted.",delete:"Delete",cancel:"Cancel",quotaAndQualifyNoteNormal:"When the number of leads routed exceeds your quota, they will be disqualified.",quotaAndQualifyNoteExceeded:"You have exceeded your quota for lead routing. Your leads will be disqualified.",youCanOnlyConnectToTheFirstGroup:"You can only connect to the first group.",disqualifiedMessageEmpty:"Please fill in a message.",disqualifiedLinkEmpty:"Please fill in a URL.",disqualifiedLinkInvalid:"The URL is invalid",emptyGroupMessage:"Assign your leads to a specific Assignee Group based on their responses to the form.",uponFromSubmission:"Upon form submission",lead:"lead"},[n.editPageLayout]:{submissions:"Submissions",save:"Save",share:"Share",prev:"Prev",next:"Next",connectForm:"Connect form",installation:"Installation",thereAreUnsavedChanges:"There are unsaved changes.",exit:"Exit",saveAndExit:"Save and exit",unusedConditions:"Unused conditions will be deleted.",unconnectedNodes:"Unused conditions will be deleted.",checkSave:"Continue to save?",cancel:"Cancel",invalidConnection:"Your meeting assignment connections are invalid.",invalidUrl:"Your Website URL is invalid.",fillFormClass:"Please fill in your Form Class.",checkFormInput:"Please check your Form Inputs.",assignGroup:"Meeting group unassigned.",connectInboundLead:"Please connect your inbound leads into a meeting group.",fillWebsiteUrl:"Please fill in your website URL.",deleteRouterTitle:"Are you sure you want to delete this lead router?",deleteRouterDescription:"This cannot be undone.",deleteRouterOkText:"OK",deleteRouterCancelText:"Cancel",apiError:"Failed to save changes.",saved:"Saved.",saveFailed:"Failed to save.",pleaseCheckIfAllRequiredFieldsAreFilledCorrectlyInTheFormSettings:"Please check if all required fields are filled correctly in the form settings",buildForm:"Build form",routeLeads:"Route leads",setMeetings:"Set meetings",disqualifiedMessageEmpty:"Please fill in your message",disqualifiedLinkEmpty:"Please fill in a URL.",disqualifiedLinkInvalid:"The URL is invalid.",meetingDateRangeIsExpired:"The meeting date range for this booking page has expired."},[n.condition]:{numberTypeIsEqualTo:"is equal to",numberTypeIsNotEqualTo:"is not equal to",numberTypeGreaterThan:"greater than",numberTypeGreaterThanOrEqualTo:"greater than or equal to",numberTypeLessThan:"less than",numberTypeLessThanOrEqualTo:"less than or equal to",numberTypeIsBetween:"is between",numberTypeIsNotBetween:"is not between",textTypeIs:"is",textTypeIsNot:"is not",textTypeContains:"contains",textTypeDoesNotContain:"does not contain",textTypeStartsWith:"starts with",textTypeEndsWith:"ends with",textTypeIsEmpty:"is empty",textTypeIsNotEmpty:"is not empty",selectTypeIs:"is",selectTypeIsNot:"is not",selectTypeAnyIn:"any in",selectTypeNotIn:"not in",checkboxTypeIsOn:"is on",checkboxTypeIsOff:"is off",conditionPrefix:"<copula>If</copula> <name>{{name}}</name>",textCondition:"<operator /><value />",numberConditionBasic:"<operator /><value />",numberConditionBetween:"<operator /><min /><copula>and</copula><max />",selectCondition:"<operator /><value />"},[n.entryNode]:{routingTest:"Routing Test",customerInquiry:"Customer Inquiry",requestADemo:"Request a Demo",inboundLead:"Inbound Lead"},[n.testResult]:{routingTestResult:"Routing test result",theMeetingWasAssignedTo:"The meeting was assigned to {{groupName}}.",theMeetingWasNotAssigned:"The meeting was not assigned.",theMessageWasDisplayed:'The message "{{message}}" was displayed.',theUserWasRedirecteTo:"The user was redirected to {{redirectUrl}}.",previewBookingScreen:"Preview booking screen",previewMessage:"Preview message",group:"Group",assignGroup:"Meeting group unassigned.",connectInboundLead:"Please connect your inbound leads into a meeting group.",name:"Name",email:"Email"},[n.embed]:{minutes:"minutes",meetingTimeDescription:"<text>The meeting will be hosted on </text><meet></meet><text> for </text><length></length>.",meetingTimeDescriptionWithoutLocation:"<text>The meeting will be hosted for </text><length></length>.",thisBookingPageIsExpired:"This booking page is expired.",closeConfirmModalComment:"<comment>Are you sure?</comment><comment>Those who book a time will be</comment><comment>prioritized.</comment>",closeConfirmModalCancel:"Leave",closeConfirmModalContinue:"Finish Booking"},[n.calendar]:{january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December",jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",mayShort:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec",weekDaySun:"Sun",weekDayMon:"Mon",weekDayTue:"Tue",weekDayWed:"Wed",weekDayThu:"Thu",weekDayFri:"Fri",weekDaySat:"Sat",time1am:"1 AM",time2am:"2 AM",time3am:"3 AM",time4am:"4 AM",time5am:"5 AM",time6am:"6 AM",time7am:"7 AM",time8am:"8 AM",time9am:"9 AM",time10am:"10 AM",time11am:"11 AM",time12pm:"12 PM",time1pm:"1 PM",time2pm:"2 PM",time3pm:"3 PM",time4pm:"4 PM",time5pm:"5 PM",time6pm:"6 PM",time7pm:"7 PM",time8pm:"8 PM",time9pm:"9 PM",time10pm:"10 PM",time11pm:"11 PM",today:"Today",showAvailability:"Show availability",eventBlockDateRangeTimeString:"{{startHours}}:{{startMinutes}}{{startA}} - {{endHours}}:{{endMinutes}}{{endA}}",draggedEventBlockDateRangeTimeString:"{{startHours}}:{{startMinutes}}{{startA}} - {{endHours}}:{{endMinutes}}{{endA}}",cannotSelectPastTime:"Past time slots are unavailable."},[n.nodeSettingModal]:{title:"Set condition",modalInfo:"The conditions will be applied in sequential order from top to bottom.",addCondition:"Add Condition",cancel:"Cancel",save:"Save"},[n.meetingSetting]:{assigneeGroup:"Assignee Group",assigneeInvalidMessage:"Please add assignee for this meeting.",assigneeAssignRule:"Assignee assign rule",description:"Description",descriptionPlaceholder:"Message for leads to view on your booking page",meetingLength:"Length",meetingLengthInvalidMessage:"Please add valid meeting time length.",minutes:"min",reminders:"Reminders",integration:"Integrations",nextGroup:"Next group",setDateRangeAndBuffers:"Set date range and buffers",days:"days",hours:"hours",limitMeetingDateRange:"Limit meeting date range",limitMeetingDateRangeDescription:"",preventShortNotice:"Prevent short notice of meetings",preventShortNoticeDescription1:"Can book",preventShortNoticeDescription2:"after time of scheduling",beforeBuffer:"Before event",beforeBufferDescription1:"Cannot book for",beforeBufferDescription2:"before meeting",afterBuffer:"After event",afterBufferDescription1:"Cannot book for",afterBufferDescription2:"after meeting",basicSettings:"Basic",attendees:"Attendees",notification:"Notification",basic:"Basic",recordType:"Record type"}}}},69672:function(e,t,i){i.d(t,{lS:function(){return n.l}}),i(84402);var n=i(63110)},16643:function(e,t,i){i.d(t,{ZP:function(){return d},aw:function(){return l}});var n=i(98764),o=i(26335),r=i(48538),s=i(41782);class a extends Error{constructor(){super("The name field is not of the correct type."),Object.setPrototypeOf(this,new.target.prototype)}}class l extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class d{get values$(){return this.subject}get values(){return this.subject.value}get history(){return[...this._history]}removeHistory(){this._history=this._history.slice(-1)}isNameValueOfFieldDuplicate(e,t){var i,n,o;let r=this.values;return!!(!(null==t?void 0:t.includes("fullName"))&&!(0,s.S)(r.name)&&r.name.name===e||!(null==t?void 0:t.includes("firstName"))&&(0,s.S)(r.name)&&r.name.firstName.name===e||!(null==t?void 0:t.includes("lastName"))&&(0,s.S)(r.name)&&r.name.lastName.name===e||!(null==t?void 0:t.includes("email"))&&(null===(i=r.email)||void 0===i?void 0:i.name)===e||!(null==t?void 0:t.includes("phone"))&&(null===(n=r.phone)||void 0===n?void 0:n.name)===e||!(null==t?void 0:t.includes("company"))&&(null===(o=r.company)||void 0===o?void 0:o.name)===e||!(null==t?void 0:t.includes("fields"))&&r.fields.find(t=>t.name===e))}updateValues(e){this.subject.next(e),this._history.push(e)}constructor(e){this._history=[],this.defaultFieldNamePrefix="Field",this.defaultFieldType="text",this.defaultName="name",this.defaultFirstName="first-name",this.defaultLastName="last-name",this.setUrl=e=>{let t={...this.values,url:e};return this.updateValues(t),t},this.getUrlError=()=>{let e=this.values.url;return""===e?"empty":(0,o.Z)(e)?void 0:"invalid"},this.setFormSelector=e=>{let t={...this.values,formSelector:e};return this.updateValues(t),t},this.getFormSelectorError=()=>{if(""===this.values.formSelector)return"empty"},this.setName=e=>{if((0,s.S)(this.values.name))throw new a;let t={...this.values,name:{...e,reservedFieldName:"fullName"}};return this.updateValues(t),t},this.getNameError=()=>{let e=this.values.name;if((0,s.S)(e))throw new a;return""===e.name?"empty":this.isNameValueOfFieldDuplicate(e.name,["fullName"])?"duplicated":void 0},this.setFirstName=e=>{if(!(0,s.S)(this.values.name))throw new a;let t={...this.values,name:{...this.values.name,firstName:{...e,reservedFieldName:"firstName"}}};return this.updateValues(t),t},this.getFirstNameError=()=>{let e=this.values.name;if(!(0,s.S)(e))throw new a;return""===e.firstName.name?"empty":this.isNameValueOfFieldDuplicate(e.firstName.name,["firstName"])?"duplicated":void 0},this.setLastName=e=>{if(!(0,s.S)(this.values.name))throw new a;let t={...this.values,name:{...this.values.name,lastName:{...e,reservedFieldName:"lastName"}}};return this.updateValues(t),t},this.getLastNameError=()=>{let e=this.values.name;if(!(0,s.S)(e))throw new a;return""===e.lastName.name?"empty":this.isNameValueOfFieldDuplicate(e.lastName.name,["lastName"])?"duplicated":void 0},this.switchNameField=e=>{let t;t=e&&!(0,s.S)(this.values.name)?{firstName:{id:(0,r.Z)(),name:this.defaultFirstName,type:"text",reservedFieldName:"firstName"},lastName:{id:(0,r.Z)(),name:this.defaultLastName,type:"text",reservedFieldName:"lastName"}}:{id:(0,r.Z)(),name:this.defaultName,type:"text",reservedFieldName:"fullName"};let i={...this.values,name:t};return this.updateValues(i),i},this.setEmailField=e=>{let t={...this.values,email:e?{...e,reservedFieldName:"email"}:void 0};return this.updateValues(t),t},this.getEmailFieldError=()=>{let e=this.values.email;return e?""===e.name?"empty":this.isNameValueOfFieldDuplicate(e.name,["email"])?"duplicated":void 0:void 0},this.setPhoneField=e=>{let t={...this.values,phone:e?{...e,reservedFieldName:"phone"}:void 0};return this.updateValues(t),t},this.getPhoneFieldError=()=>{let e=this.values.phone;return e?""===e.name?"empty":this.isNameValueOfFieldDuplicate(e.name,["phone"])?"duplicated":void 0:void 0},this.setCompanyField=e=>{let t={...this.values,company:e?{...e,reservedFieldName:"company"}:void 0};return this.updateValues(t),t},this.getCompanyFieldError=()=>{let e=this.values.company;return e?""===e.name?"empty":this.isNameValueOfFieldDuplicate(e.name,["company"])?"duplicated":void 0:void 0},this.setFields=e=>{let t={...this.values,fields:e};return this.updateValues(t),t},this.addField=()=>{let e=this.values,t=e.fields,i=t.map(e=>e.name),n=1;for(;;){let o="".concat(this.defaultFieldNamePrefix," ").concat(n);if(!i.includes(o)&&!this.isNameValueOfFieldDuplicate(o)){let i=[...t,{id:(0,r.Z)(),name:o,type:this.defaultFieldType}],n={...e,fields:i};return this.updateValues(n),n}n+=1}},this.getFieldsError=()=>{let e=this.values.fields;return e.map((t,i)=>{if(""===t.name)return"empty";if(this.isNameValueOfFieldDuplicate(t.name,["fields"]))return"duplicated";for(let n=0;n<e.length;n+=1)if(i!==n&&t.name===e[n].name)return"duplicated"})},this.validate=()=>{let e=this.getUrlError();if("empty"===e)throw new l("fillWebsiteUrl");if("invalid"===e)throw new l("invalidUrl");if("empty"===this.getFormSelectorError())throw new l("fillFormClass");if(void 0!==this.getEmailFieldError()||void 0!==this.getCompanyFieldError()||void 0!==this.getPhoneFieldError()||(0,s.S)(this.values.name)&&(void 0!==this.getFirstNameError()||void 0!==this.getLastNameError())||!(0,s.S)(this.values.name)&&void 0!==this.getNameError()||this.getFieldsError().length>0&&this.getFieldsError().some(e=>void 0!==e))throw new l("checkFormInput")},this._history.push(e),this.subject=new n.X(e)}}},58927:function(e,t,i){i.d(t,{X:function(){return C}});var n=i(64369),o=i(52255),r=i(14026),s=i(14403),a=i(91662),l=i(7446),d=i(33399),c=i(33088),u=i(95794),p=i(96935),g=i(98764),h=i(86153),m=i(11446),f=i(53518),x=i(79912),b=i(16803),y=i(71484),v=i(49456);class C extends m.M{get inboundRouter(){return this._history[this._history.length-1]}get title$(){return this.subject.pipe((0,n.U)(e=>e.title),(0,o.x)((e,t)=>e===t))}get hasInValidDateRange$(){return this.workflowManager.hasValidDate$().pipe((0,n.U)(e=>Object.values(e).includes(!1)),(0,o.x)((e,t)=>e===t))}get hasError$(){let e=this.customFormManager.errors$.pipe((0,n.U)(e=>void 0!==e)),t=this.workflowManager.errors$.pipe((0,n.U)(e=>null!=e&&!!e.groupErrors&&Object.values(e.groupErrors).some(h.t)||(null==e?void 0:e.disqualifiedResult)!==void 0));return(0,r.a)([e,t]).pipe((0,n.U)(e=>{let[t,i]=e;return t||i}),(0,o.x)((e,t)=>e===t))}get routerId(){return this.initialInboundRouter.id}get history(){return this._history}async saveRouter(){try{let e=await (0,s.z)(this.customFormManager.errors$);if(e){let t=Object.values(e);return{status:"failed",message:{content:t[0]}}}let t=this.getWorkflowError();if("string"==typeof t)return{status:"failed",message:{content:t}};if(t)return{status:"failed",message:{content:"workflow-group-organizer-error"}};let i=this.workflowManager.findNoNextConditions();if(i.length>0)return{status:"failed",message:{content:"unusedConditions",nodeIds:i}};if(this.workflowManager.hasUnconnectedNodes())return{status:"failed",message:{content:"unconnectedNodes"}};let n=this.workflowManager.getLinkIdByGroupIdMap(),o=(0,a.D)(this.workflowManager.getGroups().filter(e=>"creating"!==e)).pipe((0,l.r)(3),(0,d.z)(e=>e.pipe((0,c.q)())),(0,u.b)(e=>Promise.all(e.map(e=>this.saveMultiUseBookingPage(e.copyWith({id:n[e.id]}))))));await (0,p.n)(o),await this.inboundRouterUseCase.updateRouter(this.inboundRouter.id,this.inboundRouter),this.workflowManager.removeHistory(),this.customFormManager.removeHistory()}catch(e){if(e instanceof y.Bh||e instanceof Error)return{status:"failed",message:{content:e.message}};throw e}return{status:"success",message:void 0}}setFormFieldsToWorkflowManager(){let{nameField:e,customFields:t}=this.customFormManager.values;this.workflowManager.setFormFields([(0,x.ae)(e),...t.map(x.ae)].filter(f.L))}updateTitle(e){let t=this._history[this._history.length-1].copyWith({title:e});this._history.push(t),this.subject.next(t)}hasChanges(){return this.workflowManager.history.length>2||this.customFormManager.history.length>1}getFormMakerFieldByFormFieldName(e){let{nameField:t,customFields:i}=this.customFormManager.values;return[t,...i].find(t=>t.htmlNameAttribute===e)}getCustomForm(){return(0,b.c)(this.customFormManager.values)}removeUnconnectedNodes(){this.workflowManager.removeUnconnectedNodes()}subscribeHistories(){this.customFormManager.values$.subscribe(this.setFormFieldsToWorkflowManager),(0,r.a)([this.customFormManager.values$,this.workflowManager.values$]).subscribe(e=>{var t;let[i,n]=e,o=this._history[this._history.length-1],r=null===(t=i.metadata)||void 0===t?void 0:t.formStyle,s=o.copyWith({customForm:(0,b.c)(i),workflowData:n,moduleConfig:o.moduleConfig||r?{...o.moduleConfig,...r?v.N.toModuleConfig(r):{}}:void 0});this._history.push(s),this.subject.next(s)})}getWorkflowError(){let e=this.workflowManager.errors;if(!e)return;let t=Object.keys(e)[0];if(t&&"disqualifiedResult"===t)return e[t]}constructor(e,t,i,n,o){super(),this.initialInboundRouter=e,this.customFormManager=t,this.workflowManager=i,this.inboundRouterUseCase=n,this.saveMultiUseBookingPage=o,this._history=[e],this.subject=new g.X(e),this.subscribeHistories()}}},55142:function(e,t,i){i.d(t,{Z:function(){return es},h:function(){return eo}});var n=i(80432),o=i(3056),r=i(78232),s=i(1439),a=i(33399),l=i(52255),d=i(19212),c=i(14026),u=i(64369),p=i(83254),g=i(18095),h=i(25565),m=i(70604),f=i(11558),x=i(11446),b=i(53518),y=i(26335),v=i(77939),C=i(75894),w=i(71484);class j extends x.M{connect(e){let{source:t,sourceHandle:i,target:n,targetHandle:o}=e;if(t&&n){if(t===C.M.ENTRY_NODE_ID){if(n===C.M.RESULT_NODE_ID){if(!o)return;o===C.M.DISQUALIFIED_HANDLE_ID?this.connectEntryToDisqualified():this.connectEntryToGroup(o)}else this.connectEntryToNode(n)}else if(i){if(n===C.M.RESULT_NODE_ID){if(!o)return;o===C.M.DISQUALIFIED_HANDLE_ID?this.connectToDisqualified(t,this.convertSourceHandleToConditionIndex(i)):this.connectToGroup(t,this.convertSourceHandleToConditionIndex(i),o)}else this.connectToNode(t,this.convertSourceHandleToConditionIndex(i),n)}}}disconnect(e){e.forEach(e=>{e.source===C.M.ENTRY_NODE_ID?this.disconnectFromEntry():e.sourceHandle&&this.disconnectFromNode(e.source,this.convertSourceHandleToConditionIndex(e.sourceHandle))})}convertSourceHandleToConditionIndex(e){return+e}connectEntryToNode(e){let t=this.nodeManager.getEntryNode();this.reactFlowInstance.setNodes(i=>i.map(i=>i.id===t.id?{...i,data:{...i.data,next:{type:"node",id:e}}}:i));let i=[...this.reactFlowInstance.getEdges().filter(e=>e.source!==t.id),C.M.createEntryToNodeEdge(e)];this.reactFlowInstance.setEdges(i),this.historyManager.pushHistory("connectEntryToNode")}connectEntryToGroup(e){let t=this.nodeManager.getEntryNode(),i=this.groupManager.getGroups().find(t=>"creating"!==t&&t.id===e);if(!i||"creating"===i)throw new w.vY;this.reactFlowInstance.setNodes(e=>e.map(e=>e.id===t.id&&C.M.isEntryNodeData(e.data)?{...e,data:{...e.data,next:{type:"group",id:i.id}}}:e));let n=[...this.reactFlowInstance.getEdges().filter(e=>e.source!==t.id),C.M.createEntryToGroupEdge(i.id)];this.reactFlowInstance.setEdges(n),this.historyManager.pushHistory("connectEntryToGroup")}connectEntryToDisqualified(){let e=this.nodeManager.getEntryNode();this.reactFlowInstance.setNodes(t=>t.map(t=>t.id===e.id?{...t,data:{...t.data,next:{type:"disqualified"}}}:t));let t=[...this.reactFlowInstance.getEdges().filter(t=>t.source!==e.id),C.M.createEntryToDisqualifiedEdge()];this.reactFlowInstance.setEdges(t),this.historyManager.pushHistory("connectEntryToDisqualified")}connectToNode(e,t,i){this.reactFlowInstance.setNodes(n=>n.map(n=>n.id===e&&C.M.isConditionsNodeData(n.data)?{...n,data:{...n.data,conditions:n.data.conditions.map((e,n)=>n===t?{...e,next:{type:"node",id:i}}:e)}}:n));let n=[...this.reactFlowInstance.getEdges().filter(i=>i.source!==e||i.sourceHandle!==t.toString()),C.M.createNodeToNodeEdge({sourceNodeId:e,sourceConditionIndex:t,targetNodeId:i})];this.reactFlowInstance.setEdges(n),this.historyManager.pushHistory("connectToNode")}connectToGroup(e,t,i){let n=this.groupManager.getGroups().find(e=>"creating"!==e&&e.id===i);if(!n||"creating"===n)throw new w.vY;this.reactFlowInstance.setNodes(i=>i.map(i=>i.id===e&&C.M.isConditionsNodeData(i.data)?{...i,data:{...i.data,conditions:i.data.conditions.map((e,i)=>i===t?{...e,next:{type:"group",id:n.id}}:e)}}:i));let o=[...this.reactFlowInstance.getEdges().filter(i=>i.source!==e||i.sourceHandle!==t.toString()),C.M.createNodeToGroupEdge({sourceNodeId:e,sourceConditionIndex:t,targetGroupId:n.id})];this.reactFlowInstance.setEdges(o),this.historyManager.pushHistory("connectToGroup")}connectToDisqualified(e,t){this.reactFlowInstance.setNodes(i=>i.map(i=>i.id===e&&C.M.isConditionsNodeData(i.data)?{...i,data:{...i.data,conditions:i.data.conditions.map((e,i)=>i===t?{...e,next:{type:"disqualified"}}:e)}}:i));let i=[...this.reactFlowInstance.getEdges().filter(i=>i.source!==e||i.sourceHandle!==t.toString()),C.M.createNodeToDisqualifiedEdge({sourceNodeId:e,sourceConditionIndex:t})];this.reactFlowInstance.setEdges(i),this.historyManager.pushHistory("connectToDisqualified")}disconnectFromEntry(){let e=this.nodeManager.getEntryNode();this.reactFlowInstance.setNodes(t=>t.map(t=>t.id===e.id?{...t,data:{...t.data,next:void 0}}:t));let t=this.reactFlowInstance.getEdges().filter(t=>t.source!==e.id);this.reactFlowInstance.setEdges(t),this.historyManager.pushHistory("disconnectFromEntry")}disconnectFromNode(e,t){this.reactFlowInstance.setNodes(i=>i.map(i=>i.id===e&&C.M.isConditionsNodeData(i.data)?{...i,data:{...i.data,conditions:i.data.conditions.map((e,i)=>i===t?{...e,next:void 0}:e)}}:i));let i=this.reactFlowInstance.getEdges().filter(i=>i.source!==e||i.sourceHandle!==t.toString());this.reactFlowInstance.setEdges(i),this.historyManager.pushHistory("disconnect")}constructor(e,t,i,n){super(),this.reactFlowInstance=e,this.historyManager=t,this.nodeManager=i,this.groupManager=n}}var T=i(98764);class I extends x.M{get values$(){return this.subject}get values(){return this.subject.getValue()}get history(){return[...this._history]}pushHistory(e){let{nodes:t,edges:i}=this.reactFlowInstance.toObject(),n={nodes:t,edges:i,formFields:this.formFields};this.subject.next(n),"setFormFields"!==e&&"removeUselessCondition"!==e&&this._history.push({name:e,reactFlowData:n})}removeHistory(){this._history=[...this._history.slice(-2)]}constructor(e,t){super(),this.reactFlowInstance=e,this.formFields=t,this.subject=new T.X(void 0),this._history=[]}}var F=i(71473),M=i(68937),N=i(798),k=i(13235);class E extends x.M{getGroups$(){return this.groupsSubject}getGroups(){return this.nodeManager.getResultNode().data.groups}addCreatingGroup(){let e=this.nodeManager.getResultNode();return this.reactFlowInstance.setNodes(t=>t.map(t=>t.id===e.id?{...e,data:{...e.data,groups:[...e.data.groups,"creating"]}}:t)),this.groupsSubject.next(this.getGroups()),this.historyManager.pushHistory("addCreatingGroup"),this.groupsSubject.value.length-1}addGroup(e){let t=this.nodeManager.getResultNode();if(this.reactFlowInstance.setNodes(i=>i.map(i=>i.id===t.id?{...t,data:{...t.data,groups:[...t.data.groups,e]}}:i)),!(e instanceof k.Q))return;let i=new N.v(M.a.fromMultiUseBookingPage(e,this.teamMembers),this.user,this.teamMembers,this.calendarsByAccount,this.primaryCalendar,this.defaultFormFieldLabels,this.getCalendarListByUserId);this.registerGroupValuesManager(e.id,i),this.groupsSubject.next(this.getGroups()),this.historyManager.pushHistory("addGroup")}setGroup(e,t){let i=this.nodeManager.getResultNode(),n=[...i.data.groups];if(n[e]=t,this.reactFlowInstance.setNodes(e=>e.map(e=>e.id===i.id?{...i,data:{...i.data,groups:n}}:e)),!(t instanceof k.Q))return;let o=new N.v(M.a.fromMultiUseBookingPage(t,this.teamMembers),this.user,this.teamMembers,this.calendarsByAccount,this.primaryCalendar,this.defaultFormFieldLabels,this.getCalendarListByUserId);this.registerGroupValuesManager(t.id,o),this.groupsSubject.next(n),this.historyManager.pushHistory("setGroup")}updateGroup(e){let t=[...this.getGroups()],i=t.findIndex(t=>"string"!=typeof t&&t.id===e.id);-1!==i&&(t[i]=e,this.reactFlowInstance.setNodes(e=>e.map(e=>e.id===C.M.RESULT_NODE_ID&&C.M.isResultNodeData(e.data)?{...e,data:{...e.data,groups:t}}:e)),this.groupsSubject.next(t),this.historyManager.pushHistory("updateGroup"))}removeGroup(e){this.reactFlowInstance.setEdges(t=>t.filter(t=>t.target!==C.M.RESULT_NODE_ID||t.targetHandle!==e)),this.reactFlowInstance.setNodes(t=>t.map(t=>{if(t.id===C.M.ENTRY_NODE_ID&&C.M.isEntryNodeData(t.data)){var i;return{...t,data:{...t.data,next:(null===(i=t.data.next)||void 0===i?void 0:i.type)==="group"&&t.data.next.id===e?void 0:t.data.next}}}return t.id===C.M.RESULT_NODE_ID&&C.M.isResultNodeData(t.data)?{...t,data:{...t.data,groups:t.data.groups.filter(t=>"string"==typeof t||t.id!==e)}}:C.M.isConditionsNodeData(t.data)?{...t,data:{...t.data,conditions:t.data.conditions.map(t=>{var i;return(null===(i=t.next)||void 0===i?void 0:i.type)==="group"&&t.next.id===e?{...t,next:void 0}:t})}}:t}));let t=this.getGroups();0===t.length&&this.leaveEditingGroupMode(),this.unregisterGroupValuesManager(e),this.groupsSubject.next(t),this.historyManager.pushHistory("removeGroup")}enterEditingGroupMode(){let e=this.nodeManager.getResultNode();this.reactFlowInstance.setNodes(e=>e.map(e=>(e.draggable=!1,e))),this.viewportBeforeEditingGroup||(this.viewportBeforeEditingGroup=this.reactFlowInstance.getViewport());let t=document.querySelector(".group-settings-wrapper");t&&(t.scrollTop=0),setTimeout(()=>{this.reactFlowInstance.setViewport({x:-e.position.x+window.innerWidth/2+240+(window.innerWidth-480)/2-265,y:-e.position.y,zoom:1},{duration:200})},100)}leaveEditingGroupMode(){this.reactFlowInstance.setNodes(e=>e.map(e=>(e.draggable=!0,e)));let e=this.viewportBeforeEditingGroup;e&&setTimeout(()=>{this.reactFlowInstance.setViewport(e,{duration:200}),this.viewportBeforeEditingGroup=void 0},100)}getGroupValuesManager(e){return this.groupValuesManagers[e]}registerGroupValuesManager(e,t){this.groupValuesManagers[e]=t;let i=t.value$.pipe((0,u.U)(()=>t),(0,F.b)(500)).subscribe(t=>{let n=this.getGroups().find(t=>"string"!=typeof t&&t.id===e);if(!n){i.unsubscribe(),delete this.groupValuesSubscriptions[e];return}let o=t.getDataToCopy(),r=n.copyWith(o);this.updateGroup(r)});this.groupValuesSubscriptions[e]=i}unregisterGroupValuesManager(e){this.groupValuesManagers[e]&&delete this.groupValuesManagers[e],this.groupValuesSubscriptions[e]&&(this.groupValuesSubscriptions[e].unsubscribe(),delete this.groupValuesSubscriptions[e])}initGroupValuesManagers(e){let{user:t,teamMembers:i,calendarsByAccount:n,primaryCalendar:o,defaultFormFieldLabels:r}=e;this.user=t,this.teamMembers=i,this.calendarsByAccount=n,this.primaryCalendar=o,this.defaultFormFieldLabels=r,this.getGroups().forEach(e=>{if("string"==typeof e||!(e instanceof k.Q))return;let s=new N.v(M.a.fromMultiUseBookingPage(e,this.teamMembers),t,i,n,o,r,this.getCalendarListByUserId);this.registerGroupValuesManager(e.id,s)})}constructor(e,t,i,n,o){super(),this.reactFlowInstance=e,this.historyManager=t,this.nodeManager=i,this.getCalendarListByUserId=o,this.groupValuesManagers={},this.groupValuesSubscriptions={},this.groupsSubject=new T.X([]),this.groupsSubject.next(this.getGroups()),this.initGroupValuesManagers(n)}}class S extends x.M{getConditions(e){let t=this.reactFlowInstance.getNode(e);if(!t)throw new w.$R(e);return C.M.isConditionsNodeData(t.data)?t.data.conditions:[]}setConditions(e,t){if(!this.reactFlowInstance.getNode(e))throw new w.$R(e);this.reactFlowInstance.setNodes(i=>i.map(i=>i.id===e?{...i,data:{...i.data,conditions:t}}:i));let i=this.reactFlowInstance.getEdges().filter(t=>t.source!==e),n=this.groupManager.getGroups(),o=[];t.forEach((t,i)=>{let{next:r}=t;if(r){if("node"===r.type){let t=C.M.createNodeToNodeEdge({sourceNodeId:e,sourceConditionIndex:i,targetNodeId:r.id});o.push(t);return}if("group"===r.type){if(n.find(e=>"creating"!==e&&e.id===r.id)){let t=C.M.createNodeToGroupEdge({sourceNodeId:e,sourceConditionIndex:i,targetGroupId:r.id});o.push(t)}return}if("disqualified"===r.type){let t=C.M.createNodeToDisqualifiedEdge({sourceNodeId:e,sourceConditionIndex:i});o.push(t);return}}}),this.reactFlowInstance.setEdges([...i,...o]),this.historyManager.pushHistory("setConditions")}findNoNextConditions(){return this.reactFlowInstance.toObject().nodes.filter(e=>{if(C.M.isConditionsNodeData(e.data))return e.data.conditions.length>1&&e.data.conditions.find(e=>!e.next)}).map(e=>e.id)}removeNoNextConditions(e){e.forEach(e=>{let t=this.reactFlowInstance.getNode(e);if(t&&C.M.isConditionsNodeData(t.data)){let i=t.data.conditions.filter(e=>e.next);0===i.length?this.setConditions(e,[t.data.conditions[0]]):this.setConditions(e,i)}}),this.historyManager.pushHistory("removeUselessCondition")}constructor(e,t,i){super(),this.reactFlowInstance=e,this.historyManager=t,this.groupManager=i}}var P=i(86483),Z=i(91907);class D extends x.M{addNode(e,t,i){let n=t;i&&(n=this.reactFlowInstance.project({x:t.x,y:t.y}));let o=this.formFieldsManager.getFormField(e);if(!o)throw new w.gZ(e);let r=C.M.createConditionsNode({formField:o,position:n,conditions:(0,Z.Se)(o)});return this.reactFlowInstance.addNodes(r),this.historyManager.pushHistory("addNode"),r.id}removeNode(e){e!==C.M.RESULT_NODE_ID&&e!==C.M.ENTRY_NODE_ID&&(this.reactFlowInstance.setNodes(t=>t.filter(t=>t.id!==e).map(t=>{var i,n;return C.M.isConditionsNodeData(t.data)?{...t,data:{...t.data,conditions:t.data.conditions.map(t=>{var i,n;return(null===(i=t.next)||void 0===i?void 0:i.type)==="node"&&(null===(n=t.next)||void 0===n?void 0:n.id)===e?{...t,next:void 0}:t})}}:C.M.isEntryNodeData(t.data)?{...t,data:{...t.data,next:(null===(i=t.data.next)||void 0===i?void 0:i.type)==="node"&&(null===(n=t.data.next)||void 0===n?void 0:n.id)===e?void 0:t.data.next}}:t})),this.reactFlowInstance.setEdges(t=>t.filter(t=>t.source!==e&&t.target!==e)),this.historyManager.pushHistory("removeNode"))}setDisqualifiedResult(e){let t=this.getResultNode();this.reactFlowInstance.setNodes(i=>i.map(i=>i.id===t.id&&C.M.isResultNodeData(i.data)?{...t,data:{...t.data,disqualifiedResultSettings:{selectedType:e.type,message:"message"===e.type?e.data:t.data.disqualifiedResultSettings.message,redirectUrl:"redirect"===e.type?e.data:t.data.disqualifiedResultSettings.redirectUrl,formSubmissionMapping:e.formSubmissionMapping}}}:i)),this.historyManager.pushHistory("setDisqualifiedResult")}getResultNode(){let e=this.reactFlowInstance.getNode(C.M.RESULT_NODE_ID);if(!e||!C.M.isResultNodeData(e.data))throw new w.of;return e}getEntryNode(){let e=this.reactFlowInstance.getNode(C.M.ENTRY_NODE_ID);if(!e||!C.M.isEntryNodeData(e.data))throw new w.m7;return e}getConditionsNode(){return this.reactFlowInstance.getNodes().filter(e=>C.M.isConditionsNodeData(e.data))}removeUnconnectedNodes(){let e=this.pruneRedundantNodes().filter(e=>e.id!==C.M.RESULT_NODE_ID);this.reactFlowInstance.setNodes(t=>[this.getEntryNode(),...e,this.getResultNode()]);let t=e.reduce((e,t)=>(e[t.id]=!0,e),{[C.M.ENTRY_NODE_ID]:!0,[C.M.RESULT_NODE_ID]:!0});this.reactFlowInstance.setEdges(e=>e.filter(e=>t[e.source]&&t[e.target])),this.historyManager.pushHistory("removeUnconnectedNodes")}hasUnconnectedNodes(){let e=this.getConditionsNode(),t=this.pruneRedundantNodes().filter(e=>e.id!==C.M.RESULT_NODE_ID);return e.length!==t.length}pruneRedundantNodes(){let{next:e}=this.getEntryNode().data;if((null==e?void 0:e.type)!=="node")return[];let t=this.reactFlowInstance.getNode(e.id);return(0,P.Z)(this._pruneRedundantNodes(t),e=>e.id)}_pruneRedundantNodes(e){if(e.id===C.M.RESULT_NODE_ID)return[e];if(!C.M.isConditionsNodeData(e.data)||0===e.data.conditions.length)return[];let t=e.data.conditions.flatMap(e=>{var t,i,n;if((null===(t=e.next)||void 0===t?void 0:t.type)==="disqualified"||(null===(i=e.next)||void 0===i?void 0:i.type)==="group")return this._pruneRedundantNodes(this.getResultNode());if((null===(n=e.next)||void 0===n?void 0:n.type)==="node"){let t=this.reactFlowInstance.getNode(e.next.id);return this._pruneRedundantNodes(t)}return[]});return 0===t.length?[]:[e,...t]}constructor(e,t,i){super(),this.reactFlowInstance=e,this.historyManager=t,this.formFieldsManager=i}}var R=i(79912);class _ extends x.M{getFormFields$(){return this.formFieldsSubject}getFormField(e){return this.formFields.find(t=>t.name===e)}setFormFields(e){this.formFields=e,this.formFieldsSubject.next(e);let t={};e.forEach(e=>{t[e.id]=e});let i={[C.M.ENTRY_NODE_ID]:!0,[C.M.RESULT_NODE_ID]:!0},n={},o={};this.reactFlowInstance.setNodes(e=>e.filter(e=>{if(!C.M.isConditionsNodeData(e.data))return!0;let n=!!t[e.data.formField.id];return n&&(i[e.id]=!0),n}).map(r=>{if(C.M.isResultNodeData(r.data))return r;if(C.M.isConditionsNodeData(r.data)){let s=t[r.data.formField.id].name,a=t[r.data.formField.id],l=o=>{if(!o.next)return o;if("node"===o.next.type&&!i[o.next.id])return{...o,next:void 0};let r=e.find(e=>{var t;return(null===(t=o.next)||void 0===t?void 0:t.type)==="node"&&e.id===o.next.id});return r&&C.M.isConditionsNodeData(r.data)&&r.data.formField.type!==t[r.data.formField.id].type?(("node"===o.next.type||"group"===o.next.type)&&(n[o.next.id]=!0),{...o,next:void 0}):r&&C.M.isConditionsNodeData(r.data)&&(0,R.O6)(r.data.formField)&&0===t[r.data.formField.id].options.length?(("node"===o.next.type||"group"===o.next.type)&&(n[o.next.id]=!0),{...o,next:void 0}):o};if(r.data.formField.type!==t[r.data.formField.id].type)return o[r.id]=!0,{...r,data:{...r.data,label:s,formField:a,conditions:(0,Z.Se)(t[r.data.formField.id])}};if((0,R.O6)(a)){let e=r.data.conditions.filter(e=>{var t,i;return!!(0,R.p3)(e)||(((null===(t=e.next)||void 0===t?void 0:t.type)==="node"||(null===(i=e.next)||void 0===i?void 0:i.type)==="group")&&(n[e.next.id]=!0),!1)}).filter(R.p3).filter(e=>Array.isArray(e.value)?e.value.filter(e=>a.options.includes(e)).length>0:a.options.includes(e.value)).map(e=>Array.isArray(e.value)?{...e,value:e.value.filter(e=>a.options.includes(e))}:e).map(l);return{...r,data:{...r.data,label:s,formField:{...a,options:a.options},conditions:0===e.length?(0,Z.yA)(a.options):e}}}return{...r,data:{...r.data,label:s,formField:a,conditions:r.data.conditions.map(l)}}}if(C.M.isEntryNodeData(r.data)){var s;return(null===(s=r.data.next)||void 0===s?void 0:s.type)!=="node"||i[r.data.next.id]?r:{...r,data:{...r.data,next:void 0}}}return r})),this.reactFlowInstance.setEdges(e=>e.filter(e=>!o[e.source]&&!o[e.target]&&!n[e.target]&&(!e.targetHandle||!n[e.targetHandle])&&i[e.source]&&i[e.target])),this.historyManager.pushHistory("setFormFields")}constructor(e,t,i){super(),this.reactFlowInstance=e,this.historyManager=t,this.formFields=i,this.formFieldsSubject=new T.X([]),this.setFormFields(this.formFields)}}var O=i(74641),G=i(12583),q=i(66626);class z extends G.StringField{evaluate(e,t){let i=this.conditions.indexOf(t);return super.evaluate(e,t,()=>this.callback(this,i))}constructor(e,t){super(e),this.callback=t}}class A extends G.NumberField{evaluate(e,t){let i=this.conditions.indexOf(t);return super.evaluate(e,t,()=>this.callback(this,i))}constructor(e,t){super(e),this.callback=t}}class $ extends G.SelectField{evaluate(e,t){let i=this.conditions.indexOf(t);return super.evaluate(e,t,()=>this.callback(this,i))}constructor(e,t){super(e),this.callback=t}}class L extends G.CheckBoxField{evaluate(e,t){let i=this.conditions.indexOf(t);return super.evaluate(e,t,()=>this.callback(this,i))}constructor(e,t){super(e),this.callback=t}}class B extends x.M{run(e){this.logic.input(e);let t=this.logic.run();return t instanceof G.AssignableResult?this.trace.push({type:"group",id:t.id}):t instanceof G.TextResult?this.trace.push({type:"disqualified",dqType:"message",value:t.value}):t instanceof G.RedirectionResult&&this.trace.push({type:"disqualified",dqType:"redirect",value:t.value}),this.trace}evalCallback(e,t){var i;let n=null===(i=this.logic.getRules().find(t=>t.field===e))||void 0===i?void 0:i.id;n&&this.trace.push({type:"node",id:n,conditionIndex:t})}formFieldFactoryToTest(e){if("text"===e.type)return new z(e.name,this.evalCallback);if("number"===e.type)return new A(e.name,this.evalCallback);if("select"===e.type)return new $(e.name,this.evalCallback);if("checkbox"===e.type)return new L(e.name,this.evalCallback);throw new w.vO}constructor(e){super(),this.trace=[],this.logic=new q.E().toLogic(e,this.formFieldFactoryToTest)}}class U extends x.M{routingTest(e){let t=this.getTraces(e),i=this.getEdgeFromEntry(t);if(!i)return[];let{nodes:n,edges:o}=this.getTracedNodesAndEdges(t);return o[i.id]=i,this.setTracedNodesAndEdges(n,o),t}getTraces(e){return new B(this.reactFlowInstance.toObject().nodes).run(e)}getEdgeFromEntry(e){let t=e[0];switch(null==t?void 0:t.type){case"node":{let e=C.M.createEntryToNodeEdge(t.id);return e.type=C.M.HIGHLIGHT_EDGE_TYPE,e}case"group":{let e=C.M.createEntryToGroupEdge(t.id);return e.type=C.M.HIGHLIGHT_EDGE_TYPE,e}case"disqualified":{let e=C.M.createEntryToDisqualifiedEdge();return e.type=C.M.HIGHLIGHT_EDGE_TYPE,e}default:return}}getTracedNodesAndEdges(e){let t={},i={};for(let n=0;n<e.length-1;n+=1){let o=e[n],r=e[n+1];if("node"!==o.type)break;let{node:s,edge:a}=this.getTracedNodeAndEdge(o,r);t[s.id]=s,i[a.id]=a}return{nodes:t,edges:i}}getTracedNode(e){if("node"!==e.type)throw Error("Invalid trace type");let t=this.reactFlowInstance.getNode(e.id);return C.M.createConditionsNode({formField:t.data.formField,position:t.position,conditions:t.data.conditions.map((t,i)=>({...t,passed:i===e.conditionIndex})),nodeId:t.id})}getNodeToNodeTracedData(e,t){if("node"!==e.type||"node"!==t.type)throw Error("Invalid trace type");let i=this.getTracedNode(e),n=C.M.createNodeToNodeEdge({sourceNodeId:e.id,sourceConditionIndex:e.conditionIndex,targetNodeId:t.id});return n.type=C.M.HIGHLIGHT_EDGE_TYPE,{node:i,edge:n}}getNodeToGroupTracedData(e,t){if("node"!==e.type||"group"!==t.type)throw Error("Invalid trace type");let i=this.getTracedNode(e);if(-1===this.groupManager.getGroups().findIndex(e=>"creating"!==e&&e.id===t.id))throw Error("Invalid target group");let n=C.M.createNodeToGroupEdge({sourceNodeId:e.id,sourceConditionIndex:e.conditionIndex,targetGroupId:t.id});return n.type=C.M.HIGHLIGHT_EDGE_TYPE,{node:i,edge:n}}getNodeToDisqualifiedTracedData(e,t){if("node"!==e.type||"disqualified"!==t.type)throw Error("Invalid trace type");let i=this.getTracedNode(e),n=C.M.createNodeToDisqualifiedEdge({sourceNodeId:e.id,sourceConditionIndex:e.conditionIndex});return n.type=C.M.HIGHLIGHT_EDGE_TYPE,{node:i,edge:n}}getTracedNodeAndEdge(e,t){return"node"===t.type?this.getNodeToNodeTracedData(e,t):"group"===t.type?this.getNodeToGroupTracedData(e,t):this.getNodeToDisqualifiedTracedData(e,t)}setTracedNodesAndEdges(e,t){this.reactFlowInstance.setEdges(e=>e.map(e=>{var i;return null!==(i=t[e.id])&&void 0!==i?i:{...e,type:C.M.NORMAL_EDGE_TYPE}})),this.reactFlowInstance.setNodes(t=>t.map(t=>{var i;return null!==(i=e[t.id])&&void 0!==i?i:{...t,data:C.M.isConditionsNodeData(t.data)?{...t.data,conditions:t.data.conditions.map(e=>({...e,passed:!1}))}:t.data}})),this.highlightClearingSubject.next()}clearHighlightedNodesAndEdges(){this.reactFlowInstance.setEdges(e=>e.map(e=>({...e,type:C.M.NORMAL_EDGE_TYPE}))),this.reactFlowInstance.setNodes(e=>e.map(e=>({...e,data:C.M.isConditionsNodeData(e.data)?{...e.data,conditions:e.data.conditions.map(e=>({...e,passed:!1}))}:e.data})))}constructor(e,t){super(),this.reactFlowInstance=e,this.groupManager=t,this.highlightClearingSubject=new O.x,this.highlightClearingSubject.pipe((0,F.b)(4500)).subscribe(()=>this.clearHighlightedNodesAndEdges())}}class W extends x.M{get errors$(){return this.errorsSubject}get errors(){return this.errorsSubject.getValue()}setError(e,t){let i=this.errorsSubject.value;if((null==i?void 0:i[e])===t)return;let n=i?{...i,[e]:t}:{[e]:t};this.errorsSubject.next(n)}removeError(e){let t=this.errorsSubject.value;if(!t||!t[e])return;let i={...t};delete i[e],this.errorsSubject.next(Object.keys(i).length>0?i:void 0)}getError(e){var t;return null===(t=this.errorsSubject.value)||void 0===t?void 0:t[e]}constructor(...e){super(...e),this.errorsSubject=new T.X(void 0)}}class V extends x.M{init(e){let{reactFlowInstance:t,editingGroupId:i,user:n,teamMembers:o,calendarsByAccount:r,primaryCalendar:s,defaultGroupFormFieldLabels:a}=e,{nodes:l,edges:d,formFields:c}=this.inboundRouter.workflowData;this.reactFlowInstance=t,this.reactFlowInstance.addNodes(l),this.reactFlowInstance.addEdges(d),this.historyManager=new I(this.reactFlowInstance,c),this.formFieldsManager=new _(this.reactFlowInstance,this.historyManager,c),this.nodeManager=new D(this.reactFlowInstance,this.historyManager,this.formFieldsManager),this.groupManager=new E(this.reactFlowInstance,this.historyManager,this.nodeManager,{user:n,teamMembers:o,calendarsByAccount:r,primaryCalendar:s,defaultFormFieldLabels:a},this.getCalendarListByUserId),this.connectManager=new j(this.reactFlowInstance,this.historyManager,this.nodeManager,this.groupManager),this.conditionsManager=new S(this.reactFlowInstance,this.historyManager,this.groupManager),this.routingTestManager=new U(this.reactFlowInstance,this.groupManager),this.errorManager=new W,i&&this.groupManager.enterEditingGroupMode()}routingTest(e){return this.routingTestManager.routingTest(e)}removeHistory(){this.historyManager.removeHistory()}get values$(){return this.pollWhileValid(()=>this.historyManager).pipe((0,a.z)(e=>e.values$),(0,l.x)((e,t)=>JSON.stringify(e)===JSON.stringify(t)))}get values(){var e,t;return null!==(t=null===(e=this.historyManager)||void 0===e?void 0:e.values)&&void 0!==t?t:void 0}get errors$(){return this.pollWhileValid(()=>this.errorManager).pipe((0,d.w)(e=>(0,c.a)([e.errors$,this.getGroupErrorsById$()]).pipe((0,u.U)(e=>{let[t,i]=e;return{disqualifiedResult:null==t?void 0:t.disqualifiedResult,groupErrors:i}}))),(0,l.x)((e,t)=>JSON.stringify(e)===JSON.stringify(t)))}get warnings$(){return this.hasValidDate$().pipe((0,u.U)(e=>Object.entries(e).reduce((e,t)=>{let[i,n]=t;return{...e,[i]:!n}},{})))}get errors(){var e,t;return null!==(t=null===(e=this.errorManager)||void 0===e?void 0:e.errors)&&void 0!==t?t:void 0}get history(){return this.historyManager.history}getFormFields$(){return this.pollWhileValid(()=>this.formFieldsManager).pipe((0,a.z)(e=>e.getFormFields$()),(0,l.x)((e,t)=>JSON.stringify(e)===JSON.stringify(t)))}getFormField(e){return this.formFieldsManager.getFormField(e)}setFormFields(e){var t;null===(t=this.formFieldsManager)||void 0===t||t.setFormFields(e)}addNode(e,t,i){return this.nodeManager.addNode(e,t,i)}removeNode(e){this.nodeManager.removeNode(e)}setDisqualifiedResult(e){this.nodeManager.setDisqualifiedResult(e);let{type:t,data:i}=e;"message"===t?""===i?this.errorManager.setError("disqualifiedResult","disqualified-message-empty"):this.errorManager.removeError("disqualifiedResult"):"redirect"===t&&(""===i?this.errorManager.setError("disqualifiedResult","disqualified-link-empty"):(0,y.Z)(i)?this.errorManager.removeError("disqualifiedResult"):this.errorManager.setError("disqualifiedResult","disqualified-link-invalid"))}getConditions(e){this.conditionsManager.getConditions(e)}setConditions(e,t){this.conditionsManager.setConditions(e,t)}findNoNextConditions(){return this.conditionsManager.findNoNextConditions()}removeNoNextConditions(e){this.conditionsManager.removeNoNextConditions(e)}getGroupValuesManager(e){return this.groupManager.getGroupValuesManager(e)}getLinkIdByGroupIdMap(){return this.nodeManager.getResultNode().data.linkIdByGroupId}getGroups(){return this.groupManager.getGroups()}getGroups$(){return this.pollWhileValid(()=>this.groupManager).pipe((0,a.z)(e=>e.getGroups$()),(0,l.x)((e,t)=>JSON.stringify(e)===JSON.stringify(t)))}hasValidDate$(){let e=v._I.getToday();return this.getGroups$().pipe((0,u.U)(t=>t.filter(e=>"creating"!==e).reduce((t,i)=>{let{validRange:n}=i;return void 0===n||(null==n?void 0:n.startDate)===null||(null==n?void 0:n.endDate)===null?{...t,[i.id]:!0}:{...t,[i.id]:n.endDate>=e}},{})),(0,l.x)((e,t)=>JSON.stringify(e)===JSON.stringify(t)))}getGroupErrorsById$(){return this.getGroups$().pipe((0,u.U)(e=>e.filter(e=>"creating"!==e).map(e=>({manager:this.getGroupValuesManager(e.id),groupId:e.id}))),(0,a.z)(e=>{let t=e.map(e=>{let{manager:t}=e;return t.errors$});return(0,p.s)(()=>e.length>0,(0,c.a)(t).pipe((0,u.U)(t=>t.reduce((t,i,n)=>((i.title||i.meetingMethods||i.organizersAndAttendees||i.calendarToAddEvent||i.calendarsToCheckConflict||i.customForm)&&(t[e[n].groupId]=i),t),{}))),(0,g.of)({}))}),(0,l.x)((e,t)=>JSON.stringify(e)===JSON.stringify(t)))}addCreatingGroup(){return this.groupManager.addCreatingGroup()}addGroup(e){this.groupManager.addGroup(e)}setGroup(e,t){this.groupManager.setGroup(e,t)}updateGroup(e){this.groupManager.updateGroup(e)}removeGroup(e){this.groupManager.removeGroup(e)}enterEditingGroupMode(){this.groupManager.enterEditingGroupMode()}leaveEditingGroupMode(){this.groupManager.leaveEditingGroupMode()}connect(e){this.connectManager.connect(e)}disconnect(e){this.connectManager.disconnect(e)}removeUnconnectedNodes(){this.nodeManager.removeUnconnectedNodes()}hasUnconnectedNodes(){return this.nodeManager.hasUnconnectedNodes()}pruneRedundantNodes(){return this.nodeManager.pruneRedundantNodes()}pollWhileValid(e){return(0,h.H)(0,100).pipe((0,u.U)(()=>e()),(0,m.h)(b.L),(0,f.q)(1))}constructor(e,t){super(),this.inboundRouter=e,this.getCalendarListByUserId=t}}var H=i(16643),Y=i(14128),Q=i(16803),X=i(55490),J=i(33511);class K{}K.convertToCustomFormFields=e=>[e.nameField,...e.customFields];class ee extends x.M{get values$(){return this.subject.pipe((0,l.x)((e,t)=>JSON.stringify(e)===JSON.stringify(t)))}get values(){return this.subject.value}get history(){return this._history}get errors$(){return this._customFormFieldsManager.errors$.pipe((0,l.x)((e,t)=>JSON.stringify(e)===JSON.stringify(t)))}get customFormFieldsManager(){return this._customFormFieldsManager}setTitle(e){let t=this.values,i={...t,metadata:t.metadata?{...t.metadata,title:e}:{title:e,description:"",submitText:""}};this.updateValues(i)}setDescription(e){let t=this.values,i={...t,metadata:t.metadata?{...t.metadata,description:e}:{title:"",description:e,submitText:""}};this.updateValues(i)}setSubmitText(e){let t=this.values,i={...t,metadata:t.metadata?{...t.metadata,submitText:e}:{title:"",description:"",submitText:e}};this.updateValues(i)}setIsWatermarkHidden(e){let t=this.values,i={...t,metadata:t.metadata?{...t.metadata,isWatermarkHidden:e}:{title:"",description:"",submitText:"",isWatermarkHidden:e}};this.updateValues(i)}updateValues(e){JSON.stringify(e)!==JSON.stringify(this.values)&&(this.subject.next(e),this._history.push(e))}constructor(e){super(),this._history=[],this.changeNameFieldQuestion=e=>{this._customFormFieldsManager.changeNameFieldQuestion(e)},this.changeNameFieldPlaceholderChange=e=>{this._customFormFieldsManager.changeNameFieldPlaceholder(e)},this.addCustomField=e=>{this._customFormFieldsManager.addCustomField(e)},this.deleteCustomField=e=>{this._customFormFieldsManager.deleteCustomField(e)},this.setCustomField=e=>{this._customFormFieldsManager.setCustomField(e)},this.setCustomFields=e=>{this._customFormFieldsManager.setCustomFields(e)},this.setDefaultFormStyleIfNeeded=()=>{var e,t;let i=this.values;if(null===(e=i.metadata)||void 0===e?void 0:e.formStyle)return;let n={...i,metadata:{...null!==(t=i.metadata)&&void 0!==t?t:{title:"",description:"",submitText:""},formStyle:J.h.getDefaultCustomFormStyleUI()}};this.updateValues(n)},this.setTheme=e=>{this.updateFormStyle({theme:e})},this.setFormSizePreset=e=>{"custom"===e?this.updateFormStyle({customSelected:!0}):this.updateFormStyle({customSelected:!1,size:J.h.getSizeFromPresetName(e),buttonSize:e})},this.setButtonSize=e=>{this.updateFormStyle({buttonSize:e})},this.updateFormSize=e=>{var t,i;let n=null===(i=this.values.metadata)||void 0===i?void 0:null===(t=i.formStyle)||void 0===t?void 0:t.size;n&&this.updateFormStyle({customSelected:!0,size:{...n,...e}})},this.setPrimaryColor=e=>{this.updateFormStyle({primaryColor:e})},this.removeHistory=()=>{this._history=this._history.slice(-1)},this.updateFormStyle=e=>{var t;let i=this.values;if(!(null===(t=i.metadata)||void 0===t?void 0:t.formStyle))return;let n={...i,metadata:{...i.metadata,formStyle:{...i.metadata.formStyle,...e}}};this.updateValues(n)},this.convertToInboundRouterCustomForm=e=>{let t=e.find(X.m.isNameField);if(!t)throw Error("The name field does not exist. (CustomFormValuesManager.updateFields)");let i=e.filter(X.m.isCustomField);return{...this.values,nameField:t,customFields:i}},this._history.push(e),this.subject=new T.X(e),this._customFormFieldsManager=new X.m(K.convertToCustomFormFields(e),e=>{this.updateValues(this.convertToInboundRouterCustomForm(e))},{name:e.nameField.label})}}var et=i(58927),ei=i(21073);let en=o.createContext({});function eo(){return(0,o.useContext)(en)}function er(e){let{inboundRouter:t,saveMultiUseBookingPage:i,children:r}=e,{useCases:{inboundRouterUseCase:a},repositories:{calendarListRepository:l}}=(0,s.Ty)(),d=(0,o.useMemo)(()=>new V(t,l.getByUser),[l.getByUser,t]),c=(0,o.useMemo)(()=>{if(t.formValues){let e=new H.ZP(t.formValues);return new Y.o(t,e,d,a,i)}if(t.customForm){let e=(0,Q.g)(t.customForm);if(t.moduleConfig){let i=ei.NF.toModuleConfig(ei.h_.getDefaultCustomFormStyleUI()),n=ei.NF.fromModuleConfig({...i,...Object.fromEntries(Object.entries(t.moduleConfig).filter(e=>{let[,t]=e;return void 0!==t}))});e.metadata&&n&&(e.metadata={...e.metadata,formStyle:n})}let n=new ee(e);return new et.X(t,n,d,a,i)}throw Error("Invalid inbound router value (InboundRouterFacadeFactory)")},[t,a,i,d]);return(0,n.jsx)(en.Provider,{value:c,children:r})}function es(e){return(0,n.jsx)(r.tV,{children:(0,n.jsx)(er,{...e,children:e.children})})}},14128:function(e,t,i){i.d(t,{o:function(){return b}});var n=i(64369),o=i(52255),r=i(14026),s=i(91662),a=i(7446),l=i(33399),d=i(33088),c=i(95794),u=i(96935),p=i(98764),g=i(86153),h=i(53518),m=i(11446),f=i(41782),x=i(16643);class b extends m.M{get inboundRouter(){return this.history[this.history.length-1]}get title$(){return this.subject.pipe((0,n.U)(e=>e.title),(0,o.x)((e,t)=>e===t))}get hasInValidDateRange$(){return this.workflowManager.hasValidDate$().pipe((0,n.U)(e=>Object.values(e).includes(!1)),(0,o.x)((e,t)=>e===t))}get hasError$(){let e=this.formValuesManager.values$.pipe((0,n.U)(()=>{try{return this.formValuesManager.validate(),!1}catch(e){return!0}})),t=this.workflowManager.errors$.pipe((0,n.U)(e=>null!=e&&!!e.groupErrors&&Object.values(e.groupErrors).some(g.t)||(null==e?void 0:e.disqualifiedResult)!==void 0));return(0,r.a)([e,t]).pipe((0,n.U)(e=>{let[t,i]=e;return t||i}),(0,o.x)((e,t)=>e===t))}get routerId(){return this.initialInboundRouter.id}async saveRouter(){try{let e=this.getWorkflowError();if("string"==typeof e)return{status:"failed",message:{content:e}};this.formValuesManager.validate();let t=this.workflowManager.findNoNextConditions();if(t.length>0)return{status:"failed",message:{content:"unusedConditions",nodeIds:t}};if(this.workflowManager.hasUnconnectedNodes())return{status:"failed",message:{content:"unconnectedNodes"}};let i=this.workflowManager.getLinkIdByGroupIdMap(),n=(0,s.D)(this.workflowManager.getGroups().filter(e=>"creating"!==e)).pipe((0,a.r)(3),(0,l.z)(e=>e.pipe((0,d.q)())),(0,c.b)(e=>Promise.all(e.map(e=>this.saveMultiUseBookingPage(e.copyWith({id:i[e.id]}))))));await (0,u.n)(n),await this.inboundRouterUseCase.updateRouter(this.inboundRouter.id,this.inboundRouter),this.workflowManager.removeHistory(),this.formValuesManager.removeHistory()}catch(e){if(e instanceof x.aw||e instanceof Error)return{status:"failed",message:{content:e.message}};throw e}return{status:"success",message:void 0}}setFormFieldsToWorkflowManager(){let{values:e}=this.formValuesManager;this.workflowManager.setFormFields([...(0,f.S)(e.name)?[e.name.firstName,e.name.lastName]:[e.name],e.email,e.phone,e.company,...e.fields].filter(h.L))}updateTitle(e){let t=this.history[this.history.length-1].copyWith({title:e});this.history.push(t),this.subject.next(t)}removeUnconnectedNodes(){this.workflowManager.removeUnconnectedNodes()}hasChanges(){return this.workflowManager.history.length>2||this.formValuesManager.history.length>1}subscribeHistories(){this.formValuesManager.values$.subscribe(this.setFormFieldsToWorkflowManager),(0,r.a)([this.formValuesManager.values$,this.workflowManager.values$]).subscribe(e=>{let[t,i]=e,n=this.history[this.history.length-1].copyWith({formValues:t,workflowData:i});this.history.push(n),this.subject.next(n)})}getWorkflowError(){let e=this.workflowManager.errors;if(!e)return;let t=Object.keys(e)[0];if(t&&"disqualifiedResult"===t)return e[t]}constructor(e,t,i,n,o){super(),this.initialInboundRouter=e,this.formValuesManager=t,this.workflowManager=i,this.inboundRouterUseCase=n,this.saveMultiUseBookingPage=o,this.subject=new p.X(e),this.history=[this.initialInboundRouter],this.subscribeHistories()}}},51068:function(e,t,i){i.d(t,{XK:function(){return o.X},on:function(){return n.o}}),i(55142);var n=i(14128),o=i(58927)},32385:function(e,t,i){i.d(t,{O7:function(){return o},Qd:function(){return r}});var n=i(79912);let o=e=>e.map(e=>(0,n.po)(e)?(0,n.X7)(e)?{...e,value:""}:e:(0,n.D4)(e)?(0,n.Qu)(e)?e:{...e,value:[e.value]}:(0,n.p3)(e)?Array.isArray(e.value)?{...e,value:e.value}:{...e,value:[e.value]}:e),r=(e,t)=>t.map(t=>"number"===e&&(t.operator===n.jT.BETWEEN||t.operator===n.jT.NOT_BETWEEN||t.operator===n.jT.IS||t.operator===n.jT.IS_NOT||t.operator===n.jT.GT||t.operator===n.jT.GT_AND_EQUAL||t.operator===n.jT.LT||t.operator===n.jT.LT_AND_EQUAL)&&Array.isArray(t.value)?t.operator===n.jT.BETWEEN||t.operator===n.jT.NOT_BETWEEN?{...t,value:t.value.map(Number)}:{...t,value:Number(t.value[0])}:"text"===e&&(t.operator===n.jT.IS||t.operator===n.jT.IS_NOT||t.operator===n.jT.CONTAINS||t.operator===n.jT.NOT_CONTAINS||t.operator===n.jT.STARTS_WITH||t.operator===n.jT.ENDS_WITH||t.operator===n.jT.IS_EMPTY||t.operator===n.jT.IS_NOT_EMPTY)&&"string"==typeof t.value?t.operator===n.jT.IS_EMPTY||t.operator===n.jT.IS_NOT_EMPTY?{operator:t.operator,next:t.next}:{...t,value:String(t.value)}:"select"===e&&(t.operator===n.jT.IS||t.operator===n.jT.IS_NOT||t.operator===n.jT.ANY_IN||t.operator===n.jT.NOT_IN)&&Array.isArray(t.value)?t.value.length>1?{...t,value:t.value.map(String)}:{...t,value:String(t.value[0])}:t)},16803:function(e,t,i){i.d(t,{c:function(){return o},g:function(){return r}});var n=i(55490);function o(e){return{metadata:e.metadata,fields:[e.nameField,...e.customFields]}}function r(e){return{metadata:e.metadata,nameField:e.fields.find(n.m.isNameField),customFields:e.fields.filter(n.m.isCustomField)}}},33511:function(e,t,i){i.d(t,{h:function(){return n}});class n{static getPresetNameFromSize(e){return 16===e.titleFontSize&&14===e.descriptionFontSize&&14===e.questionFontSize&&16===e.gap?"small":20===e.titleFontSize&&15===e.descriptionFontSize&&15===e.questionFontSize&&20===e.gap?"medium":24===e.titleFontSize&&17===e.descriptionFontSize&&17===e.questionFontSize&&25===e.gap?"large":"custom"}static getSizeFromPresetName(e){switch(e){case"small":return{titleFontSize:16,descriptionFontSize:14,questionFontSize:14,gap:16};case"medium":return{titleFontSize:20,descriptionFontSize:15,questionFontSize:15,gap:20};case"large":return{titleFontSize:24,descriptionFontSize:17,questionFontSize:17,gap:25}}}static getDefaultCustomFormStyleUI(){return{theme:"light",customSelected:!1,size:n.getSizeFromPresetName("small"),buttonSize:"small",primaryColor:"#4A7CFE"}}}},57350:function(e,t,i){i.d(t,{B:function(){return n},n:function(){return o}});let n=!0,o="https://api.recatch.cc"},91907:function(e,t,i){i.d(t,{Se:function(){return r},yA:function(){return o}});var n=i(79912);function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return 0===e.length?[{operator:"is",value:"option1",next:void 0},{operator:"isNot",value:"option1",next:void 0}]:1===e.length?[{operator:"is",value:e[0],next:void 0},{operator:"isNot",value:e[0],next:void 0}]:e.map(e=>({operator:"is",value:e,next:void 0}))}function r(e){return(0,n.E0)(e)?[{operator:"isEmpty",next:void 0},{operator:"isNotEmpty",next:void 0}]:(0,n.lI)(e)?[{operator:"ltAndEqual",value:50,next:void 0},{operator:"gt",value:50,next:void 0}]:(0,n.O6)(e)?o(e.options):(0,n.E9)(e)?[{operator:"is",value:!0,next:void 0},{operator:"isNot",value:!0,next:void 0}]:[]}},34675:function(e,t,i){i.d(t,{My:function(){return n.M}});var n=i(75894);i(91907)}}]);