@jctrans-materials/comps-vue3 1.0.7 → 1.0.8

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.
@@ -10,6 +10,7 @@ interface Props {
10
10
  placeholder?: string;
11
11
  showSearchIcon?: boolean;
12
12
  showItemTag?: boolean;
13
+ showApplyData?: boolean;
13
14
  }
14
15
  declare function __VLS_template(): {
15
16
  history?(_: {
@@ -49,12 +50,14 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
49
50
  lang: string;
50
51
  showSearchIcon: boolean;
51
52
  showItemTag: boolean;
53
+ showApplyData: boolean;
52
54
  }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
53
55
  change: (...args: any[]) => void;
54
56
  select: (...args: any[]) => void;
55
57
  "update:modelValue": (...args: any[]) => void;
56
58
  "submit-search": (...args: any[]) => void;
57
59
  remove: (...args: any[]) => void;
60
+ "apply-data": (...args: any[]) => void;
58
61
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
59
62
  modelValue: null;
60
63
  multiple: boolean;
@@ -64,12 +67,14 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
64
67
  lang: string;
65
68
  showSearchIcon: boolean;
66
69
  showItemTag: boolean;
70
+ showApplyData: boolean;
67
71
  }>>> & Readonly<{
68
72
  onChange?: ((...args: any[]) => any) | undefined;
69
73
  onSelect?: ((...args: any[]) => any) | undefined;
70
74
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
71
75
  "onSubmit-search"?: ((...args: any[]) => any) | undefined;
72
76
  onRemove?: ((...args: any[]) => any) | undefined;
77
+ "onApply-data"?: ((...args: any[]) => any) | undefined;
73
78
  }>, {
74
79
  modelValue: SearchItem | SearchItem[] | null;
75
80
  multiple: boolean;
@@ -79,6 +84,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
79
84
  searchTypeList: string[];
80
85
  showSearchIcon: boolean;
81
86
  showItemTag: boolean;
87
+ showApplyData: boolean;
82
88
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
83
89
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
84
90
  export default _default;
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),R=require("@jctrans-materials/shared"),B=require("element-plus");function pt(t){const n=e.ref([]),o="_search_history_cache",l=typeof window<"u"&&typeof localStorage<"u",r=e.computed(()=>(t.value||"")+o),a=e.computed(()=>!!t.value&&t.value!==""),s=u=>{if(!u||!l)return;const c=n.value.filter(m=>m.id&&m.id!==u.id||m.display!==u.display);c.unshift(u);const d=c.slice(0,4);if(a.value){n.value=d;try{localStorage.setItem(r.value,JSON.stringify(d))}catch(m){console.warn("LocalStorage save failed:",m)}}},i=()=>{n.value=[],l&&localStorage.removeItem(r.value)};return e.onMounted(()=>{if(l&&a.value){const u=localStorage.getItem(r.value);if(u)try{n.value=JSON.parse(u)}catch{n.value=[]}}}),{searchHistory:n,saveToHistory:s,clearHistory:i,HasHistory:a}}async function ht(t,n=["Continent","Country","City","Seaport","Airport"],o={}){return R.locationSearchV2.searchByName({keyword:t,displayInfo:n,...o})}const ke=(t,n)=>R.locationSearchV2.searchByIdWithType(t,n);function gt(t,n){const o=e.ref([]),l=e.ref(!1),r=e.ref(!1),a=e.ref(1),s=e.ref(0),i=e.ref(10),u=e.computed(()=>s.value===0?!1:o.value.length>=s.value),c=e.computed(()=>{const f=[...n.value];return f.includes("Country")&&!f.includes("Region")&&f.push("Region"),f}),d=f=>!f||!Array.isArray(f)?[]:f.filter(p=>c.value.includes(p.type));return{searchResults:o,loading:l,isFetchingMore:r,isFinished:u,currentPage:a,total:s,fetchData:async(f=1,p=!1)=>{if(!t.value.trim()&&!p){o.value=[],s.value=0;return}if(!(p&&(r.value||u.value))&&!(!p&&l.value)){p?r.value=!0:(l.value=!0,a.value=1);try{const h=await ht(t.value,n.value,{current:f,size:i.value}),y=h.records||[],A=d(y);p?o.value=[...o.value,...A]:o.value=A,s.value=h.total||0,a.value=f}catch(h){console.error("Failed to fetch search results:",h)}finally{l.value=!1,r.value=!1}}},filterByTypes:d}}const re=Math.min,I=Math.max,he=Math.round,pe=Math.floor,W=t=>({x:t,y:t}),vt={left:"right",right:"left",bottom:"top",top:"bottom"},yt={start:"end",end:"start"};function Ie(t,n,o){return I(t,re(n,o))}function ue(t,n){return typeof t=="function"?t(n):t}function X(t){return t.split("-")[0]}function de(t){return t.split("-")[1]}function Ke(t){return t==="x"?"y":"x"}function Ge(t){return t==="y"?"height":"width"}const At=new Set(["top","bottom"]);function j(t){return At.has(X(t))?"y":"x"}function ze(t){return Ke(j(t))}function wt(t,n,o){o===void 0&&(o=!1);const l=de(t),r=ze(t),a=Ge(r);let s=r==="x"?l===(o?"end":"start")?"right":"left":l==="start"?"bottom":"top";return n.reference[a]>n.floating[a]&&(s=ge(s)),[s,ge(s)]}function Ct(t){const n=ge(t);return[Ve(t),n,Ve(n)]}function Ve(t){return t.replace(/start|end/g,n=>yt[n])}const Fe=["left","right"],Pe=["right","left"],xt=["top","bottom"],kt=["bottom","top"];function Et(t,n,o){switch(t){case"top":case"bottom":return o?n?Pe:Fe:n?Fe:Pe;case"left":case"right":return n?xt:kt;default:return[]}}function Vt(t,n,o,l){const r=de(t);let a=Et(X(t),o==="start",l);return r&&(a=a.map(s=>s+"-"+r),n&&(a=a.concat(a.map(Ve)))),a}function ge(t){return t.replace(/left|right|bottom|top/g,n=>vt[n])}function St(t){return{top:0,right:0,bottom:0,left:0,...t}}function bt(t){return typeof t!="number"?St(t):{top:t,right:t,bottom:t,left:t}}function ve(t){const{x:n,y:o,width:l,height:r}=t;return{width:l,height:r,top:o,left:n,right:n+l,bottom:o+r,x:n,y:o}}function Ue(t,n,o){let{reference:l,floating:r}=t;const a=j(n),s=ze(n),i=Ge(s),u=X(n),c=a==="y",d=l.x+l.width/2-r.width/2,m=l.y+l.height/2-r.height/2,f=l[i]/2-r[i]/2;let p;switch(u){case"top":p={x:d,y:l.y-r.height};break;case"bottom":p={x:d,y:l.y+l.height};break;case"right":p={x:l.x+l.width,y:m};break;case"left":p={x:l.x-r.width,y:m};break;default:p={x:l.x,y:l.y}}switch(de(n)){case"start":p[s]-=f*(o&&c?-1:1);break;case"end":p[s]+=f*(o&&c?-1:1);break}return p}const Nt=async(t,n,o)=>{const{placement:l="bottom",strategy:r="absolute",middleware:a=[],platform:s}=o,i=a.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(n));let c=await s.getElementRects({reference:t,floating:n,strategy:r}),{x:d,y:m}=Ue(c,l,u),f=l,p={},h=0;for(let y=0;y<i.length;y++){const{name:A,fn:v}=i[y],{x:w,y:k,data:S,reset:b}=await v({x:d,y:m,initialPlacement:l,placement:f,strategy:r,middlewareData:p,rects:c,platform:s,elements:{reference:t,floating:n}});d=w??d,m=k??m,p={...p,[A]:{...p[A],...S}},b&&h<=50&&(h++,typeof b=="object"&&(b.placement&&(f=b.placement),b.rects&&(c=b.rects===!0?await s.getElementRects({reference:t,floating:n,strategy:r}):b.rects),{x:d,y:m}=Ue(c,f,u)),y=-1)}return{x:d,y:m,placement:f,strategy:r,middlewareData:p}};async function Ne(t,n){var o;n===void 0&&(n={});const{x:l,y:r,platform:a,rects:s,elements:i,strategy:u}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:m="floating",altBoundary:f=!1,padding:p=0}=ue(n,t),h=bt(p),A=i[f?m==="floating"?"reference":"floating":m],v=ve(await a.getClippingRect({element:(o=await(a.isElement==null?void 0:a.isElement(A)))==null||o?A:A.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(i.floating)),boundary:c,rootBoundary:d,strategy:u})),w=m==="floating"?{x:l,y:r,width:s.floating.width,height:s.floating.height}:s.reference,k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(i.floating)),S=await(a.isElement==null?void 0:a.isElement(k))?await(a.getScale==null?void 0:a.getScale(k))||{x:1,y:1}:{x:1,y:1},b=ve(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:w,offsetParent:k,strategy:u}):w);return{top:(v.top-b.top+h.top)/S.y,bottom:(b.bottom-v.bottom+h.bottom)/S.y,left:(v.left-b.left+h.left)/S.x,right:(b.right-v.right+h.right)/S.x}}const Bt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(n){var o,l;const{placement:r,middlewareData:a,rects:s,initialPlacement:i,platform:u,elements:c}=n,{mainAxis:d=!0,crossAxis:m=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:y=!0,...A}=ue(t,n);if((o=a.arrow)!=null&&o.alignmentOffset)return{};const v=X(r),w=j(i),k=X(i)===i,S=await(u.isRTL==null?void 0:u.isRTL(c.floating)),b=f||(k||!y?[ge(i)]:Ct(i)),P=h!=="none";!f&&P&&b.push(...Vt(i,y,h,S));const _=[i,...b],L=await Ne(n,A),U=[];let O=((l=a.flip)==null?void 0:l.overflows)||[];if(d&&U.push(L[v]),m){const H=wt(r,s,S);U.push(L[H[0]],L[H[1]])}if(O=[...O,{placement:r,overflows:U}],!U.every(H=>H<=0)){var z,J;const H=(((z=a.flip)==null?void 0:z.index)||0)+1,ee=_[H];if(ee&&(!(m==="alignment"?w!==j(ee):!1)||O.every(V=>j(V.placement)===w?V.overflows[0]>0:!0)))return{data:{index:H,overflows:O},reset:{placement:ee}};let C=(J=O.filter(E=>E.overflows[0]<=0).sort((E,V)=>E.overflows[1]-V.overflows[1])[0])==null?void 0:J.placement;if(!C)switch(p){case"bestFit":{var D;const E=(D=O.filter(V=>{if(P){const T=j(V.placement);return T===w||T==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(T=>T>0).reduce((T,ie)=>T+ie,0)]).sort((V,T)=>V[1]-T[1])[0])==null?void 0:D[0];E&&(C=E);break}case"initialPlacement":C=i;break}if(r!==C)return{reset:{placement:C}}}return{}}}},Rt=new Set(["left","top"]);async function Dt(t,n){const{placement:o,platform:l,elements:r}=t,a=await(l.isRTL==null?void 0:l.isRTL(r.floating)),s=X(o),i=de(o),u=j(o)==="y",c=Rt.has(s)?-1:1,d=a&&u?-1:1,m=ue(n,t);let{mainAxis:f,crossAxis:p,alignmentAxis:h}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return i&&typeof h=="number"&&(p=i==="end"?h*-1:h),u?{x:p*d,y:f*c}:{x:f*c,y:p*d}}const _t=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(n){var o,l;const{x:r,y:a,placement:s,middlewareData:i}=n,u=await Dt(n,t);return s===((o=i.offset)==null?void 0:o.placement)&&(l=i.arrow)!=null&&l.alignmentOffset?{}:{x:r+u.x,y:a+u.y,data:{...u,placement:s}}}}},Ot=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(n){const{x:o,y:l,placement:r}=n,{mainAxis:a=!0,crossAxis:s=!1,limiter:i={fn:A=>{let{x:v,y:w}=A;return{x:v,y:w}}},...u}=ue(t,n),c={x:o,y:l},d=await Ne(n,u),m=j(X(r)),f=Ke(m);let p=c[f],h=c[m];if(a){const A=f==="y"?"top":"left",v=f==="y"?"bottom":"right",w=p+d[A],k=p-d[v];p=Ie(w,p,k)}if(s){const A=m==="y"?"top":"left",v=m==="y"?"bottom":"right",w=h+d[A],k=h-d[v];h=Ie(w,h,k)}const y=i.fn({...n,[f]:p,[m]:h});return{...y,data:{x:y.x-o,y:y.y-l,enabled:{[f]:a,[m]:s}}}}}},Tt=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(n){var o,l;const{placement:r,rects:a,platform:s,elements:i}=n,{apply:u=()=>{},...c}=ue(t,n),d=await Ne(n,c),m=X(r),f=de(r),p=j(r)==="y",{width:h,height:y}=a.floating;let A,v;m==="top"||m==="bottom"?(A=m,v=f===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(v=m,A=f==="end"?"top":"bottom");const w=y-d.top-d.bottom,k=h-d.left-d.right,S=re(y-d[A],w),b=re(h-d[v],k),P=!n.middlewareData.shift;let _=S,L=b;if((o=n.middlewareData.shift)!=null&&o.enabled.x&&(L=k),(l=n.middlewareData.shift)!=null&&l.enabled.y&&(_=w),P&&!f){const O=I(d.left,0),z=I(d.right,0),J=I(d.top,0),D=I(d.bottom,0);p?L=h-2*(O!==0||z!==0?O+z:I(d.left,d.right)):_=y-2*(J!==0||D!==0?J+D:I(d.top,d.bottom))}await u({...n,availableWidth:L,availableHeight:_});const U=await s.getDimensions(i.floating);return h!==U.width||y!==U.height?{reset:{rects:!0}}:{}}}};function ye(){return typeof window<"u"}function ae(t){return Ye(t)?(t.nodeName||"").toLowerCase():"#document"}function F(t){var n;return(t==null||(n=t.ownerDocument)==null?void 0:n.defaultView)||window}function G(t){var n;return(n=(Ye(t)?t.ownerDocument:t.document)||window.document)==null?void 0:n.documentElement}function Ye(t){return ye()?t instanceof Node||t instanceof F(t).Node:!1}function Q(t){return ye()?t instanceof Element||t instanceof F(t).Element:!1}function K(t){return ye()?t instanceof HTMLElement||t instanceof F(t).HTMLElement:!1}function He(t){return!ye()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof F(t).ShadowRoot}const Lt=new Set(["inline","contents"]);function fe(t){const{overflow:n,overflowX:o,overflowY:l,display:r}=$(t);return/auto|scroll|overlay|hidden|clip/.test(n+l+o)&&!Lt.has(r)}const Mt=new Set(["table","td","th"]);function It(t){return Mt.has(ae(t))}const Ft=[":popover-open",":modal"];function Ae(t){return Ft.some(n=>{try{return t.matches(n)}catch{return!1}})}const Pt=["transform","translate","scale","rotate","perspective"],Ut=["transform","translate","scale","rotate","perspective","filter"],Ht=["paint","layout","strict","content"];function Be(t){const n=Re(),o=Q(t)?$(t):t;return Pt.some(l=>o[l]?o[l]!=="none":!1)||(o.containerType?o.containerType!=="normal":!1)||!n&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!n&&(o.filter?o.filter!=="none":!1)||Ut.some(l=>(o.willChange||"").includes(l))||Ht.some(l=>(o.contain||"").includes(l))}function Qt(t){let n=Z(t);for(;K(n)&&!se(n);){if(Be(n))return n;if(Ae(n))return null;n=Z(n)}return null}function Re(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const $t=new Set(["html","body","#document"]);function se(t){return $t.has(ae(t))}function $(t){return F(t).getComputedStyle(t)}function we(t){return Q(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Z(t){if(ae(t)==="html")return t;const n=t.assignedSlot||t.parentNode||He(t)&&t.host||G(t);return He(n)?n.host:n}function je(t){const n=Z(t);return se(n)?t.ownerDocument?t.ownerDocument.body:t.body:K(n)&&fe(n)?n:je(n)}function ce(t,n,o){var l;n===void 0&&(n=[]),o===void 0&&(o=!0);const r=je(t),a=r===((l=t.ownerDocument)==null?void 0:l.body),s=F(r);if(a){const i=Se(s);return n.concat(s,s.visualViewport||[],fe(r)?r:[],i&&o?ce(i):[])}return n.concat(r,ce(r,[],o))}function Se(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Xe(t){const n=$(t);let o=parseFloat(n.width)||0,l=parseFloat(n.height)||0;const r=K(t),a=r?t.offsetWidth:o,s=r?t.offsetHeight:l,i=he(o)!==a||he(l)!==s;return i&&(o=a,l=s),{width:o,height:l,$:i}}function De(t){return Q(t)?t:t.contextElement}function le(t){const n=De(t);if(!K(n))return W(1);const o=n.getBoundingClientRect(),{width:l,height:r,$:a}=Xe(n);let s=(a?he(o.width):o.width)/l,i=(a?he(o.height):o.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}const Jt=W(0);function Ze(t){const n=F(t);return!Re()||!n.visualViewport?Jt:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function qt(t,n,o){return n===void 0&&(n=!1),!o||n&&o!==F(t)?!1:n}function ne(t,n,o,l){n===void 0&&(n=!1),o===void 0&&(o=!1);const r=t.getBoundingClientRect(),a=De(t);let s=W(1);n&&(l?Q(l)&&(s=le(l)):s=le(t));const i=qt(a,o,l)?Ze(a):W(0);let u=(r.left+i.x)/s.x,c=(r.top+i.y)/s.y,d=r.width/s.x,m=r.height/s.y;if(a){const f=F(a),p=l&&Q(l)?F(l):l;let h=f,y=Se(h);for(;y&&l&&p!==h;){const A=le(y),v=y.getBoundingClientRect(),w=$(y),k=v.left+(y.clientLeft+parseFloat(w.paddingLeft))*A.x,S=v.top+(y.clientTop+parseFloat(w.paddingTop))*A.y;u*=A.x,c*=A.y,d*=A.x,m*=A.y,u+=k,c+=S,h=F(y),y=Se(h)}}return ve({width:d,height:m,x:u,y:c})}function Ce(t,n){const o=we(t).scrollLeft;return n?n.left+o:ne(G(t)).left+o}function et(t,n){const o=t.getBoundingClientRect(),l=o.left+n.scrollLeft-Ce(t,o),r=o.top+n.scrollTop;return{x:l,y:r}}function Wt(t){let{elements:n,rect:o,offsetParent:l,strategy:r}=t;const a=r==="fixed",s=G(l),i=n?Ae(n.floating):!1;if(l===s||i&&a)return o;let u={scrollLeft:0,scrollTop:0},c=W(1);const d=W(0),m=K(l);if((m||!m&&!a)&&((ae(l)!=="body"||fe(s))&&(u=we(l)),K(l))){const p=ne(l);c=le(l),d.x=p.x+l.clientLeft,d.y=p.y+l.clientTop}const f=s&&!m&&!a?et(s,u):W(0);return{width:o.width*c.x,height:o.height*c.y,x:o.x*c.x-u.scrollLeft*c.x+d.x+f.x,y:o.y*c.y-u.scrollTop*c.y+d.y+f.y}}function Kt(t){return Array.from(t.getClientRects())}function Gt(t){const n=G(t),o=we(t),l=t.ownerDocument.body,r=I(n.scrollWidth,n.clientWidth,l.scrollWidth,l.clientWidth),a=I(n.scrollHeight,n.clientHeight,l.scrollHeight,l.clientHeight);let s=-o.scrollLeft+Ce(t);const i=-o.scrollTop;return $(l).direction==="rtl"&&(s+=I(n.clientWidth,l.clientWidth)-r),{width:r,height:a,x:s,y:i}}const Qe=25;function zt(t,n){const o=F(t),l=G(t),r=o.visualViewport;let a=l.clientWidth,s=l.clientHeight,i=0,u=0;if(r){a=r.width,s=r.height;const d=Re();(!d||d&&n==="fixed")&&(i=r.offsetLeft,u=r.offsetTop)}const c=Ce(l);if(c<=0){const d=l.ownerDocument,m=d.body,f=getComputedStyle(m),p=d.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,h=Math.abs(l.clientWidth-m.clientWidth-p);h<=Qe&&(a-=h)}else c<=Qe&&(a+=c);return{width:a,height:s,x:i,y:u}}const Yt=new Set(["absolute","fixed"]);function jt(t,n){const o=ne(t,!0,n==="fixed"),l=o.top+t.clientTop,r=o.left+t.clientLeft,a=K(t)?le(t):W(1),s=t.clientWidth*a.x,i=t.clientHeight*a.y,u=r*a.x,c=l*a.y;return{width:s,height:i,x:u,y:c}}function $e(t,n,o){let l;if(n==="viewport")l=zt(t,o);else if(n==="document")l=Gt(G(t));else if(Q(n))l=jt(n,o);else{const r=Ze(t);l={x:n.x-r.x,y:n.y-r.y,width:n.width,height:n.height}}return ve(l)}function tt(t,n){const o=Z(t);return o===n||!Q(o)||se(o)?!1:$(o).position==="fixed"||tt(o,n)}function Xt(t,n){const o=n.get(t);if(o)return o;let l=ce(t,[],!1).filter(i=>Q(i)&&ae(i)!=="body"),r=null;const a=$(t).position==="fixed";let s=a?Z(t):t;for(;Q(s)&&!se(s);){const i=$(s),u=Be(s);!u&&i.position==="fixed"&&(r=null),(a?!u&&!r:!u&&i.position==="static"&&!!r&&Yt.has(r.position)||fe(s)&&!u&&tt(t,s))?l=l.filter(d=>d!==s):r=i,s=Z(s)}return n.set(t,l),l}function Zt(t){let{element:n,boundary:o,rootBoundary:l,strategy:r}=t;const s=[...o==="clippingAncestors"?Ae(n)?[]:Xt(n,this._c):[].concat(o),l],i=s[0],u=s.reduce((c,d)=>{const m=$e(n,d,r);return c.top=I(m.top,c.top),c.right=re(m.right,c.right),c.bottom=re(m.bottom,c.bottom),c.left=I(m.left,c.left),c},$e(n,i,r));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function en(t){const{width:n,height:o}=Xe(t);return{width:n,height:o}}function tn(t,n,o){const l=K(n),r=G(n),a=o==="fixed",s=ne(t,!0,a,n);let i={scrollLeft:0,scrollTop:0};const u=W(0);function c(){u.x=Ce(r)}if(l||!l&&!a)if((ae(n)!=="body"||fe(r))&&(i=we(n)),l){const p=ne(n,!0,a,n);u.x=p.x+n.clientLeft,u.y=p.y+n.clientTop}else r&&c();a&&!l&&r&&c();const d=r&&!l&&!a?et(r,i):W(0),m=s.left+i.scrollLeft-u.x-d.x,f=s.top+i.scrollTop-u.y-d.y;return{x:m,y:f,width:s.width,height:s.height}}function Ee(t){return $(t).position==="static"}function Je(t,n){if(!K(t)||$(t).position==="fixed")return null;if(n)return n(t);let o=t.offsetParent;return G(t)===o&&(o=o.ownerDocument.body),o}function nt(t,n){const o=F(t);if(Ae(t))return o;if(!K(t)){let r=Z(t);for(;r&&!se(r);){if(Q(r)&&!Ee(r))return r;r=Z(r)}return o}let l=Je(t,n);for(;l&&It(l)&&Ee(l);)l=Je(l,n);return l&&se(l)&&Ee(l)&&!Be(l)?o:l||Qt(t)||o}const nn=async function(t){const n=this.getOffsetParent||nt,o=this.getDimensions,l=await o(t.floating);return{reference:tn(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}};function on(t){return $(t).direction==="rtl"}const ln={convertOffsetParentRelativeRectToViewportRelativeRect:Wt,getDocumentElement:G,getClippingRect:Zt,getOffsetParent:nt,getElementRects:nn,getClientRects:Kt,getDimensions:en,getScale:le,isElement:Q,isRTL:on};function ot(t,n){return t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height}function rn(t,n){let o=null,l;const r=G(t);function a(){var i;clearTimeout(l),(i=o)==null||i.disconnect(),o=null}function s(i,u){i===void 0&&(i=!1),u===void 0&&(u=1),a();const c=t.getBoundingClientRect(),{left:d,top:m,width:f,height:p}=c;if(i||n(),!f||!p)return;const h=pe(m),y=pe(r.clientWidth-(d+f)),A=pe(r.clientHeight-(m+p)),v=pe(d),k={rootMargin:-h+"px "+-y+"px "+-A+"px "+-v+"px",threshold:I(0,re(1,u))||1};let S=!0;function b(P){const _=P[0].intersectionRatio;if(_!==u){if(!S)return s();_?s(!1,_):l=setTimeout(()=>{s(!1,1e-7)},1e3)}_===1&&!ot(c,t.getBoundingClientRect())&&s(),S=!1}try{o=new IntersectionObserver(b,{...k,root:r.ownerDocument})}catch{o=new IntersectionObserver(b,k)}o.observe(t)}return s(!0),a}function sn(t,n,o,l){l===void 0&&(l={});const{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:u=!1}=l,c=De(t),d=r||a?[...c?ce(c):[],...ce(n)]:[];d.forEach(v=>{r&&v.addEventListener("scroll",o,{passive:!0}),a&&v.addEventListener("resize",o)});const m=c&&i?rn(c,o):null;let f=-1,p=null;s&&(p=new ResizeObserver(v=>{let[w]=v;w&&w.target===c&&p&&(p.unobserve(n),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var k;(k=p)==null||k.observe(n)})),o()}),c&&!u&&p.observe(c),p.observe(n));let h,y=u?ne(t):null;u&&A();function A(){const v=ne(t);y&&!ot(y,v)&&o(),y=v,h=requestAnimationFrame(A)}return o(),()=>{var v;d.forEach(w=>{r&&w.removeEventListener("scroll",o),a&&w.removeEventListener("resize",o)}),m?.(),(v=p)==null||v.disconnect(),p=null,u&&cancelAnimationFrame(h)}}const an=_t,cn=Ot,un=Bt,dn=Tt,fn=(t,n,o)=>{const l=new Map,r={platform:ln,...o},a={...r.platform,_c:l};return Nt(t,n,{...r,platform:a})};function mn(t,n){const o=e.ref({position:"fixed",left:"0",top:"0",zIndex:3e3});let l=null;const r=()=>{!t.value||!n.value||fn(t.value,n.value,{placement:"bottom-start",strategy:"fixed",middleware:[an(6),un(),cn({padding:10}),dn({apply({rects:i,elements:u}){const c=`${i.reference.width}px`;Object.assign(u.floating.style,{width:c,minWidth:c,maxWidth:c})}})]}).then(({x:i,y:u})=>{Object.assign(o.value,{left:`${i}px`,top:`${u}px`})})},a=()=>{t.value&&n.value&&(l=sn(t.value,n.value,r))},s=()=>{l&&(l(),l=null)};return e.onBeforeUnmount(s),{floatingStyles:o,startTrack:a,stopTrack:s}}const pn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACT0lEQVR4AaRSO2hTYRT+zn9v2g6CiktFJYoVHXQoOljM2EIEh0orbRKa5qUuDoIZAnXI4FBwcRDikMcNkoQMQjcVESo4OASsW2kLBi3oUKiD1OZx7/H811wJZFF6uOee85/H93/3nKtwQPkvgFKpdKRgVR+UrFrOsurX9N3/DJCvVPxMwx+lKcbgKzbstPhwAXSyWK7eLZZrc4VCNZDPPx/Tt+kCrTqvOrQqfuNrc2OcgW0CduQM9TfJyIB5mQy8UaaxKbftFq3qL9HP1KGGFDe+NDdC/jPnlwgcZEM9lRiU2VFjgngI4FGxa0IvZXecU07XPsc2pkCUIULaa2Z2MsJ7Orkw/8kFiMVCb4XWcQV14w8temL4aJNM47Fh0OHEYqieWAyXT/jPBhzmh7o5EY28Rk/cGWSz2a4GSsTCt3tgs5qmDc726sTQvsS6/c0SFDz97lO/329K4z2Amm1u3ZK11SyrOmNC/ZDYSElWiT5R2resymUZ1pIUv2Qa+iafcrrFretDNJwTf94GUnt7u9u6to3hUW09dQEcIC+BR0LxqgztPnFrotd8wWHclNykaR4dYeCngj0IQNyekOQshLas8hmzLyA3B2UTU6l4eEX8Ld8IZsTu+Mg4hj5xGcTj8f1kLPxChjgO0AdWlAOwnkotbImFrHGFGdOy6u82aJAB+kUZywQ6KaH3ou7TcbguziRApiLWOXjiMvAO2iaic3rH6wxe1Wetd+KRNQKEDV9kwisd83QAQCfkr7uUjEUq2vdUgdJQFExEw++8mLa/AQAA//9h0VsEAAAABklEQVQDAKhs6Pxd3K8TAAAAAElFTkSuQmCC",hn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACgUlEQVR4AXRST0hUYRD/zbfbrqahQpAHlQ3dSurYoaBAwWNQkIT7J/ve09DQsOigkNCha4ckl4Lct0/S3QI7REFEBB08FBHRIYLwIJEodOlUurnfNN+6mq9weMPM+818v2/mm1HYQXK5XH02mz9h1fo7pOE/gkwmU+v5+fuGot8phJdWmSLLnl+4I0RV/xIFCGxCdU3DUwaOkULX18Uve1ydrC4xdwLcwRR9bnO2kwQIoCIDEowpXjsZ4vBCSyx+w/Nnb1KElkkwG4OqGhG79QUImEkT0T2JrpZ4fV5sF0Ad6je9BrBKxLeZuVv8rS9IAG4qGf5oTPSolNxIXOyUNjqlpb0W4xI+Cd62dVqcAAGBVqSCVmPMIoPCttzm2MEBAoeLir4hRK2AWPyVIAHRHMH0Ly0tCBF3M5t+Aq6A0HPJSSyCeZAIz7BNAgQwqxNyc1NL7MCoeyH1xNWpuKsTcet7fv46QI0/zdoEtkmAwHGcHyFQj/Q57vuPzm7m+X5efB6HYj3kOCubuLVlApltfdbPX5uaetCmdeKVAqUN1mdy04XR3PTsqAHPWMztTb24myvEBBuRM+WlUnbzDEXeya2D4XC0zrJqnXwsO3pG3mCMGWMK6lQZk2A0hH2GMSxL9VlI6lVkd90RgGKkVFrrc+9REXubjLH9FxfbbVUVGG5v4i2p8LD8x9ax65C66KTfKGCSDc97fv6DJzuf9QtDtm+iqsM1ot70w9O+YDbmSQ6bkkyCJitnAUcnryqmuExgSsZYKypvgFvS+5xVsJk0MGlps97mFCVXpnNZqoBcbo2QyJz7dCLj6JTj6tRxVyf3izZUtNndwM73SU55JzaO4Q8AAAD//54At5MAAAAGSURBVAMAh2IbMAJQAZQAAAAASUVORK5CYII=",gn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACC0lEQVR4AXxRv2tTURT+zk1iIjgoOMShkIJVNwf/gQYULOjQwaGvGl8TBMEMDg4ODgF17likvL4HIYm4OLg61K2CooWKDoKCDoJDHASb9N17POf5Enwk6eN+9/z+3nfvNZjxbYS9ymbYXlQ8CbvnZrRhKoEOFMl9zFHuuaJA/E4Jp5FMJTCwZWner/veCYX6ecQVsRNrKsFE1yGJDMFW1Hm4FXX7hnIvADquvkJ9zYn/U3vw35chYOA2Ebcc26uWbVWwnKKqOak9ktmmYLwyBATkY+d2b63d2FYgps9umNtTX6G18WTqmNRmTNB+djaIOqEpmC+FIn8Lom4vaD89n2lKgwkCebYNsvEnAlXI4CIMXSagTNa9l9p6Ojc2CUEYhiW5oE3IxQH4AYNFeb5qvea9SuB7Vc1J7ReDjomidZ2RWNKysyneFHNFovGgxIiizoWR9BGRqiKw76i0qj2JAo7jtwycJDvY1eQIDNM0lu+OYrUHf/BBbEmI9sTKP2VvNGpvAP4Kc1SVSGb2OlLiVQa+12srr7UrUZA6Lx27e0HUu6PnU/kOXGbwaT1Gq9XKa80xmgTa1hlFQiBP1hNWn4AdOd8DpmLfgnakYV/yv/UF5ipn+qLyvgGp2us6I/V/R+DYPiYenpKbv0Y8mGeLS0OmhYbvLQuWiGkeFkuGBwtrvrdyMKA5nVGCvwAAAP//q4xnOgAAAAZJREFUAwCH2O8KfEWHWQAAAABJRU5ErkJggg==",vn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACmklEQVR4AXRTT0jUQRT+3uyqGxgYeCiy1JAo6JBUp4Q81EEiKKiDa+H+/ENGHgPpZtChQ4EHL+Ku+9t0V7EkQSGPBYGHBIU6RAqt2cFDBw9C+3de3yy7hobDvHm/+d4337x58xuDQ9r4+FRDLJZqG49PtrvvQ2j4TyDmJ7sm/NRqoMpsIYD3RgIL7pvY54lEqvug0J5APB4PxfzUOwFGRWReVJp7I+GjW+nvxxQo0DagOjLhJxcctyK0J6BS/UaAc1nNtXrdnc88rzPtSMPDwwXiM7R2WNwDpMVKzTTKrSRQTq0tq9mOR55XWliOY2wsVQ+RRWZQiyACjiPQ9pg/0+U4JQEoBkXMi4OLmWpdsEZXofY5yYtSzH10HHJHBPYJMZhyhS8X84U5B+y36iaBNPxMr59nPTo9z8uU4jaToL8Yj88eN2xNTG+3r+/BBncMuSLRln1/+iZgdkhEY2NjvfMVo1DarbG20GIqoPMaqL5G38Zb+GBh36roMufpzc3N3xSvi0ZfX6APEYNAg86bjMluCFDr+7OX1JoWQNJed/ipaK6Z6oOi2dbTZ85eVan+YYLBL7yBdRb9IXkha23aPPa8bQBrFoUVqo4qMMU5mOZ2JBKeo98RiwHi8xQ7Qo6vCsdb6e+//4ubgJegLzlmDOQ6i/XKCVQskZg9aaFtRrBGsYytQpQiu+SPOI5xQ2+kK6mQJRJHo8lko8MqxswGhceCzY25mMnLEmOf3Br6f2/BaLaTqhuSl6/xxPRQNDrJehBRrSWxABMaMnmsKfCN9eEfSZS9lAG9O3OmJ9J1C9ABVb1rgoF1PqA/Cokw3k7stgKDvZHwHXcUYqW+J1CacejlcXoi4SvFvD2lRdxAER0s3glirS5Gyr7+FwAA//8Pj6q2AAAABklEQVQDAJPeLlNn5TR8AAAAAElFTkSuQmCC",yn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABFUlEQVR4AaRQO07DQBCdWe8B4B5IFFyAK9ARkIVNhIQEEiVtJLgABRVRvIBCJBquwBVyDgoaSnuHeZY3MlYcNsnIb8fze6M3hra0XoKJm95N3Nv3EnyhFvb2EgjRJbOMKqmO2tDcvQ5fK+qvl4CJbOn9/CJPP9tArp5sHtP4lc652VXxPL1Z1hRFIOytF1NuTJCfnT4Ms8HjSgJctn1xIt6hxqIkdK+u8U8zT1ESmP5enUkWmqMkhG2FmxXOvR+EGD5KAhoDqsQvtiMXJQGNQJ4N8mF6PMd/wL8SxuOXPSG21pj9p+L1EOjGyAHoQQ0zWGDqx9pbPWIpwqOEkw+gGyMHoAc1ozOkVhOcZyepYndNpDpPvwAAAP//BVQJHAAAAAZJREFUAwDZWL4hub5xHQAAAABJRU5ErkJggg==",be="data:image/svg+xml,%3csvg%20t='1695277594902'%20fill='%23fff'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='2534'%20width='200'%20height='200'%3e%3cpath%20d='M448%2085.333333a362.666667%20362.666667%200%201%200%20224.512%20647.509334l155.818667%20155.818666a42.666667%2042.666667%200%200%200%2060.330666-60.330666l-155.818666-155.818667A362.666667%20362.666667%200%200%200%20448%2085.333333zM170.666667%20448a277.333333%20277.333333%200%201%201%20554.666666%200%20277.333333%20277.333333%200%200%201-554.666666%200z'%20p-id='2535'%3e%3c/path%3e%3c/svg%3e",An={class:"search-container"},wn={class:"selection-wrapper"},Cn={class:"tag-text"},xn=["onClick"],kn={key:0,class:"search-tag collapse"},En=["placeholder"],Vn={class:"suffix-area"},Sn={key:1,class:"loading-spinner"},bn={class:"search-icon"},Nn=["src"],Bn={key:0,class:"history-section"},Rn={class:"history-header"},Dn=["onMousedown"],_n=["src"],On={class:"type-text"},Tn={class:"result-text"},Ln={key:0,class:"status-msg"},Mn=["onMousedown"],In=["src"],Fn={class:"type-text"},Pn={class:"result-text"},Un={key:0,class:"load-more-msg"},Hn={key:1,class:"load-more-msg no-more"},Qn={key:2,class:"status-msg"},$n=e.defineComponent({__name:"index",props:{modelValue:{default:null},multiple:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},searchTypeList:{default:()=>["Continent","Country","Region","City","Seaport","Airport"]},historyKey:{default:void 0},lang:{default:""},placeholder:{},showSearchIcon:{type:Boolean,default:!0},showItemTag:{type:Boolean,default:!0}},emits:["update:modelValue","select","change","submit-search","remove"],setup(t,{emit:n}){const o=t,l=n,r=e.ref(null),a=e.ref(null),s=e.ref(null),i=e.ref(""),u=e.ref(""),c=e.ref(!1),d=e.ref(!1);let m=null;const f=e.computed(()=>o.modelValue?Array.isArray(o.modelValue)?o.modelValue:[o.modelValue]:[]),p=e.computed(()=>o.multiple?o.collapseTags?f.value.slice(0,1):f.value:[]),h=e.computed(()=>i.value||f.value.length>0),y=e.computed(()=>o.multiple?i.value?`${i.value.length*10+20}px`:"10px":"100%"),{searchHistory:A,saveToHistory:v,clearHistory:w}=pt(e.toRef(o,"historyKey")),{searchResults:k,loading:S,isFetchingMore:b,isFinished:P,currentPage:_,fetchData:L,filterByTypes:U}=gt(i,e.toRef(o,"searchTypeList")),{floatingStyles:O,startTrack:z,stopTrack:J}=mn(a,s),D=e.computed(()=>{if(o.lang)return o.lang==="en"||o.lang==="en-US";try{if(typeof useCookie=="function"){const g=useCookie("jc-language")?.value;if(g)return/^en(-US)?$/.test(g)}}catch{}if(typeof document<"u"){const g=document.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(g)}try{if(typeof useNuxtApp=="function"){const N=useNuxtApp()?.ssrContext?.event?.node?.req?.headers?.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(N)}}catch{}return!1}),H=e.computed(()=>o.multiple&&f.value.length>0?"":c.value&&!o.multiple?u.value:o.placeholder?o.placeholder:D.value?"Please enter...":"请输入..."),ee=()=>r.value?.focus(),C=g=>{if(v(g),o.multiple){if(!f.value.some(x=>x.id===g.id)){const x=[...f.value,g];l("update:modelValue",x)}i.value=""}else u.value=oe(g),c.value=!0,i.value="",d.value=!1,l("update:modelValue",g);l("select",g),l("change",g)},E=g=>{const N=f.value.filter(x=>x.id!==g.id);l("update:modelValue",N),l("remove",g)},V=()=>{o.multiple&&!i.value&&f.value.length>0&&E(f.value[f.value.length-1])},T=()=>{i.value="",c.value=!1,u.value="",l("update:modelValue",o.multiple?[]:null)},ie=async()=>{if(d.value=!0,!o.multiple&&c.value&&k.value.length===0){const g=o.modelValue;if(g?.id){S.value=!0;try{const N=await ke(g.id,g.type);k.value=U(N.records)}finally{S.value=!1}}}},at=()=>setTimeout(()=>d.value=!1,200),it=g=>{g.target.value===""&&!o.multiple&&T()},ct=()=>{l("submit-search",f.value),d.value=!1},ut=g=>{const{scrollTop:N,scrollHeight:x,clientHeight:M}=g.target;N+M>=x-20&&!S.value&&!b.value&&!P.value&&i.value&&L(_.value+1,!0)};e.watch(d,g=>{g?z():J()}),e.watch(i,g=>{if(!g.trim()){k.value=[];return}m&&clearTimeout(m),m=setTimeout(()=>L(1,!1),300)}),e.watch(()=>o.modelValue,async(g,N)=>{if(JSON.stringify(g)===JSON.stringify(N))return;if(o.multiple&&Array.isArray(g)){const M=[...g],Y=M.filter(q=>q&&q.id&&q.type&&!q.display);if(Y.length>0)try{const q=Y.map(te=>te.id).filter(te=>te!=null),xe=await ke(q,Y[0].type);if(xe&&xe.records){let te=!1;const ft=M.map(me=>{const Me=xe.records.find(mt=>mt.id===me.id);return Me&&!me.display?(te=!0,{...me,...Me}):me});te&&l("update:modelValue",ft)}}catch(q){console.error("Batch fetch detail failed:",q)}return}const x=g;if(!x){c.value=!1,u.value="";return}if(typeof x=="object")if(x.id&&x.type&&!x.display)try{const Y=(await ke(x.id,x.type)).records.find(q=>q.id===x.id);Y&&(u.value=oe(Y),c.value=!0)}catch(M){console.error("Single fetch detail failed:",M)}else u.value=oe(x),c.value=!!u.value;else u.value=String(x),c.value=!!x},{immediate:!0,deep:!0});const Te=g=>({City:yn,Country:vn,Airport:pn,Seaport:gn})[g]||hn,oe=g=>D.value?g.displayEn||g.display||"":g.displayCn||g.display||"",Le=g=>{const N={City:{en:"City",cn:"城市"},Country:{en:"Country",cn:"国家"},Region:{en:"Region",cn:"区域"},Airport:{en:"Airport",cn:"机场"},Seaport:{en:"Seaport",cn:"港口"}};return D.value?N[g].en:N[g].cn},dt=g=>f.value.some(N=>N.id===g.id);return e.onBeforeUnmount(J),(g,N)=>(e.openBlock(),e.createElementBlock("div",An,[e.createElementVNode("div",{class:e.normalizeClass(["search-input-wrapper",{"is-multiple":t.multiple}]),ref_key:"referenceRef",ref:a,onClick:ee},[e.createElementVNode("div",wn,[t.multiple&&f.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(x,M)=>(e.openBlock(),e.createElementBlock("div",{key:x.id||M,class:"search-tag"},[e.createElementVNode("span",Cn,e.toDisplayString(oe(x)),1),e.createElementVNode("span",{class:"tag-close",onClick:e.withModifiers(Y=>E(x),["stop"])},"×",8,xn)]))),128)),t.collapseTags&&f.value.length>1?(e.openBlock(),e.createElementBlock("div",kn," + "+e.toDisplayString(f.value.length-1),1)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:r,class:e.normalizeClass({"is-selected-state":c.value&&!t.multiple}),"onUpdate:modelValue":N[0]||(N[0]=x=>i.value=x),type:"text",placeholder:H.value,style:e.normalizeStyle({width:y.value}),onFocus:ie,onBlur:at,onInput:it,onKeydown:e.withKeys(V,["delete"])},null,46,En),[[e.vModelText,i.value]])]),e.createElementVNode("div",Vn,[h.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"clear-icon",onMousedown:N[1]||(N[1]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(T,["stop"])},"ⓧ",32)):e.createCommentVNode("",!0),e.unref(S)&&!e.unref(b)?(e.openBlock(),e.createElementBlock("div",Sn)):!e.unref(S)&&t.showSearchIcon?(e.openBlock(),e.createElementBlock("button",{key:2,class:"search-btn",onClick:e.withModifiers(ct,["stop"])},[e.createElementVNode("span",bn,[e.createElementVNode("img",{src:e.unref(be),alt:"search"},null,8,Nn)])])):e.createCommentVNode("",!0)])],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.withDirectives(e.createElementVNode("div",{ref_key:"floatingRef",ref:s,class:"dropdown-list",style:e.normalizeStyle(e.unref(O)),onScroll:ut},[e.renderSlot(g.$slots,"history",{searchHistory:e.unref(A)},()=>[e.unref(A).length>0&&!i.value?(e.openBlock(),e.createElementBlock("div",Bn,[e.createElementVNode("div",Rn,[e.createElementVNode("span",null,e.toDisplayString(D.value?"Recent search":"最近搜索"),1),e.createElementVNode("span",{class:"clear-btn",onMousedown:N[2]||(N[2]=e.withModifiers(()=>{},["prevent"])),onClick:N[3]||(N[3]=e.withModifiers((...x)=>e.unref(w)&&e.unref(w)(...x),["stop"]))},e.toDisplayString(D.value?"Clear":"清空"),33)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(A),(x,M)=>(e.openBlock(),e.createElementBlock("div",{key:"hist-"+M,class:"dropdown-item",onMousedown:Y=>C(x)},[e.createElementVNode("div",{class:"category-tag",style:e.normalizeStyle(t.showItemTag?{}:{display:"none"})},[e.createElementVNode("img",{class:"type-icon",src:Te(x.type),alt:""},null,8,_n),e.createElementVNode("span",On,e.toDisplayString(Le(x.type)),1)],4),e.createElementVNode("div",Tn,e.toDisplayString(oe(x)),1)],40,Dn))),128)),N[4]||(N[4]=e.createElementVNode("hr",{class:"divider"},null,-1))])):e.createCommentVNode("",!0)],!0),e.unref(S)&&!e.unref(b)?(e.openBlock(),e.createElementBlock("div",Ln,e.toDisplayString(D.value?"Searching...":"正在搜索中..."),1)):e.unref(k).length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(g.$slots,"results",{searchResults:e.unref(k)},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(k),(x,M)=>(e.openBlock(),e.createElementBlock("div",{key:M,class:e.normalizeClass(["dropdown-item",{"is-active":dt(x)}]),onMousedown:Y=>C(x)},[e.createElementVNode("div",{class:"category-tag",style:e.normalizeStyle(t.showItemTag?{}:{display:"none"})},[e.createElementVNode("img",{class:"type-icon",src:Te(x.type),alt:""},null,8,In),e.createElementVNode("span",Fn,e.toDisplayString(Le(x.type)),1)],4),e.createElementVNode("div",Pn,e.toDisplayString(oe(x)),1)],42,Mn))),128))],!0),e.unref(b)?(e.openBlock(),e.createElementBlock("div",Un,e.toDisplayString(D.value?"Loading more...":"正在加载更多..."),1)):e.unref(P)&&i.value?(e.openBlock(),e.createElementBlock("div",Hn,e.toDisplayString(D.value?"All results have been loaded":"已加载全部结果"),1)):e.createCommentVNode("",!0)],64)):i.value&&!e.unref(S)?(e.openBlock(),e.createElementBlock("div",Qn,[e.renderSlot(g.$slots,"noData",{},()=>[e.createTextVNode(e.toDisplayString(D.value?`No results found related to "${i.value}".`:`未找到与 "${i.value}" 相关的结果`),1)],!0)])):e.createCommentVNode("",!0)],36),[[e.vShow,d.value&&(e.unref(k).length>0||e.unref(S)||i.value||e.unref(A).length>0)]])]))]))}}),_e=(t,n)=>{const o=t.__vccOpts||t;for(const[l,r]of n)o[l]=r;return o},Oe=_e($n,[["__scopeId","data-v-af778256"]]),Jn={class:"modal-container"},qn={class:"modal-header"},Wn={class:"header-title"},Kn={class:"modal-body"},Gn={class:"form-item"},zn={class:"required"},Yn={class:"input-box"},jn=["placeholder"],Xn={key:0,class:"error-message"},Zn={class:"form-item"},eo={class:"required"},to={class:"type-group"},no=["onClick"],oo={key:0,class:"check-mark"},lo={class:"form-item"},ro={class:"required"},so={key:0,class:"error-message"},ao={class:"modal-footer"},io={__name:"ApplyDataDialog",props:{value:{type:Boolean,default:!1},lang:{type:String,default:"en",validator:t=>["en","en-US","zh-CN","cn"].includes(t)},placeholder:{type:String,default:""}},emits:["update:value","confirm"],setup(t,{emit:n}){const o=t,l=n,r=[{typeCn:"城市",typeEn:"City",type:"City"},{typeCn:"海运港口",typeEn:"Port",type:"Seaport"},{typeCn:"机场",typeEn:"Airport",type:"Airport"}],a=e.ref(null),s=e.reactive({name:"",country:""}),i=e.reactive({name:"",type:"City"}),u=e.computed(()=>{if(o.lang)return o.lang==="en"||o.lang==="en-US";try{if(typeof useCookie=="function"){const m=useCookie("jc-language")?.value;if(m)return/^en(-US)?$/.test(m)}}catch{}if(typeof document<"u"){const m=document.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(m)}try{if(typeof useNuxtApp=="function"){const f=useNuxtApp()?.ssrContext?.event?.node?.req?.headers?.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(f)}}catch{}return!1}),c=()=>{s.name="",s.country="",l("update:value",!1)},d=()=>{s.name="",s.country="";let m=!0;i.name.trim()||(s.name="Data name is required",m=!1),a.value||(s.country="Please select a country",m=!1),m&&l("confirm",{...i,country:a.value})};return(m,f)=>t.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"modal-mask",onClick:e.withModifiers(c,["self"])},[e.createElementVNode("div",Jn,[e.createElementVNode("div",qn,[e.createElementVNode("span",Wn,e.toDisplayString(u.value?"Apply for data addition":"申请补充数据"),1),e.createElementVNode("div",{class:"close-btn",onClick:c},"×")]),e.createElementVNode("div",Kn,[e.createElementVNode("div",Gn,[e.createElementVNode("label",zn,e.toDisplayString(u.value?"Data To Add":"需补充的数据"),1),e.createElementVNode("div",Yn,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=p=>i.name=p),type:"text",placeholder:t.placeholder??(u.value?" Please enter":"请输入"),class:e.normalizeClass(["custom-input",{"input-error":s.name}]),onInput:f[1]||(f[1]=p=>s.name="")},null,42,jn),[[e.vModelText,i.name]])]),s.name?(e.openBlock(),e.createElementBlock("div",Xn,e.toDisplayString(s.name),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Zn,[e.createElementVNode("label",eo,e.toDisplayString(u.value?"Type":"所属类别"),1),e.createElementVNode("div",to,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,p=>e.createElementVNode("div",{key:p.type,class:e.normalizeClass(["type-btn",{active:i.type===p.type}]),onClick:h=>i.type=p.type},[e.createTextVNode(e.toDisplayString(u.value?p.typeEn:p.typeCn)+" ",1),i.type===p.type?(e.openBlock(),e.createElementBlock("div",oo)):e.createCommentVNode("",!0)],10,no)),64))])]),e.createElementVNode("div",lo,[e.createElementVNode("label",ro,e.toDisplayString(u.value?"Country":"国家"),1),e.createElementVNode("div",{class:e.normalizeClass({"search-error-wrap":s.country})},[e.createVNode(Oe,{"search-type-list":["Country"],"model-value":a.value,"onUpdate:modelValue":[f[2]||(f[2]=p=>a.value=p),f[3]||(f[3]=p=>s.country="")],style:{margin:"0 auto"},lang:t.lang,placeholder:t.placeholder??(u.value?" Please enter":"请输入")},null,8,["model-value","lang","placeholder"])],2),s.country?(e.openBlock(),e.createElementBlock("div",so,e.toDisplayString(s.country),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",ao,[e.createElementVNode("button",{class:"confirm-btn",onClick:d},e.toDisplayString(u.value?"Submit":"申请补充"),1)])])])):e.createCommentVNode("",!0)}},lt=_e(io,[["__scopeId","data-v-9c778fb9"]]),co={class:"global-modal-header-custom"},uo={class:"global-modal-body-custom"},fo={class:"global-modal-footer-custom"},rt=e.defineComponent({__name:"GlobalModal",setup(t){const n=e.ref(),o=e.ref(!1),l=e.ref({city:"",company:"",email:"",phone:"",name:"",agreement:!1}),r=e.reactive({city:[{required:!0,message:"请输入所在地城市",trigger:"blur"}],company:[{required:!0,message:"请输入公司名称",trigger:"blur"}],email:[{required:!0,message:"请输入邮箱",trigger:"blur"},{type:"email",message:"请输入有效的邮箱地址",trigger:"blur"}],agreement:[{validator:(u,c,d)=>{c?d():d(new Error("请同意隐私政策"))},trigger:"change"}]}),a=()=>{o.value=!1,R.emitter.emit(R.MODAL_ACTION.Close,void 0),n.value?.resetFields()},s=async()=>{n.value&&await n.value.validate(u=>{u&&(R.emitter.emit(R.MODAL_ACTION.Submit,l.value),a(),l.value={city:"",company:"",email:"",phone:"",name:"",agreement:!1})})},i=u=>{o.value=!0};return e.onMounted(()=>{R.emitter.on(R.MODAL_ACTION.Open,i)}),e.onUnmounted(()=>{R.emitter.off(R.MODAL_ACTION.Open,i)}),(u,c)=>(e.openBlock(),e.createBlock(e.unref(B.ElDialog),{modelValue:o.value,"onUpdate:modelValue":c[7]||(c[7]=d=>o.value=d),"before-close":a,"show-close":!1,"close-on-click-modal":!0,width:500,class:"global-modal-custom"},{header:e.withCtx(()=>[e.createElementVNode("div",co,[c[9]||(c[9]=e.createElementVNode("h2",null,"即刻链接全球货代",-1)),e.createVNode(e.unref(B.ElButton),{link:"",onClick:a,class:"close-button-custom","aria-label":"Close"},{default:e.withCtx(()=>[...c[8]||(c[8]=[e.createElementVNode("span",{style:{"font-size":"2rem"}},"×",-1)])]),_:1})])]),footer:e.withCtx(()=>[e.createElementVNode("div",fo,[e.createVNode(e.unref(B.ElButton),{type:"primary",class:"submit-button-custom",onClick:s},{default:e.withCtx(()=>[...c[11]||(c[11]=[e.createTextVNode(" 加入会员 ",-1)])]),_:1})])]),default:e.withCtx(()=>[e.createElementVNode("div",uo,[e.createVNode(e.unref(B.ElForm),{model:l.value,rules:r,ref_key:"formRef",ref:n,"label-position":"top",onSubmit:c[6]||(c[6]=e.withModifiers(()=>{},["prevent"]))},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElRow),{gutter:20},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElCol),{span:12},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElFormItem),{label:"所在地(城市)",prop:"city"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElInput),{modelValue:l.value.city,"onUpdate:modelValue":c[0]||(c[0]=d=>l.value.city=d),placeholder:"请输入城市"},null,8,["modelValue"])]),_:1})]),_:1}),e.createVNode(e.unref(B.ElCol),{span:12},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElFormItem),{label:"公司名称",prop:"company"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElInput),{modelValue:l.value.company,"onUpdate:modelValue":c[1]||(c[1]=d=>l.value.company=d),placeholder:"请输入公司名称"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e.createVNode(e.unref(B.ElRow),{gutter:20},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElCol),{span:12},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElFormItem),{label:"邮箱",prop:"email"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElInput),{modelValue:l.value.email,"onUpdate:modelValue":c[2]||(c[2]=d=>l.value.email=d),placeholder:"请输入邮箱"},null,8,["modelValue"])]),_:1})]),_:1}),e.createVNode(e.unref(B.ElCol),{span:12},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElFormItem),{label:"电话",prop:"phone"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElInput),{modelValue:l.value.phone,"onUpdate:modelValue":c[3]||(c[3]=d=>l.value.phone=d),placeholder:"请输入电话"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e.createVNode(e.unref(B.ElRow),null,{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElCol),{span:24},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElFormItem),{label:"姓名",prop:"name"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElInput),{modelValue:l.value.name,"onUpdate:modelValue":c[4]||(c[4]=d=>l.value.name=d),placeholder:"请输入您的全名"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e.createVNode(e.unref(B.ElFormItem),{prop:"agreement",class:"agreement-item"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElCheckbox),{modelValue:l.value.agreement,"onUpdate:modelValue":c[5]||(c[5]=d=>l.value.agreement=d),label:"我同意"},null,8,["modelValue"]),c[10]||(c[10]=e.createElementVNode("a",{href:"#",class:"privacy-link"},"隐私政策",-1))]),_:1})]),_:1},8,["model","rules"])])]),_:1},8,["modelValue"]))}});function mo(t){const n=e.ref([]),o="_search_history_cache",l=typeof window<"u"&&typeof localStorage<"u",r=e.computed(()=>(t.value||"")+o),a=e.computed(()=>!!t.value&&t.value!==""),s=u=>{if(!u||!l)return;const c=n.value.filter(m=>m.id&&m.id!==u.id||m.display!==u.display);c.unshift(u);const d=c.slice(0,4);if(a.value){n.value=d;try{localStorage.setItem(r.value,JSON.stringify(d))}catch(m){console.warn("LocalStorage save failed:",m)}}},i=()=>{n.value=[],l&&localStorage.removeItem(r.value)};return e.onMounted(()=>{if(l&&a.value){const u=localStorage.getItem(r.value);if(u)try{n.value=JSON.parse(u)}catch{n.value=[]}}}),{searchHistory:n,saveToHistory:s,clearHistory:i,HasHistory:a}}async function po(t,n=["Continent","Country","City","Seaport","Airport"],o={}){return R.locationSearchV2.searchByName({keyword:t,displayInfo:n,...o})}function ho(t,n){const o=e.ref([]),l=e.ref(!1),r=e.ref(!1),a=e.ref(!1),s=e.ref(1),i=10,u=e.ref(0),c=e.computed(()=>{const f=[...n.value];return f.includes("Country")&&!f.includes("Region")&&f.push("Region"),f}),d=f=>Array.isArray(f)?f.filter(p=>c.value.includes(p.type)):[];return{searchResults:o,loading:l,isFetchingMore:r,isFinished:a,fetchData:async(f=!1)=>{const p=t.value.trim();if(!p){o.value=[],u.value=0,a.value=!1;return}if(f){if(r.value||a.value)return;r.value=!0,s.value+=1}else{if(l.value)return;l.value=!0,s.value=1,a.value=!1}try{const h=await po(p,n.value,{current:s.value,size:i}),y=d(h.records||[]);f?o.value.push(...y):o.value=y,u.value=h.total||0,(o.value.length>=u.value||y.length<i)&&(a.value=!0)}catch(h){console.error("Search request failed:",h),f&&(s.value-=1)}finally{l.value=!1,r.value=!1}}}}const go={class:"h5-search-container"},vo={class:"trigger-content"},yo=["src"],Ao={class:"placeholder-text"},wo={key:0,class:"selected-count"},Co={key:1,class:"selected-val"},xo={key:2,class:"placeholder-gray"},ko={key:0,class:"h5-modal-root"},Eo={class:"h5-drawer-card"},Vo={class:"h5-header"},So={class:"h5-input-wrapper"},bo=["src"],No=["placeholder"],Bo={key:0,class:"h5-spinner-box"},Ro={key:1,class:"h5-section"},Do={class:"h5-section-hd"},_o={class:"h5-history-grid"},Oo=["onClick"],To={key:2,class:"h5-result-list"},Lo=["onClick"],Mo={class:"item-info"},Io={class:"item-name"},Fo={key:0,class:"item-sub"},Po={class:"h5-load-status"},Uo={key:1,class:"no-more"},Ho={key:3,class:"h5-empty"},Qo=e.defineComponent({__name:"index",props:{modelValue:{},multiple:{type:Boolean,default:!1},lang:{default:"zh-CN"},placeholder:{},historyKey:{}},emits:["update:modelValue","select"],setup(t,{emit:n}){const o=t,l=n,r=e.ref(!1),a=e.ref(""),s=e.ref(null),i=e.ref(null);let u=null;const{searchHistory:c,saveToHistory:d,clearHistory:m}=mo(e.toRef(o,"historyKey")),{searchResults:f,loading:p,isFetchingMore:h,isFinished:y,fetchData:A}=ho(a,e.ref(["City","Seaport","Airport"])),v=e.computed(()=>{if(o.lang)return o.lang==="en"||o.lang==="en-US";try{if(typeof useCookie=="function"){const C=useCookie("jc-language")?.value;if(C)return/^en(-US)?$/.test(C)}}catch{}if(typeof document<"u"){const C=document.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(C)}try{if(typeof useNuxtApp=="function"){const E=useNuxtApp()?.ssrContext?.event?.node?.req?.headers?.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(E)}}catch{}return!1}),w=e.computed(()=>Array.isArray(o.modelValue)?o.modelValue:o.modelValue?[o.modelValue]:[]),k=e.computed(()=>!o.multiple&&!!o.modelValue),S=e.computed(()=>k.value?D(o.modelValue):""),b=e.computed(()=>w.value.length>0),P=()=>{r.value=!0,e.nextTick(()=>{s.value?.focus()})},_=()=>{r.value=!1,a.value=""},L=C=>{d(C),o.multiple?w.value.some(V=>V.id===C.id)||l("update:modelValue",[...w.value,C]):(l("update:modelValue",C),_()),l("select",C)},U=()=>{l("update:modelValue",o.multiple?[]:null)},O=e.ref(!1),z=C=>{const E=C.target;if(!E)return;E.scrollTop+E.clientHeight>=E.scrollHeight-80&&a.value&&!p.value&&!h.value&&!y.value&&!O.value&&(O.value=!0,A(!0))};e.watch(h,C=>{C||(O.value=!1)});const J=()=>{u&&clearTimeout(u),u=setTimeout(()=>{O.value=!1,i.value?.scrollTo({top:0}),console.log("🍉 ~ index.vue:279 ~ onInput ~ fetchData:",A),A(!1)},300)},D=C=>v.value?C.displayEn||C.display:C.displayCn||C.display,H=C=>{const E={City:"城市",Seaport:"港口",Airport:"机场"};return v.value?C:E[C]||C},ee=C=>w.value.some(E=>E.id===C.id);return(C,E)=>(e.openBlock(),e.createElementBlock("div",go,[e.createElementVNode("div",{class:"search-trigger",onClick:P},[e.createElementVNode("div",vo,[e.createElementVNode("img",{src:e.unref(be),class:"search-icon-m"},null,8,yo),e.createElementVNode("div",Ao,[t.multiple&&w.value.length>0?(e.openBlock(),e.createElementBlock("span",wo,e.toDisplayString(v.value?"Selected":"已选")+" ("+e.toDisplayString(w.value.length)+")",1)):!t.multiple&&k.value?(e.openBlock(),e.createElementBlock("span",Co,e.toDisplayString(S.value),1)):(e.openBlock(),e.createElementBlock("span",xo,e.toDisplayString(t.placeholder||(v.value?"Search":"搜索")),1))])]),b.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"clear-trigger",onClick:e.withModifiers(U,["stop"])},"ⓧ")):e.createCommentVNode("",!0)]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[r.value?(e.openBlock(),e.createElementBlock("div",ko,[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"h5-mask",onClick:_})]),_:1}),e.createVNode(e.Transition,{name:"slide-up"},{default:e.withCtx(()=>[e.createElementVNode("div",Eo,[e.createElementVNode("div",{class:"drawer-handle",onClick:_}),e.createElementVNode("div",Vo,[e.createElementVNode("div",So,[e.createElementVNode("img",{src:e.unref(be),class:"inner-icon"},null,8,bo),e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:s,"onUpdate:modelValue":E[0]||(E[0]=V=>a.value=V),placeholder:v.value?"City/Port/Airport":"搜索城市/港口/机场",onInput:J},null,40,No),[[e.vModelText,a.value]]),a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"h5-clear-btn",onClick:E[1]||(E[1]=V=>a.value="")}," ✕ ")):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:"h5-cancel-btn",onClick:_},e.toDisplayString(v.value?"Cancel":"取消"),1)]),e.createElementVNode("div",{class:"h5-main-content",ref_key:"scrollContainer",ref:i,onScroll:z},[e.unref(p)&&!e.unref(h)?(e.openBlock(),e.createElementBlock("div",Bo,[...E[3]||(E[3]=[e.createElementVNode("div",{class:"h5-spinner"},null,-1)])])):e.createCommentVNode("",!0),!a.value&&e.unref(c).length>0?(e.openBlock(),e.createElementBlock("div",Ro,[e.createElementVNode("div",Do,[e.createElementVNode("span",null,e.toDisplayString(v.value?"Recent":"最近搜索"),1),e.createElementVNode("span",{class:"h5-clear-history",onClick:E[2]||(E[2]=(...V)=>e.unref(m)&&e.unref(m)(...V))},e.toDisplayString(v.value?"Clear":"清空"),1)]),e.createElementVNode("div",_o,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),(V,T)=>(e.openBlock(),e.createElementBlock("div",{key:T,class:"h5-history-tag",onClick:ie=>L(V)},e.toDisplayString(D(V)),9,Oo))),128))])])):e.createCommentVNode("",!0),e.unref(f).length>0?(e.openBlock(),e.createElementBlock("div",To,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f),(V,T)=>(e.openBlock(),e.createElementBlock("div",{key:T,class:e.normalizeClass(["h5-result-item",{"is-active":ee(V)}]),onClick:ie=>L(V)},[e.createElementVNode("div",{class:e.normalizeClass(["item-type",V.type.toLowerCase()])},e.toDisplayString(H(V.type)),3),e.createElementVNode("div",Mo,[e.createElementVNode("div",Io,e.toDisplayString(D(V)),1),V.parentName?(e.openBlock(),e.createElementBlock("div",Fo,e.toDisplayString(V.parentName),1)):e.createCommentVNode("",!0)])],10,Lo))),128)),e.createElementVNode("div",Po,[e.unref(h)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[E[4]||(E[4]=e.createElementVNode("div",{class:"mini-spinner"},null,-1)),e.createElementVNode("span",null,e.toDisplayString(v.value?"Loading...":"加载中..."),1)],64)):e.unref(y)&&a.value?(e.openBlock(),e.createElementBlock("span",Uo,e.toDisplayString(v.value?"No more results":"没有更多结果了"),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),a.value&&!e.unref(p)&&e.unref(f).length===0?(e.openBlock(),e.createElementBlock("div",Ho,e.toDisplayString(v.value?"No Results Found":"未找到相关结果"),1)):e.createCommentVNode("",!0)],544)])]),_:1})])):e.createCommentVNode("",!0)]))]))}}),st=_e(Qo,[["__scopeId","data-v-c1314e9c"]]);let $o={open(){R.emitter.emit(R.MODAL_ACTION.Open)},close(){R.emitter.emit(R.MODAL_ACTION.Close)},onSubmit(t){R.emitter.on(R.MODAL_ACTION.Submit,t)}};function Jo(){let t=!1;return{install(n){if(typeof window<"u"&&!t){const o=document.createElement("div");o.setAttribute("id","global-modal-root"),document.body.appendChild(o),e.createApp(rt).mount(o),t=!0}n.config.globalProperties.$globalModal=$o}}}const qe={ApplyDataDialog:lt,JcSearch:Oe,JCMSearch:st};let We=!1;const qo={install(t,n){if(!We){We=!0,n?.sharedConfig&&R.initSharedConfig(n.sharedConfig);for(const o in qe)t.component(o,qe[o])}}};Object.defineProperty(exports,"MODAL_ACTION",{enumerable:!0,get:()=>R.MODAL_ACTION});Object.defineProperty(exports,"emitter",{enumerable:!0,get:()=>R.emitter});Object.defineProperty(exports,"initSharedConfig",{enumerable:!0,get:()=>R.initSharedConfig});exports.ApplyDataDialog=lt;exports.GlobalModal=rt;exports.JCMSearch=st;exports.JcSearch=Oe;exports.createGlobalModalPlugin=Jo;exports.default=qo;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),D=require("@jctrans-materials/shared"),B=require("element-plus");function gt(t){const o=e.ref([]),n="_search_history_cache",l=typeof window<"u"&&typeof localStorage<"u",r=e.computed(()=>(t.value||"")+n),a=e.computed(()=>!!t.value&&t.value!==""),s=u=>{if(!u||!l)return;const c=o.value.filter(m=>m.id&&m.id!==u.id||m.display!==u.display);c.unshift(u);const d=c.slice(0,4);if(a.value){o.value=d;try{localStorage.setItem(r.value,JSON.stringify(d))}catch(m){console.warn("LocalStorage save failed:",m)}}},i=()=>{o.value=[],l&&localStorage.removeItem(r.value)};return e.onMounted(()=>{if(l&&a.value){const u=localStorage.getItem(r.value);if(u)try{o.value=JSON.parse(u)}catch{o.value=[]}}}),{searchHistory:o,saveToHistory:s,clearHistory:i,HasHistory:a}}async function vt(t,o=["Continent","Country","City","Seaport","Airport"],n={}){return D.locationSearchV2.searchByName({keyword:t,displayInfo:o,...n})}const Ce=(t,o)=>D.locationSearchV2.searchByIdWithType(t,o);function yt(t,o){const n=e.ref([]),l=e.ref(!1),r=e.ref(!1),a=e.ref(1),s=e.ref(0),i=e.ref(10),u=e.computed(()=>s.value===0?!1:n.value.length>=s.value),c=e.computed(()=>{const p=[...o.value];return p.includes("Country")&&!p.includes("Region")&&p.push("Region"),p}),d=p=>!p||!Array.isArray(p)?[]:p.filter(f=>c.value.includes(f.type));return{searchResults:n,loading:l,isFetchingMore:r,isFinished:u,currentPage:a,total:s,fetchData:async(p=1,f=!1)=>{if(!t.value.trim()&&!f){n.value=[],s.value=0;return}if(!(f&&(r.value||u.value))&&!(!f&&l.value)){f?r.value=!0:(l.value=!0,a.value=1);try{const h=await vt(t.value,o.value,{current:p,size:i.value}),y=h.records||[],w=d(y);f?n.value=[...n.value,...w]:n.value=w,s.value=h.total||0,a.value=p}catch(h){console.error("Failed to fetch search results:",h)}finally{l.value=!1,r.value=!1}}},filterByTypes:d}}const le=Math.min,I=Math.max,pe=Math.round,me=Math.floor,W=t=>({x:t,y:t}),At={left:"right",right:"left",bottom:"top",top:"bottom"},wt={start:"end",end:"start"};function Fe(t,o,n){return I(t,le(o,n))}function ce(t,o){return typeof t=="function"?t(o):t}function X(t){return t.split("-")[0]}function ue(t){return t.split("-")[1]}function Ge(t){return t==="x"?"y":"x"}function ze(t){return t==="y"?"height":"width"}const kt=new Set(["top","bottom"]);function j(t){return kt.has(X(t))?"y":"x"}function Ye(t){return Ge(j(t))}function Ct(t,o,n){n===void 0&&(n=!1);const l=ue(t),r=Ye(t),a=ze(r);let s=r==="x"?l===(n?"end":"start")?"right":"left":l==="start"?"bottom":"top";return o.reference[a]>o.floating[a]&&(s=he(s)),[s,he(s)]}function xt(t){const o=he(t);return[Ee(t),o,Ee(o)]}function Ee(t){return t.replace(/start|end/g,o=>wt[o])}const Pe=["left","right"],Ue=["right","left"],Et=["top","bottom"],Vt=["bottom","top"];function St(t,o,n){switch(t){case"top":case"bottom":return n?o?Ue:Pe:o?Pe:Ue;case"left":case"right":return o?Et:Vt;default:return[]}}function bt(t,o,n,l){const r=ue(t);let a=St(X(t),n==="start",l);return r&&(a=a.map(s=>s+"-"+r),o&&(a=a.concat(a.map(Ee)))),a}function he(t){return t.replace(/left|right|bottom|top/g,o=>At[o])}function Nt(t){return{top:0,right:0,bottom:0,left:0,...t}}function Bt(t){return typeof t!="number"?Nt(t):{top:t,right:t,bottom:t,left:t}}function ge(t){const{x:o,y:n,width:l,height:r}=t;return{width:l,height:r,top:n,left:o,right:o+l,bottom:n+r,x:o,y:n}}function He(t,o,n){let{reference:l,floating:r}=t;const a=j(o),s=Ye(o),i=ze(s),u=X(o),c=a==="y",d=l.x+l.width/2-r.width/2,m=l.y+l.height/2-r.height/2,p=l[i]/2-r[i]/2;let f;switch(u){case"top":f={x:d,y:l.y-r.height};break;case"bottom":f={x:d,y:l.y+l.height};break;case"right":f={x:l.x+l.width,y:m};break;case"left":f={x:l.x-r.width,y:m};break;default:f={x:l.x,y:l.y}}switch(ue(o)){case"start":f[s]-=p*(n&&c?-1:1);break;case"end":f[s]+=p*(n&&c?-1:1);break}return f}const Dt=async(t,o,n)=>{const{placement:l="bottom",strategy:r="absolute",middleware:a=[],platform:s}=n,i=a.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(o));let c=await s.getElementRects({reference:t,floating:o,strategy:r}),{x:d,y:m}=He(c,l,u),p=l,f={},h=0;for(let y=0;y<i.length;y++){const{name:w,fn:v}=i[y],{x:k,y:b,data:N,reset:S}=await v({x:d,y:m,initialPlacement:l,placement:p,strategy:r,middlewareData:f,rects:c,platform:s,elements:{reference:t,floating:o}});d=k??d,m=b??m,f={...f,[w]:{...f[w],...N}},S&&h<=50&&(h++,typeof S=="object"&&(S.placement&&(p=S.placement),S.rects&&(c=S.rects===!0?await s.getElementRects({reference:t,floating:o,strategy:r}):S.rects),{x:d,y:m}=He(c,p,u)),y=-1)}return{x:d,y:m,placement:p,strategy:r,middlewareData:f}};async function be(t,o){var n;o===void 0&&(o={});const{x:l,y:r,platform:a,rects:s,elements:i,strategy:u}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:m="floating",altBoundary:p=!1,padding:f=0}=ce(o,t),h=Bt(f),w=i[p?m==="floating"?"reference":"floating":m],v=ge(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(w)))==null||n?w:w.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(i.floating)),boundary:c,rootBoundary:d,strategy:u})),k=m==="floating"?{x:l,y:r,width:s.floating.width,height:s.floating.height}:s.reference,b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(i.floating)),N=await(a.isElement==null?void 0:a.isElement(b))?await(a.getScale==null?void 0:a.getScale(b))||{x:1,y:1}:{x:1,y:1},S=ge(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:k,offsetParent:b,strategy:u}):k);return{top:(v.top-S.top+h.top)/N.y,bottom:(S.bottom-v.bottom+h.bottom)/N.y,left:(v.left-S.left+h.left)/N.x,right:(S.right-v.right+h.right)/N.x}}const Rt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(o){var n,l;const{placement:r,middlewareData:a,rects:s,initialPlacement:i,platform:u,elements:c}=o,{mainAxis:d=!0,crossAxis:m=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:y=!0,...w}=ce(t,o);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const v=X(r),k=j(i),b=X(i)===i,N=await(u.isRTL==null?void 0:u.isRTL(c.floating)),S=p||(b||!y?[he(i)]:xt(i)),M=h!=="none";!p&&M&&S.push(...bt(i,y,h,N));const O=[i,...S],P=await be(o,w),U=[];let _=((l=a.flip)==null?void 0:l.overflows)||[];if(d&&U.push(P[v]),m){const R=Ct(r,s,N);U.push(P[R[0]],P[R[1]])}if(_=[..._,{placement:r,overflows:U}],!U.every(R=>R<=0)){var G,z;const R=(((G=a.flip)==null?void 0:G.index)||0)+1,ee=O[R];if(ee&&(!(m==="alignment"?k!==j(ee):!1)||_.every(E=>j(E.placement)===k?E.overflows[0]>0:!0)))return{data:{index:R,overflows:_},reset:{placement:ee}};let C=(z=_.filter(x=>x.overflows[0]<=0).sort((x,E)=>x.overflows[1]-E.overflows[1])[0])==null?void 0:z.placement;if(!C)switch(f){case"bestFit":{var H;const x=(H=_.filter(E=>{if(M){const T=j(E.placement);return T===k||T==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(T=>T>0).reduce((T,ae)=>T+ae,0)]).sort((E,T)=>E[1]-T[1])[0])==null?void 0:H[0];x&&(C=x);break}case"initialPlacement":C=i;break}if(r!==C)return{reset:{placement:C}}}return{}}}},Ot=new Set(["left","top"]);async function _t(t,o){const{placement:n,platform:l,elements:r}=t,a=await(l.isRTL==null?void 0:l.isRTL(r.floating)),s=X(n),i=ue(n),u=j(n)==="y",c=Ot.has(s)?-1:1,d=a&&u?-1:1,m=ce(o,t);let{mainAxis:p,crossAxis:f,alignmentAxis:h}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return i&&typeof h=="number"&&(f=i==="end"?h*-1:h),u?{x:f*d,y:p*c}:{x:p*c,y:f*d}}const Tt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(o){var n,l;const{x:r,y:a,placement:s,middlewareData:i}=o,u=await _t(o,t);return s===((n=i.offset)==null?void 0:n.placement)&&(l=i.arrow)!=null&&l.alignmentOffset?{}:{x:r+u.x,y:a+u.y,data:{...u,placement:s}}}}},Mt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(o){const{x:n,y:l,placement:r}=o,{mainAxis:a=!0,crossAxis:s=!1,limiter:i={fn:w=>{let{x:v,y:k}=w;return{x:v,y:k}}},...u}=ce(t,o),c={x:n,y:l},d=await be(o,u),m=j(X(r)),p=Ge(m);let f=c[p],h=c[m];if(a){const w=p==="y"?"top":"left",v=p==="y"?"bottom":"right",k=f+d[w],b=f-d[v];f=Fe(k,f,b)}if(s){const w=m==="y"?"top":"left",v=m==="y"?"bottom":"right",k=h+d[w],b=h-d[v];h=Fe(k,h,b)}const y=i.fn({...o,[p]:f,[m]:h});return{...y,data:{x:y.x-n,y:y.y-l,enabled:{[p]:a,[m]:s}}}}}},Lt=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(o){var n,l;const{placement:r,rects:a,platform:s,elements:i}=o,{apply:u=()=>{},...c}=ce(t,o),d=await be(o,c),m=X(r),p=ue(r),f=j(r)==="y",{width:h,height:y}=a.floating;let w,v;m==="top"||m==="bottom"?(w=m,v=p===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(v=m,w=p==="end"?"top":"bottom");const k=y-d.top-d.bottom,b=h-d.left-d.right,N=le(y-d[w],k),S=le(h-d[v],b),M=!o.middlewareData.shift;let O=N,P=S;if((n=o.middlewareData.shift)!=null&&n.enabled.x&&(P=b),(l=o.middlewareData.shift)!=null&&l.enabled.y&&(O=k),M&&!p){const _=I(d.left,0),G=I(d.right,0),z=I(d.top,0),H=I(d.bottom,0);f?P=h-2*(_!==0||G!==0?_+G:I(d.left,d.right)):O=y-2*(z!==0||H!==0?z+H:I(d.top,d.bottom))}await u({...o,availableWidth:P,availableHeight:O});const U=await s.getDimensions(i.floating);return h!==U.width||y!==U.height?{reset:{rects:!0}}:{}}}};function ve(){return typeof window<"u"}function se(t){return je(t)?(t.nodeName||"").toLowerCase():"#document"}function F(t){var o;return(t==null||(o=t.ownerDocument)==null?void 0:o.defaultView)||window}function K(t){var o;return(o=(je(t)?t.ownerDocument:t.document)||window.document)==null?void 0:o.documentElement}function je(t){return ve()?t instanceof Node||t instanceof F(t).Node:!1}function Q(t){return ve()?t instanceof Element||t instanceof F(t).Element:!1}function q(t){return ve()?t instanceof HTMLElement||t instanceof F(t).HTMLElement:!1}function Qe(t){return!ve()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof F(t).ShadowRoot}const It=new Set(["inline","contents"]);function de(t){const{overflow:o,overflowX:n,overflowY:l,display:r}=$(t);return/auto|scroll|overlay|hidden|clip/.test(o+l+n)&&!It.has(r)}const Ft=new Set(["table","td","th"]);function Pt(t){return Ft.has(se(t))}const Ut=[":popover-open",":modal"];function ye(t){return Ut.some(o=>{try{return t.matches(o)}catch{return!1}})}const Ht=["transform","translate","scale","rotate","perspective"],Qt=["transform","translate","scale","rotate","perspective","filter"],$t=["paint","layout","strict","content"];function Ne(t){const o=Be(),n=Q(t)?$(t):t;return Ht.some(l=>n[l]?n[l]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!o&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!o&&(n.filter?n.filter!=="none":!1)||Qt.some(l=>(n.willChange||"").includes(l))||$t.some(l=>(n.contain||"").includes(l))}function Jt(t){let o=Z(t);for(;q(o)&&!re(o);){if(Ne(o))return o;if(ye(o))return null;o=Z(o)}return null}function Be(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Wt=new Set(["html","body","#document"]);function re(t){return Wt.has(se(t))}function $(t){return F(t).getComputedStyle(t)}function Ae(t){return Q(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Z(t){if(se(t)==="html")return t;const o=t.assignedSlot||t.parentNode||Qe(t)&&t.host||K(t);return Qe(o)?o.host:o}function Xe(t){const o=Z(t);return re(o)?t.ownerDocument?t.ownerDocument.body:t.body:q(o)&&de(o)?o:Xe(o)}function ie(t,o,n){var l;o===void 0&&(o=[]),n===void 0&&(n=!0);const r=Xe(t),a=r===((l=t.ownerDocument)==null?void 0:l.body),s=F(r);if(a){const i=Ve(s);return o.concat(s,s.visualViewport||[],de(r)?r:[],i&&n?ie(i):[])}return o.concat(r,ie(r,[],n))}function Ve(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Ze(t){const o=$(t);let n=parseFloat(o.width)||0,l=parseFloat(o.height)||0;const r=q(t),a=r?t.offsetWidth:n,s=r?t.offsetHeight:l,i=pe(n)!==a||pe(l)!==s;return i&&(n=a,l=s),{width:n,height:l,$:i}}function De(t){return Q(t)?t:t.contextElement}function ne(t){const o=De(t);if(!q(o))return W(1);const n=o.getBoundingClientRect(),{width:l,height:r,$:a}=Ze(o);let s=(a?pe(n.width):n.width)/l,i=(a?pe(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}const qt=W(0);function et(t){const o=F(t);return!Be()||!o.visualViewport?qt:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function Kt(t,o,n){return o===void 0&&(o=!1),!n||o&&n!==F(t)?!1:o}function oe(t,o,n,l){o===void 0&&(o=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),a=De(t);let s=W(1);o&&(l?Q(l)&&(s=ne(l)):s=ne(t));const i=Kt(a,n,l)?et(a):W(0);let u=(r.left+i.x)/s.x,c=(r.top+i.y)/s.y,d=r.width/s.x,m=r.height/s.y;if(a){const p=F(a),f=l&&Q(l)?F(l):l;let h=p,y=Ve(h);for(;y&&l&&f!==h;){const w=ne(y),v=y.getBoundingClientRect(),k=$(y),b=v.left+(y.clientLeft+parseFloat(k.paddingLeft))*w.x,N=v.top+(y.clientTop+parseFloat(k.paddingTop))*w.y;u*=w.x,c*=w.y,d*=w.x,m*=w.y,u+=b,c+=N,h=F(y),y=Ve(h)}}return ge({width:d,height:m,x:u,y:c})}function we(t,o){const n=Ae(t).scrollLeft;return o?o.left+n:oe(K(t)).left+n}function tt(t,o){const n=t.getBoundingClientRect(),l=n.left+o.scrollLeft-we(t,n),r=n.top+o.scrollTop;return{x:l,y:r}}function Gt(t){let{elements:o,rect:n,offsetParent:l,strategy:r}=t;const a=r==="fixed",s=K(l),i=o?ye(o.floating):!1;if(l===s||i&&a)return n;let u={scrollLeft:0,scrollTop:0},c=W(1);const d=W(0),m=q(l);if((m||!m&&!a)&&((se(l)!=="body"||de(s))&&(u=Ae(l)),q(l))){const f=oe(l);c=ne(l),d.x=f.x+l.clientLeft,d.y=f.y+l.clientTop}const p=s&&!m&&!a?tt(s,u):W(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+d.x+p.x,y:n.y*c.y-u.scrollTop*c.y+d.y+p.y}}function zt(t){return Array.from(t.getClientRects())}function Yt(t){const o=K(t),n=Ae(t),l=t.ownerDocument.body,r=I(o.scrollWidth,o.clientWidth,l.scrollWidth,l.clientWidth),a=I(o.scrollHeight,o.clientHeight,l.scrollHeight,l.clientHeight);let s=-n.scrollLeft+we(t);const i=-n.scrollTop;return $(l).direction==="rtl"&&(s+=I(o.clientWidth,l.clientWidth)-r),{width:r,height:a,x:s,y:i}}const $e=25;function jt(t,o){const n=F(t),l=K(t),r=n.visualViewport;let a=l.clientWidth,s=l.clientHeight,i=0,u=0;if(r){a=r.width,s=r.height;const d=Be();(!d||d&&o==="fixed")&&(i=r.offsetLeft,u=r.offsetTop)}const c=we(l);if(c<=0){const d=l.ownerDocument,m=d.body,p=getComputedStyle(m),f=d.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,h=Math.abs(l.clientWidth-m.clientWidth-f);h<=$e&&(a-=h)}else c<=$e&&(a+=c);return{width:a,height:s,x:i,y:u}}const Xt=new Set(["absolute","fixed"]);function Zt(t,o){const n=oe(t,!0,o==="fixed"),l=n.top+t.clientTop,r=n.left+t.clientLeft,a=q(t)?ne(t):W(1),s=t.clientWidth*a.x,i=t.clientHeight*a.y,u=r*a.x,c=l*a.y;return{width:s,height:i,x:u,y:c}}function Je(t,o,n){let l;if(o==="viewport")l=jt(t,n);else if(o==="document")l=Yt(K(t));else if(Q(o))l=Zt(o,n);else{const r=et(t);l={x:o.x-r.x,y:o.y-r.y,width:o.width,height:o.height}}return ge(l)}function ot(t,o){const n=Z(t);return n===o||!Q(n)||re(n)?!1:$(n).position==="fixed"||ot(n,o)}function eo(t,o){const n=o.get(t);if(n)return n;let l=ie(t,[],!1).filter(i=>Q(i)&&se(i)!=="body"),r=null;const a=$(t).position==="fixed";let s=a?Z(t):t;for(;Q(s)&&!re(s);){const i=$(s),u=Ne(s);!u&&i.position==="fixed"&&(r=null),(a?!u&&!r:!u&&i.position==="static"&&!!r&&Xt.has(r.position)||de(s)&&!u&&ot(t,s))?l=l.filter(d=>d!==s):r=i,s=Z(s)}return o.set(t,l),l}function to(t){let{element:o,boundary:n,rootBoundary:l,strategy:r}=t;const s=[...n==="clippingAncestors"?ye(o)?[]:eo(o,this._c):[].concat(n),l],i=s[0],u=s.reduce((c,d)=>{const m=Je(o,d,r);return c.top=I(m.top,c.top),c.right=le(m.right,c.right),c.bottom=le(m.bottom,c.bottom),c.left=I(m.left,c.left),c},Je(o,i,r));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function oo(t){const{width:o,height:n}=Ze(t);return{width:o,height:n}}function no(t,o,n){const l=q(o),r=K(o),a=n==="fixed",s=oe(t,!0,a,o);let i={scrollLeft:0,scrollTop:0};const u=W(0);function c(){u.x=we(r)}if(l||!l&&!a)if((se(o)!=="body"||de(r))&&(i=Ae(o)),l){const f=oe(o,!0,a,o);u.x=f.x+o.clientLeft,u.y=f.y+o.clientTop}else r&&c();a&&!l&&r&&c();const d=r&&!l&&!a?tt(r,i):W(0),m=s.left+i.scrollLeft-u.x-d.x,p=s.top+i.scrollTop-u.y-d.y;return{x:m,y:p,width:s.width,height:s.height}}function xe(t){return $(t).position==="static"}function We(t,o){if(!q(t)||$(t).position==="fixed")return null;if(o)return o(t);let n=t.offsetParent;return K(t)===n&&(n=n.ownerDocument.body),n}function nt(t,o){const n=F(t);if(ye(t))return n;if(!q(t)){let r=Z(t);for(;r&&!re(r);){if(Q(r)&&!xe(r))return r;r=Z(r)}return n}let l=We(t,o);for(;l&&Pt(l)&&xe(l);)l=We(l,o);return l&&re(l)&&xe(l)&&!Ne(l)?n:l||Jt(t)||n}const lo=async function(t){const o=this.getOffsetParent||nt,n=this.getDimensions,l=await n(t.floating);return{reference:no(t.reference,await o(t.floating),t.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}};function ro(t){return $(t).direction==="rtl"}const so={convertOffsetParentRelativeRectToViewportRelativeRect:Gt,getDocumentElement:K,getClippingRect:to,getOffsetParent:nt,getElementRects:lo,getClientRects:zt,getDimensions:oo,getScale:ne,isElement:Q,isRTL:ro};function lt(t,o){return t.x===o.x&&t.y===o.y&&t.width===o.width&&t.height===o.height}function ao(t,o){let n=null,l;const r=K(t);function a(){var i;clearTimeout(l),(i=n)==null||i.disconnect(),n=null}function s(i,u){i===void 0&&(i=!1),u===void 0&&(u=1),a();const c=t.getBoundingClientRect(),{left:d,top:m,width:p,height:f}=c;if(i||o(),!p||!f)return;const h=me(m),y=me(r.clientWidth-(d+p)),w=me(r.clientHeight-(m+f)),v=me(d),b={rootMargin:-h+"px "+-y+"px "+-w+"px "+-v+"px",threshold:I(0,le(1,u))||1};let N=!0;function S(M){const O=M[0].intersectionRatio;if(O!==u){if(!N)return s();O?s(!1,O):l=setTimeout(()=>{s(!1,1e-7)},1e3)}O===1&&!lt(c,t.getBoundingClientRect())&&s(),N=!1}try{n=new IntersectionObserver(S,{...b,root:r.ownerDocument})}catch{n=new IntersectionObserver(S,b)}n.observe(t)}return s(!0),a}function io(t,o,n,l){l===void 0&&(l={});const{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:u=!1}=l,c=De(t),d=r||a?[...c?ie(c):[],...ie(o)]:[];d.forEach(v=>{r&&v.addEventListener("scroll",n,{passive:!0}),a&&v.addEventListener("resize",n)});const m=c&&i?ao(c,n):null;let p=-1,f=null;s&&(f=new ResizeObserver(v=>{let[k]=v;k&&k.target===c&&f&&(f.unobserve(o),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=f)==null||b.observe(o)})),n()}),c&&!u&&f.observe(c),f.observe(o));let h,y=u?oe(t):null;u&&w();function w(){const v=oe(t);y&&!lt(y,v)&&n(),y=v,h=requestAnimationFrame(w)}return n(),()=>{var v;d.forEach(k=>{r&&k.removeEventListener("scroll",n),a&&k.removeEventListener("resize",n)}),m?.(),(v=f)==null||v.disconnect(),f=null,u&&cancelAnimationFrame(h)}}const co=Tt,uo=Mt,fo=Rt,mo=Lt,po=(t,o,n)=>{const l=new Map,r={platform:so,...n},a={...r.platform,_c:l};return Dt(t,o,{...r,platform:a})};function ho(t,o){const n=e.ref({position:"fixed",left:"0",top:"0",zIndex:3e3});let l=null;const r=()=>{!t.value||!o.value||po(t.value,o.value,{placement:"bottom-start",strategy:"fixed",middleware:[co(6),fo(),uo({padding:10}),mo({apply({rects:i,elements:u}){const c=`${i.reference.width}px`;Object.assign(u.floating.style,{width:c,minWidth:c,maxWidth:c})}})]}).then(({x:i,y:u})=>{Object.assign(n.value,{left:`${i}px`,top:`${u}px`})})},a=()=>{t.value&&o.value&&(l=io(t.value,o.value,r))},s=()=>{l&&(l(),l=null)};return e.onBeforeUnmount(s),{floatingStyles:n,startTrack:a,stopTrack:s}}const go="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACT0lEQVR4AaRSO2hTYRT+zn9v2g6CiktFJYoVHXQoOljM2EIEh0orbRKa5qUuDoIZAnXI4FBwcRDikMcNkoQMQjcVESo4OASsW2kLBi3oUKiD1OZx7/H811wJZFF6uOee85/H93/3nKtwQPkvgFKpdKRgVR+UrFrOsurX9N3/DJCvVPxMwx+lKcbgKzbstPhwAXSyWK7eLZZrc4VCNZDPPx/Tt+kCrTqvOrQqfuNrc2OcgW0CduQM9TfJyIB5mQy8UaaxKbftFq3qL9HP1KGGFDe+NDdC/jPnlwgcZEM9lRiU2VFjgngI4FGxa0IvZXecU07XPsc2pkCUIULaa2Z2MsJ7Orkw/8kFiMVCb4XWcQV14w8temL4aJNM47Fh0OHEYqieWAyXT/jPBhzmh7o5EY28Rk/cGWSz2a4GSsTCt3tgs5qmDc726sTQvsS6/c0SFDz97lO/329K4z2Amm1u3ZK11SyrOmNC/ZDYSElWiT5R2resymUZ1pIUv2Qa+iafcrrFretDNJwTf94GUnt7u9u6to3hUW09dQEcIC+BR0LxqgztPnFrotd8wWHclNykaR4dYeCngj0IQNyekOQshLas8hmzLyA3B2UTU6l4eEX8Ld8IZsTu+Mg4hj5xGcTj8f1kLPxChjgO0AdWlAOwnkotbImFrHGFGdOy6u82aJAB+kUZywQ6KaH3ou7TcbguziRApiLWOXjiMvAO2iaic3rH6wxe1Wetd+KRNQKEDV9kwisd83QAQCfkr7uUjEUq2vdUgdJQFExEw++8mLa/AQAA//9h0VsEAAAABklEQVQDAKhs6Pxd3K8TAAAAAElFTkSuQmCC",vo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACgUlEQVR4AXRST0hUYRD/zbfbrqahQpAHlQ3dSurYoaBAwWNQkIT7J/ve09DQsOigkNCha4ckl4Lct0/S3QI7REFEBB08FBHRIYLwIJEodOlUurnfNN+6mq9weMPM+818v2/mm1HYQXK5XH02mz9h1fo7pOE/gkwmU+v5+fuGot8phJdWmSLLnl+4I0RV/xIFCGxCdU3DUwaOkULX18Uve1ydrC4xdwLcwRR9bnO2kwQIoCIDEowpXjsZ4vBCSyx+w/Nnb1KElkkwG4OqGhG79QUImEkT0T2JrpZ4fV5sF0Ad6je9BrBKxLeZuVv8rS9IAG4qGf5oTPSolNxIXOyUNjqlpb0W4xI+Cd62dVqcAAGBVqSCVmPMIoPCttzm2MEBAoeLir4hRK2AWPyVIAHRHMH0Ly0tCBF3M5t+Aq6A0HPJSSyCeZAIz7BNAgQwqxNyc1NL7MCoeyH1xNWpuKsTcet7fv46QI0/zdoEtkmAwHGcHyFQj/Q57vuPzm7m+X5efB6HYj3kOCubuLVlApltfdbPX5uaetCmdeKVAqUN1mdy04XR3PTsqAHPWMztTb24myvEBBuRM+WlUnbzDEXeya2D4XC0zrJqnXwsO3pG3mCMGWMK6lQZk2A0hH2GMSxL9VlI6lVkd90RgGKkVFrrc+9REXubjLH9FxfbbVUVGG5v4i2p8LD8x9ax65C66KTfKGCSDc97fv6DJzuf9QtDtm+iqsM1ot70w9O+YDbmSQ6bkkyCJitnAUcnryqmuExgSsZYKypvgFvS+5xVsJk0MGlps97mFCVXpnNZqoBcbo2QyJz7dCLj6JTj6tRxVyf3izZUtNndwM73SU55JzaO4Q8AAAD//54At5MAAAAGSURBVAMAh2IbMAJQAZQAAAAASUVORK5CYII=",yo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACC0lEQVR4AXxRv2tTURT+zk1iIjgoOMShkIJVNwf/gQYULOjQwaGvGl8TBMEMDg4ODgF17likvL4HIYm4OLg61K2CooWKDoKCDoJDHASb9N17POf5Enwk6eN+9/z+3nfvNZjxbYS9ymbYXlQ8CbvnZrRhKoEOFMl9zFHuuaJA/E4Jp5FMJTCwZWner/veCYX6ecQVsRNrKsFE1yGJDMFW1Hm4FXX7hnIvADquvkJ9zYn/U3vw35chYOA2Ebcc26uWbVWwnKKqOak9ktmmYLwyBATkY+d2b63d2FYgps9umNtTX6G18WTqmNRmTNB+djaIOqEpmC+FIn8Lom4vaD89n2lKgwkCebYNsvEnAlXI4CIMXSagTNa9l9p6Ojc2CUEYhiW5oE3IxQH4AYNFeb5qvea9SuB7Vc1J7ReDjomidZ2RWNKysyneFHNFovGgxIiizoWR9BGRqiKw76i0qj2JAo7jtwycJDvY1eQIDNM0lu+OYrUHf/BBbEmI9sTKP2VvNGpvAP4Kc1SVSGb2OlLiVQa+12srr7UrUZA6Lx27e0HUu6PnU/kOXGbwaT1Gq9XKa80xmgTa1hlFQiBP1hNWn4AdOd8DpmLfgnakYV/yv/UF5ipn+qLyvgGp2us6I/V/R+DYPiYenpKbv0Y8mGeLS0OmhYbvLQuWiGkeFkuGBwtrvrdyMKA5nVGCvwAAAP//q4xnOgAAAAZJREFUAwCH2O8KfEWHWQAAAABJRU5ErkJggg==",Ao="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACmklEQVR4AXRTT0jUQRT+3uyqGxgYeCiy1JAo6JBUp4Q81EEiKKiDa+H+/ENGHgPpZtChQ4EHL+Ku+9t0V7EkQSGPBYGHBIU6RAqt2cFDBw9C+3de3yy7hobDvHm/+d4337x58xuDQ9r4+FRDLJZqG49PtrvvQ2j4TyDmJ7sm/NRqoMpsIYD3RgIL7pvY54lEqvug0J5APB4PxfzUOwFGRWReVJp7I+GjW+nvxxQo0DagOjLhJxcctyK0J6BS/UaAc1nNtXrdnc88rzPtSMPDwwXiM7R2WNwDpMVKzTTKrSRQTq0tq9mOR55XWliOY2wsVQ+RRWZQiyACjiPQ9pg/0+U4JQEoBkXMi4OLmWpdsEZXofY5yYtSzH10HHJHBPYJMZhyhS8X84U5B+y36iaBNPxMr59nPTo9z8uU4jaToL8Yj88eN2xNTG+3r+/BBncMuSLRln1/+iZgdkhEY2NjvfMVo1DarbG20GIqoPMaqL5G38Zb+GBh36roMufpzc3N3xSvi0ZfX6APEYNAg86bjMluCFDr+7OX1JoWQNJed/ipaK6Z6oOi2dbTZ85eVan+YYLBL7yBdRb9IXkha23aPPa8bQBrFoUVqo4qMMU5mOZ2JBKeo98RiwHi8xQ7Qo6vCsdb6e+//4ubgJegLzlmDOQ6i/XKCVQskZg9aaFtRrBGsYytQpQiu+SPOI5xQ2+kK6mQJRJHo8lko8MqxswGhceCzY25mMnLEmOf3Br6f2/BaLaTqhuSl6/xxPRQNDrJehBRrSWxABMaMnmsKfCN9eEfSZS9lAG9O3OmJ9J1C9ABVb1rgoF1PqA/Cokw3k7stgKDvZHwHXcUYqW+J1CacejlcXoi4SvFvD2lRdxAER0s3glirS5Gyr7+FwAA//8Pj6q2AAAABklEQVQDAJPeLlNn5TR8AAAAAElFTkSuQmCC",wo="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABFUlEQVR4AaRQO07DQBCdWe8B4B5IFFyAK9ARkIVNhIQEEiVtJLgABRVRvIBCJBquwBVyDgoaSnuHeZY3MlYcNsnIb8fze6M3hra0XoKJm95N3Nv3EnyhFvb2EgjRJbOMKqmO2tDcvQ5fK+qvl4CJbOn9/CJPP9tArp5sHtP4lc652VXxPL1Z1hRFIOytF1NuTJCfnT4Ms8HjSgJctn1xIt6hxqIkdK+u8U8zT1ESmP5enUkWmqMkhG2FmxXOvR+EGD5KAhoDqsQvtiMXJQGNQJ4N8mF6PMd/wL8SxuOXPSG21pj9p+L1EOjGyAHoQQ0zWGDqx9pbPWIpwqOEkw+gGyMHoAc1ozOkVhOcZyepYndNpDpPvwAAAP//BVQJHAAAAAZJREFUAwDZWL4hub5xHQAAAABJRU5ErkJggg==",Se="data:image/svg+xml,%3csvg%20t='1695277594902'%20fill='%23fff'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='2534'%20width='200'%20height='200'%3e%3cpath%20d='M448%2085.333333a362.666667%20362.666667%200%201%200%20224.512%20647.509334l155.818667%20155.818666a42.666667%2042.666667%200%200%200%2060.330666-60.330666l-155.818666-155.818667A362.666667%20362.666667%200%200%200%20448%2085.333333zM170.666667%20448a277.333333%20277.333333%200%201%201%20554.666666%200%20277.333333%20277.333333%200%200%201-554.666666%200z'%20p-id='2535'%3e%3c/path%3e%3c/svg%3e",ko="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='icon/more'%3e%3cg%20id='&%23231;&%23188;&%23150;&%23231;&%23187;&%23132;'%3e%3cpath%20id='Stroke%201'%20d='M1.56628%207.79421H14.0959'%20stroke='%23FF6A00'%20stroke-width='1.5'%20stroke-linejoin='round'/%3e%3cpath%20id='Stroke%203'%20d='M14.0667%207.79292C11.5075%207.79292%209.43396%205.71938%209.43396%203.16016'%20stroke='%23FF6A00'%20stroke-width='1.5'%20stroke-linejoin='round'/%3e%3cpath%20id='Stroke%205'%20d='M14.0667%207.79297C11.5075%207.79297%209.43396%209.86651%209.43396%2012.4257'%20stroke='%23FF6A00'%20stroke-width='1.5'%20stroke-linejoin='round'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Co={class:"search-container"},xo={class:"selection-wrapper"},Eo={class:"tag-text"},Vo=["onClick"],So={key:0,class:"search-tag collapse"},bo=["placeholder"],No={class:"suffix-area"},Bo={key:1,class:"loading-spinner"},Do={class:"search-icon"},Ro=["src"],Oo={key:0,class:"history-section"},_o={class:"history-header"},To=["onMousedown"],Mo=["src"],Lo={class:"type-text"},Io={class:"result-text"},Fo={key:0,class:"status-msg"},Po=["onMousedown"],Uo=["src"],Ho={class:"type-text"},Qo={class:"result-text"},$o={key:0,class:"load-more-msg"},Jo={key:1,class:"load-more-msg no-more"},Wo={key:2,class:"status-msg"},qo={key:0,class:"no-result-label"},Ko={key:1,class:"no-result-label"},Go=["src"],zo=e.defineComponent({__name:"index",props:{modelValue:{default:null},multiple:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},searchTypeList:{default:()=>["Continent","Country","Region","City","Seaport","Airport"]},historyKey:{default:void 0},lang:{default:""},placeholder:{},showSearchIcon:{type:Boolean,default:!0},showItemTag:{type:Boolean,default:!0},showApplyData:{type:Boolean,default:!0}},emits:["update:modelValue","select","change","submit-search","remove","apply-data"],setup(t,{emit:o}){const n=t,l=o,r=e.ref(null),a=e.ref(null),s=e.ref(null),i=e.ref(""),u=e.ref(""),c=e.ref(!1),d=e.ref(!1);let m=null;const p=e.ref(!1),f=e.computed(()=>n.modelValue?Array.isArray(n.modelValue)?n.modelValue:[n.modelValue]:[]),h=e.computed(()=>n.multiple?n.collapseTags?f.value.slice(0,1):f.value:[]),y=e.computed(()=>i.value||f.value.length>0),w=e.computed(()=>n.multiple?i.value?`${i.value.length*10+20}px`:"10px":"100%"),{searchHistory:v,saveToHistory:k,clearHistory:b}=gt(e.toRef(n,"historyKey")),{searchResults:N,loading:S,isFetchingMore:M,isFinished:O,currentPage:P,fetchData:U,filterByTypes:_}=yt(i,e.toRef(n,"searchTypeList")),{floatingStyles:G,startTrack:z,stopTrack:H}=ho(a,s),R=e.computed(()=>{if(n.lang)return n.lang==="en"||n.lang==="en-US";try{if(typeof useCookie=="function"){const g=useCookie("jc-language")?.value;if(g)return/^en(-US)?$/.test(g)}}catch{}if(typeof document<"u"){const g=document.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(g)}try{if(typeof useNuxtApp=="function"){const V=useNuxtApp()?.ssrContext?.event?.node?.req?.headers?.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(V)}}catch{}return!1}),ee=e.computed(()=>n.multiple&&f.value.length>0?"":c.value&&!n.multiple?u.value:n.placeholder?n.placeholder:R.value?"Please enter...":"请输入..."),C=()=>r.value?.focus(),x=g=>R.value?g.displayEn||g.display||"":g.displayCn||g.display||"",E=g=>{if(k(g),n.multiple){if(!f.value.some(A=>A.id===g.id)){const A=[...f.value,g];l("update:modelValue",A)}i.value=""}else u.value=x(g),c.value=!0,i.value="",d.value=!1,l("update:modelValue",g);l("select",g),l("change",g)},T=g=>{const V=f.value.filter(A=>A.id!==g.id);l("update:modelValue",V),l("remove",g)},ae=()=>{n.multiple&&!i.value&&f.value.length>0&&T(f.value[f.value.length-1])},Te=()=>{i.value="",c.value=!1,u.value="",l("update:modelValue",n.multiple?[]:null)},at=async()=>{if(d.value=!0,!n.multiple&&c.value&&N.value.length===0){const g=n.modelValue;if(g?.id){S.value=!0;try{const V=await Ce(g.id,g.type);N.value=_(V.records)}finally{S.value=!1}}}},it=()=>setTimeout(()=>d.value=!1,200),ct=g=>{g.target.value===""&&!n.multiple&&Te()},ut=()=>{l("submit-search",f.value),d.value=!1},dt=g=>{const{scrollTop:V,scrollHeight:A,clientHeight:L}=g.target;V+L>=A-20&&!S.value&&!M.value&&!O.value&&i.value&&U(P.value+1,!0)},ft=g=>{console.log("🍉 ~ index.vue:428 ~ handleConfirmApplyData ~ e:",g),l("apply-data",g)};e.watch(d,g=>{g?z():H()}),e.watch(i,g=>{if(!g.trim()){N.value=[];return}m&&clearTimeout(m),m=setTimeout(()=>U(1,!1),300)}),e.watch(()=>n.modelValue,async(g,V)=>{if(JSON.stringify(g)===JSON.stringify(V))return;if(n.multiple&&Array.isArray(g)){const L=[...g],Y=L.filter(J=>J&&J.id&&J.type&&!J.display);if(Y.length>0)try{const J=Y.map(te=>te.id).filter(te=>te!=null),ke=await Ce(J,Y[0].type);if(ke&&ke.records){let te=!1;const pt=L.map(fe=>{const Ie=ke.records.find(ht=>ht.id===fe.id);return Ie&&!fe.display?(te=!0,{...fe,...Ie}):fe});te&&l("update:modelValue",pt)}}catch(J){console.error("Batch fetch detail failed:",J)}return}const A=g;if(!A){c.value=!1,u.value="";return}if(typeof A=="object")if(A.id&&A.type&&!A.display)try{const Y=(await Ce(A.id,A.type)).records.find(J=>J.id===A.id);Y&&(u.value=x(Y),c.value=!0)}catch(L){console.error("Single fetch detail failed:",L)}else u.value=x(A),c.value=!!u.value;else u.value=String(A),c.value=!!A},{immediate:!0,deep:!0});const Me=g=>({City:wo,Country:Ao,Airport:go,Seaport:yo})[g]||vo,Le=g=>{const V={City:{en:"City",cn:"城市"},Country:{en:"Country",cn:"国家"},Region:{en:"Region",cn:"区域"},Airport:{en:"Airport",cn:"机场"},Seaport:{en:"Seaport",cn:"港口"}};return R.value?V[g].en:V[g].cn},mt=g=>f.value.some(V=>V.id===g.id);return e.onBeforeUnmount(H),(g,V)=>(e.openBlock(),e.createElementBlock("div",Co,[e.createElementVNode("div",{class:e.normalizeClass(["search-input-wrapper",{"is-multiple":t.multiple}]),ref_key:"referenceRef",ref:a,onClick:C},[e.createElementVNode("div",xo,[t.multiple&&f.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(A,L)=>(e.openBlock(),e.createElementBlock("div",{key:A.id||L,class:"search-tag"},[e.createElementVNode("span",Eo,e.toDisplayString(x(A)),1),e.createElementVNode("span",{class:"tag-close",onClick:e.withModifiers(Y=>T(A),["stop"])},"×",8,Vo)]))),128)),t.collapseTags&&f.value.length>1?(e.openBlock(),e.createElementBlock("div",So," + "+e.toDisplayString(f.value.length-1),1)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:r,class:e.normalizeClass({"is-selected-state":c.value&&!t.multiple}),"onUpdate:modelValue":V[0]||(V[0]=A=>i.value=A),type:"text",placeholder:ee.value,style:e.normalizeStyle({width:w.value}),onFocus:at,onBlur:it,onInput:ct,onKeydown:e.withKeys(ae,["delete"])},null,46,bo),[[e.vModelText,i.value]])]),e.createElementVNode("div",No,[y.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"clear-icon",onMousedown:V[1]||(V[1]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(Te,["stop"])},"ⓧ",32)):e.createCommentVNode("",!0),e.unref(S)&&!e.unref(M)?(e.openBlock(),e.createElementBlock("div",Bo)):!e.unref(S)&&t.showSearchIcon?(e.openBlock(),e.createElementBlock("button",{key:2,class:"search-btn",onClick:e.withModifiers(ut,["stop"])},[e.createElementVNode("span",Do,[e.createElementVNode("img",{src:e.unref(Se),alt:"search"},null,8,Ro)])])):e.createCommentVNode("",!0)])],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.withDirectives(e.createElementVNode("div",{ref_key:"floatingRef",ref:s,class:"dropdown-list",style:e.normalizeStyle(e.unref(G)),onScroll:dt},[e.renderSlot(g.$slots,"history",{searchHistory:e.unref(v)},()=>[e.unref(v).length>0&&!i.value?(e.openBlock(),e.createElementBlock("div",Oo,[e.createElementVNode("div",_o,[e.createElementVNode("span",null,e.toDisplayString(R.value?"Recent search":"最近搜索"),1),e.createElementVNode("span",{class:"clear-btn",onMousedown:V[2]||(V[2]=e.withModifiers(()=>{},["prevent"])),onClick:V[3]||(V[3]=e.withModifiers((...A)=>e.unref(b)&&e.unref(b)(...A),["stop"]))},e.toDisplayString(R.value?"Clear":"清空"),33)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v),(A,L)=>(e.openBlock(),e.createElementBlock("div",{key:"hist-"+L,class:"dropdown-item",onMousedown:Y=>E(A)},[e.createElementVNode("div",{class:"category-tag",style:e.normalizeStyle(t.showItemTag?{}:{display:"none"})},[e.createElementVNode("img",{class:"type-icon",src:Me(A.type),alt:""},null,8,Mo),e.createElementVNode("span",Lo,e.toDisplayString(Le(A.type)),1)],4),e.createElementVNode("div",Io,e.toDisplayString(x(A)),1)],40,To))),128)),V[7]||(V[7]=e.createElementVNode("hr",{class:"divider"},null,-1))])):e.createCommentVNode("",!0)],!0),e.unref(S)&&!e.unref(M)?(e.openBlock(),e.createElementBlock("div",Fo,e.toDisplayString(R.value?"Searching...":"正在搜索中..."),1)):e.unref(N).length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.renderSlot(g.$slots,"results",{searchResults:e.unref(N)},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(N),(A,L)=>(e.openBlock(),e.createElementBlock("div",{key:L,class:e.normalizeClass(["dropdown-item",{"is-active":mt(A)}]),onMousedown:Y=>E(A)},[e.createElementVNode("div",{class:"category-tag",style:e.normalizeStyle(t.showItemTag?{}:{display:"none"})},[e.createElementVNode("img",{class:"type-icon",src:Me(A.type),alt:""},null,8,Uo),e.createElementVNode("span",Ho,e.toDisplayString(Le(A.type)),1)],4),e.createElementVNode("div",Qo,e.toDisplayString(x(A)),1)],42,Po))),128))],!0),e.unref(M)?(e.openBlock(),e.createElementBlock("div",$o,e.toDisplayString(R.value?"Loading more...":"正在加载更多..."),1)):e.unref(O)&&i.value?(e.openBlock(),e.createElementBlock("div",Jo,e.toDisplayString(R.value?"All results have been loaded":"已加载全部结果"),1)):e.createCommentVNode("",!0)],64)):i.value&&!e.unref(S)?(e.openBlock(),e.createElementBlock("div",Wo,[e.renderSlot(g.$slots,"noData",{},()=>[t.showApplyData?(e.openBlock(),e.createElementBlock("p",Ko,[e.createTextVNode(e.toDisplayString(R.value?"No results found .":"暂无结果,")+" ",1),e.createElementVNode("span",{class:"apply-data",onClick:V[4]||(V[4]=e.withModifiers(()=>p.value=!0,["stop"]))},e.toDisplayString(R.value?" Apply for data addition":"申请补充数据 "),1),e.createElementVNode("img",{src:e.unref(ko),alt:"",class:"apply-data-more-icon",onClick:V[5]||(V[5]=e.withModifiers(()=>p.value=!0,["stop"]))},null,8,Go)])):(e.openBlock(),e.createElementBlock("p",qo,e.toDisplayString(R.value?`No results found related to "${i.value}".`:`未找到与 "${i.value}" 相关的结果`),1))],!0)])):e.createCommentVNode("",!0)],36),[[e.vShow,d.value&&(e.unref(N).length>0||e.unref(S)||i.value||e.unref(v).length>0)]])])),e.createVNode(_e,{value:p.value,"onUpdate:value":V[6]||(V[6]=A=>p.value=A),onConfirm:ft},null,8,["value"])]))}}),Re=(t,o)=>{const n=t.__vccOpts||t;for(const[l,r]of o)n[l]=r;return n},Oe=Re(zo,[["__scopeId","data-v-3c09ec64"]]),Yo={class:"modal-container"},jo={class:"modal-header"},Xo={class:"header-title"},Zo={class:"modal-body"},en={class:"form-item"},tn={class:"required"},on={class:"input-box"},nn=["placeholder"],ln={key:0,class:"error-message"},rn={class:"form-item"},sn={class:"required"},an={class:"type-group"},cn=["onClick"],un={key:0,class:"check-mark"},dn={class:"form-item"},fn={class:"required"},mn={key:0,class:"error-message"},pn={class:"modal-footer"},hn={__name:"ApplyDataDialog",props:{value:{type:Boolean,default:!1},lang:{type:String,default:"",validator:t=>["","en","en-US","zh-CN","cn"].includes(t)},placeholder:{type:String,default:""}},emits:["update:value","confirm"],setup(t,{emit:o}){const n=t,l=o,r=[{typeCn:"城市",typeEn:"City",type:"City"},{typeCn:"海运港口",typeEn:"Port",type:"Seaport"},{typeCn:"机场",typeEn:"Airport",type:"Airport"}],a=e.ref(null),s=e.reactive({name:"",country:""}),i=e.reactive({name:"",type:"City"}),u=e.computed(()=>{if(n.lang)return n.lang==="en"||n.lang==="en-US";try{if(typeof useCookie=="function"){const m=useCookie("jc-language")?.value;if(m)return/^en(-US)?$/.test(m)}}catch{}if(typeof document<"u"){const m=document.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(m)}try{if(typeof useNuxtApp=="function"){const p=useNuxtApp()?.ssrContext?.event?.node?.req?.headers?.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(p)}}catch{}return!1}),c=()=>{s.name="",s.country="",l("update:value",!1)},d=()=>{s.name="",s.country="";let m=!0;i.name.trim()||(s.name=u.value?"Please enter the data":"请输入需要补充的数据",m=!1),a.value||(s.country=u.value?"Please select a country":"请选择国家",m=!1),m&&(D.reportNewTypeDataApi({reportData:i.name,reportType:i.type.toLocaleLowerCase(),countryId:a.value.id}).then(p=>{console.log("🍉 ~ ApplyDataDialog.vue:185 ~ handleConfirm ~ res:",p)}).catch(p=>{console.log("🍉 ~ ApplyDataDialog.vue:187 ~ handleConfirm ~ err:",p)}),l("confirm",{...i,country:a.value}))};return(m,p)=>t.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"modal-mask",onClick:e.withModifiers(c,["self"])},[e.createElementVNode("div",Yo,[e.createElementVNode("div",jo,[e.createElementVNode("span",Xo,e.toDisplayString(u.value?"Apply for data addition":"申请补充数据"),1),e.createElementVNode("div",{class:"close-btn",onClick:c},"×")]),e.createElementVNode("div",Zo,[e.createElementVNode("div",en,[e.createElementVNode("label",tn,e.toDisplayString(u.value?"Data To Add":"需补充的数据"),1),e.createElementVNode("div",on,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[0]||(p[0]=f=>i.name=f),type:"text",placeholder:t.placeholder??(u.value?" Please enter":"请输入"),class:e.normalizeClass(["custom-input",{"input-error":s.name}]),onInput:p[1]||(p[1]=f=>s.name="")},null,42,nn),[[e.vModelText,i.name]])]),s.name?(e.openBlock(),e.createElementBlock("div",ln,e.toDisplayString(s.name),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",rn,[e.createElementVNode("label",sn,e.toDisplayString(u.value?"Type":"所属类别"),1),e.createElementVNode("div",an,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(r,f=>e.createElementVNode("div",{key:f.type,class:e.normalizeClass(["type-btn",{active:i.type===f.type}]),onClick:h=>i.type=f.type},[e.createTextVNode(e.toDisplayString(u.value?f.typeEn:f.typeCn)+" ",1),i.type===f.type?(e.openBlock(),e.createElementBlock("div",un)):e.createCommentVNode("",!0)],10,cn)),64))])]),e.createElementVNode("div",dn,[e.createElementVNode("label",fn,e.toDisplayString(u.value?"Country":"国家"),1),e.createElementVNode("div",{class:e.normalizeClass({"search-error-wrap":s.country})},[e.createVNode(Oe,{"search-type-list":["Country"],"model-value":a.value,"onUpdate:modelValue":[p[2]||(p[2]=f=>a.value=f),p[3]||(p[3]=f=>s.country="")],style:{margin:"0 auto"},lang:t.lang,"show-apply-data":!1,"show-search-icon":!1,placeholder:t.placeholder??(u.value?" Please enter":"请输入")},null,8,["model-value","lang","placeholder"])],2),s.country?(e.openBlock(),e.createElementBlock("div",mn,e.toDisplayString(s.country),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",pn,[e.createElementVNode("button",{class:"confirm-btn",onClick:d},e.toDisplayString(u.value?"Submit":"申请补充"),1)])])])):e.createCommentVNode("",!0)}},_e=Re(hn,[["__scopeId","data-v-055673f8"]]),gn={class:"global-modal-header-custom"},vn={class:"global-modal-body-custom"},yn={class:"global-modal-footer-custom"},rt=e.defineComponent({__name:"GlobalModal",setup(t){const o=e.ref(),n=e.ref(!1),l=e.ref({city:"",company:"",email:"",phone:"",name:"",agreement:!1}),r=e.reactive({city:[{required:!0,message:"请输入所在地城市",trigger:"blur"}],company:[{required:!0,message:"请输入公司名称",trigger:"blur"}],email:[{required:!0,message:"请输入邮箱",trigger:"blur"},{type:"email",message:"请输入有效的邮箱地址",trigger:"blur"}],agreement:[{validator:(u,c,d)=>{c?d():d(new Error("请同意隐私政策"))},trigger:"change"}]}),a=()=>{n.value=!1,D.emitter.emit(D.MODAL_ACTION.Close,void 0),o.value?.resetFields()},s=async()=>{o.value&&await o.value.validate(u=>{u&&(D.emitter.emit(D.MODAL_ACTION.Submit,l.value),a(),l.value={city:"",company:"",email:"",phone:"",name:"",agreement:!1})})},i=u=>{n.value=!0};return e.onMounted(()=>{D.emitter.on(D.MODAL_ACTION.Open,i)}),e.onUnmounted(()=>{D.emitter.off(D.MODAL_ACTION.Open,i)}),(u,c)=>(e.openBlock(),e.createBlock(e.unref(B.ElDialog),{modelValue:n.value,"onUpdate:modelValue":c[7]||(c[7]=d=>n.value=d),"before-close":a,"show-close":!1,"close-on-click-modal":!0,width:500,class:"global-modal-custom"},{header:e.withCtx(()=>[e.createElementVNode("div",gn,[c[9]||(c[9]=e.createElementVNode("h2",null,"即刻链接全球货代",-1)),e.createVNode(e.unref(B.ElButton),{link:"",onClick:a,class:"close-button-custom","aria-label":"Close"},{default:e.withCtx(()=>[...c[8]||(c[8]=[e.createElementVNode("span",{style:{"font-size":"2rem"}},"×",-1)])]),_:1})])]),footer:e.withCtx(()=>[e.createElementVNode("div",yn,[e.createVNode(e.unref(B.ElButton),{type:"primary",class:"submit-button-custom",onClick:s},{default:e.withCtx(()=>[...c[11]||(c[11]=[e.createTextVNode(" 加入会员 ",-1)])]),_:1})])]),default:e.withCtx(()=>[e.createElementVNode("div",vn,[e.createVNode(e.unref(B.ElForm),{model:l.value,rules:r,ref_key:"formRef",ref:o,"label-position":"top",onSubmit:c[6]||(c[6]=e.withModifiers(()=>{},["prevent"]))},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElRow),{gutter:20},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElCol),{span:12},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElFormItem),{label:"所在地(城市)",prop:"city"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElInput),{modelValue:l.value.city,"onUpdate:modelValue":c[0]||(c[0]=d=>l.value.city=d),placeholder:"请输入城市"},null,8,["modelValue"])]),_:1})]),_:1}),e.createVNode(e.unref(B.ElCol),{span:12},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElFormItem),{label:"公司名称",prop:"company"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElInput),{modelValue:l.value.company,"onUpdate:modelValue":c[1]||(c[1]=d=>l.value.company=d),placeholder:"请输入公司名称"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e.createVNode(e.unref(B.ElRow),{gutter:20},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElCol),{span:12},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElFormItem),{label:"邮箱",prop:"email"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElInput),{modelValue:l.value.email,"onUpdate:modelValue":c[2]||(c[2]=d=>l.value.email=d),placeholder:"请输入邮箱"},null,8,["modelValue"])]),_:1})]),_:1}),e.createVNode(e.unref(B.ElCol),{span:12},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElFormItem),{label:"电话",prop:"phone"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElInput),{modelValue:l.value.phone,"onUpdate:modelValue":c[3]||(c[3]=d=>l.value.phone=d),placeholder:"请输入电话"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e.createVNode(e.unref(B.ElRow),null,{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElCol),{span:24},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElFormItem),{label:"姓名",prop:"name"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElInput),{modelValue:l.value.name,"onUpdate:modelValue":c[4]||(c[4]=d=>l.value.name=d),placeholder:"请输入您的全名"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e.createVNode(e.unref(B.ElFormItem),{prop:"agreement",class:"agreement-item"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.ElCheckbox),{modelValue:l.value.agreement,"onUpdate:modelValue":c[5]||(c[5]=d=>l.value.agreement=d),label:"我同意"},null,8,["modelValue"]),c[10]||(c[10]=e.createElementVNode("a",{href:"#",class:"privacy-link"},"隐私政策",-1))]),_:1})]),_:1},8,["model","rules"])])]),_:1},8,["modelValue"]))}});function An(t){const o=e.ref([]),n="_search_history_cache",l=typeof window<"u"&&typeof localStorage<"u",r=e.computed(()=>(t.value||"")+n),a=e.computed(()=>!!t.value&&t.value!==""),s=u=>{if(!u||!l)return;const c=o.value.filter(m=>m.id&&m.id!==u.id||m.display!==u.display);c.unshift(u);const d=c.slice(0,4);if(a.value){o.value=d;try{localStorage.setItem(r.value,JSON.stringify(d))}catch(m){console.warn("LocalStorage save failed:",m)}}},i=()=>{o.value=[],l&&localStorage.removeItem(r.value)};return e.onMounted(()=>{if(l&&a.value){const u=localStorage.getItem(r.value);if(u)try{o.value=JSON.parse(u)}catch{o.value=[]}}}),{searchHistory:o,saveToHistory:s,clearHistory:i,HasHistory:a}}async function wn(t,o=["Continent","Country","City","Seaport","Airport"],n={}){return D.locationSearchV2.searchByName({keyword:t,displayInfo:o,...n})}function kn(t,o){const n=e.ref([]),l=e.ref(!1),r=e.ref(!1),a=e.ref(!1),s=e.ref(1),i=10,u=e.ref(0),c=e.computed(()=>{const p=[...o.value];return p.includes("Country")&&!p.includes("Region")&&p.push("Region"),p}),d=p=>Array.isArray(p)?p.filter(f=>c.value.includes(f.type)):[];return{searchResults:n,loading:l,isFetchingMore:r,isFinished:a,fetchData:async(p=!1)=>{const f=t.value.trim();if(!f){n.value=[],u.value=0,a.value=!1;return}if(p){if(r.value||a.value)return;r.value=!0,s.value+=1}else{if(l.value)return;l.value=!0,s.value=1,a.value=!1}try{const h=await wn(f,o.value,{current:s.value,size:i}),y=d(h.records||[]);p?n.value.push(...y):n.value=y,u.value=h.total||0,(n.value.length>=u.value||y.length<i)&&(a.value=!0)}catch(h){console.error("Search request failed:",h),p&&(s.value-=1)}finally{l.value=!1,r.value=!1}}}}const Cn={class:"h5-search-container"},xn={class:"trigger-content"},En=["src"],Vn={class:"placeholder-text"},Sn={key:0,class:"selected-count"},bn={key:1,class:"selected-val"},Nn={key:2,class:"placeholder-gray"},Bn={key:0,class:"h5-modal-root"},Dn={class:"h5-drawer-card"},Rn={class:"h5-header"},On={class:"h5-input-wrapper"},_n=["src"],Tn=["placeholder"],Mn={key:0,class:"h5-spinner-box"},Ln={key:1,class:"h5-section"},In={class:"h5-section-hd"},Fn={class:"h5-history-grid"},Pn=["onClick"],Un={key:2,class:"h5-result-list"},Hn=["onClick"],Qn={class:"item-info"},$n={class:"item-name"},Jn={key:0,class:"item-sub"},Wn={class:"h5-load-status"},qn={key:1,class:"no-more"},Kn={key:3,class:"h5-empty"},Gn=e.defineComponent({__name:"index",props:{modelValue:{},multiple:{type:Boolean,default:!1},lang:{default:"zh-CN"},placeholder:{},historyKey:{}},emits:["update:modelValue","select"],setup(t,{emit:o}){const n=t,l=o,r=e.ref(!1),a=e.ref(""),s=e.ref(null),i=e.ref(null);let u=null;const{searchHistory:c,saveToHistory:d,clearHistory:m}=An(e.toRef(n,"historyKey")),{searchResults:p,loading:f,isFetchingMore:h,isFinished:y,fetchData:w}=kn(a,e.ref(["City","Seaport","Airport"])),v=e.computed(()=>{if(n.lang)return n.lang==="en"||n.lang==="en-US";try{if(typeof useCookie=="function"){const C=useCookie("jc-language")?.value;if(C)return/^en(-US)?$/.test(C)}}catch{}if(typeof document<"u"){const C=document.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(C)}try{if(typeof useNuxtApp=="function"){const x=useNuxtApp()?.ssrContext?.event?.node?.req?.headers?.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(x)}}catch{}return!1}),k=e.computed(()=>Array.isArray(n.modelValue)?n.modelValue:n.modelValue?[n.modelValue]:[]),b=e.computed(()=>!n.multiple&&!!n.modelValue),N=e.computed(()=>b.value?H(n.modelValue):""),S=e.computed(()=>k.value.length>0),M=()=>{r.value=!0,e.nextTick(()=>{s.value?.focus()})},O=()=>{r.value=!1,a.value=""},P=C=>{d(C),n.multiple?k.value.some(E=>E.id===C.id)||l("update:modelValue",[...k.value,C]):(l("update:modelValue",C),O()),l("select",C)},U=()=>{l("update:modelValue",n.multiple?[]:null)},_=e.ref(!1),G=C=>{const x=C.target;if(!x)return;x.scrollTop+x.clientHeight>=x.scrollHeight-80&&a.value&&!f.value&&!h.value&&!y.value&&!_.value&&(_.value=!0,w(!0))};e.watch(h,C=>{C||(_.value=!1)});const z=()=>{u&&clearTimeout(u),u=setTimeout(()=>{_.value=!1,i.value?.scrollTo({top:0}),console.log("🍉 ~ index.vue:279 ~ onInput ~ fetchData:",w),w(!1)},300)},H=C=>v.value?C.displayEn||C.display:C.displayCn||C.display,R=C=>{const x={City:"城市",Seaport:"港口",Airport:"机场"};return v.value?C:x[C]||C},ee=C=>k.value.some(x=>x.id===C.id);return(C,x)=>(e.openBlock(),e.createElementBlock("div",Cn,[e.createElementVNode("div",{class:"search-trigger",onClick:M},[e.createElementVNode("div",xn,[e.createElementVNode("img",{src:e.unref(Se),class:"search-icon-m"},null,8,En),e.createElementVNode("div",Vn,[t.multiple&&k.value.length>0?(e.openBlock(),e.createElementBlock("span",Sn,e.toDisplayString(v.value?"Selected":"已选")+" ("+e.toDisplayString(k.value.length)+")",1)):!t.multiple&&b.value?(e.openBlock(),e.createElementBlock("span",bn,e.toDisplayString(N.value),1)):(e.openBlock(),e.createElementBlock("span",Nn,e.toDisplayString(t.placeholder||(v.value?"Search":"搜索")),1))])]),S.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"clear-trigger",onClick:e.withModifiers(U,["stop"])},"ⓧ")):e.createCommentVNode("",!0)]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[r.value?(e.openBlock(),e.createElementBlock("div",Bn,[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"h5-mask",onClick:O})]),_:1}),e.createVNode(e.Transition,{name:"slide-up"},{default:e.withCtx(()=>[e.createElementVNode("div",Dn,[e.createElementVNode("div",{class:"drawer-handle",onClick:O}),e.createElementVNode("div",Rn,[e.createElementVNode("div",On,[e.createElementVNode("img",{src:e.unref(Se),class:"inner-icon"},null,8,_n),e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:s,"onUpdate:modelValue":x[0]||(x[0]=E=>a.value=E),placeholder:v.value?"City/Port/Airport":"搜索城市/港口/机场",onInput:z},null,40,Tn),[[e.vModelText,a.value]]),a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"h5-clear-btn",onClick:x[1]||(x[1]=E=>a.value="")}," ✕ ")):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:"h5-cancel-btn",onClick:O},e.toDisplayString(v.value?"Cancel":"取消"),1)]),e.createElementVNode("div",{class:"h5-main-content",ref_key:"scrollContainer",ref:i,onScroll:G},[e.unref(f)&&!e.unref(h)?(e.openBlock(),e.createElementBlock("div",Mn,[...x[3]||(x[3]=[e.createElementVNode("div",{class:"h5-spinner"},null,-1)])])):e.createCommentVNode("",!0),!a.value&&e.unref(c).length>0?(e.openBlock(),e.createElementBlock("div",Ln,[e.createElementVNode("div",In,[e.createElementVNode("span",null,e.toDisplayString(v.value?"Recent":"最近搜索"),1),e.createElementVNode("span",{class:"h5-clear-history",onClick:x[2]||(x[2]=(...E)=>e.unref(m)&&e.unref(m)(...E))},e.toDisplayString(v.value?"Clear":"清空"),1)]),e.createElementVNode("div",Fn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),(E,T)=>(e.openBlock(),e.createElementBlock("div",{key:T,class:"h5-history-tag",onClick:ae=>P(E)},e.toDisplayString(H(E)),9,Pn))),128))])])):e.createCommentVNode("",!0),e.unref(p).length>0?(e.openBlock(),e.createElementBlock("div",Un,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(p),(E,T)=>(e.openBlock(),e.createElementBlock("div",{key:T,class:e.normalizeClass(["h5-result-item",{"is-active":ee(E)}]),onClick:ae=>P(E)},[e.createElementVNode("div",{class:e.normalizeClass(["item-type",E.type.toLowerCase()])},e.toDisplayString(R(E.type)),3),e.createElementVNode("div",Qn,[e.createElementVNode("div",$n,e.toDisplayString(H(E)),1),E.parentName?(e.openBlock(),e.createElementBlock("div",Jn,e.toDisplayString(E.parentName),1)):e.createCommentVNode("",!0)])],10,Hn))),128)),e.createElementVNode("div",Wn,[e.unref(h)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[x[4]||(x[4]=e.createElementVNode("div",{class:"mini-spinner"},null,-1)),e.createElementVNode("span",null,e.toDisplayString(v.value?"Loading...":"加载中..."),1)],64)):e.unref(y)&&a.value?(e.openBlock(),e.createElementBlock("span",qn,e.toDisplayString(v.value?"No more results":"没有更多结果了"),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),a.value&&!e.unref(f)&&e.unref(p).length===0?(e.openBlock(),e.createElementBlock("div",Kn,e.toDisplayString(v.value?"No Results Found":"未找到相关结果"),1)):e.createCommentVNode("",!0)],544)])]),_:1})])):e.createCommentVNode("",!0)]))]))}}),st=Re(Gn,[["__scopeId","data-v-c1314e9c"]]);let zn={open(){D.emitter.emit(D.MODAL_ACTION.Open)},close(){D.emitter.emit(D.MODAL_ACTION.Close)},onSubmit(t){D.emitter.on(D.MODAL_ACTION.Submit,t)}};function Yn(){let t=!1;return{install(o){if(typeof window<"u"&&!t){const n=document.createElement("div");n.setAttribute("id","global-modal-root"),document.body.appendChild(n),e.createApp(rt).mount(n),t=!0}o.config.globalProperties.$globalModal=zn}}}const qe={ApplyDataDialog:_e,JcSearch:Oe,JCMSearch:st};let Ke=!1;const jn={install(t,o){if(!Ke){Ke=!0,o?.sharedConfig&&D.initSharedConfig(o.sharedConfig);for(const n in qe)t.component(n,qe[n])}}};Object.defineProperty(exports,"MODAL_ACTION",{enumerable:!0,get:()=>D.MODAL_ACTION});Object.defineProperty(exports,"emitter",{enumerable:!0,get:()=>D.emitter});Object.defineProperty(exports,"initSharedConfig",{enumerable:!0,get:()=>D.initSharedConfig});exports.ApplyDataDialog=_e;exports.GlobalModal=rt;exports.JCMSearch=st;exports.JcSearch=Oe;exports.createGlobalModalPlugin=Yn;exports.default=jn;