import{j as p,bK as h,bL as f,bM as b,$ as y,dt as j,Y as c,dl as v,c7 as w,bN as $}from"./index-DXdAv5n3.js";import{j as n}from"./vendor-react-CVHocMAO.js";import{A as l}from"./award-TfkAFFEh.js";import{Z as d,f as C}from"./utils-m29NAvmr.js";import{S as _}from"./star-WZhRtBdg.js";import{C as S}from"./circle-check-CJi34ijI.js";import{B as k}from"./badge-check-CabiHZCA.js";import{g as m}from"./feeRates-DFYxRksI.js";/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const F=p("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const V=p("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);function L(e,r=14){const t={size:r,strokeWidth:2.5};switch(e){case"plec_partner":return n.jsx(F,{...t});case"plec_featured":return n.jsx(c,{...t});case"plec_verified":return n.jsx(k,{...t});case"plec_onboarded":return n.jsx($,{...t});case"hosting_since":return n.jsx(w,{...t});case"early_adopter":return n.jsx(d,{...t});case"verified":return n.jsx(S,{...t});case"highly_rated":return n.jsx(_,{...t,fill:"currentColor"});case"superhost":return n.jsx(l,{...t});case"popular":return n.jsx(v,{...t});case"new":return n.jsx(c,{...t});case"instant_book":return n.jsx(d,{...t});case"travels_to_you":return n.jsx(j,{...t});case"licensed_insured":return n.jsx(y,{...t});case"award_winner":return n.jsx(l,{...t});default:return null}}function P(e,r,t){const s=`inline-flex items-center rounded-full font-medium transition-all ${{sm:"px-2 py-0.5 gap-1 text-xs",md:"px-2.5 py-1 gap-1.5 text-sm",lg:"px-3 py-1.5 gap-2 text-base"}[t]}`;if(r==="plec_featured")return`${s} bg-gradient-to-r from-amber-500 to-orange-500 text-white shadow-sm`;if(r==="plec_partner")return`${s} bg-gradient-to-r from-blue-600 to-indigo-600 text-white shadow-sm`;if(r==="plec_onboarded")return`${s} bg-blue-600 text-white shadow-sm`;switch(e){case"plec":return`${s} bg-blue-50 text-blue-700 ring-1 ring-blue-200/50`;case"trust":return r==="verified"?`${s} bg-emerald-50 text-emerald-700 ring-1 ring-emerald-200/50`:r==="highly_rated"||r==="superhost"?`${s} bg-amber-50 text-amber-700 ring-1 ring-amber-200/50`:`${s} bg-green-50 text-green-700 ring-1 ring-green-200/50`;case"status":return r==="popular"?`${s} bg-rose-50 text-rose-700 ring-1 ring-rose-200/50`:r==="new"?`${s} bg-purple-50 text-purple-700 ring-1 ring-purple-200/50`:`${s} bg-amber-50 text-amber-700 ring-1 ring-amber-200/50`;case"feature":return r==="instant_book"?`${s} bg-violet-50 text-violet-700 ring-1 ring-violet-200/50`:`${s} bg-slate-50 text-slate-700 ring-1 ring-slate-200/50`;default:return`${s} bg-gray-50 text-gray-700 ring-1 ring-gray-200/50`}}function T({badge:e,size:r="sm",variant:t="default"}){const a=r==="sm"?13:r==="md"?14:16,s=L(e.type,a),i=P(e.category,e.type,r);if(t==="compact"){const u=i.split(" ").filter(o=>!o.startsWith("px-")&&!o.startsWith("py-")&&!o.startsWith("gap-")).join(" ");return n.jsxs(h,{children:[n.jsx(f,{asChild:!0,children:n.jsx("div",{className:`${u} p-1.5 flex items-center justify-center`,"aria-label":e.label,children:s})}),n.jsx(b,{side:"bottom",sideOffset:4,children:n.jsx("p",{className:"text-xs",children:e.label})})]})}return n.jsxs("div",{className:i,children:[s,n.jsx("span",{children:e.label})]})}function A({badges:e,maxVisible:r=3,size:t="sm",variant:a="default"}){const s=e.slice(0,r),i=e.length-r;return n.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[s.map((u,o)=>n.jsx(T,{badge:u,size:t,variant:a},`${u.type}-${o}`)),i>0&&n.jsxs("div",{className:`inline-flex items-center rounded-full bg-gray-100 text-gray-600 ring-1 ring-gray-200/50 ${t==="sm"?"px-2 py-0.5 text-xs":t==="md"?"px-2.5 py-1 text-sm":"px-3 py-1.5 text-base"}`,children:["+",i]})]})}const Z=({badges:e,maxDisplay:r,className:t,variant:a="default"})=>{const s=r?e.slice(0,r):e;if(s.length===0)return null;const i=(t!=null&&t.includes("text-[9px]"),"sm");return n.jsx("div",{className:t,children:n.jsx(A,{badges:s,maxVisible:r||3,size:i,variant:a})})};function B(e){var a;const r=(a=e==null?void 0:e.metadata)==null?void 0:a.pricing;return!r||typeof r!="object"?null:r.feeOverrides??null}function q(e,r){var t,a;return{listingKind:(e==null?void 0:e.listingKind)??"service",category:(e==null?void 0:e.category)??(r==null?void 0:r.category),serviceType:(r==null?void 0:r.serviceType)??(e==null?void 0:e.serviceType),feeOverrides:((t=e==null?void 0:e.pricingFeeSummary)==null?void 0:t.feeOverrides)??B(r),effectiveFeeRates:((a=e==null?void 0:e.pricingFeeSummary)==null?void 0:a.effectiveFeeRates)??null}}function g(e,r){if(!(!Number.isFinite(e)||(e??0)<=0))return m(e,r)}function x(e,r){return g(e,r)}function G(e,r){if(!(e==null||!Number.isFinite(e)))return m(e/100,r)}function E(e,r){const t=G(e,r)??0;return C(t)??"$0.00"}function O(e,r){return g(e.price,r)}function H(e,r){var a;const t=O(e,r);if(t)return(e.priceType==="per_person"||e.priceType==="per_guest")&&((a=e.guestLimit)!=null&&a.min)?t*e.guestLimit.min:t}function Y(e,r){return x(e.finalAmount,r)}function J(e,r){return x(e.unitPrice,r)}export{Z as L,V as P,O as a,G as b,q as c,g as d,J as e,E as f,H as g,Y as h};