PageSourceSearch

https://smenarnabitcoin.cz/assets/ImageNotification-DIAIH_Jp.js

js smenarnabitcoin.cz collected 2026-10-06 19:43:34 UTC 5,027 bytes, 1 lines download raw bytes

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