1import{u as M,r as n,j as e,L as f,H as C}from"./app-DP13319Q.js";import{F as p,at as L,az as T,aI as B}from"./index-CtyZ6W6U.js";import{D as Z}from"./DraggableMenu-Bk7Spryo.js";/* empty css */import"./index-DQkUn08L.js";function W(){const{props:g}=M(),{auth:b,template:s,invoice:t}=g,x=n.useCallback(a=>{try{return new URL(a),!0}catch{return!1}},[]),d=n.useCallback(a=>{var r;return(r=a.split("?")[0].split(".").pop())==null?void 0:r.toLowerCase()},[]),c=n.useCallback(a=>a?["jpg","jpeg","png","gif","bmp","tiff","tif","webp","apng","svg","ico"].includes(a):!1,[]),y=n.useMemo(()=>s!=null&&s.image&&c(d(s.image))?e.jsx("style",{children:` 2 .blur-bg { 3 background: url('${s.user_id===0?"https://admin.ez3d.ai/":"https://ez.wiki/"}${s.image}') no-repeat center center; 4 background-size: cover; 5 } 6 `}):null,[s,d,c]),w=n.useMemo(()=>{var h;if(!s)return null;const a=((h=s.image.split(".").pop())==null?void 0:h.toLowerCase())||"",r=`${s.user_id===0?"https://admin.ez3d.ai/":"https://ez.wiki/"}${s.image}`,m=["jpg","jpeg","png","gif","bmp","tiff","tif","webp","apng","svg","ico"],v=["ppt","pptx","pdf","xls","xlsx","doc","docx","pages","ai","psd","eps","ttf","dxf","xps","rar","zip","ods","odt","odp"],N=/(?:youtube(?:-nocookie)?\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?/ ]{11})/i,$=/(?:https?:\/\/)?(?:www\.)?linkedin\.com\/(?:in|posts|company|feed|showcase|embed\/feed\/update\/urn:li:[^/]+:[^"&?/ ]+)/i,k=/^https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)(?:[?]?.*)$/im,_=/^(https?:\/\/)?(www\.)?fb\.watch\/[a-zA-Z0-9(\.\?)?]/,z=/^(https?:\/\/)?(www\.)?facebook\.com\/[a-zA-Z0-9(\.\?)?]/,D=/<iframe.*?src=["'](.*?)["'].*?>.*?<\/iframe>/is,I=/<blockquote/,o=s.image.match(N),F=s.image.match($),u=s.image.match(k),P=s.image.match(_),R=s.image.match(z),E=s.image.match(D)||I.test(s.image),H=new Blob([s.image],{type:"text/html"}),S=URL.createObjectURL(H);if(m.includes(a))return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 7 .blur-overlay { 8 position: fixed; 9 top: 0; 10 left: 0; 11 width: 100%; 12 height: 100%; 13 backdrop-filter: blur(20px); 14 z-index: -1; 15 } 16 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("img",{src:r,alt:"Background",className:"absolute inset-0 max-w-full max-h-full m-auto z-0 rounded-lg",onError:i=>console.error("Image failed to load",i)},`image-${s.image}`)]});if(v.includes(a))return e.jsx("iframe",{src:`https://docs.google.com/viewer?url=${r}&embedded=true`,className:"fixed top-0 left-0 w-full h-full",frameBorder:"0",loading:"lazy",allow:"autoplay; fullscreen",allowFullScreen:!0,sandbox:"allow-scripts allow-same-origin",title:"Document Viewer",scrolling:"yes"},`doc-${s.image}`);if(E){const i=s.image.replace(/<(iframe|blockquote)([^>]*)\s(height|width|style)=["'][^"']*["']([^>]*)>/gi,'<$1$2$4 class="fixed top-0 left-0 w-full h-full" scrolling="yes">').replace(/class="([^"]*)"/g,'class="$1 absolute inset-0 m-auto"'),U=/<(iframe|blockquote)[^>]*class="/i.test(i)?i:i.replace(/<(iframe|blockquote)/g,'<$1 scrolling="yes" class="absolute w-full h-full inset-0 m-auto"');return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 17 .blur-overlay { 18 position: fixed; 19 top: 0; 20 left: 0; 21 width: 100%; 22 height: 100%; 23 backdrop-filter: blur(20px); 24 z-index: -2; 25 } 26 .twitter-tweet { 27 position: fixed; 28 top: 0; 29 left: 0; 30 width: 100vw; 31 height: 100vh; 32 object-fit: cover; 33 z-index: 0; 34 border: none; 35 } 36 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("div",{className:"fixed top-0 left-0 w-full h-full object-cover",dangerouslySetInnerHTML:{__html:U}},`iframe-${s.image}`)]})}if(o){const i=s.option==="autoplay"?"autoplay=1":s.option==="mute"?"autoplay=1&mute=1":"mute=1";return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed top-0 left-0 w-full h-full z-[-2]",children:e.jsx("iframe",{loading:"lazy",src:`https://www.youtube.com/embed/${o[1]}?${i}&loop=1&playlist=${o[1]}&controls=0&showinfo=0&modestbranding=1&iv_load_policy=3`,className:"w-full h-full object-cover",frameBorder:"0",allow:"autoplay; fullscreen",allowFullScreen:!0},`youtube-1-${o[1]}`)}),e.jsx("style",{children:` 37 .blur-overlay { 38 position: fixed; 39 top: 0; 40 left: 0; 41 width: 100%; 42 height: 100%; 43 backdrop-filter: blur(20px); 44 z-index: -1; 45 } 46 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("iframe",{id:"bgVideo",loading:"lazy",className:"fixed top-0 left-0 w-full h-full object-cover",src:`https://www.youtube.com/embed/${o[1]}?${s.option}=1&mute=1&loop=1&playlist=${o[1]}`,title:"YouTube video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture;
46 web-share",referrerPolicy:"strict-origin-when-cross-origin",allowFullScreen:!0},`youtube-2-${o[1]}`)]})}if(F){let i=s.image;return i.includes("?compact=1")||(i+=(i.includes("?")?"&":"?")+"compact=1"),e.jsx("div",{className:"fixed top-0 left-0 w-full h-full flex justify-center items-center bg-black",children:e.jsx("iframe",{id:"bgVideo",src:i,className:"w-full h-full",frameBorder:"0",allowFullScreen:!0,title:"Embedded LinkedIn Post",scrolling:"yes"},`linkedin-${i}`)})}return u?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 47 .blur-overlay { 48 position: fixed; 49 top: 0; 50 left: 0; 51 width: 100%; 52 height: 100%; 53 backdrop-filter: blur(20px); 54 z-index: -1; 55 } 56 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("iframe",{loading:"lazy",id:"bgVideo",allow:"camera; microphone; fullscreen; display-capture; autoplay",src:`https://player.vimeo.com/video/${u[3]}?h=33160d1512&color=de0101`,className:"fixed top-0 left-0 w-full h-full object-cover",frameBorder:"0",allowFullScreen:!0},`vimeo-${u[3]}`)]}):P||R&&!s.image.includes("groups")?e.jsx("div",{className:"fixed top-0 left-0 w-full h-full",children:e.jsx("div",{className:"fb-post","data-href":s.image,"data-width":"1400","data-show-text":"true"},`fb-${s.image}`)}):a==="mp4"?e.jsxs(e.Fragment,{children:[e.jsxs("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"fixed top-0 left-0 w-full h-full object-cover z-[-3]",children:[e.jsx("source",{src:r,type:"video/mp4"}),"Your browser does not support the video tag."]},`video-bg-${s.image}`),e.jsx("style",{children:` 57 .blur-overlay { 58 position: fixed; 59 top: 0; 60 left: 0; 61 width: 100%; 62 height: 100%; 63 backdrop-filter: blur(20px); 64 z-index: -2; 65 } 66 `}),e.jsx("div",{className:"blur-overlay"}),e.jsxs("video",{id:"bgVideo",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"absolute inset-0 max-w-full max-h-full m-auto",controls:!0,children:[e.jsx("source",{src:r,type:"video/mp4"}),"Your browser does not support the video tag."]},`video-main-${s.image}`)]}):a==="glb"?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 67 .blur-overlay { 68 position: fixed; 69 top: 0; 70 left: 0; 71 width: 100%; 72 height: 100%; 73 backdrop-filter: blur(20px); 74 z-index: -1; 75 } 76 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("model-viewer",{src:r,alt:"3D model",className:"fixed top-0 left-0 w-full h-full",ar:!0,"auto-rotate":!0,"camera-controls":!0,"shadow-intensity":"1"},`model-${s.image}`)]}):x(s.image)?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 77 .blur-overlay { 78 position: fixed; 79 top: 0; 80 left: 0; 81 width: 100%; 82 height: 100%; 83 backdrop-filter: blur(20px); 84 z-index: -1; 85 } 86 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("iframe",{loading:"lazy",id:"bgVideo",allow:"camera; microphone; fullscreen; display-capture; autoplay",src:s.image,className:"fixed top-0 left-0 w-full h-full",frameBorder:"0",allowFullScreen:!0,scrolling:"yes"},`iframe-url-${s.image}`)]}):e.jsx("iframe",{src:S,className:"fixed top-0 left-0 w-full h-full border-none",allow:"microphone *; camera *; autoplay *; fullscreen *; display-capture *;",sandbox:`allow-forms allow-modals allow-orientation-lock allow-pointer-lock 87 allow-popups allow-popups-to-escape-sandbox allow-presentation 88 allow-same-origin allow-scripts allow-top-navigation 89 allow-top-navigation-by-user-activation allow-downloads allow-storage-access-by-user-activation`,allowFullScreen:!0,loading:"lazy",name:"binauralMixerFrame",allowTransparency:"true",scrolling:"yes"},`html-${s.image}`)},[s,x]);if(!t)return e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsxs("div",{className:"text-center p-8 bg-white rounded-lg shadow-md",children:[e.jsx("h1",{className:"text-2xl font-bold text-red-600 mb-4",children:"Invoice Not Found"}),e.jsx(f,{href:"/handlesellhistory",className:"text-blue-600 hover:text-blue-800",children:"Back to Sell History"})]})});const j=()=>{const a=window.open("","_blank");a?(a.document.write(` 90 <!DOCTYPE html> 91 <html> 92 <head> 93 <title>Refund Invoice ${t.invoice_number}</title> 94 <style> 95 body { font-family: Arial, sans-serif; margin: 0; padding: 20px; color: #333; } 96 .invoice-header { background: #000; color: #fff; padding: 20px; } 97 .invoice-body { padding: 20px; } 98 table { width: 100%; border-collapse: collapse; margin: 20px 0; } 99 th, td { padding: 12px; text-align: left; border-bottom: 1px solid #ddd; } 100 th { background-color: #f5f5f5; } 101 .total-row { font-weight: bold; } 102 .status { display: inline-block; padding: 5px 10px; border-radius: 20px; font-size: 14px; } 103 .refunded { background: #d4edda; color: #155724; } 104 .penalty { background: #fff3cd; color: #856404; } 105 .summary-table { width: 100%; margin-top: 20px; border-collapse: collapse; } 106 .summary-table th { background-color: #f8f9fa; } 107 .negative { color: #dc3545; } 108 </style> 109 </head> 110 <body> 111 <div class="invoice-header"> 112 <h1>${t.is_seller?"Penalty":"Refund"} Invoice #${t.invoice_number}</h1> 113 <p>Issued: ${t.issue_date} | Due: ${t.due_date}</p>
114 <span class="status ${t.status==="refunded"?"refunded":"penalty"}"> 115 ${t.status.toUpperCase()} 116 </span> 117 </div> 118 <div class="invoice-body"> 119 <h2>Transaction Details</h2> 120 <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px;"> 121 <div style="background: #f5f5f5; padding: 15px; border-radius: 5px;"> 122 <h3 style="font-size: 14px; color: #666; margin: 0 0 10px 0;">Payment Method</h3> 123 <div style="display: flex; align-items: center;"> 124 <span style="font-weight: bold; text-transform: capitalize;"> 125 ${t.transaction.payment_method} ending in ${t.transaction.last4} 126 </span> 127 </div> 128 </div> 129 <div style="background: #f5f5f5; padding: 15px; border-radius: 5px;"> 130 <h3 style="font-size: 14px; color: #666; margin: 0 0 10px 0;">Transaction ID</h3> 131 <div style="font-family: monospace;"> 132 ${t.transaction.id} 133 </div> 134 </div> 135 </div> 136 137 <h2>Handle Details</h2> 138 <div style="margin-bottom: 20px;"> 139 <p><strong>Type:</strong> ${t.handle.type==="custom"?"Custom Handle":"Domain Handle"}</p> 140 <p><strong>Handle:</strong> ${t.handle.name}</p> 141 <p><strong>Domain:</strong> ${t.handle.domain}</p> 142 <p><strong>URL:</strong> <a href="${t.handle.url}" target="_blank">${t.handle.url}</a></p> 143 </div> 144 145 <h2>${t.is_seller?"Penalty Details":"Refund Details"}</h2> 146 <table> 147 <thead> 148 <tr> 149 <th>Description</th> 150 <th>Quantity</th> 151 <th>Unit Price</th> 152 <th>Amount</th> 153 </tr> 154 </thead> 155 <tbody> 156 ${t.items.map(l=>` 157 <tr> 158 <td>${l.description}</td> 159 <td>${l.quantity.toLocaleString()}</td> 160 <td>${l.unit_price} EZ$</td> 161 <td>${l.amount} EZ$</td> 162 </tr> 163 `).join("")} 164 </tbody> 165 <tfoot> 166 <tr class="total-row"> 167 <td colspan="3" style="text-align: right;">Total</td> 168 <td>${t.amount} EZ$</td> 169 </tr> 170 </tfoot> 171 </table> 172 173 ${t.summary?` 174 <h2>Summary</h2> 175 <table class="summary-table"> 176 <tbody> 177 ${Object.entries(t.summary).map(([l,r])=>` 178 <tr> 179 <th style="text-align: left; padding: 8px; border-bottom: 1px solid #ddd;">${l.replace(/_/g," ").replace(/\b\w/g,m=>m.toUpperCase())}</th> 180 <td style="padding: 8px; border-bottom: 1px solid #ddd; ${r<0?"color: #dc3545;":""}"> 181 ${r<0?"-":""}${Math.abs(r).toFixed(2)} EZ$ 182 </td> 183 </tr> 184 `).join("")} 185 </tbody> 186 </table> 187 `:""} 188 189 ${t.notes?` 190 <h2>Notes</h2> 191 <p>${t.notes}</p> 192 `:""} 193 </div> 194 <script>window.print(); window.close();<\/script> 195 </body> 196 </html> 197 `),a.document.close()):window.print()};return e.jsxs(e.Fragment,{children:[e.jsxs(C,{children:[e.jsx("title",{children:`${t.is_seller?"Penalty":"Refund"} Invoice ${t.invoice_number}`}),e.jsx("meta",{name:"description",content:`${t.is_seller?"Penalty":"Refund"} invoice for handle transaction - ${t.invoice_number}`}),y]}),e.jsx(Z,{auth:b}),e.jsxs("main",{className:`relative min-h-screen p-4 md:p-8 ${s!=null&&s.image&&c(d(s.image))?"blur-bg":""}`,children:[e.jsx("div",{className:"absolute inset-0 z-0",children:w}),e.jsx("div",{className:"relative z-10",children:e.jsxs("div",{className:"max-w-4xl mx-auto bg-white rounded-lg shadow-lg overflow-hidden",children:[e.jsx("div",{className:"p-6 md:p-8 bg-gray-800 text-white",children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold flex items-center",children:[e.jsx(p,{icon:L,className:"mr-3"}),t.is_seller?"Penalty":"Refund"," Invoice #",t.invoice_number]}),e.jsxs("p",{className:"text-gray-300 mt-2",children:["Issued: ",t.issue_date,t.due_date&&` | Due: ${t.due_date}`]})]}),e.jsx("div",{className:"text-right",children:e.jsx("span",{className:`px-3 py-1 rounded-full text-sm font-medium ${t.status==="refunded"?"bg-green-100 text-green-800":"bg-yellow-100 text-yellow-800"}`,children:t.status.toUpperCase()})})]})}),e.jsxs("div",{className:"p-6 md:p-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-lg font-medium text-gray-900 mb-4",children:"Transaction Details"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-500 mb-2",children:"Payment Method"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx(p,{icon:T,className:"text-yellow-500 mr-2"}),e.jsxs("span",{className:"font-medium capitalize",children:[t.transaction.payment_method," ending in ",t.transaction.last4]})]})]}),e.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-500 mb-2",children:"Transaction ID"}),e.jsx("div",{className:"font-mono text-sm",children:t.transaction.refund_reference||t.transaction.id})]})]})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-lg font-medium text-gray-900 mb-4",children:"Handle Details"}),e.jsx("div",{className:"bg-gray-50 p-4 rounded-lg",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-500",children:"Type"}),e.jsx("p",{className:"font-medium",children:t.handle.type==="custom"?"Custom Handle":"Domain Handle"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-500",children:"Handle"}),e.jsx("p",{className:"font-medium",children:t.handle.name})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-500",children:"Domain"}),e.jsx("p",{className:"font-medium",children:t.handle.domain})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-500",children:"URL"}),e.jsx("a",{href:t.handle.url,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-blue-600 hover:text-blue-800",children:t.handle.url})]})]})})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-lg font-medium text-gray-900 mb-4",children:t.is_seller?"Penalty Details":"Refund Details"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[e.jsx("thead",{className:"bg-gray-50",children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Description"}),e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Quantity"}),e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Unit Price"}),e.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Amount"})]})}),e.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:t.items.map((a,l)=>e.jsxs("tr",{children:[e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("div",{className:"text-sm font-medium text-gray-900",children:a.description})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:a.quantity.toLocaleStr
197ing()}),e.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:[a.unit_price," EZ$"]}),e.jsxs("td",{className:`px-6 py-4 whitespace-nowrap text-sm font-medium ${Number(a.amount)<0?"text-red-600":"text-gray-900"}`,children:[a.amount," EZ$"]})]},l))}),e.jsx("tfoot",{className:"bg-gray-50",children:e.jsxs("tr",{children:[e.jsx("td",{colSpan:3,className:"px-6 py-4 text-right text-sm font-medium text-gray-500",children:"Total"}),e.jsxs("td",{className:`px-6 py-4 whitespace-nowrap text-sm font-bold ${Number(t.amount)<0?"text-red-600":"text-gray-900"}`,children:[t.amount," EZ$"]})]})})]})})]}),t.summary&&e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-lg font-medium text-gray-900 mb-4",children:"Summary"}),e.jsx("div",{className:"bg-gray-50 p-4 rounded-lg",children:e.jsx("table",{className:"min-w-full divide-y divide-gray-200",children:e.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:Object.entries(t.summary).map(([a,l])=>e.jsxs("tr",{children:[e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900 capitalize",children:a.replace(/_/g," ")}),e.jsxs("td",{className:`px-6 py-4 whitespace-nowrap text-sm ${Number(l)<0?"text-red-600 font-medium":"text-gray-500"}`,children:[Number(l)<0?"-":"",Math.abs(Number(l)).toFixed(2)," EZ$"]})]},a))})})})]}),t.notes&&e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-lg font-medium text-gray-900 mb-2",children:"Notes"}),e.jsx("p",{className:"text-gray-600 whitespace-pre-line",children:t.notes})]}),e.jsxs("div",{className:"flex justify-end space-x-4",children:[e.jsxs("button",{onClick:j,className:"inline-flex items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[e.jsx(p,{icon:B,className:"mr-2"}),"Print Invoice"]}),e.jsxs(f,{href:t.is_seller?"/refundtransferlist":"/handlesellhistory",className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:["Back to ",t.is_seller?"Refund History":"Sell History"]})]})]})]})})]})]})}export{W as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.