bitsnap-react 1.18.0 → 1.19.0
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.
- package/AGENTS.md +106 -0
- package/README.md +98 -0
- package/dist/BitsnapCart-E72W5RRZ.mjs +2 -0
- package/dist/BitsnapCart-LHJ6KOTV.css +2 -0
- package/dist/BitsnapCart-LHJ6KOTV.css.map +1 -0
- package/dist/BitsnapCart-Q2HER6GU.js +2 -0
- package/dist/BitsnapCart-Q2HER6GU.js.map +1 -0
- package/dist/CartProvider-677CE2FI.js +2 -0
- package/dist/CartProvider-677CE2FI.js.map +1 -0
- package/dist/CartProvider-YPDOFSYC.mjs +2 -0
- package/dist/{PanelModelFiles-JZFSF7BF.mjs → PanelModelFiles-4B2HYGIE.mjs} +2 -2
- package/dist/{PanelModelFiles-7HPXWONN.js → PanelModelFiles-EKQRLF46.js} +2 -2
- package/dist/PanelModelFiles-EKQRLF46.js.map +1 -0
- package/dist/analytics.js +1 -1
- package/dist/analytics.js.map +1 -1
- package/dist/analytics.mjs +1 -1
- package/dist/catalog.js +1 -1
- package/dist/catalog.js.map +1 -1
- package/dist/catalog.mjs +1 -1
- package/dist/chat.css +2 -0
- package/dist/chat.css.map +1 -0
- package/dist/chat.d.mts +172 -0
- package/dist/chat.d.ts +172 -0
- package/dist/chat.js +2 -0
- package/dist/chat.js.map +1 -0
- package/dist/chat.mjs +2 -0
- package/dist/chat.mjs.map +1 -0
- package/dist/chunk-2FD2QP4Y.js +2 -0
- package/dist/chunk-2FD2QP4Y.js.map +1 -0
- package/dist/chunk-5JRUPLXY.mjs +2 -0
- package/dist/chunk-5JRUPLXY.mjs.map +1 -0
- package/dist/chunk-5M6M7FAR.mjs +2 -0
- package/dist/chunk-5M6M7FAR.mjs.map +1 -0
- package/dist/chunk-6Q3VGPSF.js.map +1 -1
- package/dist/chunk-AAC576BC.mjs +5 -0
- package/dist/chunk-AAC576BC.mjs.map +1 -0
- package/dist/{chunk-4OVOKGGS.mjs → chunk-AB37DWOK.mjs} +2 -2
- package/dist/{chunk-ZATPBYOA.js → chunk-BUYTK7KM.js} +2 -2
- package/dist/chunk-BUYTK7KM.js.map +1 -0
- package/dist/{chunk-DP2NOHCI.js → chunk-D2ASWUXM.js} +2 -2
- package/dist/chunk-D2ASWUXM.js.map +1 -0
- package/dist/chunk-DDIEFKNP.mjs +2 -0
- package/dist/{chunk-ZHTMK5TA.mjs.map → chunk-DDIEFKNP.mjs.map} +1 -1
- package/dist/{chunk-4HGZZJEL.js → chunk-DOJICJCQ.js} +2 -2
- package/dist/chunk-DOJICJCQ.js.map +1 -0
- package/dist/chunk-EMR4YXNY.mjs +2 -0
- package/dist/chunk-EMR4YXNY.mjs.map +1 -0
- package/dist/{chunk-JA62KNAQ.js → chunk-GJOGATP6.js} +2 -2
- package/dist/chunk-GJOGATP6.js.map +1 -0
- package/dist/chunk-GQ5OKU74.js +2 -0
- package/dist/chunk-GQ5OKU74.js.map +1 -0
- package/dist/chunk-JSDGZ4NY.js.map +1 -1
- package/dist/chunk-KHQEDQYF.js +5 -0
- package/dist/chunk-KHQEDQYF.js.map +1 -0
- package/dist/chunk-KOYBZORL.js.map +1 -1
- package/dist/chunk-LGPNJ5XE.js +2 -0
- package/dist/chunk-LGPNJ5XE.js.map +1 -0
- package/dist/chunk-MDAFPGPA.js +2 -0
- package/dist/chunk-MDAFPGPA.js.map +1 -0
- package/dist/{chunk-JHJ3ZZF4.mjs → chunk-MMLBQHBM.mjs} +2 -2
- package/dist/chunk-MWWEPEU2.js +2 -0
- package/dist/chunk-MWWEPEU2.js.map +1 -0
- package/dist/{chunk-GEBRXFT3.mjs → chunk-N523LFAM.mjs} +2 -2
- package/dist/chunk-NWXZ45TV.js +2 -0
- package/dist/chunk-NWXZ45TV.js.map +1 -0
- package/dist/chunk-OFPRIENJ.mjs +2 -0
- package/dist/chunk-OFPRIENJ.mjs.map +1 -0
- package/dist/chunk-OR566YJI.mjs +2 -0
- package/dist/chunk-OR566YJI.mjs.map +1 -0
- package/dist/chunk-Q337IQNA.js +2 -0
- package/dist/chunk-Q337IQNA.js.map +1 -0
- package/dist/chunk-SCEWYZUZ.mjs +2 -0
- package/dist/chunk-SCEWYZUZ.mjs.map +1 -0
- package/dist/{chunk-CF45RDMD.mjs → chunk-SSSF64M7.mjs} +2 -2
- package/dist/{chunk-CF45RDMD.mjs.map → chunk-SSSF64M7.mjs.map} +1 -1
- package/dist/chunk-W3RGQYPD.js.map +1 -1
- package/dist/chunk-WG54EHST.mjs +2 -0
- package/dist/chunk-WG54EHST.mjs.map +1 -0
- package/dist/chunk-XEXPQFKN.mjs +2 -0
- package/dist/chunk-XEXPQFKN.mjs.map +1 -0
- package/dist/chunk-YV2C276H.js +2 -0
- package/dist/chunk-YV2C276H.js.map +1 -0
- package/dist/consent.js.map +1 -1
- package/dist/course.d.mts +2 -14
- package/dist/course.d.ts +2 -14
- package/dist/course.js +1 -1
- package/dist/course.js.map +1 -1
- package/dist/course.mjs +1 -1
- package/dist/course.mjs.map +1 -1
- package/dist/embed/analytics.js +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +288 -4
- package/dist/index.d.ts +288 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internal.js.map +1 -1
- package/dist/methods-64D5DD6K.js +2 -0
- package/dist/methods-64D5DD6K.js.map +1 -0
- package/dist/methods-NQA3DFLE.mjs +2 -0
- package/dist/methods-NQA3DFLE.mjs.map +1 -0
- package/dist/model-files-client-P4PORZJ6.js.map +1 -1
- package/dist/models.js.map +1 -1
- package/dist/returns.js +1 -1
- package/dist/returns.js.map +1 -1
- package/dist/returns.mjs +1 -1
- package/dist/texts-9kfgClsA.d.mts +14 -0
- package/dist/texts-9kfgClsA.d.ts +14 -0
- package/dist/{types-D6LsoycW.d.mts → types-B-sjyZQs.d.mts} +7 -1
- package/dist/{types-ClFCVzk_.d.ts → types-iRe6ix2y.d.ts} +7 -1
- package/dist/viewer3d.js.map +1 -1
- package/dist/viewer3d.mjs +1 -1
- package/dist/viewer3d.mjs.map +1 -1
- package/dist/widgets-BT2LN2Nq.d.mts +547 -0
- package/dist/widgets-BVOSj9fU.d.ts +547 -0
- package/package.json +18 -3
- package/dist/CartProvider-OEI526IN.js +0 -2
- package/dist/CartProvider-OEI526IN.js.map +0 -1
- package/dist/CartProvider-RYAA3JDA.mjs +0 -2
- package/dist/PanelModelFiles-7HPXWONN.js.map +0 -1
- package/dist/chunk-4HGZZJEL.js.map +0 -1
- package/dist/chunk-5X7TP3TQ.mjs +0 -2
- package/dist/chunk-5X7TP3TQ.mjs.map +0 -1
- package/dist/chunk-7RXW6XFY.js +0 -2
- package/dist/chunk-7RXW6XFY.js.map +0 -1
- package/dist/chunk-DP2NOHCI.js.map +0 -1
- package/dist/chunk-EVIDNS22.mjs +0 -2
- package/dist/chunk-EVIDNS22.mjs.map +0 -1
- package/dist/chunk-G4V2KWTV.js +0 -2
- package/dist/chunk-G4V2KWTV.js.map +0 -1
- package/dist/chunk-GWF3MRUP.js +0 -2
- package/dist/chunk-GWF3MRUP.js.map +0 -1
- package/dist/chunk-JA62KNAQ.js.map +0 -1
- package/dist/chunk-UPAOIY4R.mjs +0 -2
- package/dist/chunk-UPAOIY4R.mjs.map +0 -1
- package/dist/chunk-V5ECGBFW.js +0 -5
- package/dist/chunk-V5ECGBFW.js.map +0 -1
- package/dist/chunk-VNV5BD4X.js +0 -2
- package/dist/chunk-VNV5BD4X.js.map +0 -1
- package/dist/chunk-VNYHJT6V.mjs +0 -2
- package/dist/chunk-VNYHJT6V.mjs.map +0 -1
- package/dist/chunk-WJO5GSY3.mjs +0 -5
- package/dist/chunk-WJO5GSY3.mjs.map +0 -1
- package/dist/chunk-ZATPBYOA.js.map +0 -1
- package/dist/chunk-ZHTMK5TA.mjs +0 -2
- package/dist/methods-AULQDKVS.mjs +0 -2
- package/dist/methods-PMH5VQ25.js +0 -2
- package/dist/methods-PMH5VQ25.js.map +0 -1
- /package/dist/{CartProvider-RYAA3JDA.mjs.map → BitsnapCart-E72W5RRZ.mjs.map} +0 -0
- /package/dist/{methods-AULQDKVS.mjs.map → CartProvider-YPDOFSYC.mjs.map} +0 -0
- /package/dist/{PanelModelFiles-JZFSF7BF.mjs.map → PanelModelFiles-4B2HYGIE.mjs.map} +0 -0
- /package/dist/{chunk-4OVOKGGS.mjs.map → chunk-AB37DWOK.mjs.map} +0 -0
- /package/dist/{chunk-JHJ3ZZF4.mjs.map → chunk-MMLBQHBM.mjs.map} +0 -0
- /package/dist/{chunk-GEBRXFT3.mjs.map → chunk-N523LFAM.mjs.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkKOYBZORLjs = require('./chunk-KOYBZORL.js');var _chunkG4V2KWTVjs = require('./chunk-G4V2KWTV.js');var _chunk4HGZZJELjs = require('./chunk-4HGZZJEL.js');var _chunkDP2NOHCIjs = require('./chunk-DP2NOHCI.js');var _chunk7RXW6XFYjs = require('./chunk-7RXW6XFY.js');var Pr=["root","header","title","description","backButton","stepIndicator","error","emptyState","skeleton","emailForm","emailInput","codeForm","codeInput","resendButton","logoutButton","orderList","orderCard","orderReference","orderDate","orderTotal","pagination","lineList","line","lineName","linePrice","lineQuantityControl","quantityButton","quantityInput","lineIneligibleReason","noteInput","summary","submitButton","secondaryButton","successState","returnReference","returnInstructions","returnList","returnCard","statusBadge","history","historyEntry"],Tn={fontFamily:"--bitsnap-returns-font-family",fontSize:"--bitsnap-returns-font-size",background:"--bitsnap-returns-background",surface:"--bitsnap-returns-surface",foreground:"--bitsnap-returns-foreground",mutedForeground:"--bitsnap-returns-muted-foreground",border:"--bitsnap-returns-border",buttonBackground:"--bitsnap-returns-button-background",buttonForeground:"--bitsnap-returns-button-foreground",buttonHoverBackground:"--bitsnap-returns-button-hover-background",hoverSurface:"--bitsnap-returns-hover-surface",focusRing:"--bitsnap-returns-focus-ring",error:"--bitsnap-returns-error",success:"--bitsnap-returns-success",warning:"--bitsnap-returns-warning",badgeBackground:"--bitsnap-returns-badge-background",badgeForeground:"--bitsnap-returns-badge-foreground",inputBackground:"--bitsnap-returns-input-background",radius:"--bitsnap-returns-radius"},wn={light:{background:"#ffffff",surface:"#f9fafb",foreground:"#18181b",mutedForeground:"#71717a",border:"#e4e4e7",buttonBackground:"#18181b",buttonForeground:"#fafafa",buttonHoverBackground:"#000000",hoverSurface:"#f4f4f5",focusRing:"#71717a",error:"#dc2626",success:"#16a34a",warning:"#d97706",badgeBackground:"#f4f4f5",badgeForeground:"#3f3f46",inputBackground:"#ffffff",radius:"8px"},dark:{background:"#18181b",surface:"#27272a",foreground:"#fafafa",mutedForeground:"#a1a1aa",border:"#3f3f46",buttonBackground:"#fafafa",buttonForeground:"#18181b",buttonHoverBackground:"#e4e4e7",hoverSurface:"#3f3f46",focusRing:"#a1a1aa",error:"#f87171",success:"#4ade80",warning:"#fbbf24",badgeBackground:"#3f3f46",badgeForeground:"#e4e4e7",inputBackground:"#27272a",radius:"8px"}},En=[{token:"background",variable:"--background"},{token:"foreground",variable:"--foreground"},{token:"surface",variable:"--card"},{token:"foreground",variable:"--card-foreground"},{token:"surface",variable:"--popover"},{token:"foreground",variable:"--popover-foreground"},{token:"buttonBackground",variable:"--primary"},{token:"buttonForeground",variable:"--primary-foreground"},{token:"surface",variable:"--secondary"},{token:"foreground",variable:"--secondary-foreground"},{token:"hoverSurface",variable:"--accent"},{token:"foreground",variable:"--accent-foreground"},{token:"mutedForeground",variable:"--muted-foreground"},{token:"border",variable:"--border"},{token:"border",variable:"--input"},{token:"focusRing",variable:"--ring"},{token:"error",variable:"--destructive"},{token:"radius",variable:"--radius"}];function Ze(e){let t=_chunkKOYBZORLjs.a.call(void 0, e,{defaultTheme:"light",presets:wn,variables:Tn,shadcnVariables:En});return{theme:t.theme,tokens:t.tokens,elements:t.elements,boundaryClassName:t.theme,boundaryStyle:t.boundaryStyle}}function Pt(e,t){return _chunkKOYBZORLjs.b.call(void 0, e.elements,t)}var _react = require('react'); var an = _interopRequireWildcard(_react);var _jsxruntime = require('react/jsx-runtime');var At=_react.createContext.call(void 0, Ze());function Ot({appearance:e,children:t}){let n=_react.useMemo.call(void 0, ()=>Ze(e),[e]);return _jsxruntime.jsx.call(void 0, At.Provider,{value:n,children:t})}function $e(){return _react.useContext.call(void 0, At)}function d(e){let t=$e();return _nullishCoalesce(Pt(t,e), () => ({}))}function Bt(e){return e==="test"||e===1?1:0}var zt={title:["emailStepTitle"],email:["emailLabel"],sendCode:["emailSubmit"],code:["codeLabel"],verify:["codeSubmit"],orders:["ordersTitle"],submit:["confirmationSubmit"],note:["noteLabel"],history:["myReturnsTitle","myReturnsLink"]};function Mt(e){if(e==null)return;let t={};for(let[n,r]of Object.entries(zt)){let a=e[n];if(typeof a=="string")for(let i of r)t[i]=a}for(let n of Object.keys(e)){if(n in zt)continue;let r=e[n];typeof r=="string"&&(t[n]=r)}return t}function Dt(e,t){let n=_optionalChain([t, 'optionalAccess', _2 => _2.brandColor, 'optionalAccess', _3 => _3.trim, 'call', _4 => _4()]);return n==null||n===""?e:{...e,tokens:{..._chunkG4V2KWTVjs.t.call(void 0, n),..._optionalChain([e, 'optionalAccess', _5 => _5.tokens])}}}function Ge(e,t){return typeof e=="object"&&e!=null?{pageSize:_nullishCoalesce(e.pageSize, () => (20)),explicitPageToken:void 0}:typeof e=="number"||t!==void 0?{pageSize:_nullishCoalesce(e, () => (20)),explicitPageToken:_nullishCoalesce(t, () => (""))}:{pageSize:20,explicitPageToken:void 0}}var An={en:{back:"Back",stepIndicator:"Step {current} of {total}",loading:"Loading",myReturnsLink:"My returns",emailStepTitle:"Return a product",emailStepDescription:"Enter the email address you used for the order. We will send you a verification code.",emailLabel:"Email address",emailPlaceholder:"name@example.com",emailSubmit:"Send code",codeStepTitle:"Enter the code",codeStepDescription:"We sent a verification code to {email}.",codeLabel:"Verification code",codeSubmit:"Verify",resend:"Send the code again",resendIn:"Send again in {seconds} s",resendSent:"We sent a new code.",codeSpamHint:"Can't see the email? Check your spam folder.",codeValidity:"The code is valid for 10 minutes.",codeIncomplete:"Enter all 6 digits of the code.",logout:"Sign out",ordersTitle:"Your orders",ordersDescription:"Choose the order that contains the product to return.",ordersEmpty:"There are no orders eligible for return.",orderTitle:"Order {reference}",orderReturnableLines:"Products available to return: {count}",orderSelect:"Choose",paginationPrevious:"Previous",paginationNext:"Next",paginationInfo:"Page {page}, {total} orders",orderDetailTitle:"Order {reference}",orderDetailDescription:"Select the products and quantities to return.",quantityLabel:"Quantity to return: {name}",quantityDecrease:"Decrease quantity: {name}",quantityIncrease:"Increase quantity: {name}",quantityOfAvailable:"of {available}",lineIneligibleFallback:"This product cannot be returned.",noteLabel:"Note (optional)",notePlaceholder:"Tell us why you are returning the product",selectionContinue:"Continue",selectionEmpty:"Select at least one item to return.",previousReturnsTitle:"Earlier returns for this order",confirmationTitle:"Confirm the return",confirmationDescription:"Check the products before you submit the request.",confirmationSummary:"Products to return",confirmationQuantity:"Quantity: {quantity}",confirmationNote:"Your note",confirmationSubmit:"Submit return request",successTitle:"Return request submitted",successDescription:"We received your request and will keep you posted.",successReference:"Request number",successInstructions:"What to do next",successDone:"Back to orders",myReturnsTitle:"My returns",myReturnsDescription:"Track the status of your return requests.",myReturnsEmpty:"You have not submitted any return requests yet.",myReturnOpen:"Details",myReturnDetailTitle:"Return details",myReturnTitle:"Return {reference}",myReturnCreatedAt:"Submitted",myReturnRefund:"Refund",myReturnLines:"Products",myReturnLineQuantities:"Requested: {requested}, approved: {approved}, received: {received}",myReturnNote:"Your note",myReturnHistory:"History",statusSubmitted:"Submitted",statusApproved:"Approved",statusRejected:"Rejected",statusAwaitingReceipt:"Awaiting the package",statusReceived:"Package received",statusCompleted:"Completed",statusCancelled:"Cancelled",statusRefunded:"Refunded",statusFallback:"In progress",refundStatusNotStarted:"Not started",refundStatusPending:"Refund in progress",refundStatusSucceeded:"Refunded",refundStatusFailed:"Refund failed",refundStatusFallback:"Unknown",errorGeneric:"Something went wrong. Please try again.",errorNetwork:"Cannot reach the server. Check your connection and try again.",errorInvalidEmail:"Enter a valid email address.",errorInvalidCode:"The code is invalid or has expired.",errorSessionExpired:"Your session has expired. Verify your email again.",errorOrderNotFound:"We could not find this order.",errorReturnNotFound:"We could not find this return request.",errorQuantityUnavailable:"The selected quantity is no longer available for return.",errorItemNotReturnable:"One of the selected products cannot be returned.",errorReturnsDisabled:"Returns are not available in this shop.",errorRateLimited:"Too many attempts. Please try again later.",errorIdempotencyConflict:"This request was already submitted with different contents. Reload and try again.",errorDeliveryFailed:"We could not send the code. Please try again.",errorRetry:"Try again"},pl:{back:"Wstecz",stepIndicator:"Krok {current} z {total}",loading:"\u0141adowanie",myReturnsLink:"Moje zwroty",emailStepTitle:"Zwr\xF3\u0107 produkt",emailStepDescription:"Podaj adres e-mail u\u017Cyty w zam\xF3wieniu. Wy\u015Blemy na niego kod weryfikacyjny.",emailLabel:"Adres e-mail",emailPlaceholder:"jan@example.com",emailSubmit:"Wy\u015Blij kod",codeStepTitle:"Wpisz kod",codeStepDescription:"Wys\u0142ali\u015Bmy kod weryfikacyjny na adres {email}.",codeLabel:"Kod weryfikacyjny",codeSubmit:"Zweryfikuj",resend:"Wy\u015Blij kod ponownie",resendIn:"Wy\u015Blij ponownie za {seconds} s",resendSent:"Wys\u0142ali\u015Bmy nowy kod.",codeSpamHint:"Nie widzisz e-maila? Sprawd\u017A folder spam.",codeValidity:"Kod jest wa\u017Cny 10 minut.",codeIncomplete:"Wpisz wszystkie 6 cyfr kodu.",logout:"Wyloguj si\u0119",ordersTitle:"Twoje zam\xF3wienia",ordersDescription:"Wybierz zam\xF3wienie z produktem do zwrotu.",ordersEmpty:"Brak zam\xF3wie\u0144, kt\xF3re mo\u017Cna zwr\xF3ci\u0107.",orderTitle:"Zam\xF3wienie {reference}",orderReturnableLines:"Produkty do zwrotu: {count}",orderSelect:"Wybierz",paginationPrevious:"Poprzednia",paginationNext:"Nast\u0119pna",paginationInfo:"Strona {page}, zam\xF3wie\u0144: {total}",orderDetailTitle:"Zam\xF3wienie {reference}",orderDetailDescription:"Wybierz produkty i ilo\u015Bci do zwrotu.",quantityLabel:"Ilo\u015B\u0107 do zwrotu: {name}",quantityDecrease:"Zmniejsz ilo\u015B\u0107: {name}",quantityIncrease:"Zwi\u0119ksz ilo\u015B\u0107: {name}",quantityOfAvailable:"z {available}",lineIneligibleFallback:"Ten produkt nie podlega zwrotowi.",noteLabel:"Uwagi (opcjonalnie)",notePlaceholder:"Napisz, dlaczego zwracasz produkt",selectionContinue:"Dalej",selectionEmpty:"Wybierz co najmniej jedn\u0105 sztuk\u0119 do zwrotu.",previousReturnsTitle:"Wcze\u015Bniejsze zwroty tego zam\xF3wienia",confirmationTitle:"Potwierd\u017A zwrot",confirmationDescription:"Sprawd\u017A produkty przed wys\u0142aniem zg\u0142oszenia.",confirmationSummary:"Produkty do zwrotu",confirmationQuantity:"Ilo\u015B\u0107: {quantity}",confirmationNote:"Twoje uwagi",confirmationSubmit:"Wy\u015Blij zg\u0142oszenie zwrotu",successTitle:"Zg\u0142oszenie zwrotu zosta\u0142o wys\u0142ane",successDescription:"Otrzymali\u015Bmy zg\u0142oszenie i b\u0119dziemy informowa\u0107 o jego statusie.",successReference:"Numer zg\u0142oszenia",successInstructions:"Co dalej",successDone:"Wr\xF3\u0107 do zam\xF3wie\u0144",myReturnsTitle:"Moje zwroty",myReturnsDescription:"Sprawd\u017A status swoich zg\u0142osze\u0144 zwrotu.",myReturnsEmpty:"Nie masz jeszcze \u017Cadnych zg\u0142osze\u0144 zwrotu.",myReturnOpen:"Szczeg\xF3\u0142y",myReturnDetailTitle:"Szczeg\xF3\u0142y zwrotu",myReturnTitle:"Zwrot {reference}",myReturnCreatedAt:"Zg\u0142oszono",myReturnRefund:"Zwrot \u015Brodk\xF3w",myReturnLines:"Produkty",myReturnLineQuantities:"Zg\u0142oszono: {requested}, zaakceptowano: {approved}, odebrano: {received}",myReturnNote:"Twoje uwagi",myReturnHistory:"Historia",statusSubmitted:"Zg\u0142oszony",statusApproved:"Zaakceptowany",statusRejected:"Odrzucony",statusAwaitingReceipt:"Oczekiwanie na paczk\u0119",statusReceived:"Paczka odebrana",statusCompleted:"Zako\u0144czony",statusCancelled:"Anulowany",statusRefunded:"\u015Arodki zwr\xF3cone",statusFallback:"W trakcie",refundStatusNotStarted:"Nie rozpocz\u0119to",refundStatusPending:"Zwrot \u015Brodk\xF3w w toku",refundStatusSucceeded:"\u015Arodki zwr\xF3cone",refundStatusFailed:"Zwrot \u015Brodk\xF3w nie powi\xF3d\u0142 si\u0119",refundStatusFallback:"Nieznany",errorGeneric:"Co\u015B posz\u0142o nie tak. Spr\xF3buj ponownie.",errorNetwork:"Brak po\u0142\u0105czenia z serwerem. Sprawd\u017A internet i spr\xF3buj ponownie.",errorInvalidEmail:"Podaj poprawny adres e-mail.",errorInvalidCode:"Kod jest nieprawid\u0142owy lub wygas\u0142.",errorSessionExpired:"Sesja wygas\u0142a. Zweryfikuj adres e-mail ponownie.",errorOrderNotFound:"Nie znaleziono tego zam\xF3wienia.",errorReturnNotFound:"Nie znaleziono tego zg\u0142oszenia zwrotu.",errorQuantityUnavailable:"Wybrana ilo\u015B\u0107 nie jest ju\u017C dost\u0119pna do zwrotu.",errorItemNotReturnable:"Jeden z wybranych produkt\xF3w nie podlega zwrotowi.",errorReturnsDisabled:"Zwroty nie s\u0105 dost\u0119pne w tym sklepie.",errorRateLimited:"Zbyt wiele pr\xF3b. Spr\xF3buj ponownie p\xF3\u017Aniej.",errorIdempotencyConflict:"To zg\u0142oszenie zosta\u0142o ju\u017C wys\u0142ane z inn\u0105 zawarto\u015Bci\u0105. Od\u015Bwie\u017C stron\u0119 i spr\xF3buj ponownie.",errorDeliveryFailed:"Nie uda\u0142o si\u0119 wys\u0142a\u0107 kodu. Spr\xF3buj ponownie.",errorRetry:"Spr\xF3buj ponownie"}};function Xe(e,t){return _chunk7RXW6XFYjs.b.call(void 0, An,e,t)}function Ft(e,t){return e.replace(/\{(\w+)\}/g,(n,r)=>Object.prototype.hasOwnProperty.call(t,r)?String(t[r]):n)}var On={submitted:"statusSubmitted",approved:"statusApproved",rejected:"statusRejected",awaiting_receipt:"statusAwaitingReceipt",received:"statusReceived",completed:"statusCompleted",cancelled:"statusCancelled",refunded:"statusRefunded"},zn={not_started:"refundStatusNotStarted",pending:"refundStatusPending",succeeded:"refundStatusSucceeded",failed:"refundStatusFailed"};function Kt(e){return _nullishCoalesce(On[e], () => ("statusFallback"))}function _t(e){return _nullishCoalesce(zn[e], () => ("refundStatusFallback"))}var Je=_react.createContext.call(void 0, {locale:"pl-PL",texts:Xe("pl-PL")});function qt({texts:e,locale:t,children:n}){let r=_nullishCoalesce(t, () => (_chunk7RXW6XFYjs.f.call(void 0, ))),a=_react.useMemo.call(void 0, ()=>({locale:r,texts:Xe(r,e)}),[r,e]);return _jsxruntime.jsx.call(void 0, Je.Provider,{value:a,children:n})}function z(){let{texts:e}=_react.useContext.call(void 0, Je);return _react.useCallback.call(void 0, (t,n)=>n==null?e[t]:Ft(e[t],n),[e])}function Z(){return _react.useContext.call(void 0, Je).locale}var _connect = require('@connectrpc/connect');var _connectquery = require('@connectrpc/connect-query');var _reactquery = require('@tanstack/react-query');function et(){try{return typeof window<"u"?window.sessionStorage:void 0}catch (e2){return}}function Ut(e,t,n){return`bitsnap-login-pending:${e}:${encodeURIComponent(_nullishCoalesce(n, () => ("")))}:${encodeURIComponent(_nullishCoalesce(t, () => ("")))}`}function Le(e,t){try{_optionalChain([et, 'call', _6 => _6(), 'optionalAccess', _7 => _7.setItem, 'call', _8 => _8(e,JSON.stringify(t))])}catch (e3){}}function me(e){try{_optionalChain([et, 'call', _9 => _9(), 'optionalAccess', _10 => _10.removeItem, 'call', _11 => _11(e)])}catch (e4){}}function Pe(e,t=Date.now()){let n=et();if(n!=null)try{let r=n.getItem(e);if(r==null)return;let a=JSON.parse(r);if(a!=null&&typeof a.email=="string"&&a.email!==""&&typeof a.sentAt=="number"&&typeof a.resendAt=="number"&&(a.challengeId==null||typeof a.challengeId=="string")&&t-a.sentAt<6e5)return{email:a.email,challengeId:a.challengeId,resendAt:a.resendAt,sentAt:a.sentAt};n.removeItem(e)}catch (e5){try{n.removeItem(e)}catch (e6){}}}var _wkt = require('@bufbuild/protobuf/wkt');var _n="bitsnap-returns-session:";function tt(e){return`${_n}${e}`}function Ae(){try{return typeof window<"u"?window.sessionStorage:void 0}catch (e7){return}}function Qt(e,t,n=Date.now()){if(e==null)return;let r=tt(t);try{let a=e.getItem(r);if(a==null)return;let i=JSON.parse(a);if(i!=null&&typeof i=="object"&&typeof i.token=="string"&&i.token.length>0&&typeof i.expiresAt=="number"&&i.expiresAt>n){let{token:s,expiresAt:o}=i;return{token:s,expiresAt:o}}e.removeItem(r)}catch (e8){try{e.removeItem(r)}catch (e9){}}}function Vt(e,t,n){try{_optionalChain([e, 'optionalAccess', _12 => _12.setItem, 'call', _13 => _13(tt(t),JSON.stringify(n))])}catch (e10){}}function nt(e,t){try{_optionalChain([e, 'optionalAccess', _14 => _14.removeItem, 'call', _15 => _15(tt(t))])}catch (e11){}}function Oe(e){return e==null?void 0:_wkt.timestampMs.call(void 0, e)}var Yt=_react.createContext.call(void 0, void 0);function D(e){let t=_react.useContext.call(void 0, Yt);if(t==null)throw new Error(`${e} must be rendered inside <ReturnsProvider>`);return t}function rt(){return _connectquery.createConnectQueryKey.call(void 0, {schema:_chunkG4V2KWTVjs.j,cardinality:void 0})}var $n=2**31-1;function Gn({projectID:e,environment:t,transport:n,panelAccessToken:r,className:a,children:i}){let s=_reactquery.useQueryClient.call(void 0, ),{boundaryClassName:o,boundaryStyle:g}=$e(),m=d("root"),[l,y]=_react.useState.call(void 0, {status:"hydrating"}),[c,f]=_react.useState.call(void 0, ),[b,x]=_react.useState.call(void 0, ),[v,k]=_react.useState.call(void 0, ),S=Ut("returns",e),w=_react.useRef.call(void 0, void 0),h=_react.useCallback.call(void 0, N=>{if(x(N),N==null){me(S);return}k(N.email),Le(S,{email:N.email,challengeId:N.challengeId,resendAt:N.resendAvailableAt,sentAt:Date.now()})},[S]),C=_react.useCallback.call(void 0, ()=>{s.removeQueries({queryKey:rt()})},[s]),U=_react.useCallback.call(void 0, ()=>{nt(Ae(),e),h(void 0),y({status:"anonymous"}),C()},[e,C,h]),_=_react.useCallback.call(void 0, N=>{Vt(Ae(),e,N),f(void 0),h(void 0),y({status:"authenticated",token:N.token,expiresAt:N.expiresAt})},[e,h]);_react.useEffect.call(void 0, ()=>{let N=!1,Y=Ae();if(r==null||r===""){let O=w.current!=null;if(w.current=void 0,O){U();return}let j=Qt(Y,e),Q=j==null?Pe(S):void 0;_optionalChain([Q, 'optionalAccess', _16 => _16.challengeId])!=null&&(x({challengeId:Q.challengeId,email:Q.email,resendAvailableAt:Q.resendAt}),k(Q.email)),y(j!=null?{status:"authenticated",token:j.token,expiresAt:j.expiresAt}:{status:"anonymous"});return}return w.current=r,nt(Y,e),C(),f(void 0),y({status:"exchanging"}),_connect.createClient.call(void 0, _chunkG4V2KWTVjs.j,n).exchangePanelSession({projectId:e,accessToken:r,environment:t}).then(O=>{if(N)return;let j=Oe(O.expiresAt);if(O.sessionToken===""||j==null)throw new Error("EMPTY_SESSION");_({token:O.sessionToken,expiresAt:j})}).catch(O=>{N||(f(O),y({status:"anonymous"}))}),()=>{N=!0}},[r,e,t,n]),_react.useEffect.call(void 0, ()=>{if(l.status!=="authenticated"||l.expiresAt==null)return;let N=l.expiresAt-Date.now();if(N<=0){U();return}let Y=setTimeout(U,Math.min(N,$n));return()=>clearTimeout(Y)},[l.status,l.expiresAt,U]);let J=_react.useMemo.call(void 0, ()=>({projectID:e,environment:t,status:l.status,token:l.token,exchangeError:c,challenge:b,setChallenge:h,lastEmail:v,authenticate:_,clearSession:U}),[e,t,l.status,l.token,c,b,h,v,_,U]);return _jsxruntime.jsx.call(void 0, Yt.Provider,{value:J,children:_jsxruntime.jsx.call(void 0, "div",{"data-bitsnap-returns":"root","data-bitsnap-returns-slot":"root",className:_chunk4HGZZJELjs.g.call(void 0, "bitsnap-react",o,a,m.className),style:{...g,...m.style},children:i})})}function Xn({projectID:e,host:t,environment:n,appearance:r,texts:a,theme:i,locale:s,panelAccessToken:o,className:g,analytics:m,children:l}){let y=_chunkDP2NOHCIjs.n.call(void 0, e,m,"returns"),c=_react.useContext.call(void 0, _reactquery.QueryClientContext),[f]=_react.useState.call(void 0, ()=>c==null?new (0, _reactquery.QueryClient)({defaultOptions:{queries:{staleTime:5e3}}}):void 0),b=_nullishCoalesce(t, () => (_chunkG4V2KWTVjs.n.call(void 0, ))),x=_react.useMemo.call(void 0, ()=>_chunkG4V2KWTVjs.o.call(void 0, b),[b]),v=_optionalChain([i, 'optionalAccess', _17 => _17.brandColor]),k=_react.useMemo.call(void 0, ()=>Dt(r,{brandColor:v}),[r,v]),S=_react.useMemo.call(void 0, ()=>Mt(a),[a]),w=_jsxruntime.jsx.call(void 0, _chunkDP2NOHCIjs.l,{value:y,children:_jsxruntime.jsx.call(void 0, _connectquery.TransportProvider,{transport:x,children:_jsxruntime.jsx.call(void 0, Ot,{appearance:k,children:_jsxruntime.jsx.call(void 0, qt,{texts:S,locale:s,children:_jsxruntime.jsx.call(void 0, Gn,{projectID:e,environment:Bt(n),transport:x,panelAccessToken:o,className:g,children:l})})})})});return c==null&&f!=null?_jsxruntime.jsx.call(void 0, _reactquery.QueryClientProvider,{client:f,children:w}):w}var ls=Xn;function Zt(e){let t=_connect.ConnectError.from(e);switch(t.code){case _connect.Code.ResourceExhausted:return"rateLimited";case _connect.Code.Unavailable:case _connect.Code.DeadlineExceeded:case _connect.Code.Canceled:return"network";case _connect.Code.Unknown:return e instanceof TypeError||t.cause instanceof TypeError?"network":"unknown";default:return"unknown"}}var nr="SESSION_EXPIRED",$t={INVALID_EMAIL:"errorInvalidEmail",INVALID_OR_EXPIRED_CODE:"errorInvalidCode",SESSION_EXPIRED:"errorSessionExpired",ORDER_NOT_FOUND:"errorOrderNotFound",RETURN_NOT_FOUND:"errorReturnNotFound",QUANTITY_UNAVAILABLE:"errorQuantityUnavailable",ITEM_NOT_RETURNABLE:"errorItemNotReturnable",INVALID_RETURN_ITEMS:"errorItemNotReturnable",RETURNS_DISABLED:"errorReturnsDisabled",SUBMISSION_RATE_LIMITED:"errorRateLimited",IDEMPOTENCY_CONFLICT:"errorIdempotencyConflict",VERIFICATION_DELIVERY_FAILED:"errorDeliveryFailed"};function Gt(e){if(e==null||typeof e!="object")return;let{rawMessage:t,message:n}=e;if(typeof t=="string"&&t.length>0)return t;if(typeof n=="string")return Object.keys($t).find(r=>n.includes(r))}function st(e){return Gt(e)===nr}function Xt(e){let t=Gt(e),n=t!=null?$t[t]:void 0;if(n!=null)return n;if(e!=null&&typeof e=="object"){if(_connect.ConnectError.from(e).code===_connect.Code.ResourceExhausted)return"errorRateLimited";if(Zt(e)==="network")return"errorNetwork"}return"errorGeneric"}function ot(){let e=typeof globalThis<"u"?globalThis.crypto:void 0;if(typeof _optionalChain([e, 'optionalAccess', _18 => _18.randomUUID])=="function")return e.randomUUID();let t=new Uint8Array(16);if(typeof _optionalChain([e, 'optionalAccess', _19 => _19.getRandomValues])=="function")e.getRandomValues(t);else for(let n=0;n<t.length;n++)t[n]=Math.floor(Math.random()*256);return Array.from(t,n=>n.toString(16).padStart(2,"0")).join("")}function fe(e){return e==null?null:e instanceof Error?e:new Error(String(e))}function ge(e){return e==null?void 0:Xt(e)}function De(e,t){_react.useEffect.call(void 0, ()=>{st(e)&&t()},[e,t])}function en(e){let[t,n]=_react.useState.call(void 0, [""]);return _react.useEffect.call(void 0, ()=>{n([""])},[e]),{pageToken:_nullishCoalesce(t[t.length-1], () => ("")),page:t.length,push:r=>n(a=>[...a,r]),pop:()=>n(r=>r.length>1?r.slice(0,-1):r)}}function Fe(){let e=D("useReturnSession"),t=_connectquery.useMutation.call(void 0, _chunkG4V2KWTVjs.k.returns.startReturnSession),n=_connectquery.useMutation.call(void 0, _chunkG4V2KWTVjs.k.returns.verifyReturnSession),{setChallenge:r,authenticate:a,clearSession:i}=e,s=Z().toLowerCase().startsWith("en")?"en":"pl",o=_react.useCallback.call(void 0, async f=>{n.reset();let b=f.trim(),x=await t.mutateAsync({projectId:e.projectID,email:b,environment:e.environment,locale:s});return r({challengeId:x.challengeId,email:b,resendAvailableAt:Date.now()+Math.max(0,x.resendAfterSeconds)*1e3}),x},[e.projectID,e.environment,s,r,t,n]),g=_react.useCallback.call(void 0, async f=>{let b=await n.mutateAsync({projectId:e.projectID,challengeId:f.challengeId,code:f.code,environment:e.environment}),x=Oe(b.expiresAt);if(b.sessionToken===""||x==null)throw new Error("EMPTY_SESSION");return a({token:b.sessionToken,expiresAt:x}),b},[e.projectID,e.environment,a,n]),m=_react.useCallback.call(void 0, async f=>{try{return await o(f),!0}catch (e12){return!1}},[o]),l=_react.useCallback.call(void 0, async f=>{if(e.challenge==null)return!1;try{return await g({challengeId:e.challenge.challengeId,code:f.trim()}),!0}catch (e13){return!1}},[e.challenge,g]),y=_react.useCallback.call(void 0, ()=>e.challenge!=null?m(e.challenge.email):Promise.resolve(!1),[e.challenge,m]),c=fe(_nullishCoalesce(_nullishCoalesce(t.error, () => (n.error)), () => (e.exchangeError)));return{status:e.status,isAuthenticated:e.status==="authenticated",challenge:e.challenge,isStarting:t.isPending,isVerifying:n.isPending,starting:t.isPending,verifying:n.isPending,error:c,errorKey:ge(c),start:m,startSession:o,verifySession:g,verify:l,resend:y,logout:i}}function Ke(e){return e.status==="hydrating"||e.status==="exchanging"}function tn(e,t){let n=D("useReturnOrders"),{pageSize:r,explicitPageToken:a}=Ge(e,t),i=en(n.token),s=_connectquery.useQuery.call(void 0, _chunkG4V2KWTVjs.k.returns.listReturnOrders,{projectId:n.projectID,sessionToken:_nullishCoalesce(n.token, () => ("")),pageSize:r,pageToken:_nullishCoalesce(a, () => (i.pageToken))},{enabled:n.token!=null});De(s.error,n.clearSession);let o=_nullishCoalesce(_optionalChain([s, 'access', _20 => _20.data, 'optionalAccess', _21 => _21.nextPageToken]), () => (""));return{orders:_nullishCoalesce(_optionalChain([s, 'access', _22 => _22.data, 'optionalAccess', _23 => _23.orders]), () => ([])),total:_nullishCoalesce(_optionalChain([s, 'access', _24 => _24.data, 'optionalAccess', _25 => _25.total]), () => (0)),data:s.data,isLoading:Ke(n)||s.isLoading,isFetching:s.isFetching,error:fe(s.error),errorKey:ge(s.error),status:s.status,isError:s.isError,isSuccess:s.isSuccess,page:i.page,hasNext:o!=="",hasPrevious:i.page>1,next:()=>{o!==""&&i.push(o)},previous:i.pop,refetch:()=>s.refetch()}}function it(e){let t=D("useReturnableOrder"),n=_connectquery.useQuery.call(void 0, _chunkG4V2KWTVjs.k.returns.getReturnableOrder,{projectId:t.projectID,sessionToken:_nullishCoalesce(t.token, () => ("")),canonicalOrderId:_nullishCoalesce(e, () => (""))},{enabled:t.token!=null&&e!=null&&e!==""});return De(n.error,t.clearSession),{order:_optionalChain([n, 'access', _26 => _26.data, 'optionalAccess', _27 => _27.order]),returnHistory:_nullishCoalesce(_optionalChain([n, 'access', _28 => _28.data, 'optionalAccess', _29 => _29.returnHistory]), () => ([])),data:n.data,isLoading:e!=null&&e!==""&&(Ke(t)||n.isLoading),error:fe(n.error),errorKey:ge(n.error),status:n.status,isError:n.isError,isSuccess:n.isSuccess,refetch:()=>n.refetch()}}function nn(){let e=D("useCreateReturn"),t=_reactquery.useQueryClient.call(void 0, ),n=_connectquery.useMutation.call(void 0, _chunkG4V2KWTVjs.k.returns.createReturnRequest),r=_chunkDP2NOHCIjs.m.call(void 0, ),a=_react.useRef.call(void 0, void 0),{clearSession:i}=e,s=_react.useCallback.call(void 0, async(l,y)=>{try{let c=await n.mutateAsync({projectId:e.projectID,sessionToken:_nullishCoalesce(e.token, () => ("")),canonicalOrderId:l.orderId,items:l.items,note:_nullishCoalesce(l.note, () => ("")),idempotencyKey:y});return t.invalidateQueries({queryKey:rt()}),r.track("return_submitted",{reason_code:"unspecified",item_count:l.items.length},{order_ref:null}),c}catch(c){throw st(c)&&i(),c}},[e.projectID,e.token,n,t,i,r]),o=_react.useCallback.call(void 0, async l=>{a.current??=ot();try{let y=await s(l,a.current);return a.current=void 0,y.request}catch (e14){return}},[s]),g=_react.useCallback.call(void 0, async l=>{if(e.token==null)throw new Error("Verify your email to continue.");return s({orderId:l.canonicalOrderID,items:l.items,note:l.note},_nullishCoalesce(l.idempotencyKey, () => (ot())))},[e.token,s]),m=_react.useCallback.call(void 0, (l,y)=>{g(l).then(c=>_optionalChain([y, 'optionalAccess', _30 => _30.onSuccess, 'optionalCall', _31 => _31(c)]),c=>_optionalChain([y, 'optionalAccess', _32 => _32.onError, 'optionalCall', _33 => _33(fe(c))]))},[g]);return{submit:o,isPending:n.isPending,error:fe(n.error),errorKey:ge(n.error),mutateAsync:g,mutate:m,data:n.data,reset:n.reset,status:n.status,isError:n.isError,isSuccess:n.isSuccess}}function rn(e,t){let n=D("useMyReturns"),{pageSize:r,explicitPageToken:a}=Ge(e,t),i=en(n.token),s=_connectquery.useQuery.call(void 0, _chunkG4V2KWTVjs.k.returns.listMyReturns,{projectId:n.projectID,sessionToken:_nullishCoalesce(n.token, () => ("")),pageSize:r,pageToken:_nullishCoalesce(a, () => (i.pageToken))},{enabled:n.token!=null});De(s.error,n.clearSession);let o=_nullishCoalesce(_optionalChain([s, 'access', _34 => _34.data, 'optionalAccess', _35 => _35.nextPageToken]), () => (""));return{returns:_nullishCoalesce(_optionalChain([s, 'access', _36 => _36.data, 'optionalAccess', _37 => _37.returns]), () => ([])),total:_nullishCoalesce(_optionalChain([s, 'access', _38 => _38.data, 'optionalAccess', _39 => _39.total]), () => (0)),data:s.data,isLoading:Ke(n)||s.isLoading,isFetching:s.isFetching,error:fe(s.error),errorKey:ge(s.error),status:s.status,isError:s.isError,isSuccess:s.isSuccess,page:i.page,hasNext:o!=="",hasPrevious:i.page>1,next:()=>{o!==""&&i.push(o)},previous:i.pop,refetch:()=>s.refetch()}}function _e(e){let t=D("useMyReturn"),n=_connectquery.useQuery.call(void 0, _chunkG4V2KWTVjs.k.returns.getMyReturn,{projectId:t.projectID,sessionToken:_nullishCoalesce(t.token, () => ("")),returnId:e},{enabled:t.token!=null});return De(n.error,t.clearSession),{request:_optionalChain([n, 'access', _40 => _40.data, 'optionalAccess', _41 => _41.request]),isLoading:Ke(t)||n.isLoading,error:n.error,errorKey:ge(n.error),refetch:()=>n.refetch()}}var _reactlabel = require('@radix-ui/react-label'); var sn = _interopRequireWildcard(_reactlabel);function Te({className:e,...t}){return _jsxruntime.jsx.call(void 0, sn.Root,{"data-slot":"label",className:_chunk4HGZZJELjs.g.call(void 0, "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}var _lucidereact = require('lucide-react');function ye({className:e,...t}){return _jsxruntime.jsx.call(void 0, _lucidereact.Loader2Icon,{role:"status","aria-label":"Loading",className:_chunk4HGZZJELjs.g.call(void 0, "size-4 animate-spin",e),...t})}var dr={pl:{alt:"Logo sklepu"},en:{alt:"Shop logo"}},ut="flex h-10 items-center",lt="block max-h-10 max-w-48 w-auto object-contain";function cr(){return _jsxruntime.jsxs.call(void 0, "span",{role:"img","aria-label":"Bitsnap",className:"inline-flex items-center gap-1.5",children:[_jsxruntime.jsx.call(void 0, "svg",{"aria-hidden":"true",width:"29",height:"27",viewBox:"0 0 33 30",fill:"none",stroke:"currentColor",strokeWidth:"3.04",strokeLinecap:"round",children:_jsxruntime.jsx.call(void 0, "path",{d:"M20.2 1.8h0M22.8 6.2h0M22.8 10.6h0M22.8 15h0M22.8 19.4h0M22.8 23.8h0M20.2 28.2h0M27.1 10.6h0M27.1 15h0M27.1 19.4h0M31.5 15h0M1.5 1.8h0M5.4 1.8h0M9.3 1.8h0M13.2 1.8h0M5.4 15h0M9.3 15h0M13.2 15h0M5.4 28.2h0M9.3 28.2h0M13.2 28.2h0M1.5 6.2h0M1.5 10.6h0M1.5 15h0M1.5 19.4h0M1.5 23.8h0M1.5 28.2h0M16.7 19.4h0M16.7 23.8h0M16.7 6.2h0M16.7 10.6h0"})}),_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":"true",className:"text-xl tracking-wider",children:"bitsnap."})]})}function pr(e,t){return _chunkG4V2KWTVjs.l.call(void 0, _chunkG4V2KWTVjs.h,{projectId:e},{enabled:t,staleTime:1/0,retry:!1,refetchOnWindowFocus:!1})}function dt({projectId:e,name:t,locale:n,showLogo:r=!0,logoUrl:a,logoDarkUrl:i,className:s}){let[o,g]=_react.useState.call(void 0, []),m=a||i,l=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _42 => _42.trim, 'call', _43 => _43()]), () => ("")),{data:y,isPending:c}=pr(l,r&&!m&&l!=="");if(!r)return null;if(!m&&l!==""&&c)return _jsxruntime.jsx.call(void 0, "div",{className:_chunk4HGZZJELjs.g.call(void 0, ut,s),"aria-hidden":"true"});let f=(m?a||i:_optionalChain([y, 'optionalAccess', _44 => _44.logoUrl])||_optionalChain([y, 'optionalAccess', _45 => _45.logoDarkUrl]))||"",b=(m?i||a:_optionalChain([y, 'optionalAccess', _46 => _46.logoDarkUrl])||_optionalChain([y, 'optionalAccess', _47 => _47.logoUrl]))||"",x=h=>h!==""&&!o.includes(h),v=x(f)?f:x(b)?b:"",k=x(b)?b:x(f)?f:"";if(v===""&&k==="")return _jsxruntime.jsx.call(void 0, "div",{className:_chunk4HGZZJELjs.g.call(void 0, ut,s),children:_jsxruntime.jsx.call(void 0, cr,{})});let S=t||_optionalChain([y, 'optionalAccess', _48 => _48.name])||_chunk7RXW6XFYjs.a.call(void 0, dr,_nullishCoalesce(n, () => (_chunk7RXW6XFYjs.f.call(void 0, )))).alt,w=h=>()=>g(C=>C.includes(h)?C:[...C,h]);return _jsxruntime.jsx.call(void 0, "div",{className:_chunk4HGZZJELjs.g.call(void 0, ut,s),children:v===k?_jsxruntime.jsx.call(void 0, "img",{src:v,alt:S,className:lt,draggable:!1,onError:w(v)}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "img",{src:v,alt:S,className:_chunk4HGZZJELjs.g.call(void 0, lt,"dark:hidden"),draggable:!1,onError:w(v)}),_jsxruntime.jsx.call(void 0, "img",{src:k,alt:S,className:_chunk4HGZZJELjs.g.call(void 0, lt,"hidden dark:block"),draggable:!1,onError:w(k)})]})})}var _inputotp = require('input-otp');function un({className:e,containerClassName:t,...n}){return _jsxruntime.jsx.call(void 0, _inputotp.OTPInput,{"data-slot":"input-otp",containerClassName:_chunk4HGZZJELjs.g.call(void 0, "flex items-center gap-2 has-disabled:opacity-50",t),className:_chunk4HGZZJELjs.g.call(void 0, "disabled:cursor-not-allowed",e),...n})}function ln({className:e,...t}){return _jsxruntime.jsx.call(void 0, "div",{"data-slot":"input-otp-group",className:_chunk4HGZZJELjs.g.call(void 0, "flex items-center",e),...t})}function dn({index:e,className:t,...n}){let r=an.useContext(_inputotp.OTPInputContext),{char:a,hasFakeCaret:i,isActive:s}=_nullishCoalesce(_optionalChain([r, 'optionalAccess', _49 => _49.slots, 'access', _50 => _50[e]]), () => ({}));return _jsxruntime.jsxs.call(void 0, "div",{"data-slot":"input-otp-slot","data-active":s,className:_chunk4HGZZJELjs.g.call(void 0, "data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",t),...n,children:[a,i&&_jsxruntime.jsx.call(void 0, "div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:_jsxruntime.jsx.call(void 0, "div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function qe(e){let[,t]=_react.useState.call(void 0, 0);return _react.useEffect.call(void 0, ()=>{if(e==null||Date.now()>=e)return;let n=setInterval(()=>{t(r=>r+1),Date.now()>=e&&clearInterval(n)},1e3);return()=>clearInterval(n)},[e]),e!=null?Math.max(0,Math.ceil((e-Date.now())/1e3)):0}var xr={pl:{emailLabel:"E-mail",emailPlaceholder:"m@example.com",sendCode:"Wy\u015Blij kod",sending:"Wysy\u0142anie\u2026",invalidEmail:"Podaj poprawny adres e-mail.",codeSentTo:"Wys\u0142ali\u015Bmy kod na {email}.",changeEmail:"Zmie\u0144",codeLabel:"Kod z e-maila",verify:"Zaloguj si\u0119",verifying:"Sprawdzanie\u2026",codeIncomplete:"Wpisz wszystkie 6 cyfr kodu.",spamHint:"Nie widzisz e-maila? Sprawd\u017A folder spam.",validity:"Kod jest wa\u017Cny 10 minut.",resend:"Wy\u015Blij ponownie",resendIn:"Wy\u015Blij ponownie za {seconds}\xA0s",resendNew:"Wy\u015Blij nowy kod",resent:"Wys\u0142ali\u015Bmy nowy kod.",haveCodePrompt:"Masz ju\u017C kod?",haveCode:"Mam ju\u017C kod",noCode:"Nie masz kodu? Wy\u015Blij go",stepEmail:"Krok 1 z 2: podaj adres e-mail.",stepCode:"Krok 2 z 2: wpisz kod z e-maila.",wrongCode:"Nieprawid\u0142owy kod. Spr\xF3buj jeszcze raz.",expired:"Kod wygas\u0142. Wy\u015Blij nowy kod.",tooManyAttempts:"Zbyt wiele b\u0142\u0119dnych pr\xF3b. Wy\u015Blij nowy kod albo zmie\u0144 adres e-mail.",rateLimited:"Zbyt wiele pr\xF3b. Spr\xF3buj ponownie za {time}.",alreadySent:"Kod zosta\u0142 ju\u017C wys\u0142any. Nowy mo\u017Cesz poprosi\u0107 za {time}.",emailNotFound:"Nie znale\u017Ali\u015Bmy konta z tym adresem e-mail.",deliveryFailed:"Nie uda\u0142o si\u0119 wys\u0142a\u0107 kodu. Spr\xF3buj ponownie.",deliveryUnavailable:"Nie mo\u017Cemy teraz wys\u0142a\u0107 kodu na ten adres. Spr\xF3buj p\xF3\u017Aniej.",network:"Brak po\u0142\u0105czenia z serwerem. Sprawd\u017A internet i spr\xF3buj ponownie.",generic:"Co\u015B posz\u0142o nie tak. Spr\xF3buj ponownie."},en:{emailLabel:"Email",emailPlaceholder:"m@example.com",sendCode:"Send code",sending:"Sending\u2026",invalidEmail:"Enter a valid email address.",codeSentTo:"We sent a code to {email}.",changeEmail:"Change",codeLabel:"Code from the email",verify:"Sign in",verifying:"Checking\u2026",codeIncomplete:"Enter all 6 digits of the code.",spamHint:"Can't see the email? Check your spam folder.",validity:"The code is valid for 10 minutes.",resend:"Resend",resendIn:"Resend in {seconds}s",resendNew:"Send a new code",resent:"We sent a new code.",haveCodePrompt:"Already have a code?",haveCode:"I have a code",noCode:"No code yet? Send one",stepEmail:"Step 1 of 2: enter your email address.",stepCode:"Step 2 of 2: enter the code from the email.",wrongCode:"Incorrect code. Please try again.",expired:"The code has expired. Send a new one.",tooManyAttempts:"Too many wrong attempts. Send a new code or change the email address.",rateLimited:"Too many attempts. Try again in {time}.",alreadySent:"A code was already sent. You can ask for a new one in {time}.",emailNotFound:"We could not find an account with this email address.",deliveryFailed:"We could not send the code. Please try again.",deliveryUnavailable:"We cannot send a code to this address right now. Try again later.",network:"Cannot reach the server. Check your connection and try again.",generic:"Something went wrong. Please try again."}};function eo(e,...t){let n={..._chunk7RXW6XFYjs.a.call(void 0, xr,e)};for(let r of t)if(r!=null)for(let[a,i]of Object.entries(r))i!=null&&(n[a]=i);return n}function cn(e){let t=Math.max(1,Math.ceil(e));return t<=60?`${t}\xA0s`:`${Math.ceil(t/60)}\xA0min`}function ct(e,t){return e.replace(/\{(\w+)\}/g,(n,r)=>Object.prototype.hasOwnProperty.call(t,r)?String(t[r]):n)}var de=6,mn=60,vr=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;function pn(e){return vr.test(e.trim())}function pt(e,t,n){return{...Sr(e,t,n),failure:t}}function Sr(e,t,n){let r=cn(_nullishCoalesce(n, () => (mn)));switch(t){case"invalidEmail":return{kind:"error",text:e.invalidEmail};case"emailNotFound":return{kind:"error",text:e.emailNotFound};case"wrongCode":return{kind:"error",text:e.wrongCode};case"expired":return{kind:"error",text:e.expired};case"tooManyAttempts":return{kind:"error",text:e.tooManyAttempts};case"rateLimited":return{kind:"error",text:ct(e.rateLimited,{time:r})};case"alreadySent":return{kind:"info",text:ct(e.alreadySent,{time:r})};case"deliveryFailed":return{kind:"error",text:e.deliveryFailed};case"deliveryUnavailable":return{kind:"error",text:e.deliveryUnavailable};case"network":return{kind:"error",text:e.network};default:return{kind:"error",text:e.generic}}}function ao(e){let{storageKey:t}=e,n=_react.useRef.call(void 0, e);n.current=e;let[r,a]=_react.useState.call(void 0, "email"),[i,s]=_react.useState.call(void 0, _nullishCoalesce(e.initialEmail, () => (""))),[o,g]=_react.useState.call(void 0, ""),[m,l]=_react.useState.call(void 0, ),[y,c]=_react.useState.call(void 0, ),[f,b]=_react.useState.call(void 0, !1),[x,v]=_react.useState.call(void 0, ),[k,S]=_react.useState.call(void 0, ),[w,h]=_react.useState.call(void 0, ),[C,U]=_react.useState.call(void 0, !1),[_,J]=_react.useState.call(void 0, ""),[N,Y]=_react.useState.call(void 0, 0),O=_react.useRef.call(void 0, !1),j=_react.useRef.call(void 0, "email"),Q=_react.useRef.call(void 0, null),F=_react.useRef.call(void 0, null),re=_react.useRef.call(void 0, "email"),Se=qe(y),B=_react.useCallback.call(void 0, T=>{j.current=T,Y(A=>A+1)},[]);_react.useEffect.call(void 0, ()=>{N!==0&&_optionalChain([(j.current==="email"?Q:F), 'access', _51 => _51.current, 'optionalAccess', _52 => _52.focus, 'call', _53 => _53()])},[N]),_react.useEffect.call(void 0, ()=>{if(a("email"),g(""),l(void 0),c(void 0),b(!1),v(void 0),S(void 0),t==null)return;let T=Pe(t);T!=null&&(s(T.email),l(T.challengeId),c(T.resendAt>Date.now()?T.resendAt:void 0),a("code"))},[t]),_react.useEffect.call(void 0, ()=>{re.current!==r&&(re.current=r,J(r==="code"?n.current.texts.stepCode:n.current.texts.stepEmail))},[r]),_react.useEffect.call(void 0, ()=>{r==="code"&&N===0&&B(f?"email":"code")},[r]);let R=_react.useCallback.call(void 0, (T,A,L,M)=>{T!=="wrongCode"&&T!=="invalidEmail"&&T!=="alreadySent"&&_optionalChain([n, 'access', _54 => _54.current, 'access', _55 => _55.onFailure, 'optionalCall', _56 => _56(T,L)]);let se=pt(n.current.texts,T,A);return M!=null?{...se,text:M}:se},[]),X=_react.useCallback.call(void 0, (T,A,L,M)=>{let se=Date.now(),bt=se+(_nullishCoalesce(L, () => (mn)))*1e3;s(T),a("code"),b(!1),l(A),c(bt),g(""),v(void 0),S(M),t!=null&&Le(t,{email:T,challengeId:A,resendAt:bt,sentAt:se}),B("code")},[t,B]),V=_react.useCallback.call(void 0, async T=>{if(O.current)return;let A=i.trim();if(!pn(A)){S(pt(n.current.texts,"invalidEmail")),B("email");return}O.current=!0,h(T),S(void 0);let L;try{L=await n.current.adapter.send(A,{resend:T==="resend"})}catch(se){L={ok:!1,kind:"network",cause:se}}if(O.current=!1,h(void 0),L.ok){X(A,L.challengeId,L.retryIn,T==="resend"?{kind:"success",text:n.current.texts.resent}:void 0);return}let M=R(L.kind,L.retryIn,L.cause,L.message);if(L.kind==="alreadySent"&&T==="send"){X(A,void 0,L.retryIn,M);return}L.retryIn!=null&&T==="resend"&&c(Date.now()+L.retryIn*1e3),S(M),T==="send"&&B("email")},[i,X,R,B]),he=_react.useCallback.call(void 0, async T=>{let A=_nullishCoalesce(T, () => (o));if(O.current||C||x!=null)return;let L=i.trim();if(f&&!pn(L)){S(pt(n.current.texts,"invalidEmail")),B("email");return}if(A.length!==de){S({kind:"error",text:n.current.texts.codeIncomplete}),B("code");return}O.current=!0,h("verify"),S(void 0);let M;try{M=await n.current.adapter.verify({email:L,code:A,challengeId:m})}catch(se){M={ok:!1,kind:"network",cause:se}}if(O.current=!1,h(void 0),M.ok){t!=null&&me(t),U(!0),_optionalChain([n, 'access', _57 => _57.current, 'access', _58 => _58.onVerified, 'optionalCall', _59 => _59(M.value,L)]);return}switch(S(R(M.kind,M.retryIn,M.cause,M.message)),M.kind){case"expired":case"tooManyAttempts":v(M.kind),g(""),t!=null&&me(t);break;case"invalidEmail":case"emailNotFound":B(f?"email":"code");break;case"network":case"unknown":case"deliveryFailed":case"deliveryUnavailable":B("code");break;default:g(""),B("code")}},[o,m,x,C,i,R,f,B,t]),He=_react.useCallback.call(void 0, T=>{s(T),S(A=>_optionalChain([A, 'optionalAccess', _60 => _60.kind])==="error"?void 0:A)},[]),hn=_react.useCallback.call(void 0, T=>{g(T.replace(/\D/g,"").slice(0,de)),S(A=>_optionalChain([A, 'optionalAccess', _61 => _61.kind])==="error"?void 0:A)},[]),kn=_react.useCallback.call(void 0, ()=>{a("email"),b(!1),g(""),l(void 0),c(void 0),v(void 0),S(void 0),t!=null&&me(t),B("email")},[t,B]),Nn=_react.useCallback.call(void 0, ()=>{a("code"),b(!0),g(""),l(void 0),c(void 0),v(void 0),S(void 0),B("email")},[B]);return{step:r,email:i,setEmail:He,code:o,setCode:hn,needsEmail:f,busy:w,isBusy:w!=null||C,done:C,notice:k,dead:x,secondsLeft:Se,announcement:_,emailRef:Q,codeRef:F,sendCode:()=>V("send"),resend:()=>V("resend"),submitCode:he,changeEmail:kn,haveCode:Nn}}function Nr(e){return e.replace(/[\s-]/g,"")}function Tr(e){e!=null&&(e.style.boxSizing="border-box",e.style.padding="0")}function fn({id:e,name:t,value:n,onChange:r,onComplete:a,disabled:i,invalid:s,inputRef:o,autoFocus:g,slotClassName:m,slotStyle:l,className:y,...c}){let f=_react.useCallback.call(void 0, x=>{Tr(x),typeof o=="function"?o(x):o!=null&&(o.current=x)},[o]),b={className:_chunk4HGZZJELjs.g.call(void 0, "h-11 w-auto min-w-0 flex-1 rounded-md border first:rounded-md last:rounded-md text-base","dark:border-foreground/30 dark:data-[active=true]:border-foreground/70 dark:data-[active=true]:ring-foreground/25","dark:aria-invalid:border-destructive-foreground dark:data-[active=true]:aria-invalid:border-destructive-foreground dark:aria-invalid:ring-destructive-foreground/30 dark:data-[active=true]:aria-invalid:ring-destructive-foreground/30",m),style:l,"aria-invalid":s?!0:void 0};return _jsxruntime.jsx.call(void 0, un,{ref:f,id:e,name:t,maxLength:de,value:n,onChange:r,onComplete:a,disabled:i,autoFocus:g,inputMode:"numeric",autoComplete:"one-time-code",pattern:_inputotp.REGEXP_ONLY_DIGITS,pasteTransformer:Nr,"aria-invalid":s?!0:void 0,"aria-label":c["aria-label"],"aria-describedby":c["aria-describedby"],containerClassName:_chunk4HGZZJELjs.g.call(void 0, "w-full",y),children:_jsxruntime.jsx.call(void 0, ln,{className:"w-full gap-1.5 sm:gap-2",children:Array.from({length:de},(x,v)=>_jsxruntime.jsx.call(void 0, dn,{index:v,...b},v))})})}var ce="bg-[var(--bitsnap-returns-button-background,#18181b)] text-[color:var(--bitsnap-returns-button-foreground,#fafafa)] hover:bg-[var(--bitsnap-returns-button-hover-background,#000000)] focus-visible:ring-[color:var(--bitsnap-returns-focus-ring,#71717a)]/50",W="border border-[color:var(--bitsnap-returns-border,#e4e4e7)] bg-transparent text-[color:var(--bitsnap-returns-foreground,#18181b)] hover:bg-[var(--bitsnap-returns-hover-surface,#f4f4f5)] focus-visible:ring-[color:var(--bitsnap-returns-focus-ring,#71717a)]/50",Re="bg-[var(--bitsnap-returns-input-background,#ffffff)] dark:bg-[var(--bitsnap-returns-input-background,#ffffff)] border-[color:var(--bitsnap-returns-border,#e4e4e7)] text-[color:var(--bitsnap-returns-foreground,#18181b)] placeholder:text-[color:var(--bitsnap-returns-muted-foreground,#71717a)] focus-visible:border-[color:var(--bitsnap-returns-focus-ring,#71717a)] focus-visible:ring-[color:var(--bitsnap-returns-focus-ring,#71717a)]/50",gn=_chunk4HGZZJELjs.g.call(void 0, Re,"data-[active=true]:border-[color:var(--bitsnap-returns-focus-ring,#71717a)] data-[active=true]:ring-[color:var(--bitsnap-returns-focus-ring,#71717a)]/50");function te({title:e,description:t,onBack:n,lead:r,className:a,children:i}){let s=z(),o=d("header"),g=d("title"),m=d("description"),l=d("backButton");return _jsxruntime.jsxs.call(void 0, "section",{className:_chunk4HGZZJELjs.g.call(void 0, "flex flex-col gap-5",a),children:[r,_jsxruntime.jsxs.call(void 0, "div",{"data-bitsnap-returns-slot":"header",className:_chunk4HGZZJELjs.g.call(void 0, "flex flex-col gap-2",o.className),style:o.style,children:[n!=null&&_jsxruntime.jsx.call(void 0, _chunkG4V2KWTVjs.q,{type:"button",variant:"ghost",size:"sm","data-bitsnap-returns-slot":"backButton",className:_chunk4HGZZJELjs.g.call(void 0, "self-start -ml-3 text-[color:var(--bitsnap-returns-muted-foreground,#71717a)] hover:bg-[var(--bitsnap-returns-hover-surface,#f4f4f5)]",l.className),style:l.style,onClick:n,children:s("back")}),_jsxruntime.jsx.call(void 0, "h2",{"data-bitsnap-returns-slot":"title",className:_chunk4HGZZJELjs.g.call(void 0, "text-2xl font-semibold",g.className),style:g.style,children:e}),t!=null&&_jsxruntime.jsx.call(void 0, "p",{"data-bitsnap-returns-slot":"description",className:_chunk4HGZZJELjs.g.call(void 0, "text-sm",m.className),style:m.style,children:t})]}),i]})}function H({errorKey:e,onRetry:t}){let n=z(),r=d("error"),a=d("secondaryButton");return _jsxruntime.jsxs.call(void 0, "div",{role:"alert","data-bitsnap-returns-slot":"error",className:_chunk4HGZZJELjs.g.call(void 0, "flex flex-col items-start gap-2 text-sm",r.className),style:r.style,children:[_jsxruntime.jsx.call(void 0, "p",{children:n(e)}),t!=null&&_jsxruntime.jsx.call(void 0, _chunkG4V2KWTVjs.q,{type:"button",variant:"secondary",size:"sm","data-bitsnap-returns-slot":"secondaryButton",className:_chunk4HGZZJELjs.g.call(void 0, W,a.className),style:a.style,onClick:t,children:n("errorRetry")})]})}function Ve({children:e}){let t=d("emptyState");return _jsxruntime.jsx.call(void 0, "p",{"data-bitsnap-returns-slot":"emptyState",className:_chunk4HGZZJELjs.g.call(void 0, "py-6 text-center text-sm",t.className),style:t.style,children:e})}function le({rows:e=3}){let t=z(),n=d("skeleton");return _jsxruntime.jsx.call(void 0, "div",{role:"status","aria-busy":"true","aria-label":t("loading"),className:"flex flex-col gap-3",children:Array.from({length:e},(r,a)=>_jsxruntime.jsx.call(void 0, _chunkG4V2KWTVjs.u,{"data-bitsnap-returns-slot":"skeleton",className:_chunk4HGZZJELjs.g.call(void 0, "h-16 w-full bg-[var(--bitsnap-returns-hover-surface,#f4f4f5)]",n.className),style:n.style},a))})}function xe({status:e}){let t=z(),n=d("statusBadge");return _jsxruntime.jsx.call(void 0, "span",{"data-bitsnap-returns-slot":"statusBadge","data-status":e,className:_chunk4HGZZJELjs.g.call(void 0, "inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium",n.className),style:n.style,children:t(Kt(e))})}function ft(){let e=z();return t=>e(_t(t))}function We({page:e,total:t,hasNext:n,hasPrevious:r,isFetching:a,onNext:i,onPrevious:s}){let o=z(),g=d("pagination"),m=d("secondaryButton");return!n&&!r?null:_jsxruntime.jsxs.call(void 0, "nav",{"data-bitsnap-returns-slot":"pagination",className:_chunk4HGZZJELjs.g.call(void 0, "flex items-center justify-between gap-3 text-sm",g.className),style:g.style,children:[_jsxruntime.jsx.call(void 0, _chunkG4V2KWTVjs.q,{type:"button",variant:"secondary",size:"sm","data-bitsnap-returns-slot":"secondaryButton",className:_chunk4HGZZJELjs.g.call(void 0, W,m.className),style:m.style,disabled:!r||a,onClick:s,children:o("paginationPrevious")}),_jsxruntime.jsx.call(void 0, "span",{"aria-live":"polite",children:o("paginationInfo",{page:e,total:t})}),_jsxruntime.jsx.call(void 0, _chunkG4V2KWTVjs.q,{type:"button",variant:"secondary",size:"sm","data-bitsnap-returns-slot":"secondaryButton",className:_chunk4HGZZJELjs.g.call(void 0, W,m.className),style:m.style,disabled:!n||a,onClick:i,children:o("paginationNext")})]})}function Ko({onSubmitted:e,className:t,...n}){let r=D("ReturnsEmailStep"),a=z(),i=Z(),s=Fe(),[o,g]=_react.useState.call(void 0, _nullishCoalesce(r.lastEmail, () => (""))),m=d("emailForm"),l=d("emailInput"),y=d("submitButton");async function c(f){f.preventDefault(),!s.isStarting&&await s.start(o)&&_optionalChain([e, 'optionalCall', _62 => _62(o.trim())])}return _jsxruntime.jsx.call(void 0, te,{className:t,lead:_jsxruntime.jsx.call(void 0, dt,{projectId:r.projectID,locale:i,...n}),title:a("emailStepTitle"),description:a("emailStepDescription"),children:_jsxruntime.jsxs.call(void 0, "form",{"data-bitsnap-returns-slot":"emailForm",className:_chunk4HGZZJELjs.g.call(void 0, "flex flex-col gap-4",m.className),style:m.style,onSubmit:c,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-2",children:[_jsxruntime.jsx.call(void 0, Te,{htmlFor:"bitsnap-returns-email",children:a("emailLabel")}),_jsxruntime.jsx.call(void 0, _chunkG4V2KWTVjs.r,{id:"bitsnap-returns-email",type:"email",name:"email",autoComplete:"email",inputMode:"email",autoCapitalize:"none",spellCheck:!1,autoFocus:!0,required:!0,value:o,placeholder:a("emailPlaceholder"),disabled:s.isStarting,"data-bitsnap-returns-slot":"emailInput",className:_chunk4HGZZJELjs.g.call(void 0, Re,l.className),style:l.style,onChange:f=>g(f.target.value)})]}),s.errorKey!=null&&_jsxruntime.jsx.call(void 0, H,{errorKey:s.errorKey}),_jsxruntime.jsxs.call(void 0, _chunkG4V2KWTVjs.q,{type:"submit",disabled:s.isStarting,"data-bitsnap-returns-slot":"submitButton",className:_chunk4HGZZJELjs.g.call(void 0, ce,y.className),style:y.style,children:[s.isStarting&&_jsxruntime.jsx.call(void 0, ye,{}),a("emailSubmit")]})]})})}function _o({onVerified:e,onBack:t,className:n,...r}){let a=D("ReturnsCodeStep"),i=z(),s=Z(),o=Fe(),[g,m]=_react.useState.call(void 0, ""),[l,y]=_react.useState.call(void 0, !1),[c,f]=_react.useState.call(void 0, !1),[b,x]=_react.useState.call(void 0, 1),v=_react.useRef.call(void 0, null),k=_react.useRef.call(void 0, !1),S=qe(_optionalChain([o, 'access', _63 => _63.challenge, 'optionalAccess', _64 => _64.resendAvailableAt])),w=d("codeForm"),h=d("codeInput"),C=d("submitButton"),U=d("resendButton"),_=o.isVerifying||o.isStarting,J="bitsnap-returns-code",N=`${J}-hint`;_react.useEffect.call(void 0, ()=>{_||_optionalChain([v, 'access', _65 => _65.current, 'optionalAccess', _66 => _66.focus, 'call', _67 => _67()])},[b,_]);async function Y(F){if(!(_||k.current)){if(F.length!==de){y(!0),x(re=>re+1);return}k.current=!0,y(!1),f(!1);try{await o.verify(F)?_optionalChain([e, 'optionalCall', _68 => _68()]):(m(""),x(re=>re+1))}finally{k.current=!1}}}async function O(F){F.preventDefault(),await Y(g)}async function j(){y(!1),f(!1),await o.resend()&&(m(""),f(!0)),x(F=>F+1)}function Q(){a.setChallenge(void 0),_optionalChain([t, 'optionalCall', _69 => _69()])}return _jsxruntime.jsx.call(void 0, te,{className:n,onBack:t!=null?Q:void 0,lead:_jsxruntime.jsx.call(void 0, dt,{projectId:a.projectID,locale:s,...r}),title:i("codeStepTitle"),description:i("codeStepDescription",{email:_nullishCoalesce(_optionalChain([o, 'access', _70 => _70.challenge, 'optionalAccess', _71 => _71.email]), () => (""))}),children:_jsxruntime.jsxs.call(void 0, "form",{"data-bitsnap-returns-slot":"codeForm",className:_chunk4HGZZJELjs.g.call(void 0, "flex flex-col gap-4",w.className),style:w.style,noValidate:!0,onSubmit:O,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-2",children:[_jsxruntime.jsx.call(void 0, Te,{htmlFor:J,children:i("codeLabel")}),_jsxruntime.jsx.call(void 0, fn,{id:J,name:"code",inputRef:v,value:g,disabled:_,invalid:o.errorKey!=null||l,"aria-describedby":N,slotClassName:_chunk4HGZZJELjs.g.call(void 0, gn,h.className),slotStyle:h.style,onChange:F=>{m(F.replace(/\D/g,"")),y(!1)},onComplete:F=>void Y(F)}),_jsxruntime.jsxs.call(void 0, "p",{id:N,className:"text-xs",children:[i("codeValidity")," ",i("codeSpamHint")]})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"min-h-10",children:[l&&_jsxruntime.jsx.call(void 0, "p",{role:"alert",className:"text-sm",children:i("codeIncomplete")}),!l&&o.errorKey!=null&&_jsxruntime.jsx.call(void 0, H,{errorKey:o.errorKey}),!l&&o.errorKey==null&&c&&_jsxruntime.jsx.call(void 0, "p",{role:"status",className:"text-sm",children:i("resendSent")})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-wrap items-center gap-3",children:[_jsxruntime.jsxs.call(void 0, _chunkG4V2KWTVjs.q,{type:"submit",disabled:_||o.challenge==null,"data-bitsnap-returns-slot":"submitButton",className:_chunk4HGZZJELjs.g.call(void 0, "h-11",ce,C.className),style:C.style,children:[o.isVerifying&&_jsxruntime.jsx.call(void 0, ye,{"aria-hidden":!0}),i("codeSubmit")]}),_jsxruntime.jsxs.call(void 0, _chunkG4V2KWTVjs.q,{type:"button",variant:"secondary",disabled:_||S>0||o.challenge==null,"data-bitsnap-returns-slot":"resendButton",className:_chunk4HGZZJELjs.g.call(void 0, "h-11",W,U.className),style:U.style,onClick:()=>void j(),children:[o.isStarting&&_jsxruntime.jsx.call(void 0, ye,{"aria-hidden":!0}),S>0?i("resendIn",{seconds:S}):i("resend")]})]})]})})}function bn(){let e=z(),t=Fe(),n=d("logoutButton");return _jsxruntime.jsx.call(void 0, _chunkG4V2KWTVjs.q,{type:"button",variant:"ghost",size:"sm","data-bitsnap-returns-slot":"logoutButton",className:_chunk4HGZZJELjs.g.call(void 0, "text-[color:var(--bitsnap-returns-muted-foreground,#71717a)] hover:bg-[var(--bitsnap-returns-hover-surface,#f4f4f5)]",n.className),style:n.style,onClick:t.logout,children:e("logout")})}function pe(e,t){if(e==null)return"";let n=_wkt.timestampDate.call(void 0, e);try{return new Intl.DateTimeFormat(t,{dateStyle:"medium"}).format(n)}catch (e15){return n.toISOString().slice(0,10)}}function ve(e,t,n){let r=typeof e=="bigint"?e:BigInt(Math.trunc(e));try{let a=new Intl.NumberFormat(n,{style:"currency",currency:t}),i=_nullishCoalesce(a.resolvedOptions().maximumFractionDigits, () => (2));return a.format(Rn(r,i))}catch (e16){return`${Rn(r,2)} ${t}`}}function Rn(e,t){let n=e<BigInt(0),r=n?-e:e;if(t<=0)return`${n?"-":""}${r}`;let a=BigInt(10)**BigInt(t),i=r/a,s=(r%a).toString().padStart(t,"0");return`${n?"-":""}${i}.${s}`}function xn(e,t){return Number.isFinite(e)?Math.min(Math.max(0,Math.trunc(e)),Math.max(0,t)):0}function gt(e){return e.eligible&&e.availableQuantity>0}function vn(e,t){return e.map(n=>({lineId:n,quantity:_nullishCoalesce(t[n], () => (0))})).filter(n=>n.quantity>0)}function la({onSelectOrder:e,onOpenMyReturns:t,showLogout:n=!0,pageSize:r,className:a}){D("ReturnsOrderList");let i=z(),s=Z(),o=tn({pageSize:r}),g=d("orderList"),m=d("orderCard"),l=d("orderReference"),y=d("orderDate"),c=d("orderTotal"),f=d("secondaryButton");return _jsxruntime.jsxs.call(void 0, te,{className:a,title:i("ordersTitle"),description:i("ordersDescription"),children:[(n||t!=null)&&_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t!=null?_jsxruntime.jsx.call(void 0, _chunkG4V2KWTVjs.q,{type:"button",variant:"secondary",size:"sm","data-bitsnap-returns-slot":"secondaryButton",className:_chunk4HGZZJELjs.g.call(void 0, W,f.className),style:f.style,onClick:t,children:i("myReturnsLink")}):_jsxruntime.jsx.call(void 0, "span",{}),n&&_jsxruntime.jsx.call(void 0, bn,{})]}),o.isLoading?_jsxruntime.jsx.call(void 0, le,{}):o.errorKey!=null?_jsxruntime.jsx.call(void 0, H,{errorKey:o.errorKey,onRetry:o.refetch}):o.orders.length===0?_jsxruntime.jsx.call(void 0, Ve,{children:i("ordersEmpty")}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "ul",{"data-bitsnap-returns-slot":"orderList",className:_chunk4HGZZJELjs.g.call(void 0, "flex flex-col gap-3",g.className),style:g.style,children:o.orders.map(b=>_jsxruntime.jsxs.call(void 0, "li",{"data-bitsnap-returns-slot":"orderCard",className:_chunk4HGZZJELjs.g.call(void 0, "flex flex-wrap items-center justify-between gap-3 border p-4",m.className),style:m.style,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-1",children:[_jsxruntime.jsx.call(void 0, "span",{"data-bitsnap-returns-slot":"orderReference",className:_chunk4HGZZJELjs.g.call(void 0, "font-medium",l.className),style:l.style,children:i("orderTitle",{reference:b.displayReference})}),_jsxruntime.jsx.call(void 0, "span",{"data-bitsnap-returns-slot":"orderDate",className:_chunk4HGZZJELjs.g.call(void 0, "text-sm",y.className),style:y.style,children:pe(b.purchasedAt,s)}),_jsxruntime.jsx.call(void 0, "span",{className:"text-sm",children:i("orderReturnableLines",{count:b.returnableLineCount})})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center gap-4",children:[_jsxruntime.jsx.call(void 0, "span",{"data-bitsnap-returns-slot":"orderTotal",className:_chunk4HGZZJELjs.g.call(void 0, "font-medium",c.className),style:c.style,children:ve(b.totalMinor,b.currency,s)}),_jsxruntime.jsx.call(void 0, _chunkG4V2KWTVjs.q,{type:"button",variant:"secondary",size:"sm","aria-label":`${i("orderSelect")}: ${i("orderTitle",{reference:b.displayReference})}`,"data-bitsnap-returns-slot":"secondaryButton",className:_chunk4HGZZJELjs.g.call(void 0, W,f.className),style:f.style,onClick:()=>_optionalChain([e, 'optionalCall', _72 => _72(b.canonicalOrderId)]),children:i("orderSelect")})]})]},b.canonicalOrderId))}),_jsxruntime.jsx.call(void 0, We,{page:o.page,total:o.total,hasNext:o.hasNext,hasPrevious:o.hasPrevious,isFetching:o.isFetching,onNext:o.next,onPrevious:o.previous})]})]})}function da({orderId:e,onContinue:t,onBack:n,initialItems:r,initialNote:a,className:i}){D("ReturnsOrderDetail");let s=_chunkDP2NOHCIjs.m.call(void 0, );_react.useEffect.call(void 0, ()=>{s.track("return_started",{},{order_ref:null})},[s]);let o=z(),g=Z(),{order:m,returnHistory:l,isLoading:y,errorKey:c,refetch:f}=it(e),[b,x]=_react.useState.call(void 0, ()=>Object.fromEntries((_nullishCoalesce(r, () => ([]))).map(R=>[R.lineId,R.quantity]))),[v,k]=_react.useState.call(void 0, _nullishCoalesce(a, () => (""))),[S,w]=_react.useState.call(void 0, !1),h=d("lineList"),C=d("line"),U=d("lineName"),_=d("linePrice"),J=d("lineQuantityControl"),N=d("quantityButton"),Y=d("quantityInput"),O=d("lineIneligibleReason"),j=d("noteInput"),Q=d("submitButton"),F=d("history"),re=d("historyEntry");function Se(R,X){w(!1),x(V=>({...V,[R.lineId]:xn(X,R.availableQuantity)}))}function B(R){if(R.preventDefault(),m==null)return;let X=vn(m.lines.filter(gt).map(V=>V.lineId),b);if(X.length===0){w(!0);return}_optionalChain([t, 'optionalCall', _73 => _73({items:X,note:v.trim()})])}return _jsxruntime.jsx.call(void 0, te,{className:i,onBack:n,title:o("orderDetailTitle",{reference:_nullishCoalesce(_optionalChain([m, 'optionalAccess', _74 => _74.displayReference]), () => (""))}),description:o("orderDetailDescription"),children:y?_jsxruntime.jsx.call(void 0, le,{}):c!=null?_jsxruntime.jsx.call(void 0, H,{errorKey:c,onRetry:f}):m==null?null:_jsxruntime.jsxs.call(void 0, "form",{className:"flex flex-col gap-5",onSubmit:B,children:[_jsxruntime.jsx.call(void 0, "ul",{"data-bitsnap-returns-slot":"lineList",className:_chunk4HGZZJELjs.g.call(void 0, "flex flex-col gap-3",h.className),style:h.style,children:m.lines.map(R=>{let X=gt(R),V=_nullishCoalesce(b[R.lineId], () => (0)),he=`bitsnap-returns-quantity-${R.lineId}`;return _jsxruntime.jsxs.call(void 0, "li",{"data-bitsnap-returns-slot":"line","data-selected":V>0?"":void 0,"data-ineligible":X?void 0:"",className:_chunk4HGZZJELjs.g.call(void 0, "flex flex-col gap-3 border p-4",C.className),style:C.style,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[_jsxruntime.jsx.call(void 0, "span",{"data-bitsnap-returns-slot":"lineName",className:_chunk4HGZZJELjs.g.call(void 0, "font-medium",U.className),style:U.style,children:R.name}),_jsxruntime.jsx.call(void 0, "span",{"data-bitsnap-returns-slot":"linePrice",className:_chunk4HGZZJELjs.g.call(void 0, "text-sm",_.className),style:_.style,children:ve(R.paidUnitMinor,R.currency,g)})]}),X?_jsxruntime.jsxs.call(void 0, "div",{role:"group","aria-label":o("quantityLabel",{name:R.name}),"data-bitsnap-returns-slot":"lineQuantityControl",className:_chunk4HGZZJELjs.g.call(void 0, "flex items-center gap-2",J.className),style:J.style,children:[_jsxruntime.jsx.call(void 0, _chunkG4V2KWTVjs.q,{type:"button",variant:"secondary",size:"icon-sm","aria-label":o("quantityDecrease",{name:R.name}),"aria-controls":he,disabled:V<=0,"data-bitsnap-returns-slot":"quantityButton",className:_chunk4HGZZJELjs.g.call(void 0, W,N.className),style:N.style,onClick:()=>Se(R,V-1),children:_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":"true",children:"-"})}),_jsxruntime.jsx.call(void 0, "input",{id:he,type:"number",inputMode:"numeric",min:0,max:R.availableQuantity,step:1,value:V,"aria-label":o("quantityLabel",{name:R.name}),"data-bitsnap-returns-slot":"quantityInput",className:_chunk4HGZZJELjs.g.call(void 0, "h-8 w-16 rounded-md border px-2 text-center text-sm outline-none focus-visible:ring-[3px]",Re,Y.className),style:Y.style,onChange:He=>Se(R,He.target.valueAsNumber)}),_jsxruntime.jsx.call(void 0, _chunkG4V2KWTVjs.q,{type:"button",variant:"secondary",size:"icon-sm","aria-label":o("quantityIncrease",{name:R.name}),"aria-controls":he,disabled:V>=R.availableQuantity,"data-bitsnap-returns-slot":"quantityButton",className:_chunk4HGZZJELjs.g.call(void 0, W,N.className),style:N.style,onClick:()=>Se(R,V+1),children:_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":"true",children:"+"})}),_jsxruntime.jsx.call(void 0, "span",{className:"text-sm",children:o("quantityOfAvailable",{available:R.availableQuantity})})]}):_jsxruntime.jsx.call(void 0, "p",{"data-bitsnap-returns-slot":"lineIneligibleReason",className:_chunk4HGZZJELjs.g.call(void 0, "text-sm",O.className),style:O.style,children:R.exclusionReason!==""?R.exclusionReason:o("lineIneligibleFallback")})]},R.lineId)})}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-2",children:[_jsxruntime.jsx.call(void 0, Te,{htmlFor:"bitsnap-returns-note",children:o("noteLabel")}),_jsxruntime.jsx.call(void 0, _chunkG4V2KWTVjs.v,{id:"bitsnap-returns-note",name:"note",rows:3,maxLength:1e3,value:v,placeholder:o("notePlaceholder"),"data-bitsnap-returns-slot":"noteInput",className:_chunk4HGZZJELjs.g.call(void 0, Re,"dark:border-[color:var(--bitsnap-returns-border,#e4e4e7)] dark:placeholder:text-[color:var(--bitsnap-returns-muted-foreground,#71717a)] dark:focus-visible:ring-[color:var(--bitsnap-returns-focus-ring,#71717a)]",j.className),style:j.style,onChange:R=>k(R.target.value)})]}),S&&_jsxruntime.jsx.call(void 0, H,{errorKey:"selectionEmpty"}),_jsxruntime.jsx.call(void 0, _chunkG4V2KWTVjs.q,{type:"submit","data-bitsnap-returns-slot":"submitButton",className:_chunk4HGZZJELjs.g.call(void 0, ce,Q.className),style:Q.style,children:o("selectionContinue")}),l.length>0&&_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-2",children:[_jsxruntime.jsx.call(void 0, "h3",{className:"text-sm font-medium",children:o("previousReturnsTitle")}),_jsxruntime.jsx.call(void 0, "ul",{"data-bitsnap-returns-slot":"history",className:_chunk4HGZZJELjs.g.call(void 0, "flex flex-col gap-2",F.className),style:F.style,children:l.map(R=>_jsxruntime.jsxs.call(void 0, "li",{"data-bitsnap-returns-slot":"historyEntry",className:_chunk4HGZZJELjs.g.call(void 0, "flex flex-wrap items-center justify-between gap-2 text-sm",re.className),style:re.style,children:[_jsxruntime.jsx.call(void 0, "span",{children:R.reference}),_jsxruntime.jsx.call(void 0, "span",{children:pe(R.createdAt,g)}),_jsxruntime.jsx.call(void 0, xe,{status:R.status})]},R.id))})]})]})})}function ca({orderId:e,items:t,note:n,onSubmitted:r,onBack:a,className:i}){D("ReturnsConfirmation");let s=z(),o=Z(),{order:g,isLoading:m,errorKey:l,refetch:y}=it(e),c=nn(),f=d("summary"),b=d("line"),x=d("lineName"),v=d("linePrice"),k=d("submitButton");async function S(w){if(w.preventDefault(),c.isPending)return;let h=await c.submit({orderId:e,items:t.map(C=>({lineId:C.lineId,quantity:C.quantity})),note:n});h!=null&&_optionalChain([r, 'optionalCall', _75 => _75(h.id,h)])}return _jsxruntime.jsx.call(void 0, te,{className:i,onBack:a,title:s("confirmationTitle"),description:s("confirmationDescription"),children:m?_jsxruntime.jsx.call(void 0, le,{rows:2}):l!=null?_jsxruntime.jsx.call(void 0, H,{errorKey:l,onRetry:y}):_jsxruntime.jsxs.call(void 0, "form",{className:"flex flex-col gap-5",onSubmit:S,children:[_jsxruntime.jsxs.call(void 0, "div",{"data-bitsnap-returns-slot":"summary",className:_chunk4HGZZJELjs.g.call(void 0, "flex flex-col gap-3 border p-4",f.className),style:f.style,children:[_jsxruntime.jsx.call(void 0, "h3",{className:"text-sm font-medium",children:s("confirmationSummary")}),_jsxruntime.jsx.call(void 0, "ul",{className:"flex flex-col gap-3",children:t.map(w=>{let h=_optionalChain([g, 'optionalAccess', _76 => _76.lines, 'access', _77 => _77.find, 'call', _78 => _78(C=>C.lineId===w.lineId)]);return _jsxruntime.jsxs.call(void 0, "li",{"data-bitsnap-returns-slot":"line",className:_chunk4HGZZJELjs.g.call(void 0, "flex flex-wrap items-baseline justify-between gap-2",b.className),style:b.style,children:[_jsxruntime.jsx.call(void 0, "span",{"data-bitsnap-returns-slot":"lineName",className:_chunk4HGZZJELjs.g.call(void 0, "font-medium",x.className),style:x.style,children:_nullishCoalesce(_optionalChain([h, 'optionalAccess', _79 => _79.name]), () => (w.lineId))}),_jsxruntime.jsxs.call(void 0, "span",{"data-bitsnap-returns-slot":"linePrice",className:_chunk4HGZZJELjs.g.call(void 0, "text-sm",v.className),style:v.style,children:[s("confirmationQuantity",{quantity:w.quantity}),h!=null&&` \xB7 ${ve(h.paidUnitMinor*BigInt(w.quantity),h.currency,o)}`]})]},w.lineId)})}),n!=null&&n!==""&&_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-1 text-sm",children:[_jsxruntime.jsx.call(void 0, "span",{className:"font-medium",children:s("confirmationNote")}),_jsxruntime.jsx.call(void 0, "span",{className:"whitespace-pre-wrap",children:n})]})]}),c.errorKey!=null&&_jsxruntime.jsx.call(void 0, H,{errorKey:c.errorKey}),_jsxruntime.jsxs.call(void 0, _chunkG4V2KWTVjs.q,{type:"submit",disabled:c.isPending||t.length===0,"data-bitsnap-returns-slot":"submitButton",className:_chunk4HGZZJELjs.g.call(void 0, ce,k.className),style:k.style,children:[c.isPending&&_jsxruntime.jsx.call(void 0, ye,{}),s("confirmationSubmit")]})]})})}function pa({returnId:e,onContinue:t,onOpenMyReturns:n,className:r}){D("ReturnsResult");let a=z(),{request:i,isLoading:s,errorKey:o,refetch:g}=_e(e),m=d("successState"),l=d("returnReference"),y=d("returnInstructions"),c=d("submitButton"),f=d("secondaryButton");return _jsxruntime.jsxs.call(void 0, "section",{className:_chunk4HGZZJELjs.g.call(void 0, "flex flex-col gap-5",r),children:[_jsxruntime.jsxs.call(void 0, "div",{role:"status","data-bitsnap-returns-slot":"successState",className:_chunk4HGZZJELjs.g.call(void 0, "flex flex-col gap-4 border p-5",m.className),style:m.style,children:[_jsxruntime.jsx.call(void 0, "h2",{className:"text-2xl font-semibold",children:a("successTitle")}),_jsxruntime.jsx.call(void 0, "p",{className:"text-sm",children:a("successDescription")}),s?_jsxruntime.jsx.call(void 0, le,{rows:2}):o!=null?_jsxruntime.jsx.call(void 0, H,{errorKey:o,onRetry:g}):i!=null&&_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-1",children:[_jsxruntime.jsx.call(void 0, "span",{className:"text-sm",children:a("successReference")}),_jsxruntime.jsx.call(void 0, "span",{"data-bitsnap-returns-slot":"returnReference",className:_chunk4HGZZJELjs.g.call(void 0, "text-lg font-semibold",l.className),style:l.style,children:i.reference})]}),i.returnInstructions!==""&&_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-1",children:[_jsxruntime.jsx.call(void 0, "span",{className:"text-sm font-medium",children:a("successInstructions")}),_jsxruntime.jsx.call(void 0, "p",{"data-bitsnap-returns-slot":"returnInstructions",className:_chunk4HGZZJELjs.g.call(void 0, "whitespace-pre-wrap border p-3 text-sm",y.className),style:y.style,children:i.returnInstructions})]})]})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-wrap gap-3",children:[_jsxruntime.jsx.call(void 0, _chunkG4V2KWTVjs.q,{type:"button","data-bitsnap-returns-slot":"submitButton",className:_chunk4HGZZJELjs.g.call(void 0, ce,c.className),style:c.style,onClick:t,children:a("successDone")}),n!=null&&_jsxruntime.jsx.call(void 0, _chunkG4V2KWTVjs.q,{type:"button",variant:"secondary","data-bitsnap-returns-slot":"secondaryButton",className:_chunk4HGZZJELjs.g.call(void 0, W,f.className),style:f.style,onClick:n,children:a("myReturnsLink")})]})]})}function Na({onSelectReturn:e,onBack:t,pageSize:n,className:r}){D("ReturnsMyReturnsList");let a=z(),i=Z(),s=ft(),o=rn({pageSize:n}),g=d("returnList"),m=d("returnCard"),l=d("returnReference"),y=d("secondaryButton");return _jsxruntime.jsx.call(void 0, te,{className:r,onBack:t,title:a("myReturnsTitle"),description:a("myReturnsDescription"),children:o.isLoading?_jsxruntime.jsx.call(void 0, le,{}):o.errorKey!=null?_jsxruntime.jsx.call(void 0, H,{errorKey:o.errorKey,onRetry:o.refetch}):o.returns.length===0?_jsxruntime.jsx.call(void 0, Ve,{children:a("myReturnsEmpty")}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "ul",{"data-bitsnap-returns-slot":"returnList",className:_chunk4HGZZJELjs.g.call(void 0, "flex flex-col gap-3",g.className),style:g.style,children:o.returns.map(c=>_jsxruntime.jsxs.call(void 0, "li",{"data-bitsnap-returns-slot":"returnCard",className:_chunk4HGZZJELjs.g.call(void 0, "flex flex-wrap items-center justify-between gap-3 border p-4",m.className),style:m.style,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-1",children:[_jsxruntime.jsx.call(void 0, "span",{"data-bitsnap-returns-slot":"returnReference",className:_chunk4HGZZJELjs.g.call(void 0, "font-medium",l.className),style:l.style,children:c.reference}),_jsxruntime.jsx.call(void 0, "span",{className:"text-sm",children:pe(c.createdAt,i)}),_jsxruntime.jsxs.call(void 0, "span",{className:"text-sm",children:[a("myReturnRefund"),": ",s(c.refundStatus)]})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center gap-3",children:[_jsxruntime.jsx.call(void 0, xe,{status:c.status}),_jsxruntime.jsx.call(void 0, _chunkG4V2KWTVjs.q,{type:"button",variant:"secondary",size:"sm","aria-label":`${a("myReturnOpen")}: ${c.reference}`,"data-bitsnap-returns-slot":"secondaryButton",className:_chunk4HGZZJELjs.g.call(void 0, W,y.className),style:y.style,onClick:()=>_optionalChain([e, 'optionalCall', _80 => _80(c.id)]),children:a("myReturnOpen")})]})]},c.id))}),_jsxruntime.jsx.call(void 0, We,{page:o.page,total:o.total,hasNext:o.hasNext,hasPrevious:o.hasPrevious,isFetching:o.isFetching,onNext:o.next,onPrevious:o.previous})]})})}function Ta({returnId:e,onBack:t,className:n}){D("ReturnsMyReturnDetail");let r=z(),a=Z(),i=ft(),{request:s,isLoading:o,errorKey:g,refetch:m}=_e(e),l=d("summary"),y=d("lineList"),c=d("line"),f=d("lineName"),b=d("returnInstructions"),x=d("history"),v=d("historyEntry");return _jsxruntime.jsx.call(void 0, te,{className:n,onBack:t,title:s!=null?r("myReturnTitle",{reference:s.reference}):r("myReturnDetailTitle"),children:o?_jsxruntime.jsx.call(void 0, le,{}):g!=null?_jsxruntime.jsx.call(void 0, H,{errorKey:g,onRetry:m}):s!=null&&_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-5",children:[_jsxruntime.jsxs.call(void 0, "div",{"data-bitsnap-returns-slot":"summary",className:_chunk4HGZZJELjs.g.call(void 0, "flex flex-col gap-2 border p-4 text-sm",l.className),style:l.style,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center justify-between gap-2",children:[_jsxruntime.jsx.call(void 0, xe,{status:s.status}),_jsxruntime.jsxs.call(void 0, "span",{children:[r("myReturnCreatedAt"),":"," ",pe(s.createdAt,a)]})]}),_jsxruntime.jsxs.call(void 0, "span",{children:[r("myReturnRefund"),": ",i(s.refundStatus),s.refundAmountMinor>BigInt(0)&&` \xB7 ${ve(s.refundAmountMinor,s.currency,a)}`]}),s.customerNote!==""&&_jsxruntime.jsxs.call(void 0, "span",{className:"whitespace-pre-wrap",children:[r("myReturnNote"),": ",s.customerNote]})]}),s.returnInstructions!==""&&_jsxruntime.jsx.call(void 0, "p",{"data-bitsnap-returns-slot":"returnInstructions",className:_chunk4HGZZJELjs.g.call(void 0, "whitespace-pre-wrap border p-3 text-sm",b.className),style:b.style,children:s.returnInstructions}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-2",children:[_jsxruntime.jsx.call(void 0, "h3",{className:"text-sm font-medium",children:r("myReturnLines")}),_jsxruntime.jsx.call(void 0, "ul",{"data-bitsnap-returns-slot":"lineList",className:_chunk4HGZZJELjs.g.call(void 0, "flex flex-col gap-3",y.className),style:y.style,children:s.lines.map(k=>_jsxruntime.jsxs.call(void 0, "li",{"data-bitsnap-returns-slot":"line",className:_chunk4HGZZJELjs.g.call(void 0, "flex flex-wrap items-baseline justify-between gap-2 border p-4",c.className),style:c.style,children:[_jsxruntime.jsx.call(void 0, "span",{"data-bitsnap-returns-slot":"lineName",className:_chunk4HGZZJELjs.g.call(void 0, "font-medium",f.className),style:f.style,children:k.name}),_jsxruntime.jsx.call(void 0, "span",{className:"text-sm",children:r("myReturnLineQuantities",{requested:k.requestedQuantity,approved:k.approvedQuantity,received:k.receivedQuantity})})]},k.lineId))})]}),s.history.length>0&&_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-2",children:[_jsxruntime.jsx.call(void 0, "h3",{className:"text-sm font-medium",children:r("myReturnHistory")}),_jsxruntime.jsx.call(void 0, "ul",{"data-bitsnap-returns-slot":"history",className:_chunk4HGZZJELjs.g.call(void 0, "flex flex-col gap-2",x.className),style:x.style,children:s.history.map(k=>_jsxruntime.jsxs.call(void 0, "li",{"data-bitsnap-returns-slot":"historyEntry",className:_chunk4HGZZJELjs.g.call(void 0, "flex flex-wrap items-center justify-between gap-2 text-sm",v.className),style:v.style,children:[_jsxruntime.jsx.call(void 0, xe,{status:k.status}),_jsxruntime.jsx.call(void 0, "span",{children:pe(k.createdAt,a)})]},k.id))})]})]})})}exports.a = Zt; exports.b = pr; exports.c = dt; exports.d = Te; exports.e = ye; exports.f = Ut; exports.g = xr; exports.h = eo; exports.i = ct; exports.j = ao; exports.k = fn; exports.l = Pr; exports.m = Ot; exports.n = $e; exports.o = d; exports.p = st; exports.q = Xt; exports.r = z; exports.s = Z; exports.t = D; exports.u = Xn; exports.v = ls; exports.w = Fe; exports.x = tn; exports.y = it; exports.z = nn; exports.A = rn; exports.B = _e; exports.C = le; exports.D = Ko; exports.E = _o; exports.F = la; exports.G = da; exports.H = ca; exports.I = pa; exports.J = Na; exports.K = Ta;
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkKOYBZORLjs = require('./chunk-KOYBZORL.js');var _chunk2FD2QP4Yjs = require('./chunk-2FD2QP4Y.js');var _chunkDOJICJCQjs = require('./chunk-DOJICJCQ.js');var _chunkD2ASWUXMjs = require('./chunk-D2ASWUXM.js');var _chunkQ337IQNAjs = require('./chunk-Q337IQNA.js');var Pr=["root","header","title","description","backButton","stepIndicator","error","emptyState","skeleton","emailForm","emailInput","codeForm","codeInput","resendButton","logoutButton","orderList","orderCard","orderReference","orderDate","orderTotal","pagination","lineList","line","lineName","linePrice","lineQuantityControl","quantityButton","quantityInput","lineIneligibleReason","noteInput","summary","submitButton","secondaryButton","successState","returnReference","returnInstructions","returnList","returnCard","statusBadge","history","historyEntry"],Tn={fontFamily:"--bitsnap-returns-font-family",fontSize:"--bitsnap-returns-font-size",background:"--bitsnap-returns-background",surface:"--bitsnap-returns-surface",foreground:"--bitsnap-returns-foreground",mutedForeground:"--bitsnap-returns-muted-foreground",border:"--bitsnap-returns-border",buttonBackground:"--bitsnap-returns-button-background",buttonForeground:"--bitsnap-returns-button-foreground",buttonHoverBackground:"--bitsnap-returns-button-hover-background",hoverSurface:"--bitsnap-returns-hover-surface",focusRing:"--bitsnap-returns-focus-ring",error:"--bitsnap-returns-error",success:"--bitsnap-returns-success",warning:"--bitsnap-returns-warning",badgeBackground:"--bitsnap-returns-badge-background",badgeForeground:"--bitsnap-returns-badge-foreground",inputBackground:"--bitsnap-returns-input-background",radius:"--bitsnap-returns-radius"},wn={light:{background:"#ffffff",surface:"#f9fafb",foreground:"#18181b",mutedForeground:"#71717a",border:"#e4e4e7",buttonBackground:"#18181b",buttonForeground:"#fafafa",buttonHoverBackground:"#000000",hoverSurface:"#f4f4f5",focusRing:"#71717a",error:"#dc2626",success:"#16a34a",warning:"#d97706",badgeBackground:"#f4f4f5",badgeForeground:"#3f3f46",inputBackground:"#ffffff",radius:"8px"},dark:{background:"#18181b",surface:"#27272a",foreground:"#fafafa",mutedForeground:"#a1a1aa",border:"#3f3f46",buttonBackground:"#fafafa",buttonForeground:"#18181b",buttonHoverBackground:"#e4e4e7",hoverSurface:"#3f3f46",focusRing:"#a1a1aa",error:"#f87171",success:"#4ade80",warning:"#fbbf24",badgeBackground:"#3f3f46",badgeForeground:"#e4e4e7",inputBackground:"#27272a",radius:"8px"}},En=[{token:"background",variable:"--background"},{token:"foreground",variable:"--foreground"},{token:"surface",variable:"--card"},{token:"foreground",variable:"--card-foreground"},{token:"surface",variable:"--popover"},{token:"foreground",variable:"--popover-foreground"},{token:"buttonBackground",variable:"--primary"},{token:"buttonForeground",variable:"--primary-foreground"},{token:"surface",variable:"--secondary"},{token:"foreground",variable:"--secondary-foreground"},{token:"hoverSurface",variable:"--accent"},{token:"foreground",variable:"--accent-foreground"},{token:"mutedForeground",variable:"--muted-foreground"},{token:"border",variable:"--border"},{token:"border",variable:"--input"},{token:"focusRing",variable:"--ring"},{token:"error",variable:"--destructive"},{token:"radius",variable:"--radius"}];function Ze(e){let t=_chunkKOYBZORLjs.a.call(void 0, e,{defaultTheme:"light",presets:wn,variables:Tn,shadcnVariables:En});return{theme:t.theme,tokens:t.tokens,elements:t.elements,boundaryClassName:t.theme,boundaryStyle:t.boundaryStyle}}function Pt(e,t){return _chunkKOYBZORLjs.b.call(void 0, e.elements,t)}var _react = require('react'); var an = _interopRequireWildcard(_react);var _jsxruntime = require('react/jsx-runtime');var At=_react.createContext.call(void 0, Ze());function Ot({appearance:e,children:t}){let n=_react.useMemo.call(void 0, ()=>Ze(e),[e]);return _jsxruntime.jsx.call(void 0, At.Provider,{value:n,children:t})}function $e(){return _react.useContext.call(void 0, At)}function d(e){let t=$e();return _nullishCoalesce(Pt(t,e), () => ({}))}function Bt(e){return e==="test"||e===1?1:0}var zt={title:["emailStepTitle"],email:["emailLabel"],sendCode:["emailSubmit"],code:["codeLabel"],verify:["codeSubmit"],orders:["ordersTitle"],submit:["confirmationSubmit"],note:["noteLabel"],history:["myReturnsTitle","myReturnsLink"]};function Mt(e){if(e==null)return;let t={};for(let[n,r]of Object.entries(zt)){let a=e[n];if(typeof a=="string")for(let i of r)t[i]=a}for(let n of Object.keys(e)){if(n in zt)continue;let r=e[n];typeof r=="string"&&(t[n]=r)}return t}function Dt(e,t){let n=_optionalChain([t, 'optionalAccess', _2 => _2.brandColor, 'optionalAccess', _3 => _3.trim, 'call', _4 => _4()]);return n==null||n===""?e:{...e,tokens:{..._chunk2FD2QP4Yjs.n.call(void 0, n),..._optionalChain([e, 'optionalAccess', _5 => _5.tokens])}}}function Ge(e,t){return typeof e=="object"&&e!=null?{pageSize:_nullishCoalesce(e.pageSize, () => (20)),explicitPageToken:void 0}:typeof e=="number"||t!==void 0?{pageSize:_nullishCoalesce(e, () => (20)),explicitPageToken:_nullishCoalesce(t, () => (""))}:{pageSize:20,explicitPageToken:void 0}}var An={en:{back:"Back",stepIndicator:"Step {current} of {total}",loading:"Loading",myReturnsLink:"My returns",emailStepTitle:"Return a product",emailStepDescription:"Enter the email address you used for the order. We will send you a verification code.",emailLabel:"Email address",emailPlaceholder:"name@example.com",emailSubmit:"Send code",codeStepTitle:"Enter the code",codeStepDescription:"We sent a verification code to {email}.",codeLabel:"Verification code",codeSubmit:"Verify",resend:"Send the code again",resendIn:"Send again in {seconds} s",resendSent:"We sent a new code.",codeSpamHint:"Can't see the email? Check your spam folder.",codeValidity:"The code is valid for 10 minutes.",codeIncomplete:"Enter all 6 digits of the code.",logout:"Sign out",ordersTitle:"Your orders",ordersDescription:"Choose the order that contains the product to return.",ordersEmpty:"There are no orders eligible for return.",orderTitle:"Order {reference}",orderReturnableLines:"Products available to return: {count}",orderSelect:"Choose",paginationPrevious:"Previous",paginationNext:"Next",paginationInfo:"Page {page}, {total} orders",orderDetailTitle:"Order {reference}",orderDetailDescription:"Select the products and quantities to return.",quantityLabel:"Quantity to return: {name}",quantityDecrease:"Decrease quantity: {name}",quantityIncrease:"Increase quantity: {name}",quantityOfAvailable:"of {available}",lineIneligibleFallback:"This product cannot be returned.",noteLabel:"Note (optional)",notePlaceholder:"Tell us why you are returning the product",selectionContinue:"Continue",selectionEmpty:"Select at least one item to return.",previousReturnsTitle:"Earlier returns for this order",confirmationTitle:"Confirm the return",confirmationDescription:"Check the products before you submit the request.",confirmationSummary:"Products to return",confirmationQuantity:"Quantity: {quantity}",confirmationNote:"Your note",confirmationSubmit:"Submit return request",successTitle:"Return request submitted",successDescription:"We received your request and will keep you posted.",successReference:"Request number",successInstructions:"What to do next",successDone:"Back to orders",myReturnsTitle:"My returns",myReturnsDescription:"Track the status of your return requests.",myReturnsEmpty:"You have not submitted any return requests yet.",myReturnOpen:"Details",myReturnDetailTitle:"Return details",myReturnTitle:"Return {reference}",myReturnCreatedAt:"Submitted",myReturnRefund:"Refund",myReturnLines:"Products",myReturnLineQuantities:"Requested: {requested}, approved: {approved}, received: {received}",myReturnNote:"Your note",myReturnHistory:"History",statusSubmitted:"Submitted",statusApproved:"Approved",statusRejected:"Rejected",statusAwaitingReceipt:"Awaiting the package",statusReceived:"Package received",statusCompleted:"Completed",statusCancelled:"Cancelled",statusRefunded:"Refunded",statusFallback:"In progress",refundStatusNotStarted:"Not started",refundStatusPending:"Refund in progress",refundStatusSucceeded:"Refunded",refundStatusFailed:"Refund failed",refundStatusFallback:"Unknown",errorGeneric:"Something went wrong. Please try again.",errorNetwork:"Cannot reach the server. Check your connection and try again.",errorInvalidEmail:"Enter a valid email address.",errorInvalidCode:"The code is invalid or has expired.",errorSessionExpired:"Your session has expired. Verify your email again.",errorOrderNotFound:"We could not find this order.",errorReturnNotFound:"We could not find this return request.",errorQuantityUnavailable:"The selected quantity is no longer available for return.",errorItemNotReturnable:"One of the selected products cannot be returned.",errorReturnsDisabled:"Returns are not available in this shop.",errorRateLimited:"Too many attempts. Please try again later.",errorIdempotencyConflict:"This request was already submitted with different contents. Reload and try again.",errorDeliveryFailed:"We could not send the code. Please try again.",errorRetry:"Try again"},pl:{back:"Wstecz",stepIndicator:"Krok {current} z {total}",loading:"\u0141adowanie",myReturnsLink:"Moje zwroty",emailStepTitle:"Zwr\xF3\u0107 produkt",emailStepDescription:"Podaj adres e-mail u\u017Cyty w zam\xF3wieniu. Wy\u015Blemy na niego kod weryfikacyjny.",emailLabel:"Adres e-mail",emailPlaceholder:"jan@example.com",emailSubmit:"Wy\u015Blij kod",codeStepTitle:"Wpisz kod",codeStepDescription:"Wys\u0142ali\u015Bmy kod weryfikacyjny na adres {email}.",codeLabel:"Kod weryfikacyjny",codeSubmit:"Zweryfikuj",resend:"Wy\u015Blij kod ponownie",resendIn:"Wy\u015Blij ponownie za {seconds} s",resendSent:"Wys\u0142ali\u015Bmy nowy kod.",codeSpamHint:"Nie widzisz e-maila? Sprawd\u017A folder spam.",codeValidity:"Kod jest wa\u017Cny 10 minut.",codeIncomplete:"Wpisz wszystkie 6 cyfr kodu.",logout:"Wyloguj si\u0119",ordersTitle:"Twoje zam\xF3wienia",ordersDescription:"Wybierz zam\xF3wienie z produktem do zwrotu.",ordersEmpty:"Brak zam\xF3wie\u0144, kt\xF3re mo\u017Cna zwr\xF3ci\u0107.",orderTitle:"Zam\xF3wienie {reference}",orderReturnableLines:"Produkty do zwrotu: {count}",orderSelect:"Wybierz",paginationPrevious:"Poprzednia",paginationNext:"Nast\u0119pna",paginationInfo:"Strona {page}, zam\xF3wie\u0144: {total}",orderDetailTitle:"Zam\xF3wienie {reference}",orderDetailDescription:"Wybierz produkty i ilo\u015Bci do zwrotu.",quantityLabel:"Ilo\u015B\u0107 do zwrotu: {name}",quantityDecrease:"Zmniejsz ilo\u015B\u0107: {name}",quantityIncrease:"Zwi\u0119ksz ilo\u015B\u0107: {name}",quantityOfAvailable:"z {available}",lineIneligibleFallback:"Ten produkt nie podlega zwrotowi.",noteLabel:"Uwagi (opcjonalnie)",notePlaceholder:"Napisz, dlaczego zwracasz produkt",selectionContinue:"Dalej",selectionEmpty:"Wybierz co najmniej jedn\u0105 sztuk\u0119 do zwrotu.",previousReturnsTitle:"Wcze\u015Bniejsze zwroty tego zam\xF3wienia",confirmationTitle:"Potwierd\u017A zwrot",confirmationDescription:"Sprawd\u017A produkty przed wys\u0142aniem zg\u0142oszenia.",confirmationSummary:"Produkty do zwrotu",confirmationQuantity:"Ilo\u015B\u0107: {quantity}",confirmationNote:"Twoje uwagi",confirmationSubmit:"Wy\u015Blij zg\u0142oszenie zwrotu",successTitle:"Zg\u0142oszenie zwrotu zosta\u0142o wys\u0142ane",successDescription:"Otrzymali\u015Bmy zg\u0142oszenie i b\u0119dziemy informowa\u0107 o jego statusie.",successReference:"Numer zg\u0142oszenia",successInstructions:"Co dalej",successDone:"Wr\xF3\u0107 do zam\xF3wie\u0144",myReturnsTitle:"Moje zwroty",myReturnsDescription:"Sprawd\u017A status swoich zg\u0142osze\u0144 zwrotu.",myReturnsEmpty:"Nie masz jeszcze \u017Cadnych zg\u0142osze\u0144 zwrotu.",myReturnOpen:"Szczeg\xF3\u0142y",myReturnDetailTitle:"Szczeg\xF3\u0142y zwrotu",myReturnTitle:"Zwrot {reference}",myReturnCreatedAt:"Zg\u0142oszono",myReturnRefund:"Zwrot \u015Brodk\xF3w",myReturnLines:"Produkty",myReturnLineQuantities:"Zg\u0142oszono: {requested}, zaakceptowano: {approved}, odebrano: {received}",myReturnNote:"Twoje uwagi",myReturnHistory:"Historia",statusSubmitted:"Zg\u0142oszony",statusApproved:"Zaakceptowany",statusRejected:"Odrzucony",statusAwaitingReceipt:"Oczekiwanie na paczk\u0119",statusReceived:"Paczka odebrana",statusCompleted:"Zako\u0144czony",statusCancelled:"Anulowany",statusRefunded:"\u015Arodki zwr\xF3cone",statusFallback:"W trakcie",refundStatusNotStarted:"Nie rozpocz\u0119to",refundStatusPending:"Zwrot \u015Brodk\xF3w w toku",refundStatusSucceeded:"\u015Arodki zwr\xF3cone",refundStatusFailed:"Zwrot \u015Brodk\xF3w nie powi\xF3d\u0142 si\u0119",refundStatusFallback:"Nieznany",errorGeneric:"Co\u015B posz\u0142o nie tak. Spr\xF3buj ponownie.",errorNetwork:"Brak po\u0142\u0105czenia z serwerem. Sprawd\u017A internet i spr\xF3buj ponownie.",errorInvalidEmail:"Podaj poprawny adres e-mail.",errorInvalidCode:"Kod jest nieprawid\u0142owy lub wygas\u0142.",errorSessionExpired:"Sesja wygas\u0142a. Zweryfikuj adres e-mail ponownie.",errorOrderNotFound:"Nie znaleziono tego zam\xF3wienia.",errorReturnNotFound:"Nie znaleziono tego zg\u0142oszenia zwrotu.",errorQuantityUnavailable:"Wybrana ilo\u015B\u0107 nie jest ju\u017C dost\u0119pna do zwrotu.",errorItemNotReturnable:"Jeden z wybranych produkt\xF3w nie podlega zwrotowi.",errorReturnsDisabled:"Zwroty nie s\u0105 dost\u0119pne w tym sklepie.",errorRateLimited:"Zbyt wiele pr\xF3b. Spr\xF3buj ponownie p\xF3\u017Aniej.",errorIdempotencyConflict:"To zg\u0142oszenie zosta\u0142o ju\u017C wys\u0142ane z inn\u0105 zawarto\u015Bci\u0105. Od\u015Bwie\u017C stron\u0119 i spr\xF3buj ponownie.",errorDeliveryFailed:"Nie uda\u0142o si\u0119 wys\u0142a\u0107 kodu. Spr\xF3buj ponownie.",errorRetry:"Spr\xF3buj ponownie"}};function Xe(e,t){return _chunkQ337IQNAjs.b.call(void 0, An,e,t)}function Ft(e,t){return e.replace(/\{(\w+)\}/g,(n,r)=>Object.prototype.hasOwnProperty.call(t,r)?String(t[r]):n)}var On={submitted:"statusSubmitted",approved:"statusApproved",rejected:"statusRejected",awaiting_receipt:"statusAwaitingReceipt",received:"statusReceived",completed:"statusCompleted",cancelled:"statusCancelled",refunded:"statusRefunded"},zn={not_started:"refundStatusNotStarted",pending:"refundStatusPending",succeeded:"refundStatusSucceeded",failed:"refundStatusFailed"};function Kt(e){return _nullishCoalesce(On[e], () => ("statusFallback"))}function _t(e){return _nullishCoalesce(zn[e], () => ("refundStatusFallback"))}var Je=_react.createContext.call(void 0, {locale:"pl-PL",texts:Xe("pl-PL")});function qt({texts:e,locale:t,children:n}){let r=_nullishCoalesce(t, () => (_chunkQ337IQNAjs.f.call(void 0, ))),a=_react.useMemo.call(void 0, ()=>({locale:r,texts:Xe(r,e)}),[r,e]);return _jsxruntime.jsx.call(void 0, Je.Provider,{value:a,children:n})}function z(){let{texts:e}=_react.useContext.call(void 0, Je);return _react.useCallback.call(void 0, (t,n)=>n==null?e[t]:Ft(e[t],n),[e])}function Z(){return _react.useContext.call(void 0, Je).locale}var _connect = require('@connectrpc/connect');var _connectquery = require('@connectrpc/connect-query');var _reactquery = require('@tanstack/react-query');function et(){try{return typeof window<"u"?window.sessionStorage:void 0}catch (e2){return}}function Ut(e,t,n){return`bitsnap-login-pending:${e}:${encodeURIComponent(_nullishCoalesce(n, () => ("")))}:${encodeURIComponent(_nullishCoalesce(t, () => ("")))}`}function Le(e,t){try{_optionalChain([et, 'call', _6 => _6(), 'optionalAccess', _7 => _7.setItem, 'call', _8 => _8(e,JSON.stringify(t))])}catch (e3){}}function me(e){try{_optionalChain([et, 'call', _9 => _9(), 'optionalAccess', _10 => _10.removeItem, 'call', _11 => _11(e)])}catch (e4){}}function Pe(e,t=Date.now()){let n=et();if(n!=null)try{let r=n.getItem(e);if(r==null)return;let a=JSON.parse(r);if(a!=null&&typeof a.email=="string"&&a.email!==""&&typeof a.sentAt=="number"&&typeof a.resendAt=="number"&&(a.challengeId==null||typeof a.challengeId=="string")&&t-a.sentAt<6e5)return{email:a.email,challengeId:a.challengeId,resendAt:a.resendAt,sentAt:a.sentAt};n.removeItem(e)}catch (e5){try{n.removeItem(e)}catch (e6){}}}var _wkt = require('@bufbuild/protobuf/wkt');var _n="bitsnap-returns-session:";function tt(e){return`${_n}${e}`}function Ae(){try{return typeof window<"u"?window.sessionStorage:void 0}catch (e7){return}}function Qt(e,t,n=Date.now()){if(e==null)return;let r=tt(t);try{let a=e.getItem(r);if(a==null)return;let i=JSON.parse(a);if(i!=null&&typeof i=="object"&&typeof i.token=="string"&&i.token.length>0&&typeof i.expiresAt=="number"&&i.expiresAt>n){let{token:s,expiresAt:o}=i;return{token:s,expiresAt:o}}e.removeItem(r)}catch (e8){try{e.removeItem(r)}catch (e9){}}}function Vt(e,t,n){try{_optionalChain([e, 'optionalAccess', _12 => _12.setItem, 'call', _13 => _13(tt(t),JSON.stringify(n))])}catch (e10){}}function nt(e,t){try{_optionalChain([e, 'optionalAccess', _14 => _14.removeItem, 'call', _15 => _15(tt(t))])}catch (e11){}}function Oe(e){return e==null?void 0:_wkt.timestampMs.call(void 0, e)}var Yt=_react.createContext.call(void 0, void 0);function D(e){let t=_react.useContext.call(void 0, Yt);if(t==null)throw new Error(`${e} must be rendered inside <ReturnsProvider>`);return t}function rt(){return _connectquery.createConnectQueryKey.call(void 0, {schema:_chunk2FD2QP4Yjs.d,cardinality:void 0})}var $n=2**31-1;function Gn({projectID:e,environment:t,transport:n,panelAccessToken:r,className:a,children:i}){let s=_reactquery.useQueryClient.call(void 0, ),{boundaryClassName:o,boundaryStyle:g}=$e(),m=d("root"),[l,y]=_react.useState.call(void 0, {status:"hydrating"}),[c,f]=_react.useState.call(void 0, ),[b,x]=_react.useState.call(void 0, ),[v,k]=_react.useState.call(void 0, ),S=Ut("returns",e),w=_react.useRef.call(void 0, void 0),h=_react.useCallback.call(void 0, N=>{if(x(N),N==null){me(S);return}k(N.email),Le(S,{email:N.email,challengeId:N.challengeId,resendAt:N.resendAvailableAt,sentAt:Date.now()})},[S]),C=_react.useCallback.call(void 0, ()=>{s.removeQueries({queryKey:rt()})},[s]),U=_react.useCallback.call(void 0, ()=>{nt(Ae(),e),h(void 0),y({status:"anonymous"}),C()},[e,C,h]),_=_react.useCallback.call(void 0, N=>{Vt(Ae(),e,N),f(void 0),h(void 0),y({status:"authenticated",token:N.token,expiresAt:N.expiresAt})},[e,h]);_react.useEffect.call(void 0, ()=>{let N=!1,Y=Ae();if(r==null||r===""){let O=w.current!=null;if(w.current=void 0,O){U();return}let j=Qt(Y,e),Q=j==null?Pe(S):void 0;_optionalChain([Q, 'optionalAccess', _16 => _16.challengeId])!=null&&(x({challengeId:Q.challengeId,email:Q.email,resendAvailableAt:Q.resendAt}),k(Q.email)),y(j!=null?{status:"authenticated",token:j.token,expiresAt:j.expiresAt}:{status:"anonymous"});return}return w.current=r,nt(Y,e),C(),f(void 0),y({status:"exchanging"}),_connect.createClient.call(void 0, _chunk2FD2QP4Yjs.d,n).exchangePanelSession({projectId:e,accessToken:r,environment:t}).then(O=>{if(N)return;let j=Oe(O.expiresAt);if(O.sessionToken===""||j==null)throw new Error("EMPTY_SESSION");_({token:O.sessionToken,expiresAt:j})}).catch(O=>{N||(f(O),y({status:"anonymous"}))}),()=>{N=!0}},[r,e,t,n]),_react.useEffect.call(void 0, ()=>{if(l.status!=="authenticated"||l.expiresAt==null)return;let N=l.expiresAt-Date.now();if(N<=0){U();return}let Y=setTimeout(U,Math.min(N,$n));return()=>clearTimeout(Y)},[l.status,l.expiresAt,U]);let J=_react.useMemo.call(void 0, ()=>({projectID:e,environment:t,status:l.status,token:l.token,exchangeError:c,challenge:b,setChallenge:h,lastEmail:v,authenticate:_,clearSession:U}),[e,t,l.status,l.token,c,b,h,v,_,U]);return _jsxruntime.jsx.call(void 0, Yt.Provider,{value:J,children:_jsxruntime.jsx.call(void 0, "div",{"data-bitsnap-returns":"root","data-bitsnap-returns-slot":"root",className:_chunkDOJICJCQjs.g.call(void 0, "bitsnap-react",o,a,m.className),style:{...g,...m.style},children:i})})}function Xn({projectID:e,host:t,environment:n,appearance:r,texts:a,theme:i,locale:s,panelAccessToken:o,className:g,analytics:m,children:l}){let y=_chunkD2ASWUXMjs.n.call(void 0, e,m,"returns"),c=_react.useContext.call(void 0, _reactquery.QueryClientContext),[f]=_react.useState.call(void 0, ()=>c==null?new (0, _reactquery.QueryClient)({defaultOptions:{queries:{staleTime:5e3}}}):void 0),b=_nullishCoalesce(t, () => (_chunk2FD2QP4Yjs.h.call(void 0, ))),x=_react.useMemo.call(void 0, ()=>_chunk2FD2QP4Yjs.i.call(void 0, b),[b]),v=_optionalChain([i, 'optionalAccess', _17 => _17.brandColor]),k=_react.useMemo.call(void 0, ()=>Dt(r,{brandColor:v}),[r,v]),S=_react.useMemo.call(void 0, ()=>Mt(a),[a]),w=_jsxruntime.jsx.call(void 0, _chunkD2ASWUXMjs.l,{value:y,children:_jsxruntime.jsx.call(void 0, _connectquery.TransportProvider,{transport:x,children:_jsxruntime.jsx.call(void 0, Ot,{appearance:k,children:_jsxruntime.jsx.call(void 0, qt,{texts:S,locale:s,children:_jsxruntime.jsx.call(void 0, Gn,{projectID:e,environment:Bt(n),transport:x,panelAccessToken:o,className:g,children:l})})})})});return c==null&&f!=null?_jsxruntime.jsx.call(void 0, _reactquery.QueryClientProvider,{client:f,children:w}):w}var ls=Xn;function Zt(e){let t=_connect.ConnectError.from(e);switch(t.code){case _connect.Code.ResourceExhausted:return"rateLimited";case _connect.Code.Unavailable:case _connect.Code.DeadlineExceeded:case _connect.Code.Canceled:return"network";case _connect.Code.Unknown:return e instanceof TypeError||t.cause instanceof TypeError?"network":"unknown";default:return"unknown"}}var nr="SESSION_EXPIRED",$t={INVALID_EMAIL:"errorInvalidEmail",INVALID_OR_EXPIRED_CODE:"errorInvalidCode",SESSION_EXPIRED:"errorSessionExpired",ORDER_NOT_FOUND:"errorOrderNotFound",RETURN_NOT_FOUND:"errorReturnNotFound",QUANTITY_UNAVAILABLE:"errorQuantityUnavailable",ITEM_NOT_RETURNABLE:"errorItemNotReturnable",INVALID_RETURN_ITEMS:"errorItemNotReturnable",RETURNS_DISABLED:"errorReturnsDisabled",SUBMISSION_RATE_LIMITED:"errorRateLimited",IDEMPOTENCY_CONFLICT:"errorIdempotencyConflict",VERIFICATION_DELIVERY_FAILED:"errorDeliveryFailed"};function Gt(e){if(e==null||typeof e!="object")return;let{rawMessage:t,message:n}=e;if(typeof t=="string"&&t.length>0)return t;if(typeof n=="string")return Object.keys($t).find(r=>n.includes(r))}function st(e){return Gt(e)===nr}function Xt(e){let t=Gt(e),n=t!=null?$t[t]:void 0;if(n!=null)return n;if(e!=null&&typeof e=="object"){if(_connect.ConnectError.from(e).code===_connect.Code.ResourceExhausted)return"errorRateLimited";if(Zt(e)==="network")return"errorNetwork"}return"errorGeneric"}function ot(){let e=typeof globalThis<"u"?globalThis.crypto:void 0;if(typeof _optionalChain([e, 'optionalAccess', _18 => _18.randomUUID])=="function")return e.randomUUID();let t=new Uint8Array(16);if(typeof _optionalChain([e, 'optionalAccess', _19 => _19.getRandomValues])=="function")e.getRandomValues(t);else for(let n=0;n<t.length;n++)t[n]=Math.floor(Math.random()*256);return Array.from(t,n=>n.toString(16).padStart(2,"0")).join("")}function fe(e){return e==null?null:e instanceof Error?e:new Error(String(e))}function ge(e){return e==null?void 0:Xt(e)}function De(e,t){_react.useEffect.call(void 0, ()=>{st(e)&&t()},[e,t])}function en(e){let[t,n]=_react.useState.call(void 0, [""]);return _react.useEffect.call(void 0, ()=>{n([""])},[e]),{pageToken:_nullishCoalesce(t[t.length-1], () => ("")),page:t.length,push:r=>n(a=>[...a,r]),pop:()=>n(r=>r.length>1?r.slice(0,-1):r)}}function Fe(){let e=D("useReturnSession"),t=_connectquery.useMutation.call(void 0, _chunk2FD2QP4Yjs.e.returns.startReturnSession),n=_connectquery.useMutation.call(void 0, _chunk2FD2QP4Yjs.e.returns.verifyReturnSession),{setChallenge:r,authenticate:a,clearSession:i}=e,s=Z().toLowerCase().startsWith("en")?"en":"pl",o=_react.useCallback.call(void 0, async f=>{n.reset();let b=f.trim(),x=await t.mutateAsync({projectId:e.projectID,email:b,environment:e.environment,locale:s});return r({challengeId:x.challengeId,email:b,resendAvailableAt:Date.now()+Math.max(0,x.resendAfterSeconds)*1e3}),x},[e.projectID,e.environment,s,r,t,n]),g=_react.useCallback.call(void 0, async f=>{let b=await n.mutateAsync({projectId:e.projectID,challengeId:f.challengeId,code:f.code,environment:e.environment}),x=Oe(b.expiresAt);if(b.sessionToken===""||x==null)throw new Error("EMPTY_SESSION");return a({token:b.sessionToken,expiresAt:x}),b},[e.projectID,e.environment,a,n]),m=_react.useCallback.call(void 0, async f=>{try{return await o(f),!0}catch (e12){return!1}},[o]),l=_react.useCallback.call(void 0, async f=>{if(e.challenge==null)return!1;try{return await g({challengeId:e.challenge.challengeId,code:f.trim()}),!0}catch (e13){return!1}},[e.challenge,g]),y=_react.useCallback.call(void 0, ()=>e.challenge!=null?m(e.challenge.email):Promise.resolve(!1),[e.challenge,m]),c=fe(_nullishCoalesce(_nullishCoalesce(t.error, () => (n.error)), () => (e.exchangeError)));return{status:e.status,isAuthenticated:e.status==="authenticated",challenge:e.challenge,isStarting:t.isPending,isVerifying:n.isPending,starting:t.isPending,verifying:n.isPending,error:c,errorKey:ge(c),start:m,startSession:o,verifySession:g,verify:l,resend:y,logout:i}}function Ke(e){return e.status==="hydrating"||e.status==="exchanging"}function tn(e,t){let n=D("useReturnOrders"),{pageSize:r,explicitPageToken:a}=Ge(e,t),i=en(n.token),s=_connectquery.useQuery.call(void 0, _chunk2FD2QP4Yjs.e.returns.listReturnOrders,{projectId:n.projectID,sessionToken:_nullishCoalesce(n.token, () => ("")),pageSize:r,pageToken:_nullishCoalesce(a, () => (i.pageToken))},{enabled:n.token!=null});De(s.error,n.clearSession);let o=_nullishCoalesce(_optionalChain([s, 'access', _20 => _20.data, 'optionalAccess', _21 => _21.nextPageToken]), () => (""));return{orders:_nullishCoalesce(_optionalChain([s, 'access', _22 => _22.data, 'optionalAccess', _23 => _23.orders]), () => ([])),total:_nullishCoalesce(_optionalChain([s, 'access', _24 => _24.data, 'optionalAccess', _25 => _25.total]), () => (0)),data:s.data,isLoading:Ke(n)||s.isLoading,isFetching:s.isFetching,error:fe(s.error),errorKey:ge(s.error),status:s.status,isError:s.isError,isSuccess:s.isSuccess,page:i.page,hasNext:o!=="",hasPrevious:i.page>1,next:()=>{o!==""&&i.push(o)},previous:i.pop,refetch:()=>s.refetch()}}function it(e){let t=D("useReturnableOrder"),n=_connectquery.useQuery.call(void 0, _chunk2FD2QP4Yjs.e.returns.getReturnableOrder,{projectId:t.projectID,sessionToken:_nullishCoalesce(t.token, () => ("")),canonicalOrderId:_nullishCoalesce(e, () => (""))},{enabled:t.token!=null&&e!=null&&e!==""});return De(n.error,t.clearSession),{order:_optionalChain([n, 'access', _26 => _26.data, 'optionalAccess', _27 => _27.order]),returnHistory:_nullishCoalesce(_optionalChain([n, 'access', _28 => _28.data, 'optionalAccess', _29 => _29.returnHistory]), () => ([])),data:n.data,isLoading:e!=null&&e!==""&&(Ke(t)||n.isLoading),error:fe(n.error),errorKey:ge(n.error),status:n.status,isError:n.isError,isSuccess:n.isSuccess,refetch:()=>n.refetch()}}function nn(){let e=D("useCreateReturn"),t=_reactquery.useQueryClient.call(void 0, ),n=_connectquery.useMutation.call(void 0, _chunk2FD2QP4Yjs.e.returns.createReturnRequest),r=_chunkD2ASWUXMjs.m.call(void 0, ),a=_react.useRef.call(void 0, void 0),{clearSession:i}=e,s=_react.useCallback.call(void 0, async(l,y)=>{try{let c=await n.mutateAsync({projectId:e.projectID,sessionToken:_nullishCoalesce(e.token, () => ("")),canonicalOrderId:l.orderId,items:l.items,note:_nullishCoalesce(l.note, () => ("")),idempotencyKey:y});return t.invalidateQueries({queryKey:rt()}),r.track("return_submitted",{reason_code:"unspecified",item_count:l.items.length},{order_ref:null}),c}catch(c){throw st(c)&&i(),c}},[e.projectID,e.token,n,t,i,r]),o=_react.useCallback.call(void 0, async l=>{a.current??=ot();try{let y=await s(l,a.current);return a.current=void 0,y.request}catch (e14){return}},[s]),g=_react.useCallback.call(void 0, async l=>{if(e.token==null)throw new Error("Verify your email to continue.");return s({orderId:l.canonicalOrderID,items:l.items,note:l.note},_nullishCoalesce(l.idempotencyKey, () => (ot())))},[e.token,s]),m=_react.useCallback.call(void 0, (l,y)=>{g(l).then(c=>_optionalChain([y, 'optionalAccess', _30 => _30.onSuccess, 'optionalCall', _31 => _31(c)]),c=>_optionalChain([y, 'optionalAccess', _32 => _32.onError, 'optionalCall', _33 => _33(fe(c))]))},[g]);return{submit:o,isPending:n.isPending,error:fe(n.error),errorKey:ge(n.error),mutateAsync:g,mutate:m,data:n.data,reset:n.reset,status:n.status,isError:n.isError,isSuccess:n.isSuccess}}function rn(e,t){let n=D("useMyReturns"),{pageSize:r,explicitPageToken:a}=Ge(e,t),i=en(n.token),s=_connectquery.useQuery.call(void 0, _chunk2FD2QP4Yjs.e.returns.listMyReturns,{projectId:n.projectID,sessionToken:_nullishCoalesce(n.token, () => ("")),pageSize:r,pageToken:_nullishCoalesce(a, () => (i.pageToken))},{enabled:n.token!=null});De(s.error,n.clearSession);let o=_nullishCoalesce(_optionalChain([s, 'access', _34 => _34.data, 'optionalAccess', _35 => _35.nextPageToken]), () => (""));return{returns:_nullishCoalesce(_optionalChain([s, 'access', _36 => _36.data, 'optionalAccess', _37 => _37.returns]), () => ([])),total:_nullishCoalesce(_optionalChain([s, 'access', _38 => _38.data, 'optionalAccess', _39 => _39.total]), () => (0)),data:s.data,isLoading:Ke(n)||s.isLoading,isFetching:s.isFetching,error:fe(s.error),errorKey:ge(s.error),status:s.status,isError:s.isError,isSuccess:s.isSuccess,page:i.page,hasNext:o!=="",hasPrevious:i.page>1,next:()=>{o!==""&&i.push(o)},previous:i.pop,refetch:()=>s.refetch()}}function _e(e){let t=D("useMyReturn"),n=_connectquery.useQuery.call(void 0, _chunk2FD2QP4Yjs.e.returns.getMyReturn,{projectId:t.projectID,sessionToken:_nullishCoalesce(t.token, () => ("")),returnId:e},{enabled:t.token!=null});return De(n.error,t.clearSession),{request:_optionalChain([n, 'access', _40 => _40.data, 'optionalAccess', _41 => _41.request]),isLoading:Ke(t)||n.isLoading,error:n.error,errorKey:ge(n.error),refetch:()=>n.refetch()}}var _reactlabel = require('@radix-ui/react-label'); var sn = _interopRequireWildcard(_reactlabel);function Te({className:e,...t}){return _jsxruntime.jsx.call(void 0, sn.Root,{"data-slot":"label",className:_chunkDOJICJCQjs.g.call(void 0, "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}var _lucidereact = require('lucide-react');function ye({className:e,...t}){return _jsxruntime.jsx.call(void 0, _lucidereact.Loader2Icon,{role:"status","aria-label":"Loading",className:_chunkDOJICJCQjs.g.call(void 0, "size-4 animate-spin",e),...t})}var dr={pl:{alt:"Logo sklepu"},en:{alt:"Shop logo"}},ut="flex h-10 items-center",lt="block max-h-10 max-w-48 w-auto object-contain";function cr(){return _jsxruntime.jsxs.call(void 0, "span",{role:"img","aria-label":"Bitsnap",className:"inline-flex items-center gap-1.5",children:[_jsxruntime.jsx.call(void 0, "svg",{"aria-hidden":"true",width:"29",height:"27",viewBox:"0 0 33 30",fill:"none",stroke:"currentColor",strokeWidth:"3.04",strokeLinecap:"round",children:_jsxruntime.jsx.call(void 0, "path",{d:"M20.2 1.8h0M22.8 6.2h0M22.8 10.6h0M22.8 15h0M22.8 19.4h0M22.8 23.8h0M20.2 28.2h0M27.1 10.6h0M27.1 15h0M27.1 19.4h0M31.5 15h0M1.5 1.8h0M5.4 1.8h0M9.3 1.8h0M13.2 1.8h0M5.4 15h0M9.3 15h0M13.2 15h0M5.4 28.2h0M9.3 28.2h0M13.2 28.2h0M1.5 6.2h0M1.5 10.6h0M1.5 15h0M1.5 19.4h0M1.5 23.8h0M1.5 28.2h0M16.7 19.4h0M16.7 23.8h0M16.7 6.2h0M16.7 10.6h0"})}),_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":"true",className:"text-xl tracking-wider",children:"bitsnap."})]})}function pr(e,t){return _chunk2FD2QP4Yjs.f.call(void 0, _chunk2FD2QP4Yjs.b,{projectId:e},{enabled:t,staleTime:1/0,retry:!1,refetchOnWindowFocus:!1})}function dt({projectId:e,name:t,locale:n,showLogo:r=!0,logoUrl:a,logoDarkUrl:i,className:s}){let[o,g]=_react.useState.call(void 0, []),m=a||i,l=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _42 => _42.trim, 'call', _43 => _43()]), () => ("")),{data:y,isPending:c}=pr(l,r&&!m&&l!=="");if(!r)return null;if(!m&&l!==""&&c)return _jsxruntime.jsx.call(void 0, "div",{className:_chunkDOJICJCQjs.g.call(void 0, ut,s),"aria-hidden":"true"});let f=(m?a||i:_optionalChain([y, 'optionalAccess', _44 => _44.logoUrl])||_optionalChain([y, 'optionalAccess', _45 => _45.logoDarkUrl]))||"",b=(m?i||a:_optionalChain([y, 'optionalAccess', _46 => _46.logoDarkUrl])||_optionalChain([y, 'optionalAccess', _47 => _47.logoUrl]))||"",x=h=>h!==""&&!o.includes(h),v=x(f)?f:x(b)?b:"",k=x(b)?b:x(f)?f:"";if(v===""&&k==="")return _jsxruntime.jsx.call(void 0, "div",{className:_chunkDOJICJCQjs.g.call(void 0, ut,s),children:_jsxruntime.jsx.call(void 0, cr,{})});let S=t||_optionalChain([y, 'optionalAccess', _48 => _48.name])||_chunkQ337IQNAjs.a.call(void 0, dr,_nullishCoalesce(n, () => (_chunkQ337IQNAjs.f.call(void 0, )))).alt,w=h=>()=>g(C=>C.includes(h)?C:[...C,h]);return _jsxruntime.jsx.call(void 0, "div",{className:_chunkDOJICJCQjs.g.call(void 0, ut,s),children:v===k?_jsxruntime.jsx.call(void 0, "img",{src:v,alt:S,className:lt,draggable:!1,onError:w(v)}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "img",{src:v,alt:S,className:_chunkDOJICJCQjs.g.call(void 0, lt,"dark:hidden"),draggable:!1,onError:w(v)}),_jsxruntime.jsx.call(void 0, "img",{src:k,alt:S,className:_chunkDOJICJCQjs.g.call(void 0, lt,"hidden dark:block"),draggable:!1,onError:w(k)})]})})}var _inputotp = require('input-otp');function un({className:e,containerClassName:t,...n}){return _jsxruntime.jsx.call(void 0, _inputotp.OTPInput,{"data-slot":"input-otp",containerClassName:_chunkDOJICJCQjs.g.call(void 0, "flex items-center gap-2 has-disabled:opacity-50",t),className:_chunkDOJICJCQjs.g.call(void 0, "disabled:cursor-not-allowed",e),...n})}function ln({className:e,...t}){return _jsxruntime.jsx.call(void 0, "div",{"data-slot":"input-otp-group",className:_chunkDOJICJCQjs.g.call(void 0, "flex items-center",e),...t})}function dn({index:e,className:t,...n}){let r=an.useContext(_inputotp.OTPInputContext),{char:a,hasFakeCaret:i,isActive:s}=_nullishCoalesce(_optionalChain([r, 'optionalAccess', _49 => _49.slots, 'access', _50 => _50[e]]), () => ({}));return _jsxruntime.jsxs.call(void 0, "div",{"data-slot":"input-otp-slot","data-active":s,className:_chunkDOJICJCQjs.g.call(void 0, "data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",t),...n,children:[a,i&&_jsxruntime.jsx.call(void 0, "div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:_jsxruntime.jsx.call(void 0, "div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function qe(e){let[,t]=_react.useState.call(void 0, 0);return _react.useEffect.call(void 0, ()=>{if(e==null||Date.now()>=e)return;let n=setInterval(()=>{t(r=>r+1),Date.now()>=e&&clearInterval(n)},1e3);return()=>clearInterval(n)},[e]),e!=null?Math.max(0,Math.ceil((e-Date.now())/1e3)):0}var xr={pl:{emailLabel:"E-mail",emailPlaceholder:"m@example.com",sendCode:"Wy\u015Blij kod",sending:"Wysy\u0142anie\u2026",invalidEmail:"Podaj poprawny adres e-mail.",codeSentTo:"Wys\u0142ali\u015Bmy kod na {email}.",changeEmail:"Zmie\u0144",codeLabel:"Kod z e-maila",verify:"Zaloguj si\u0119",verifying:"Sprawdzanie\u2026",codeIncomplete:"Wpisz wszystkie 6 cyfr kodu.",spamHint:"Nie widzisz e-maila? Sprawd\u017A folder spam.",validity:"Kod jest wa\u017Cny 10 minut.",resend:"Wy\u015Blij ponownie",resendIn:"Wy\u015Blij ponownie za {seconds}\xA0s",resendNew:"Wy\u015Blij nowy kod",resent:"Wys\u0142ali\u015Bmy nowy kod.",haveCodePrompt:"Masz ju\u017C kod?",haveCode:"Mam ju\u017C kod",noCode:"Nie masz kodu? Wy\u015Blij go",stepEmail:"Krok 1 z 2: podaj adres e-mail.",stepCode:"Krok 2 z 2: wpisz kod z e-maila.",wrongCode:"Nieprawid\u0142owy kod. Spr\xF3buj jeszcze raz.",expired:"Kod wygas\u0142. Wy\u015Blij nowy kod.",tooManyAttempts:"Zbyt wiele b\u0142\u0119dnych pr\xF3b. Wy\u015Blij nowy kod albo zmie\u0144 adres e-mail.",rateLimited:"Zbyt wiele pr\xF3b. Spr\xF3buj ponownie za {time}.",alreadySent:"Kod zosta\u0142 ju\u017C wys\u0142any. Nowy mo\u017Cesz poprosi\u0107 za {time}.",emailNotFound:"Nie znale\u017Ali\u015Bmy konta z tym adresem e-mail.",deliveryFailed:"Nie uda\u0142o si\u0119 wys\u0142a\u0107 kodu. Spr\xF3buj ponownie.",deliveryUnavailable:"Nie mo\u017Cemy teraz wys\u0142a\u0107 kodu na ten adres. Spr\xF3buj p\xF3\u017Aniej.",network:"Brak po\u0142\u0105czenia z serwerem. Sprawd\u017A internet i spr\xF3buj ponownie.",generic:"Co\u015B posz\u0142o nie tak. Spr\xF3buj ponownie."},en:{emailLabel:"Email",emailPlaceholder:"m@example.com",sendCode:"Send code",sending:"Sending\u2026",invalidEmail:"Enter a valid email address.",codeSentTo:"We sent a code to {email}.",changeEmail:"Change",codeLabel:"Code from the email",verify:"Sign in",verifying:"Checking\u2026",codeIncomplete:"Enter all 6 digits of the code.",spamHint:"Can't see the email? Check your spam folder.",validity:"The code is valid for 10 minutes.",resend:"Resend",resendIn:"Resend in {seconds}s",resendNew:"Send a new code",resent:"We sent a new code.",haveCodePrompt:"Already have a code?",haveCode:"I have a code",noCode:"No code yet? Send one",stepEmail:"Step 1 of 2: enter your email address.",stepCode:"Step 2 of 2: enter the code from the email.",wrongCode:"Incorrect code. Please try again.",expired:"The code has expired. Send a new one.",tooManyAttempts:"Too many wrong attempts. Send a new code or change the email address.",rateLimited:"Too many attempts. Try again in {time}.",alreadySent:"A code was already sent. You can ask for a new one in {time}.",emailNotFound:"We could not find an account with this email address.",deliveryFailed:"We could not send the code. Please try again.",deliveryUnavailable:"We cannot send a code to this address right now. Try again later.",network:"Cannot reach the server. Check your connection and try again.",generic:"Something went wrong. Please try again."}};function eo(e,...t){let n={..._chunkQ337IQNAjs.a.call(void 0, xr,e)};for(let r of t)if(r!=null)for(let[a,i]of Object.entries(r))i!=null&&(n[a]=i);return n}function cn(e){let t=Math.max(1,Math.ceil(e));return t<=60?`${t}\xA0s`:`${Math.ceil(t/60)}\xA0min`}function ct(e,t){return e.replace(/\{(\w+)\}/g,(n,r)=>Object.prototype.hasOwnProperty.call(t,r)?String(t[r]):n)}var de=6,mn=60,vr=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;function pn(e){return vr.test(e.trim())}function pt(e,t,n){return{...Sr(e,t,n),failure:t}}function Sr(e,t,n){let r=cn(_nullishCoalesce(n, () => (mn)));switch(t){case"invalidEmail":return{kind:"error",text:e.invalidEmail};case"emailNotFound":return{kind:"error",text:e.emailNotFound};case"wrongCode":return{kind:"error",text:e.wrongCode};case"expired":return{kind:"error",text:e.expired};case"tooManyAttempts":return{kind:"error",text:e.tooManyAttempts};case"rateLimited":return{kind:"error",text:ct(e.rateLimited,{time:r})};case"alreadySent":return{kind:"info",text:ct(e.alreadySent,{time:r})};case"deliveryFailed":return{kind:"error",text:e.deliveryFailed};case"deliveryUnavailable":return{kind:"error",text:e.deliveryUnavailable};case"network":return{kind:"error",text:e.network};default:return{kind:"error",text:e.generic}}}function ao(e){let{storageKey:t}=e,n=_react.useRef.call(void 0, e);n.current=e;let[r,a]=_react.useState.call(void 0, "email"),[i,s]=_react.useState.call(void 0, _nullishCoalesce(e.initialEmail, () => (""))),[o,g]=_react.useState.call(void 0, ""),[m,l]=_react.useState.call(void 0, ),[y,c]=_react.useState.call(void 0, ),[f,b]=_react.useState.call(void 0, !1),[x,v]=_react.useState.call(void 0, ),[k,S]=_react.useState.call(void 0, ),[w,h]=_react.useState.call(void 0, ),[C,U]=_react.useState.call(void 0, !1),[_,J]=_react.useState.call(void 0, ""),[N,Y]=_react.useState.call(void 0, 0),O=_react.useRef.call(void 0, !1),j=_react.useRef.call(void 0, "email"),Q=_react.useRef.call(void 0, null),F=_react.useRef.call(void 0, null),re=_react.useRef.call(void 0, "email"),Se=qe(y),B=_react.useCallback.call(void 0, T=>{j.current=T,Y(A=>A+1)},[]);_react.useEffect.call(void 0, ()=>{N!==0&&_optionalChain([(j.current==="email"?Q:F), 'access', _51 => _51.current, 'optionalAccess', _52 => _52.focus, 'call', _53 => _53()])},[N]),_react.useEffect.call(void 0, ()=>{if(a("email"),g(""),l(void 0),c(void 0),b(!1),v(void 0),S(void 0),t==null)return;let T=Pe(t);T!=null&&(s(T.email),l(T.challengeId),c(T.resendAt>Date.now()?T.resendAt:void 0),a("code"))},[t]),_react.useEffect.call(void 0, ()=>{re.current!==r&&(re.current=r,J(r==="code"?n.current.texts.stepCode:n.current.texts.stepEmail))},[r]),_react.useEffect.call(void 0, ()=>{r==="code"&&N===0&&B(f?"email":"code")},[r]);let R=_react.useCallback.call(void 0, (T,A,L,M)=>{T!=="wrongCode"&&T!=="invalidEmail"&&T!=="alreadySent"&&_optionalChain([n, 'access', _54 => _54.current, 'access', _55 => _55.onFailure, 'optionalCall', _56 => _56(T,L)]);let se=pt(n.current.texts,T,A);return M!=null?{...se,text:M}:se},[]),X=_react.useCallback.call(void 0, (T,A,L,M)=>{let se=Date.now(),bt=se+(_nullishCoalesce(L, () => (mn)))*1e3;s(T),a("code"),b(!1),l(A),c(bt),g(""),v(void 0),S(M),t!=null&&Le(t,{email:T,challengeId:A,resendAt:bt,sentAt:se}),B("code")},[t,B]),V=_react.useCallback.call(void 0, async T=>{if(O.current)return;let A=i.trim();if(!pn(A)){S(pt(n.current.texts,"invalidEmail")),B("email");return}O.current=!0,h(T),S(void 0);let L;try{L=await n.current.adapter.send(A,{resend:T==="resend"})}catch(se){L={ok:!1,kind:"network",cause:se}}if(O.current=!1,h(void 0),L.ok){X(A,L.challengeId,L.retryIn,T==="resend"?{kind:"success",text:n.current.texts.resent}:void 0);return}let M=R(L.kind,L.retryIn,L.cause,L.message);if(L.kind==="alreadySent"&&T==="send"){X(A,void 0,L.retryIn,M);return}L.retryIn!=null&&T==="resend"&&c(Date.now()+L.retryIn*1e3),S(M),T==="send"&&B("email")},[i,X,R,B]),he=_react.useCallback.call(void 0, async T=>{let A=_nullishCoalesce(T, () => (o));if(O.current||C||x!=null)return;let L=i.trim();if(f&&!pn(L)){S(pt(n.current.texts,"invalidEmail")),B("email");return}if(A.length!==de){S({kind:"error",text:n.current.texts.codeIncomplete}),B("code");return}O.current=!0,h("verify"),S(void 0);let M;try{M=await n.current.adapter.verify({email:L,code:A,challengeId:m})}catch(se){M={ok:!1,kind:"network",cause:se}}if(O.current=!1,h(void 0),M.ok){t!=null&&me(t),U(!0),_optionalChain([n, 'access', _57 => _57.current, 'access', _58 => _58.onVerified, 'optionalCall', _59 => _59(M.value,L)]);return}switch(S(R(M.kind,M.retryIn,M.cause,M.message)),M.kind){case"expired":case"tooManyAttempts":v(M.kind),g(""),t!=null&&me(t);break;case"invalidEmail":case"emailNotFound":B(f?"email":"code");break;case"network":case"unknown":case"deliveryFailed":case"deliveryUnavailable":B("code");break;default:g(""),B("code")}},[o,m,x,C,i,R,f,B,t]),He=_react.useCallback.call(void 0, T=>{s(T),S(A=>_optionalChain([A, 'optionalAccess', _60 => _60.kind])==="error"?void 0:A)},[]),hn=_react.useCallback.call(void 0, T=>{g(T.replace(/\D/g,"").slice(0,de)),S(A=>_optionalChain([A, 'optionalAccess', _61 => _61.kind])==="error"?void 0:A)},[]),kn=_react.useCallback.call(void 0, ()=>{a("email"),b(!1),g(""),l(void 0),c(void 0),v(void 0),S(void 0),t!=null&&me(t),B("email")},[t,B]),Nn=_react.useCallback.call(void 0, ()=>{a("code"),b(!0),g(""),l(void 0),c(void 0),v(void 0),S(void 0),B("email")},[B]);return{step:r,email:i,setEmail:He,code:o,setCode:hn,needsEmail:f,busy:w,isBusy:w!=null||C,done:C,notice:k,dead:x,secondsLeft:Se,announcement:_,emailRef:Q,codeRef:F,sendCode:()=>V("send"),resend:()=>V("resend"),submitCode:he,changeEmail:kn,haveCode:Nn}}function Nr(e){return e.replace(/[\s-]/g,"")}function Tr(e){e!=null&&(e.style.boxSizing="border-box",e.style.padding="0")}function fn({id:e,name:t,value:n,onChange:r,onComplete:a,disabled:i,invalid:s,inputRef:o,autoFocus:g,slotClassName:m,slotStyle:l,className:y,...c}){let f=_react.useCallback.call(void 0, x=>{Tr(x),typeof o=="function"?o(x):o!=null&&(o.current=x)},[o]),b={className:_chunkDOJICJCQjs.g.call(void 0, "h-11 w-auto min-w-0 flex-1 rounded-md border first:rounded-md last:rounded-md text-base","dark:border-foreground/30 dark:data-[active=true]:border-foreground/70 dark:data-[active=true]:ring-foreground/25","dark:aria-invalid:border-destructive-foreground dark:data-[active=true]:aria-invalid:border-destructive-foreground dark:aria-invalid:ring-destructive-foreground/30 dark:data-[active=true]:aria-invalid:ring-destructive-foreground/30",m),style:l,"aria-invalid":s?!0:void 0};return _jsxruntime.jsx.call(void 0, un,{ref:f,id:e,name:t,maxLength:de,value:n,onChange:r,onComplete:a,disabled:i,autoFocus:g,inputMode:"numeric",autoComplete:"one-time-code",pattern:_inputotp.REGEXP_ONLY_DIGITS,pasteTransformer:Nr,"aria-invalid":s?!0:void 0,"aria-label":c["aria-label"],"aria-describedby":c["aria-describedby"],containerClassName:_chunkDOJICJCQjs.g.call(void 0, "w-full",y),children:_jsxruntime.jsx.call(void 0, ln,{className:"w-full gap-1.5 sm:gap-2",children:Array.from({length:de},(x,v)=>_jsxruntime.jsx.call(void 0, dn,{index:v,...b},v))})})}var ce="bg-[var(--bitsnap-returns-button-background,#18181b)] text-[color:var(--bitsnap-returns-button-foreground,#fafafa)] hover:bg-[var(--bitsnap-returns-button-hover-background,#000000)] focus-visible:ring-[color:var(--bitsnap-returns-focus-ring,#71717a)]/50",W="border border-[color:var(--bitsnap-returns-border,#e4e4e7)] bg-transparent text-[color:var(--bitsnap-returns-foreground,#18181b)] hover:bg-[var(--bitsnap-returns-hover-surface,#f4f4f5)] focus-visible:ring-[color:var(--bitsnap-returns-focus-ring,#71717a)]/50",Re="bg-[var(--bitsnap-returns-input-background,#ffffff)] dark:bg-[var(--bitsnap-returns-input-background,#ffffff)] border-[color:var(--bitsnap-returns-border,#e4e4e7)] text-[color:var(--bitsnap-returns-foreground,#18181b)] placeholder:text-[color:var(--bitsnap-returns-muted-foreground,#71717a)] focus-visible:border-[color:var(--bitsnap-returns-focus-ring,#71717a)] focus-visible:ring-[color:var(--bitsnap-returns-focus-ring,#71717a)]/50",gn=_chunkDOJICJCQjs.g.call(void 0, Re,"data-[active=true]:border-[color:var(--bitsnap-returns-focus-ring,#71717a)] data-[active=true]:ring-[color:var(--bitsnap-returns-focus-ring,#71717a)]/50");function te({title:e,description:t,onBack:n,lead:r,className:a,children:i}){let s=z(),o=d("header"),g=d("title"),m=d("description"),l=d("backButton");return _jsxruntime.jsxs.call(void 0, "section",{className:_chunkDOJICJCQjs.g.call(void 0, "flex flex-col gap-5",a),children:[r,_jsxruntime.jsxs.call(void 0, "div",{"data-bitsnap-returns-slot":"header",className:_chunkDOJICJCQjs.g.call(void 0, "flex flex-col gap-2",o.className),style:o.style,children:[n!=null&&_jsxruntime.jsx.call(void 0, _chunk2FD2QP4Yjs.k,{type:"button",variant:"ghost",size:"sm","data-bitsnap-returns-slot":"backButton",className:_chunkDOJICJCQjs.g.call(void 0, "self-start -ml-3 text-[color:var(--bitsnap-returns-muted-foreground,#71717a)] hover:bg-[var(--bitsnap-returns-hover-surface,#f4f4f5)]",l.className),style:l.style,onClick:n,children:s("back")}),_jsxruntime.jsx.call(void 0, "h2",{"data-bitsnap-returns-slot":"title",className:_chunkDOJICJCQjs.g.call(void 0, "text-2xl font-semibold",g.className),style:g.style,children:e}),t!=null&&_jsxruntime.jsx.call(void 0, "p",{"data-bitsnap-returns-slot":"description",className:_chunkDOJICJCQjs.g.call(void 0, "text-sm",m.className),style:m.style,children:t})]}),i]})}function H({errorKey:e,onRetry:t}){let n=z(),r=d("error"),a=d("secondaryButton");return _jsxruntime.jsxs.call(void 0, "div",{role:"alert","data-bitsnap-returns-slot":"error",className:_chunkDOJICJCQjs.g.call(void 0, "flex flex-col items-start gap-2 text-sm",r.className),style:r.style,children:[_jsxruntime.jsx.call(void 0, "p",{children:n(e)}),t!=null&&_jsxruntime.jsx.call(void 0, _chunk2FD2QP4Yjs.k,{type:"button",variant:"secondary",size:"sm","data-bitsnap-returns-slot":"secondaryButton",className:_chunkDOJICJCQjs.g.call(void 0, W,a.className),style:a.style,onClick:t,children:n("errorRetry")})]})}function Ve({children:e}){let t=d("emptyState");return _jsxruntime.jsx.call(void 0, "p",{"data-bitsnap-returns-slot":"emptyState",className:_chunkDOJICJCQjs.g.call(void 0, "py-6 text-center text-sm",t.className),style:t.style,children:e})}function le({rows:e=3}){let t=z(),n=d("skeleton");return _jsxruntime.jsx.call(void 0, "div",{role:"status","aria-busy":"true","aria-label":t("loading"),className:"flex flex-col gap-3",children:Array.from({length:e},(r,a)=>_jsxruntime.jsx.call(void 0, _chunk2FD2QP4Yjs.o,{"data-bitsnap-returns-slot":"skeleton",className:_chunkDOJICJCQjs.g.call(void 0, "h-16 w-full bg-[var(--bitsnap-returns-hover-surface,#f4f4f5)]",n.className),style:n.style},a))})}function xe({status:e}){let t=z(),n=d("statusBadge");return _jsxruntime.jsx.call(void 0, "span",{"data-bitsnap-returns-slot":"statusBadge","data-status":e,className:_chunkDOJICJCQjs.g.call(void 0, "inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium",n.className),style:n.style,children:t(Kt(e))})}function ft(){let e=z();return t=>e(_t(t))}function We({page:e,total:t,hasNext:n,hasPrevious:r,isFetching:a,onNext:i,onPrevious:s}){let o=z(),g=d("pagination"),m=d("secondaryButton");return!n&&!r?null:_jsxruntime.jsxs.call(void 0, "nav",{"data-bitsnap-returns-slot":"pagination",className:_chunkDOJICJCQjs.g.call(void 0, "flex items-center justify-between gap-3 text-sm",g.className),style:g.style,children:[_jsxruntime.jsx.call(void 0, _chunk2FD2QP4Yjs.k,{type:"button",variant:"secondary",size:"sm","data-bitsnap-returns-slot":"secondaryButton",className:_chunkDOJICJCQjs.g.call(void 0, W,m.className),style:m.style,disabled:!r||a,onClick:s,children:o("paginationPrevious")}),_jsxruntime.jsx.call(void 0, "span",{"aria-live":"polite",children:o("paginationInfo",{page:e,total:t})}),_jsxruntime.jsx.call(void 0, _chunk2FD2QP4Yjs.k,{type:"button",variant:"secondary",size:"sm","data-bitsnap-returns-slot":"secondaryButton",className:_chunkDOJICJCQjs.g.call(void 0, W,m.className),style:m.style,disabled:!n||a,onClick:i,children:o("paginationNext")})]})}function Ko({onSubmitted:e,className:t,...n}){let r=D("ReturnsEmailStep"),a=z(),i=Z(),s=Fe(),[o,g]=_react.useState.call(void 0, _nullishCoalesce(r.lastEmail, () => (""))),m=d("emailForm"),l=d("emailInput"),y=d("submitButton");async function c(f){f.preventDefault(),!s.isStarting&&await s.start(o)&&_optionalChain([e, 'optionalCall', _62 => _62(o.trim())])}return _jsxruntime.jsx.call(void 0, te,{className:t,lead:_jsxruntime.jsx.call(void 0, dt,{projectId:r.projectID,locale:i,...n}),title:a("emailStepTitle"),description:a("emailStepDescription"),children:_jsxruntime.jsxs.call(void 0, "form",{"data-bitsnap-returns-slot":"emailForm",className:_chunkDOJICJCQjs.g.call(void 0, "flex flex-col gap-4",m.className),style:m.style,onSubmit:c,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-2",children:[_jsxruntime.jsx.call(void 0, Te,{htmlFor:"bitsnap-returns-email",children:a("emailLabel")}),_jsxruntime.jsx.call(void 0, _chunk2FD2QP4Yjs.l,{id:"bitsnap-returns-email",type:"email",name:"email",autoComplete:"email",inputMode:"email",autoCapitalize:"none",spellCheck:!1,autoFocus:!0,required:!0,value:o,placeholder:a("emailPlaceholder"),disabled:s.isStarting,"data-bitsnap-returns-slot":"emailInput",className:_chunkDOJICJCQjs.g.call(void 0, Re,l.className),style:l.style,onChange:f=>g(f.target.value)})]}),s.errorKey!=null&&_jsxruntime.jsx.call(void 0, H,{errorKey:s.errorKey}),_jsxruntime.jsxs.call(void 0, _chunk2FD2QP4Yjs.k,{type:"submit",disabled:s.isStarting,"data-bitsnap-returns-slot":"submitButton",className:_chunkDOJICJCQjs.g.call(void 0, ce,y.className),style:y.style,children:[s.isStarting&&_jsxruntime.jsx.call(void 0, ye,{}),a("emailSubmit")]})]})})}function _o({onVerified:e,onBack:t,className:n,...r}){let a=D("ReturnsCodeStep"),i=z(),s=Z(),o=Fe(),[g,m]=_react.useState.call(void 0, ""),[l,y]=_react.useState.call(void 0, !1),[c,f]=_react.useState.call(void 0, !1),[b,x]=_react.useState.call(void 0, 1),v=_react.useRef.call(void 0, null),k=_react.useRef.call(void 0, !1),S=qe(_optionalChain([o, 'access', _63 => _63.challenge, 'optionalAccess', _64 => _64.resendAvailableAt])),w=d("codeForm"),h=d("codeInput"),C=d("submitButton"),U=d("resendButton"),_=o.isVerifying||o.isStarting,J="bitsnap-returns-code",N=`${J}-hint`;_react.useEffect.call(void 0, ()=>{_||_optionalChain([v, 'access', _65 => _65.current, 'optionalAccess', _66 => _66.focus, 'call', _67 => _67()])},[b,_]);async function Y(F){if(!(_||k.current)){if(F.length!==de){y(!0),x(re=>re+1);return}k.current=!0,y(!1),f(!1);try{await o.verify(F)?_optionalChain([e, 'optionalCall', _68 => _68()]):(m(""),x(re=>re+1))}finally{k.current=!1}}}async function O(F){F.preventDefault(),await Y(g)}async function j(){y(!1),f(!1),await o.resend()&&(m(""),f(!0)),x(F=>F+1)}function Q(){a.setChallenge(void 0),_optionalChain([t, 'optionalCall', _69 => _69()])}return _jsxruntime.jsx.call(void 0, te,{className:n,onBack:t!=null?Q:void 0,lead:_jsxruntime.jsx.call(void 0, dt,{projectId:a.projectID,locale:s,...r}),title:i("codeStepTitle"),description:i("codeStepDescription",{email:_nullishCoalesce(_optionalChain([o, 'access', _70 => _70.challenge, 'optionalAccess', _71 => _71.email]), () => (""))}),children:_jsxruntime.jsxs.call(void 0, "form",{"data-bitsnap-returns-slot":"codeForm",className:_chunkDOJICJCQjs.g.call(void 0, "flex flex-col gap-4",w.className),style:w.style,noValidate:!0,onSubmit:O,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-2",children:[_jsxruntime.jsx.call(void 0, Te,{htmlFor:J,children:i("codeLabel")}),_jsxruntime.jsx.call(void 0, fn,{id:J,name:"code",inputRef:v,value:g,disabled:_,invalid:o.errorKey!=null||l,"aria-describedby":N,slotClassName:_chunkDOJICJCQjs.g.call(void 0, gn,h.className),slotStyle:h.style,onChange:F=>{m(F.replace(/\D/g,"")),y(!1)},onComplete:F=>void Y(F)}),_jsxruntime.jsxs.call(void 0, "p",{id:N,className:"text-xs",children:[i("codeValidity")," ",i("codeSpamHint")]})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"min-h-10",children:[l&&_jsxruntime.jsx.call(void 0, "p",{role:"alert",className:"text-sm",children:i("codeIncomplete")}),!l&&o.errorKey!=null&&_jsxruntime.jsx.call(void 0, H,{errorKey:o.errorKey}),!l&&o.errorKey==null&&c&&_jsxruntime.jsx.call(void 0, "p",{role:"status",className:"text-sm",children:i("resendSent")})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-wrap items-center gap-3",children:[_jsxruntime.jsxs.call(void 0, _chunk2FD2QP4Yjs.k,{type:"submit",disabled:_||o.challenge==null,"data-bitsnap-returns-slot":"submitButton",className:_chunkDOJICJCQjs.g.call(void 0, "h-11",ce,C.className),style:C.style,children:[o.isVerifying&&_jsxruntime.jsx.call(void 0, ye,{"aria-hidden":!0}),i("codeSubmit")]}),_jsxruntime.jsxs.call(void 0, _chunk2FD2QP4Yjs.k,{type:"button",variant:"secondary",disabled:_||S>0||o.challenge==null,"data-bitsnap-returns-slot":"resendButton",className:_chunkDOJICJCQjs.g.call(void 0, "h-11",W,U.className),style:U.style,onClick:()=>void j(),children:[o.isStarting&&_jsxruntime.jsx.call(void 0, ye,{"aria-hidden":!0}),S>0?i("resendIn",{seconds:S}):i("resend")]})]})]})})}function bn(){let e=z(),t=Fe(),n=d("logoutButton");return _jsxruntime.jsx.call(void 0, _chunk2FD2QP4Yjs.k,{type:"button",variant:"ghost",size:"sm","data-bitsnap-returns-slot":"logoutButton",className:_chunkDOJICJCQjs.g.call(void 0, "text-[color:var(--bitsnap-returns-muted-foreground,#71717a)] hover:bg-[var(--bitsnap-returns-hover-surface,#f4f4f5)]",n.className),style:n.style,onClick:t.logout,children:e("logout")})}function pe(e,t){if(e==null)return"";let n=_wkt.timestampDate.call(void 0, e);try{return new Intl.DateTimeFormat(t,{dateStyle:"medium"}).format(n)}catch (e15){return n.toISOString().slice(0,10)}}function ve(e,t,n){let r=typeof e=="bigint"?e:BigInt(Math.trunc(e));try{let a=new Intl.NumberFormat(n,{style:"currency",currency:t}),i=_nullishCoalesce(a.resolvedOptions().maximumFractionDigits, () => (2));return a.format(Rn(r,i))}catch (e16){return`${Rn(r,2)} ${t}`}}function Rn(e,t){let n=e<BigInt(0),r=n?-e:e;if(t<=0)return`${n?"-":""}${r}`;let a=BigInt(10)**BigInt(t),i=r/a,s=(r%a).toString().padStart(t,"0");return`${n?"-":""}${i}.${s}`}function xn(e,t){return Number.isFinite(e)?Math.min(Math.max(0,Math.trunc(e)),Math.max(0,t)):0}function gt(e){return e.eligible&&e.availableQuantity>0}function vn(e,t){return e.map(n=>({lineId:n,quantity:_nullishCoalesce(t[n], () => (0))})).filter(n=>n.quantity>0)}function la({onSelectOrder:e,onOpenMyReturns:t,showLogout:n=!0,pageSize:r,className:a}){D("ReturnsOrderList");let i=z(),s=Z(),o=tn({pageSize:r}),g=d("orderList"),m=d("orderCard"),l=d("orderReference"),y=d("orderDate"),c=d("orderTotal"),f=d("secondaryButton");return _jsxruntime.jsxs.call(void 0, te,{className:a,title:i("ordersTitle"),description:i("ordersDescription"),children:[(n||t!=null)&&_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t!=null?_jsxruntime.jsx.call(void 0, _chunk2FD2QP4Yjs.k,{type:"button",variant:"secondary",size:"sm","data-bitsnap-returns-slot":"secondaryButton",className:_chunkDOJICJCQjs.g.call(void 0, W,f.className),style:f.style,onClick:t,children:i("myReturnsLink")}):_jsxruntime.jsx.call(void 0, "span",{}),n&&_jsxruntime.jsx.call(void 0, bn,{})]}),o.isLoading?_jsxruntime.jsx.call(void 0, le,{}):o.errorKey!=null?_jsxruntime.jsx.call(void 0, H,{errorKey:o.errorKey,onRetry:o.refetch}):o.orders.length===0?_jsxruntime.jsx.call(void 0, Ve,{children:i("ordersEmpty")}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "ul",{"data-bitsnap-returns-slot":"orderList",className:_chunkDOJICJCQjs.g.call(void 0, "flex flex-col gap-3",g.className),style:g.style,children:o.orders.map(b=>_jsxruntime.jsxs.call(void 0, "li",{"data-bitsnap-returns-slot":"orderCard",className:_chunkDOJICJCQjs.g.call(void 0, "flex flex-wrap items-center justify-between gap-3 border p-4",m.className),style:m.style,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-1",children:[_jsxruntime.jsx.call(void 0, "span",{"data-bitsnap-returns-slot":"orderReference",className:_chunkDOJICJCQjs.g.call(void 0, "font-medium",l.className),style:l.style,children:i("orderTitle",{reference:b.displayReference})}),_jsxruntime.jsx.call(void 0, "span",{"data-bitsnap-returns-slot":"orderDate",className:_chunkDOJICJCQjs.g.call(void 0, "text-sm",y.className),style:y.style,children:pe(b.purchasedAt,s)}),_jsxruntime.jsx.call(void 0, "span",{className:"text-sm",children:i("orderReturnableLines",{count:b.returnableLineCount})})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center gap-4",children:[_jsxruntime.jsx.call(void 0, "span",{"data-bitsnap-returns-slot":"orderTotal",className:_chunkDOJICJCQjs.g.call(void 0, "font-medium",c.className),style:c.style,children:ve(b.totalMinor,b.currency,s)}),_jsxruntime.jsx.call(void 0, _chunk2FD2QP4Yjs.k,{type:"button",variant:"secondary",size:"sm","aria-label":`${i("orderSelect")}: ${i("orderTitle",{reference:b.displayReference})}`,"data-bitsnap-returns-slot":"secondaryButton",className:_chunkDOJICJCQjs.g.call(void 0, W,f.className),style:f.style,onClick:()=>_optionalChain([e, 'optionalCall', _72 => _72(b.canonicalOrderId)]),children:i("orderSelect")})]})]},b.canonicalOrderId))}),_jsxruntime.jsx.call(void 0, We,{page:o.page,total:o.total,hasNext:o.hasNext,hasPrevious:o.hasPrevious,isFetching:o.isFetching,onNext:o.next,onPrevious:o.previous})]})]})}function da({orderId:e,onContinue:t,onBack:n,initialItems:r,initialNote:a,className:i}){D("ReturnsOrderDetail");let s=_chunkD2ASWUXMjs.m.call(void 0, );_react.useEffect.call(void 0, ()=>{s.track("return_started",{},{order_ref:null})},[s]);let o=z(),g=Z(),{order:m,returnHistory:l,isLoading:y,errorKey:c,refetch:f}=it(e),[b,x]=_react.useState.call(void 0, ()=>Object.fromEntries((_nullishCoalesce(r, () => ([]))).map(R=>[R.lineId,R.quantity]))),[v,k]=_react.useState.call(void 0, _nullishCoalesce(a, () => (""))),[S,w]=_react.useState.call(void 0, !1),h=d("lineList"),C=d("line"),U=d("lineName"),_=d("linePrice"),J=d("lineQuantityControl"),N=d("quantityButton"),Y=d("quantityInput"),O=d("lineIneligibleReason"),j=d("noteInput"),Q=d("submitButton"),F=d("history"),re=d("historyEntry");function Se(R,X){w(!1),x(V=>({...V,[R.lineId]:xn(X,R.availableQuantity)}))}function B(R){if(R.preventDefault(),m==null)return;let X=vn(m.lines.filter(gt).map(V=>V.lineId),b);if(X.length===0){w(!0);return}_optionalChain([t, 'optionalCall', _73 => _73({items:X,note:v.trim()})])}return _jsxruntime.jsx.call(void 0, te,{className:i,onBack:n,title:o("orderDetailTitle",{reference:_nullishCoalesce(_optionalChain([m, 'optionalAccess', _74 => _74.displayReference]), () => (""))}),description:o("orderDetailDescription"),children:y?_jsxruntime.jsx.call(void 0, le,{}):c!=null?_jsxruntime.jsx.call(void 0, H,{errorKey:c,onRetry:f}):m==null?null:_jsxruntime.jsxs.call(void 0, "form",{className:"flex flex-col gap-5",onSubmit:B,children:[_jsxruntime.jsx.call(void 0, "ul",{"data-bitsnap-returns-slot":"lineList",className:_chunkDOJICJCQjs.g.call(void 0, "flex flex-col gap-3",h.className),style:h.style,children:m.lines.map(R=>{let X=gt(R),V=_nullishCoalesce(b[R.lineId], () => (0)),he=`bitsnap-returns-quantity-${R.lineId}`;return _jsxruntime.jsxs.call(void 0, "li",{"data-bitsnap-returns-slot":"line","data-selected":V>0?"":void 0,"data-ineligible":X?void 0:"",className:_chunkDOJICJCQjs.g.call(void 0, "flex flex-col gap-3 border p-4",C.className),style:C.style,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[_jsxruntime.jsx.call(void 0, "span",{"data-bitsnap-returns-slot":"lineName",className:_chunkDOJICJCQjs.g.call(void 0, "font-medium",U.className),style:U.style,children:R.name}),_jsxruntime.jsx.call(void 0, "span",{"data-bitsnap-returns-slot":"linePrice",className:_chunkDOJICJCQjs.g.call(void 0, "text-sm",_.className),style:_.style,children:ve(R.paidUnitMinor,R.currency,g)})]}),X?_jsxruntime.jsxs.call(void 0, "div",{role:"group","aria-label":o("quantityLabel",{name:R.name}),"data-bitsnap-returns-slot":"lineQuantityControl",className:_chunkDOJICJCQjs.g.call(void 0, "flex items-center gap-2",J.className),style:J.style,children:[_jsxruntime.jsx.call(void 0, _chunk2FD2QP4Yjs.k,{type:"button",variant:"secondary",size:"icon-sm","aria-label":o("quantityDecrease",{name:R.name}),"aria-controls":he,disabled:V<=0,"data-bitsnap-returns-slot":"quantityButton",className:_chunkDOJICJCQjs.g.call(void 0, W,N.className),style:N.style,onClick:()=>Se(R,V-1),children:_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":"true",children:"-"})}),_jsxruntime.jsx.call(void 0, "input",{id:he,type:"number",inputMode:"numeric",min:0,max:R.availableQuantity,step:1,value:V,"aria-label":o("quantityLabel",{name:R.name}),"data-bitsnap-returns-slot":"quantityInput",className:_chunkDOJICJCQjs.g.call(void 0, "h-8 w-16 rounded-md border px-2 text-center text-sm outline-none focus-visible:ring-[3px]",Re,Y.className),style:Y.style,onChange:He=>Se(R,He.target.valueAsNumber)}),_jsxruntime.jsx.call(void 0, _chunk2FD2QP4Yjs.k,{type:"button",variant:"secondary",size:"icon-sm","aria-label":o("quantityIncrease",{name:R.name}),"aria-controls":he,disabled:V>=R.availableQuantity,"data-bitsnap-returns-slot":"quantityButton",className:_chunkDOJICJCQjs.g.call(void 0, W,N.className),style:N.style,onClick:()=>Se(R,V+1),children:_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":"true",children:"+"})}),_jsxruntime.jsx.call(void 0, "span",{className:"text-sm",children:o("quantityOfAvailable",{available:R.availableQuantity})})]}):_jsxruntime.jsx.call(void 0, "p",{"data-bitsnap-returns-slot":"lineIneligibleReason",className:_chunkDOJICJCQjs.g.call(void 0, "text-sm",O.className),style:O.style,children:R.exclusionReason!==""?R.exclusionReason:o("lineIneligibleFallback")})]},R.lineId)})}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-2",children:[_jsxruntime.jsx.call(void 0, Te,{htmlFor:"bitsnap-returns-note",children:o("noteLabel")}),_jsxruntime.jsx.call(void 0, _chunk2FD2QP4Yjs.p,{id:"bitsnap-returns-note",name:"note",rows:3,maxLength:1e3,value:v,placeholder:o("notePlaceholder"),"data-bitsnap-returns-slot":"noteInput",className:_chunkDOJICJCQjs.g.call(void 0, Re,"dark:border-[color:var(--bitsnap-returns-border,#e4e4e7)] dark:placeholder:text-[color:var(--bitsnap-returns-muted-foreground,#71717a)] dark:focus-visible:ring-[color:var(--bitsnap-returns-focus-ring,#71717a)]",j.className),style:j.style,onChange:R=>k(R.target.value)})]}),S&&_jsxruntime.jsx.call(void 0, H,{errorKey:"selectionEmpty"}),_jsxruntime.jsx.call(void 0, _chunk2FD2QP4Yjs.k,{type:"submit","data-bitsnap-returns-slot":"submitButton",className:_chunkDOJICJCQjs.g.call(void 0, ce,Q.className),style:Q.style,children:o("selectionContinue")}),l.length>0&&_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-2",children:[_jsxruntime.jsx.call(void 0, "h3",{className:"text-sm font-medium",children:o("previousReturnsTitle")}),_jsxruntime.jsx.call(void 0, "ul",{"data-bitsnap-returns-slot":"history",className:_chunkDOJICJCQjs.g.call(void 0, "flex flex-col gap-2",F.className),style:F.style,children:l.map(R=>_jsxruntime.jsxs.call(void 0, "li",{"data-bitsnap-returns-slot":"historyEntry",className:_chunkDOJICJCQjs.g.call(void 0, "flex flex-wrap items-center justify-between gap-2 text-sm",re.className),style:re.style,children:[_jsxruntime.jsx.call(void 0, "span",{children:R.reference}),_jsxruntime.jsx.call(void 0, "span",{children:pe(R.createdAt,g)}),_jsxruntime.jsx.call(void 0, xe,{status:R.status})]},R.id))})]})]})})}function ca({orderId:e,items:t,note:n,onSubmitted:r,onBack:a,className:i}){D("ReturnsConfirmation");let s=z(),o=Z(),{order:g,isLoading:m,errorKey:l,refetch:y}=it(e),c=nn(),f=d("summary"),b=d("line"),x=d("lineName"),v=d("linePrice"),k=d("submitButton");async function S(w){if(w.preventDefault(),c.isPending)return;let h=await c.submit({orderId:e,items:t.map(C=>({lineId:C.lineId,quantity:C.quantity})),note:n});h!=null&&_optionalChain([r, 'optionalCall', _75 => _75(h.id,h)])}return _jsxruntime.jsx.call(void 0, te,{className:i,onBack:a,title:s("confirmationTitle"),description:s("confirmationDescription"),children:m?_jsxruntime.jsx.call(void 0, le,{rows:2}):l!=null?_jsxruntime.jsx.call(void 0, H,{errorKey:l,onRetry:y}):_jsxruntime.jsxs.call(void 0, "form",{className:"flex flex-col gap-5",onSubmit:S,children:[_jsxruntime.jsxs.call(void 0, "div",{"data-bitsnap-returns-slot":"summary",className:_chunkDOJICJCQjs.g.call(void 0, "flex flex-col gap-3 border p-4",f.className),style:f.style,children:[_jsxruntime.jsx.call(void 0, "h3",{className:"text-sm font-medium",children:s("confirmationSummary")}),_jsxruntime.jsx.call(void 0, "ul",{className:"flex flex-col gap-3",children:t.map(w=>{let h=_optionalChain([g, 'optionalAccess', _76 => _76.lines, 'access', _77 => _77.find, 'call', _78 => _78(C=>C.lineId===w.lineId)]);return _jsxruntime.jsxs.call(void 0, "li",{"data-bitsnap-returns-slot":"line",className:_chunkDOJICJCQjs.g.call(void 0, "flex flex-wrap items-baseline justify-between gap-2",b.className),style:b.style,children:[_jsxruntime.jsx.call(void 0, "span",{"data-bitsnap-returns-slot":"lineName",className:_chunkDOJICJCQjs.g.call(void 0, "font-medium",x.className),style:x.style,children:_nullishCoalesce(_optionalChain([h, 'optionalAccess', _79 => _79.name]), () => (w.lineId))}),_jsxruntime.jsxs.call(void 0, "span",{"data-bitsnap-returns-slot":"linePrice",className:_chunkDOJICJCQjs.g.call(void 0, "text-sm",v.className),style:v.style,children:[s("confirmationQuantity",{quantity:w.quantity}),h!=null&&` \xB7 ${ve(h.paidUnitMinor*BigInt(w.quantity),h.currency,o)}`]})]},w.lineId)})}),n!=null&&n!==""&&_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-1 text-sm",children:[_jsxruntime.jsx.call(void 0, "span",{className:"font-medium",children:s("confirmationNote")}),_jsxruntime.jsx.call(void 0, "span",{className:"whitespace-pre-wrap",children:n})]})]}),c.errorKey!=null&&_jsxruntime.jsx.call(void 0, H,{errorKey:c.errorKey}),_jsxruntime.jsxs.call(void 0, _chunk2FD2QP4Yjs.k,{type:"submit",disabled:c.isPending||t.length===0,"data-bitsnap-returns-slot":"submitButton",className:_chunkDOJICJCQjs.g.call(void 0, ce,k.className),style:k.style,children:[c.isPending&&_jsxruntime.jsx.call(void 0, ye,{}),s("confirmationSubmit")]})]})})}function pa({returnId:e,onContinue:t,onOpenMyReturns:n,className:r}){D("ReturnsResult");let a=z(),{request:i,isLoading:s,errorKey:o,refetch:g}=_e(e),m=d("successState"),l=d("returnReference"),y=d("returnInstructions"),c=d("submitButton"),f=d("secondaryButton");return _jsxruntime.jsxs.call(void 0, "section",{className:_chunkDOJICJCQjs.g.call(void 0, "flex flex-col gap-5",r),children:[_jsxruntime.jsxs.call(void 0, "div",{role:"status","data-bitsnap-returns-slot":"successState",className:_chunkDOJICJCQjs.g.call(void 0, "flex flex-col gap-4 border p-5",m.className),style:m.style,children:[_jsxruntime.jsx.call(void 0, "h2",{className:"text-2xl font-semibold",children:a("successTitle")}),_jsxruntime.jsx.call(void 0, "p",{className:"text-sm",children:a("successDescription")}),s?_jsxruntime.jsx.call(void 0, le,{rows:2}):o!=null?_jsxruntime.jsx.call(void 0, H,{errorKey:o,onRetry:g}):i!=null&&_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-1",children:[_jsxruntime.jsx.call(void 0, "span",{className:"text-sm",children:a("successReference")}),_jsxruntime.jsx.call(void 0, "span",{"data-bitsnap-returns-slot":"returnReference",className:_chunkDOJICJCQjs.g.call(void 0, "text-lg font-semibold",l.className),style:l.style,children:i.reference})]}),i.returnInstructions!==""&&_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-1",children:[_jsxruntime.jsx.call(void 0, "span",{className:"text-sm font-medium",children:a("successInstructions")}),_jsxruntime.jsx.call(void 0, "p",{"data-bitsnap-returns-slot":"returnInstructions",className:_chunkDOJICJCQjs.g.call(void 0, "whitespace-pre-wrap border p-3 text-sm",y.className),style:y.style,children:i.returnInstructions})]})]})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-wrap gap-3",children:[_jsxruntime.jsx.call(void 0, _chunk2FD2QP4Yjs.k,{type:"button","data-bitsnap-returns-slot":"submitButton",className:_chunkDOJICJCQjs.g.call(void 0, ce,c.className),style:c.style,onClick:t,children:a("successDone")}),n!=null&&_jsxruntime.jsx.call(void 0, _chunk2FD2QP4Yjs.k,{type:"button",variant:"secondary","data-bitsnap-returns-slot":"secondaryButton",className:_chunkDOJICJCQjs.g.call(void 0, W,f.className),style:f.style,onClick:n,children:a("myReturnsLink")})]})]})}function Na({onSelectReturn:e,onBack:t,pageSize:n,className:r}){D("ReturnsMyReturnsList");let a=z(),i=Z(),s=ft(),o=rn({pageSize:n}),g=d("returnList"),m=d("returnCard"),l=d("returnReference"),y=d("secondaryButton");return _jsxruntime.jsx.call(void 0, te,{className:r,onBack:t,title:a("myReturnsTitle"),description:a("myReturnsDescription"),children:o.isLoading?_jsxruntime.jsx.call(void 0, le,{}):o.errorKey!=null?_jsxruntime.jsx.call(void 0, H,{errorKey:o.errorKey,onRetry:o.refetch}):o.returns.length===0?_jsxruntime.jsx.call(void 0, Ve,{children:a("myReturnsEmpty")}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "ul",{"data-bitsnap-returns-slot":"returnList",className:_chunkDOJICJCQjs.g.call(void 0, "flex flex-col gap-3",g.className),style:g.style,children:o.returns.map(c=>_jsxruntime.jsxs.call(void 0, "li",{"data-bitsnap-returns-slot":"returnCard",className:_chunkDOJICJCQjs.g.call(void 0, "flex flex-wrap items-center justify-between gap-3 border p-4",m.className),style:m.style,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-1",children:[_jsxruntime.jsx.call(void 0, "span",{"data-bitsnap-returns-slot":"returnReference",className:_chunkDOJICJCQjs.g.call(void 0, "font-medium",l.className),style:l.style,children:c.reference}),_jsxruntime.jsx.call(void 0, "span",{className:"text-sm",children:pe(c.createdAt,i)}),_jsxruntime.jsxs.call(void 0, "span",{className:"text-sm",children:[a("myReturnRefund"),": ",s(c.refundStatus)]})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center gap-3",children:[_jsxruntime.jsx.call(void 0, xe,{status:c.status}),_jsxruntime.jsx.call(void 0, _chunk2FD2QP4Yjs.k,{type:"button",variant:"secondary",size:"sm","aria-label":`${a("myReturnOpen")}: ${c.reference}`,"data-bitsnap-returns-slot":"secondaryButton",className:_chunkDOJICJCQjs.g.call(void 0, W,y.className),style:y.style,onClick:()=>_optionalChain([e, 'optionalCall', _80 => _80(c.id)]),children:a("myReturnOpen")})]})]},c.id))}),_jsxruntime.jsx.call(void 0, We,{page:o.page,total:o.total,hasNext:o.hasNext,hasPrevious:o.hasPrevious,isFetching:o.isFetching,onNext:o.next,onPrevious:o.previous})]})})}function Ta({returnId:e,onBack:t,className:n}){D("ReturnsMyReturnDetail");let r=z(),a=Z(),i=ft(),{request:s,isLoading:o,errorKey:g,refetch:m}=_e(e),l=d("summary"),y=d("lineList"),c=d("line"),f=d("lineName"),b=d("returnInstructions"),x=d("history"),v=d("historyEntry");return _jsxruntime.jsx.call(void 0, te,{className:n,onBack:t,title:s!=null?r("myReturnTitle",{reference:s.reference}):r("myReturnDetailTitle"),children:o?_jsxruntime.jsx.call(void 0, le,{}):g!=null?_jsxruntime.jsx.call(void 0, H,{errorKey:g,onRetry:m}):s!=null&&_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-5",children:[_jsxruntime.jsxs.call(void 0, "div",{"data-bitsnap-returns-slot":"summary",className:_chunkDOJICJCQjs.g.call(void 0, "flex flex-col gap-2 border p-4 text-sm",l.className),style:l.style,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center justify-between gap-2",children:[_jsxruntime.jsx.call(void 0, xe,{status:s.status}),_jsxruntime.jsxs.call(void 0, "span",{children:[r("myReturnCreatedAt"),":"," ",pe(s.createdAt,a)]})]}),_jsxruntime.jsxs.call(void 0, "span",{children:[r("myReturnRefund"),": ",i(s.refundStatus),s.refundAmountMinor>BigInt(0)&&` \xB7 ${ve(s.refundAmountMinor,s.currency,a)}`]}),s.customerNote!==""&&_jsxruntime.jsxs.call(void 0, "span",{className:"whitespace-pre-wrap",children:[r("myReturnNote"),": ",s.customerNote]})]}),s.returnInstructions!==""&&_jsxruntime.jsx.call(void 0, "p",{"data-bitsnap-returns-slot":"returnInstructions",className:_chunkDOJICJCQjs.g.call(void 0, "whitespace-pre-wrap border p-3 text-sm",b.className),style:b.style,children:s.returnInstructions}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-2",children:[_jsxruntime.jsx.call(void 0, "h3",{className:"text-sm font-medium",children:r("myReturnLines")}),_jsxruntime.jsx.call(void 0, "ul",{"data-bitsnap-returns-slot":"lineList",className:_chunkDOJICJCQjs.g.call(void 0, "flex flex-col gap-3",y.className),style:y.style,children:s.lines.map(k=>_jsxruntime.jsxs.call(void 0, "li",{"data-bitsnap-returns-slot":"line",className:_chunkDOJICJCQjs.g.call(void 0, "flex flex-wrap items-baseline justify-between gap-2 border p-4",c.className),style:c.style,children:[_jsxruntime.jsx.call(void 0, "span",{"data-bitsnap-returns-slot":"lineName",className:_chunkDOJICJCQjs.g.call(void 0, "font-medium",f.className),style:f.style,children:k.name}),_jsxruntime.jsx.call(void 0, "span",{className:"text-sm",children:r("myReturnLineQuantities",{requested:k.requestedQuantity,approved:k.approvedQuantity,received:k.receivedQuantity})})]},k.lineId))})]}),s.history.length>0&&_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-2",children:[_jsxruntime.jsx.call(void 0, "h3",{className:"text-sm font-medium",children:r("myReturnHistory")}),_jsxruntime.jsx.call(void 0, "ul",{"data-bitsnap-returns-slot":"history",className:_chunkDOJICJCQjs.g.call(void 0, "flex flex-col gap-2",x.className),style:x.style,children:s.history.map(k=>_jsxruntime.jsxs.call(void 0, "li",{"data-bitsnap-returns-slot":"historyEntry",className:_chunkDOJICJCQjs.g.call(void 0, "flex flex-wrap items-center justify-between gap-2 text-sm",v.className),style:v.style,children:[_jsxruntime.jsx.call(void 0, xe,{status:k.status}),_jsxruntime.jsx.call(void 0, "span",{children:pe(k.createdAt,a)})]},k.id))})]})]})})}exports.a = Zt; exports.b = pr; exports.c = dt; exports.d = Te; exports.e = ye; exports.f = Ut; exports.g = xr; exports.h = eo; exports.i = ct; exports.j = ao; exports.k = fn; exports.l = Pr; exports.m = Ot; exports.n = $e; exports.o = d; exports.p = st; exports.q = Xt; exports.r = z; exports.s = Z; exports.t = D; exports.u = Xn; exports.v = ls; exports.w = Fe; exports.x = tn; exports.y = it; exports.z = nn; exports.A = rn; exports.B = _e; exports.C = le; exports.D = Ko; exports.E = _o; exports.F = la; exports.G = da; exports.H = ca; exports.I = pa; exports.J = Na; exports.K = Ta;
|
|
2
|
+
//# sourceMappingURL=chunk-BUYTK7KM.js.map
|