openstack-uicore-foundation 5.0.54-beta.0 → 5.0.54-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={3209:(e,t,o)=>{o.d(t,{OP:()=>n,UT:()=>a,eM:()=>c,fJ:()=>l,iC:()=>i,q9:()=>r});const r=100n,n=2,l=0,a=100,i=1e3,c={AMOUNT:"Amount",RATE:"Rate"}},8400:(e,t,o)=>{o.d(t,{currencyAmountFromCents:()=>l,formatBalance:()=>c,formatDiscount:()=>a,getOrderTotal:()=>i});var r=o(3209);const n={USD:"$",EUR:"€",GBP:"£",CAD:"C$",AUD:"A$",NZD:"NZ$",CHF:"CHF",ARS:"AR$",BRL:"R$",MXN:"MX$"};function l(e,t="USD"){let o="!ERROR";if("number"!=typeof e||!Number.isInteger(e))return console.error("ERROR - currencyAmountFromCents: cents must be an integer number"),o;try{const l=function(e){let t;if("bigint"==typeof e)t=e;else if("number"==typeof e){if(!Number.isSafeInteger(e))throw new Error("cents must be a safe integer Number (or pass BigInt/string).");t=BigInt(e)}else{if("string"!=typeof e)throw new Error("cents must be a bigint, number, or numeric string.");{const o=e.trim();if(!/^\d+$/.test(o))throw new Error("cents string must contain digits only (e.g., '1234').");t=BigInt(o)}}if(t<r.fJ)throw new Error("cents must be non-negative.");const o=t/r.q9,n=t%r.q9;return`${o.toString()}.${n.toString().padStart(r.OP,"0")}`}(e);o=`${n[t]??"$"}${l}`}catch(e){console.error(`ERROR - currencyAmountFromCents: ${e}`)}return o}const a=(e,t)=>t===r.eM.AMOUNT?l(e):t===r.eM.RATE?e/r.UT+"%":"",i=e=>e&&(e.net_amount||e.amount_due)||0,c=e=>{if(null==e)return"";const t=l(Math.abs(e));return e<0?`-${t}`:t}}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,o),l.exports}(()=>{o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t}})(),(()=>{o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};o.r(r),o.d(r,{OrderPdf:()=>R,buildRows:()=>v,generateInvoicePDF:()=>F,previewPDF:()=>V});const n=require("react");var l=o.n(n);const a=require("prop-types");var i=o.n(a);const c=require("i18n-react/dist/i18n-react");var d=o.n(c);const s=require("@react-pdf/renderer"),m=require("@babel/runtime/helpers/defineProperty");var u=o.n(m);const f=require("moment-timezone");var p=o.n(f),y=o(8400),b=o(3209);function g(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function w(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?g(Object(o),!0).forEach((function(t){u()(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):g(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}const h="Helvetica",_=(e,t="LOC",o="dddd Do h:mm a")=>e?"LOC"===t?p()(e*b.iC).format(o):p()(e*b.iC).tz(t).format(o):"",E=e=>e?[e.address_1??e.line1,e.address_2??e.line2,e.city,e.state,e.zip_code??e.postal_code,e.country].map((e=>(e??"").toString().trim())).filter(Boolean).join(", "):"",C=e=>e?`${(null==e?void 0:e.short_name)??""}${null!=e&&e.name?` (${null==e?void 0:e.name})`:""}`:"",v=e=>{const t=[];let o=0;(e.forms||[]).forEach((e=>{(e.items||[]).filter((e=>(e.quantity??1)>0)).forEach((r=>{var n,l;const a=r.quantity??1,i=r.canceled_quantity??0,c=r.cancellations??[],s=i>0&&i===a,m=i>0&&i<a;o+=r.amount,t.push({rowKey:`item-${r.line_id??r.id}`,type:"item",code:String(e.code||""),description:String((null===(n=r.type)||void 0===n?void 0:n.name)||r.title||""),addon:String((null===(l=e.add_on)||void 0===l?void 0:l.name)||""),qty:String(a-i),price:(0,y.currencyAmountFromCents)(r.amount),balanceCents:o,cancelled:s,partiallyCancelled:m,cancellations:c.map((e=>({id:e.id,label:d().translate("sponsor_order_grid.cancelled_by",{x:e.quantity,y:a,user:e.canceled_by_full_name,date:_(e.created,"LOC","YYYY/MM/DD HH:mm")}),reason:e.reason?String(e.reason):""})))})}));const r=e.discount_in_cents??0;r&&(o-=r,t.push({rowKey:`discount-${e.id}`,type:"discount",code:d().translate("mui_table.dis"),description:(0,y.formatDiscount)(e.discount_amount,e.discount_type),addon:"",qty:"",price:(0,y.currencyAmountFromCents)(r),balanceCents:o}))})),(e.fees||[]).forEach((e=>{o+=e.amount,t.push({rowKey:`fee-${e.line_id??e.id}`,type:"fee",code:d().translate("mui_table.payfee"),description:String(e.title||""),addon:"",qty:"1",price:(0,y.currencyAmountFromCents)(e.amount),balanceCents:o})}));return[...(e.payments||[]).map((e=>w(w({},e),{},{_rowType:"payment"}))),...(e.refunds||[]).map((e=>w(w({},e),{},{_rowType:"refund"})))].sort(((e,t)=>e.created-t.created)).forEach((e=>{"payment"===e._rowType?(o-=e.amount,t.push({rowKey:`payment-${e.id}`,type:"payment",code:d().translate("mui_table.pay"),description:`${d().translate("mui_table.paid_via")} ${e.method||d().translate("mui_table.card")}`,subDescription:_(e.created,"LOC","YYYY/MM/DD HH:mm"),addon:"",qty:"1",price:(0,y.currencyAmountFromCents)(e.amount),balanceCents:o})):(o+=e.amount,t.push({rowKey:`refund-${e.id}`,type:"refund",code:d().translate("mui_table.ref"),description:String(e.reason||d().translate("mui_table.refund")),subDescription:String(e.status||""),addon:"",qty:"1",price:(0,y.currencyAmountFromCents)(e.amount),balanceCents:o}))})),(e.notes||[]).forEach((e=>{t.push({rowKey:`note-${e.id}`,type:"note",content:String(e.content||"")})})),t},x=({styles:e,label:t,value:o,noBorder:r=!1})=>l().createElement(s.View,{style:[e.fieldRow,r&&e.fieldRowNoBorder]},l().createElement(s.Text,{style:e.fieldLabel},t??""),l().createElement(s.Text,{style:e.fieldValue},o??"")),T={ArrowUpward:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",ArrowDownward:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",Refresh:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z",DoNotDisturb:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"},D=({name:e,color:t,size:o=8})=>l().createElement(s.Svg,{width:o,height:o,viewBox:"0 0 24 24",style:{marginRight:3}},l().createElement(s.Path,{d:T[e],fill:t})),B=({row:e,styles:t,rowStyles:o})=>{if("note"===e.type)return l().createElement(s.View,{style:t.tdNote},l().createElement(s.Text,{style:[t.colCode,t.muted]},d().translate("mui_table.note")),l().createElement(s.Text,{style:[{flex:1},t.muted]},e.content));const r=o[e.cancelled?"cancelled":e.type];return l().createElement(s.View,{style:r.row},l().createElement(s.Text,{style:r.code},e.code),r.typeBadge?l().createElement(s.View,{style:t.typeCell},l().createElement(D,{name:r.typeBadge.icon,color:r.typeBadge.iconColor}),l().createElement(s.Text,{style:[t.typeBadgeLabel,{color:r.typeBadge.labelColor}]},r.typeBadge.label)):l().createElement(s.View,{style:t.colType}),l().createElement(s.View,{style:t.colDescMultiLine},l().createElement(s.Text,{style:r.descText},"item"===e.type?`${e.description} - ${d().translate("mui_table.total")}: ${e.qty}`:e.description),(e.cancellations||[]).map((e=>l().createElement(l().Fragment,{key:e.id},l().createElement(s.Text,{style:t.muted},e.label),e.reason&&l().createElement(s.Text,{style:t.muted},e.reason)))),e.subDescription&&l().createElement(s.Text,{style:t.muted},e.subDescription)),l().createElement(s.Text,{style:r.price},e.price),null!=e.balanceCents?l().createElement(s.Text,{style:[r.balance??t.colBalance,e.balanceCents<0&&t.colBalanceNegative]},(0,y.formatBalance)(e.balanceCents)):l().createElement(s.View,{style:t.colBalance}))},S=({styles:e,cancelledTotal:t,refundsTotal:o,retained:r,credited:n})=>{const a=r>0?"#c62828":"#1b5e20",i=r>0?d().translate("sponsor_order_grid.retained"):n>0?d().translate("sponsor_order_grid.credited"):d().translate("sponsor_order_grid.balance"),c=r>0?r:n>0?n:r;return l().createElement(s.View,{style:e.reconciliationWrapper,wrap:!1},l().createElement(s.View,{style:e.reconciliationBox},l().createElement(s.Text,{style:e.reconciliationTitle},d().translate("sponsor_order_grid.reconciliation")),l().createElement(s.View,{style:e.reconciliationRow},l().createElement(s.Text,{style:e.reconciliationLabel},d().translate("sponsor_order_grid.cancelled")),l().createElement(s.Text,{style:e.reconciliationValue},(0,y.currencyAmountFromCents)(t??0))),l().createElement(s.View,{style:e.reconciliationRow},l().createElement(s.Text,{style:e.reconciliationLabel},d().translate("sponsor_order_grid.refunded")),l().createElement(s.Text,{style:e.reconciliationValue},(0,y.currencyAmountFromCents)(o??0))),l().createElement(s.View,{style:e.reconciliationDivider}),l().createElement(s.View,{style:e.reconciliationRow},l().createElement(s.Text,{style:e.reconciliationLabel},i),l().createElement(s.Text,{style:[e.reconciliationValue,{color:a}]},(0,y.currencyAmountFromCents)(c??0)))))},R=({order:e,summit:t,logoSrc:o,theme:r})=>{var n,a,i,c;if(!e)throw new Error("OrderPdf: order is required");if(!t)throw new Error("OrderPdf: summit is required");const m=(e=>{var t;const o=null==e||null===(t=e.typography)||void 0===t?void 0:t.fontFamily;if(!o)return h;const r=o.split(",")[0].trim().replace(/^['"]|['"]$/g,"");return s.Font.getRegisteredFontFamilies().includes(r)?r:h})(r),u=(e=>s.StyleSheet.create({page:{backgroundColor:"#F7F7F8",padding:64,fontFamily:e,fontSize:8,color:"#212529"},headerRow:{flexDirection:"row",marginBottom:20,gap:20},cellLeft:{flex:1,backgroundColor:"#ffffff",borderRadius:10,borderWidth:1,borderColor:"#DEE2E6",paddingHorizontal:18,paddingVertical:10,justifyContent:"center"},logo:{width:"100%",height:84,objectFit:"contain",marginBottom:0,paddingBottom:0},cellRight:{flex:1,backgroundColor:"#ffffff",borderRadius:10,borderWidth:1,borderColor:"#DEE2E6",paddingHorizontal:18,paddingVertical:10},invoiceTitle:{fontFamily:e,fontWeight:"bold",fontSize:14,lineHeight:1.5,letterSpacing:0,color:"rgba(17, 19, 21, 1)",marginBottom:8},fieldRow:{fontSize:8,lineHeight:1.8,flexDirection:"row",color:"rgba(0, 0, 0, 0.87)",paddingBottom:3,paddingTop:6,borderBottom:"1px solid rgba(224, 224, 224, 1)",alignContent:"flex-start"},fieldRowNoBorder:{borderBottomWidth:0},fieldLabel:{flex:4,fontWeight:"bold",color:"rgba(0, 0, 0, 0.87)"},fieldValue:{flex:9},tableWrapper:{marginTop:8,borderRadius:8,borderWidth:1,borderStyle:"solid",borderColor:"#eee",backgroundColor:"#ffffff"},table:{fontFamily:e,borderRadius:8,overflow:"hidden"},thRow:{flexDirection:"row",backgroundColor:"#f0f0f0",paddingVertical:12,paddingHorizontal:12,alignItems:"center",borderBottomWidth:1,borderBottomStyle:"solid",borderBottomColor:"#eee"},thText:{fontFamily:e,fontSize:7,fontWeight:600,color:"#333333"},tdRow:{backgroundColor:"#FFFFFF",flexDirection:"row",paddingHorizontal:12,paddingVertical:14,alignItems:"center",borderBottomWidth:1,borderBottomStyle:"solid",borderBottomColor:"#eee"},tdPayment:{flexDirection:"row",paddingHorizontal:12,paddingVertical:14,alignItems:"flex-start",backgroundColor:"#f0fdf4",borderBottomWidth:1,borderBottomStyle:"solid",borderBottomColor:"#eee"},tdRefund:{flexDirection:"row",paddingHorizontal:12,paddingVertical:14,alignItems:"flex-start",backgroundColor:"#fff7ed",borderBottomWidth:1,borderBottomStyle:"solid",borderBottomColor:"#eee"},tdNote:{flexDirection:"row",paddingHorizontal:12,paddingVertical:10,alignItems:"flex-start",backgroundColor:"#FFFFFF",borderBottomWidth:1,borderBottomStyle:"solid",borderBottomColor:"#eee"},tdAmountDue:{flexDirection:"row",paddingHorizontal:12,paddingVertical:14,alignItems:"center",backgroundColor:"#fafafa",borderTopWidth:1,borderTopColor:"#000000"},colCode:{width:"12%",fontSize:8},colCodePayment:{width:"12%",fontSize:8,fontWeight:"bold"},colType:{width:"15%",fontSize:8},colDesc:{width:"39%",fontSize:8},colDescMultiLine:{width:"39%",flexDirection:"column",justifyContent:"flex-start"},colPrice:{width:"18%",textAlign:"right",fontSize:8,color:"#333333"},colPriceRefund:{fontFamily:e,width:"18%",textAlign:"right",fontSize:8,fontWeight:"bold",color:"#e65100"},colPricePayment:{fontFamily:e,width:"18%",textAlign:"right",fontSize:8,fontWeight:"bold",color:"#1b5e20"},colBalance:{width:"16%",textAlign:"right",fontSize:8,color:"#666666"},colBalanceNegative:{color:"#dc2626"},tdAmountDueLabel:{fontFamily:e,width:"66%",fontSize:8,fontWeight:700},tdAmountDueValue:{fontFamily:e,width:"16%",textAlign:"right",fontSize:9,fontWeight:700},paymentDesc:{fontFamily:e,fontSize:8,fontWeight:"bold"},muted:{color:"#6C757D",fontSize:8},typeCell:{width:"15%",flexDirection:"row",alignItems:"center"},typeBadgeLabel:{fontSize:8},cancelledText:{color:"#9ca3af",textDecoration:"line-through"},reconciliationWrapper:{flexDirection:"row",paddingHorizontal:12,paddingVertical:12,borderBottomWidth:1,borderBottomStyle:"solid",borderBottomColor:"#eee"},reconciliationBox:{width:"33%"},reconciliationTitle:{fontFamily:e,fontSize:8,fontWeight:600,color:"#333333",marginBottom:6},reconciliationRow:{flexDirection:"row",justifyContent:"space-between",paddingVertical:2},reconciliationLabel:{fontSize:7,color:"#6C757D"},reconciliationValue:{fontSize:7,color:"#333333",textAlign:"right"},reconciliationDivider:{borderBottomWidth:1,borderBottomColor:"#dee2e6",marginVertical:4}}))(m),f=(e=>({fee:{row:e.tdRow,code:e.colCode,descText:null,price:e.colPrice,typeBadge:{icon:"ArrowUpward",iconColor:"#ff9800",label:d().translate("order_invoice_pdf.charge"),labelColor:"#333333"}},item:{row:e.tdRow,code:e.colCode,descText:null,price:e.colPrice,typeBadge:{icon:"ArrowUpward",iconColor:"#ff9800",label:d().translate("order_invoice_pdf.charge"),labelColor:"#333333"}},discount:{row:e.tdPayment,code:e.colCodePayment,descText:e.paymentDesc,price:e.colPricePayment,typeBadge:{icon:"ArrowDownward",iconColor:"#4caf50",label:d().translate("mui_table.discount"),labelColor:"#1b5e20"}},payment:{row:e.tdPayment,code:e.colCodePayment,descText:e.paymentDesc,price:e.colPricePayment,typeBadge:{icon:"ArrowDownward",iconColor:"#4caf50",label:d().translate("mui_table.payment"),labelColor:"#1b5e20"}},refund:{row:e.tdRefund,code:e.colCodePayment,descText:e.paymentDesc,price:e.colPriceRefund,typeBadge:{icon:"Refresh",iconColor:"#ea580c",label:d().translate("mui_table.refund"),labelColor:"#e65100"}},cancelled:{row:e.tdRow,code:[e.colCode,e.cancelledText],descText:e.cancelledText,price:[e.colPrice,e.cancelledText],balance:[e.colBalance,e.cancelledText],typeBadge:{icon:"DoNotDisturb",iconColor:"#9ca3af",label:d().translate("sponsor_order_grid.cancelled"),labelColor:"#9ca3af"}}}))(u),p=v(e,t),b=(null===(n=t.main_locations)||void 0===n?void 0:n[0])??(null===(a=t.locations)||void 0===a?void 0:a.find((e=>e.is_main))),{cancelled_total:g=0,refunds_total:w=0,retained:T=0,credited_to_payment_method:D=0}=e,R=(0,y.getOrderTotal)(e),F=(null===(i=e.client)||void 0===i?void 0:i.contact_name)||e.purchased_by_full_name||"",V=(null===(c=e.client)||void 0===c?void 0:c.company_name)||"",O=E(e.address)||d().translate("general.not_available");return l().createElement(s.Document,null,l().createElement(s.Page,{size:"A4",orientation:"portrait",style:u.page},l().createElement(s.View,{style:u.headerRow,wrap:!1},l().createElement(s.View,{style:u.cellLeft},o?l().createElement(s.Image,{src:o,style:u.logo}):null),l().createElement(s.View,{style:u.cellRight},l().createElement(s.Text,{style:u.invoiceTitle},d().translate("order_invoice_pdf.invoice_title")),l().createElement(x,{styles:u,label:d().translate("order_invoice_pdf.order"),value:e.number}),l().createElement(x,{styles:u,label:d().translate("order_invoice_pdf.date"),value:e.purchased_date?_(e.purchased_date,"LOC","YYYY/MM/DD hh:mm a"):d().translate("order_invoice_pdf.pending")}),l().createElement(x,{styles:u,label:d().translate("order_invoice_pdf.payment_method"),value:e.payment_method??""}),l().createElement(x,{styles:u,label:d().translate("order_invoice_pdf.status"),value:e.status??""}),l().createElement(x,{styles:u,label:d().translate("order_invoice_pdf.payment_date"),value:e.created?_(e.created,"LOC","YYYY/MM/DD hh:mm a"):"",noBorder:!0}))),l().createElement(s.View,{style:u.headerRow,wrap:!1},l().createElement(s.View,{style:u.cellLeft},l().createElement(x,{styles:u,label:d().translate("order_invoice_pdf.client"),value:`${V}\n${F}`}),l().createElement(x,{styles:u,label:d().translate("order_invoice_pdf.address"),value:O,noBorder:!0})),l().createElement(s.View,{style:u.cellRight},l().createElement(x,{styles:u,label:d().translate("order_invoice_pdf.event"),value:t.name??""}),l().createElement(x,{styles:u,label:d().translate("order_invoice_pdf.venue"),value:C(b)??""}),l().createElement(x,{styles:u,label:d().translate("order_invoice_pdf.address"),value:E(b)??"",noBorder:!0}))),l().createElement(s.View,{style:u.tableWrapper},l().createElement(s.View,{style:u.table},l().createElement(s.View,{style:u.thRow,fixed:!0},l().createElement(s.Text,{style:[u.thText,u.colCode]},d().translate("sponsor_order_grid.code")),l().createElement(s.Text,{style:[u.thText,u.colType]},d().translate("sponsor_order_grid.type")),l().createElement(s.Text,{style:[u.thText,u.colDesc]},d().translate("sponsor_order_grid.details")),l().createElement(s.Text,{style:[u.thText,u.colPrice]},d().translate("sponsor_order_grid.amount")),l().createElement(s.Text,{style:[u.thText,u.colBalance]},d().translate("sponsor_order_grid.balance"))),p.map((e=>l().createElement(B,{key:e.rowKey,row:e,styles:u,rowStyles:f}))),g||w||T||D?l().createElement(S,{styles:u,cancelledTotal:g,refundsTotal:w,retained:T,credited:D}):null,l().createElement(s.View,{style:u.tdAmountDue},l().createElement(s.Text,{style:u.tdAmountDueLabel},d().translate("sponsor_order_grid.amount_due")),l().createElement(s.View,{style:{width:"18%"}}),l().createElement(s.Text,{style:[u.tdAmountDueValue,{color:(R??0)>0?"#e65100":"#1b5e20"}]},(0,y.formatBalance)(R??0)))))))};R.propTypes={order:i().object.isRequired,summit:i().object.isRequired,logoSrc:i().string,theme:i().object};const F=async(e,t,{logoSrc:o,theme:r}={})=>{try{const n=await(0,s.pdf)(l().createElement(R,{order:e,summit:t,logoSrc:o,theme:r})).toBlob(),a=URL.createObjectURL(n),i=document.createElement("a");i.href=a,i.download=`invoice-${e.number}.pdf`.toLowerCase().replace(/\s+/g,"-"),document.body.appendChild(i),i.click(),document.body.removeChild(i),setTimeout((()=>URL.revokeObjectURL(a)),6e4)}catch(e){throw console.error("Error generating invoice PDF:",e),e}},V=async(e,t,{logoSrc:o,theme:r}={})=>{const n=window.open("","_blank");try{const a=await(0,s.pdf)(l().createElement(R,{order:e,summit:t,logoSrc:o,theme:r})).toBlob(),i=URL.createObjectURL(a);return n?(n.location.href=i,void setTimeout((()=>URL.revokeObjectURL(i)),6e4)):(URL.revokeObjectURL(i),F(e,t,{logoSrc:o,theme:r}))}catch(e){throw console.error("Error generating invoice PDF preview:",e),n&&n.close(),e}};return r})()));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={3209:(e,t,o)=>{o.d(t,{OP:()=>n,UT:()=>a,eM:()=>c,fJ:()=>l,iC:()=>i,q9:()=>r});const r=100n,n=2,l=0,a=100,i=1e3,c={AMOUNT:"Amount",RATE:"Rate"}},8400:(e,t,o)=>{o.d(t,{currencyAmountFromCents:()=>l,formatBalance:()=>c,formatDiscount:()=>a,getOrderTotal:()=>i});var r=o(3209);const n={USD:"$",EUR:"€",GBP:"£",CAD:"C$",AUD:"A$",NZD:"NZ$",CHF:"CHF",ARS:"AR$",BRL:"R$",MXN:"MX$"};function l(e,t="USD"){let o="!ERROR";if("number"!=typeof e||!Number.isInteger(e))return console.error("ERROR - currencyAmountFromCents: cents must be an integer number"),o;try{const l=function(e){let t;if("bigint"==typeof e)t=e;else if("number"==typeof e){if(!Number.isSafeInteger(e))throw new Error("cents must be a safe integer Number (or pass BigInt/string).");t=BigInt(e)}else{if("string"!=typeof e)throw new Error("cents must be a bigint, number, or numeric string.");{const o=e.trim();if(!/^\d+$/.test(o))throw new Error("cents string must contain digits only (e.g., '1234').");t=BigInt(o)}}if(t<r.fJ)throw new Error("cents must be non-negative.");const o=t/r.q9,n=t%r.q9;return`${o.toString()}.${n.toString().padStart(r.OP,"0")}`}(e);o=`${n[t]??"$"}${l}`}catch(e){console.error(`ERROR - currencyAmountFromCents: ${e}`)}return o}const a=(e,t)=>t===r.eM.AMOUNT?l(e):t===r.eM.RATE?e/r.UT+"%":"",i=e=>e&&(e.net_amount||e.amount_due)||0,c=e=>{if(null==e)return"";const t=l(Math.abs(e));return e<0?`-${t}`:t}}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var l=t[r]={exports:{}};return e[r](l,l.exports,o),l.exports}(()=>{o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t}})(),(()=>{o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};o.r(r),o.d(r,{OrderPdf:()=>V,buildRows:()=>v,generateInvoicePDF:()=>F,previewPDF:()=>L});const n=require("react");var l=o.n(n);const a=require("prop-types");var i=o.n(a);const c=require("i18n-react/dist/i18n-react");var d=o.n(c);const s=require("@react-pdf/renderer"),m=require("@babel/runtime/helpers/defineProperty");var u=o.n(m);const f=require("moment-timezone");var y=o.n(f),p=o(8400),g=o(3209);function b(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function w(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?b(Object(o),!0).forEach((function(t){u()(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):b(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}const h="Helvetica",_=(e,t="LOC",o="dddd Do h:mm a")=>e?"LOC"===t?y()(e*g.iC).format(o):y()(e*g.iC).tz(t).format(o):"",E=e=>e?[e.address_1??e.line1,e.address_2??e.line2,e.city,e.state,e.zip_code??e.postal_code,e.country].map((e=>(e??"").toString().trim())).filter(Boolean).join(", "):"",C=e=>e?`${(null==e?void 0:e.short_name)??""}${null!=e&&e.name?` (${null==e?void 0:e.name})`:""}`:"",v=e=>{const t=[];let o=0;(e.forms||[]).forEach((e=>{(e.items||[]).filter((e=>(e.quantity??1)>0)).forEach((r=>{var n,l,a;const i=r.quantity??1,c=r.canceled_quantity??0,s=r.cancellations??[],m=c>0&&c===i,u=c>0&&c<i;o+=r.amount,t.push({rowKey:`item-${r.line_id??r.id}`,type:"item",code:String(e.code||""),itemCode:String((null===(n=r.type)||void 0===n?void 0:n.code)||r.code||""),description:String((null===(l=r.type)||void 0===l?void 0:l.name)||r.title||""),addon:String((null===(a=e.add_on)||void 0===a?void 0:a.name)||""),qty:String(i-c),quantity:i,canceledQuantity:c,price:(0,p.currencyAmountFromCents)(r.amount),balanceCents:o,cancelled:m,partiallyCancelled:u,cancellations:s.map((e=>({id:e.id,label:d().translate("sponsor_order_grid.cancelled_by",{x:e.quantity,y:i,user:e.canceled_by_full_name,date:_(e.created,"LOC","M/D/YY [@] h:mm A")}),reason:e.reason?String(e.reason):""})))})}));const r=e.discount_in_cents??0;r&&(o-=r,t.push({rowKey:`discount-${e.id}`,type:"discount",code:d().translate("mui_table.dis"),description:(0,p.formatDiscount)(e.discount_amount,e.discount_type),addon:"",qty:"",price:(0,p.currencyAmountFromCents)(r),balanceCents:o}))})),(e.fees||[]).forEach((e=>{o+=e.amount,t.push({rowKey:`fee-${e.line_id??e.id}`,type:"fee",code:d().translate("mui_table.payfee"),description:String(e.title||""),addon:"",qty:"1",price:(0,p.currencyAmountFromCents)(e.amount),balanceCents:o})}));return[...(e.payments||[]).map((e=>w(w({},e),{},{_rowType:"payment"}))),...(e.refunds||[]).map((e=>w(w({},e),{},{_rowType:"refund"})))].sort(((e,t)=>e.created-t.created)).forEach((e=>{"payment"===e._rowType?(o-=e.amount,t.push({rowKey:`payment-${e.id}`,type:"payment",code:d().translate("mui_table.pay"),description:`${d().translate("mui_table.paid_via")} ${e.method||d().translate("mui_table.card")}`,subDescription:_(e.created,"LOC","YYYY/MM/DD HH:mm"),addon:"",qty:"1",price:(0,p.currencyAmountFromCents)(e.amount),balanceCents:o})):(o+=e.amount,t.push({rowKey:`refund-${e.id}`,type:"refund",code:d().translate("mui_table.ref"),description:String(e.reason||d().translate("mui_table.refund")),subDescription:String(e.status||""),addon:"",qty:"1",price:(0,p.currencyAmountFromCents)(e.amount),balanceCents:o}))})),(e.notes||[]).forEach((e=>{t.push({rowKey:`note-${e.id}`,type:"note",content:String(e.content||"")})})),t},x=({styles:e,label:t,value:o,noBorder:r=!1})=>l().createElement(s.View,{style:[e.fieldRow,r&&e.fieldRowNoBorder]},l().createElement(s.Text,{style:e.fieldLabel},t??""),l().createElement(s.Text,{style:e.fieldValue},o??"")),T={ArrowUpward:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",ArrowDownward:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",Refresh:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z",DoNotDisturb:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z",SubdirectoryArrowRight:"m19 15-6 6-1.42-1.42L15.17 16H4V4h2v10h9.17l-3.59-3.58L13 9z"},D=({name:e,color:t,size:o=8})=>l().createElement(s.Svg,{width:o,height:o,viewBox:"0 0 24 24",style:{marginRight:3}},l().createElement(s.Path,{d:T[e],fill:t})),R=({row:e,styles:t,rowStyles:o})=>{if("note"===e.type)return l().createElement(s.View,{style:t.tdNote},l().createElement(s.Text,{style:[t.colCode,t.muted]},d().translate("mui_table.note")),l().createElement(s.Text,{style:[{flex:1},t.muted]},e.content));const r=o[e.cancelled?"cancelled":e.type];return l().createElement(s.View,{style:r.row},l().createElement(s.Text,{style:r.code},e.code),r.typeBadge?l().createElement(s.View,{style:t.typeCell},l().createElement(D,{name:r.typeBadge.icon,color:r.typeBadge.iconColor}),l().createElement(s.Text,{style:[t.typeBadgeLabel,{color:r.typeBadge.labelColor}]},r.typeBadge.label)):l().createElement(s.View,{style:t.colType}),l().createElement(s.View,{style:t.colDescMultiLine},l().createElement(s.Text,{style:r.descText},"item"===e.type?`${e.description} - ${d().translate("mui_table.total")}: ${e.qty}`:e.description),(e.cancellations||[]).map((e=>l().createElement(l().Fragment,{key:e.id},l().createElement(s.Text,{style:t.muted},e.label),l().createElement(s.View,{style:t.cancellationReasonRow},l().createElement(D,{name:"SubdirectoryArrowRight",color:"#6C757D"}),l().createElement(s.Text,{style:t.cancellationReason},e.reason," This is a test reason"))))),e.subDescription&&l().createElement(s.Text,{style:t.muted},e.subDescription)),l().createElement(s.Text,{style:r.price},e.price),null!=e.balanceCents?l().createElement(s.Text,{style:[r.balance??t.colBalance,e.balanceCents<0&&t.colBalanceNegative]},(0,p.formatBalance)(e.balanceCents)):l().createElement(s.View,{style:t.colBalance}))},S=({styles:e,cancelledTotal:t,refundsTotal:o,retained:r,credited:n})=>{const a=r>0?"#c62828":"#1b5e20",i=r>0?d().translate("sponsor_order_grid.retained"):n>0?d().translate("sponsor_order_grid.credited"):d().translate("sponsor_order_grid.balance"),c=r>0?r:n>0?n:r;return l().createElement(s.View,{style:e.reconciliationWrapper,wrap:!1},l().createElement(s.View,{style:e.reconciliationBox},l().createElement(s.Text,{style:e.reconciliationTitle},d().translate("sponsor_order_grid.reconciliation")),l().createElement(s.View,{style:e.reconciliationRow},l().createElement(s.Text,{style:e.reconciliationLabel},d().translate("sponsor_order_grid.cancelled")),l().createElement(s.Text,{style:e.reconciliationValue},(0,p.currencyAmountFromCents)(t??0))),l().createElement(s.View,{style:e.reconciliationRow},l().createElement(s.Text,{style:e.reconciliationLabel},d().translate("sponsor_order_grid.refunded")),l().createElement(s.Text,{style:e.reconciliationValue},(0,p.currencyAmountFromCents)(o??0))),l().createElement(s.View,{style:e.reconciliationDivider}),l().createElement(s.View,{style:e.reconciliationRow},l().createElement(s.Text,{style:e.reconciliationLabel},i),l().createElement(s.Text,{style:[e.reconciliationValue,{color:a}]},(0,p.currencyAmountFromCents)(c??0)))))},B=({items:e,styles:t})=>e&&0!==e.length?l().createElement(s.View,{style:t.cancelledItemsWrapper,wrap:!1},l().createElement(D,{name:"DoNotDisturb",color:"#212529"}),l().createElement(s.Text,{style:t.cancelledItemsLabel},d().translate("sponsor_order_grid.cancelled_items")),e.map((e=>l().createElement(s.Text,{key:e.rowKey,style:[t.cancelledItemLink,e.cancelled&&t.cancelledItemLinkBold]},e.code," - ",e.itemCode," (",e.canceledQuantity,"/",e.quantity,")")))):null,V=({order:e,summit:t,logoSrc:o,theme:r})=>{var n,a,i,c;if(!e)throw new Error("OrderPdf: order is required");if(!t)throw new Error("OrderPdf: summit is required");const m=(e=>{var t;const o=null==e||null===(t=e.typography)||void 0===t?void 0:t.fontFamily;if(!o)return h;const r=o.split(",")[0].trim().replace(/^['"]|['"]$/g,"");return s.Font.getRegisteredFontFamilies().includes(r)?r:h})(r),u=(e=>s.StyleSheet.create({page:{backgroundColor:"#F7F7F8",padding:64,fontFamily:e,fontSize:8,color:"#212529"},headerRow:{flexDirection:"row",marginBottom:20,gap:20},cellLeft:{flex:1,backgroundColor:"#ffffff",borderRadius:10,borderWidth:1,borderColor:"#DEE2E6",paddingHorizontal:18,paddingVertical:10,justifyContent:"center"},logo:{width:"100%",height:84,objectFit:"contain",marginBottom:0,paddingBottom:0},cellRight:{flex:1,backgroundColor:"#ffffff",borderRadius:10,borderWidth:1,borderColor:"#DEE2E6",paddingHorizontal:18,paddingVertical:10},invoiceTitle:{fontFamily:e,fontWeight:"bold",fontSize:14,lineHeight:1.5,letterSpacing:0,color:"rgba(17, 19, 21, 1)",marginBottom:8},fieldRow:{fontSize:8,lineHeight:1.8,flexDirection:"row",color:"rgba(0, 0, 0, 0.87)",paddingBottom:3,paddingTop:6,borderBottom:"1px solid rgba(224, 224, 224, 1)",alignContent:"flex-start"},fieldRowNoBorder:{borderBottomWidth:0},fieldLabel:{flex:4,fontWeight:"bold",color:"rgba(0, 0, 0, 0.87)"},fieldValue:{flex:9},cancelledItemsWrapper:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"flex-end",marginTop:8},cancelledItemsLabel:{fontFamily:e,fontSize:8,color:"#212529",marginRight:6},cancelledItemLink:{fontSize:8,color:"#6C757D",marginRight:8},cancelledItemLinkBold:{fontWeight:"bold"},tableWrapper:{marginTop:8,borderRadius:8,borderWidth:1,borderStyle:"solid",borderColor:"#eee",backgroundColor:"#ffffff"},table:{fontFamily:e,borderRadius:8,overflow:"hidden"},thRow:{flexDirection:"row",backgroundColor:"#f0f0f0",paddingVertical:12,paddingHorizontal:12,alignItems:"center",borderBottomWidth:1,borderBottomStyle:"solid",borderBottomColor:"#eee"},thText:{fontFamily:e,fontSize:7,fontWeight:600,color:"#333333"},tdRow:{backgroundColor:"#FFFFFF",flexDirection:"row",paddingHorizontal:12,paddingVertical:14,alignItems:"center",borderBottomWidth:1,borderBottomStyle:"solid",borderBottomColor:"#eee"},tdPayment:{flexDirection:"row",paddingHorizontal:12,paddingVertical:14,alignItems:"flex-start",backgroundColor:"#f0fdf4",borderBottomWidth:1,borderBottomStyle:"solid",borderBottomColor:"#eee"},tdRefund:{flexDirection:"row",paddingHorizontal:12,paddingVertical:14,alignItems:"flex-start",backgroundColor:"#fff7ed",borderBottomWidth:1,borderBottomStyle:"solid",borderBottomColor:"#eee"},tdNote:{flexDirection:"row",paddingHorizontal:12,paddingVertical:10,alignItems:"flex-start",backgroundColor:"#FFFFFF",borderBottomWidth:1,borderBottomStyle:"solid",borderBottomColor:"#eee"},tdAmountDue:{flexDirection:"row",paddingHorizontal:12,paddingVertical:14,alignItems:"center",backgroundColor:"#fafafa",borderTopWidth:1,borderTopColor:"#000000"},colCode:{width:"12%",fontSize:8},colCodePayment:{width:"12%",fontSize:8,fontWeight:"bold"},colType:{width:"15%",fontSize:8},colDesc:{width:"39%",fontSize:8},colDescMultiLine:{width:"39%",flexDirection:"column",justifyContent:"flex-start"},colPrice:{width:"18%",textAlign:"right",fontSize:8,color:"#333333"},colPriceRefund:{fontFamily:e,width:"18%",textAlign:"right",fontSize:8,fontWeight:"bold",color:"#e65100"},colPricePayment:{fontFamily:e,width:"18%",textAlign:"right",fontSize:8,fontWeight:"bold",color:"#1b5e20"},colBalance:{width:"16%",textAlign:"right",fontSize:8,color:"#666666"},colBalanceNegative:{color:"#dc2626"},tdAmountDueLabel:{fontFamily:e,width:"66%",fontSize:8,fontWeight:700},tdAmountDueValue:{fontFamily:e,width:"16%",textAlign:"right",fontSize:9,fontWeight:700},paymentDesc:{fontFamily:e,fontSize:8,fontWeight:"bold"},muted:{color:"#6C757D",fontSize:8},cancellationReasonRow:{flexDirection:"row",alignItems:"center",marginLeft:8},cancellationReason:{color:"#6C757D",fontSize:8,fontStyle:"italic"},typeCell:{width:"15%",flexDirection:"row",alignItems:"center"},typeBadgeLabel:{fontSize:8},cancelledText:{color:"#9ca3af",textDecoration:"line-through"},reconciliationWrapper:{flexDirection:"row",paddingHorizontal:12,paddingVertical:12,borderBottomWidth:1,borderBottomStyle:"solid",borderBottomColor:"#eee"},reconciliationBox:{width:"33%"},reconciliationTitle:{fontFamily:e,fontSize:8,fontWeight:600,color:"#333333",marginBottom:6},reconciliationRow:{flexDirection:"row",justifyContent:"space-between",paddingVertical:2},reconciliationLabel:{fontSize:7,color:"#6C757D"},reconciliationValue:{fontSize:7,color:"#333333",textAlign:"right"},reconciliationDivider:{borderBottomWidth:1,borderBottomColor:"#dee2e6",marginVertical:4}}))(m),f=(e=>({fee:{row:e.tdRow,code:e.colCode,descText:null,price:e.colPrice,typeBadge:{icon:"ArrowUpward",iconColor:"#ff9800",label:d().translate("order_invoice_pdf.charge"),labelColor:"#333333"}},item:{row:e.tdRow,code:e.colCode,descText:null,price:e.colPrice,typeBadge:{icon:"ArrowUpward",iconColor:"#ff9800",label:d().translate("order_invoice_pdf.charge"),labelColor:"#333333"}},discount:{row:e.tdPayment,code:e.colCodePayment,descText:e.paymentDesc,price:e.colPricePayment,typeBadge:{icon:"ArrowDownward",iconColor:"#4caf50",label:d().translate("mui_table.discount"),labelColor:"#1b5e20"}},payment:{row:e.tdPayment,code:e.colCodePayment,descText:e.paymentDesc,price:e.colPricePayment,typeBadge:{icon:"ArrowDownward",iconColor:"#4caf50",label:d().translate("mui_table.payment"),labelColor:"#1b5e20"}},refund:{row:e.tdRefund,code:e.colCodePayment,descText:e.paymentDesc,price:e.colPriceRefund,typeBadge:{icon:"Refresh",iconColor:"#ea580c",label:d().translate("mui_table.refund"),labelColor:"#e65100"}},cancelled:{row:e.tdRow,code:[e.colCode,e.cancelledText],descText:e.cancelledText,price:[e.colPrice,e.cancelledText],balance:[e.colBalance,e.cancelledText],typeBadge:{icon:"DoNotDisturb",iconColor:"#9ca3af",label:d().translate("sponsor_order_grid.cancelled"),labelColor:"#9ca3af"}}}))(u),y=v(e,t),g=y.filter((e=>{var t;return"item"===e.type&&(null===(t=e.cancellations)||void 0===t?void 0:t.length)>0})),b=(null===(n=t.main_locations)||void 0===n?void 0:n[0])??(null===(a=t.locations)||void 0===a?void 0:a.find((e=>e.is_main))),{cancelled_total:w=0,refunds_total:T=0,retained:D=0,credited_to_payment_method:V=0}=e,F=(0,p.getOrderTotal)(e),L=(null===(i=e.client)||void 0===i?void 0:i.contact_name)||e.purchased_by_full_name||"",O=(null===(c=e.client)||void 0===c?void 0:c.company_name)||"",P=E(e.address)||d().translate("general.not_available");return l().createElement(s.Document,null,l().createElement(s.Page,{size:"A4",orientation:"portrait",style:u.page},l().createElement(s.View,{style:u.headerRow,wrap:!1},l().createElement(s.View,{style:u.cellLeft},o?l().createElement(s.Image,{src:o,style:u.logo}):null),l().createElement(s.View,{style:u.cellRight},l().createElement(s.Text,{style:u.invoiceTitle},d().translate("order_invoice_pdf.invoice_title")),l().createElement(x,{styles:u,label:d().translate("order_invoice_pdf.order"),value:e.number}),l().createElement(x,{styles:u,label:d().translate("order_invoice_pdf.date"),value:e.purchased_date?_(e.purchased_date,"LOC","YYYY/MM/DD hh:mm a"):d().translate("order_invoice_pdf.pending")}),l().createElement(x,{styles:u,label:d().translate("order_invoice_pdf.payment_method"),value:e.payment_method??""}),l().createElement(x,{styles:u,label:d().translate("order_invoice_pdf.status"),value:e.status??""}),l().createElement(x,{styles:u,label:d().translate("order_invoice_pdf.payment_date"),value:e.created?_(e.created,"LOC","YYYY/MM/DD hh:mm a"):"",noBorder:!0}))),l().createElement(s.View,{style:u.headerRow,wrap:!1},l().createElement(s.View,{style:u.cellLeft},l().createElement(x,{styles:u,label:d().translate("order_invoice_pdf.client"),value:`${O}\n${L}`}),l().createElement(x,{styles:u,label:d().translate("order_invoice_pdf.address"),value:P,noBorder:!0})),l().createElement(s.View,{style:u.cellRight},l().createElement(x,{styles:u,label:d().translate("order_invoice_pdf.event"),value:t.name??""}),l().createElement(x,{styles:u,label:d().translate("order_invoice_pdf.venue"),value:C(b)??""}),l().createElement(x,{styles:u,label:d().translate("order_invoice_pdf.address"),value:E(b)??"",noBorder:!0}))),l().createElement(B,{items:g,styles:u}),l().createElement(s.View,{style:u.tableWrapper},l().createElement(s.View,{style:u.table},l().createElement(s.View,{style:u.thRow,fixed:!0},l().createElement(s.Text,{style:[u.thText,u.colCode]},d().translate("sponsor_order_grid.code")),l().createElement(s.Text,{style:[u.thText,u.colType]},d().translate("sponsor_order_grid.type")),l().createElement(s.Text,{style:[u.thText,u.colDesc]},d().translate("sponsor_order_grid.details")),l().createElement(s.Text,{style:[u.thText,u.colPrice]},d().translate("sponsor_order_grid.amount")),l().createElement(s.Text,{style:[u.thText,u.colBalance]},d().translate("sponsor_order_grid.balance"))),y.map((e=>l().createElement(R,{key:e.rowKey,row:e,styles:u,rowStyles:f}))),w||T||D||V?l().createElement(S,{styles:u,cancelledTotal:w,refundsTotal:T,retained:D,credited:V}):null,l().createElement(s.View,{style:u.tdAmountDue},l().createElement(s.Text,{style:u.tdAmountDueLabel},d().translate("sponsor_order_grid.amount_due")),l().createElement(s.View,{style:{width:"18%"}}),l().createElement(s.Text,{style:[u.tdAmountDueValue,{color:(F??0)>0?"#e65100":"#1b5e20"}]},(0,p.formatBalance)(F??0)))))))};V.propTypes={order:i().object.isRequired,summit:i().object.isRequired,logoSrc:i().string,theme:i().object};const F=async(e,t,{logoSrc:o,theme:r}={})=>{try{const n=await(0,s.pdf)(l().createElement(V,{order:e,summit:t,logoSrc:o,theme:r})).toBlob(),a=URL.createObjectURL(n),i=document.createElement("a");i.href=a,i.download=`invoice-${e.number}.pdf`.toLowerCase().replace(/\s+/g,"-"),document.body.appendChild(i),i.click(),document.body.removeChild(i),setTimeout((()=>URL.revokeObjectURL(a)),6e4)}catch(e){throw console.error("Error generating invoice PDF:",e),e}},L=async(e,t,{logoSrc:o,theme:r}={})=>{const n=window.open("","_blank");try{const a=await(0,s.pdf)(l().createElement(V,{order:e,summit:t,logoSrc:o,theme:r})).toBlob(),i=URL.createObjectURL(a);return n?(n.location.href=i,void setTimeout((()=>URL.revokeObjectURL(i)),6e4)):(URL.revokeObjectURL(i),F(e,t,{logoSrc:o,theme:r}))}catch(e){throw console.error("Error generating invoice PDF preview:",e),n&&n.close(),e}};return r})()));
|
|
2
2
|
//# sourceMappingURL=order-invoice-pdf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"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CACnB3R,MAAO4R,IAAAA,OAAiBC,WACxB1G,OAAQyG,IAAAA,OAAiBC,WACzBzG,QAASwG,IAAAA,OACTvG,MAAOuG,IAAAA,QAMT,MAEaE,EAAqBC,MAChC/R,EACAmL,GACEC,UAASC,SAAU,CAAC,KAEtB,IACE,MAAM2G,QAAaC,EAAAA,EAAAA,KACjB1K,IAAAA,cAAC2D,EAAQ,CACPlL,MAAOA,EACPmL,OAAQA,EACRC,QAASA,EACTC,MAAOA,KAET6G,SACIC,EAAMC,IAAIC,gBAAgBL,GAC1BM,EAAOC,SAASC,cAAc,KACpCF,EAAKG,KAAON,EACZG,EAAKI,SAAW,WAAW1S,EAAMuR,aAC9BoB,cACA5G,QAAQ,OAAQ,KACnBwG,SAASK,KAAKC,YAAYP,GAC1BA,EAAKQ,QACLP,SAASK,KAAKG,YAAYT,GAC1BU,YAAW,IAAMZ,IAAIa,gBAAgBd,IAzBjB,IA0BtB,CAAE,MAAOpT,GAEP,MADAD,QAAQC,MAAM,gCAAiCA,GACzCA,CACR,GAGWmU,EAAanB,MAAO/R,EAAOmL,GAAUC,UAASC,SAAU,CAAC,KAMpE,MAAM8H,EAASC,OAAOC,KAAK,GAAI,UAE/B,IACE,MAAMrB,QAAaC,EAAAA,EAAAA,KACjB1K,IAAAA,cAAC2D,EAAQ,CAAClL,MAAOA,EAAOmL,OAAQA,EAAQC,QAASA,EAASC,MAAOA,KACjE6G,SACIC,EAAMC,IAAIC,gBAAgBL,GAEhC,OAAImB,GACFA,EAAOzP,SAAS+O,KAAON,OAEvBa,YAAW,IAAMZ,IAAIa,gBAAgBd,IAjDnB,OAuDpBC,IAAIa,gBAAgBd,GACbL,EAAmB9R,EAAOmL,EAAQ,CAAEC,UAASC,UACtD,CAAE,MAAOtM,GAGP,MAFAD,QAAQC,MAAM,wCAAyCA,GACnDoU,GAAQA,EAAOG,QACbvU,CACR,G","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/utils/constants.js","webpack://openstack-uicore-foundation/./src/utils/money.js","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"prop-types\"","webpack://openstack-uicore-foundation/external commonjs \"i18n-react/dist/i18n-react\"","webpack://openstack-uicore-foundation/external commonjs \"@react-pdf/renderer\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/defineProperty\"","webpack://openstack-uicore-foundation/external commonjs \"moment-timezone\"","webpack://openstack-uicore-foundation/./src/components/order-invoice-pdf/helpers.js","webpack://openstack-uicore-foundation/./src/components/order-invoice-pdf/components/field-row.js","webpack://openstack-uicore-foundation/./src/components/order-invoice-pdf/components/pdf-icon.js","webpack://openstack-uicore-foundation/./src/components/order-invoice-pdf/components/pdf-table-row.js","webpack://openstack-uicore-foundation/./src/components/order-invoice-pdf/components/reconciliation-block.js","webpack://openstack-uicore-foundation/./src/components/order-invoice-pdf/index.js","webpack://openstack-uicore-foundation/./src/components/order-invoice-pdf/styles.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","export const CENTS_FACTOR = 100n;\nexport const TWO_DECIMAL_PLACES = 2;\nexport const THREE_DECIMAL_PLACES = 3;\nexport const ONE_CENT = 1n;\nexport const ZERO_INT = 0;\nexport const BPS = 100;\n\nexport const CODE_200 = 200;\n\nexport const DEBOUNCE_WAIT_250 = 250;\nexport const DEBOUNCE_WAIT = 500;\n\nexport const NOTIFICATION_TIMEOUT = 2000;\nexport const ASYNC_SELECT_SAFETY_TIMEOUT = 15000;\nexport const DEFAULT_PER_PAGE = 10;\nexport const TWENTY_PER_PAGE = 20;\nexport const FIFTY_PER_PAGE = 50;\nexport const MAX_PER_PAGE = 100;\n\nexport const INT_BASE = 10;\n\nexport const ONE_HUNDRED = 100;\nexport const MILLISECONDS_IN_SECOND = 1000;\n\nexport const MILLISECONDS_TO_SECONDS = 1000;\n\nexport const BYTES_PER_MB = 1_048_576; // 1024 * 1024\n\nexport const MAX_INVENTORY_IMAGE_UPLOAD_SIZE = 512000;\nexport const MAX_INVENTORY_IMAGES_UPLOAD_QTY = 5;\nexport const ALLOWED_INVENTORY_IMAGE_FORMATS = [\"jpg\", \"jpeg\", \"png\"];\n\nexport const METAFIELD_TYPES_WITH_OPTIONS = [\n \"CheckBoxList\",\n \"ComboBox\",\n \"RadioButtonList\"\n];\n\nexport const METAFIELD_TYPES = [\n \"CheckBox\",\n ...METAFIELD_TYPES_WITH_OPTIONS,\n \"Text\",\n \"TextArea\",\n \"Quantity\",\n \"DateTime\",\n \"Time\"\n];\n\nexport const DISCOUNT_TYPES = {\n AMOUNT: \"Amount\",\n RATE: \"Rate\"\n};\n\nexport const RATE_FIELDS = {\n EARLY_BIRD: \"early_bird_rate\",\n STANDARD: \"standard_rate\",\n ONSITE: \"onsite_rate\"\n};\n\nexport const DECIMAL_DIGITS = 2;\n\nexport const FILE_UPLOAD_STATUS = {\n PENDING: \"PENDING\",\n DEADLINE_ALERT: \"DEADLINE ALERT\",\n DEADLINE_MISSED: \"DEADLINE MISSED\",\n COMPLETE: \"COMPLETE\"\n};\n\nexport const FILE_UPLOAD_STATUS_COLOR = {\n [FILE_UPLOAD_STATUS.COMPLETE]: \"success.light\",\n [FILE_UPLOAD_STATUS.DEADLINE_MISSED]: \"error\",\n [FILE_UPLOAD_STATUS.DEADLINE_ALERT]: \"warning.light\",\n [FILE_UPLOAD_STATUS.PENDING]: \"default\"\n};\n\nexport const FILE_UPLOAD_STATUS_BKGR_COLOR = {\n [FILE_UPLOAD_STATUS.COMPLETE]: \"white\",\n [FILE_UPLOAD_STATUS.DEADLINE_MISSED]: \"#D32F2F0A\",\n [FILE_UPLOAD_STATUS.DEADLINE_ALERT]: \"#EF6C000A\",\n [FILE_UPLOAD_STATUS.PENDING]: \"white\"\n};\n\nexport const DATE_FORMAT = \"MM/DD/YYYY\";\nexport const DATETIME_FORMAT = \"MM/DD/YYYY hh:mm a\";\n\nexport const SPONSOR_FORMS_METAFIELD_CLASS = {\n FORM: \"Form\",\n ITEM: \"Item\"\n};\n\nexport const SPONSOR_ORDER_GRID_ITEM_TYPES = {\n CHARGE: \"Charge\",\n PAYMENT: \"Payment\",\n REFUND: \"Refund\",\n DISCOUNT: \"Discount\",\n CANCELLED: \"Cancelled\"\n};","/**\n * Copyright 2025 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport {\n BPS,\n CENTS_FACTOR,\n DISCOUNT_TYPES,\n ONE_CENT,\n THREE_DECIMAL_PLACES,\n TWO_DECIMAL_PLACES,\n ZERO_INT\n} from \"./constants\";\n\nconst CURRENCY_SYMBOL = {\n USD: \"$\",\n EUR: \"€\",\n GBP: \"£\",\n CAD: \"C$\",\n AUD: \"A$\",\n NZD: \"NZ$\",\n CHF: \"CHF\",\n ARS: \"AR$\",\n BRL: \"R$\",\n MXN: \"MX$\",\n};\n\n/**\n * Convert a decimal money amount to integer cents safely (no floating point math).\n *\n * Why this exists:\n * - `Math.round(parseFloat(x) * 100)` can be wrong due to IEEE-754 floating point errors\n * (e.g. 1.005 * 100 may become 100.499999..., rounding down unexpectedly).\n *\n * Input:\n * - number or string (recommended: string from API/UI)\n * - Examples: \"12.34\", \"1,234.56\", \"1234,56\", 12.34\n *\n * Output:\n * - Number cents (exact), e.g. \"12.34\" -> 1234\n *\n * Rounding:\n * - Half-up to 2 decimals (>= 0.005 USD rounds up by 1 cent).\n *\n * Notes:\n * - Amounts are assumed to be NON-negative (per your requirement).\n * - Throws on invalid formats (does not silently return 0).\n */\nexport function amountToCents(amount) {\n if (amount == null) throw new Error(\"amount is required\");\n\n let s = String(amount).trim();\n\n // Normalize common separators:\n // - \"1,234.56\" => \"1234.56\" (remove thousands separators)\n // - \"1234,56\" => \"1234.56\" (convert decimal comma to dot)\n if (s.includes(\",\") && s.includes(\".\")) {\n s = s.replace(/,/g, \"\");\n } else if (s.includes(\",\") && !s.includes(\".\")) {\n s = s.replace(\",\", \".\");\n }\n\n // Validate: digits optionally followed by '.' and more digits\n if (!/^\\d+(\\.\\d+)?$/.test(s)) {\n throw new Error(`Invalid money format: \"${amount}\"`);\n }\n\n const [intPart, fracRaw = \"\"] = s.split(\".\");\n\n // Pad at least 3 fractional digits so we can:\n // - take 2 digits for cents\n // - take the 3rd digit to decide rounding\n const fracPadded = (`${fracRaw}000`);\n\n const tenths = fracPadded[0] ?? \"0\"; // 1st decimal digit\n const hundredths = fracPadded[1] ?? \"0\"; // 2nd decimal digit (cents)\n const thousandths = fracPadded[2] ?? \"0\"; // 3rd decimal digit (rounding decision)\n\n // If there are more than 3 decimals, we track if any non-zero exists after the 3rd.\n // This can matter for policies like bankers rounding; here it's mainly informational.\n const trailing =\n fracRaw.length > THREE_DECIMAL_PLACES\n ? fracRaw.slice(THREE_DECIMAL_PLACES)\n : \"\";\n const hasTrailingNonZero = /[1-9]/.test(trailing);\n\n // Build cents as integer: (dollars * 100) + (first two decimal digits)\n let cents = BigInt(intPart) * CENTS_FACTOR + BigInt(tenths + hundredths);\n\n // Half-up rounding:\n // - If the 3rd digit is >= 5, round up by 1 cent.\n // - If there are more digits beyond the 3rd, \"5xxx\" should also round up.\n const roundUp = thousandths > \"5\" || thousandths === \"5\" || (thousandths === \"5\" && hasTrailingNonZero);\n\n if (roundUp) cents += ONE_CENT;\n\n return Number(cents);\n}\n\n/**\n * Convert an amount in cents to a decimal string (e.g. 1234 -> \"12.34\") safely.\n *\n * Why:\n * - Avoids floating point math (cents / 100) which can lose precision for large integers\n * or if cents is already imprecise as a JS Number.\n *\n * Input:\n * - Accepts: bigint | number | string (digits)\n * - Assumes NON-negative cents (per your requirement).\n *\n * Output:\n * - Always returns a string with exactly 2 decimal places.\n */\nexport function amountFromCents(cents) {\n let c;\n\n // Normalize input to BigInt safely\n if (typeof cents === \"bigint\") {\n c = cents;\n } else if (typeof cents === \"number\") {\n // Ensure it's a safe integer before converting to BigInt\n if (!Number.isSafeInteger(cents)) {\n throw new Error(\"cents must be a safe integer Number (or pass BigInt/string).\");\n }\n c = BigInt(cents);\n } else if (typeof cents === \"string\") {\n const s = cents.trim();\n if (!/^\\d+$/.test(s)) {\n throw new Error(\"cents string must contain digits only (e.g., '1234').\");\n }\n c = BigInt(s);\n } else {\n throw new Error(\"cents must be a bigint, number, or numeric string.\");\n }\n\n if (c < ZERO_INT) {\n throw new Error(\"cents must be non-negative.\");\n }\n\n const amount = c / CENTS_FACTOR;\n const remainder = c % CENTS_FACTOR;\n\n // Always pad remainder to 2 digits\n return `${amount.toString()}.${remainder.toString().padStart(TWO_DECIMAL_PLACES, \"0\")}`;\n}\n\n/**\n * @param cents\n * @param currency\n * @returns {string}\n */\nexport function currencyAmountFromCents(cents, currency = \"USD\") {\n let result = \"!ERROR\";\n\n if (typeof cents !== \"number\" || !Number.isInteger(cents)) {\n console.error(\"ERROR - currencyAmountFromCents: cents must be an integer number\");\n return result;\n }\n\n try {\n const amount = amountFromCents(cents); // \"12.34\"\n const symbol = CURRENCY_SYMBOL[currency] ?? \"$\";\n result = `${symbol}${amount}`;\n } catch (e) {\n console.error(`ERROR - currencyAmountFromCents: ${e}`);\n }\n\n return result;\n}\n\n/**\n * Converts a price string into cents.\n * @param {string} priceString - The price (e.g., $0.30).\n * @returns {number} - The amount converted to cents (e.g., 30).\n */\nexport const parsePrice = (priceString) => {\n if (priceString == null) throw new Error(\"priceString is required\");\n\n let s = String(priceString).trim();\n\n // Reject negatives explicitly (per your requirement).\n if (s.includes(\"-\")) throw new Error(\"Negative amounts are not allowed\");\n\n // Keep only digits and separators. Remove currency symbols/letters/spaces.\n s = s.replace(/[^\\d.,]/g, \"\");\n if (!s) throw new Error(`Invalid price: \"${priceString}\"`);\n\n // Delegate exact cents conversion (no floats)\n return amountToCents(s); // <- your safe BigInt cents converter\n};\n\n/**\n * Formats a discount value in BPS or CENTS to string.\n * @param {number} amount - The discount in BPS or CENTS(e.g., 300 = 3%).\n * @param {string} type - The discount type: \"Amount\" or \"Rate\".\n * @returns {string} - The discount converted to string (e.g., $5).\n */\nexport const formatDiscount = (amount, type) => {\n if (type === DISCOUNT_TYPES.AMOUNT) return currencyAmountFromCents(amount);\n if (type === DISCOUNT_TYPES.RATE) return `${amount / BPS}%`; // transform from bps to percentage\n return \"\";\n};\n\n/**\n * Derives an order's amount due directly from its raw net_amount/amount_due\n * fields (both in cents). This is the single source for that fallback rule,\n * shared by consumers that normalize a raw order (e.g. into order.total) and\n * by consumers that render straight from the raw order (e.g. the invoice PDF).\n * @param {object} order - Raw order object with net_amount/amount_due in cents.\n * @returns {number} - The amount due, in cents.\n */\nexport const getOrderTotal = (order) => {\n if (!order) return 0;\n return order.net_amount || order.amount_due || 0;\n};\n\n/**\n * Formats a signed amount in cents as currency, preserving the sign\n * (e.g. -500 -> \"-$5.00\").\n * @param {number} cents\n * @returns {string}\n */\nexport const formatBalance = (cents) => {\n if (cents == null) return \"\";\n const abs = currencyAmountFromCents(Math.abs(cents));\n return cents < 0 ? `-${abs}` : abs;\n};","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"prop-types\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"i18n-react/dist/i18n-react\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@react-pdf/renderer\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/defineProperty\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"moment-timezone\");","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport moment from \"moment-timezone\";\nimport T from \"i18n-react/dist/i18n-react\";\nimport { Font } from \"@react-pdf/renderer\";\nimport { currencyAmountFromCents, formatDiscount } from \"../../utils/money\";\nimport { MILLISECONDS_IN_SECOND } from \"../../utils/constants\";\n\nexport const DEFAULT_FONT_FAMILY = \"Helvetica\";\n\nexport const formatDate = (\n date,\n timeZone = \"LOC\",\n format = \"dddd Do h:mm a\"\n) => {\n if (!date) return \"\";\n\n if (timeZone === \"LOC\") {\n return moment(date * MILLISECONDS_IN_SECOND).format(format);\n }\n\n return moment(date * MILLISECONDS_IN_SECOND)\n .tz(timeZone)\n .format(format);\n};\n\nexport const formatAddress = (address) => {\n if (!address) return \"\";\n return [\n address.address_1 ?? address.line1,\n address.address_2 ?? address.line2,\n address.city,\n address.state,\n address.zip_code ?? address.postal_code,\n address.country\n ]\n .map(val => (val ?? \"\").toString().trim())\n .filter(Boolean)\n .join(\", \");\n};\n\nexport const formatVenueName = (location) => {\n if (!location) return \"\";\n return `${location?.short_name ?? \"\"}${location?.name ? ` (${location?.name})` : \"\"}`;\n};\n\n// Reads fontFamily off the consumer's MUI theme so it stays in sync with the\n// rest of their app instead of being duplicated as a separate literal. Only\n// the first name in the CSS font stack is usable here: react-pdf renders\n// with fonts registered via Font.register, so this name must match a family\n// already registered that way in the consuming app.\nexport const getThemeFontFamily = (theme) => {\n const fontFamily = theme?.typography?.fontFamily;\n if (!fontFamily) return DEFAULT_FONT_FAMILY;\n const resolved = fontFamily.split(\",\")[0].trim().replace(/^['\"]|['\"]$/g, \"\");\n return Font.getRegisteredFontFamilies().includes(resolved)\n ? resolved\n : DEFAULT_FONT_FAMILY;\n};\n\nexport const buildRows = (order) => {\n const rows = [];\n let balanceCents = 0;\n\n (order.forms || []).forEach((form) => {\n (form.items || [])\n .filter((item) => (item.quantity ?? 1) > 0)\n .forEach((item) => {\n // Cancellation is per-item and quantity-scoped: canceled_quantity may\n // be anywhere from 0 (not cancelled) up to quantity (fully cancelled),\n // with the individual cancellation events (and their frozen per-event\n // amounts) listed in cancellations. Mirrors SponsorOrderGrid's contract.\n const quantity = item.quantity ?? 1;\n const canceledQuantity = item.canceled_quantity ?? 0;\n const cancellations = item.cancellations ?? [];\n const cancelled = canceledQuantity > 0 && canceledQuantity === quantity;\n const partiallyCancelled = canceledQuantity > 0 && canceledQuantity < quantity;\n\n // Matches SponsorOrderGrid: a charge stays in the ledger in full\n // whether it's cancelled or not, partially or fully -- cancellation\n // only nets out via the reconciliation block below.\n balanceCents += item.amount;\n\n rows.push({\n rowKey: `item-${item.line_id ?? item.id}`,\n type: \"item\",\n // Table shows form.code per item row (columnKey: \"formCode\", value: form.code)\n code: String(form.code || \"\"),\n description: String(item.type?.name || item.title || \"\"),\n addon: String(form.add_on?.name || \"\"),\n qty: String(quantity - canceledQuantity),\n price: currencyAmountFromCents(item.amount),\n balanceCents,\n cancelled,\n partiallyCancelled,\n cancellations: cancellations.map((c) => ({\n id: c.id,\n label: T.translate(\"sponsor_order_grid.cancelled_by\", {\n x: c.quantity,\n y: quantity,\n user: c.canceled_by_full_name,\n date: formatDate(c.created, \"LOC\", \"YYYY/MM/DD HH:mm\")\n }),\n reason: c.reason ? String(c.reason) : \"\"\n }))\n });\n });\n\n const discountCents = form.discount_in_cents ?? 0;\n if (discountCents) {\n balanceCents -= discountCents;\n rows.push({\n rowKey: `discount-${form.id}`,\n type: \"discount\",\n code: T.translate(\"mui_table.dis\"),\n description: formatDiscount(form.discount_amount, form.discount_type),\n addon: \"\",\n qty: \"\",\n price: currencyAmountFromCents(discountCents),\n balanceCents\n });\n }\n });\n\n (order.fees || []).forEach((fee) => {\n balanceCents += fee.amount;\n rows.push({\n rowKey: `fee-${fee.line_id ?? fee.id}`,\n type: \"fee\",\n code: T.translate(\"mui_table.payfee\"),\n description: String(fee.title || \"\"),\n addon: \"\",\n qty: \"1\",\n price: currencyAmountFromCents(fee.amount),\n balanceCents\n });\n });\n\n // Payments and refunds interleaved and sorted by created:\n const paymentsAndRefundsOrdered = [\n ...(order.payments || []).map((p) => ({ ...p, _rowType: \"payment\" })),\n ...(order.refunds || []).map((r) => ({ ...r, _rowType: \"refund\" }))\n ].sort((a, b) => a.created - b.created);\n\n paymentsAndRefundsOrdered.forEach((item) => {\n if (item._rowType === \"payment\") {\n balanceCents -= item.amount;\n rows.push({\n rowKey: `payment-${item.id}`,\n type: \"payment\",\n code: T.translate(\"mui_table.pay\"),\n description: `${T.translate(\"mui_table.paid_via\")} ${item.method || T.translate(\"mui_table.card\")}`,\n subDescription: formatDate(item.created, \"LOC\", \"YYYY/MM/DD HH:mm\"),\n addon: \"\",\n qty: \"1\",\n price: currencyAmountFromCents(item.amount),\n balanceCents\n });\n } else {\n balanceCents += item.amount;\n rows.push({\n rowKey: `refund-${item.id}`,\n type: \"refund\",\n code: T.translate(\"mui_table.ref\"),\n description: String(item.reason || T.translate(\"mui_table.refund\")),\n subDescription: String(item.status || \"\"),\n addon: \"\",\n qty: \"1\",\n price: currencyAmountFromCents(item.amount),\n balanceCents\n });\n }\n });\n\n (order.notes || []).forEach((note) => {\n rows.push({\n rowKey: `note-${note.id}`,\n type: \"note\",\n content: String(note.content || \"\")\n });\n });\n\n return rows;\n};\n","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React from \"react\";\nimport { View, Text } from \"@react-pdf/renderer\";\n\nexport const FieldRow = ({ styles, label, value, noBorder = false }) => (\n <View style={[styles.fieldRow, noBorder && styles.fieldRowNoBorder]}>\n <Text style={styles.fieldLabel}>{label ?? \"\"}</Text>\n <Text style={styles.fieldValue}>{value ?? \"\"}</Text>\n </View>\n);","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React from \"react\";\nimport { Svg, Path } from \"@react-pdf/renderer\";\n\nconst MUI_ICON_PATHS = {\n ArrowUpward: \"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z\",\n ArrowDownward:\n \"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z\",\n Refresh:\n \"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z\",\n DoNotDisturb:\n \"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z\"\n};\n\nconst PDF_ICON_SIZE = 8;\n\nexport const PdfIcon = ({ name, color, size = PDF_ICON_SIZE }) => (\n <Svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n style={{ marginRight: 3 }}\n >\n <Path d={MUI_ICON_PATHS[name]} fill={color} />\n </Svg>\n);","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React from \"react\";\nimport T from \"i18n-react/dist/i18n-react\";\nimport { View, Text } from \"@react-pdf/renderer\";\nimport { formatBalance } from \"../../../utils/money\";\nimport { PdfIcon } from \"./pdf-icon\";\n\nexport const PdfTableRow = ({ row, styles, rowStyles }) => {\n // Notes span all columns, matching NotesRow in the table\n if (row.type === \"note\") {\n return (\n <View style={styles.tdNote}>\n <Text style={[styles.colCode, styles.muted]}>\n {T.translate(\"mui_table.note\")}\n </Text>\n <Text style={[{ flex: 1 }, styles.muted]}>{row.content}</Text>\n </View>\n );\n }\n\n const s = rowStyles[row.cancelled ? \"cancelled\" : row.type];\n return (\n <View style={s.row}>\n <Text style={s.code}>{row.code}</Text>\n {s.typeBadge ? (\n <View style={styles.typeCell}>\n <PdfIcon name={s.typeBadge.icon} color={s.typeBadge.iconColor} />\n <Text\n style={[styles.typeBadgeLabel, { color: s.typeBadge.labelColor }]}\n >\n {s.typeBadge.label}\n </Text>\n </View>\n ) : (\n <View style={styles.colType} />\n )}\n <View style={styles.colDescMultiLine}>\n <Text style={s.descText}>\n {row.type === \"item\"\n ? `${row.description} - ${T.translate(\"mui_table.total\")}: ${row.qty}`\n : row.description}\n </Text>\n {(row.cancellations || []).map((cancellation) => (\n <React.Fragment key={cancellation.id}>\n <Text style={styles.muted}>{cancellation.label}</Text>\n {cancellation.reason && (\n <Text style={styles.muted}>{cancellation.reason}</Text>\n )}\n </React.Fragment>\n ))}\n {row.subDescription && (\n <Text style={styles.muted}>{row.subDescription}</Text>\n )}\n </View>\n <Text style={s.price}>{row.price}</Text>\n {row.balanceCents != null ? (\n <Text\n style={[\n s.balance ?? styles.colBalance,\n row.balanceCents < 0 && styles.colBalanceNegative\n ]}\n >\n {formatBalance(row.balanceCents)}\n </Text>\n ) : (\n <View style={styles.colBalance} />\n )}\n </View>\n );\n};","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React from \"react\";\nimport T from \"i18n-react/dist/i18n-react\";\nimport { View, Text } from \"@react-pdf/renderer\";\nimport { currencyAmountFromCents } from \"../../../utils/money\";\n\n// Uses order-level totals matching the table's ReconciliationBox props:\n// cancelledTotal ← order.cancelled_total\n// refundsTotal ← order.refunds_total\n// retained ← order.retained\n// credited ← order.credited_to_payment_method\nexport const ReconciliationBlock = ({\n styles,\n cancelledTotal,\n refundsTotal,\n retained,\n credited\n}) => {\n const totalColor = retained > 0 ? \"#c62828\" : \"#1b5e20\";\n const totalLabel =\n retained > 0\n ? T.translate(\"sponsor_order_grid.retained\")\n : credited > 0\n ? T.translate(\"sponsor_order_grid.credited\")\n : T.translate(\"sponsor_order_grid.balance\");\n const totalValue =\n retained > 0 ? retained : credited > 0 ? credited : retained;\n\n return (\n <View style={styles.reconciliationWrapper} wrap={false}>\n <View style={styles.reconciliationBox}>\n <Text style={styles.reconciliationTitle}>\n {T.translate(\"sponsor_order_grid.reconciliation\")}\n </Text>\n <View style={styles.reconciliationRow}>\n <Text style={styles.reconciliationLabel}>\n {T.translate(\"sponsor_order_grid.cancelled\")}\n </Text>\n <Text style={styles.reconciliationValue}>\n {currencyAmountFromCents(cancelledTotal ?? 0)}\n </Text>\n </View>\n <View style={styles.reconciliationRow}>\n <Text style={styles.reconciliationLabel}>\n {T.translate(\"sponsor_order_grid.refunded\")}\n </Text>\n <Text style={styles.reconciliationValue}>\n {currencyAmountFromCents(refundsTotal ?? 0)}\n </Text>\n </View>\n <View style={styles.reconciliationDivider} />\n <View style={styles.reconciliationRow}>\n <Text style={styles.reconciliationLabel}>{totalLabel}</Text>\n <Text style={[styles.reconciliationValue, { color: totalColor }]}>\n {currencyAmountFromCents(totalValue ?? 0)}\n </Text>\n </View>\n </View>\n </View>\n );\n};\n","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport T from \"i18n-react/dist/i18n-react\";\nimport { Document, Page, Text, View, Image, pdf } from \"@react-pdf/renderer\";\nimport { createStyles, createRowStyles } from \"./styles\";\nimport {\n buildRows,\n formatDate,\n formatAddress,\n formatVenueName,\n getThemeFontFamily\n} from \"./helpers\";\nimport { FieldRow } from \"./components/field-row\";\nimport { PdfTableRow } from \"./components/pdf-table-row\";\nimport { ReconciliationBlock } from \"./components/reconciliation-block\";\nimport { formatBalance, getOrderTotal } from \"../../utils/money\";\n\nexport { buildRows };\n\n// logoSrc/theme are left to the consumer on purpose: this component is\n// shared across apps with different branding/typefaces, so no logo image or\n// font file ships with uicore. fontFamily is read off theme.typography and\n// falls back to a react-pdf built-in (no Font.register needed) when absent\n// OR when not registered via Font.register in the consuming app — react-pdf\n// throws on an unregistered family rather than falling back itself, so\n// getThemeFontFamily checks Font.getRegisteredFontFamilies() before using it.\nexport const OrderPdf = ({ order, summit, logoSrc, theme }) => {\n if (!order) throw new Error(\"OrderPdf: order is required\");\n if (!summit) throw new Error(\"OrderPdf: summit is required\");\n\n const fontFamily = getThemeFontFamily(theme);\n const styles = createStyles(fontFamily);\n const rowStyles = createRowStyles(styles);\n const rows = buildRows(order, summit);\n const mainLocation =\n summit.main_locations?.[0] ??\n summit.locations?.find((location) => location.is_main);\n\n const {\n cancelled_total: cancelledTotal = 0,\n refunds_total: refundsTotal = 0,\n retained = 0,\n credited_to_payment_method: credited = 0\n } = order;\n\n const total = getOrderTotal(order);\n\n const clientName =\n order.client?.contact_name || order.purchased_by_full_name || \"\";\n const clientCompany = order.client?.company_name || \"\";\n const clientAddress = formatAddress(order.address) || T.translate(\"general.not_available\");\n\n return (\n <Document>\n <Page size=\"A4\" orientation=\"portrait\" style={styles.page}>\n {/* Row 1: Logo | Invoice title + Order / Date */}\n <View style={styles.headerRow} wrap={false}>\n <View style={styles.cellLeft}>\n {logoSrc ? <Image src={logoSrc} style={styles.logo} /> : null}\n </View>\n <View style={styles.cellRight}>\n <Text style={styles.invoiceTitle}>\n {T.translate(\"order_invoice_pdf.invoice_title\")}\n </Text>\n <FieldRow\n styles={styles}\n label={T.translate(\"order_invoice_pdf.order\")}\n value={order.number}\n />\n <FieldRow\n styles={styles}\n label={T.translate(\"order_invoice_pdf.date\")}\n value={order.purchased_date ? formatDate(\n order.purchased_date,\n \"LOC\",\n \"YYYY/MM/DD hh:mm a\"\n ) : T.translate(\"order_invoice_pdf.pending\")}\n />\n <FieldRow\n styles={styles}\n label={T.translate(\"order_invoice_pdf.payment_method\")}\n value={order.payment_method ?? \"\"}\n />\n <FieldRow\n styles={styles}\n label={T.translate(\"order_invoice_pdf.status\")}\n value={order.status ?? \"\"}\n />\n <FieldRow\n styles={styles}\n label={T.translate(\"order_invoice_pdf.payment_date\")}\n value={order.created ? formatDate(\n order.created,\n \"LOC\",\n \"YYYY/MM/DD hh:mm a\"\n ) : \"\"}\n noBorder\n />\n </View>\n </View>\n\n {/* Row 2: Client + Address | Event + Venue + Address */}\n <View style={styles.headerRow} wrap={false}>\n <View style={styles.cellLeft}>\n <FieldRow\n styles={styles}\n label={T.translate(\"order_invoice_pdf.client\")}\n value={`${clientCompany}\\n${clientName}`}\n />\n <FieldRow\n styles={styles}\n label={T.translate(\"order_invoice_pdf.address\")}\n value={clientAddress}\n noBorder\n />\n </View>\n <View style={styles.cellRight}>\n <FieldRow\n styles={styles}\n label={T.translate(\"order_invoice_pdf.event\")}\n value={summit.name ?? \"\"}\n />\n <FieldRow\n styles={styles}\n label={T.translate(\"order_invoice_pdf.venue\")}\n value={formatVenueName(mainLocation) ?? \"\"}\n />\n <FieldRow\n styles={styles}\n label={T.translate(\"order_invoice_pdf.address\")}\n value={formatAddress(mainLocation) ?? \"\"}\n noBorder\n />\n </View>\n </View>\n\n {/* Table */}\n <View style={styles.tableWrapper}>\n <View style={styles.table}>\n <View style={styles.thRow} fixed>\n <Text style={[styles.thText, styles.colCode]}>\n {T.translate(\"sponsor_order_grid.code\")}\n </Text>\n <Text style={[styles.thText, styles.colType]}>\n {T.translate(\"sponsor_order_grid.type\")}\n </Text>\n <Text style={[styles.thText, styles.colDesc]}>\n {T.translate(\"sponsor_order_grid.details\")}\n </Text>\n <Text style={[styles.thText, styles.colPrice]}>\n {T.translate(\"sponsor_order_grid.amount\")}\n </Text>\n <Text style={[styles.thText, styles.colBalance]}>\n {T.translate(\"sponsor_order_grid.balance\")}\n </Text>\n </View>\n\n {rows.map((row) => (\n <PdfTableRow\n key={row.rowKey}\n row={row}\n styles={styles}\n rowStyles={rowStyles}\n />\n ))}\n\n {(cancelledTotal || refundsTotal || retained || credited) ? (\n <ReconciliationBlock\n styles={styles}\n cancelledTotal={cancelledTotal}\n refundsTotal={refundsTotal}\n retained={retained}\n credited={credited}\n />\n ) : null}\n\n <View style={styles.tdAmountDue}>\n <Text style={styles.tdAmountDueLabel}>\n {T.translate(\"sponsor_order_grid.amount_due\")}\n </Text>\n <View style={{ width: \"18%\" }} />\n <Text\n style={[\n styles.tdAmountDueValue,\n {\n color: (total ?? 0) > 0 ? \"#e65100\" : \"#1b5e20\"\n }\n ]}\n >\n {formatBalance(total ?? 0)}\n </Text>\n </View>\n </View>\n </View>\n </Page>\n </Document>\n );\n};\n\nOrderPdf.propTypes = {\n order: PropTypes.object.isRequired,\n summit: PropTypes.object.isRequired,\n logoSrc: PropTypes.string,\n theme: PropTypes.object\n};\n\n// Revoking a blob URL immediately after use has been reported to produce\n// empty/failed downloads on Safari and some Firefox versions, so both\n// generateInvoicePDF and previewPDF defer the revoke by this long instead.\nconst REVOKE_DELAY_MS = 60_000;\n\nexport const generateInvoicePDF = async (\n order,\n summit,\n { logoSrc, theme } = {}\n) => {\n try {\n const blob = await pdf(\n <OrderPdf\n order={order}\n summit={summit}\n logoSrc={logoSrc}\n theme={theme}\n />\n ).toBlob();\n const url = URL.createObjectURL(blob);\n const link = document.createElement(\"a\");\n link.href = url;\n link.download = `invoice-${order.number}.pdf`\n .toLowerCase()\n .replace(/\\s+/g, \"-\");\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n setTimeout(() => URL.revokeObjectURL(url), REVOKE_DELAY_MS);\n } catch (error) {\n console.error(\"Error generating invoice PDF:\", error);\n throw error;\n }\n};\n\nexport const previewPDF = async (order, summit, { logoSrc, theme } = {}) => {\n // Opened synchronously, before the await below, so the tab is still tied\n // to the originating click — otherwise Safari's popup blocker kills it.\n // Can't pass \"noopener\" (or \"noreferrer\", which implies it) here: that\n // makes window.open return null, and we need the reference to set\n // .location.href once the blob URL is ready.\n const newTab = window.open(\"\", \"_blank\");\n\n try {\n const blob = await pdf(\n <OrderPdf order={order} summit={summit} logoSrc={logoSrc} theme={theme} />\n ).toBlob();\n const url = URL.createObjectURL(blob);\n\n if (newTab) {\n newTab.location.href = url;\n // Revoke after the new tab has had a chance to load the PDF.\n setTimeout(() => URL.revokeObjectURL(url), REVOKE_DELAY_MS);\n return;\n }\n\n // Popup blocked: fall back to a download so the click isn't silently\n // swallowed.\n URL.revokeObjectURL(url);\n return generateInvoicePDF(order, summit, { logoSrc, theme });\n } catch (error) {\n console.error(\"Error generating invoice PDF preview:\", error);\n if (newTab) newTab.close();\n throw error;\n }\n};\n","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport T from \"i18n-react/dist/i18n-react\";\nimport { StyleSheet } from \"@react-pdf/renderer\";\n\n// Parameterized by fontFamily so a consumer's custom typeface (registered via\n// Font.register in their own app) applies to every text style explicitly,\n// not just the ones a consumer happens to remember to override.\nexport const createStyles = (fontFamily) => StyleSheet.create({\n page: {\n backgroundColor: \"#F7F7F8\",\n padding: 64,\n fontFamily,\n fontSize: 8,\n color: \"#212529\"\n },\n headerRow: {\n flexDirection: \"row\",\n marginBottom: 20,\n gap: 20\n },\n cellLeft: {\n flex: 1,\n backgroundColor: \"#ffffff\",\n borderRadius: 10,\n borderWidth: 1,\n borderColor: \"#DEE2E6\",\n paddingHorizontal: 18,\n paddingVertical: 10,\n justifyContent: \"center\"\n },\n logo: {\n width: \"100%\",\n height: 84,\n objectFit: \"contain\",\n marginBottom: 0,\n paddingBottom: 0\n },\n cellRight: {\n flex: 1,\n backgroundColor: \"#ffffff\",\n borderRadius: 10,\n borderWidth: 1,\n borderColor: \"#DEE2E6\",\n paddingHorizontal: 18,\n paddingVertical: 10\n },\n invoiceTitle: {\n fontFamily,\n fontWeight: \"bold\",\n fontSize: 14,\n lineHeight: 1.5,\n letterSpacing: 0,\n color: \"rgba(17, 19, 21, 1)\",\n marginBottom: 8\n },\n fieldRow: {\n fontSize: 8,\n lineHeight: 1.8,\n flexDirection: \"row\",\n color: \"rgba(0, 0, 0, 0.87)\",\n paddingBottom: 3,\n paddingTop: 6,\n borderBottom: \"1px solid rgba(224, 224, 224, 1)\",\n alignContent: \"flex-start\"\n },\n fieldRowNoBorder: {\n borderBottomWidth: 0\n },\n fieldLabel: {\n flex: 4,\n fontWeight: \"bold\",\n color: \"rgba(0, 0, 0, 0.87)\"\n },\n fieldValue: {\n flex: 9\n },\n tableWrapper: {\n marginTop: 8,\n borderRadius: 8,\n borderWidth: 1,\n borderStyle: \"solid\",\n borderColor: \"#eee\",\n backgroundColor: \"#ffffff\"\n },\n table: {\n fontFamily,\n borderRadius: 8,\n overflow: \"hidden\"\n },\n thRow: {\n flexDirection: \"row\",\n backgroundColor: \"#f0f0f0\",\n paddingVertical: 12,\n paddingHorizontal: 12,\n alignItems: \"center\",\n borderBottomWidth: 1,\n borderBottomStyle: \"solid\",\n borderBottomColor: \"#eee\"\n },\n thText: {\n fontFamily,\n fontSize: 7,\n fontWeight: 600,\n color: \"#333333\"\n },\n tdRow: {\n backgroundColor: \"#FFFFFF\",\n flexDirection: \"row\",\n paddingHorizontal: 12,\n paddingVertical: 14,\n alignItems: \"center\",\n borderBottomWidth: 1,\n borderBottomStyle: \"solid\",\n borderBottomColor: \"#eee\"\n },\n tdPayment: {\n flexDirection: \"row\",\n paddingHorizontal: 12,\n paddingVertical: 14,\n alignItems: \"flex-start\",\n backgroundColor: \"#f0fdf4\",\n borderBottomWidth: 1,\n borderBottomStyle: \"solid\",\n borderBottomColor: \"#eee\"\n },\n tdRefund: {\n flexDirection: \"row\",\n paddingHorizontal: 12,\n paddingVertical: 14,\n alignItems: \"flex-start\",\n backgroundColor: \"#fff7ed\",\n borderBottomWidth: 1,\n borderBottomStyle: \"solid\",\n borderBottomColor: \"#eee\"\n },\n tdNote: {\n flexDirection: \"row\",\n paddingHorizontal: 12,\n paddingVertical: 10,\n alignItems: \"flex-start\",\n backgroundColor: \"#FFFFFF\",\n borderBottomWidth: 1,\n borderBottomStyle: \"solid\",\n borderBottomColor: \"#eee\"\n },\n tdAmountDue: {\n flexDirection: \"row\",\n paddingHorizontal: 12,\n paddingVertical: 14,\n alignItems: \"center\",\n backgroundColor: \"#fafafa\",\n borderTopWidth: 1,\n borderTopColor: \"#000000\"\n },\n colCode: { width: \"12%\", fontSize: 8 },\n colCodePayment: { width: \"12%\", fontSize: 8, fontWeight: \"bold\" },\n colType: { width: \"15%\", fontSize: 8 },\n colDesc: { width: \"39%\", fontSize: 8 },\n colDescMultiLine: {\n width: \"39%\",\n flexDirection: \"column\",\n justifyContent: \"flex-start\"\n },\n colPrice: { width: \"18%\", textAlign: \"right\", fontSize: 8, color: \"#333333\" },\n colPriceRefund: {\n fontFamily,\n width: \"18%\",\n textAlign: \"right\",\n fontSize: 8,\n fontWeight: \"bold\",\n color: \"#e65100\"\n },\n colPricePayment: {\n fontFamily,\n width: \"18%\",\n textAlign: \"right\",\n fontSize: 8,\n fontWeight: \"bold\",\n color: \"#1b5e20\"\n },\n colBalance: {\n width: \"16%\",\n textAlign: \"right\",\n fontSize: 8,\n color: \"#666666\"\n },\n colBalanceNegative: { color: \"#dc2626\" },\n tdAmountDueLabel: {\n fontFamily,\n width: \"66%\",\n fontSize: 8,\n fontWeight: 700\n },\n tdAmountDueValue: {\n fontFamily,\n width: \"16%\",\n textAlign: \"right\",\n fontSize: 9,\n fontWeight: 700\n },\n paymentDesc: { fontFamily, fontSize: 8, fontWeight: \"bold\" },\n muted: { color: \"#6C757D\", fontSize: 8 },\n typeCell: { width: \"15%\", flexDirection: \"row\", alignItems: \"center\" },\n typeBadgeLabel: { fontSize: 8 },\n cancelledText: { color: \"#9ca3af\", textDecoration: \"line-through\" },\n reconciliationWrapper: {\n flexDirection: \"row\",\n paddingHorizontal: 12,\n paddingVertical: 12,\n borderBottomWidth: 1,\n borderBottomStyle: \"solid\",\n borderBottomColor: \"#eee\"\n },\n reconciliationBox: {\n width: \"33%\"\n },\n reconciliationTitle: {\n fontFamily,\n fontSize: 8,\n fontWeight: 600,\n color: \"#333333\",\n marginBottom: 6\n },\n reconciliationRow: {\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingVertical: 2\n },\n reconciliationLabel: {\n fontSize: 7,\n color: \"#6C757D\"\n },\n reconciliationValue: {\n fontSize: 7,\n color: \"#333333\",\n textAlign: \"right\"\n },\n reconciliationDivider: {\n borderBottomWidth: 1,\n borderBottomColor: \"#dee2e6\",\n marginVertical: 4\n }\n});\n\nexport const createRowStyles = (styles) => ({\n fee: {\n row: styles.tdRow,\n code: styles.colCode,\n descText: null,\n price: styles.colPrice,\n typeBadge: {\n icon: \"ArrowUpward\",\n iconColor: \"#ff9800\",\n label: T.translate(\"order_invoice_pdf.charge\"),\n labelColor: \"#333333\"\n }\n },\n item: {\n row: styles.tdRow,\n code: styles.colCode,\n descText: null,\n price: styles.colPrice,\n typeBadge: {\n icon: \"ArrowUpward\",\n iconColor: \"#ff9800\",\n label: T.translate(\"order_invoice_pdf.charge\"),\n labelColor: \"#333333\"\n }\n },\n discount: {\n row: styles.tdPayment,\n code: styles.colCodePayment,\n descText: styles.paymentDesc,\n price: styles.colPricePayment,\n typeBadge: {\n icon: \"ArrowDownward\",\n iconColor: \"#4caf50\",\n label: T.translate(\"mui_table.discount\"),\n labelColor: \"#1b5e20\"\n }\n },\n payment: {\n row: styles.tdPayment,\n code: styles.colCodePayment,\n descText: styles.paymentDesc,\n price: styles.colPricePayment,\n typeBadge: {\n icon: \"ArrowDownward\",\n iconColor: \"#4caf50\",\n label: T.translate(\"mui_table.payment\"),\n labelColor: \"#1b5e20\"\n }\n },\n refund: {\n row: styles.tdRefund,\n code: styles.colCodePayment,\n descText: styles.paymentDesc,\n price: styles.colPriceRefund,\n typeBadge: {\n icon: \"Refresh\",\n iconColor: \"#ea580c\",\n label: T.translate(\"mui_table.refund\"),\n labelColor: \"#e65100\"\n }\n },\n cancelled: {\n row: styles.tdRow,\n code: [styles.colCode, styles.cancelledText],\n descText: styles.cancelledText,\n price: [styles.colPrice, styles.cancelledText],\n balance: [styles.colBalance, styles.cancelledText],\n typeBadge: {\n icon: \"DoNotDisturb\",\n iconColor: \"#9ca3af\",\n label: T.translate(\"sponsor_order_grid.cancelled\"),\n labelColor: \"#9ca3af\"\n }\n }\n});\n"],"names":["root","factory","exports","module","define","amd","this","CENTS_FACTOR","TWO_DECIMAL_PLACES","ZERO_INT","BPS","MILLISECONDS_IN_SECOND","DISCOUNT_TYPES","AMOUNT","RATE","CURRENCY_SYMBOL","USD","EUR","GBP","CAD","AUD","NZD","CHF","ARS","BRL","MXN","currencyAmountFromCents","cents","currency","result","Number","isInteger","console","error","amount","c","isSafeInteger","Error","BigInt","s","trim","test","remainder","toString","padStart","amountFromCents","e","formatDiscount","type","getOrderTotal","order","net_amount","amount_due","formatBalance","abs","Math","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","require","DEFAULT_FONT_FAMILY","formatDate","date","timeZone","format","moment","tz","formatAddress","address","address_1","line1","address_2","line2","city","state","zip_code","postal_code","country","map","val","filter","Boolean","join","formatVenueName","location","short_name","name","buildRows","rows","balanceCents","forms","forEach","form","items","item","quantity","_item$type","_form$add_on","canceledQuantity","canceled_quantity","cancellations","cancelled","partiallyCancelled","push","rowKey","line_id","id","code","String","description","title","addon","add_on","qty","price","label","T","x","y","user","canceled_by_full_name","created","reason","discountCents","discount_in_cents","discount_amount","discount_type","fees","fee","payments","p","_objectSpread","_rowType","refunds","sort","b","method","subDescription","status","notes","note","content","FieldRow","styles","noBorder","React","View","style","fieldRow","fieldRowNoBorder","Text","fieldLabel","fieldValue","MUI_ICON_PATHS","ArrowUpward","ArrowDownward","Refresh","DoNotDisturb","PdfIcon","color","size","Svg","width","height","viewBox","marginRight","Path","fill","PdfTableRow","row","rowStyles","tdNote","colCode","muted","flex","typeBadge","typeCell","icon","iconColor","typeBadgeLabel","labelColor","colType","colDescMultiLine","descText","cancellation","balance","colBalance","colBalanceNegative","ReconciliationBlock","cancelledTotal","refundsTotal","retained","credited","totalColor","totalLabel","totalValue","reconciliationWrapper","wrap","reconciliationBox","reconciliationTitle","reconciliationRow","reconciliationLabel","reconciliationValue","reconciliationDivider","OrderPdf","summit","logoSrc","theme","_summit$main_location","_summit$locations","_order$client","_order$client2","fontFamily","_theme$typography","typography","resolved","split","replace","Font","getRegisteredFontFamilies","includes","getThemeFontFamily","StyleSheet","create","page","backgroundColor","padding","fontSize","headerRow","flexDirection","marginBottom","gap","cellLeft","borderRadius","borderWidth","borderColor","paddingHorizontal","paddingVertical","justifyContent","logo","objectFit","paddingBottom","cellRight","invoiceTitle","fontWeight","lineHeight","letterSpacing","paddingTop","borderBottom","alignContent","borderBottomWidth","tableWrapper","marginTop","borderStyle","table","overflow","thRow","alignItems","borderBottomStyle","borderBottomColor","thText","tdRow","tdPayment","tdRefund","tdAmountDue","borderTopWidth","borderTopColor","colCodePayment","colDesc","colPrice","textAlign","colPriceRefund","colPricePayment","tdAmountDueLabel","tdAmountDueValue","paymentDesc","cancelledText","textDecoration","marginVertical","createStyles","discount","payment","refund","createRowStyles","mainLocation","main_locations","locations","find","is_main","cancelled_total","refunds_total","credited_to_payment_method","total","clientName","client","contact_name","purchased_by_full_name","clientCompany","company_name","clientAddress","Document","Page","orientation","Image","src","number","purchased_date","payment_method","fixed","propTypes","PropTypes","isRequired","generateInvoicePDF","async","blob","pdf","toBlob","url","URL","createObjectURL","link","document","createElement","href","download","toLowerCase","body","appendChild","click","removeChild","setTimeout","revokeObjectURL","previewPDF","newTab","window","open","close"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"components/order-invoice-pdf.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBA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ources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/utils/constants.js","webpack://openstack-uicore-foundation/./src/utils/money.js","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"prop-types\"","webpack://openstack-uicore-foundation/external commonjs \"i18n-react/dist/i18n-react\"","webpack://openstack-uicore-foundation/external commonjs \"@react-pdf/renderer\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/defineProperty\"","webpack://openstack-uicore-foundation/external commonjs \"moment-timezone\"","webpack://openstack-uicore-foundation/./src/components/order-invoice-pdf/helpers.js","webpack://openstack-uicore-foundation/./src/components/order-invoice-pdf/components/field-row.js","webpack://openstack-uicore-foundation/./src/components/order-invoice-pdf/components/pdf-icon.js","webpack://openstack-uicore-foundation/./src/components/order-invoice-pdf/components/pdf-table-row.js","webpack://openstack-uicore-foundation/./src/components/order-invoice-pdf/components/reconciliation-block.js","webpack://openstack-uicore-foundation/./src/components/order-invoice-pdf/components/cancelled-items-summary.js","webpack://openstack-uicore-foundation/./src/components/order-invoice-pdf/index.js","webpack://openstack-uicore-foundation/./src/components/order-invoice-pdf/styles.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","export const CENTS_FACTOR = 100n;\nexport const TWO_DECIMAL_PLACES = 2;\nexport const THREE_DECIMAL_PLACES = 3;\nexport const ONE_CENT = 1n;\nexport const ZERO_INT = 0;\nexport const BPS = 100;\n\nexport const CODE_200 = 200;\n\nexport const DEBOUNCE_WAIT_250 = 250;\nexport const DEBOUNCE_WAIT = 500;\n\nexport const NOTIFICATION_TIMEOUT = 2000;\nexport const ASYNC_SELECT_SAFETY_TIMEOUT = 15000;\nexport const DEFAULT_PER_PAGE = 10;\nexport const TWENTY_PER_PAGE = 20;\nexport const FIFTY_PER_PAGE = 50;\nexport const MAX_PER_PAGE = 100;\n\nexport const INT_BASE = 10;\n\nexport const ONE_HUNDRED = 100;\nexport const MILLISECONDS_IN_SECOND = 1000;\n\nexport const MILLISECONDS_TO_SECONDS = 1000;\n\nexport const BYTES_PER_MB = 1_048_576; // 1024 * 1024\n\nexport const MAX_INVENTORY_IMAGE_UPLOAD_SIZE = 512000;\nexport const MAX_INVENTORY_IMAGES_UPLOAD_QTY = 5;\nexport const ALLOWED_INVENTORY_IMAGE_FORMATS = [\"jpg\", \"jpeg\", \"png\"];\n\nexport const METAFIELD_TYPES_WITH_OPTIONS = [\n \"CheckBoxList\",\n \"ComboBox\",\n \"RadioButtonList\"\n];\n\nexport const METAFIELD_TYPES = [\n \"CheckBox\",\n ...METAFIELD_TYPES_WITH_OPTIONS,\n \"Text\",\n \"TextArea\",\n \"Quantity\",\n \"DateTime\",\n \"Time\"\n];\n\nexport const DISCOUNT_TYPES = {\n AMOUNT: \"Amount\",\n RATE: \"Rate\"\n};\n\nexport const RATE_FIELDS = {\n EARLY_BIRD: \"early_bird_rate\",\n STANDARD: \"standard_rate\",\n ONSITE: \"onsite_rate\"\n};\n\nexport const DECIMAL_DIGITS = 2;\n\nexport const FILE_UPLOAD_STATUS = {\n PENDING: \"PENDING\",\n DEADLINE_ALERT: \"DEADLINE ALERT\",\n DEADLINE_MISSED: \"DEADLINE MISSED\",\n COMPLETE: \"COMPLETE\"\n};\n\nexport const FILE_UPLOAD_STATUS_COLOR = {\n [FILE_UPLOAD_STATUS.COMPLETE]: \"success.light\",\n [FILE_UPLOAD_STATUS.DEADLINE_MISSED]: \"error\",\n [FILE_UPLOAD_STATUS.DEADLINE_ALERT]: \"warning.light\",\n [FILE_UPLOAD_STATUS.PENDING]: \"default\"\n};\n\nexport const FILE_UPLOAD_STATUS_BKGR_COLOR = {\n [FILE_UPLOAD_STATUS.COMPLETE]: \"white\",\n [FILE_UPLOAD_STATUS.DEADLINE_MISSED]: \"#D32F2F0A\",\n [FILE_UPLOAD_STATUS.DEADLINE_ALERT]: \"#EF6C000A\",\n [FILE_UPLOAD_STATUS.PENDING]: \"white\"\n};\n\nexport const DATE_FORMAT = \"MM/DD/YYYY\";\nexport const DATETIME_FORMAT = \"MM/DD/YYYY hh:mm a\";\n\nexport const SPONSOR_FORMS_METAFIELD_CLASS = {\n FORM: \"Form\",\n ITEM: \"Item\"\n};\n\nexport const SPONSOR_ORDER_GRID_ITEM_TYPES = {\n CHARGE: \"Charge\",\n PAYMENT: \"Payment\",\n REFUND: \"Refund\",\n DISCOUNT: \"Discount\",\n CANCELLED: \"Cancelled\"\n};","/**\n * Copyright 2025 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport {\n BPS,\n CENTS_FACTOR,\n DISCOUNT_TYPES,\n ONE_CENT,\n THREE_DECIMAL_PLACES,\n TWO_DECIMAL_PLACES,\n ZERO_INT\n} from \"./constants\";\n\nconst CURRENCY_SYMBOL = {\n USD: \"$\",\n EUR: \"€\",\n GBP: \"£\",\n CAD: \"C$\",\n AUD: \"A$\",\n NZD: \"NZ$\",\n CHF: \"CHF\",\n ARS: \"AR$\",\n BRL: \"R$\",\n MXN: \"MX$\",\n};\n\n/**\n * Convert a decimal money amount to integer cents safely (no floating point math).\n *\n * Why this exists:\n * - `Math.round(parseFloat(x) * 100)` can be wrong due to IEEE-754 floating point errors\n * (e.g. 1.005 * 100 may become 100.499999..., rounding down unexpectedly).\n *\n * Input:\n * - number or string (recommended: string from API/UI)\n * - Examples: \"12.34\", \"1,234.56\", \"1234,56\", 12.34\n *\n * Output:\n * - Number cents (exact), e.g. \"12.34\" -> 1234\n *\n * Rounding:\n * - Half-up to 2 decimals (>= 0.005 USD rounds up by 1 cent).\n *\n * Notes:\n * - Amounts are assumed to be NON-negative (per your requirement).\n * - Throws on invalid formats (does not silently return 0).\n */\nexport function amountToCents(amount) {\n if (amount == null) throw new Error(\"amount is required\");\n\n let s = String(amount).trim();\n\n // Normalize common separators:\n // - \"1,234.56\" => \"1234.56\" (remove thousands separators)\n // - \"1234,56\" => \"1234.56\" (convert decimal comma to dot)\n if (s.includes(\",\") && s.includes(\".\")) {\n s = s.replace(/,/g, \"\");\n } else if (s.includes(\",\") && !s.includes(\".\")) {\n s = s.replace(\",\", \".\");\n }\n\n // Validate: digits optionally followed by '.' and more digits\n if (!/^\\d+(\\.\\d+)?$/.test(s)) {\n throw new Error(`Invalid money format: \"${amount}\"`);\n }\n\n const [intPart, fracRaw = \"\"] = s.split(\".\");\n\n // Pad at least 3 fractional digits so we can:\n // - take 2 digits for cents\n // - take the 3rd digit to decide rounding\n const fracPadded = (`${fracRaw}000`);\n\n const tenths = fracPadded[0] ?? \"0\"; // 1st decimal digit\n const hundredths = fracPadded[1] ?? \"0\"; // 2nd decimal digit (cents)\n const thousandths = fracPadded[2] ?? \"0\"; // 3rd decimal digit (rounding decision)\n\n // If there are more than 3 decimals, we track if any non-zero exists after the 3rd.\n // This can matter for policies like bankers rounding; here it's mainly informational.\n const trailing =\n fracRaw.length > THREE_DECIMAL_PLACES\n ? fracRaw.slice(THREE_DECIMAL_PLACES)\n : \"\";\n const hasTrailingNonZero = /[1-9]/.test(trailing);\n\n // Build cents as integer: (dollars * 100) + (first two decimal digits)\n let cents = BigInt(intPart) * CENTS_FACTOR + BigInt(tenths + hundredths);\n\n // Half-up rounding:\n // - If the 3rd digit is >= 5, round up by 1 cent.\n // - If there are more digits beyond the 3rd, \"5xxx\" should also round up.\n const roundUp = thousandths > \"5\" || thousandths === \"5\" || (thousandths === \"5\" && hasTrailingNonZero);\n\n if (roundUp) cents += ONE_CENT;\n\n return Number(cents);\n}\n\n/**\n * Convert an amount in cents to a decimal string (e.g. 1234 -> \"12.34\") safely.\n *\n * Why:\n * - Avoids floating point math (cents / 100) which can lose precision for large integers\n * or if cents is already imprecise as a JS Number.\n *\n * Input:\n * - Accepts: bigint | number | string (digits)\n * - Assumes NON-negative cents (per your requirement).\n *\n * Output:\n * - Always returns a string with exactly 2 decimal places.\n */\nexport function amountFromCents(cents) {\n let c;\n\n // Normalize input to BigInt safely\n if (typeof cents === \"bigint\") {\n c = cents;\n } else if (typeof cents === \"number\") {\n // Ensure it's a safe integer before converting to BigInt\n if (!Number.isSafeInteger(cents)) {\n throw new Error(\"cents must be a safe integer Number (or pass BigInt/string).\");\n }\n c = BigInt(cents);\n } else if (typeof cents === \"string\") {\n const s = cents.trim();\n if (!/^\\d+$/.test(s)) {\n throw new Error(\"cents string must contain digits only (e.g., '1234').\");\n }\n c = BigInt(s);\n } else {\n throw new Error(\"cents must be a bigint, number, or numeric string.\");\n }\n\n if (c < ZERO_INT) {\n throw new Error(\"cents must be non-negative.\");\n }\n\n const amount = c / CENTS_FACTOR;\n const remainder = c % CENTS_FACTOR;\n\n // Always pad remainder to 2 digits\n return `${amount.toString()}.${remainder.toString().padStart(TWO_DECIMAL_PLACES, \"0\")}`;\n}\n\n/**\n * @param cents\n * @param currency\n * @returns {string}\n */\nexport function currencyAmountFromCents(cents, currency = \"USD\") {\n let result = \"!ERROR\";\n\n if (typeof cents !== \"number\" || !Number.isInteger(cents)) {\n console.error(\"ERROR - currencyAmountFromCents: cents must be an integer number\");\n return result;\n }\n\n try {\n const amount = amountFromCents(cents); // \"12.34\"\n const symbol = CURRENCY_SYMBOL[currency] ?? \"$\";\n result = `${symbol}${amount}`;\n } catch (e) {\n console.error(`ERROR - currencyAmountFromCents: ${e}`);\n }\n\n return result;\n}\n\n/**\n * Converts a price string into cents.\n * @param {string} priceString - The price (e.g., $0.30).\n * @returns {number} - The amount converted to cents (e.g., 30).\n */\nexport const parsePrice = (priceString) => {\n if (priceString == null) throw new Error(\"priceString is required\");\n\n let s = String(priceString).trim();\n\n // Reject negatives explicitly (per your requirement).\n if (s.includes(\"-\")) throw new Error(\"Negative amounts are not allowed\");\n\n // Keep only digits and separators. Remove currency symbols/letters/spaces.\n s = s.replace(/[^\\d.,]/g, \"\");\n if (!s) throw new Error(`Invalid price: \"${priceString}\"`);\n\n // Delegate exact cents conversion (no floats)\n return amountToCents(s); // <- your safe BigInt cents converter\n};\n\n/**\n * Formats a discount value in BPS or CENTS to string.\n * @param {number} amount - The discount in BPS or CENTS(e.g., 300 = 3%).\n * @param {string} type - The discount type: \"Amount\" or \"Rate\".\n * @returns {string} - The discount converted to string (e.g., $5).\n */\nexport const formatDiscount = (amount, type) => {\n if (type === DISCOUNT_TYPES.AMOUNT) return currencyAmountFromCents(amount);\n if (type === DISCOUNT_TYPES.RATE) return `${amount / BPS}%`; // transform from bps to percentage\n return \"\";\n};\n\n/**\n * Derives an order's amount due directly from its raw net_amount/amount_due\n * fields (both in cents). This is the single source for that fallback rule,\n * shared by consumers that normalize a raw order (e.g. into order.total) and\n * by consumers that render straight from the raw order (e.g. the invoice PDF).\n * @param {object} order - Raw order object with net_amount/amount_due in cents.\n * @returns {number} - The amount due, in cents.\n */\nexport const getOrderTotal = (order) => {\n if (!order) return 0;\n return order.net_amount || order.amount_due || 0;\n};\n\n/**\n * Formats a signed amount in cents as currency, preserving the sign\n * (e.g. -500 -> \"-$5.00\").\n * @param {number} cents\n * @returns {string}\n */\nexport const formatBalance = (cents) => {\n if (cents == null) return \"\";\n const abs = currencyAmountFromCents(Math.abs(cents));\n return cents < 0 ? `-${abs}` : abs;\n};","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"prop-types\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"i18n-react/dist/i18n-react\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@react-pdf/renderer\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/defineProperty\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"moment-timezone\");","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport moment from \"moment-timezone\";\nimport T from \"i18n-react/dist/i18n-react\";\nimport { Font } from \"@react-pdf/renderer\";\nimport { currencyAmountFromCents, formatDiscount } from \"../../utils/money\";\nimport { MILLISECONDS_IN_SECOND } from \"../../utils/constants\";\n\nexport const DEFAULT_FONT_FAMILY = \"Helvetica\";\n\nexport const formatDate = (\n date,\n timeZone = \"LOC\",\n format = \"dddd Do h:mm a\"\n) => {\n if (!date) return \"\";\n\n if (timeZone === \"LOC\") {\n return moment(date * MILLISECONDS_IN_SECOND).format(format);\n }\n\n return moment(date * MILLISECONDS_IN_SECOND)\n .tz(timeZone)\n .format(format);\n};\n\nexport const formatAddress = (address) => {\n if (!address) return \"\";\n return [\n address.address_1 ?? address.line1,\n address.address_2 ?? address.line2,\n address.city,\n address.state,\n address.zip_code ?? address.postal_code,\n address.country\n ]\n .map(val => (val ?? \"\").toString().trim())\n .filter(Boolean)\n .join(\", \");\n};\n\nexport const formatVenueName = (location) => {\n if (!location) return \"\";\n return `${location?.short_name ?? \"\"}${location?.name ? ` (${location?.name})` : \"\"}`;\n};\n\n// Reads fontFamily off the consumer's MUI theme so it stays in sync with the\n// rest of their app instead of being duplicated as a separate literal. Only\n// the first name in the CSS font stack is usable here: react-pdf renders\n// with fonts registered via Font.register, so this name must match a family\n// already registered that way in the consuming app.\nexport const getThemeFontFamily = (theme) => {\n const fontFamily = theme?.typography?.fontFamily;\n if (!fontFamily) return DEFAULT_FONT_FAMILY;\n const resolved = fontFamily.split(\",\")[0].trim().replace(/^['\"]|['\"]$/g, \"\");\n return Font.getRegisteredFontFamilies().includes(resolved)\n ? resolved\n : DEFAULT_FONT_FAMILY;\n};\n\nexport const buildRows = (order) => {\n const rows = [];\n let balanceCents = 0;\n\n (order.forms || []).forEach((form) => {\n (form.items || [])\n .filter((item) => (item.quantity ?? 1) > 0)\n .forEach((item) => {\n // Cancellation is per-item and quantity-scoped: canceled_quantity may\n // be anywhere from 0 (not cancelled) up to quantity (fully cancelled),\n // with the individual cancellation events (and their frozen per-event\n // amounts) listed in cancellations. Mirrors SponsorOrderGrid's contract.\n const quantity = item.quantity ?? 1;\n const canceledQuantity = item.canceled_quantity ?? 0;\n const cancellations = item.cancellations ?? [];\n const cancelled = canceledQuantity > 0 && canceledQuantity === quantity;\n const partiallyCancelled = canceledQuantity > 0 && canceledQuantity < quantity;\n\n // Matches SponsorOrderGrid: a charge stays in the ledger in full\n // whether it's cancelled or not, partially or fully -- cancellation\n // only nets out via the reconciliation block below.\n balanceCents += item.amount;\n\n rows.push({\n rowKey: `item-${item.line_id ?? item.id}`,\n type: \"item\",\n // Table shows form.code per item row (columnKey: \"formCode\", value: form.code)\n code: String(form.code || \"\"),\n // Distinct from `code` (the form's code) -- this is the item's own\n // code, used by the \"Cancelled items:\" summary to mirror\n // SponsorOrderGrid's \"formCode - itemCode (x/y)\" links.\n itemCode: String(item.type?.code || item.code || \"\"),\n description: String(item.type?.name || item.title || \"\"),\n addon: String(form.add_on?.name || \"\"),\n qty: String(quantity - canceledQuantity),\n quantity,\n canceledQuantity,\n price: currencyAmountFromCents(item.amount),\n balanceCents,\n cancelled,\n partiallyCancelled,\n cancellations: cancellations.map((c) => ({\n id: c.id,\n label: T.translate(\"sponsor_order_grid.cancelled_by\", {\n x: c.quantity,\n y: quantity,\n user: c.canceled_by_full_name,\n date: formatDate(c.created, \"LOC\", \"M/D/YY [@] h:mm A\")\n }),\n reason: c.reason ? String(c.reason) : \"\"\n }))\n });\n });\n\n const discountCents = form.discount_in_cents ?? 0;\n if (discountCents) {\n balanceCents -= discountCents;\n rows.push({\n rowKey: `discount-${form.id}`,\n type: \"discount\",\n code: T.translate(\"mui_table.dis\"),\n description: formatDiscount(form.discount_amount, form.discount_type),\n addon: \"\",\n qty: \"\",\n price: currencyAmountFromCents(discountCents),\n balanceCents\n });\n }\n });\n\n (order.fees || []).forEach((fee) => {\n balanceCents += fee.amount;\n rows.push({\n rowKey: `fee-${fee.line_id ?? fee.id}`,\n type: \"fee\",\n code: T.translate(\"mui_table.payfee\"),\n description: String(fee.title || \"\"),\n addon: \"\",\n qty: \"1\",\n price: currencyAmountFromCents(fee.amount),\n balanceCents\n });\n });\n\n // Payments and refunds interleaved and sorted by created:\n const paymentsAndRefundsOrdered = [\n ...(order.payments || []).map((p) => ({ ...p, _rowType: \"payment\" })),\n ...(order.refunds || []).map((r) => ({ ...r, _rowType: \"refund\" }))\n ].sort((a, b) => a.created - b.created);\n\n paymentsAndRefundsOrdered.forEach((item) => {\n if (item._rowType === \"payment\") {\n balanceCents -= item.amount;\n rows.push({\n rowKey: `payment-${item.id}`,\n type: \"payment\",\n code: T.translate(\"mui_table.pay\"),\n description: `${T.translate(\"mui_table.paid_via\")} ${item.method || T.translate(\"mui_table.card\")}`,\n subDescription: formatDate(item.created, \"LOC\", \"YYYY/MM/DD HH:mm\"),\n addon: \"\",\n qty: \"1\",\n price: currencyAmountFromCents(item.amount),\n balanceCents\n });\n } else {\n balanceCents += item.amount;\n rows.push({\n rowKey: `refund-${item.id}`,\n type: \"refund\",\n code: T.translate(\"mui_table.ref\"),\n description: String(item.reason || T.translate(\"mui_table.refund\")),\n subDescription: String(item.status || \"\"),\n addon: \"\",\n qty: \"1\",\n price: currencyAmountFromCents(item.amount),\n balanceCents\n });\n }\n });\n\n (order.notes || []).forEach((note) => {\n rows.push({\n rowKey: `note-${note.id}`,\n type: \"note\",\n content: String(note.content || \"\")\n });\n });\n\n return rows;\n};\n","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React from \"react\";\nimport { View, Text } from \"@react-pdf/renderer\";\n\nexport const FieldRow = ({ styles, label, value, noBorder = false }) => (\n <View style={[styles.fieldRow, noBorder && styles.fieldRowNoBorder]}>\n <Text style={styles.fieldLabel}>{label ?? \"\"}</Text>\n <Text style={styles.fieldValue}>{value ?? \"\"}</Text>\n </View>\n);","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React from \"react\";\nimport { Svg, Path } from \"@react-pdf/renderer\";\n\nconst MUI_ICON_PATHS = {\n ArrowUpward: \"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z\",\n ArrowDownward:\n \"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z\",\n Refresh:\n \"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z\",\n DoNotDisturb:\n \"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z\",\n SubdirectoryArrowRight:\n \"m19 15-6 6-1.42-1.42L15.17 16H4V4h2v10h9.17l-3.59-3.58L13 9z\"\n};\n\nconst PDF_ICON_SIZE = 8;\n\nexport const PdfIcon = ({ name, color, size = PDF_ICON_SIZE }) => (\n <Svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n style={{ marginRight: 3 }}\n >\n <Path d={MUI_ICON_PATHS[name]} fill={color} />\n </Svg>\n);","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React from \"react\";\nimport T from \"i18n-react/dist/i18n-react\";\nimport { View, Text } from \"@react-pdf/renderer\";\nimport { formatBalance } from \"../../../utils/money\";\nimport { PdfIcon } from \"./pdf-icon\";\n\nexport const PdfTableRow = ({ row, styles, rowStyles }) => {\n // Notes span all columns, matching NotesRow in the table\n if (row.type === \"note\") {\n return (\n <View style={styles.tdNote}>\n <Text style={[styles.colCode, styles.muted]}>\n {T.translate(\"mui_table.note\")}\n </Text>\n <Text style={[{ flex: 1 }, styles.muted]}>{row.content}</Text>\n </View>\n );\n }\n\n const s = rowStyles[row.cancelled ? \"cancelled\" : row.type];\n return (\n <View style={s.row}>\n <Text style={s.code}>{row.code}</Text>\n {s.typeBadge ? (\n <View style={styles.typeCell}>\n <PdfIcon name={s.typeBadge.icon} color={s.typeBadge.iconColor} />\n <Text\n style={[styles.typeBadgeLabel, { color: s.typeBadge.labelColor }]}\n >\n {s.typeBadge.label}\n </Text>\n </View>\n ) : (\n <View style={styles.colType} />\n )}\n <View style={styles.colDescMultiLine}>\n <Text style={s.descText}>\n {row.type === \"item\"\n ? `${row.description} - ${T.translate(\"mui_table.total\")}: ${row.qty}`\n : row.description}\n </Text>\n {(row.cancellations || []).map((cancellation) => (\n <React.Fragment key={cancellation.id}>\n <Text style={styles.muted}>{cancellation.label}</Text>\n {/* {cancellation.reason && ( */}\n <View style={styles.cancellationReasonRow}>\n <PdfIcon name=\"SubdirectoryArrowRight\" color=\"#6C757D\" />\n <Text style={styles.cancellationReason}>\n {cancellation.reason} This is a test reason \n </Text>\n </View>\n {/* )} */}\n </React.Fragment>\n ))}\n {row.subDescription && (\n <Text style={styles.muted}>{row.subDescription}</Text>\n )}\n </View>\n <Text style={s.price}>{row.price}</Text>\n {row.balanceCents != null ? (\n <Text\n style={[\n s.balance ?? styles.colBalance,\n row.balanceCents < 0 && styles.colBalanceNegative\n ]}\n >\n {formatBalance(row.balanceCents)}\n </Text>\n ) : (\n <View style={styles.colBalance} />\n )}\n </View>\n );\n};","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React from \"react\";\nimport T from \"i18n-react/dist/i18n-react\";\nimport { View, Text } from \"@react-pdf/renderer\";\nimport { currencyAmountFromCents } from \"../../../utils/money\";\n\n// Uses order-level totals matching the table's ReconciliationBox props:\n// cancelledTotal ← order.cancelled_total\n// refundsTotal ← order.refunds_total\n// retained ← order.retained\n// credited ← order.credited_to_payment_method\nexport const ReconciliationBlock = ({\n styles,\n cancelledTotal,\n refundsTotal,\n retained,\n credited\n}) => {\n const totalColor = retained > 0 ? \"#c62828\" : \"#1b5e20\";\n const totalLabel =\n retained > 0\n ? T.translate(\"sponsor_order_grid.retained\")\n : credited > 0\n ? T.translate(\"sponsor_order_grid.credited\")\n : T.translate(\"sponsor_order_grid.balance\");\n const totalValue =\n retained > 0 ? retained : credited > 0 ? credited : retained;\n\n return (\n <View style={styles.reconciliationWrapper} wrap={false}>\n <View style={styles.reconciliationBox}>\n <Text style={styles.reconciliationTitle}>\n {T.translate(\"sponsor_order_grid.reconciliation\")}\n </Text>\n <View style={styles.reconciliationRow}>\n <Text style={styles.reconciliationLabel}>\n {T.translate(\"sponsor_order_grid.cancelled\")}\n </Text>\n <Text style={styles.reconciliationValue}>\n {currencyAmountFromCents(cancelledTotal ?? 0)}\n </Text>\n </View>\n <View style={styles.reconciliationRow}>\n <Text style={styles.reconciliationLabel}>\n {T.translate(\"sponsor_order_grid.refunded\")}\n </Text>\n <Text style={styles.reconciliationValue}>\n {currencyAmountFromCents(refundsTotal ?? 0)}\n </Text>\n </View>\n <View style={styles.reconciliationDivider} />\n <View style={styles.reconciliationRow}>\n <Text style={styles.reconciliationLabel}>{totalLabel}</Text>\n <Text style={[styles.reconciliationValue, { color: totalColor }]}>\n {currencyAmountFromCents(totalValue ?? 0)}\n </Text>\n </View>\n </View>\n </View>\n );\n};\n","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React from \"react\";\nimport T from \"i18n-react/dist/i18n-react\";\nimport { View, Text } from \"@react-pdf/renderer\";\nimport { PdfIcon } from \"./pdf-icon\";\n\n// Mirrors SponsorOrderGrid's CancelledItems: an at-a-glance list of every\n// (partially or fully) cancelled line, so a reader doesn't have to scan the\n// whole table to find them. `items` are order-invoice-pdf rows (from\n// buildRows), not raw order items.\nexport const CancelledItemsSummary = ({ items, styles }) => {\n if (!items || items.length === 0) return null;\n\n return (\n <View style={styles.cancelledItemsWrapper} wrap={false}>\n <PdfIcon name=\"DoNotDisturb\" color=\"#212529\" />\n <Text style={styles.cancelledItemsLabel}>\n {T.translate(\"sponsor_order_grid.cancelled_items\")}\n </Text>\n {items.map((item) => (\n <Text\n key={item.rowKey}\n style={[\n styles.cancelledItemLink,\n item.cancelled && styles.cancelledItemLinkBold\n ]}\n >\n {item.code} - {item.itemCode} ({item.canceledQuantity}/{item.quantity})\n </Text>\n ))}\n </View>\n );\n};\n","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport T from \"i18n-react/dist/i18n-react\";\nimport { Document, Page, Text, View, Image, pdf } from \"@react-pdf/renderer\";\nimport { createStyles, createRowStyles } from \"./styles\";\nimport {\n buildRows,\n formatDate,\n formatAddress,\n formatVenueName,\n getThemeFontFamily\n} from \"./helpers\";\nimport { FieldRow } from \"./components/field-row\";\nimport { PdfTableRow } from \"./components/pdf-table-row\";\nimport { ReconciliationBlock } from \"./components/reconciliation-block\";\nimport { CancelledItemsSummary } from \"./components/cancelled-items-summary\";\nimport { formatBalance, getOrderTotal } from \"../../utils/money\";\n\nexport { buildRows };\n\n// logoSrc/theme are left to the consumer on purpose: this component is\n// shared across apps with different branding/typefaces, so no logo image or\n// font file ships with uicore. fontFamily is read off theme.typography and\n// falls back to a react-pdf built-in (no Font.register needed) when absent\n// OR when not registered via Font.register in the consuming app — react-pdf\n// throws on an unregistered family rather than falling back itself, so\n// getThemeFontFamily checks Font.getRegisteredFontFamilies() before using it.\nexport const OrderPdf = ({ order, summit, logoSrc, theme }) => {\n if (!order) throw new Error(\"OrderPdf: order is required\");\n if (!summit) throw new Error(\"OrderPdf: summit is required\");\n\n const fontFamily = getThemeFontFamily(theme);\n const styles = createStyles(fontFamily);\n const rowStyles = createRowStyles(styles);\n const rows = buildRows(order, summit);\n const cancelledItems = rows.filter(\n (row) => row.type === \"item\" && row.cancellations?.length > 0\n );\n const mainLocation =\n summit.main_locations?.[0] ??\n summit.locations?.find((location) => location.is_main);\n\n const {\n cancelled_total: cancelledTotal = 0,\n refunds_total: refundsTotal = 0,\n retained = 0,\n credited_to_payment_method: credited = 0\n } = order;\n\n const total = getOrderTotal(order);\n\n const clientName =\n order.client?.contact_name || order.purchased_by_full_name || \"\";\n const clientCompany = order.client?.company_name || \"\";\n const clientAddress = formatAddress(order.address) || T.translate(\"general.not_available\");\n\n return (\n <Document>\n <Page size=\"A4\" orientation=\"portrait\" style={styles.page}>\n {/* Row 1: Logo | Invoice title + Order / Date */}\n <View style={styles.headerRow} wrap={false}>\n <View style={styles.cellLeft}>\n {logoSrc ? <Image src={logoSrc} style={styles.logo} /> : null}\n </View>\n <View style={styles.cellRight}>\n <Text style={styles.invoiceTitle}>\n {T.translate(\"order_invoice_pdf.invoice_title\")}\n </Text>\n <FieldRow\n styles={styles}\n label={T.translate(\"order_invoice_pdf.order\")}\n value={order.number}\n />\n <FieldRow\n styles={styles}\n label={T.translate(\"order_invoice_pdf.date\")}\n value={order.purchased_date ? formatDate(\n order.purchased_date,\n \"LOC\",\n \"YYYY/MM/DD hh:mm a\"\n ) : T.translate(\"order_invoice_pdf.pending\")}\n />\n <FieldRow\n styles={styles}\n label={T.translate(\"order_invoice_pdf.payment_method\")}\n value={order.payment_method ?? \"\"}\n />\n <FieldRow\n styles={styles}\n label={T.translate(\"order_invoice_pdf.status\")}\n value={order.status ?? \"\"}\n />\n <FieldRow\n styles={styles}\n label={T.translate(\"order_invoice_pdf.payment_date\")}\n value={order.created ? formatDate(\n order.created,\n \"LOC\",\n \"YYYY/MM/DD hh:mm a\"\n ) : \"\"}\n noBorder\n />\n </View>\n </View>\n\n {/* Row 2: Client + Address | Event + Venue + Address */}\n <View style={styles.headerRow} wrap={false}>\n <View style={styles.cellLeft}>\n <FieldRow\n styles={styles}\n label={T.translate(\"order_invoice_pdf.client\")}\n value={`${clientCompany}\\n${clientName}`}\n />\n <FieldRow\n styles={styles}\n label={T.translate(\"order_invoice_pdf.address\")}\n value={clientAddress}\n noBorder\n />\n </View>\n <View style={styles.cellRight}>\n <FieldRow\n styles={styles}\n label={T.translate(\"order_invoice_pdf.event\")}\n value={summit.name ?? \"\"}\n />\n <FieldRow\n styles={styles}\n label={T.translate(\"order_invoice_pdf.venue\")}\n value={formatVenueName(mainLocation) ?? \"\"}\n />\n <FieldRow\n styles={styles}\n label={T.translate(\"order_invoice_pdf.address\")}\n value={formatAddress(mainLocation) ?? \"\"}\n noBorder\n />\n </View>\n </View>\n\n <CancelledItemsSummary items={cancelledItems} styles={styles} />\n\n {/* Table */}\n <View style={styles.tableWrapper}>\n <View style={styles.table}>\n <View style={styles.thRow} fixed>\n <Text style={[styles.thText, styles.colCode]}>\n {T.translate(\"sponsor_order_grid.code\")}\n </Text>\n <Text style={[styles.thText, styles.colType]}>\n {T.translate(\"sponsor_order_grid.type\")}\n </Text>\n <Text style={[styles.thText, styles.colDesc]}>\n {T.translate(\"sponsor_order_grid.details\")}\n </Text>\n <Text style={[styles.thText, styles.colPrice]}>\n {T.translate(\"sponsor_order_grid.amount\")}\n </Text>\n <Text style={[styles.thText, styles.colBalance]}>\n {T.translate(\"sponsor_order_grid.balance\")}\n </Text>\n </View>\n\n {rows.map((row) => (\n <PdfTableRow\n key={row.rowKey}\n row={row}\n styles={styles}\n rowStyles={rowStyles}\n />\n ))}\n\n {(cancelledTotal || refundsTotal || retained || credited) ? (\n <ReconciliationBlock\n styles={styles}\n cancelledTotal={cancelledTotal}\n refundsTotal={refundsTotal}\n retained={retained}\n credited={credited}\n />\n ) : null}\n\n <View style={styles.tdAmountDue}>\n <Text style={styles.tdAmountDueLabel}>\n {T.translate(\"sponsor_order_grid.amount_due\")}\n </Text>\n <View style={{ width: \"18%\" }} />\n <Text\n style={[\n styles.tdAmountDueValue,\n {\n color: (total ?? 0) > 0 ? \"#e65100\" : \"#1b5e20\"\n }\n ]}\n >\n {formatBalance(total ?? 0)}\n </Text>\n </View>\n </View>\n </View>\n </Page>\n </Document>\n );\n};\n\nOrderPdf.propTypes = {\n order: PropTypes.object.isRequired,\n summit: PropTypes.object.isRequired,\n logoSrc: PropTypes.string,\n theme: PropTypes.object\n};\n\n// Revoking a blob URL immediately after use has been reported to produce\n// empty/failed downloads on Safari and some Firefox versions, so both\n// generateInvoicePDF and previewPDF defer the revoke by this long instead.\nconst REVOKE_DELAY_MS = 60_000;\n\nexport const generateInvoicePDF = async (\n order,\n summit,\n { logoSrc, theme } = {}\n) => {\n try {\n const blob = await pdf(\n <OrderPdf\n order={order}\n summit={summit}\n logoSrc={logoSrc}\n theme={theme}\n />\n ).toBlob();\n const url = URL.createObjectURL(blob);\n const link = document.createElement(\"a\");\n link.href = url;\n link.download = `invoice-${order.number}.pdf`\n .toLowerCase()\n .replace(/\\s+/g, \"-\");\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n setTimeout(() => URL.revokeObjectURL(url), REVOKE_DELAY_MS);\n } catch (error) {\n console.error(\"Error generating invoice PDF:\", error);\n throw error;\n }\n};\n\nexport const previewPDF = async (order, summit, { logoSrc, theme } = {}) => {\n // Opened synchronously, before the await below, so the tab is still tied\n // to the originating click — otherwise Safari's popup blocker kills it.\n // Can't pass \"noopener\" (or \"noreferrer\", which implies it) here: that\n // makes window.open return null, and we need the reference to set\n // .location.href once the blob URL is ready.\n const newTab = window.open(\"\", \"_blank\");\n\n try {\n const blob = await pdf(\n <OrderPdf order={order} summit={summit} logoSrc={logoSrc} theme={theme} />\n ).toBlob();\n const url = URL.createObjectURL(blob);\n\n if (newTab) {\n newTab.location.href = url;\n // Revoke after the new tab has had a chance to load the PDF.\n setTimeout(() => URL.revokeObjectURL(url), REVOKE_DELAY_MS);\n return;\n }\n\n // Popup blocked: fall back to a download so the click isn't silently\n // swallowed.\n URL.revokeObjectURL(url);\n return generateInvoicePDF(order, summit, { logoSrc, theme });\n } catch (error) {\n console.error(\"Error generating invoice PDF preview:\", error);\n if (newTab) newTab.close();\n throw error;\n }\n};\n","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport T from \"i18n-react/dist/i18n-react\";\nimport { StyleSheet } from \"@react-pdf/renderer\";\n\n// Parameterized by fontFamily so a consumer's custom typeface (registered via\n// Font.register in their own app) applies to every text style explicitly,\n// not just the ones a consumer happens to remember to override.\nexport const createStyles = (fontFamily) => StyleSheet.create({\n page: {\n backgroundColor: \"#F7F7F8\",\n padding: 64,\n fontFamily,\n fontSize: 8,\n color: \"#212529\"\n },\n headerRow: {\n flexDirection: \"row\",\n marginBottom: 20,\n gap: 20\n },\n cellLeft: {\n flex: 1,\n backgroundColor: \"#ffffff\",\n borderRadius: 10,\n borderWidth: 1,\n borderColor: \"#DEE2E6\",\n paddingHorizontal: 18,\n paddingVertical: 10,\n justifyContent: \"center\"\n },\n logo: {\n width: \"100%\",\n height: 84,\n objectFit: \"contain\",\n marginBottom: 0,\n paddingBottom: 0\n },\n cellRight: {\n flex: 1,\n backgroundColor: \"#ffffff\",\n borderRadius: 10,\n borderWidth: 1,\n borderColor: \"#DEE2E6\",\n paddingHorizontal: 18,\n paddingVertical: 10\n },\n invoiceTitle: {\n fontFamily,\n fontWeight: \"bold\",\n fontSize: 14,\n lineHeight: 1.5,\n letterSpacing: 0,\n color: \"rgba(17, 19, 21, 1)\",\n marginBottom: 8\n },\n fieldRow: {\n fontSize: 8,\n lineHeight: 1.8,\n flexDirection: \"row\",\n color: \"rgba(0, 0, 0, 0.87)\",\n paddingBottom: 3,\n paddingTop: 6,\n borderBottom: \"1px solid rgba(224, 224, 224, 1)\",\n alignContent: \"flex-start\"\n },\n fieldRowNoBorder: {\n borderBottomWidth: 0\n },\n fieldLabel: {\n flex: 4,\n fontWeight: \"bold\",\n color: \"rgba(0, 0, 0, 0.87)\"\n },\n fieldValue: {\n flex: 9\n },\n cancelledItemsWrapper: {\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n alignItems: \"center\",\n justifyContent: \"flex-end\",\n marginTop: 8\n },\n cancelledItemsLabel: {\n fontFamily,\n fontSize: 8,\n color: \"#212529\",\n marginRight: 6\n },\n cancelledItemLink: {\n fontSize: 8,\n color: \"#6C757D\",\n marginRight: 8\n },\n cancelledItemLinkBold: {\n fontWeight: \"bold\"\n },\n tableWrapper: {\n marginTop: 8,\n borderRadius: 8,\n borderWidth: 1,\n borderStyle: \"solid\",\n borderColor: \"#eee\",\n backgroundColor: \"#ffffff\"\n },\n table: {\n fontFamily,\n borderRadius: 8,\n overflow: \"hidden\"\n },\n thRow: {\n flexDirection: \"row\",\n backgroundColor: \"#f0f0f0\",\n paddingVertical: 12,\n paddingHorizontal: 12,\n alignItems: \"center\",\n borderBottomWidth: 1,\n borderBottomStyle: \"solid\",\n borderBottomColor: \"#eee\"\n },\n thText: {\n fontFamily,\n fontSize: 7,\n fontWeight: 600,\n color: \"#333333\"\n },\n tdRow: {\n backgroundColor: \"#FFFFFF\",\n flexDirection: \"row\",\n paddingHorizontal: 12,\n paddingVertical: 14,\n alignItems: \"center\",\n borderBottomWidth: 1,\n borderBottomStyle: \"solid\",\n borderBottomColor: \"#eee\"\n },\n tdPayment: {\n flexDirection: \"row\",\n paddingHorizontal: 12,\n paddingVertical: 14,\n alignItems: \"flex-start\",\n backgroundColor: \"#f0fdf4\",\n borderBottomWidth: 1,\n borderBottomStyle: \"solid\",\n borderBottomColor: \"#eee\"\n },\n tdRefund: {\n flexDirection: \"row\",\n paddingHorizontal: 12,\n paddingVertical: 14,\n alignItems: \"flex-start\",\n backgroundColor: \"#fff7ed\",\n borderBottomWidth: 1,\n borderBottomStyle: \"solid\",\n borderBottomColor: \"#eee\"\n },\n tdNote: {\n flexDirection: \"row\",\n paddingHorizontal: 12,\n paddingVertical: 10,\n alignItems: \"flex-start\",\n backgroundColor: \"#FFFFFF\",\n borderBottomWidth: 1,\n borderBottomStyle: \"solid\",\n borderBottomColor: \"#eee\"\n },\n tdAmountDue: {\n flexDirection: \"row\",\n paddingHorizontal: 12,\n paddingVertical: 14,\n alignItems: \"center\",\n backgroundColor: \"#fafafa\",\n borderTopWidth: 1,\n borderTopColor: \"#000000\"\n },\n colCode: { width: \"12%\", fontSize: 8 },\n colCodePayment: { width: \"12%\", fontSize: 8, fontWeight: \"bold\" },\n colType: { width: \"15%\", fontSize: 8 },\n colDesc: { width: \"39%\", fontSize: 8 },\n colDescMultiLine: {\n width: \"39%\",\n flexDirection: \"column\",\n justifyContent: \"flex-start\"\n },\n colPrice: { width: \"18%\", textAlign: \"right\", fontSize: 8, color: \"#333333\" },\n colPriceRefund: {\n fontFamily,\n width: \"18%\",\n textAlign: \"right\",\n fontSize: 8,\n fontWeight: \"bold\",\n color: \"#e65100\"\n },\n colPricePayment: {\n fontFamily,\n width: \"18%\",\n textAlign: \"right\",\n fontSize: 8,\n fontWeight: \"bold\",\n color: \"#1b5e20\"\n },\n colBalance: {\n width: \"16%\",\n textAlign: \"right\",\n fontSize: 8,\n color: \"#666666\"\n },\n colBalanceNegative: { color: \"#dc2626\" },\n tdAmountDueLabel: {\n fontFamily,\n width: \"66%\",\n fontSize: 8,\n fontWeight: 700\n },\n tdAmountDueValue: {\n fontFamily,\n width: \"16%\",\n textAlign: \"right\",\n fontSize: 9,\n fontWeight: 700\n },\n paymentDesc: { fontFamily, fontSize: 8, fontWeight: \"bold\" },\n muted: { color: \"#6C757D\", fontSize: 8 },\n cancellationReasonRow: {\n flexDirection: \"row\",\n alignItems: \"center\",\n marginLeft: 8\n },\n cancellationReason: { color: \"#6C757D\", fontSize: 8, fontStyle: \"italic\" },\n typeCell: { width: \"15%\", flexDirection: \"row\", alignItems: \"center\" },\n typeBadgeLabel: { fontSize: 8 },\n cancelledText: { color: \"#9ca3af\", textDecoration: \"line-through\" },\n reconciliationWrapper: {\n flexDirection: \"row\",\n paddingHorizontal: 12,\n paddingVertical: 12,\n borderBottomWidth: 1,\n borderBottomStyle: \"solid\",\n borderBottomColor: \"#eee\"\n },\n reconciliationBox: {\n width: \"33%\"\n },\n reconciliationTitle: {\n fontFamily,\n fontSize: 8,\n fontWeight: 600,\n color: \"#333333\",\n marginBottom: 6\n },\n reconciliationRow: {\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n paddingVertical: 2\n },\n reconciliationLabel: {\n fontSize: 7,\n color: \"#6C757D\"\n },\n reconciliationValue: {\n fontSize: 7,\n color: \"#333333\",\n textAlign: \"right\"\n },\n reconciliationDivider: {\n borderBottomWidth: 1,\n borderBottomColor: \"#dee2e6\",\n marginVertical: 4\n }\n});\n\nexport const createRowStyles = (styles) => ({\n fee: {\n row: styles.tdRow,\n code: styles.colCode,\n descText: null,\n price: styles.colPrice,\n typeBadge: {\n icon: \"ArrowUpward\",\n iconColor: \"#ff9800\",\n label: T.translate(\"order_invoice_pdf.charge\"),\n labelColor: \"#333333\"\n }\n },\n item: {\n row: styles.tdRow,\n code: styles.colCode,\n descText: null,\n price: styles.colPrice,\n typeBadge: {\n icon: \"ArrowUpward\",\n iconColor: \"#ff9800\",\n label: T.translate(\"order_invoice_pdf.charge\"),\n labelColor: \"#333333\"\n }\n },\n discount: {\n row: styles.tdPayment,\n code: styles.colCodePayment,\n descText: styles.paymentDesc,\n price: styles.colPricePayment,\n typeBadge: {\n icon: \"ArrowDownward\",\n iconColor: \"#4caf50\",\n label: T.translate(\"mui_table.discount\"),\n labelColor: \"#1b5e20\"\n }\n },\n payment: {\n row: styles.tdPayment,\n code: styles.colCodePayment,\n descText: styles.paymentDesc,\n price: styles.colPricePayment,\n typeBadge: {\n icon: \"ArrowDownward\",\n iconColor: \"#4caf50\",\n label: T.translate(\"mui_table.payment\"),\n labelColor: \"#1b5e20\"\n }\n },\n refund: {\n row: styles.tdRefund,\n code: styles.colCodePayment,\n descText: styles.paymentDesc,\n price: styles.colPriceRefund,\n typeBadge: {\n icon: \"Refresh\",\n iconColor: \"#ea580c\",\n label: T.translate(\"mui_table.refund\"),\n labelColor: \"#e65100\"\n }\n },\n cancelled: {\n row: styles.tdRow,\n code: [styles.colCode, styles.cancelledText],\n descText: styles.cancelledText,\n price: [styles.colPrice, styles.cancelledText],\n balance: [styles.colBalance, styles.cancelledText],\n typeBadge: {\n icon: \"DoNotDisturb\",\n iconColor: \"#9ca3af\",\n label: T.translate(\"sponsor_order_grid.cancelled\"),\n labelColor: \"#9ca3af\"\n }\n }\n});\n"],"names":["root","factory","exports","module","define","amd","this","CENTS_FACTOR","TWO_DECIMAL_PLACES","ZERO_INT","BPS","MILLISECONDS_IN_SECOND","DISCOUNT_TYPES","AMOUNT","RATE","CURRENCY_SYMBOL","USD","EUR","GBP","CAD","AUD","NZD","CHF","ARS","BRL","MXN","currencyAmountFromCents","cents","currency","result","Number","isInteger","console","error","amount","c","isSafeInteger","Error","BigInt","s","trim","test","remainder","toString","padStart","amountFromCents","e","formatDiscount","type","getOrderTotal","order","net_amount","amount_due","formatBalance","abs","Math","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","require","DEFAULT_FONT_FAMILY","formatDate","date","timeZone","format","moment","tz","formatAddress","address","address_1","line1","address_2","line2","city","state","zip_code","postal_code","country","map","val","filter","Boolean","join","formatVenueName","location","short_name","name","buildRows","rows","balanceCents","forms","forEach","form","items","item","quantity","_item$type","_item$type2","_form$add_on","canceledQuantity","canceled_quantity","cancellations","cancelled","partiallyCancelled","push","rowKey","line_id","id","code","String","itemCode","description","title","addon","add_on","qty","price","label","T","x","y","user","canceled_by_full_name","created","reason","discountCents","discount_in_cents","discount_amount","discount_type","fees","fee","payments","p","_objectSpread","_rowType","refunds","sort","b","method","subDescription","status","notes","note","content","FieldRow","styles","noBorder","React","View","style","fieldRow","fieldRowNoBorder","Text","fieldLabel","fieldValue","MUI_ICON_PATHS","ArrowUpward","ArrowDownward","Refresh","DoNotDisturb","SubdirectoryArrowRight","PdfIcon","color","size","Svg","width","height","viewBox","marginRight","Path","fill","PdfTableRow","row","rowStyles","tdNote","colCode","muted","flex","typeBadge","typeCell","icon","iconColor","typeBadgeLabel","labelColor","colType","colDescMultiLine","descText","cancellation","cancellationReasonRow","cancellationReason","balance","colBalance","colBalanceNegative","ReconciliationBlock","cancelledTotal","refundsTotal","retained","credited","totalColor","totalLabel","totalValue","reconciliationWrapper","wrap","reconciliationBox","reconciliationTitle","reconciliationRow","reconciliationLabel","reconciliationValue","reconciliationDivider","CancelledItemsSummary","length","cancelledItemsWrapper","cancelledItemsLabel","cancelledItemLink","cancelledItemLinkBold","OrderPdf","summit","logoSrc","theme","_summit$main_location","_summit$locations","_order$client","_order$client2","fontFamily","_theme$typography","typography","resolved","split","replace","Font","getRegisteredFontFamilies","includes","getThemeFontFamily","StyleSheet","create","page","backgroundColor","padding","fontSize","headerRow","flexDirection","marginBottom","gap","cellLeft","borderRadius","borderWidth","borderColor","paddingHorizontal","paddingVertical","justifyContent","logo","objectFit","paddingBottom","cellRight","invoiceTitle","fontWeight","lineHeight","letterSpacing","paddingTop","borderBottom","alignContent","borderBottomWidth","flexWrap","alignItems","marginTop","tableWrapper","borderStyle","table","overflow","thRow","borderBottomStyle","borderBottomColor","thText","tdRow","tdPayment","tdRefund","tdAmountDue","borderTopWidth","borderTopColor","colCodePayment","colDesc","colPrice","textAlign","colPriceRefund","colPricePayment","tdAmountDueLabel","tdAmountDueValue","paymentDesc","marginLeft","fontStyle","cancelledText","textDecoration","marginVertical","createStyles","discount","payment","refund","createRowStyles","cancelledItems","_row$cancellations","mainLocation","main_locations","locations","find","is_main","cancelled_total","refunds_total","credited_to_payment_method","total","clientName","client","contact_name","purchased_by_full_name","clientCompany","company_name","clientAddress","Document","Page","orientation","Image","src","number","purchased_date","payment_method","fixed","propTypes","PropTypes","isRequired","generateInvoicePDF","async","blob","pdf","toBlob","url","URL","createObjectURL","link","document","createElement","href","download","toLowerCase","body","appendChild","click","removeChild","setTimeout","revokeObjectURL","previewPDF","newTab","window","open","close"],"sourceRoot":""}
|