const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/js/BlackGold-DEbJSpNv.js","assets/js/vendor-element-C6D3GHVC.js","assets/js/vendor-core-B-NFAs71.js","assets/css/vendor-core-CMnMgErA.css","assets/css/vendor-element-DwpmusXE.css","assets/js/SiteBrand.vue_vue_type_script_setup_true_lang-BZmdtmKs.js","assets/js/index-BhVZTysP.js","assets/css/index-tbEx-Uss.css","assets/js/logo--FEzwJyf.js","assets/js/logic-Z3Gec4Qs.js","assets/js/order-DJFvHwfK.js","assets/js/complaint-Ip7hEZbe.js","assets/js/common-BOZCcLYp.js","assets/js/format-m-LHUz_D.js","assets/js/knowledge-CkzlkNyI.js","assets/js/SpringFestival-C9m2PsV1.js","assets/css/SpringFestival-DjNBnUko.css","assets/js/Enterprise-5ftSaPjK.js","assets/js/ReceiptConfirmDialog.vue_vue_type_script_setup_true_lang-YVwosBko.js","assets/js/index-x7l0Sfz2.js","assets/js/index.vue_vue_type_script_setup_true_lang-QlPGNRpB.js","assets/js/vendor-icons-BssY82_H.js","assets/css/vendor-icons-D3l6PERS.css","assets/css/index-BL3uMt-f.css","assets/css/Enterprise-FD4JRbid.css","assets/js/Default-DOSb3dyY.js"])))=>i.map(i=>d[i]);
var t=(t,e,r)=>new Promise((n,o)=>{var s=t=>{try{a(r.next(t))}catch(e){o(e)}},i=t=>{try{a(r.throw(t))}catch(e){o(e)}},a=t=>t.done?n(t.value):Promise.resolve(t.value).then(s,i);a((r=r.apply(t,e)).next())});import{e,u as r,_ as n}from"./index-BhVZTysP.js";import{bH as o,b$ as s,c0 as i,t as a,c as l,E as d,x as c,J as u}from"./vendor-core-B-NFAs71.js";import{d as m}from"./logo--FEzwJyf.js";import"./vendor-element-C6D3GHVC.js";const p={},f=(t,e,r)=>{const n=t.trim();if(!n)return"";const o=n.includes("<template")?n:`<template>${n}</template>`,s=e.trim()?`\n<style>${e}</style>`:"";if(!r.trim())return`${o}${s}`;var i;return`${o}${`\n<script setup lang="ts">\nimport { onMounted } from 'vue'\n${`\nonMounted(() => {\n  try {\n    const root = document.querySelector('[data-ext-theme-root]') || document.body\n    const fn = new Function('root', 'window', 'document', \`${i=r,String(i||"").replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}\`)\n    fn(root, window, document)\n  } catch (e) {\n    console.error('External theme runtime script failed:', e)\n  }\n})`}\n<\/script>`}${s}`},g=t=>{if(!t)return"";if(/^https?:\/\//i.test(t)||t.startsWith("data:"))return t;const e="undefined"!=typeof window?window.location.origin:"";if(t.startsWith("/src/")||t.startsWith("/assets/"))return e?`${e}${t}`:t;const r=String("").trim(),n=(()=>{if(!r)return e;try{return new URL(r,e||void 0).href}catch(t){return e}})();if(!n)return t.startsWith("/")?t:`/${t}`;try{return new URL(t,n).href}catch(o){return t.startsWith("/")?t:`/${t}`}},_=(t,e,r)=>{var n;const o=window.__ADVANCED_THEME_CONTEXT__||{},s=g(m),i=g(e.siteLogo||(null==(n=e.siteConfig)?void 0:n.site_logo)||"")||s,a={"{{siteName}}":e.siteName||"","{{siteLogo}}":i,"{{siteLogoImg}}":i?`<img src="${i}" alt="logo" />`:"","{{siteDescription}}":e.siteDescription||"","{{siteKeywords}}":e.siteKeywords||"","{{siteCopyright}}":e.siteCopyright||"","{{siteIcp}}":e.siteIcp||"","{{siteDianzeng}}":e.siteDianzeng||""};{const t=o.order||{};a["{{orderTradeNo}}"]=t.trade_no||"",a["{{orderStatus}}"]=t.status||"",a["{{orderAmount}}"]=t.amount||"",a["{{orderProductName}}"]=t.product_name||"",a["{{orderSearchWidget}}"]='\n<div class="order-search-widget" data-ext-order-widget>\n  <div class="flex flex-col gap-3">\n    <div class="flex flex-col sm:flex-row gap-2">\n      <input data-field="keyword" type="text" placeholder="请输入订单号或联系方式" class="flex-1 px-3 py-2 border rounded text-sm" />\n      <button data-action="submit" class="px-4 py-2 text-sm rounded bg-blue-600 text-white disabled:opacity-60" type="button">查询订单</button>\n    </div>\n    <div data-field="error" class="text-sm text-red-500"></div>\n    <div data-field="result" class="mt-4 space-y-3"></div>\n  </div>\n</div>'}let l=t;return Object.keys(a).forEach(t=>{const e=a[t];l=l.split(t).join(e)}),l},v=(r,n)=>t(null,null,function*(){const t=`${r}:${n}`;if(p[t])return p[t];try{const i=yield(o=r,s=n,e.get({url:"/api/theme/payload",params:{module:o,id:s}}));return p[t]=i||null,p[t]}catch(i){return p[t]=null,null}var o,s}),h=a({__name:"search",setup(e){const a=r(),m=l(()=>{const e=a.siteConfig.theme_order_query;return String(e||"").startsWith("ext_")?(l="order",d=e,o(()=>t(null,null,function*(){const t=r();yield t.fetchSiteConfig();const e=yield v(l,d),n=_(String((null==e?void 0:e.html)||""),t),o=_(String((null==e?void 0:e.css)||""),t),a=_(String((null==e?void 0:e.js)||""),t),c=`<div data-ext-theme-root>${n}</div>`;if(!n.trim()&&!o.trim()&&!a.trim())return{template:'<div class="p-10 text-center">Template content is empty or failed to load.</div>'};const u=f(c,o,a||""),m={moduleCache:{vue:i},getFile:()=>u,addStyle(t){const e=document.createElement("style");e.textContent=t;const r=document.head.getElementsByTagName("style")[0]||null;document.head.insertBefore(e,r)}};return yield s("custom.vue",m)}))):o("black_gold"===e?()=>n(()=>import("./BlackGold-DEbJSpNv.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])):"spring_festival"===e?()=>n(()=>import("./SpringFestival-C9m2PsV1.js"),__vite__mapDeps([15,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16])):"enterprise"===e?()=>n(()=>import("./Enterprise-5ftSaPjK.js"),__vite__mapDeps([17,1,2,3,4,5,6,7,8,18,12,10,19,20,21,22,23,9,11,13,14,24])):()=>n(()=>import("./Default-DOSb3dyY.js"),__vite__mapDeps([25,1,2,3,4,9,10,6,7,11,12,13,14,5,8,19,20,21,22,23])));var l,d});return(t,e)=>(c(),d(u(m.value)))}});export{h as default};
