PageSourceSearch

https://ponora.ai/_next/static/chunks/9937.147a0abc119df734.js

js ponora.ai collected 2026-10-05 14:38:33 UTC 6,583 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9937],{9937:(t,e,r)=>{r.d(e,{downloadOrderConfirmationPdf:()=>h});var n=r(2557),a=r(7202);let o=[{ranges:[{start:12288,end:12543},{start:19968,end:40959},{start:65280,end:65519}],path:"/fonts/pdf/NotoSansSC-GB2312.ttf"},{ranges:[{start:256,end:1327},{start:7296,end:7311},{start:7424,end:7935},{start:8352,end:8399},{start:11360,end:11391},{start:42560,end:42655},{start:42784,end:43007}],path:"/fonts/pdf/NotoSans-Regular.ttf"},{ranges:[{start:4352,end:4607},{start:12592,end:12687},{start:43360,end:43391},{start:44032,end:55215},{start:55216,end:55295}],path:"/fonts/pdf/NotoSansKR-Hangul.ttf"}],i=/[\t\n\v\f\r\u0085\u2028\u2029]+/gu,s=RegExp("[\\p{Cc}\\p{Cf}]","gu");class c extends Error{constructor(){super("At least one critical order field cannot be rendered correctly in this PDF"),this.name="UnsupportedPdfScriptError"}}function l(t){return t.replace(i," ").replace(s,"").replaceAll(" ","\xa0")}async function u(t,e,n){let a=new Set(Array.from(l(e)).map(t=>t.codePointAt(0)).filter(t=>void 0!==t&&!n.some(e=>e.has(t))));if(0===a.size)return[];let i=o.filter(t=>{let{ranges:e}=t;return Array.from(a).some(t=>e.some(e=>{let{start:r,end:n}=e;return t>=r&&t<=n}))});if(0===i.length)return[];try{let e=await r.e(3209).then(r.bind(r,2217));t.registerFontkit(e.default)}catch(t){return[]}let s=[];for(let e of i)try{let r=await fetch(e.path);if(!r.ok)continue;let n=await t.embedFont(await r.arrayBuffer(),{subset:!0});s.push({font:n,characterSet:new Set(n.getCharacterSet())})}catch(t){continue}return s}function d(t,e,r){let n=r?t.bold:t.regular,a=e.codePointAt(0);if(void 0!==a&&n.characterSet.has(a))return{character:e,font:n.font};let o=t.fallbacks.find(t=>{let{characterSet:e}=t;return void 0!==a&&e.has(a)});return o?{character:e,font:o.font}:{character:"?",font:n.font}}function p(t,e,r,n){return Array.from(t).reduce((t,a)=>{let o=d(e,a,n);return t+o.font.widthOfTextAtSize(o.character,r)},0)}async function f(t){let{order:e,locale:r,shippingAddressLine:o,translations:i}=t,s=await a.PDFDocument.create();s.setTitle("Ponora - ".concat(i.title)),s.setSubject(i.disclaimer),s.setCreator("Ponora"),s.setProducer("Ponora");let f=[...Object.values(i),e.orderNumber,e.shippingName,e.shippingAddress,o,e.shippingPostalCode,e.shippingCity,e.shippingCountry,null!=(P=e.shippingPhone)?P:"",(0,n.$g)(e.subtotalEur,r),(0,n.$g)(e.shippingEur,r),(0,n.$g)(e.discountEur,r),(0,n.$g)(e.taxEur,r),(0,n.$g)(e.totalEur,r),...(null!=(w=e.items)?w:[]).flatMap(t=>{var e;return[t.productNameSnapshot,null!=(e=t.variantNameSnapshot)?e:"",(0,n.$g)(t.unitPriceEur,r),(0,n.$g)(t.totalPriceEur,r)]})].join("\n"),h=await s.embedFont(a.StandardFonts.Helvetica),g=await s.embedFont(a.StandardFonts.HelveticaBold),m=new Set(h.getCharacterSet()),S=new Set(g.getCharacterSet()),b={regular:{font:h,characterSet:m},bold:{font:g,characterSet:S},fallbacks:await u(s,f,[m,S])};var y,E,P,w,v,N,A=[e.shippingName,e.shippingAddress,o,e.shippingPostalCode,e.shippingCity,e.shippingCountry,null!=(v=e.shippingPhone)?v:"",e.orderNumber,(0,n.$g)(e.subtotalEur,r),(0,n.$g)(e.shippingEur,r),(0,n.$g)(e.discountEur,r),(0,n.$g)(e.taxEur,r),(0,n.$g)(e.totalEur,r),...(null!=(N=e.items)?N:[]).flatMap(t=>{var e;return[t.productNameSnapshot,null!=(e=t.variantNameSnapshot)?e:"",(0,n.$g)(t.unitPriceEur,r),(0,n.$g)(t.totalPriceEur,r)]})];let C=[b.regular.characterSet,b.bold.characterSet,...b.fallbacks.map(t=>{let{characterSet:e}=t;return e})];for(let t of A)for(let e of Array.from(t)){let t=l(e);if(0===t.length||Array.from(t).some(t=>{let e=t.codePointAt(0);return void 0===e||!C.some(t=>t.has(e))}))throw new c}let[$,z]=a.PageSizes.A4,B=$-96,x=s.addPage(a.PageSizes.A4),k=z-48,H=t=>{k-t>=48||(x=s.addPage(a.PageSizes.A4),k=z-48)},F=function(t){var e,r,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null!=(e=o.size)?e:10,s=null!=(r=o.lineHeight)?r:15,c=null!=(n=o.isBold)&&n;for(let e of function(t,e,r,n,a){let o=[],i="",s=0;for(let c of Array.from(l(t))){let t=p(c,e,r,a);i&&s+t>n?(o.push(i.trimEnd()),s=p(i=c.trimStart(),e,r,a)):(i+=c,s+=t)}return i&&o.push(i.trimEnd()),o.length>0?o:[""]}(t,b,i,B,c))H(s),function(t,e,r,n){let o=n.x,i="",s=null,c=()=>{i&&s&&(t.drawText(i,{x:o,y:n.y,size:n.size,font:s,color:(0,a.rgb)(.12,.16,.2)}),o+=s.widthOfTextAtSize(i,n.size),i="")};for(let t of Array.from(l(e))){let e=d(r,t,n.isBold);s&&e.font!==s&&c(),s=e.font,i+=e.character}c()}(x,e,b,{x:48,y:k,size:i,isBold:c}),k-=s},O=t=>{H(t),k-=t},R=()=>{H(12),x.drawLine({start:{x:48,y:k},end:{x:$-48,y:k},thickness:.7,color:(0,a.rgb)(.85,.87,.88)}),k-=12};F("Ponora",{size:12,lineHeight:30,isBold:!0}),F(i.title,{size:22,lineHeight:30,isBold:!0}),R(),F("".concat(i.orderNumber,": ").concat(e.orderNumber));let T=new Date(e.createdAt);if(Number.isNaN(T.valueOf()))throw Error("Order creation date is invali
1d");for(let t of(F("".concat(i.orderDate,": ").concat(new Intl.DateTimeFormat(r,{dateStyle:"long",timeZone:"UTC"}).format(T))),"processing"===e.paymentStatus&&F(i.paymentPending,{isBold:!0}),O(10),F(i.items,{size:14,lineHeight:21,isBold:!0}),null!=(y=e.items)?y:[]))F(t.productNameSnapshot,{size:11,lineHeight:17,isBold:!0}),t.variantNameSnapshot&&F("".concat(i.specification,": ").concat(t.variantNameSnapshot)),F("".concat(i.quantity,": ").concat(t.quantity)),F("".concat(i.unitPrice,": ").concat((0,n.$g)(t.unitPriceEur,r))),F("".concat(i.lineSubtotal,": ").concat((0,n.$g)(t.totalPriceEur,r))),O(7);for(let t of(R(),F("".concat(i.subtotal,": ").concat((0,n.$g)(e.subtotalEur,r))),F("".concat(i.shippingCost,": ").concat(0===e.shippingEur?i.free:(0,n.$g)(e.shippingEur,r))),e.discountEur>0&&F("".concat(i.discount,": -").concat((0,n.$g)(e.discountEur,r))),e.taxEur>0&&F("".concat(i.tax,": ").concat((0,n.$g)(e.taxEur,r))),F("".concat(i.total,": ").concat((0,n.$g)(e.totalEur,r)),{size:13,lineHeight:20,isBold:!0}),O(12),F(i.shippingTo,{size:14,lineHeight:21,isBold:!0}),[e.shippingName,o,"".concat(e.shippingPostalCode," ").concat(e.shippingCity).trim(),e.shippingCountry,null!=(E=e.shippingPhone)?E:""].filter(Boolean)))F(t);return O(16),R(),F(i.disclaimer,{size:9,lineHeight:14}),s.save()}async function h(t){if("unpaid"===t.order.paymentStatus||"failed"===t.order.paymentStatus)throw Error("Order confirmation is unavailable before payment is completed");let e=await f(t),r=new ArrayBuffer(e.byteLength);new Uint8Array(r).set(e);let n=URL.createObjectURL(new Blob([r],{type:"application/pdf"})),a=document.createElement("a");a.href=n,a.download="Ponora-".concat(t.order.orderNumber,".pdf"),a.click(),URL.revokeObjectURL(n)}}}]);

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