PageSourceSearch

https://smenarnabitcoin.cz/assets/AppointmentVisited-oJYrvgdi.js

js smenarnabitcoin.cz collected 2026-10-06 19:43:43 UTC 4,939 bytes, 1 lines download raw bytes

1import{f as J,r as s,iw as K,j as i,P as Q,G as X,H as Z,L as $,n as ee,f6 as te,c1 as ae,iE as ne,s as E,e as f,iy as se,N as ie}from"./index-BiR4tHPa.js";import{U as oe}from"./UpdateNotificationReview-D5YRW3sD.js";import{U as le,M as R}from"./UpdateVariables-tv5-jcIs.js";import"./index-D0a2oRRq.js";import"./index-BVQZfgQa.js";import"./fade-WpTyRwrX.js";import"./UploadOutlined-hDi33Qtx.js";const he=()=>{const{t:o}=J(["common","noti"]),[t,u]=s.useState({database_name:"yb_db",collection_name:"notification_details",new_data:{}}),[V,ce]=s.useState({database_name:"yb_db",collection_name:"notification_details",new_data:{notification_type:"appointment_visited",template_name:"",template_type:"",variables:[],enabled:!0,notification_time:"",send_unsubscribed_user:!1,email:"",language:"",client_type:K}}),[A,de]=s.useState([{name:o("noti:select"),value:""},{name:o("patientsDetails:patientname"),value:"patient_name"},{name:o("patientsDetails:doctorname"),value:"doctor_name"},{name:o("noti:date"),value:"date"},{name:o("noti:time"),value:"time"},{name:o("noti:status"),value:"status"},{name:o("patientsDetails:patientType"),value:"patient_type"},{name:o("noti:language_used"),value:"language_used"}]),[c,L]=s.useState([{name:o("noti:select"),value:""}]),[p,w]=s.useState(""),[_,P]=s.useState(""),[k,y]=s.useState(!1),[U,F]=s.useState(""),[g,j]=s.useState(!1),[H,d]=s.useState(!1),[h,T]=s.useState(!1),[x,M]=s.useState({}),[v,O]=s.useState(""),[b,D]=s.useState(!1),B=async()=>{var e;d(!0);try{const a=await te("APPROVED","","");L([...c,...(e=a==null?void 0:a.data)==null?void 0:e.document]),d(!1)}catch(a){console.log(a,"get template error"),d(!1)}},S=async()=>{d(!0);try{const n=(await ae()).data.document.find(l=>l.notification_type==="appointment_visited");n?(y(!0),j(n.enabled),T(n.send_unsubscribed_user),w(n.notification_time),F(n._id),u({...t,new_data:{...n}})):y(!1),d(!1)}catch(e){console.log(e,"get ERROR"),d(!1)}},I=async()=>{d(!0);try{await ne(V),E(o("noti:addVisitedSuccess")),S()}catch(e){console.log(e,"Visited Message error"),f(o("noti:addVisitedFail"))}finally{d(!1)}},W=async()=>{var n;if(!t.new_data.template_name)return f("Please select a template first.");const e=(n=t==null?void 0:t.new_data)==null?void 0:n.variables,a=e==null?void 0:e.some(l=>!l||l.trim()==="");if((e==null?void 0:e.length)>0&&a)return f("Please select all variables.");D(!0);try{const l=await se(U,t.new_data);E(l.data.message)}catch(l){console.log(l,"update ERROR"),f(o("noti:somethingWentWrong"))}finally{D(!1)}},Y=e=>{j(e),u({...t,new_data:{...t.new_data}})},z=e=>{T(e)},G=e=>{const a=ie(e,"HH:mm").format("HH:mm");w(a)},q=(e,a)=>{const n=[...t.new_data.variables];n[a]=e,u({...t,new_data:{...t.new_data,variables:[...n]}})};return s.useEffect(()=>{var r,N,C;if(!_||!Array.isArray(c))return;const e=c.find(m=>m.name===_);if(!e)return;const a=(r=e.components)==null?void 0:r.find(m=>m.type==="BODY");let n=[];const l=(C=(N=a==null?void 0:a.example)==null?void 0:N.body_text)==null?void 0:C[0];Array.isArray(l)&&(n=l.map(()=>"")),u(m=>({...m,new_data:{...m.new_data,template_name:e.name,language:e.language,variables:n}}))},[_,c]),s.useEffect(()=>{u({...t,new_data:{...t.new_data,enabled:g,notification_time:p,send_unsubscribed_user:h}})},[g,h,p]),s.useEffect(()=>{S(),B()},[]),s.useEffect(()=>{var n,l;if(!((n=t==null?void 0:t.new_data)!=null&&n.template_name)||!Array.isArray(c))return;const e=c.find(r=>r.name===t.new_data.template_name);if(!e)return;const a=(l=e.components)==null?void 0:l.find(r=>r.type==="BODY");M(e),O((a==null?void 0:a.text)||"")},[t.new_data.template_name,c]),i.jsxs("div",{children:[i.jsx(Q,{activeMenu:o("noti:visitedTitle"),motherMenu:o("noti:notification")}),i.jsx(X,{children:i.jsx(Z,{children:H?i.jsx($,{}):k?i.jsxs("div",{className:"d-flex flex-column flex-md-row gap-5",children:[i.jsxs("div",{className:"flex-fill",children:[i.jsx(oe,{handlNotificationtChange:Y,notificationChecked:g,handleUnsubscribedChange:z,unsubscribedChecked:h,setSelectedTime:G,selectedTime:t.new_data.notification_time||p}),t.new_data.template_name?null:i.jsxs("div",{className:"alert alert-warning text-center mt-3",role:"alert",style:{borderRadius:"10px",width:"300px",fontWeight:"500",marginLeft:"10px"},children:["⚠️ ",o("noti:selecttemplate")]}),i.jsx(le,{loader:b,postData:t,setSelectedTemplate:P,templateList:c,handleVariables:q,variablesData:A,postAppointmentConfirmationFun:W,previewData:x,previewText:v})]}),i.jsx("div",{className:"d-none d-md-block",children:i.jsx(R,{previewText:v,previewData:x})}),i.jsx("div",{className:"d-block d-md-none",children:i.jsx(R,{previewText:v,previewData:x})})]}):i.jsx("div",{className:"d-flex justify-content-center align-items-center",style:{height:"80vh"},children:i.jsx(ee,{type:"submit",disabled:b,variant:"primary",size:"lg",onClick:I,children:b?i.jsxs("div",{children:[i.jsx("span",{className:"spinner"}),o("noti:adding")]}):o("noti:addVisited")})})})})]})};export{he as default};

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