import{V as ze,r as l,N as ke,j as e,P as nt,A as it,B as p,g as lt,D as ut,k as mt,bR as pt,_ as qr,f as ue,q as Re,t as ar,ac as se,ae as oe,af as ae,ag as ne,i as C,ay as nr,aG as ct,aC as qe,bq as tr,bl as Be,aT as ie,aw as dt,av as bt,au as sr,a1 as or,a3 as He,aI as St,aH as yt,bS as ht,aL as gt,bT as Nt,bb as Dt,bU as Pr,bV as vt,C as I,W as me,Y as pe,e as kr,d as z,ad as ve,aR as ce,a9 as Ie,a4 as xe,a5 as fe,a6 as Ee,a7 as Oe,a8 as Y,p as Br,a as Tr,bW as xt,aX as ir,c as jr,v as ft,M as $r,bj as Et,E as Ot,as as At,bX as Ct,aM as Ze,aa as Ur,b1 as Pt,u as jt,aB as Ut}from"./index-Ef5HIHwv.js";import{T as re}from"./textarea-DI4Rh5ZE.js";import{e as Mr,f as Rt,g as Lt,h as Vt,i as Yt,j as Gt,k as wt,l as _t,m as qt,n as kt,o as Fr,p as Bt,q as Tt,r as $t,s as Mt,t as Ft,v as Ht,w as It,x as zt,y as Kt,z as Qt,A as Wt,B as Xt,C as Jt,E as Zt,F as es,b as rs}from"./useSupportTickets-BaZS6Y9K.js";import{u as ts}from"./useOperators-CCisf6p-.js";import{S as _e}from"./statusConfig-D4gh5ibz.js";import{c as ss,E as os}from"./EmailCustomerDialog-hfDTAiYu.js";import{C as er}from"./checkbox-BVivpJ34.js";import{A as as}from"./EmailLivePreview-BVCmMA0B.js";import{P as ns}from"./pencil-DayKovnD.js";import{S as is,T as ls}from"./tag-D-azZ-Vm.js";import{P as us,S as ms}from"./square-pen-BWM0P-fi.js";import{C as ps}from"./circle-plus-BZE0a09n.js";import{P as Hr}from"./paperclip-D8gnDdf4.js";import{R as cs}from"./rotate-ccw-CLaV0eKC.js";import{T as ds}from"./timer-CmzQdvKV.js";import{A as bs}from"./activity-BnvSfr_U.js";import{T as Rr}from"./trash-2-BE5kUvUv.js";import{D as Lr}from"./index-5CRimzhx.js";import{u as Ss}from"./useMarkEntityNotificationsRead-y-Cxjm62.js";import"./EmailComposePanel-CJQwBVRG.js";import"./tabs-CqJ-vF-U.js";import"./eye-eVxIYKEU.js";/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ir=ze("Hand",[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ys=ze("Hourglass",[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Vr=ze("Landmark",[["line",{x1:"3",x2:"21",y1:"22",y2:"22",key:"j8o0r"}],["line",{x1:"6",x2:"6",y1:"18",y2:"11",key:"10tf0k"}],["line",{x1:"10",x2:"10",y1:"18",y2:"11",key:"54lgf6"}],["line",{x1:"14",x2:"14",y1:"18",y2:"11",key:"380y"}],["line",{x1:"18",x2:"18",y1:"18",y2:"11",key:"1kevvc"}],["polygon",{points:"12 2 20 7 4 7",key:"jkujk7"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hs=ze("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]),gs=[{label:"+1 hour",resolve:()=>Me(new Date,1)},{label:"+4 hours",resolve:()=>Me(new Date,4)},{label:"+24 hours",resolve:()=>Me(new Date,24)},{label:"+72 hours",resolve:()=>Me(new Date,72)},{label:"Tomorrow 9 AM",resolve:()=>{const s=new Date;return s.setDate(s.getDate()+1),s.setHours(9,0,0,0),s}},{label:"End of day",resolve:()=>{const s=new Date;return s.setHours(23,59,0,0),s}}];function Me(s,m){const i=new Date(s);return i.setHours(i.getHours()+m),i}function Ns({value:s,onSave:m,disabled:i,triggerLabel:g="Set"}){const[S,D]=l.useState(!1),[E,h]=l.useState(null),x=l.useMemo(()=>{if(!s)return new Date(Date.now()+2*60*60*1e3);const v=new Date(s);return Number.isNaN(v.getTime())?new Date:v},[s]),O=E||x,d=ke(O,"HH:mm"),P=v=>h(v.resolve()),t=v=>{if(!v)return;const A=new Date(v);A.setHours(O.getHours(),O.getMinutes(),0,0),h(A)},q=v=>{const[A,F]=v.split(":").map(Number);if(Number.isNaN(A)||Number.isNaN(F))return;const k=new Date(O);k.setHours(A,F,0,0),h(k)},L=()=>{m(O.toISOString()),D(!1),h(null)},U=()=>{D(!1),h(null)};return e.jsxDEV(nt,{open:S,onOpenChange:v=>{D(v),v||h(null)},children:[e.jsxDEV(it,{asChild:!0,children:e.jsxDEV(p,{variant:"outline",size:"sm",className:"text-xs h-6 px-2",disabled:i,title:"Pick a custom deadline",children:[e.jsxDEV(lt,{className:"h-3 w-3 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlinePicker.tsx",lineNumber:117,columnNumber:11},this),g]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlinePicker.tsx",lineNumber:110,columnNumber:9},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlinePicker.tsx",lineNumber:109,columnNumber:7},this),e.jsxDEV(ut,{className:"w-auto p-3",align:"start",children:e.jsxDEV("div",{className:"space-y-3",children:[e.jsxDEV("div",{className:"text-xs text-gray-500",children:["Deadline will be"," ",e.jsxDEV("span",{className:"font-semibold text-gray-800",children:ke(O,"EEE dd MMM yyyy, HH:mm")},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlinePicker.tsx",lineNumber:126,columnNumber:13},this),mt(O,new Date)&&e.jsxDEV("span",{className:"ml-1 text-orange-600",children:"(today)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlinePicker.tsx",lineNumber:130,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlinePicker.tsx",lineNumber:124,columnNumber:11},this),e.jsxDEV("div",{children:[e.jsxDEV("div",{className:"text-[10px] uppercase tracking-wide text-gray-400 mb-1.5",children:"Quick set"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlinePicker.tsx",lineNumber:136,columnNumber:13},this),e.jsxDEV("div",{className:"flex flex-wrap gap-1",children:gs.map(v=>e.jsxDEV("button",{type:"button",onClick:()=>P(v),className:"text-[11px] px-2 py-1 rounded-md border border-gray-200 bg-white hover:bg-orange-50 hover:border-orange-300 hover:text-orange-700 transition-colors",children:v.label},v.label,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlinePicker.tsx",lineNumber:139,columnNumber:17},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlinePicker.tsx",lineNumber:137,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlinePicker.tsx",lineNumber:135,columnNumber:11},this),e.jsxDEV("div",{className:"border-t pt-3",children:e.jsxDEV(pt,{mode:"single",selected:O,onSelect:t,initialFocus:!0},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlinePicker.tsx",lineNumber:153,columnNumber:13},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlinePicker.tsx",lineNumber:152,columnNumber:11},this),e.jsxDEV("div",{className:"border-t pt-3 flex items-center gap-2",children:[e.jsxDEV("div",{className:"flex items-center gap-1.5 text-xs text-gray-600",children:[e.jsxDEV(qr,{className:"h-3.5 w-3.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlinePicker.tsx",lineNumber:164,columnNumber:15},this),e.jsxDEV(ue,{type:"time",value:d,onChange:v=>q(v.target.value),className:"h-7 text-xs w-24"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlinePicker.tsx",lineNumber:165,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlinePicker.tsx",lineNumber:163,columnNumber:13},this),e.jsxDEV("div",{className:"ml-auto flex items-center gap-1.5",children:[e.jsxDEV(p,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:U,children:"Cancel"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlinePicker.tsx",lineNumber:173,columnNumber:15},this),e.jsxDEV(p,{size:"sm",className:"h-7 text-xs px-2 bg-orange-500 hover:bg-orange-600 text-white",onClick:L,disabled:i,children:"Save"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlinePicker.tsx",lineNumber:181,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlinePicker.tsx",lineNumber:172,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlinePicker.tsx",lineNumber:162,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlinePicker.tsx",lineNumber:122,columnNumber:9},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlinePicker.tsx",lineNumber:121,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlinePicker.tsx",lineNumber:108,columnNumber:5},this)}const Ds={passenger:He,contact:us,flight:or,hotel:sr,transfer:bt,tour:dt,booking:is},vs={passenger:"Passenger",contact:"Contact",flight:"Flight",hotel:"Hotel",transfer:"Transfer",tour:"Tour",booking:"Booking"},xs={title:"title",first_name:"first_name",last_name:"last_name",date_of_birth:"birthday",country_code:"country_code",document_id:"document_id",document_expiry:"document_expiry",document_country:"document_issued_country_code"},fs={contact_email:"email",contact_phone:"phone"},Es={hotel_name:"name",checkin_date:"checkin_date",checkout_date:"checkout_date",night_count:"night_count",pnr:"pnr",airline_pnr:"airline_pnr",pickup_from:"pickup_from",dropoff_to:"dropoff_to",pickup_date:"pickup_date",pickup_time:"pickup_time",vehicle:"vehicle",tour_title:"title",tour_date:"tour_date",duration:"duration",location:"location",supplier_reference:"supplier_reference",confirmation_number:"confirmation_number"},Yr=new Set(["net_price","sale_price","price","currency"]);function Os({isOpen:s,onClose:m,request:i,onSuccess:g}){var Ce,Ne;const{toast:S}=Re(),D=ar(),[E,h]=l.useState("review"),[x,O]=l.useState([]),[d,P]=l.useState(!1),[t,q]=l.useState(!0),[L,U]=l.useState(""),[v,A]=l.useState([]),F=i.change_type==="cancellation";l.useEffect(()=>{if(s){const n=i.field_changes||[];O(n.map(y=>({...y,edited_value:y.new_value,approved:!0}))),h("review"),A([]),U("")}},[s,i]);const k={};for(const n of x)k[n.scope]||(k[n.scope]=[]),k[n.scope].push(n);const j=x.filter(n=>n.approved),B=j.length>0||F,Q=n=>{O(y=>y.map((c,V)=>V===n?{...c,approved:!c.approved}:c))},he=(n,y)=>{O(c=>c.map((V,b)=>b===n?{...V,edited_value:y}:V))},de=()=>{const n=j.filter(c=>c.scope==="passenger"),y={};for(const c of n){const V=c.scope_id||"0";y[V]||(y[V]={});const b=c.field_key.split("."),T=b[b.length-1],$=xs[T]||T;y[V][$]=c.edited_value}return{travelers:Object.values(y)}},G=()=>{const n=j.filter(c=>c.scope==="contact"),y={};for(const c of n){const V=c.field_key.split("."),b=V[V.length-1];if(b==="contact_name"){const T=c.edited_value.split(" ");y.first_name=T[0]||"",y.last_name=T.slice(1).join(" ")||""}else{const T=fs[b]||b;y[T]=c.edited_value}}return y},le=async()=>{h("applying");const n=[],y=i.booking_id||i.booking_code;try{const c=j.filter(u=>u.scope==="passenger");if(c.length>0)try{const u=de();await St(y,u),n.push({action:`Update travelers (${c.length} field${c.length>1?"s":""})`,success:!0})}catch(u){n.push({action:"Update travelers",success:!1,error:u.message})}const V=j.filter(u=>u.scope==="contact");if(V.length>0)try{const u=G();await yt(y,u),n.push({action:`Update contact (${V.length} field${V.length>1?"s":""})`,success:!0})}catch(u){n.push({action:"Update contact",success:!1,error:u.message})}if(F&&i.product_id)try{await ht(y,i.product_id),n.push({action:`Cancel ${i.product_type||"product"}`,success:!0})}catch(u){n.push({action:"Cancel product",success:!1,error:u.message})}const b=["flight","hotel","transfer","tour"],T=j.filter(u=>b.includes(u.scope));if(T.length>0){const u={};for(const N of T){const M=N.scope_id||i.product_id||"";if(!M)continue;const w=M.match(/^(.+?):room_(\d+)$/),W=w?w[1]:M,ye=w?Number(w[2]):null,ee=`${W}::${ye??"all"}`;u[ee]||(u[ee]={details:{},prices:{},scope:N.scope,productId:W,roomIdx:ye});const te=N.field_key.split(".").pop()||N.field_key;if(Yr.has(te)){const X=te==="price"?"sale_price":te,o=Number(N.edited_value);Number.isNaN(o)?te==="currency"&&(u[ee].prices.currency=N.edited_value):u[ee].prices[X]=o}else{const X=Es[te]||te;u[ee].details[X]=N.edited_value}}for(const N of Object.values(u)){const M=N.roomIdx!=null?` (Room #${N.roomIdx+1})`:"";if(Object.keys(N.details).length>0)try{await gt(y,N.productId,N.details,L||void 0,N.roomIdx!=null?{target_room_index:N.roomIdx}:void 0),n.push({action:`Update ${N.scope}${M} (${Object.keys(N.details).length} field${Object.keys(N.details).length>1?"s":""})`,success:!0})}catch(w){n.push({action:`Update ${N.scope}${M}`,success:!1,error:w.message})}if(Object.keys(N.prices).length>0)try{await Nt(y,N.productId,N.prices,L||void 0),n.push({action:`Update ${N.scope} price (${Object.keys(N.prices).filter(w=>w!=="currency").join(", ")})`,success:!0})}catch(w){n.push({action:`Update ${N.scope} price`,success:!1,error:w.message})}}}const $=j.filter(u=>u.scope==="booking");if($.length>0&&n.push({action:`${$.length} booking-level change${$.length>1?"s":""} confirmed by admin (manual)`,success:!0}),d)try{await Dt(y,{template:"amendment_confirmation",request_number:i.request_number}),n.push({action:"Send confirmation email",success:!0})}catch(u){n.push({action:"Send confirmation email",success:!1,error:u.message})}try{const u={};u.field_changes=x.map(N=>({...N,new_value:N.edited_value,admin_approved:N.approved,admin_note:L||void 0})),await Pr(i.id,u)}catch(u){n.push({action:"Save changes to request",success:!1,error:u.message})}const Pe=["Update ","Cancel ","Send "],be=n.filter(u=>Pe.some(N=>u.action.startsWith(N))).every(u=>u.success);if(t&&!be)n.push({action:"Skipped marking resolved",success:!1,error:"At least one change failed to apply. Fix the errors above and try Apply again."});else if(t&&be)try{const u=await vt(i.id),N=(u==null?void 0:u.status)||i.status,M={open:["assigned","in_progress","resolved"],assigned:["in_progress","resolved"],in_progress:["resolved"],pending_supplier:["resolved"],escalated:["resolved"]};if(["resolved","closed","rejected"].includes(N))n.push({action:"Request already resolved",success:!0});else{const w=M[N];if(w){for(const W of w)await Pr(i.id,{status:W});n.push({action:"Resolve support request",success:!0})}else n.push({action:`Cannot resolve from status "${N}"`,success:!1,error:"Unknown status"})}}catch(u){n.push({action:"Resolve support request",success:!1,error:u.message})}A(n);const Se=n.every(u=>u.success),De=n.some(u=>u.success);if(h("results"),De){const u=i.booking_id||i.booking_code;D.invalidateQueries({queryKey:["easygds","booking",u]}),D.invalidateQueries({queryKey:["easygds","booking-products",u]}),D.invalidateQueries({queryKey:["easygds","booking-travelers",u]}),D.invalidateQueries({queryKey:["easygds","booking-contact",u]}),D.invalidateQueries({queryKey:["easygds","booking-prices",u]}),D.invalidateQueries({queryKey:["easygds","bookings"]}),D.invalidateQueries({queryKey:["bookings"]})}S(Se?{title:"Changes applied to booking successfully"}:De?{variant:"destructive",title:"Some actions failed",description:"Review the results below"}:{variant:"destructive",title:"Failed to apply changes"})}catch(c){A([{action:"Unexpected error",success:!1,error:c.message}]),h("results"),S({variant:"destructive",title:"Error",description:c.message})}},ge=()=>{E==="results"&&v.some(n=>n.success)&&(g==null||g()),h("review"),A([]),m()},Ae=({scope:n})=>{const y=Ds[n]||tr;return e.jsxDEV(y,{className:"h-3.5 w-3.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:439,columnNumber:12},this)};return e.jsxDEV(se,{open:s,onOpenChange:ge,children:e.jsxDEV(oe,{className:"max-w-xl max-h-[85vh] overflow-y-auto",children:[e.jsxDEV(ae,{children:e.jsxDEV(ne,{className:"flex items-center gap-2",children:[E==="review"&&"Review & Apply Changes",E==="applying"&&"Applying Changes...",E==="results"&&"Results",e.jsxDEV(C,{variant:"outline",className:"font-mono text-xs",children:i.booking_id||i.booking_code},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:450,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:446,columnNumber:11},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:445,columnNumber:9},this),E==="review"&&e.jsxDEV("div",{className:"space-y-4",children:[e.jsxDEV("p",{className:"text-xs text-gray-500",children:["Review all changes below. You can ",e.jsxDEV("strong",{children:"edit values"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:458,columnNumber:49},this),", ",e.jsxDEV("strong",{children:"uncheck"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:458,columnNumber:79},this)," changes you don't want to apply, or modify them based on supplier confirmation."]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:457,columnNumber:13},this),F&&e.jsxDEV("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:[e.jsxDEV("div",{className:"flex items-center gap-2 text-sm font-medium text-red-700",children:[e.jsxDEV(nr,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:465,columnNumber:19},this),"Cancel ",i.product_type||"product",((Ce=i.booking_details)==null?void 0:Ce.route)&&e.jsxDEV("span",{className:"text-xs font-normal text-red-500",children:["(",i.booking_details.route,")"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:467,columnNumber:54},this),((Ne=i.booking_details)==null?void 0:Ne.hotel_name)&&e.jsxDEV("span",{className:"text-xs font-normal text-red-500",children:["(",i.booking_details.hotel_name,")"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:468,columnNumber:59},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:464,columnNumber:17},this),i.product_id&&e.jsxDEV("div",{className:"text-xs text-red-500 mt-1",children:["Product ID: ",i.product_id]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:470,columnNumber:40},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:463,columnNumber:15},this),Object.entries(k).map(([n,y])=>e.jsxDEV("div",{className:"border rounded-lg overflow-hidden",children:[e.jsxDEV("div",{className:"bg-gray-50 px-3 py-2 flex items-center gap-2 border-b",children:[e.jsxDEV(Ae,{scope:n},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:478,columnNumber:19},this),e.jsxDEV("span",{className:"text-sm font-semibold",children:[vs[n]||n," Changes"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:479,columnNumber:19},this),e.jsxDEV(C,{variant:"outline",className:"text-[10px] ml-auto",children:y.length},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:480,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:477,columnNumber:17},this),e.jsxDEV("div",{className:"divide-y",children:y.map(c=>{const V=x.findIndex(b=>b.field_key===c.field_key);return e.jsxDEV("div",{className:`px-3 py-2.5 ${c.approved?"":"bg-gray-50 opacity-60"}`,children:e.jsxDEV("div",{className:"flex items-start gap-2",children:[e.jsxDEV(er,{checked:c.approved,onCheckedChange:()=>Q(V),className:"mt-0.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:489,columnNumber:27},this),e.jsxDEV("div",{className:"flex-1 min-w-0",children:[e.jsxDEV("label",{className:"text-xs font-medium text-gray-500",children:c.field_label},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:496,columnNumber:29},this),e.jsxDEV("div",{className:"flex items-center gap-2 mt-1",children:[e.jsxDEV("span",{className:"text-xs text-red-500 line-through shrink-0",children:c.old_value||"empty"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:499,columnNumber:31},this),e.jsxDEV(as,{className:"h-3 w-3 text-gray-400 shrink-0"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:502,columnNumber:31},this),c.approved?e.jsxDEV(ue,{value:c.edited_value,onChange:b=>he(V,b.target.value),className:"h-7 text-sm flex-1 min-w-0"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:505,columnNumber:33},this):e.jsxDEV("span",{className:"text-sm text-gray-400",children:c.edited_value},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:511,columnNumber:33},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:497,columnNumber:29},this),c.edited_value!==c.new_value&&c.approved&&e.jsxDEV("div",{className:"flex items-center gap-1 mt-1",children:[e.jsxDEV(ns,{className:"h-3 w-3 text-blue-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:517,columnNumber:33},this),e.jsxDEV("span",{className:"text-[10px] text-blue-600",children:['Modified from original: "',c.new_value,'"']},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:518,columnNumber:33},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:516,columnNumber:31},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:494,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:487,columnNumber:25},this)},c.field_key,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:486,columnNumber:23},this)})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:482,columnNumber:17},this)]},n,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:476,columnNumber:15},this)),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500 font-medium",children:"Admin Note (optional)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:534,columnNumber:15},this),e.jsxDEV(re,{placeholder:"Add a note about this approval, e.g. 'Confirmed with supplier via email on 28/03'...",value:L,onChange:n=>U(n.target.value),className:"text-sm mt-1",rows:2},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:535,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:533,columnNumber:13},this),e.jsxDEV("div",{className:"space-y-2 border-t pt-3",children:[e.jsxDEV("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsxDEV(er,{checked:d,onCheckedChange:n=>P(!!n)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:547,columnNumber:17},this),e.jsxDEV("span",{className:"text-sm",children:"Send confirmation email to client"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:548,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:546,columnNumber:15},this),e.jsxDEV("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsxDEV(er,{checked:t,onCheckedChange:n=>q(!!n)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:551,columnNumber:17},this),e.jsxDEV("span",{className:"text-sm",children:"Mark request as resolved after applying"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:552,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:550,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:545,columnNumber:13},this),e.jsxDEV("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3 text-xs text-blue-700 space-y-1",children:[e.jsxDEV("div",{className:"font-medium",children:"What will happen:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:558,columnNumber:15},this),j.filter(n=>n.scope==="passenger").length>0&&e.jsxDEV("div",{children:"• Update traveler info via EasyGDS API"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:560,columnNumber:17},this),j.filter(n=>n.scope==="contact").length>0&&e.jsxDEV("div",{children:"• Update contact info via EasyGDS API"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:563,columnNumber:17},this),F&&e.jsxDEV("div",{children:"• Cancel product via EasyGDS API"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:565,columnNumber:34},this),j.filter(n=>["flight","hotel","transfer","tour"].includes(n.scope)).length>0&&e.jsxDEV("div",{children:"• Update service product(s) via EasyGDS API"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:567,columnNumber:17},this),j.filter(n=>{const y=n.field_key.split(".").pop()||n.field_key;return["flight","hotel","transfer","tour"].includes(n.scope)&&Yr.has(y)}).length>0&&e.jsxDEV("div",{children:"• Update product pricing (net / sale)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:573,columnNumber:17},this),j.filter(n=>n.scope==="booking").length>0&&e.jsxDEV("div",{children:"• Note booking-level changes (manual confirmation)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:576,columnNumber:17},this),j.length===0&&!F&&e.jsxDEV("div",{children:"• No changes selected to apply"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:579,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:557,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:456,columnNumber:11},this),E==="applying"&&e.jsxDEV("div",{className:"flex flex-col items-center justify-center py-12",children:[e.jsxDEV(ct,{className:"h-10 w-10 animate-spin text-blue-600 mb-3"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:588,columnNumber:13},this),e.jsxDEV("p",{className:"text-sm text-gray-600",children:"Applying changes to EasyGDS booking..."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:589,columnNumber:13},this),e.jsxDEV("p",{className:"text-xs text-gray-400 mt-1",children:"This may take a moment"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:590,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:587,columnNumber:11},this),E==="results"&&e.jsxDEV("div",{className:"space-y-4",children:[(()=>{const n=v.every(c=>c.success),y=v.some(c=>c.success);return e.jsxDEV("div",{className:`flex items-center gap-2 p-3 rounded-lg ${n?"bg-green-50 text-green-700":y?"bg-amber-50 text-amber-700":"bg-red-50 text-red-700"}`,children:[n&&e.jsxDEV(qe,{className:"h-5 w-5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:607,columnNumber:34},this),!n&&y&&e.jsxDEV(tr,{className:"h-5 w-5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:608,columnNumber:49},this),!y&&e.jsxDEV(Be,{className:"h-5 w-5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:609,columnNumber:35},this),e.jsxDEV("span",{className:"font-medium text-sm",children:n?"All changes applied successfully!":y?"Some actions completed with issues":"Failed to apply changes"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:610,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:602,columnNumber:17},this)})(),e.jsxDEV("div",{className:"space-y-1.5",children:v.map((n,y)=>e.jsxDEV("div",{className:"flex items-start gap-2 text-sm p-2 rounded border bg-white",children:[n.success?e.jsxDEV(qe,{className:"h-4 w-4 text-green-500 mt-0.5 shrink-0"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:624,columnNumber:23},this):e.jsxDEV(Be,{className:"h-4 w-4 text-red-500 mt-0.5 shrink-0"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:625,columnNumber:23},this),e.jsxDEV("div",{className:"flex-1 min-w-0",children:[e.jsxDEV("span",{className:n.success?"text-gray-700":"text-red-600",children:n.action},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:628,columnNumber:21},this),n.error&&e.jsxDEV("p",{className:"text-xs text-red-500 mt-0.5",children:n.error},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:629,columnNumber:33},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:627,columnNumber:19},this)]},y,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:622,columnNumber:17},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:620,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:596,columnNumber:11},this),e.jsxDEV(ie,{children:[E==="review"&&e.jsxDEV(e.Fragment,{children:[e.jsxDEV(p,{variant:"outline",onClick:ge,children:"Cancel"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:640,columnNumber:15},this),e.jsxDEV(p,{onClick:le,className:"bg-blue-600 hover:bg-blue-700 text-white",disabled:!B,children:[e.jsxDEV(qe,{className:"h-4 w-4 mr-1.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:646,columnNumber:17},this),"Confirm & Apply (",j.length," change",j.length!==1?"s":"",")"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:641,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:639,columnNumber:13},this),E==="results"&&e.jsxDEV(p,{onClick:ge,children:v.some(n=>n.success)?"Done":"Close"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:652,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:637,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:444,columnNumber:7},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApplyChangesDialog.tsx",lineNumber:443,columnNumber:5},this)}const As=[{value:"amendment",label:"Amendment"},{value:"cancellation",label:"Cancellation"},{value:"name_change",label:"Name change"},{value:"date_change",label:"Date change"},{value:"special_service",label:"Special service"},{value:"refund",label:"Refund"},{value:"complaint",label:"Complaint"},{value:"hcn",label:"HCN"},{value:"pending_ticket",label:"Pending ticket"},{value:"other",label:"Other"}];function Cs({request:s}){const{toast:m}=Re(),i=Mr(),g=Rt(),S=Lt(),[D,E]=l.useState(!1),[h,x]=l.useState(""),[O,d]=l.useState(!1),[P,t]=l.useState(!1),[q,L]=l.useState(s.message||""),[U,v]=l.useState(s.request_type||"other"),[A,F]=l.useState(s.field_changes||[]),k=q!==(s.message||""),j=U!==(s.request_type||""),B=JSON.stringify(A||[])!==JSON.stringify(s.field_changes||[]),Q=async()=>{try{await i.mutateAsync({requestId:s.id,editedMessage:k?q:void 0,editedRequestType:j?U:void 0,editedFieldChanges:B?A:void 0}),m({title:"Forwarded to Ops",description:"The ticket is now in the Ops queue."}),t(!1)}catch(G){m({title:"Forward failed",description:G.message,variant:"destructive"})}},he=async()=>{if(h.trim())try{await g.mutateAsync({requestId:s.id,reason:h.trim()}),m({title:"Request rejected",description:"The creator has been notified."}),E(!1),x("")}catch(G){m({title:"Reject failed",description:G.message,variant:"destructive"})}},de=async()=>{try{await S.mutateAsync({requestId:s.id}),m({title:"Assigned to you",description:"The ticket is now in progress. Work with the customer here — you can resolve it or forward to Ops from the next bar."}),d(!1)}catch(G){m({title:"Action failed",description:G.message,variant:"destructive"})}};return e.jsxDEV(I,{className:"mb-4 border-amber-200 bg-amber-50/40",children:[e.jsxDEV(me,{className:"pb-3",children:e.jsxDEV(pe,{className:"flex items-center gap-2 text-base",children:[e.jsxDEV(kr,{className:"h-4 w-4 text-amber-700"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:103,columnNumber:11},this),e.jsxDEV("span",{children:"Support Team review required"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:104,columnNumber:11},this),e.jsxDEV(C,{variant:"outline",className:"bg-amber-100 text-amber-800 border-amber-200 text-xs",children:"Pending your review"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:105,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:102,columnNumber:9},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:101,columnNumber:7},this),e.jsxDEV(z,{className:"space-y-3",children:[e.jsxDEV("p",{className:"text-sm text-muted-foreground",children:"This request was submitted by an agency user. Choose how to handle it: reject it, resolve it yourself, or edit and forward to the Operation team."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:111,columnNumber:9},this),e.jsxDEV("div",{className:"flex flex-wrap gap-2",children:[e.jsxDEV(se,{open:D,onOpenChange:E,children:[e.jsxDEV(ve,{asChild:!0,children:e.jsxDEV(p,{variant:"destructive",size:"sm",children:[e.jsxDEV(Be,{className:"h-4 w-4 mr-1.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:120,columnNumber:17},this),"Reject"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:119,columnNumber:15},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:118,columnNumber:13},this),e.jsxDEV(oe,{children:[e.jsxDEV(ae,{children:[e.jsxDEV(ne,{children:"Reject this request"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:126,columnNumber:17},this),e.jsxDEV(ce,{children:"The creator will see this rejection and be able to resubmit once with changes."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:127,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:125,columnNumber:15},this),e.jsxDEV(re,{placeholder:"Reason for rejection (required)",value:h,onChange:G=>x(G.target.value),rows:4},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:131,columnNumber:15},this),e.jsxDEV(ie,{children:[e.jsxDEV(p,{variant:"outline",onClick:()=>E(!1),children:"Cancel"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:138,columnNumber:17},this),e.jsxDEV(p,{variant:"destructive",onClick:he,disabled:!h.trim()||g.isPending,children:g.isPending?"Rejecting…":"Reject request"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:139,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:137,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:124,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:117,columnNumber:11},this),e.jsxDEV(se,{open:O,onOpenChange:d,children:[e.jsxDEV(ve,{asChild:!0,children:e.jsxDEV(p,{variant:"secondary",size:"sm",children:[e.jsxDEV(Ir,{className:"h-4 w-4 mr-1.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:155,columnNumber:17},this),"Handle"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:154,columnNumber:15},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:153,columnNumber:13},this),e.jsxDEV(oe,{children:[e.jsxDEV(ae,{children:[e.jsxDEV(ne,{children:"Start handling this request?"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:161,columnNumber:17},this),e.jsxDEV(ce,{children:`The ticket will be assigned to you and moved to "In progress". Work on it directly with the customer. When you're done you can mark it as resolved, or forward it to the Operation team if you need their help.`},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:162,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:160,columnNumber:15},this),e.jsxDEV(ie,{children:[e.jsxDEV(p,{variant:"outline",onClick:()=>d(!1),children:"Cancel"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:170,columnNumber:17},this),e.jsxDEV(p,{onClick:de,disabled:S.isPending,children:S.isPending?"Starting…":"Start handling"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:171,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:169,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:159,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:152,columnNumber:11},this),e.jsxDEV(se,{open:P,onOpenChange:t,children:[e.jsxDEV(ve,{asChild:!0,children:e.jsxDEV(p,{size:"sm",children:[e.jsxDEV(Ie,{className:"h-4 w-4 mr-1.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:182,columnNumber:17},this),"Edit & Forward to Ops"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:181,columnNumber:15},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:180,columnNumber:13},this),e.jsxDEV(oe,{className:"max-w-2xl",children:[e.jsxDEV(ae,{children:[e.jsxDEV(ne,{children:"Forward to the Operation team"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:188,columnNumber:17},this),e.jsxDEV(ce,{children:"You may edit the message, request type, and field changes before forwarding. The original submission is always kept for audit."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:189,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:187,columnNumber:15},this),e.jsxDEV("div",{className:"space-y-4",children:[e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-sm font-medium mb-1 block",children:"Request type"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:197,columnNumber:19},this),e.jsxDEV(xe,{value:U,onValueChange:v,children:[e.jsxDEV(fe,{children:e.jsxDEV(Ee,{},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:199,columnNumber:36},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:199,columnNumber:21},this),e.jsxDEV(Oe,{children:As.map(G=>e.jsxDEV(Y,{value:G.value,children:G.label},G.value,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:202,columnNumber:25},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:200,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:198,columnNumber:19},this),j&&e.jsxDEV("p",{className:"text-xs text-amber-700 mt-1",children:["Changed from ",e.jsxDEV("strong",{children:s.original_request_type||s.request_type},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:208,columnNumber:36},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:207,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:196,columnNumber:17},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-sm font-medium mb-1 block",children:["Message ",k&&e.jsxDEV("span",{className:"text-amber-700",children:"(edited)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:215,columnNumber:43},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:214,columnNumber:19},this),e.jsxDEV(re,{value:q,onChange:G=>L(G.target.value),rows:6},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:217,columnNumber:19},this),k&&s.original_message&&e.jsxDEV("details",{className:"text-xs text-muted-foreground mt-1",children:[e.jsxDEV("summary",{className:"cursor-pointer",children:"Show original message"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:224,columnNumber:23},this),e.jsxDEV("pre",{className:"whitespace-pre-wrap bg-gray-50 p-2 mt-1 rounded border text-xs",children:s.original_message},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:225,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:223,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:213,columnNumber:17},this),Array.isArray(s.field_changes)&&s.field_changes.length>0&&e.jsxDEV("div",{className:"text-xs text-muted-foreground",children:[s.field_changes.length," field change(s) will be forwarded. Fine-grained editing available in a later iteration — contact the creator if adjustments are needed before forwarding."]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:233,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:195,columnNumber:15},this),e.jsxDEV(ie,{children:[e.jsxDEV(p,{variant:"outline",onClick:()=>t(!1),children:"Cancel"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:241,columnNumber:17},this),e.jsxDEV(p,{onClick:Q,disabled:i.isPending,children:i.isPending?"Forwarding…":"Forward to Ops"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:242,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:240,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:186,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:179,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:115,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:110,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppReviewBar.tsx",lineNumber:100,columnNumber:5},this)}const Fe={charge:"Charge",refund:"Refund",change:"Change",cancellation:"Cancellation"},Ps={charge:Vr,refund:Vr,change:xt,cancellation:nr},Gr={ops:"Ops",app:"App user",customer:"Customer"},js={pending:"bg-amber-100 text-amber-800 border-amber-300",approved:"bg-emerald-100 text-emerald-800 border-emerald-300",rejected:"bg-red-100 text-red-800 border-red-300",withdrawn:"bg-gray-100 text-gray-600 border-gray-300",superseded:"bg-gray-100 text-gray-600 border-gray-300"};function wr(s){if(!s)return"";try{return ke(new Date(s),"dd MMM, HH:mm")}catch{return String(s)}}function Us({requestId:s,createdByType:m}){const{profile:i}=Br(),{loginContext:g}=Tr(),{toast:S}=Re(),{data:D=[]}=Vt(s),E=Yt(),h=Gt(),x=wt(),O=_t(),d=g==="system",P=g==="app",t=g==="agent",q=D.filter(o=>o.status==="pending"),L=D.filter(o=>o.status!=="pending"),U=(o,R=!1)=>{if(t){if(o==="app"||o==="ops")return"Support Team";if(o==="customer")return R?"You":"Customer"}return Gr[o]},v=o=>o.status!=="pending"?!1:!!(o.to_party==="ops"&&d||o.to_party==="app"&&P||o.to_party==="customer"&&t),A=o=>o.status==="pending"&&o.created_by===(i==null?void 0:i.id),k=d||P&&(!m||m==="client"),[j,B]=l.useState(!1),[Q,he]=l.useState("charge"),[de,G]=l.useState(d?"app":"customer"),[le,ge]=l.useState(""),[Ae,Ce]=l.useState("USD"),[Ne,n]=l.useState(""),y=()=>{he("charge"),ge(""),Ce("USD"),n(""),G(d?"app":"customer")},c=d?["app"]:P?["customer","ops"]:[],V=async()=>{if(!Ne.trim()){S({variant:"destructive",title:"Description required"});return}if((Q==="charge"||Q==="refund")&&!(Number(le)>0)){S({variant:"destructive",title:`${Fe[Q]} needs a positive amount`});return}const o=d?"ops":"app";try{await E.mutateAsync({request_id:s,kind:Q,from_party:o,to_party:de,amount:le?Number(le):void 0,currency:le?Ae:void 0,description:Ne.trim()}),S({title:"Proposal sent",description:`To ${U(de)} — awaiting response.`}),B(!1),y()}catch(R){S({variant:"destructive",title:"Could not send",description:R.message})}},[b,T]=l.useState(null),[$,Pe]=l.useState(!1),[Z,be]=l.useState(""),[Se,De]=l.useState(""),u=o=>{T(o);const R=P&&o.from_party==="ops"&&o.to_party==="app";Pe(R),be(o.amount!=null?String(o.amount):""),De(o.description||"")},N=async()=>{if(!b)return;const o=P&&b.from_party==="ops"&&b.to_party==="app";if($&&o&&(b.kind==="charge"||b.kind==="refund")&&!(Number(Z)>0)){S({variant:"destructive",title:`Relay amount must be > 0 for ${Fe[b.kind]}`});return}try{const R=await h.mutateAsync({id:b.id,requestId:s,passToCustomer:$&&o,amount:$&&o&&Z?Number(Z):void 0,currency:b.currency||"USD",description:$&&o?Se.trim():void 0}),je=R!=null&&R.child_proposal_id?"Approved and forwarded to the customer for their approval.":"Approved.";S({title:"Approval recorded",description:je}),T(null)}catch(R){S({variant:"destructive",title:"Could not approve",description:R.message})}},[M,w]=l.useState(null),[W,ye]=l.useState(""),ee=async()=>{if(M){if(!W.trim()){S({variant:"destructive",title:"Reason required"});return}try{await x.mutateAsync({id:M.id,requestId:s,reason:W.trim()}),S({title:"Rejected"}),w(null),ye("")}catch(o){S({variant:"destructive",title:"Could not reject",description:o.message})}}},te=async o=>{try{await O.mutateAsync({id:o.id,requestId:s}),S({title:"Withdrawn"})}catch(R){S({variant:"destructive",title:"Could not withdraw",description:R.message})}},X=o=>{const R=Ps[o.kind]||ls,je=o.amount!=null?`${Number(o.amount).toFixed(2)} ${o.currency||""}`.trim():null;return e.jsxDEV("div",{className:"border rounded-lg p-3 text-sm space-y-2",children:[e.jsxDEV("div",{className:"flex items-start gap-2",children:[e.jsxDEV(R,{className:"h-4 w-4 mt-0.5 text-gray-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:233,columnNumber:11},this),e.jsxDEV("div",{className:"flex-1 min-w-0",children:[e.jsxDEV("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxDEV("span",{className:"font-medium",children:Fe[o.kind]},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:236,columnNumber:15},this),e.jsxDEV(C,{variant:"outline",className:`text-[10px] ${js[o.status]||""}`,children:o.status},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:237,columnNumber:15},this),e.jsxDEV("span",{className:"text-xs text-gray-500",children:[U(o.from_party)," → ",U(o.to_party,!0)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:238,columnNumber:15},this),je&&e.jsxDEV("span",{className:"ml-auto font-semibold",children:je},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:241,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:235,columnNumber:13},this),o.description&&e.jsxDEV("p",{className:"text-gray-700 mt-1 whitespace-pre-wrap",children:o.description},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:243,columnNumber:31},this),e.jsxDEV("div",{className:"text-xs text-gray-400 mt-1",children:[o.created_by_name&&e.jsxDEV(e.Fragment,{children:["From ",o.created_by_name," · "]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:245,columnNumber:37},this),wr(o.created_at),o.responded_at&&e.jsxDEV(e.Fragment,{children:[" · ",o.status," by ",o.responded_by_name||"?"," at ",wr(o.responded_at)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:247,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:244,columnNumber:13},this),o.response_reason&&e.jsxDEV("div",{className:"text-xs text-red-700 mt-1 italic",children:["Reason: ",o.response_reason]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:251,columnNumber:15},this),o.parent_id&&e.jsxDEV("div",{className:"text-[10px] text-muted-foreground mt-1",children:"Relayed from a parent proposal"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:254,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:234,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:232,columnNumber:9},this),o.status==="pending"&&e.jsxDEV("div",{className:"flex flex-wrap gap-2 pt-1",children:[v(o)&&e.jsxDEV(e.Fragment,{children:[e.jsxDEV(p,{size:"sm",onClick:()=>u(o),children:[e.jsxDEV(ir,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:264,columnNumber:19},this)," Approve"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:263,columnNumber:17},this),e.jsxDEV(p,{size:"sm",variant:"destructive",onClick:()=>w(o),children:[e.jsxDEV(Be,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:267,columnNumber:19},this)," Reject"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:266,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:262,columnNumber:15},this),A(o)&&e.jsxDEV(p,{size:"sm",variant:"outline",onClick:()=>te(o),children:[e.jsxDEV(nr,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:273,columnNumber:17},this)," Withdraw"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:272,columnNumber:15},this),!v(o)&&!A(o)&&e.jsxDEV("span",{className:"text-xs text-muted-foreground",children:["Waiting for ",U(o.to_party)," to respond"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:277,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:260,columnNumber:11},this)]},o.id,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:231,columnNumber:7},this)};return e.jsxDEV(I,{children:[e.jsxDEV(me,{className:"p-3 border-b",children:e.jsxDEV(pe,{className:"text-sm flex items-center gap-2",children:[e.jsxDEV(kr,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:289,columnNumber:11},this)," Approval Requests",q.length>0&&e.jsxDEV(C,{className:"bg-amber-500 text-white",children:[q.length," pending"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:290,columnNumber:34},this),k&&e.jsxDEV(se,{open:j,onOpenChange:o=>{B(o),o||y()},children:[e.jsxDEV(ve,{asChild:!0,children:e.jsxDEV(p,{size:"sm",variant:"outline",className:"ml-auto",children:[e.jsxDEV(ps,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:295,columnNumber:19},this)," New"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:294,columnNumber:17},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:293,columnNumber:15},this),e.jsxDEV(oe,{className:"max-w-lg",children:[e.jsxDEV(ae,{children:[e.jsxDEV(ne,{children:"New approval request"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:300,columnNumber:19},this),e.jsxDEV(ce,{children:"Propose a charge, refund, change, or cancellation that the other party must approve before it takes effect."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:301,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:299,columnNumber:17},this),e.jsxDEV("div",{className:"space-y-3",children:[e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Kind"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:307,columnNumber:21},this),e.jsxDEV(xe,{value:Q,onValueChange:o=>he(o),children:[e.jsxDEV(fe,{children:e.jsxDEV(Ee,{},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:309,columnNumber:38},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:309,columnNumber:23},this),e.jsxDEV(Oe,{children:[e.jsxDEV(Y,{value:"charge",children:"Charge"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:311,columnNumber:25},this),e.jsxDEV(Y,{value:"refund",children:"Refund"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:312,columnNumber:25},this),e.jsxDEV(Y,{value:"change",children:"Change"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:313,columnNumber:25},this),e.jsxDEV(Y,{value:"cancellation",children:"Cancellation"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:314,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:310,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:308,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:306,columnNumber:19},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Send to"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:319,columnNumber:21},this),e.jsxDEV(xe,{value:de,onValueChange:o=>G(o),children:[e.jsxDEV(fe,{children:e.jsxDEV(Ee,{},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:321,columnNumber:38},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:321,columnNumber:23},this),e.jsxDEV(Oe,{children:c.map(o=>e.jsxDEV(Y,{value:o,children:Gr[o]},o,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:324,columnNumber:27},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:322,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:320,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:318,columnNumber:19},this),(Q==="charge"||Q==="refund"||le)&&e.jsxDEV("div",{className:"grid grid-cols-3 gap-2",children:[e.jsxDEV("div",{className:"col-span-2",children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Amount"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:332,columnNumber:25},this),e.jsxDEV(ue,{type:"number",min:"0",step:"0.01",value:le,onChange:o=>ge(o.target.value),placeholder:"0.00"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:333,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:331,columnNumber:23},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Currency"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:336,columnNumber:25},this),e.jsxDEV(ue,{value:Ae,onChange:o=>Ce(o.target.value.toUpperCase()),maxLength:3},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:337,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:335,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:330,columnNumber:21},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Description"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:342,columnNumber:21},this),e.jsxDEV(re,{rows:3,value:Ne,onChange:o=>n(o.target.value),placeholder:"What is this for?"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:343,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:341,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:305,columnNumber:17},this),e.jsxDEV(ie,{children:[e.jsxDEV(p,{variant:"outline",onClick:()=>B(!1),children:"Cancel"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:347,columnNumber:19},this),e.jsxDEV(p,{onClick:V,disabled:E.isPending,children:E.isPending?"Sending…":"Send proposal"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:348,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:346,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:298,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:292,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:288,columnNumber:9},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:287,columnNumber:7},this),e.jsxDEV(z,{className:"p-3 space-y-2",children:[D.length===0&&e.jsxDEV("div",{className:"text-center text-xs text-gray-400 py-4",children:"No approval requests yet."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:359,columnNumber:11},this),q.length>0&&e.jsxDEV("div",{className:"space-y-2",children:[e.jsxDEV("div",{className:"text-[10px] uppercase tracking-wide text-gray-500",children:"Pending"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:363,columnNumber:13},this),q.map(X)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:362,columnNumber:11},this),L.length>0&&e.jsxDEV("div",{className:"space-y-2 pt-2",children:[e.jsxDEV("div",{className:"text-[10px] uppercase tracking-wide text-gray-500",children:"History"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:369,columnNumber:13},this),L.map(X)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:368,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:357,columnNumber:7},this),e.jsxDEV(se,{open:!!b,onOpenChange:o=>{o||T(null)},children:e.jsxDEV(oe,{children:[e.jsxDEV(ae,{children:[e.jsxDEV(ne,{children:"Approve proposal"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:379,columnNumber:13},this),e.jsxDEV(ce,{children:b&&e.jsxDEV(e.Fragment,{children:[Fe[b.kind]," · ",U(b.from_party)," → ",U(b.to_party,!0),b.amount!=null&&e.jsxDEV(e.Fragment,{children:[" · ",e.jsxDEV("strong",{children:[Number(b.amount).toFixed(2)," ",b.currency||""]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:384,columnNumber:54},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:384,columnNumber:49},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:382,columnNumber:17},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:380,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:378,columnNumber:11},this),b&&P&&b.from_party==="ops"&&b.to_party==="app"&&e.jsxDEV("div",{className:"space-y-3 border-t pt-3",children:[e.jsxDEV("div",{className:"flex items-center gap-2",children:[e.jsxDEV("input",{id:"relay",type:"checkbox",checked:$,onChange:o=>Pe(o.target.checked)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:392,columnNumber:17},this),e.jsxDEV("label",{htmlFor:"relay",className:"text-sm",children:"Also send to the customer for their approval"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:398,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:391,columnNumber:15},this),$&&e.jsxDEV("div",{className:"space-y-2 pl-6",children:[(b.kind==="charge"||b.kind==="refund")&&e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Amount to customer"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:404,columnNumber:23},this),e.jsxDEV("div",{className:"flex gap-2 items-center",children:[e.jsxDEV(ue,{type:"number",min:"0",step:"0.01",value:Z,onChange:o=>be(o.target.value)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:406,columnNumber:25},this),e.jsxDEV("span",{className:"text-xs text-gray-500",children:b.currency||"USD"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:407,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:405,columnNumber:23},this),b.amount!=null&&Z&&e.jsxDEV("p",{className:"text-[10px] text-muted-foreground mt-1",children:["Your markup: ",(Number(Z)-Number(b.amount)).toFixed(2)," ",b.currency||"USD"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:410,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:403,columnNumber:21},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Description (shown to customer)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:417,columnNumber:21},this),e.jsxDEV(re,{rows:2,value:Se,onChange:o=>De(o.target.value)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:418,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:416,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:401,columnNumber:17},this),!$&&e.jsxDEV("p",{className:"text-xs text-muted-foreground",children:"You'll accept Ops's charge without passing anything on to the customer. You absorb this cost."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:423,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:390,columnNumber:13},this),e.jsxDEV(ie,{children:[e.jsxDEV(p,{variant:"outline",onClick:()=>T(null),children:"Cancel"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:430,columnNumber:13},this),e.jsxDEV(p,{onClick:N,disabled:h.isPending,children:h.isPending?"Approving…":"Approve"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:431,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:429,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:377,columnNumber:9},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:376,columnNumber:7},this),e.jsxDEV(se,{open:!!M,onOpenChange:o=>{o||(w(null),ye(""))},children:e.jsxDEV(oe,{children:[e.jsxDEV(ae,{children:[e.jsxDEV(ne,{children:"Reject proposal"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:442,columnNumber:13},this),e.jsxDEV(ce,{children:"Tell the other party why — they'll see your reason."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:443,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:441,columnNumber:11},this),e.jsxDEV(re,{rows:4,value:W,onChange:o=>ye(o.target.value),placeholder:"Reason for rejection"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:445,columnNumber:11},this),e.jsxDEV(ie,{children:[e.jsxDEV(p,{variant:"outline",onClick:()=>w(null),children:"Cancel"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:447,columnNumber:13},this),e.jsxDEV(p,{variant:"destructive",onClick:ee,disabled:x.isPending||!W.trim(),children:x.isPending?"Rejecting…":"Reject"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:448,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:446,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:440,columnNumber:9},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:439,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/ApprovalRequestsPanel.tsx",lineNumber:286,columnNumber:5},this)}async function rr(s,m){const i=localStorage.getItem("platform_token"),S=await(await fetch(s,{headers:{"Content-Type":"application/json",...i?{Authorization:`Bearer ${i}`}:{}},...m})).json();if(S.error)throw new Error(S.error.message||S.error);return S.data}const _r={customer:"bg-blue-100 text-blue-800 border-blue-200",supplier:"bg-violet-100 text-violet-800 border-violet-200",internal:"bg-gray-100 text-gray-700 border-gray-200",unknown:"bg-amber-100 text-amber-800 border-amber-200"};function Rs({bookingCode:s,supportRequestId:m}){const i=ar(),{toast:g}=Re(),{data:S=[]}=jr({queryKey:["support-ticket-emails",m],queryFn:()=>rr(`/rest/v1/emails?support_request_id=${m}&limit=20`),refetchInterval:3e4}),{data:D=[]}=jr({queryKey:["support-ticket-emails-booking",s],queryFn:()=>rr(`/rest/v1/emails?booking_code=${encodeURIComponent(s||"")}&limit=20`),enabled:!!s}),E=new Set,h=[];for(const d of[S,D])for(const P of d)E.has(P.id)||(E.add(P.id),h.push(P));const x=h.slice(0,5),O=ft({mutationFn:d=>rr(`/rest/v1/emails/${d}/link`,{method:"POST",body:JSON.stringify({support_request_id:m})}),onSuccess:()=>{g({title:"Attached to ticket"}),i.invalidateQueries({queryKey:["support-ticket-emails"]}),i.invalidateQueries({queryKey:["support-ticket-emails-booking"]})},onError:d=>g({variant:"destructive",title:"Attach failed",description:d.message})});return h.length===0?null:e.jsxDEV(I,{children:[e.jsxDEV(me,{className:"p-3 pb-1",children:e.jsxDEV(pe,{className:"text-sm flex items-center gap-2",children:[e.jsxDEV($r,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportTicketEmailsCard.tsx",lineNumber:87,columnNumber:11},this)," Related emails",e.jsxDEV(C,{variant:"outline",className:"text-[10px] ml-auto",children:h.length},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportTicketEmailsCard.tsx",lineNumber:88,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportTicketEmailsCard.tsx",lineNumber:86,columnNumber:9},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportTicketEmailsCard.tsx",lineNumber:85,columnNumber:7},this),e.jsxDEV(z,{className:"p-3 pt-2 space-y-1.5",children:[x.map(d=>{const P=_r[d.category]||_r.unknown,t=d.support_request_id===m;return e.jsxDEV("div",{className:"border rounded p-2 text-xs space-y-1",children:[e.jsxDEV("div",{className:"flex items-center gap-1 flex-wrap",children:[e.jsxDEV(C,{variant:"outline",className:`text-[9px] ${P}`,children:d.category},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportTicketEmailsCard.tsx",lineNumber:98,columnNumber:17},this),d.booking_code&&e.jsxDEV(C,{variant:"outline",className:"text-[9px] bg-emerald-50 text-emerald-800 border-emerald-200",children:[e.jsxDEV(Et,{className:"h-2.5 w-2.5 mr-0.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportTicketEmailsCard.tsx",lineNumber:101,columnNumber:21},this),d.booking_code]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportTicketEmailsCard.tsx",lineNumber:100,columnNumber:19},this),d.attachments_count>0&&e.jsxDEV("span",{className:"text-[9px] text-muted-foreground inline-flex items-center gap-0.5",children:[e.jsxDEV(Hr,{className:"h-2.5 w-2.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportTicketEmailsCard.tsx",lineNumber:106,columnNumber:21},this),d.attachments_count]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportTicketEmailsCard.tsx",lineNumber:105,columnNumber:19},this),e.jsxDEV("span",{className:"ml-auto text-[10px] text-muted-foreground",children:d.received_at?ke(new Date(d.received_at),"dd MMM HH:mm"):""},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportTicketEmailsCard.tsx",lineNumber:109,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportTicketEmailsCard.tsx",lineNumber:97,columnNumber:15},this),e.jsxDEV("div",{className:"font-medium truncate",children:d.subject||"(no subject)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportTicketEmailsCard.tsx",lineNumber:113,columnNumber:15},this),e.jsxDEV("div",{className:"text-[10px] text-muted-foreground truncate",children:d.from_name||d.from_email||""},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportTicketEmailsCard.tsx",lineNumber:114,columnNumber:15},this),e.jsxDEV("div",{className:"flex items-center gap-1 pt-1",children:[!t&&e.jsxDEV(p,{size:"sm",variant:"outline",className:"h-6 text-[10px] px-2",onClick:()=>O.mutate(d.id),disabled:O.isPending,children:"Attach to ticket"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportTicketEmailsCard.tsx",lineNumber:119,columnNumber:19},this),t&&e.jsxDEV(C,{variant:"outline",className:"text-[9px] bg-indigo-50 text-indigo-800 border-indigo-200",children:"✓ on this ticket"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportTicketEmailsCard.tsx",lineNumber:125,columnNumber:19},this),s&&e.jsxDEV("a",{href:`/bookings/${s}?tab=emails`,target:"_blank",rel:"noreferrer",className:"ml-auto text-[10px] text-blue-700 hover:underline inline-flex items-center gap-0.5",children:["Open ",e.jsxDEV(Ot,{className:"h-2.5 w-2.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportTicketEmailsCard.tsx",lineNumber:132,columnNumber:26},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportTicketEmailsCard.tsx",lineNumber:130,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportTicketEmailsCard.tsx",lineNumber:117,columnNumber:15},this)]},d.id,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportTicketEmailsCard.tsx",lineNumber:96,columnNumber:13},this)}),h.length>x.length&&e.jsxDEV("div",{className:"text-[10px] text-center text-muted-foreground pt-1",children:["…and ",h.length-x.length," more — see the booking's ",e.jsxDEV("strong",{children:"Emails"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportTicketEmailsCard.tsx",lineNumber:141,columnNumber:74},this)," tab."]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportTicketEmailsCard.tsx",lineNumber:140,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportTicketEmailsCard.tsx",lineNumber:91,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportTicketEmailsCard.tsx",lineNumber:84,columnNumber:5},this)}function Ls({request:s}){var j;const{toast:m}=Re(),i=qt(),g=kt(),[S,D]=l.useState(!1),[E,h]=l.useState(s.ops_proposed_message||""),[x,O]=l.useState(s.ops_proposed_status||""),[d,P]=l.useState(!1),[t,q]=l.useState(""),L=E!==(s.ops_proposed_message||""),U=x!==(s.ops_proposed_status||""),v=async()=>{try{await i.mutateAsync({requestId:s.id}),m({title:"Response approved",description:"The customer has been notified."})}catch(B){m({title:"Approve failed",description:B.message,variant:"destructive"})}},A=async()=>{try{await i.mutateAsync({requestId:s.id,editedMessage:L?E:void 0,editedStatus:U?x:void 0}),m({title:"Edited response approved",description:"The edited reply has been sent."}),D(!1)}catch(B){m({title:"Approve failed",description:B.message,variant:"destructive"})}},F=async()=>{if(t.trim())try{await g.mutateAsync({requestId:s.id,reason:t.trim()}),m({title:"Returned to Ops",description:"Ops will see your reason in the internal notes."}),P(!1),q("")}catch(B){m({title:"Return failed",description:B.message,variant:"destructive"})}},k=s.ops_proposed_status?((j=_e[s.ops_proposed_status])==null?void 0:j.label)||s.ops_proposed_status:"No status change";return e.jsxDEV(I,{className:"mb-4 border-indigo-200 bg-indigo-50/40",children:[e.jsxDEV(me,{className:"pb-3",children:e.jsxDEV(pe,{className:"flex items-center gap-2 text-base",children:[e.jsxDEV(ys,{className:"h-4 w-4 text-indigo-700"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:84,columnNumber:11},this),e.jsxDEV("span",{children:"Ops wants to change the status — your approval needed"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:85,columnNumber:11},this),e.jsxDEV(C,{variant:"outline",className:"bg-indigo-100 text-indigo-800 border-indigo-200 text-xs",children:k},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:86,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:83,columnNumber:9},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:82,columnNumber:7},this),e.jsxDEV(z,{className:"space-y-3",children:[e.jsxDEV("p",{className:"text-xs text-muted-foreground",children:"Ops's day-to-day messages reach you directly as internal notes and the customer never sees them. This bar only appears when Ops wants to move the ticket to a final state (resolved / closed / rejected) — the customer will see whatever you release here."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:92,columnNumber:9},this),s.ops_proposed_message&&e.jsxDEV("div",{children:[e.jsxDEV("div",{className:"text-xs uppercase tracking-wide text-muted-foreground mb-1",children:"Suggested customer reply"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:100,columnNumber:13},this),e.jsxDEV("div",{className:"rounded border bg-white p-3 text-sm whitespace-pre-wrap",children:s.ops_proposed_message},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:103,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:99,columnNumber:11},this),e.jsxDEV("div",{className:"flex flex-wrap gap-2",children:[e.jsxDEV(p,{onClick:v,disabled:i.isPending,size:"sm",children:[e.jsxDEV(ir,{className:"h-4 w-4 mr-1.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:111,columnNumber:13},this),"Approve as-is"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:110,columnNumber:11},this),e.jsxDEV(se,{open:S,onOpenChange:D,children:[e.jsxDEV(ve,{asChild:!0,children:e.jsxDEV(p,{variant:"secondary",size:"sm",children:[e.jsxDEV(ms,{className:"h-4 w-4 mr-1.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:118,columnNumber:17},this),"Edit & Approve"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:117,columnNumber:15},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:116,columnNumber:13},this),e.jsxDEV(oe,{className:"max-w-2xl",children:[e.jsxDEV(ae,{children:[e.jsxDEV(ne,{children:"Edit Ops's proposed response"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:124,columnNumber:17},this),e.jsxDEV(ce,{children:"The customer will see your edited version. Ops's original is kept for audit."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:125,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:123,columnNumber:15},this),e.jsxDEV("div",{className:"space-y-4",children:[e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-sm font-medium mb-1 block",children:"Final status"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:131,columnNumber:19},this),e.jsxDEV(xe,{value:x,onValueChange:O,children:[e.jsxDEV(fe,{children:e.jsxDEV(Ee,{placeholder:"Status"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:133,columnNumber:36},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:133,columnNumber:21},this),e.jsxDEV(Oe,{children:[e.jsxDEV(Y,{value:"resolved",children:"Resolved"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:135,columnNumber:23},this),e.jsxDEV(Y,{value:"closed",children:"Closed"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:136,columnNumber:23},this),e.jsxDEV(Y,{value:"rejected",children:"Rejected"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:137,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:134,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:132,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:130,columnNumber:17},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-sm font-medium mb-1 block",children:["Message ",L&&e.jsxDEV("span",{className:"text-indigo-700",children:"(edited)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:143,columnNumber:43},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:142,columnNumber:19},this),e.jsxDEV(re,{value:E,onChange:B=>h(B.target.value),rows:6},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:145,columnNumber:19},this),L&&s.ops_proposed_message&&e.jsxDEV("details",{className:"text-xs text-muted-foreground mt-1",children:[e.jsxDEV("summary",{className:"cursor-pointer",children:"Show Ops's original"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:152,columnNumber:23},this),e.jsxDEV("pre",{className:"whitespace-pre-wrap bg-gray-50 p-2 mt-1 rounded border text-xs",children:s.ops_proposed_message},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:153,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:151,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:141,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:129,columnNumber:15},this),e.jsxDEV(ie,{children:[e.jsxDEV(p,{variant:"outline",onClick:()=>D(!1),children:"Cancel"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:161,columnNumber:17},this),e.jsxDEV(p,{onClick:A,disabled:i.isPending,children:i.isPending?"Approving…":"Approve edited response"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:162,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:160,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:122,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:115,columnNumber:11},this),e.jsxDEV(se,{open:d,onOpenChange:P,children:[e.jsxDEV(ve,{asChild:!0,children:e.jsxDEV(p,{variant:"outline",size:"sm",children:[e.jsxDEV(cs,{className:"h-4 w-4 mr-1.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:172,columnNumber:17},this),"Return to Ops"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:171,columnNumber:15},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:170,columnNumber:13},this),e.jsxDEV(oe,{children:[e.jsxDEV(ae,{children:[e.jsxDEV(ne,{children:"Return to the Operation team"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:178,columnNumber:17},this),e.jsxDEV(ce,{children:"The ticket will go back to Ops for revision. Your reason will be added as an internal note so Ops can see the context."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:179,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:177,columnNumber:15},this),e.jsxDEV(re,{placeholder:"Why are you returning this? (required)",value:t,onChange:B=>q(B.target.value),rows:4},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:184,columnNumber:15},this),e.jsxDEV(ie,{children:[e.jsxDEV(p,{variant:"outline",onClick:()=>P(!1),children:"Cancel"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:191,columnNumber:17},this),e.jsxDEV(p,{variant:"destructive",onClick:F,disabled:!t.trim()||g.isPending,children:g.isPending?"Returning…":"Return to Ops"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:192,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:190,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:176,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:169,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:109,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:91,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppResponseReviewBar.tsx",lineNumber:81,columnNumber:5},this)}const Vs=[{value:"amendment",label:"Amendment"},{value:"cancellation",label:"Cancellation"},{value:"name_change",label:"Name change"},{value:"date_change",label:"Date change"},{value:"special_service",label:"Special service"},{value:"refund",label:"Refund"},{value:"complaint",label:"Complaint"},{value:"hcn",label:"HCN"},{value:"pending_ticket",label:"Pending ticket"},{value:"other",label:"Other"}];function Ys({request:s}){const{toast:m}=Re(),i=Fr(),g=Mr(),[S,D]=l.useState(!1),[E,h]=l.useState(!1),[x,O]=l.useState(s.message||""),[d,P]=l.useState(s.request_type||"other"),[t]=l.useState(s.field_changes||[]),q=x!==(s.message||""),L=d!==(s.request_type||""),U=async()=>{try{await i.mutateAsync({requestId:s.id,status:"resolved"}),m({title:"Request resolved",description:"The ticket is closed. The customer will see the resolved status."}),D(!1)}catch(A){m({variant:"destructive",title:"Action failed",description:A.message})}},v=async()=>{try{await g.mutateAsync({requestId:s.id,editedMessage:q?x:void 0,editedRequestType:L?d:void 0}),m({title:"Forwarded to Ops",description:"The Operation team will take over."}),h(!1)}catch(A){m({variant:"destructive",title:"Forward failed",description:A.message})}};return e.jsxDEV(I,{className:"mb-4 border-blue-200 bg-blue-50/40",children:[e.jsxDEV(me,{className:"pb-3",children:e.jsxDEV(pe,{className:"flex items-center gap-2 text-base",children:[e.jsxDEV(Ir,{className:"h-4 w-4 text-blue-700"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:82,columnNumber:11},this),e.jsxDEV("span",{children:"You are handling this request"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:83,columnNumber:11},this),e.jsxDEV(C,{variant:"outline",className:"bg-blue-100 text-blue-800 border-blue-200 text-xs",children:"In progress"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:84,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:81,columnNumber:9},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:80,columnNumber:7},this),e.jsxDEV(z,{className:"space-y-3",children:[e.jsxDEV("p",{className:"text-sm text-muted-foreground",children:"Talk to the customer directly through the message panel below. When you're done you can mark this request as resolved. If you need the Operation team's help, forward it to them at any time."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:90,columnNumber:9},this),e.jsxDEV("div",{className:"flex flex-wrap gap-2",children:[e.jsxDEV(se,{open:S,onOpenChange:D,children:[e.jsxDEV(ve,{asChild:!0,children:e.jsxDEV(p,{size:"sm",children:[e.jsxDEV(ir,{className:"h-4 w-4 mr-1.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:100,columnNumber:17},this),"Mark as resolved"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:99,columnNumber:15},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:98,columnNumber:13},this),e.jsxDEV(oe,{children:[e.jsxDEV(ae,{children:[e.jsxDEV(ne,{children:"Resolve this request?"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:106,columnNumber:17},this),e.jsxDEV(ce,{children:"The ticket will close. The customer will see the resolved status."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:107,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:105,columnNumber:15},this),e.jsxDEV(ie,{children:[e.jsxDEV(p,{variant:"outline",onClick:()=>D(!1),children:"Cancel"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:112,columnNumber:17},this),e.jsxDEV(p,{onClick:U,disabled:i.isPending,children:i.isPending?"Resolving…":"Resolve"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:113,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:111,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:104,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:97,columnNumber:11},this),e.jsxDEV(se,{open:E,onOpenChange:h,children:[e.jsxDEV(ve,{asChild:!0,children:e.jsxDEV(p,{variant:"outline",size:"sm",children:[e.jsxDEV(Ie,{className:"h-4 w-4 mr-1.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:124,columnNumber:17},this),"Forward to Ops"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:123,columnNumber:15},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:122,columnNumber:13},this),e.jsxDEV(oe,{className:"max-w-2xl",children:[e.jsxDEV(ae,{children:[e.jsxDEV(ne,{children:"Hand this ticket to the Operation team"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:130,columnNumber:17},this),e.jsxDEV(ce,{children:"Edit the message or request type before forwarding if needed. Ops will take over from here."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:131,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:129,columnNumber:15},this),e.jsxDEV("div",{className:"space-y-4",children:[e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-sm font-medium mb-1 block",children:"Request type"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:139,columnNumber:19},this),e.jsxDEV(xe,{value:d,onValueChange:P,children:[e.jsxDEV(fe,{children:e.jsxDEV(Ee,{},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:141,columnNumber:36},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:141,columnNumber:21},this),e.jsxDEV(Oe,{children:Vs.map(A=>e.jsxDEV(Y,{value:A.value,children:A.label},A.value,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:144,columnNumber:25},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:142,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:140,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:138,columnNumber:17},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-sm font-medium mb-1 block",children:["Message ",q&&e.jsxDEV("span",{className:"text-amber-700",children:"(edited)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:151,columnNumber:43},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:150,columnNumber:19},this),e.jsxDEV(re,{value:x,onChange:A=>O(A.target.value),rows:6},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:153,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:149,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:137,columnNumber:15},this),e.jsxDEV(ie,{children:[e.jsxDEV(p,{variant:"outline",onClick:()=>h(!1),children:"Cancel"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:162,columnNumber:17},this),e.jsxDEV(p,{onClick:v,disabled:g.isPending,children:g.isPending?"Forwarding…":"Forward to Ops"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:163,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:161,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:128,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:121,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:95,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:89,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/AppHandlingBar.tsx",lineNumber:79,columnNumber:5},this)}function Gs({deadline:s,className:m=""}){if(!s)return e.jsxDEV(C,{variant:"outline",className:`bg-gray-100 text-gray-600 ${m}`,children:"No SLA"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlineBadge.tsx",lineNumber:18,columnNumber:12},this);const i=typeof s=="string"?new Date(s):s;if(isNaN(i.getTime()))return e.jsxDEV(C,{variant:"outline",className:`bg-gray-100 text-gray-600 ${m}`,children:"No SLA"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlineBadge.tsx",lineNumber:22,columnNumber:12},this);const g=Date.now(),S=i.getTime()-g,D=Math.round(S/6e4);let E="bg-emerald-100 text-emerald-800 border-emerald-200",h=qe,x;if(S<=0){E="bg-red-100 text-red-800 border-red-200",h=tr;const O=Math.abs(D);x=O>=60?`${Math.round(O/60)}h overdue`:`${O}m overdue`}else if(D<=30)E="bg-amber-100 text-amber-800 border-amber-200",h=qr,x=`${D}m left`;else{const O=Math.floor(D/60),d=D%60;x=O>0?`${O}h ${d}m left`:`${D}m left`}return e.jsxDEV(C,{className:`${E} border text-xs font-medium inline-flex items-center gap-1 ${m}`,children:[e.jsxDEV(h,{className:"h-3 w-3"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlineBadge.tsx",lineNumber:49,columnNumber:7},this),x]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/DeadlineBadge.tsx",lineNumber:48,columnNumber:5},this)}function ws({requestId:s}){var Er,Or,Ar;const{toast:m}=Re(),{profile:i}=Br(),{loginContext:g}=Tr(),S=ar(),{isOps:D,canAssignTickets:E,canDoOpsActions:h,isAppUser:x}=At(),O=Bt(),d=l.useRef(null),P=l.useRef(null),{data:t,isLoading:q}=Tt(s),{data:L=[]}=$t(s),{data:U=[]}=Mt(s),{data:v=[]}=Ft(s),{data:A=[]}=Ht(t==null?void 0:t.status),{data:F=[]}=It(s),{data:k=[]}=ts(),j=zt(),B=Kt(),Q=Qt(),he=Wt(),de=Xt(),G=Fr(),le=Jt(),ge=Zt(),Ae=es(),Ce=rs(),[Ne,n]=l.useState(!1);l.useRef(null);const y=l.useRef(null),[c,V]=l.useState(""),[b,T]=l.useState("customer"),[$,Pe]=l.useState(""),[Z,be]=l.useState(""),[Se,De]=l.useState(""),[u,N]=l.useState("charge"),[M,w]=l.useState("0"),[W,ye]=l.useState("0"),[ee,te]=l.useState("0"),[X,o]=l.useState(""),[R,je]=l.useState(""),[lr,ur]=l.useState(""),[_s,mr]=l.useState(""),[zr,Ke]=l.useState(!1);l.useEffect(()=>{var r;(r=d.current)==null||r.scrollIntoView({behavior:"smooth"})},[L]),l.useEffect(()=>{var r;(r=P.current)==null||r.scrollIntoView({behavior:"smooth"})},[U]),l.useEffect(()=>{s&&(i!=null&&i.id)&&Ct(s,i.id).catch(()=>{})},[s,i==null?void 0:i.id]),l.useEffect(()=>{if(!(t!=null&&t.deadline))return;const r=setInterval(()=>{const a=new Date().getTime(),_=new Date(t.deadline).getTime()-a;if(_<=0){mr("EXPIRED");return}const J=Math.floor(_/(1e3*60*60*24)),Ue=Math.floor(_%(1e3*60*60*24)/(1e3*60*60)),H=Math.floor(_%(1e3*60*60)/(1e3*60)),K=Math.floor(_%(1e3*60)/1e3);mr(`${J>0?J+" days ":""}${String(Ue).padStart(2,"0")}:${String(H).padStart(2,"0")}:${String(K).padStart(2,"0")}`)},1e3);return()=>clearInterval(r)},[t==null?void 0:t.deadline]);const[pr,Kr]=l.useState([]),[Te,Qe]=l.useState([]),Qr=async r=>{const a=Array.from(r.target.files||[]);for(const f of a)try{const _=await Ce.mutateAsync({file:f,requestId:s,folder:"notes"});Qe(J=>[...J,_])}catch(_){console.warn("Upload failed:",_)}y.current&&(y.current.value="")},cr=async()=>{if(c.trim())try{let r;if(g==="app"){const f=t.created_by_type==="client",_=t.triage_state==="approved_by_app"||t.triage_state==="pending_app_response_review";f?_?r=b:r="customer":r="ops"}const a=await j.mutateAsync({requestId:s,message:c,attachments:pr.length>0?pr:void 0,recipient:r});V(""),Kr([]),a!=null&&a.internal&&(m({title:"Sent to support team",description:`Delivered to ${g==="system"?"App user":"Ops"}. The customer won't see this.`}),S.invalidateQueries({queryKey:["support-internal-notes",s]}))}catch(r){m({variant:"destructive",title:"Error",description:r.message})}},dr=async()=>{if(!$.trim()){m({variant:"destructive",title:"Error",description:"Please enter a comment"});return}try{await Q.mutateAsync({requestId:s,comment:$,taskType:Z||void 0,attachments:Te.length>0?Te:void 0}),Pe(""),be(""),Qe([]),m({title:"Note added successfully"})}catch(r){console.error("Failed to add note:",r),m({variant:"destructive",title:"Error adding note",description:r.message||"Unknown error"})}},Wr=async()=>{const r=(Number(M)||0)+(Number(W)||0)+(Number(ee)||0),a=R!==""&&!Number.isNaN(Number(R)),f=a?Number(R):r;try{await de.mutateAsync({requestId:s,chargeType:u,supplierCost:Number(M)||0,otherServices:Number(W)||0,serviceFee:Number(ee)||0,netAmount:X!==""?Number(X):null,saleAmount:a?Number(R):null,total:f,currency:(t==null?void 0:t.currency)||"USD",message:lr}),w("0"),ye("0"),te("0"),o(""),je(""),ur(""),m({title:"Charge saved"})}catch(_){m({variant:"destructive",title:"Error",description:_.message})}},Xr=async()=>{if(Se)try{await G.mutateAsync({requestId:s,status:Se}),De(""),m({title:"Status updated"})}catch(r){m({variant:"destructive",title:"Error",description:r.message})}},Jr=async r=>{const a=k.find(f=>f.id===r);if(a)try{await le.mutateAsync({requestId:s,agentId:a.id,agentName:`${a.first_name} ${a.last_name}`.trim()}),m({title:"Agent assigned"})}catch(f){m({variant:"destructive",title:"Error",description:f.message})}},br=r=>{var a;return((a=_e[r])==null?void 0:a.color)||"bg-gray-100 text-gray-800"},Le=r=>{var a;return((a=_e[r])==null?void 0:a.label)||r},Ve=r=>{if(!r)return"-";try{return ke(new Date(r),"dd. MMM. yyyy. hh:mm a")}catch{return String(r)}},We=new Map,Sr=new Map;for(const r of k){const a=`${r.first_name||""} ${r.last_name||""}`.trim()||r.email||r.id;r.id&&We.set(r.id,a),r.email&&Sr.set(r.email.toLowerCase(),a)}const Zr=r=>{if(r.performed_by&&We.has(r.performed_by))return We.get(r.performed_by);const a=r.performed_by_name||"";if(a.includes("@")){const f=Sr.get(a.toLowerCase());if(f)return f}return a||"System"},et=r=>{var _,J,Ue;const a=Zr(r),f=(H,K)=>H&&K?`${Le(H)} → ${Le(K)}`:K?Le(K):"";switch(r.action_type){case"status_change":return`${a} changed status: ${f(r.old_value,r.new_value)}`;case"assignment":{const H=r.old_value||"Unassigned",K=r.new_value||"Unassigned";return H==="Unassigned"&&K!=="Unassigned"?`${a} assigned the ticket to ${K}`:K==="Unassigned"?`${a} unassigned ${H}`:`${a} reassigned ${H} → ${K}`}case"auto_claimed":return`${a} auto-claimed the ticket`;case"forwarded_to_ops":return`${a} forwarded the ticket to Ops`;case"handled_by_app":return`${a} marked the ticket as handled by App`;case"rejected_by_app":return`${a} rejected the ticket${(_=r.metadata)!=null&&_.reason?` (${r.metadata.reason})`:""}`;case"app_resubmitted_by_creator":return`${a} resubmitted the ticket for App review`;case"app_returned_to_ops":return`${a} returned the response to Ops${(J=r.metadata)!=null&&J.reason?` (${r.metadata.reason})`:""}`;case"app_approved_ops_response":return`${a} approved the Ops response`;case"ops_proposed_response":return`${a} proposed a response: ${f(r.old_value,r.new_value)}`;case"message_sent":return`${a} sent a ${r.new_value||"agent"} message`;case"internal_message":return`${a} sent an internal note (${r.new_value||"internal"} channel)`;case"note_added":return`${a} added an internal note${r.new_value?` (${r.new_value})`:""}`;case"charge_added":return`${a} recorded ${r.new_value||"a charge"}`;case"approval_proposed":return`${a} proposed an approval (${r.new_value||"change"})`;case"approval_approved":return`${a} approved a proposal`;case"approval_rejected":return`${a} rejected a proposal${(Ue=r.metadata)!=null&&Ue.reason?` (${r.metadata.reason})`:""}`;case"approval_withdrawn":return`${a} withdrew a proposal`;case"approval_relayed_to_customer":return`${a} relayed the proposal to the customer`;default:{const H=f(r.old_value,r.new_value);return`${a} — ${r.action_type}${H?`: ${H}`:""}`}}},rt=(Number(M)||0)+(Number(W)||0)+(Number(ee)||0),yr=R!==""&&!Number.isNaN(Number(R)),hr=yr?Number(R):rt,Xe=yr&&X!==""&&!Number.isNaN(Number(X))?Number(R)-Number(X):null,gr=l.useMemo(()=>{const r=U.filter(a=>a.audience==="app_ops").map(a=>({id:a.id,request_id:a.request_id,sender_id:a.agent_id,sender_type:a.task_type==="ops_to_app"?"agent":"app",sender_name:a.agent_name,message:a.comment,attachments:a.attachments||[],is_deleted:!1,created_at:a.created_at,__from_internal:!0,__direction:a.task_type}));return[...L,...r].sort((a,f)=>new Date(a.created_at).getTime()-new Date(f.created_at).getTime())},[L,U]),Je=l.useMemo(()=>U.filter(r=>(r.audience||"ops_only")==="ops_only"),[U]);if(q)return e.jsxDEV("div",{className:"flex items-center justify-center h-64",children:e.jsxDEV("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:448,columnNumber:67},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:448,columnNumber:12},this);if(!t)return e.jsxDEV("div",{className:"text-center py-12 text-gray-500",children:"Support request not found"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:452,columnNumber:12},this);const Nr=g==="system",Ye=t.status==="pending_app_review",Ge=t.triage_state==="pending_app_response_review",Dr=t.triage_state==="rejected_by_app",$e=t.triage_state==="handled_by_app",we=(i==null?void 0:i.id)&&i.id===t.created_by,vr=we&&Dr&&(t.app_review_resubmit_count||0)<1,xr=["resolved","closed","rejected"].includes(t.status),tt=g==="agent"?"client":g==="app"?"app":"agent",st=(()=>{let r=0;for(let a=L.length-1;a>=0&&L[a].sender_type===tt;a--)r++;return r})(),fr=g==="system"&&Ge,ot=!xr&&!fr&&st<2;return e.jsxDEV("div",{className:"space-y-4 h-[calc(100vh-140px)] flex flex-col",children:[Ye&&x&&e.jsxDEV(Cs,{request:t},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:499,columnNumber:9},this),$e&&x&&e.jsxDEV(Ys,{request:t},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:502,columnNumber:9},this),Ge&&x&&e.jsxDEV(Ls,{request:t},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:505,columnNumber:9},this),Dr&&e.jsxDEV(I,{className:"border-red-200 bg-red-50/40 shrink-0",children:e.jsxDEV(z,{className:"p-4 flex flex-wrap items-center gap-3",children:[e.jsxDEV(Be,{className:"h-5 w-5 text-red-700"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:510,columnNumber:13},this),e.jsxDEV("div",{className:"flex-1 min-w-[240px]",children:[e.jsxDEV("div",{className:"text-sm font-medium text-red-900",children:"Rejected by the App reviewer"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:512,columnNumber:15},this),t.rejection_reason&&e.jsxDEV("div",{className:"text-sm text-red-800 mt-0.5",children:["Reason: ",t.rejection_reason]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:516,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:511,columnNumber:13},this),vr&&e.jsxDEV(p,{size:"sm",variant:"outline",onClick:async()=>{try{await O.mutateAsync({requestId:s}),m({title:"Resubmitted for review",description:"Your request is back in the App reviewer queue."})}catch(r){m({title:"Resubmit failed",description:r.message,variant:"destructive"})}},disabled:O.isPending,children:[e.jsxDEV(hs,{className:"h-4 w-4 mr-1.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:535,columnNumber:17},this),O.isPending?"Resubmitting…":"Request another review"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:522,columnNumber:15},this),!vr&&we&&e.jsxDEV("span",{className:"text-xs text-red-700",children:"Re-submission limit reached."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:540,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:509,columnNumber:11},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:508,columnNumber:9},this),Ye&&!x&&we&&e.jsxDEV(I,{className:"border-amber-200 bg-amber-50/40 shrink-0",children:e.jsxDEV(z,{className:"p-4 flex items-center gap-2",children:[e.jsxDEV(ds,{className:"h-4 w-4 text-amber-700"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:548,columnNumber:13},this),e.jsxDEV("span",{className:"text-sm text-amber-900",children:"Your request is awaiting review by the Support Team. You'll be notified when they act on it."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:549,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:547,columnNumber:11},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:546,columnNumber:9},this),e.jsxDEV(I,{className:"border-l-4 border-l-orange-400 shrink-0",children:e.jsxDEV(z,{className:"p-4",children:e.jsxDEV("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-2",children:[e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Agency Name"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:562,columnNumber:17},this),e.jsxDEV("div",{className:"flex items-center gap-1.5",children:[e.jsxDEV("span",{className:"font-semibold text-sm",children:t.company_name||(t.passenger_details&&Array.isArray(t.passenger_details)&&t.passenger_details.length>0?`${((Er=t.passenger_details[0])==null?void 0:Er.first_name)||""} ${((Or=t.passenger_details[0])==null?void 0:Or.last_name)||""}`.trim():"-")},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:564,columnNumber:19},this),e.jsxDEV("button",{className:"bg-blue-500 text-white rounded-full w-4 h-4 flex items-center justify-center text-[9px]",title:"Agency info",children:"i"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:572,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:563,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:561,columnNumber:15},this),e.jsxDEV("div",{className:"h-8 w-px bg-gray-200"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:576,columnNumber:15},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Booking ID"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:580,columnNumber:17},this),e.jsxDEV("a",{href:`/bookings/${t.booking_id||t.booking_code}`,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium text-blue-600 hover:underline block",children:t.booking_id||t.booking_code},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:581,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:579,columnNumber:15},this),e.jsxDEV("div",{className:"h-8 w-px bg-gray-200"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:587,columnNumber:15},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Deposit"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:591,columnNumber:17},this),e.jsxDEV(C,{className:`text-xs block w-fit ${t.credit_line_status==="blocked"?"bg-red-100 text-red-800":"bg-green-100 text-green-800"}`,children:t.credit_line_status||"Active"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:592,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:590,columnNumber:15},this),D&&e.jsxDEV(e.Fragment,{children:[e.jsxDEV("div",{className:"h-8 w-px bg-gray-200"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:602,columnNumber:19},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Supplier"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:604,columnNumber:21},this),(()=>{var a;let r=t.supplier_name;if(!r&&t.booking_details){const f=t.booking_details;r=f.supplier_code||f.supplier_source||((a=f.supplier_info)==null?void 0:a.supplier_name)||f.airline||""}return e.jsxDEV("div",{className:"flex items-center gap-1.5",children:[e.jsxDEV("span",{className:"text-sm font-medium",children:r||"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:613,columnNumber:27},this),t.product_type&&e.jsxDEV(C,{variant:"outline",className:"text-[10px]",children:t.product_type},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:614,columnNumber:52},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:612,columnNumber:25},this)})()]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:603,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:601,columnNumber:17},this),e.jsxDEV("div",{className:"h-8 w-px bg-gray-200"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:622,columnNumber:15},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Product"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:626,columnNumber:17},this),e.jsxDEV("div",{className:"flex items-center gap-1.5",children:[t.product_type==="hotel"?e.jsxDEV(sr,{className:"h-3.5 w-3.5 text-blue-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:628,columnNumber:55},this):t.product_type==="flight"?e.jsxDEV(or,{className:"h-3.5 w-3.5 text-purple-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:628,columnNumber:141},this):null,e.jsxDEV("span",{className:"text-sm capitalize font-medium",children:t.product_type||"Booking"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:629,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:627,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:625,columnNumber:15},this),e.jsxDEV("div",{className:"h-8 w-px bg-gray-200"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:633,columnNumber:15},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Deadline"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:643,columnNumber:17},this),e.jsxDEV("div",{className:"flex items-center gap-2",children:[e.jsxDEV(Gs,{deadline:t.deadline},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:645,columnNumber:19},this),(h||g==="app")&&e.jsxDEV(e.Fragment,{children:[e.jsxDEV(p,{variant:"outline",size:"sm",className:"text-xs h-6 px-2",onClick:()=>ge.mutate({requestId:s}),title:"Extend deadline by 24h",children:"Extend"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:648,columnNumber:23},this),e.jsxDEV(Ns,{value:t.deadline,disabled:Ae.isPending,onSave:async r=>{try{await Ae.mutateAsync({requestId:s,deadlineIso:r}),m({title:"Deadline updated"})}catch(a){m({variant:"destructive",title:"Error",description:a.message})}}},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:657,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:647,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:644,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:642,columnNumber:15},this),e.jsxDEV("div",{className:"h-8 w-px bg-gray-200"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:674,columnNumber:15},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Assigned"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:678,columnNumber:17},this),e.jsxDEV("div",{className:"text-sm font-medium",children:t.assigned_agent_name||e.jsxDEV("span",{className:"text-gray-400",children:"Unassigned"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:680,columnNumber:51},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:679,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:677,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:559,columnNumber:13},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:558,columnNumber:11},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:557,columnNumber:7},this),e.jsxDEV("div",{className:"grid grid-cols-12 gap-4 flex-1 min-h-0 overflow-hidden",children:[e.jsxDEV("div",{className:"col-span-4 overflow-y-auto space-y-4",children:[E&&!Ye&&!Ge&&!$e&&e.jsxDEV(I,{children:e.jsxDEV(z,{className:"p-3",children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Assign Agent"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:706,columnNumber:17},this),e.jsxDEV(xe,{value:t.assigned_agent||"",onValueChange:Jr,children:[e.jsxDEV(fe,{className:"text-sm h-8 mt-1",children:e.jsxDEV(Ee,{placeholder:"Assign agent..."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:709,columnNumber:21},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:708,columnNumber:19},this),e.jsxDEV(Oe,{children:k.map(r=>e.jsxDEV(Y,{value:r.id,children:[r.first_name," ",r.last_name," (",r.role,")"]},r.id,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:713,columnNumber:23},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:711,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:707,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:705,columnNumber:15},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:704,columnNumber:13},this),e.jsxDEV(I,{children:[e.jsxDEV(me,{className:"p-3 cursor-pointer",children:e.jsxDEV(pe,{className:"text-sm flex items-center justify-between",children:["Request ",e.jsxDEV(Ze,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:727,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:726,columnNumber:15},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:725,columnNumber:13},this),e.jsxDEV(z,{className:"p-4 pt-0 space-y-3",children:[e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Request"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:732,columnNumber:15},this),e.jsxDEV(C,{className:"bg-orange-400 text-white text-xs block w-fit mt-1",children:t.request_title||t.request_type||"General"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:733,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:731,columnNumber:13},this),e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Message"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:736,columnNumber:15},this),e.jsxDEV("div",{className:"text-sm mt-1 p-2 bg-gray-50 rounded border text-gray-700 min-h-[60px]",children:t.message||"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:737,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:735,columnNumber:13},this),e.jsxDEV("div",{className:"text-xs divide-y divide-gray-100 border rounded-md overflow-hidden bg-white",children:[e.jsxDEV("div",{className:"flex items-center justify-between px-2.5 py-1.5",children:[e.jsxDEV("span",{className:"text-gray-500",children:"Request #"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:746,columnNumber:17},this),e.jsxDEV("span",{className:"font-mono text-gray-800",children:t.request_number||"-"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:747,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:745,columnNumber:15},this),e.jsxDEV("div",{className:"flex items-center justify-between px-2.5 py-1.5",children:[e.jsxDEV("span",{className:"text-gray-500",children:"Created"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:750,columnNumber:17},this),e.jsxDEV("span",{className:"text-gray-800",children:Ve(t.created_at)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:751,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:749,columnNumber:15},this),e.jsxDEV("div",{className:"flex items-center justify-between px-2.5 py-1.5",children:[e.jsxDEV("span",{className:"text-gray-500",children:"Status"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:754,columnNumber:17},this),e.jsxDEV(C,{className:`${br(t.status)} text-[10px]`,children:Le(t.status)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:755,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:753,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:744,columnNumber:13},this),t.passenger_details&&e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"passengers"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:762,columnNumber:17},this),e.jsxDEV("div",{className:"mt-1 space-y-1",children:(Array.isArray(t.passenger_details)?t.passenger_details:[t.passenger_details]).map((r,a)=>e.jsxDEV("div",{className:"flex items-center gap-2 text-sm",children:[e.jsxDEV(He,{className:"h-3 w-3"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:766,columnNumber:23},this),e.jsxDEV("span",{className:"font-medium",children:[r.first_name," ",r.last_name]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:767,columnNumber:23},this),e.jsxDEV(C,{variant:"outline",className:"text-xs",children:r.type||"adult"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:768,columnNumber:23},this)]},a,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:765,columnNumber:21},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:763,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:761,columnNumber:15},this),t.field_changes&&t.field_changes.length>0&&e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500 font-semibold",children:"Requested Changes"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:778,columnNumber:17},this),e.jsxDEV("div",{className:"mt-1",children:e.jsxDEV(ss,{changes:t.field_changes},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:780,columnNumber:19},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:779,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:777,columnNumber:15},this),t.booking_details&&e.jsxDEV("div",{children:[e.jsxDEV("label",{className:"text-xs text-gray-500",children:"Booking item"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:788,columnNumber:17},this),e.jsxDEV("div",{className:"mt-1 p-2 bg-gray-50 rounded border text-sm space-y-1.5",children:[(t.product_type==="flight"||t.booking_details.route||t.booking_details.pnr)&&e.jsxDEV(e.Fragment,{children:[e.jsxDEV("div",{className:"flex items-center gap-1.5",children:[e.jsxDEV(or,{className:"h-3.5 w-3.5 text-purple-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:794,columnNumber:25},this),e.jsxDEV("span",{className:"font-medium",children:t.booking_details.route||"Flight"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:795,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:793,columnNumber:23},this),e.jsxDEV("div",{className:"grid grid-cols-2 gap-x-3 gap-y-1 text-xs text-gray-600",children:[t.booking_details.pnr&&e.jsxDEV("div",{children:["PNR: ",e.jsxDEV("span",{className:"font-mono font-medium text-gray-800",children:t.booking_details.pnr},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:798,columnNumber:67},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:798,columnNumber:57},this),t.booking_details.airline&&e.jsxDEV("div",{children:["Airline: ",e.jsxDEV("span",{className:"font-medium",children:t.booking_details.airline},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:799,columnNumber:75},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:799,columnNumber:61},this),t.booking_details.flight_number&&e.jsxDEV("div",{children:["Flight: ",e.jsxDEV("span",{className:"font-medium",children:t.booking_details.flight_number},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:800,columnNumber:80},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:800,columnNumber:67},this),t.booking_details.cabin_class&&e.jsxDEV("div",{children:["Class: ",e.jsxDEV("span",{className:"font-medium",children:t.booking_details.cabin_class},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:801,columnNumber:77},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:801,columnNumber:65},this),t.booking_details.departure_date&&e.jsxDEV("div",{children:["Departure: ",e.jsxDEV("span",{className:"font-medium",children:new Date(t.booking_details.departure_date).toLocaleDateString()},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:802,columnNumber:84},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:802,columnNumber:68},this),t.booking_details.baggage&&e.jsxDEV("div",{children:["Baggage: ",e.jsxDEV("span",{className:"font-medium",children:t.booking_details.baggage},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:803,columnNumber:75},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:803,columnNumber:61},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:797,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:792,columnNumber:21},this),(t.product_type==="hotel"||t.product_type==="stopover"||t.booking_details.hotel_name)&&e.jsxDEV(e.Fragment,{children:[e.jsxDEV("div",{className:"flex items-center gap-1.5",children:[e.jsxDEV(sr,{className:"h-3.5 w-3.5 text-blue-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:811,columnNumber:25},this),e.jsxDEV("span",{className:"font-medium",children:t.booking_details.hotel_name||"Hotel"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:812,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:810,columnNumber:23},this),t.booking_details.booking_ref&&e.jsxDEV("div",{className:"text-xs text-gray-500",children:["Ref: ",t.booking_details.booking_ref]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:814,columnNumber:63},this),t.booking_details.room_name&&e.jsxDEV("div",{className:"text-xs text-gray-600",children:["Room: ",t.booking_details.room_name]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:815,columnNumber:61},this),t.booking_details.board_basis&&e.jsxDEV("div",{className:"text-xs text-gray-600",children:["Board: ",t.booking_details.board_basis]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:816,columnNumber:63},this),t.booking_details.check_in&&e.jsxDEV("div",{className:"grid grid-cols-2 gap-2 text-xs mt-1",children:[e.jsxDEV("div",{children:["Check-in: ",e.jsxDEV("span",{className:"font-medium",children:t.booking_details.check_in},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:819,columnNumber:42},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:819,columnNumber:27},this),e.jsxDEV("div",{children:["Check-out: ",e.jsxDEV("span",{className:"font-medium",children:t.booking_details.check_out},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:820,columnNumber:43},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:820,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:818,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:809,columnNumber:21},this),t.product_type==="transfer"&&e.jsxDEV(e.Fragment,{children:[e.jsxDEV("div",{className:"flex items-center gap-1.5",children:[e.jsxDEV(Ur,{className:"h-3.5 w-3.5 text-green-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:829,columnNumber:25},this),e.jsxDEV("span",{className:"font-medium",children:[t.booking_details.pickup_location," → ",t.booking_details.dropoff_location]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:830,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:828,columnNumber:23},this),t.booking_details.transfer_date&&e.jsxDEV("div",{className:"text-xs text-gray-600",children:["Date: ",t.booking_details.transfer_date]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:832,columnNumber:65},this),t.booking_details.vehicle_type&&e.jsxDEV("div",{className:"text-xs text-gray-600",children:["Vehicle: ",t.booking_details.vehicle_type]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:833,columnNumber:64},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:827,columnNumber:21},this),t.product_type==="tour"&&e.jsxDEV(e.Fragment,{children:[e.jsxDEV("div",{className:"flex items-center gap-1.5",children:[e.jsxDEV(Ur,{className:"h-3.5 w-3.5 text-amber-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:840,columnNumber:25},this),e.jsxDEV("span",{className:"font-medium",children:t.booking_details.tour_name||"Tour"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:841,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:839,columnNumber:23},this),t.booking_details.tour_date&&e.jsxDEV("div",{className:"text-xs text-gray-600",children:["Date: ",t.booking_details.tour_date]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:843,columnNumber:61},this),t.booking_details.duration&&e.jsxDEV("div",{className:"text-xs text-gray-600",children:["Duration: ",t.booking_details.duration]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:844,columnNumber:60},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:838,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:789,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:787,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:730,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:724,columnNumber:11},this),(D||g==="app")&&e.jsxDEV(Rs,{supportRequestId:s,bookingCode:t.booking_code||null},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:856,columnNumber:11},this),(D||g==="app")&&F.length>0&&e.jsxDEV(I,{children:[e.jsxDEV(me,{className:"p-3",children:e.jsxDEV(pe,{className:"text-sm flex items-center gap-2",children:[e.jsxDEV(bs,{className:"h-4 w-4 text-gray-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:873,columnNumber:17},this),"Activity History",e.jsxDEV(C,{variant:"outline",className:"ml-auto text-[10px]",children:F.length},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:875,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:872,columnNumber:15},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:871,columnNumber:13},this),e.jsxDEV(z,{className:"p-3 pt-0",children:e.jsxDEV("div",{className:"space-y-1.5 max-h-[400px] overflow-y-auto pr-1",children:F.map(r=>e.jsxDEV("div",{className:"flex items-start gap-2 text-xs py-1.5 px-2 rounded border border-gray-100 bg-gray-50/50 hover:bg-gray-50",children:[e.jsxDEV("span",{className:"mt-0.5 inline-block h-1.5 w-1.5 rounded-full bg-orange-400 shrink-0","aria-hidden":!0},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:887,columnNumber:21},this),e.jsxDEV("div",{className:"flex-1 min-w-0",children:[e.jsxDEV("div",{className:"text-gray-800 leading-snug break-words",children:et(r)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:889,columnNumber:23},this),e.jsxDEV("div",{className:"text-[10px] text-gray-400 mt-0.5",children:Ve(r.created_at)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:892,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:888,columnNumber:21},this)]},r.id,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:883,columnNumber:19},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:881,columnNumber:15},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:880,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:870,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:699,columnNumber:9},this),e.jsxDEV("div",{className:`${Nr?"col-span-5":"col-span-8"} overflow-y-auto space-y-4`,children:[(D||g==="app")&&e.jsxDEV(Us,{requestId:s,createdByType:t.created_by_type},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:909,columnNumber:11},this),h&&e.jsxDEV(I,{children:[e.jsxDEV(me,{className:"p-3",children:e.jsxDEV(pe,{className:"text-sm flex items-center justify-between",children:["Charges & Refunds ",e.jsxDEV(Ze,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:917,columnNumber:33},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:916,columnNumber:13},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:915,columnNumber:11},this),e.jsxDEV(z,{className:"p-4 pt-0 space-y-3",children:[e.jsxDEV("p",{className:"text-xs text-gray-500",children:"Record any additional charges or refunds related to this support request."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:921,columnNumber:13},this),e.jsxDEV("div",{className:"flex rounded-lg border overflow-hidden",children:[e.jsxDEV("button",{className:`flex-1 text-sm py-2 px-3 font-medium transition-colors ${u==="charge"?"bg-orange-500 text-white":"bg-white text-gray-600 hover:bg-gray-50"}`,onClick:()=>N("charge"),children:"💰 Charge Client"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:925,columnNumber:15},this),e.jsxDEV("button",{className:`flex-1 text-sm py-2 px-3 font-medium transition-colors ${u==="refund"?"bg-green-600 text-white":"bg-white text-gray-600 hover:bg-gray-50"}`,onClick:()=>N("refund"),children:"↩ Refund Client"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:931,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:924,columnNumber:13},this),e.jsxDEV("div",{className:`text-xs p-2 rounded ${u==="charge"?"bg-orange-50 text-orange-700":"bg-green-50 text-green-700"}`,children:u==="charge"?"Add costs that will be charged to the client for this amendment/service.":"Record a refund amount to be returned to the client."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:940,columnNumber:13},this),e.jsxDEV("div",{className:"space-y-2",children:[e.jsxDEV("div",{className:"flex items-center justify-between",children:[e.jsxDEV("label",{className:"text-sm text-gray-600",children:"Supplier cost"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:949,columnNumber:17},this),e.jsxDEV("div",{className:"flex items-center gap-1",children:[e.jsxDEV(ue,{type:"number",value:M,onChange:r=>w(r.target.value),className:"w-24 h-8 text-right text-sm"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:951,columnNumber:19},this),e.jsxDEV("span",{className:"text-xs text-gray-500 w-8",children:t.currency||"USD"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:952,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:950,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:948,columnNumber:15},this),e.jsxDEV("div",{className:"flex items-center justify-between",children:[e.jsxDEV("label",{className:"text-sm text-gray-600",children:"Other services"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:956,columnNumber:17},this),e.jsxDEV("div",{className:"flex items-center gap-1",children:[e.jsxDEV(ue,{type:"number",value:W,onChange:r=>ye(r.target.value),className:"w-24 h-8 text-right text-sm"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:958,columnNumber:19},this),e.jsxDEV("span",{className:"text-xs text-gray-500 w-8",children:t.currency||"USD"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:959,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:957,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:955,columnNumber:15},this),e.jsxDEV("div",{className:"flex items-center justify-between",children:[e.jsxDEV("label",{className:"text-sm text-gray-600",children:"Service fee"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:963,columnNumber:17},this),e.jsxDEV("div",{className:"flex items-center gap-1",children:[e.jsxDEV(ue,{type:"number",value:ee,onChange:r=>te(r.target.value),className:"w-24 h-8 text-right text-sm"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:965,columnNumber:19},this),e.jsxDEV("span",{className:"text-xs text-gray-500 w-8",children:t.currency||"USD"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:966,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:964,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:962,columnNumber:15},this),e.jsxDEV("div",{className:"border-t pt-3 mt-2 space-y-2",children:[e.jsxDEV("div",{className:"flex items-center gap-2 text-xs font-medium text-gray-600 mb-1",children:["Net / Sale price",e.jsxDEV("span",{className:"text-[10px] font-normal text-gray-400",children:"(optional — sale overrides total when set)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:976,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:974,columnNumber:17},this),e.jsxDEV("div",{className:"flex items-center justify-between",children:[e.jsxDEV("label",{className:"text-sm text-gray-600",children:"Net (supplier)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:981,columnNumber:19},this),e.jsxDEV("div",{className:"flex items-center gap-1",children:[e.jsxDEV(ue,{type:"number",step:"0.01",placeholder:"—",value:X,onChange:r=>o(r.target.value),className:"w-24 h-8 text-right text-sm"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:983,columnNumber:21},this),e.jsxDEV("span",{className:"text-xs text-gray-500 w-8",children:t.currency||"USD"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:991,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:982,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:980,columnNumber:17},this),e.jsxDEV("div",{className:"flex items-center justify-between",children:[e.jsxDEV("label",{className:"text-sm text-gray-600",children:"Sale (client)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:995,columnNumber:19},this),e.jsxDEV("div",{className:"flex items-center gap-1",children:[e.jsxDEV(ue,{type:"number",step:"0.01",placeholder:"—",value:R,onChange:r=>je(r.target.value),className:"w-24 h-8 text-right text-sm"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:997,columnNumber:21},this),e.jsxDEV("span",{className:"text-xs text-gray-500 w-8",children:t.currency||"USD"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1005,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:996,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:994,columnNumber:17},this),Xe!=null&&e.jsxDEV("div",{className:"flex items-center justify-between text-xs bg-gray-50 px-2 py-1 rounded",children:[e.jsxDEV("span",{className:"text-gray-500",children:"Margin"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1010,columnNumber:21},this),e.jsxDEV("span",{className:`font-mono font-semibold ${Xe>=0?"text-green-700":"text-red-600"}`,children:[Xe.toFixed(2)," ",t.currency||"USD"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1011,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1009,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:973,columnNumber:15},this),e.jsxDEV("div",{className:`flex items-center justify-between font-semibold p-2 rounded ${u==="charge"?"bg-orange-50":"bg-green-50"}`,children:[e.jsxDEV("label",{className:"text-sm",children:["Total ",u==="charge"?"Charge":"Refund"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1019,columnNumber:17},this),e.jsxDEV("div",{className:"flex items-center gap-1",children:[e.jsxDEV("div",{className:`w-24 h-8 border rounded px-2 flex items-center justify-end text-sm font-bold ${u==="charge"?"bg-orange-100 text-orange-700 border-orange-200":"bg-green-100 text-green-700 border-green-200"}`,children:hr.toFixed(2)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1021,columnNumber:19},this),e.jsxDEV("span",{className:"text-xs text-gray-500 w-8",children:t.currency||"USD"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1024,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1020,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1018,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:947,columnNumber:13},this),e.jsxDEV(re,{placeholder:"Add a note about this charge/refund...",value:lr,onChange:r=>ur(r.target.value),className:"text-sm",rows:2},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1029,columnNumber:13},this),e.jsxDEV(p,{className:`w-full text-white ${u==="charge"?"bg-orange-500 hover:bg-orange-600":"bg-green-600 hover:bg-green-700"}`,onClick:Wr,disabled:hr===0,children:u==="charge"?"Save Charge":"Save Refund"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1031,columnNumber:13},this),v.length>0&&e.jsxDEV("div",{className:"border-t pt-3 space-y-2",children:[e.jsxDEV("label",{className:"text-xs text-gray-500 font-medium",children:"History"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1042,columnNumber:17},this),v.map(r=>e.jsxDEV("div",{className:`text-xs p-2 rounded border ${r.charge_type==="refund"?"bg-green-50 border-green-200":"bg-orange-50 border-orange-200"}`,children:[e.jsxDEV("div",{className:"flex justify-between items-center",children:[e.jsxDEV(C,{className:`text-[10px] ${r.charge_type==="refund"?"bg-green-100 text-green-700":"bg-orange-100 text-orange-700"}`,children:r.charge_type==="refund"?"↩ Refund":"💰 Charge"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1046,columnNumber:23},this),e.jsxDEV("span",{className:"font-bold",children:[Number(r.total||0).toFixed(2)," ",r.currency]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1049,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1045,columnNumber:21},this),(r.net_amount!=null||r.sale_amount!=null)&&e.jsxDEV("div",{className:"flex gap-3 mt-1 text-[10px] text-gray-600 font-mono",children:[r.net_amount!=null&&e.jsxDEV("span",{children:["Net: ",Number(r.net_amount).toFixed(2)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1053,columnNumber:51},this),r.sale_amount!=null&&e.jsxDEV("span",{children:["Sale: ",Number(r.sale_amount).toFixed(2)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1054,columnNumber:52},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1052,columnNumber:23},this),r.message&&e.jsxDEV("p",{className:"text-gray-600 mt-1",children:r.message},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1057,columnNumber:36},this),e.jsxDEV("div",{className:"text-gray-400 mt-1",children:Ve(r.created_at)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1058,columnNumber:21},this)]},r.id,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1044,columnNumber:19},this))]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1041,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:920,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:914,columnNumber:9},this),h&&(t.field_changes&&t.field_changes.length>0||t.change_type==="cancellation")&&!["resolved","closed","rejected"].includes(t.status)&&e.jsxDEV(I,{className:"border-blue-200 bg-blue-50/50",children:e.jsxDEV(z,{className:"p-4 flex items-center justify-between",children:[e.jsxDEV("div",{children:[e.jsxDEV("h4",{className:"text-sm font-semibold text-blue-800",children:"Ready to apply changes?"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1078,columnNumber:17},this),e.jsxDEV("p",{className:"text-xs text-blue-600 mt-0.5",children:t.change_type==="cancellation"?"Cancel the product in the EasyGDS system":`${((Ar=t.field_changes)==null?void 0:Ar.length)||0} field change(s) to apply to the booking`},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1079,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1077,columnNumber:15},this),e.jsxDEV(p,{onClick:()=>Ke(!0),className:"bg-blue-600 hover:bg-blue-700 text-white",size:"sm",children:[e.jsxDEV(qe,{className:"h-4 w-4 mr-1.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1091,columnNumber:17},this),"Apply to Booking"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1086,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1076,columnNumber:13},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1075,columnNumber:11},this),t&&e.jsxDEV(Os,{isOpen:zr,onClose:()=>Ke(!1),request:t,onSuccess:()=>{Ke(!1),S.invalidateQueries({queryKey:["support-request",s]}),S.invalidateQueries({queryKey:["support-activity-log",s]}),S.invalidateQueries({queryKey:["support-requests"]})}},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1100,columnNumber:11},this),e.jsxDEV(I,{children:e.jsxDEV(z,{className:"p-4 space-y-3 max-h-[400px] overflow-y-auto",children:[gr.map(r=>{const a=!!r.__from_internal,f=r.sender_type==="client"?"bg-blue-50 border border-blue-200":r.sender_type==="app"?a?"bg-violet-50 border border-dashed border-violet-300":"bg-violet-50 border border-violet-200":a?"bg-gray-50 border border-dashed border-gray-300":"bg-white border",_=r.sender_type==="client"?"Customer":r.sender_type==="app"?"App":"Support",J=r.sender_name&&r.sender_name!=="Agent"&&r.sender_name!=="agent"?r.sender_name:"",Ue=g!=="system"&&r.sender_type==="agent",H=t.company_name||"",K=Ue?"Support Team":[H,J].filter(Boolean).join(" - ")||r.sender_type||"User";return e.jsxDEV("div",{className:`p-3 rounded-lg ${f}`,children:[e.jsxDEV("div",{className:"flex items-center justify-between mb-1",children:[e.jsxDEV("span",{className:"font-semibold text-sm",children:[K,e.jsxDEV(C,{variant:"outline",className:"ml-2 text-[10px] py-0 px-1.5",children:_},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1153,columnNumber:21},this),a&&e.jsxDEV(C,{variant:"outline",className:"ml-1 text-[10px] py-0 px-1.5 bg-amber-50 text-amber-700 border-amber-200",children:"Internal · customer hidden"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1155,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1151,columnNumber:19},this),e.jsxDEV("div",{className:"flex items-center gap-2",children:[e.jsxDEV("span",{className:"text-xs text-gray-500",children:Ve(r.created_at)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1161,columnNumber:21},this),r.sender_id===(i==null?void 0:i.id)&&e.jsxDEV("button",{onClick:()=>B.mutate({messageId:r.id,requestId:s}),className:"text-red-400 hover:text-red-600",children:e.jsxDEV(Rr,{className:"h-3.5 w-3.5"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1164,columnNumber:25},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1163,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1160,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1150,columnNumber:17},this),e.jsxDEV("p",{className:"text-sm text-gray-700 whitespace-pre-wrap",children:r.message},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1169,columnNumber:17},this),r.attachments&&r.attachments.length>0&&e.jsxDEV("div",{className:"mt-2 space-y-1",children:r.attachments.map((Cr,at)=>e.jsxDEV("a",{href:Cr.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs text-blue-600 hover:underline",children:[e.jsxDEV(Lr,{className:"h-3 w-3"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1174,columnNumber:25},this)," ",Cr.name]},at,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1173,columnNumber:23},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1171,columnNumber:19},this)]},r.id,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1149,columnNumber:15},this)}),gr.length===0&&e.jsxDEV("div",{className:"text-center text-gray-400 text-sm py-4",children:"No messages yet"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1182,columnNumber:45},this),e.jsxDEV("div",{ref:d},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1183,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1116,columnNumber:11},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1115,columnNumber:9},this),ot?e.jsxDEV("div",{className:"space-y-2",children:[g==="app"&&t.created_by_type==="client"&&(t.triage_state==="approved_by_app"||t.triage_state==="pending_app_response_review")&&e.jsxDEV("div",{className:"flex items-center gap-2 text-xs",children:[e.jsxDEV("span",{className:"text-gray-500",children:"Send to:"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1205,columnNumber:17},this),e.jsxDEV("button",{type:"button",onClick:()=>T("customer"),className:`px-2.5 py-1 rounded-md border transition-colors ${b==="customer"?"bg-blue-50 border-blue-200 text-blue-700 font-medium":"bg-white border-gray-200 text-gray-600 hover:bg-gray-50"}`,children:"Customer"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1206,columnNumber:17},this),e.jsxDEV("button",{type:"button",onClick:()=>T("ops"),className:`px-2.5 py-1 rounded-md border transition-colors ${b==="ops"?"bg-purple-50 border-purple-200 text-purple-700 font-medium":"bg-white border-gray-200 text-gray-600 hover:bg-gray-50"}`,children:"Support Team (Ops)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1217,columnNumber:17},this),e.jsxDEV("span",{className:"text-[10px] text-gray-400 ml-auto",children:b==="customer"?"Customer will see this message":"Customer won't see this"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1228,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1204,columnNumber:15},this),e.jsxDEV("div",{className:"flex gap-2",children:[e.jsxDEV(re,{placeholder:we?"Type a message to the support team...":g==="app"?t.created_by_type!=="client"?"Type a message to the Support Team...":(t.triage_state==="approved_by_app"||t.triage_state==="pending_app_response_review")&&b==="ops"?"Type a message to the Support Team (Ops)...":"Type a message to the customer...":t.triage_state==="approved_by_app"||t.triage_state==="pending_app_response_review"?"Type an internal message (customer will not see this)...":"Type a message to the client...",value:c,onChange:r=>V(r.target.value),className:"text-sm flex-1",rows:2,onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),cr())}},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1236,columnNumber:13},this),e.jsxDEV(p,{onClick:cr,className:"bg-blue-600 hover:bg-blue-700 self-end",disabled:j.isPending,children:e.jsxDEV(Ie,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1260,columnNumber:15},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1259,columnNumber:13},this),!we&&t.booking_id&&t.booking_code&&e.jsxDEV(p,{type:"button",variant:"outline",className:"self-end",onClick:()=>n(!0),title:"Reply via email — picks a customer template and lets you edit before sending",children:[e.jsxDEV($r,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1274,columnNumber:17},this)," Reply via Email"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1267,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1235,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1194,columnNumber:11},this):fr?e.jsxDEV("div",{className:"text-xs text-indigo-700 bg-indigo-50 border border-indigo-200 rounded p-3 text-center",children:"Your proposed reply is awaiting App review — messaging reopens once it's released."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1280,columnNumber:11},this):xr?e.jsxDEV("div",{className:"text-xs text-muted-foreground border border-dashed rounded p-3 text-center",children:"This request is closed. Messaging is no longer available."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1284,columnNumber:11},this):e.jsxDEV("div",{className:"text-xs text-muted-foreground border border-dashed rounded p-3 text-center",children:"You've reached the 2-message limit — wait for a reply before sending another."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1288,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:905,columnNumber:7},this),Nr&&e.jsxDEV("div",{className:"col-span-3 flex flex-col gap-4 h-full overflow-hidden",children:[e.jsxDEV(I,{className:"shrink-0",children:[e.jsxDEV(me,{className:"p-3",children:e.jsxDEV(pe,{className:"text-sm flex items-center justify-between",children:["Working status ",e.jsxDEV(Ze,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1301,columnNumber:32},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1300,columnNumber:15},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1299,columnNumber:13},this),e.jsxDEV(z,{className:"p-4 pt-0 space-y-3",children:e.jsxDEV("div",{className:"flex items-center gap-3",children:[e.jsxDEV(C,{className:`${br(t.status)} text-xs px-3 py-1 shrink-0`,children:Le(t.status)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1310,columnNumber:17},this),!Ye&&!Ge&&!$e&&e.jsxDEV("div",{className:"flex items-center gap-2 flex-1",children:[e.jsxDEV(xe,{value:Se,onValueChange:De,children:[e.jsxDEV(fe,{className:"text-sm h-8 flex-1",children:e.jsxDEV(Ee,{placeholder:"Change status..."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1317,columnNumber:25},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1316,columnNumber:23},this),e.jsxDEV(Oe,{children:A.map(r=>{var a,f;return e.jsxDEV(Y,{value:r,children:e.jsxDEV("span",{className:`inline-block px-1.5 py-0.5 rounded text-xs mr-1 ${((a=_e[r])==null?void 0:a.color)||""}`,children:((f=_e[r])==null?void 0:f.label)||r},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1322,columnNumber:29},this)},r,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1321,columnNumber:27},this)})},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1319,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1315,columnNumber:21},this),Se&&e.jsxDEV(p,{size:"sm",className:"bg-blue-600 hover:bg-blue-700 text-white text-xs shrink-0",onClick:Xr,disabled:G.isPending,children:"Apply"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1330,columnNumber:23},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1314,columnNumber:19},this),(Ye||Ge||$e)&&e.jsxDEV("span",{className:"text-xs text-muted-foreground",children:"Use the banner above to progress this ticket."},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1337,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1309,columnNumber:15},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1304,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1298,columnNumber:11},this),e.jsxDEV(I,{className:"flex flex-col flex-1 min-h-0",children:[e.jsxDEV(me,{className:"p-3 shrink-0 border-b",children:e.jsxDEV(pe,{className:"text-sm flex items-center gap-2",children:[e.jsxDEV(He,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1351,columnNumber:17},this),"Internal Team Chat",e.jsxDEV(C,{variant:"outline",className:"text-[10px] ml-auto",children:[Je.length," messages"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1353,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1350,columnNumber:15},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1349,columnNumber:13},this),e.jsxDEV(z,{className:"p-3 flex-1 overflow-y-auto space-y-3",children:[Je.map(r=>{const a=r.agent_id===(i==null?void 0:i.id),f=r.agent_name||"Agent",_=f,J=f.charAt(0).toUpperCase();return e.jsxDEV("div",{className:`flex ${a?"justify-end":"justify-start"}`,children:e.jsxDEV("div",{className:"max-w-[85%] order-1",children:[e.jsxDEV("div",{className:`flex items-center gap-2 mb-0.5 ${a?"justify-end":"justify-start"}`,children:[!a&&e.jsxDEV("div",{className:"w-6 h-6 rounded-full bg-purple-500 text-white flex items-center justify-center text-[10px] font-bold shrink-0",children:J},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1374,columnNumber:27},this),e.jsxDEV("span",{className:"text-xs font-medium text-gray-600",children:a?"You":_},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1378,columnNumber:25},this),null,e.jsxDEV("span",{className:"text-[10px] text-gray-400",children:Ve(r.created_at)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1382,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1372,columnNumber:23},this),e.jsxDEV("div",{className:`p-2.5 rounded-xl text-sm ${a?"bg-blue-600 text-white rounded-tr-sm":"bg-gray-100 text-gray-800 rounded-tl-sm border"}`,children:[r.task_type&&e.jsxDEV(C,{className:`text-[10px] mb-1.5 block w-fit ${a?"bg-blue-500 text-blue-100 border-blue-400":"bg-white text-gray-600 border-gray-300"}`,variant:"outline",children:r.task_type.replace(/_/g," ")},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1390,columnNumber:27},this),e.jsxDEV("p",{className:"whitespace-pre-wrap leading-relaxed",children:r.comment},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1394,columnNumber:25},this),r.attachments&&r.attachments.length>0&&e.jsxDEV("div",{className:"mt-2 space-y-1",children:r.attachments.map((H,K)=>e.jsxDEV("a",{href:H.url,target:"_blank",rel:"noopener noreferrer",className:`flex items-center gap-1 text-xs hover:underline ${a?"text-blue-200":"text-blue-600"}`,children:[e.jsxDEV(Lr,{className:"h-3 w-3"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1400,columnNumber:33},this)," ",H.name]},K,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1398,columnNumber:31},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1396,columnNumber:27},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1385,columnNumber:23},this),a&&e.jsxDEV("div",{className:"flex justify-end mt-0.5",children:e.jsxDEV("button",{onClick:()=>he.mutate({noteId:r.id,requestId:s}),className:"text-gray-300 hover:text-red-500 transition-colors",children:e.jsxDEV(Rr,{className:"h-3 w-3"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1410,columnNumber:29},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1409,columnNumber:27},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1408,columnNumber:25},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1370,columnNumber:21},this)},r.id,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1369,columnNumber:19},this)}),Je.length===0&&e.jsxDEV("div",{className:"flex flex-col items-center justify-center text-gray-400 py-8",children:[e.jsxDEV(He,{className:"h-8 w-8 mb-2 opacity-50"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1420,columnNumber:19},this),e.jsxDEV("span",{className:"text-sm",children:"No internal messages yet"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1421,columnNumber:19},this),e.jsxDEV("span",{className:"text-xs mt-1",children:"Start a conversation with your team"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1422,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1419,columnNumber:17},this),e.jsxDEV("div",{ref:P},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1425,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1361,columnNumber:13},this),e.jsxDEV("div",{className:"shrink-0 border-t p-3 space-y-2",children:[e.jsxDEV("div",{className:"flex items-center gap-2",children:[e.jsxDEV(xe,{value:Z,onValueChange:be,children:[e.jsxDEV(fe,{className:"text-xs h-7 w-auto max-w-[160px]",children:e.jsxDEV(Ee,{placeholder:"Tag (optional)"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1434,columnNumber:21},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1433,columnNumber:19},this),e.jsxDEV(Oe,{children:[e.jsxDEV(Y,{value:"hcn_request",children:"HCN Request"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1437,columnNumber:21},this),e.jsxDEV(Y,{value:"amendment",children:"Amendment"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1438,columnNumber:21},this),e.jsxDEV(Y,{value:"cancellation",children:"Cancellation"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1439,columnNumber:21},this),e.jsxDEV(Y,{value:"refund_request",children:"Refund Request"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1440,columnNumber:21},this),e.jsxDEV(Y,{value:"complaint",children:"Complaint"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1441,columnNumber:21},this),e.jsxDEV(Y,{value:"special_service",children:"Special Service"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1442,columnNumber:21},this),e.jsxDEV(Y,{value:"name_change",children:"Name Change"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1443,columnNumber:21},this),e.jsxDEV(Y,{value:"date_change",children:"Date Change"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1444,columnNumber:21},this),e.jsxDEV(Y,{value:"upgrade",children:"Upgrade"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1445,columnNumber:21},this),e.jsxDEV(Y,{value:"other",children:"Other"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1446,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1436,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1432,columnNumber:17},this),Z&&e.jsxDEV(C,{variant:"outline",className:"text-[10px] flex items-center gap-1",children:[Z.replace(/_/g," "),e.jsxDEV("button",{onClick:()=>be(""),className:"text-gray-400 hover:text-gray-600 ml-0.5",children:"×"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1452,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1450,columnNumber:19},this),e.jsxDEV("div",{className:"flex-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1455,columnNumber:17},this),e.jsxDEV("input",{ref:y,type:"file",multiple:!0,onChange:Qr,className:"hidden"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1456,columnNumber:17},this),e.jsxDEV(p,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>{var r;return(r=y.current)==null?void 0:r.click()},children:e.jsxDEV(Hr,{className:"h-3.5 w-3.5 text-gray-500"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1458,columnNumber:19},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1457,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1431,columnNumber:15},this),Te.length>0&&e.jsxDEV("div",{className:"flex flex-wrap gap-1",children:Te.map((r,a)=>e.jsxDEV(C,{variant:"outline",className:"text-[10px]",children:[r.name,e.jsxDEV("button",{onClick:()=>Qe(f=>f.filter((_,J)=>J!==a)),className:"ml-1 text-gray-400 hover:text-gray-600",children:"×"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1467,columnNumber:23},this)]},a,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1465,columnNumber:21},this))},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1463,columnNumber:17},this),e.jsxDEV("div",{className:"flex gap-2",children:[e.jsxDEV(re,{placeholder:"Type an internal message...",value:$,onChange:r=>Pe(r.target.value),className:"text-sm flex-1 min-h-[36px] max-h-[80px] resize-none",rows:1,onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),dr())}},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1474,columnNumber:17},this),e.jsxDEV(p,{onClick:dr,className:"bg-blue-600 hover:bg-blue-700 self-end shrink-0",size:"sm",disabled:Q.isPending||!$.trim(),children:e.jsxDEV(Ie,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1493,columnNumber:19},this)},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1487,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1473,columnNumber:15},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1429,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1348,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1296,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:697,columnNumber:7},this),t.booking_id&&t.booking_code&&e.jsxDEV(os,{open:Ne,onOpenChange:n,bookingId:t.booking_id,bookingCode:t.booking_code,customerEmail:t.contact_email||t.customer_email||null,customerName:t.customer_name||t.contact_name||null,supportRequestId:s,onSent:()=>{S.invalidateQueries({queryKey:["support-ticket-emails"]}),S.invalidateQueries({queryKey:["support-ticket-emails-booking"]}),S.invalidateQueries({queryKey:["emails"]})}},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:1507,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/components/support/SupportRequestDetail.tsx",lineNumber:496,columnNumber:5},this)}function no(){const{id:s}=Pt(),m=jt();Ss({entity_type:"support_request",entity_id:s,enabled:!!s});const i=()=>{window.history.length>1?m(-1):m("/support")};return e.jsxDEV("div",{className:"space-y-4",children:[e.jsxDEV("div",{className:"flex items-center gap-3",children:[e.jsxDEV(p,{variant:"outline",size:"sm",onClick:i,children:[e.jsxDEV(Ut,{className:"h-4 w-4 mr-1"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/SupportTicketDetailPage.tsx",lineNumber:32,columnNumber:11},this)," Back"]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/SupportTicketDetailPage.tsx",lineNumber:31,columnNumber:9},this),e.jsxDEV("h1",{className:"text-2xl font-bold",children:"Support Request"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/SupportTicketDetailPage.tsx",lineNumber:34,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/SupportTicketDetailPage.tsx",lineNumber:30,columnNumber:7},this),s?e.jsxDEV(ws,{requestId:s},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/SupportTicketDetailPage.tsx",lineNumber:37,columnNumber:9},this):e.jsxDEV("div",{className:"text-center py-12 text-gray-400",children:"No request ID provided"},void 0,!1,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/SupportTicketDetailPage.tsx",lineNumber:39,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/abanoubhelmy/Library/CloudStorage/OneDrive-Personal/EASYGDS/Operation System/trip-glide-control/src/pages/SupportTicketDetailPage.tsx",lineNumber:29,columnNumber:5},this)}export{no as default};
