@jctrans-materials/comps-vue2 1.0.6 → 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.
@@ -1,5 +1,3 @@
1
- import { SearchItem } from './type';
2
-
3
1
  declare const _default: import('vue').DefineComponent<{
4
2
  value: {
5
3
  type: (ArrayConstructor | ObjectConstructor)[];
@@ -37,10 +35,15 @@ declare const _default: import('vue').DefineComponent<{
37
35
  type: BooleanConstructor;
38
36
  default: boolean;
39
37
  };
38
+ showApplyData: {
39
+ type: BooleanConstructor;
40
+ default: boolean;
41
+ };
40
42
  }, {
41
43
  query: import('vue').Ref<string>;
42
44
  isSelected: import('vue').Ref<boolean>;
43
45
  isDropdownVisible: import('vue').Ref<boolean>;
46
+ applyDataVisible: import('vue').Ref<boolean>;
44
47
  selectedLabel: import('vue').Ref<string>;
45
48
  inputRef: import('vue').Ref<null>;
46
49
  referenceRef: import('vue').Ref<null>;
@@ -72,17 +75,19 @@ declare const _default: import('vue').DefineComponent<{
72
75
  isFinished: import('vue').ComputedRef<boolean>;
73
76
  currentPage: import('vue').Ref<number>;
74
77
  floatingStyles: import('vue').Ref<import('vue').CSSProperties>;
75
- saveToHistory: (item: SearchItem) => void;
78
+ saveToHistory: (item: import('./type').SearchItem) => void;
76
79
  clearHistory: () => void;
77
80
  fetchData: (page?: number, appendMode?: boolean) => Promise<void>;
78
- filterByTypes: (data: SearchItem[]) => SearchItem[];
81
+ filterByTypes: (data: import('./type').SearchItem[]) => import('./type').SearchItem[];
79
82
  startTrack: () => void;
80
83
  stopTrack: () => void;
81
84
  onFocus: () => Promise<void>;
82
85
  handleBlur: () => void;
83
86
  onInput: (e: any) => void;
84
87
  handleDelete: () => void;
88
+ handleConfirmApplyData: (e: any) => void;
85
89
  SearchIcon: string;
90
+ ICON_MORE: string;
86
91
  }, {}, {
87
92
  isEn(): boolean;
88
93
  selectedItems(): any[];
@@ -138,6 +143,10 @@ declare const _default: import('vue').DefineComponent<{
138
143
  type: BooleanConstructor;
139
144
  default: boolean;
140
145
  };
146
+ showApplyData: {
147
+ type: BooleanConstructor;
148
+ default: boolean;
149
+ };
141
150
  }>>, {
142
151
  multiple: boolean;
143
152
  value: Record<string, any> | unknown[];
@@ -148,5 +157,6 @@ declare const _default: import('vue').DefineComponent<{
148
157
  placeholder: string;
149
158
  showSearchIcon: boolean;
150
159
  showItemTag: boolean;
160
+ showApplyData: boolean;
151
161
  }>;
152
162
  export default _default;
package/dist/index.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("vue"),S=require("@jctrans-materials/shared"),R=require("jctrans-ui");v.util.warn;function zt(e){const t=v.ref([]),n="_search_history_cache",o=typeof window<"u"&&typeof localStorage<"u",s=v.computed(()=>(e.value||"")+n),i=v.computed(()=>!!e.value&&e.value!==""),r=l=>{if(!l||!o)return;const u=t.value.filter(f=>f.id&&f.id!==l.id||f.display!==l.display);u.unshift(l);const c=u.slice(0,4);if(i.value){t.value=c;try{localStorage.setItem(s.value,JSON.stringify(c))}catch(f){console.warn("LocalStorage save failed:",f)}}},a=()=>{t.value=[],o&&localStorage.removeItem(s.value)};return v.onMounted(()=>{if(o&&i.value){const l=localStorage.getItem(s.value);if(l)try{t.value=JSON.parse(l)}catch{t.value=[]}}}),{searchHistory:t,saveToHistory:r,clearHistory:a,HasHistory:i}}async function Xt(e,t=["Continent","Country","City","Seaport","Airport"],n={}){return S.locationSearchV2.searchByName({keyword:e,displayInfo:t,...n})}const pt=(e,t)=>S.locationSearchV2.searchByIdWithType(e,t);function $t(e,t){const n=v.ref([]),o=v.ref(!1),s=v.ref(!1),i=v.ref(1),r=v.ref(0),a=v.ref(10),l=v.computed(()=>r.value===0?!1:n.value.length>=r.value),u=v.computed(()=>{const m=[...t.value];return m.includes("Country")&&!m.includes("Region")&&m.push("Region"),m}),c=m=>!m||!Array.isArray(m)?[]:m.filter(d=>u.value.includes(d.type));return{searchResults:n,loading:o,isFetchingMore:s,isFinished:l,currentPage:i,total:r,fetchData:async(m=1,d=!1)=>{if(!e.value.trim()&&!d){n.value=[],r.value=0;return}if(!(d&&(s.value||l.value))&&!(!d&&o.value)){d?s.value=!0:(o.value=!0,i.value=1);try{const p=await Xt(e.value,t.value,{current:m,size:a.value}),h=p.records||[],y=c(h);d?n.value=[...n.value,...y]:n.value=y,r.value=p.total||0,i.value=m}catch(p){console.error("Failed to fetch search results:",p)}finally{o.value=!1,s.value=!1}}},filterByTypes:c}}const $=Math.min,T=Math.max,at=Math.round,rt=Math.floor,Q=e=>({x:e,y:e}),Zt={left:"right",right:"left",bottom:"top",top:"bottom"},te={start:"end",end:"start"};function Rt(e,t,n){return T(e,$(t,n))}function nt(e,t){return typeof e=="function"?e(t):e}function G(e){return e.split("-")[0]}function ot(e){return e.split("-")[1]}function Mt(e){return e==="x"?"y":"x"}function Nt(e){return e==="y"?"height":"width"}const ee=new Set(["top","bottom"]);function J(e){return ee.has(G(e))?"y":"x"}function Pt(e){return Mt(J(e))}function ne(e,t,n){n===void 0&&(n=!1);const o=ot(e),s=Pt(e),i=Nt(s);let r=s==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(r=lt(r)),[r,lt(r)]}function oe(e){const t=lt(e);return[gt(e),t,gt(t)]}function gt(e){return e.replace(/start|end/g,t=>te[t])}const Ot=["left","right"],_t=["right","left"],se=["top","bottom"],ie=["bottom","top"];function re(e,t,n){switch(e){case"top":case"bottom":return n?t?_t:Ot:t?Ot:_t;case"left":case"right":return t?se:ie;default:return[]}}function ae(e,t,n,o){const s=ot(e);let i=re(G(e),n==="start",o);return s&&(i=i.map(r=>r+"-"+s),t&&(i=i.concat(i.map(gt)))),i}function lt(e){return e.replace(/left|right|bottom|top/g,t=>Zt[t])}function le(e){return{top:0,right:0,bottom:0,left:0,...e}}function ce(e){return typeof e!="number"?le(e):{top:e,right:e,bottom:e,left:e}}function ct(e){const{x:t,y:n,width:o,height:s}=e;return{width:o,height:s,top:n,left:t,right:t+o,bottom:n+s,x:t,y:n}}function Et(e,t,n){let{reference:o,floating:s}=e;const i=J(t),r=Pt(t),a=Nt(r),l=G(t),u=i==="y",c=o.x+o.width/2-s.width/2,f=o.y+o.height/2-s.height/2,m=o[a]/2-s[a]/2;let d;switch(l){case"top":d={x:c,y:o.y-s.height};break;case"bottom":d={x:c,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:f};break;case"left":d={x:o.x-s.width,y:f};break;default:d={x:o.x,y:o.y}}switch(ot(t)){case"start":d[r]-=m*(n&&u?-1:1);break;case"end":d[r]+=m*(n&&u?-1:1);break}return d}const ue=async(e,t,n)=>{const{placement:o="bottom",strategy:s="absolute",middleware:i=[],platform:r}=n,a=i.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let u=await r.getElementRects({reference:e,floating:t,strategy:s}),{x:c,y:f}=Et(u,o,l),m=o,d={},p=0;for(let h=0;h<a.length;h++){const{name:y,fn:g}=a[h],{x:w,y:b,data:D,reset:x}=await g({x:c,y:f,initialPlacement:o,placement:m,strategy:s,middlewareData:d,rects:u,platform:r,elements:{reference:e,floating:t}});c=w??c,f=b??f,d={...d,[y]:{...d[y],...D}},x&&p<=50&&(p++,typeof x=="object"&&(x.placement&&(m=x.placement),x.rects&&(u=x.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:s}):x.rects),{x:c,y:f}=Et(u,m,l)),h=-1)}return{x:c,y:f,placement:m,strategy:s,middlewareData:d}};async function vt(e,t){var n;t===void 0&&(t={});const{x:o,y:s,platform:i,rects:r,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:m=!1,padding:d=0}=nt(t,e),p=ce(d),y=a[m?f==="floating"?"reference":"floating":f],g=ct(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),w=f==="floating"?{x:o,y:s,width:r.floating.width,height:r.floating.height}:r.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),D=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},x=ct(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:b,strategy:l}):w);return{top:(g.top-x.top+p.top)/D.y,bottom:(x.bottom-g.bottom+p.bottom)/D.y,left:(g.left-x.left+p.left)/D.x,right:(x.right-g.right+p.right)/D.x}}const fe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:s,middlewareData:i,rects:r,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...y}=nt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=G(s),w=J(a),b=G(a)===a,D=await(l.isRTL==null?void 0:l.isRTL(u.floating)),x=m||(b||!h?[lt(a)]:oe(a)),F=p!=="none";!m&&F&&x.push(...ae(a,h,p,D));const I=[a,...x],H=await vt(t,y),q=[];let B=((o=i.flip)==null?void 0:o.overflows)||[];if(c&&q.push(H[g]),f){const E=ne(s,r,D);q.push(H[E[0]],H[E[1]])}if(B=[...B,{placement:s,overflows:q}],!q.every(E=>E<=0)){var Y,W;const E=(((Y=i.flip)==null?void 0:Y.index)||0)+1,O=I[E];if(O&&(!(f==="alignment"?w!==J(O):!1)||B.every(C=>J(C.placement)===w?C.overflows[0]>0:!0)))return{data:{index:E,overflows:B},reset:{placement:O}};let M=(W=B.filter(_=>_.overflows[0]<=0).sort((_,C)=>_.overflows[1]-C.overflows[1])[0])==null?void 0:W.placement;if(!M)switch(d){case"bestFit":{var A;const _=(A=B.filter(C=>{if(F){const L=J(C.placement);return L===w||L==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(L=>L>0).reduce((L,z)=>L+z,0)]).sort((C,L)=>C[1]-L[1])[0])==null?void 0:A[0];_&&(M=_);break}case"initialPlacement":M=a;break}if(s!==M)return{reset:{placement:M}}}return{}}}},de=new Set(["left","top"]);async function me(e,t){const{placement:n,platform:o,elements:s}=e,i=await(o.isRTL==null?void 0:o.isRTL(s.floating)),r=G(n),a=ot(n),l=J(n)==="y",u=de.has(r)?-1:1,c=i&&l?-1:1,f=nt(t,e);let{mainAxis:m,crossAxis:d,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof p=="number"&&(d=a==="end"?p*-1:p),l?{x:d*c,y:m*u}:{x:m*u,y:d*c}}const pe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:s,y:i,placement:r,middlewareData:a}=t,l=await me(t,e);return r===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:r}}}}},he=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:s}=t,{mainAxis:i=!0,crossAxis:r=!1,limiter:a={fn:y=>{let{x:g,y:w}=y;return{x:g,y:w}}},...l}=nt(e,t),u={x:n,y:o},c=await vt(t,l),f=J(G(s)),m=Mt(f);let d=u[m],p=u[f];if(i){const y=m==="y"?"top":"left",g=m==="y"?"bottom":"right",w=d+c[y],b=d-c[g];d=Rt(w,d,b)}if(r){const y=f==="y"?"top":"left",g=f==="y"?"bottom":"right",w=p+c[y],b=p-c[g];p=Rt(w,p,b)}const h=a.fn({...t,[m]:d,[f]:p});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[m]:i,[f]:r}}}}}},ge=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:s,rects:i,platform:r,elements:a}=t,{apply:l=()=>{},...u}=nt(e,t),c=await vt(t,u),f=G(s),m=ot(s),d=J(s)==="y",{width:p,height:h}=i.floating;let y,g;f==="top"||f==="bottom"?(y=f,g=m===(await(r.isRTL==null?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(g=f,y=m==="end"?"top":"bottom");const w=h-c.top-c.bottom,b=p-c.left-c.right,D=$(h-c[y],w),x=$(p-c[g],b),F=!t.middlewareData.shift;let I=D,H=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(H=b),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(I=w),F&&!m){const B=T(c.left,0),Y=T(c.right,0),W=T(c.top,0),A=T(c.bottom,0);d?H=p-2*(B!==0||Y!==0?B+Y:T(c.left,c.right)):I=h-2*(W!==0||A!==0?W+A:T(c.top,c.bottom))}await l({...t,availableWidth:H,availableHeight:I});const q=await r.getDimensions(a.floating);return p!==q.width||h!==q.height?{reset:{rects:!0}}:{}}}};function ut(){return typeof window<"u"}function tt(e){return Qt(e)?(e.nodeName||"").toLowerCase():"#document"}function k(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function U(e){var t;return(t=(Qt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Qt(e){return ut()?e instanceof Node||e instanceof k(e).Node:!1}function N(e){return ut()?e instanceof Element||e instanceof k(e).Element:!1}function V(e){return ut()?e instanceof HTMLElement||e instanceof k(e).HTMLElement:!1}function Tt(e){return!ut()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof k(e).ShadowRoot}const ye=new Set(["inline","contents"]);function st(e){const{overflow:t,overflowX:n,overflowY:o,display:s}=P(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!ye.has(s)}const ve=new Set(["table","td","th"]);function Ae(e){return ve.has(tt(e))}const we=[":popover-open",":modal"];function ft(e){return we.some(t=>{try{return e.matches(t)}catch{return!1}})}const be=["transform","translate","scale","rotate","perspective"],xe=["transform","translate","scale","rotate","perspective","filter"],Ce=["paint","layout","strict","content"];function At(e){const t=wt(),n=N(e)?P(e):e;return be.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||xe.some(o=>(n.willChange||"").includes(o))||Ce.some(o=>(n.contain||"").includes(o))}function Se(e){let t=K(e);for(;V(t)&&!Z(t);){if(At(t))return t;if(ft(t))return null;t=K(t)}return null}function wt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const De=new Set(["html","body","#document"]);function Z(e){return De.has(tt(e))}function P(e){return k(e).getComputedStyle(e)}function dt(e){return N(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function K(e){if(tt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Tt(e)&&e.host||U(e);return Tt(t)?t.host:t}function Vt(e){const t=K(e);return Z(t)?e.ownerDocument?e.ownerDocument.body:e.body:V(t)&&st(t)?t:Vt(t)}function et(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Vt(e),i=s===((o=e.ownerDocument)==null?void 0:o.body),r=k(s);if(i){const a=yt(r);return t.concat(r,r.visualViewport||[],st(s)?s:[],a&&n?et(a):[])}return t.concat(s,et(s,[],n))}function yt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ut(e){const t=P(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const s=V(e),i=s?e.offsetWidth:n,r=s?e.offsetHeight:o,a=at(n)!==i||at(o)!==r;return a&&(n=i,o=r),{width:n,height:o,$:a}}function bt(e){return N(e)?e:e.contextElement}function X(e){const t=bt(e);if(!V(t))return Q(1);const n=t.getBoundingClientRect(),{width:o,height:s,$:i}=Ut(t);let r=(i?at(n.width):n.width)/o,a=(i?at(n.height):n.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const Re=Q(0);function Ht(e){const t=k(e);return!wt()||!t.visualViewport?Re:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Oe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==k(e)?!1:t}function j(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=bt(e);let r=Q(1);t&&(o?N(o)&&(r=X(o)):r=X(e));const a=Oe(i,n,o)?Ht(i):Q(0);let l=(s.left+a.x)/r.x,u=(s.top+a.y)/r.y,c=s.width/r.x,f=s.height/r.y;if(i){const m=k(i),d=o&&N(o)?k(o):o;let p=m,h=yt(p);for(;h&&o&&d!==p;){const y=X(h),g=h.getBoundingClientRect(),w=P(h),b=g.left+(h.clientLeft+parseFloat(w.paddingLeft))*y.x,D=g.top+(h.clientTop+parseFloat(w.paddingTop))*y.y;l*=y.x,u*=y.y,c*=y.x,f*=y.y,l+=b,u+=D,p=k(h),h=yt(p)}}return ct({width:c,height:f,x:l,y:u})}function mt(e,t){const n=dt(e).scrollLeft;return t?t.left+n:j(U(e)).left+n}function qt(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-mt(e,n),s=n.top+t.scrollTop;return{x:o,y:s}}function _e(e){let{elements:t,rect:n,offsetParent:o,strategy:s}=e;const i=s==="fixed",r=U(o),a=t?ft(t.floating):!1;if(o===r||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=Q(1);const c=Q(0),f=V(o);if((f||!f&&!i)&&((tt(o)!=="body"||st(r))&&(l=dt(o)),V(o))){const d=j(o);u=X(o),c.x=d.x+o.clientLeft,c.y=d.y+o.clientTop}const m=r&&!f&&!i?qt(r,l):Q(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+m.x,y:n.y*u.y-l.scrollTop*u.y+c.y+m.y}}function Ee(e){return Array.from(e.getClientRects())}function Te(e){const t=U(e),n=dt(e),o=e.ownerDocument.body,s=T(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=T(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+mt(e);const a=-n.scrollTop;return P(o).direction==="rtl"&&(r+=T(t.clientWidth,o.clientWidth)-s),{width:s,height:i,x:r,y:a}}const kt=25;function ke(e,t){const n=k(e),o=U(e),s=n.visualViewport;let i=o.clientWidth,r=o.clientHeight,a=0,l=0;if(s){i=s.width,r=s.height;const c=wt();(!c||c&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}const u=mt(o);if(u<=0){const c=o.ownerDocument,f=c.body,m=getComputedStyle(f),d=c.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,p=Math.abs(o.clientWidth-f.clientWidth-d);p<=kt&&(i-=p)}else u<=kt&&(i+=u);return{width:i,height:r,x:a,y:l}}const Ie=new Set(["absolute","fixed"]);function Le(e,t){const n=j(e,!0,t==="fixed"),o=n.top+e.clientTop,s=n.left+e.clientLeft,i=V(e)?X(e):Q(1),r=e.clientWidth*i.x,a=e.clientHeight*i.y,l=s*i.x,u=o*i.y;return{width:r,height:a,x:l,y:u}}function It(e,t,n){let o;if(t==="viewport")o=ke(e,n);else if(t==="document")o=Te(U(e));else if(N(t))o=Le(t,n);else{const s=Ht(e);o={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return ct(o)}function Jt(e,t){const n=K(e);return n===t||!N(n)||Z(n)?!1:P(n).position==="fixed"||Jt(n,t)}function Fe(e,t){const n=t.get(e);if(n)return n;let o=et(e,[],!1).filter(a=>N(a)&&tt(a)!=="body"),s=null;const i=P(e).position==="fixed";let r=i?K(e):e;for(;N(r)&&!Z(r);){const a=P(r),l=At(r);!l&&a.position==="fixed"&&(s=null),(i?!l&&!s:!l&&a.position==="static"&&!!s&&Ie.has(s.position)||st(r)&&!l&&Jt(e,r))?o=o.filter(c=>c!==r):s=a,r=K(r)}return t.set(e,o),o}function Be(e){let{element:t,boundary:n,rootBoundary:o,strategy:s}=e;const r=[...n==="clippingAncestors"?ft(t)?[]:Fe(t,this._c):[].concat(n),o],a=r[0],l=r.reduce((u,c)=>{const f=It(t,c,s);return u.top=T(f.top,u.top),u.right=$(f.right,u.right),u.bottom=$(f.bottom,u.bottom),u.left=T(f.left,u.left),u},It(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Me(e){const{width:t,height:n}=Ut(e);return{width:t,height:n}}function Ne(e,t,n){const o=V(t),s=U(t),i=n==="fixed",r=j(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Q(0);function u(){l.x=mt(s)}if(o||!o&&!i)if((tt(t)!=="body"||st(s))&&(a=dt(t)),o){const d=j(t,!0,i,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else s&&u();i&&!o&&s&&u();const c=s&&!o&&!i?qt(s,a):Q(0),f=r.left+a.scrollLeft-l.x-c.x,m=r.top+a.scrollTop-l.y-c.y;return{x:f,y:m,width:r.width,height:r.height}}function ht(e){return P(e).position==="static"}function Lt(e,t){if(!V(e)||P(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return U(e)===n&&(n=n.ownerDocument.body),n}function Wt(e,t){const n=k(e);if(ft(e))return n;if(!V(e)){let s=K(e);for(;s&&!Z(s);){if(N(s)&&!ht(s))return s;s=K(s)}return n}let o=Lt(e,t);for(;o&&Ae(o)&&ht(o);)o=Lt(o,t);return o&&Z(o)&&ht(o)&&!At(o)?n:o||Se(e)||n}const Pe=async function(e){const t=this.getOffsetParent||Wt,n=this.getDimensions,o=await n(e.floating);return{reference:Ne(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Qe(e){return P(e).direction==="rtl"}const Ve={convertOffsetParentRelativeRectToViewportRelativeRect:_e,getDocumentElement:U,getClippingRect:Be,getOffsetParent:Wt,getElementRects:Pe,getClientRects:Ee,getDimensions:Me,getScale:X,isElement:N,isRTL:Qe};function Gt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ue(e,t){let n=null,o;const s=U(e);function i(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function r(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const u=e.getBoundingClientRect(),{left:c,top:f,width:m,height:d}=u;if(a||t(),!m||!d)return;const p=rt(f),h=rt(s.clientWidth-(c+m)),y=rt(s.clientHeight-(f+d)),g=rt(c),b={rootMargin:-p+"px "+-h+"px "+-y+"px "+-g+"px",threshold:T(0,$(1,l))||1};let D=!0;function x(F){const I=F[0].intersectionRatio;if(I!==l){if(!D)return r();I?r(!1,I):o=setTimeout(()=>{r(!1,1e-7)},1e3)}I===1&&!Gt(u,e.getBoundingClientRect())&&r(),D=!1}try{n=new IntersectionObserver(x,{...b,root:s.ownerDocument})}catch{n=new IntersectionObserver(x,b)}n.observe(e)}return r(!0),i}function He(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=bt(e),c=s||i?[...u?et(u):[],...et(t)]:[];c.forEach(g=>{s&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const f=u&&a?Ue(u,n):null;let m=-1,d=null;r&&(d=new ResizeObserver(g=>{let[w]=g;w&&w.target===u&&d&&(d.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=d)==null||b.observe(t)})),n()}),u&&!l&&d.observe(u),d.observe(t));let p,h=l?j(e):null;l&&y();function y(){const g=j(e);h&&!Gt(h,g)&&n(),h=g,p=requestAnimationFrame(y)}return n(),()=>{var g;c.forEach(w=>{s&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),f?.(),(g=d)==null||g.disconnect(),d=null,l&&cancelAnimationFrame(p)}}const qe=pe,Je=he,We=fe,Ge=ge,Ke=(e,t,n)=>{const o=new Map,s={platform:Ve,...n},i={...s.platform,_c:o};return ue(e,t,{...s,platform:i})};function Ye(e,t){const n=v.ref({position:"fixed",left:"0",top:"0",zIndex:3e3});let o=null;const s=()=>{!e.value||!t.value||Ke(e.value,t.value,{placement:"bottom-start",strategy:"fixed",middleware:[qe(6),We(),Je({padding:10}),Ge({apply({rects:a,elements:l}){const u=`${a.reference.width}px`;Object.assign(l.floating.style,{width:u,minWidth:u,maxWidth:u})}})]}).then(({x:a,y:l})=>{Object.assign(n.value,{left:`${a}px`,top:`${l}px`})})},i=()=>{e.value&&t.value&&(o=He(e.value,t.value,s))},r=()=>{o&&(o(),o=null)};return v.onBeforeUnmount(r),{floatingStyles:n,startTrack:i,stopTrack:r}}const je="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",ze="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABFUlEQVR4AaRQO07DQBCdWe8B4B5IFFyAK9ARkIVNhIQEEiVtJLgABRVRvIBCJBquwBVyDgoaSnuHeZY3MlYcNsnIb8fze6M3hra0XoKJm95N3Nv3EnyhFvb2EgjRJbOMKqmO2tDcvQ5fK+qvl4CJbOn9/CJPP9tArp5sHtP4lc652VXxPL1Z1hRFIOytF1NuTJCfnT4Ms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Z4vBCSyx+w/Nnb1KElkkwG4OqGhG79QUImEkT0T2JrpZ4fV5sF0Ad6je9BrBKxLeZuVv8rS9IAG4qGf5oTPSolNxIXOyUNjqlpb0W4xI+Cd62dVqcAAGBVqSCVmPMIoPCttzm2MEBAoeLir4hRK2AWPyVIAHRHMH0Ly0tCBF3M5t+Aq6A0HPJSSyCeZAIz7BNAgQwqxNyc1NL7MCoeyH1xNWpuKsTcet7fv46QI0/zdoEtkmAwHGcHyFQj/Q57vuPzm7m+X5efB6HYj3kOCubuLVlApltfdbPX5uaetCmdeKVAqUN1mdy04XR3PTsqAHPWMztTb24myvEBBuRM+WlUnbzDEXeya2D4XC0zrJqnXwsO3pG3mCMGWMK6lQZk2A0hH2GMSxL9VlI6lVkd90RgGKkVFrrc+9REXubjLH9FxfbbVUVGG5v4i2p8LD8x9ax65C66KTfKGCSDc97fv6DJzuf9QtDtm+iqsM1ot70w9O+YDbmSQ6bkkyCJitnAUcnryqmuExgSsZYKypvgFvS+5xVsJk0MGlps97mFCVXpnNZqoBcbo2QyJz7dCLj6JTj6tRxVyf3izZUtNndwM73SU55JzaO4Q8AAAD//54At5MAAAAGSURBVAMAh2IbMAJQAZQAAAAASUVORK5CYII=",en=v.defineComponent({name:"GlobalSearch",model:{prop:"value",event:"input"},props:{value:{type:[Object,Array],default:null},multiple:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},searchTypeList:{type:Array,default:()=>["City","Seaport","Airport","Country"]},historyKey:{type:String,default:""},lang:{type:String,default:""},placeholder:{type:String,default:""},showSearchIcon:{type:Boolean,default:!0},showItemTag:{type:Boolean,default:!0}},setup(e,{emit:t}){const n=v.ref(""),o=v.ref(!1),s=v.ref(!1),i=v.ref(""),r=v.ref(null),a=v.ref(null),l=v.ref(null),u=v.ref(null),{searchHistory:c,saveToHistory:f,clearHistory:m}=zt(v.toRef(e,"historyKey")),{searchResults:d,loading:p,isFetchingMore:h,isFinished:y,currentPage:g,fetchData:w,filterByTypes:b}=$t(n,v.toRef(e,"searchTypeList")),{floatingStyles:D,startTrack:x,stopTrack:F}=Ye(l,u),I=async()=>{if(s.value=!0,!e.multiple&&o.value&&d.value.length===0){const A=e.value;if(A?.id){p.value=!0;try{const E=await pt(A.id,A.type);d.value=b(E.records)}finally{p.value=!1}}}},H=()=>{setTimeout(()=>{s.value=!1},200)},q=A=>{A.target.value===""&&!e.multiple&&(o.value=!1,t("input",null),t("update:value",null))},B=()=>{if(e.multiple&&!n.value&&e.value?.length>0){const A=[...e.value],E=A.pop();t("input",A),t("update:value",A),t("remove",E)}};v.watch(s,A=>A?x():F()),v.watch(n,A=>{if(!A.trim()){d.value=[];return}r.value&&clearTimeout(r.value),r.value=setTimeout(()=>w(1,!1),300)});const Y=v.computed(()=>e.lang?e.lang==="en"||e.lang==="en-US":typeof document<"u"?/(^|;\s*)jc-language=en(-US)?(;|$)/.test(document.cookie||""):!1),W=A=>Y.value?A.displayEn||A.display||A.nameEn||"":A.displayCn||A.display||A.nameCn||A.name||"";return v.watch(()=>e.value,async(A,E)=>{if(console.log("🍉 ~ index.vue:304 ~ newVal:",A),JSON.stringify(A)===JSON.stringify(E))return;if(e.multiple&&Array.isArray(A)){const M=[...A],_=M.filter(C=>C&&C.id&&C.type);if(_.length>0)try{const C=_.map(z=>z.id),L=await pt(C,_[0].type);if(L&&L.records){let z=!1;const St=M.map(it=>{const Dt=L.records.find(jt=>jt.id===it.id);return Dt&&!it.display?(z=!0,{...it,...Dt}):it});z&&(t("input",St),t("update:value",St))}}catch(C){console.error("Batch fetch detail failed:",C)}return}const O=A;if(!O){o.value=!1,i.value="";return}if(typeof O=="object")if(O.id&&O.type&&!O.display)try{const _=(await pt(O.id,O.type)).records.find(C=>C.id===O.id);_&&(i.value=W(_),o.value=!0)}catch(M){console.error("Single fetch detail failed:",M)}else i.value=W(O),o.value=!!i.value;else i.value=String(O),o.value=!!O},{immediate:!0,deep:!0}),v.onBeforeUnmount(F),{query:n,isSelected:o,isDropdownVisible:s,selectedLabel:i,inputRef:a,referenceRef:l,floatingRef:u,searchHistory:c,searchResults:d,loading:p,isFetchingMore:h,isFinished:y,currentPage:g,floatingStyles:D,saveToHistory:f,clearHistory:m,fetchData:w,filterByTypes:b,startTrack:x,stopTrack:F,onFocus:I,handleBlur:H,onInput:q,handleDelete:B,SearchIcon:je}},computed:{isEn(){if(this.lang&&this.lang!=="")return this.lang==="en"||this.lang==="en-US";try{if(typeof useCookie=="function"){const e=useCookie("jc-language")?.value;if(e)return/^en(-US)?$/.test(e)}}catch{}if(typeof document<"u"){const e=document.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(e)}try{if(typeof useNuxtApp=="function"){const t=useNuxtApp()?.ssrContext?.event?.node?.req?.headers?.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(t)}}catch{}return!1},selectedItems(){return this.value?Array.isArray(this.value)?this.value:[this.value]:[]},displayedTags(){return this.collapseTags?this.selectedItems.slice(0,1):this.selectedItems},hasValue(){return this.query||this.selectedItems.length>0},inputWidth(){return this.multiple?this.query?`${this.query.length*10+20}px`:"10px":"100%"},currentPlaceholder(){return this.multiple&&this.selectedItems.length>0?"":this.isSelected&&!this.multiple?this.selectedLabel:this.placeholder||this.isEn?"Please enter...":"请输入..."}},methods:{focusInput(){this.$refs.inputRef?.focus()},getItemLabel(e){return this.isEn?e.displayEn||e.display||"":e.displayCn||e.display||""},getItemType(e){const t={City:{en:"City",cn:"城市"},Country:{en:"Country",cn:"国家"},Region:{en:"Region",cn:"区域"},Airport:{en:"Airport",cn:"机场"},Seaport:{en:"Seaport",cn:"港口"}};return this.isEn?t[e].en:t[e].cn},isItemActive(e){return this.selectedItems.some(t=>t.id===e.id)},selectItem(e){this.saveToHistory(e),this.multiple?this.isItemActive(e)||(this.$emit("input",[...this.selectedItems,e]),this.$emit("update:value",[...this.selectedItems,e])):(this.isSelected=!0,this.selectedLabel=this.getItemLabel(e),this.$emit("input",e),this.$emit("update:value",e),this.isDropdownVisible=!1),this.query="",this.$emit("select",e)},removeItem(e){const t=this.selectedItems.filter(n=>n.id!==e.id);this.$emit("input",t),this.$emit("update:value",t),this.$emit("remove",e)},clearAll(){this.query="",this.isSelected=!1,this.selectedLabel="",this.$emit("input",this.multiple?[]:null),this.$emit("update:value",this.multiple?[]:null)},handleSearch(){const e=this.multiple?this.selectedItems:this.isSelected?this.value:null;this.$emit("submit-search",e),this.isDropdownVisible=!1},getIconUrl(e){return{City:ze,Seaport:Xe,Airport:$e,Country:Ze}[e]||tn},handleScroll(e){const{scrollTop:t,scrollHeight:n,clientHeight:o}=e.target;t+o>=n-20&&!this.loading&&!this.isFetchingMore&&!this.isFinished&&this.query&&this.fetchData(this.currentPage+1,!0)}}});function xt(e,t,n,o,s,i,r,a){var l=typeof e=="function"?e.options:e;return t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),i&&(l._scopeId="data-v-"+i),{exports:e,options:l}}var nn=function(){var t=this,n=t._self._c;return t._self._setupProxy,n("div",{staticClass:"search-container"},[n("div",{ref:"referenceRef",staticClass:"search-input-wrapper",class:{"is-multiple":t.multiple},on:{click:t.focusInput}},[n("div",{staticClass:"selection-wrapper"},[t.multiple&&t.selectedItems.length>0?[t._l(t.displayedTags,function(o,s){return n("div",{key:o.id||s,staticClass:"search-tag"},[n("span",{staticClass:"tag-text"},[t._v(t._s(t.getItemLabel(o)))]),n("span",{staticClass:"tag-close",on:{click:function(i){return i.stopPropagation(),t.removeItem(o)}}},[t._v("×")])])}),t.collapseTags&&t.selectedItems.length>1?n("div",{staticClass:"search-tag collapse"},[t._v(" + "+t._s(t.selectedItems.length-1)+" ")]):t._e()]:t._e(),n("input",{directives:[{name:"model",rawName:"v-model",value:t.query,expression:"query"}],ref:"inputRef",class:{"is-selected-state":t.isSelected&&!t.multiple},style:{width:t.inputWidth},attrs:{type:"text",placeholder:t.currentPlaceholder},domProps:{value:t.query},on:{focus:t.onFocus,blur:t.handleBlur,input:[function(o){o.target.composing||(t.query=o.target.value)},t.onInput],keydown:function(o){return!o.type.indexOf("key")&&t._k(o.keyCode,"delete",[8,46],o.key,["Backspace","Delete","Del"])?null:t.handleDelete.apply(null,arguments)}}})],2),n("div",{staticClass:"suffix-area"},[t.hasValue?n("span",{staticClass:"clear-icon",on:{mousedown:function(o){o.preventDefault()},click:function(o){return o.stopPropagation(),t.clearAll.apply(null,arguments)}}},[t._v("ⓧ")]):t._e(),t.loading&&!t.isFetchingMore?n("div",{staticClass:"loading-spinner"}):!t.loading&&t.showSearchIcon?n("button",{staticClass:"search-btn",on:{click:function(o){return o.stopPropagation(),t.handleSearch.apply(null,arguments)}}},[n("span",{staticClass:"search-icon"},[n("img",{attrs:{src:t.SearchIcon,alt:"search"}})])]):t._e()])]),n("div",{directives:[{name:"show",rawName:"v-show",value:t.isDropdownVisible&&(t.searchResults.length>0||t.loading||t.query||t.searchHistory.length>0),expression:`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("vue"),x=require("@jctrans-materials/shared"),O=require("jctrans-ui");y.util.warn;function Xt(e){const t=y.ref([]),n="_search_history_cache",o=typeof window<"u"&&typeof localStorage<"u",s=y.computed(()=>(e.value||"")+n),i=y.computed(()=>!!e.value&&e.value!==""),r=l=>{if(!l||!o)return;const u=t.value.filter(f=>f.id&&f.id!==l.id||f.display!==l.display);u.unshift(l);const c=u.slice(0,4);if(i.value){t.value=c;try{localStorage.setItem(s.value,JSON.stringify(c))}catch(f){console.warn("LocalStorage save failed:",f)}}},a=()=>{t.value=[],o&&localStorage.removeItem(s.value)};return y.onMounted(()=>{if(o&&i.value){const l=localStorage.getItem(s.value);if(l)try{t.value=JSON.parse(l)}catch{t.value=[]}}}),{searchHistory:t,saveToHistory:r,clearHistory:a,HasHistory:i}}async function Zt(e,t=["Continent","Country","City","Seaport","Airport"],n={}){return x.locationSearchV2.searchByName({keyword:e,displayInfo:t,...n})}const gt=(e,t)=>x.locationSearchV2.searchByIdWithType(e,t);function te(e,t){const n=y.ref([]),o=y.ref(!1),s=y.ref(!1),i=y.ref(1),r=y.ref(0),a=y.ref(10),l=y.computed(()=>r.value===0?!1:n.value.length>=r.value),u=y.computed(()=>{const p=[...t.value];return p.includes("Country")&&!p.includes("Region")&&p.push("Region"),p}),c=p=>!p||!Array.isArray(p)?[]:p.filter(d=>u.value.includes(d.type));return{searchResults:n,loading:o,isFetchingMore:s,isFinished:l,currentPage:i,total:r,fetchData:async(p=1,d=!1)=>{if(!e.value.trim()&&!d){n.value=[],r.value=0;return}if(!(d&&(s.value||l.value))&&!(!d&&o.value)){d?s.value=!0:(o.value=!0,i.value=1);try{const m=await Zt(e.value,t.value,{current:p,size:a.value}),h=m.records||[],v=c(h);d?n.value=[...n.value,...v]:n.value=v,r.value=m.total||0,i.value=p}catch(m){console.error("Failed to fetch search results:",m)}finally{o.value=!1,s.value=!1}}},filterByTypes:c}}const X=Math.min,k=Math.max,lt=Math.round,at=Math.floor,P=e=>({x:e,y:e}),ee={left:"right",right:"left",bottom:"top",top:"bottom"},ne={start:"end",end:"start"};function Et(e,t,n){return k(e,X(t,n))}function nt(e,t){return typeof e=="function"?e(t):e}function G(e){return e.split("-")[0]}function ot(e){return e.split("-")[1]}function Pt(e){return e==="x"?"y":"x"}function Vt(e){return e==="y"?"height":"width"}const oe=new Set(["top","bottom"]);function J(e){return oe.has(G(e))?"y":"x"}function Qt(e){return Pt(J(e))}function se(e,t,n){n===void 0&&(n=!1);const o=ot(e),s=Qt(e),i=Vt(s);let r=s==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(r=ct(r)),[r,ct(r)]}function ie(e){const t=ct(e);return[vt(e),t,vt(t)]}function vt(e){return e.replace(/start|end/g,t=>ne[t])}const _t=["left","right"],kt=["right","left"],re=["top","bottom"],ae=["bottom","top"];function le(e,t,n){switch(e){case"top":case"bottom":return n?t?kt:_t:t?_t:kt;case"left":case"right":return t?re:ae;default:return[]}}function ce(e,t,n,o){const s=ot(e);let i=le(G(e),n==="start",o);return s&&(i=i.map(r=>r+"-"+s),t&&(i=i.concat(i.map(vt)))),i}function ct(e){return e.replace(/left|right|bottom|top/g,t=>ee[t])}function ue(e){return{top:0,right:0,bottom:0,left:0,...e}}function fe(e){return typeof e!="number"?ue(e):{top:e,right:e,bottom:e,left:e}}function ut(e){const{x:t,y:n,width:o,height:s}=e;return{width:o,height:s,top:n,left:t,right:t+o,bottom:n+s,x:t,y:n}}function Tt(e,t,n){let{reference:o,floating:s}=e;const i=J(t),r=Qt(t),a=Vt(r),l=G(t),u=i==="y",c=o.x+o.width/2-s.width/2,f=o.y+o.height/2-s.height/2,p=o[a]/2-s[a]/2;let d;switch(l){case"top":d={x:c,y:o.y-s.height};break;case"bottom":d={x:c,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:f};break;case"left":d={x:o.x-s.width,y:f};break;default:d={x:o.x,y:o.y}}switch(ot(t)){case"start":d[r]-=p*(n&&u?-1:1);break;case"end":d[r]+=p*(n&&u?-1:1);break}return d}const de=async(e,t,n)=>{const{placement:o="bottom",strategy:s="absolute",middleware:i=[],platform:r}=n,a=i.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let u=await r.getElementRects({reference:e,floating:t,strategy:s}),{x:c,y:f}=Tt(u,o,l),p=o,d={},m=0;for(let h=0;h<a.length;h++){const{name:v,fn:g}=a[h],{x:w,y:b,data:S,reset:C}=await g({x:c,y:f,initialPlacement:o,placement:p,strategy:s,middlewareData:d,rects:u,platform:r,elements:{reference:e,floating:t}});c=w??c,f=b??f,d={...d,[v]:{...d[v],...S}},C&&m<=50&&(m++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(u=C.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:s}):C.rects),{x:c,y:f}=Tt(u,p,l)),h=-1)}return{x:c,y:f,placement:p,strategy:s,middlewareData:d}};async function wt(e,t){var n;t===void 0&&(t={});const{x:o,y:s,platform:i,rects:r,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:p=!1,padding:d=0}=nt(t,e),m=fe(d),v=a[p?f==="floating"?"reference":"floating":f],g=ut(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),w=f==="floating"?{x:o,y:s,width:r.floating.width,height:r.floating.height}:r.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},C=ut(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:b,strategy:l}):w);return{top:(g.top-C.top+m.top)/S.y,bottom:(C.bottom-g.bottom+m.bottom)/S.y,left:(g.left-C.left+m.left)/S.x,right:(C.right-g.right+m.right)/S.x}}const pe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:s,middlewareData:i,rects:r,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...v}=nt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const g=G(s),w=J(a),b=G(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),C=p||(b||!h?[ct(a)]:ie(a)),N=m!=="none";!p&&N&&C.push(...ce(a,h,m,S));const _=[a,...C],U=await wt(t,v),H=[];let I=((o=i.flip)==null?void 0:o.overflows)||[];if(c&&H.push(U[g]),f){const q=se(s,r,S);H.push(U[q[0]],U[q[1]])}if(I=[...I,{placement:s,overflows:H}],!H.every(q=>q<=0)){var j,Y;const q=(((j=i.flip)==null?void 0:j.index)||0)+1,A=_[q];if(A&&(!(f==="alignment"?w!==J(A):!1)||I.every(R=>J(R.placement)===w?R.overflows[0]>0:!0)))return{data:{index:q,overflows:I},reset:{placement:A}};let L=(Y=I.filter(D=>D.overflows[0]<=0).sort((D,R)=>D.overflows[1]-R.overflows[1])[0])==null?void 0:Y.placement;if(!L)switch(d){case"bestFit":{var W;const D=(W=I.filter(R=>{if(N){const E=J(R.placement);return E===w||E==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(E=>E>0).reduce((E,F)=>E+F,0)]).sort((R,E)=>R[1]-E[1])[0])==null?void 0:W[0];D&&(L=D);break}case"initialPlacement":L=a;break}if(s!==L)return{reset:{placement:L}}}return{}}}},me=new Set(["left","top"]);async function he(e,t){const{placement:n,platform:o,elements:s}=e,i=await(o.isRTL==null?void 0:o.isRTL(s.floating)),r=G(n),a=ot(n),l=J(n)==="y",u=me.has(r)?-1:1,c=i&&l?-1:1,f=nt(t,e);let{mainAxis:p,crossAxis:d,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof m=="number"&&(d=a==="end"?m*-1:m),l?{x:d*c,y:p*u}:{x:p*u,y:d*c}}const ge=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:s,y:i,placement:r,middlewareData:a}=t,l=await he(t,e);return r===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:r}}}}},ye=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:s}=t,{mainAxis:i=!0,crossAxis:r=!1,limiter:a={fn:v=>{let{x:g,y:w}=v;return{x:g,y:w}}},...l}=nt(e,t),u={x:n,y:o},c=await wt(t,l),f=J(G(s)),p=Pt(f);let d=u[p],m=u[f];if(i){const v=p==="y"?"top":"left",g=p==="y"?"bottom":"right",w=d+c[v],b=d-c[g];d=Et(w,d,b)}if(r){const v=f==="y"?"top":"left",g=f==="y"?"bottom":"right",w=m+c[v],b=m-c[g];m=Et(w,m,b)}const h=a.fn({...t,[p]:d,[f]:m});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[p]:i,[f]:r}}}}}},ve=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:s,rects:i,platform:r,elements:a}=t,{apply:l=()=>{},...u}=nt(e,t),c=await wt(t,u),f=G(s),p=ot(s),d=J(s)==="y",{width:m,height:h}=i.floating;let v,g;f==="top"||f==="bottom"?(v=f,g=p===(await(r.isRTL==null?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(g=f,v=p==="end"?"top":"bottom");const w=h-c.top-c.bottom,b=m-c.left-c.right,S=X(h-c[v],w),C=X(m-c[g],b),N=!t.middlewareData.shift;let _=S,U=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(U=b),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(_=w),N&&!p){const I=k(c.left,0),j=k(c.right,0),Y=k(c.top,0),W=k(c.bottom,0);d?U=m-2*(I!==0||j!==0?I+j:k(c.left,c.right)):_=h-2*(Y!==0||W!==0?Y+W:k(c.top,c.bottom))}await l({...t,availableWidth:U,availableHeight:_});const H=await r.getDimensions(a.floating);return m!==H.width||h!==H.height?{reset:{rects:!0}}:{}}}};function ft(){return typeof window<"u"}function tt(e){return Ut(e)?(e.nodeName||"").toLowerCase():"#document"}function T(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Q(e){var t;return(t=(Ut(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ut(e){return ft()?e instanceof Node||e instanceof T(e).Node:!1}function M(e){return ft()?e instanceof Element||e instanceof T(e).Element:!1}function V(e){return ft()?e instanceof HTMLElement||e instanceof T(e).HTMLElement:!1}function It(e){return!ft()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof T(e).ShadowRoot}const Ae=new Set(["inline","contents"]);function st(e){const{overflow:t,overflowX:n,overflowY:o,display:s}=B(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!Ae.has(s)}const we=new Set(["table","td","th"]);function be(e){return we.has(tt(e))}const Ce=[":popover-open",":modal"];function dt(e){return Ce.some(t=>{try{return e.matches(t)}catch{return!1}})}const xe=["transform","translate","scale","rotate","perspective"],Se=["transform","translate","scale","rotate","perspective","filter"],De=["paint","layout","strict","content"];function bt(e){const t=Ct(),n=M(e)?B(e):e;return xe.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Se.some(o=>(n.willChange||"").includes(o))||De.some(o=>(n.contain||"").includes(o))}function Re(e){let t=K(e);for(;V(t)&&!Z(t);){if(bt(t))return t;if(dt(t))return null;t=K(t)}return null}function Ct(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Oe=new Set(["html","body","#document"]);function Z(e){return Oe.has(tt(e))}function B(e){return T(e).getComputedStyle(e)}function pt(e){return M(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function K(e){if(tt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||It(e)&&e.host||Q(e);return It(t)?t.host:t}function Ht(e){const t=K(e);return Z(t)?e.ownerDocument?e.ownerDocument.body:e.body:V(t)&&st(t)?t:Ht(t)}function et(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Ht(e),i=s===((o=e.ownerDocument)==null?void 0:o.body),r=T(s);if(i){const a=At(r);return t.concat(r,r.visualViewport||[],st(s)?s:[],a&&n?et(a):[])}return t.concat(s,et(s,[],n))}function At(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qt(e){const t=B(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const s=V(e),i=s?e.offsetWidth:n,r=s?e.offsetHeight:o,a=lt(n)!==i||lt(o)!==r;return a&&(n=i,o=r),{width:n,height:o,$:a}}function xt(e){return M(e)?e:e.contextElement}function z(e){const t=xt(e);if(!V(t))return P(1);const n=t.getBoundingClientRect(),{width:o,height:s,$:i}=qt(t);let r=(i?lt(n.width):n.width)/o,a=(i?lt(n.height):n.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const Ee=P(0);function Jt(e){const t=T(e);return!Ct()||!t.visualViewport?Ee:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _e(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==T(e)?!1:t}function $(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=xt(e);let r=P(1);t&&(o?M(o)&&(r=z(o)):r=z(e));const a=_e(i,n,o)?Jt(i):P(0);let l=(s.left+a.x)/r.x,u=(s.top+a.y)/r.y,c=s.width/r.x,f=s.height/r.y;if(i){const p=T(i),d=o&&M(o)?T(o):o;let m=p,h=At(m);for(;h&&o&&d!==m;){const v=z(h),g=h.getBoundingClientRect(),w=B(h),b=g.left+(h.clientLeft+parseFloat(w.paddingLeft))*v.x,S=g.top+(h.clientTop+parseFloat(w.paddingTop))*v.y;l*=v.x,u*=v.y,c*=v.x,f*=v.y,l+=b,u+=S,m=T(h),h=At(m)}}return ut({width:c,height:f,x:l,y:u})}function mt(e,t){const n=pt(e).scrollLeft;return t?t.left+n:$(Q(e)).left+n}function Wt(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-mt(e,n),s=n.top+t.scrollTop;return{x:o,y:s}}function ke(e){let{elements:t,rect:n,offsetParent:o,strategy:s}=e;const i=s==="fixed",r=Q(o),a=t?dt(t.floating):!1;if(o===r||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=P(1);const c=P(0),f=V(o);if((f||!f&&!i)&&((tt(o)!=="body"||st(r))&&(l=pt(o)),V(o))){const d=$(o);u=z(o),c.x=d.x+o.clientLeft,c.y=d.y+o.clientTop}const p=r&&!f&&!i?Wt(r,l):P(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+p.x,y:n.y*u.y-l.scrollTop*u.y+c.y+p.y}}function Te(e){return Array.from(e.getClientRects())}function Ie(e){const t=Q(e),n=pt(e),o=e.ownerDocument.body,s=k(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=k(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+mt(e);const a=-n.scrollTop;return B(o).direction==="rtl"&&(r+=k(t.clientWidth,o.clientWidth)-s),{width:s,height:i,x:r,y:a}}const Lt=25;function Le(e,t){const n=T(e),o=Q(e),s=n.visualViewport;let i=o.clientWidth,r=o.clientHeight,a=0,l=0;if(s){i=s.width,r=s.height;const c=Ct();(!c||c&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}const u=mt(o);if(u<=0){const c=o.ownerDocument,f=c.body,p=getComputedStyle(f),d=c.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(o.clientWidth-f.clientWidth-d);m<=Lt&&(i-=m)}else u<=Lt&&(i+=u);return{width:i,height:r,x:a,y:l}}const Fe=new Set(["absolute","fixed"]);function Me(e,t){const n=$(e,!0,t==="fixed"),o=n.top+e.clientTop,s=n.left+e.clientLeft,i=V(e)?z(e):P(1),r=e.clientWidth*i.x,a=e.clientHeight*i.y,l=s*i.x,u=o*i.y;return{width:r,height:a,x:l,y:u}}function Ft(e,t,n){let o;if(t==="viewport")o=Le(e,n);else if(t==="document")o=Ie(Q(e));else if(M(t))o=Me(t,n);else{const s=Jt(e);o={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return ut(o)}function Gt(e,t){const n=K(e);return n===t||!M(n)||Z(n)?!1:B(n).position==="fixed"||Gt(n,t)}function Be(e,t){const n=t.get(e);if(n)return n;let o=et(e,[],!1).filter(a=>M(a)&&tt(a)!=="body"),s=null;const i=B(e).position==="fixed";let r=i?K(e):e;for(;M(r)&&!Z(r);){const a=B(r),l=bt(r);!l&&a.position==="fixed"&&(s=null),(i?!l&&!s:!l&&a.position==="static"&&!!s&&Fe.has(s.position)||st(r)&&!l&&Gt(e,r))?o=o.filter(c=>c!==r):s=a,r=K(r)}return t.set(e,o),o}function Ne(e){let{element:t,boundary:n,rootBoundary:o,strategy:s}=e;const r=[...n==="clippingAncestors"?dt(t)?[]:Be(t,this._c):[].concat(n),o],a=r[0],l=r.reduce((u,c)=>{const f=Ft(t,c,s);return u.top=k(f.top,u.top),u.right=X(f.right,u.right),u.bottom=X(f.bottom,u.bottom),u.left=k(f.left,u.left),u},Ft(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Pe(e){const{width:t,height:n}=qt(e);return{width:t,height:n}}function Ve(e,t,n){const o=V(t),s=Q(t),i=n==="fixed",r=$(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=P(0);function u(){l.x=mt(s)}if(o||!o&&!i)if((tt(t)!=="body"||st(s))&&(a=pt(t)),o){const d=$(t,!0,i,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else s&&u();i&&!o&&s&&u();const c=s&&!o&&!i?Wt(s,a):P(0),f=r.left+a.scrollLeft-l.x-c.x,p=r.top+a.scrollTop-l.y-c.y;return{x:f,y:p,width:r.width,height:r.height}}function yt(e){return B(e).position==="static"}function Mt(e,t){if(!V(e)||B(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Q(e)===n&&(n=n.ownerDocument.body),n}function Kt(e,t){const n=T(e);if(dt(e))return n;if(!V(e)){let s=K(e);for(;s&&!Z(s);){if(M(s)&&!yt(s))return s;s=K(s)}return n}let o=Mt(e,t);for(;o&&be(o)&&yt(o);)o=Mt(o,t);return o&&Z(o)&&yt(o)&&!bt(o)?n:o||Re(e)||n}const Qe=async function(e){const t=this.getOffsetParent||Kt,n=this.getDimensions,o=await n(e.floating);return{reference:Ve(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ue(e){return B(e).direction==="rtl"}const He={convertOffsetParentRelativeRectToViewportRelativeRect:ke,getDocumentElement:Q,getClippingRect:Ne,getOffsetParent:Kt,getElementRects:Qe,getClientRects:Te,getDimensions:Pe,getScale:z,isElement:M,isRTL:Ue};function jt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qe(e,t){let n=null,o;const s=Q(e);function i(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function r(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const u=e.getBoundingClientRect(),{left:c,top:f,width:p,height:d}=u;if(a||t(),!p||!d)return;const m=at(f),h=at(s.clientWidth-(c+p)),v=at(s.clientHeight-(f+d)),g=at(c),b={rootMargin:-m+"px "+-h+"px "+-v+"px "+-g+"px",threshold:k(0,X(1,l))||1};let S=!0;function C(N){const _=N[0].intersectionRatio;if(_!==l){if(!S)return r();_?r(!1,_):o=setTimeout(()=>{r(!1,1e-7)},1e3)}_===1&&!jt(u,e.getBoundingClientRect())&&r(),S=!1}try{n=new IntersectionObserver(C,{...b,root:s.ownerDocument})}catch{n=new IntersectionObserver(C,b)}n.observe(e)}return r(!0),i}function Je(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=xt(e),c=s||i?[...u?et(u):[],...et(t)]:[];c.forEach(g=>{s&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const f=u&&a?qe(u,n):null;let p=-1,d=null;r&&(d=new ResizeObserver(g=>{let[w]=g;w&&w.target===u&&d&&(d.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=d)==null||b.observe(t)})),n()}),u&&!l&&d.observe(u),d.observe(t));let m,h=l?$(e):null;l&&v();function v(){const g=$(e);h&&!jt(h,g)&&n(),h=g,m=requestAnimationFrame(v)}return n(),()=>{var g;c.forEach(w=>{s&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),f?.(),(g=d)==null||g.disconnect(),d=null,l&&cancelAnimationFrame(m)}}const We=ge,Ge=ye,Ke=pe,je=ve,Ye=(e,t,n)=>{const o=new Map,s={platform:He,...n},i={...s.platform,_c:o};return de(e,t,{...s,platform:i})};function $e(e,t){const n=y.ref({position:"fixed",left:"0",top:"0",zIndex:3e3});let o=null;const s=()=>{!e.value||!t.value||Ye(e.value,t.value,{placement:"bottom-start",strategy:"fixed",middleware:[We(6),Ke(),Ge({padding:10}),je({apply({rects:a,elements:l}){const u=`${a.reference.width}px`;Object.assign(l.floating.style,{width:u,minWidth:u,maxWidth:u})}})]}).then(({x:a,y:l})=>{Object.assign(n.value,{left:`${a}px`,top:`${l}px`})})},i=()=>{e.value&&t.value&&(o=Je(e.value,t.value,s))},r=()=>{o&&(o(),o=null)};return y.onBeforeUnmount(r),{floatingStyles:n,startTrack:i,stopTrack:r}}const ze="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",Xe="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",Ze="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABFUlEQVR4AaRQO07DQBCdWe8B4B5IFFyAK9ARkIVNhIQEEiVtJLgABRVRvIBCJBquwBVyDgoaSnuHeZY3MlYcNsnIb8fze6M3hra0XoKJm95N3Nv3EnyhFvb2EgjRJbOMKqmO2tDcvQ5fK+qvl4CJbOn9/CJPP9tArp5sHtP4lc652VXxPL1Z1hRFIOytF1NuTJCfnT4Ms8HjSgJctn1xIt6hxqIkdK+u8U8zT1ESmP5enUkWmqMkhG2FmxXOvR+EGD5KAhoDqsQvtiMXJQGNQJ4N8mF6PMd/wL8SxuOXPSG21pj9p+L1EOjGyAHoQQ0zWGDqx9pbPWIpwqOEkw+gGyMHoAc1ozOkVhOcZyepYndNpDpPvwAAAP//BVQJHAAAAAZJREFUAwDZWL4hub5xHQAAAABJRU5ErkJggg==",tn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACC0lEQVR4AXxRv2tTURT+zk1iIjgoOMShkIJVNwf/gQYULOjQwaGvGl8TBMEMDg4ODgF17likvL4HIYm4OLg61K2CooWKDoKCDoJDHASb9N17POf5Enwk6eN+9/z+3nfvNZjxbYS9ymbYXlQ8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FxfbbVUVGG5v4i2p8LD8x9ax65C66KTfKGCSDc97fv6DJzuf9QtDtm+iqsM1ot70w9O+YDbmSQ6bkkyCJitnAUcnryqmuExgSsZYKypvgFvS+5xVsJk0MGlps97mFCVXpnNZqoBcbo2QyJz7dCLj6JTj6tRxVyf3izZUtNndwM73SU55JzaO4Q8AAAD//54At5MAAAAGSURBVAMAh2IbMAJQAZQAAAAASUVORK5CYII=",sn=y.defineComponent({name:"GlobalSearch",model:{prop:"value",event:"input"},props:{value:{type:[Object,Array],default:null},multiple:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},searchTypeList:{type:Array,default:()=>["City","Seaport","Airport","Country"]},historyKey:{type:String,default:""},lang:{type:String,default:""},placeholder:{type:String,default:""},showSearchIcon:{type:Boolean,default:!0},showItemTag:{type:Boolean,default:!0},showApplyData:{type:Boolean,default:!0}},setup(e,{emit:t}){const n=y.ref(""),o=y.ref(!1),s=y.ref(!1),i=y.ref(""),r=y.ref(null),a=y.ref(null),l=y.ref(null),u=y.ref(null),c=y.ref(!1),{searchHistory:f,saveToHistory:p,clearHistory:d}=Xt(y.toRef(e,"historyKey")),{searchResults:m,loading:h,isFetchingMore:v,isFinished:g,currentPage:w,fetchData:b,filterByTypes:S}=te(n,y.toRef(e,"searchTypeList")),{floatingStyles:C,startTrack:N,stopTrack:_}=$e(l,u),U=async()=>{if(s.value=!0,!e.multiple&&o.value&&m.value.length===0){const A=e.value;if(A?.id){h.value=!0;try{const L=await gt(A.id,A.type);m.value=S(L.records)}finally{h.value=!1}}}},H=()=>{setTimeout(()=>{s.value=!1},200)},I=A=>{A.target.value===""&&!e.multiple&&(o.value=!1,t("input",null),t("update:value",null))},j=()=>{if(e.multiple&&!n.value&&e.value?.length>0){const A=[...e.value],L=A.pop();t("input",A),t("update:value",A),t("remove",L)}};y.watch(s,A=>A?N():_()),y.watch(n,A=>{if(!A.trim()){m.value=[];return}r.value&&clearTimeout(r.value),r.value=setTimeout(()=>b(1,!1),300)});const Y=y.computed(()=>e.lang?e.lang==="en"||e.lang==="en-US":typeof document<"u"?/(^|;\s*)jc-language=en(-US)?(;|$)/.test(document.cookie||""):!1),W=A=>Y.value?A.displayEn||A.display||A.nameEn||"":A.displayCn||A.display||A.nameCn||A.name||"",q=A=>{console.log("🍉 ~ index.vue:428 ~ handleConfirmApplyData ~ e:",A),t("apply-data",A)};return y.watch(()=>e.value,async(A,L)=>{if(console.log("🍉 ~ index.vue:304 ~ newVal:",A),JSON.stringify(A)===JSON.stringify(L))return;if(e.multiple&&Array.isArray(A)){const R=[...A],E=R.filter(F=>F&&F.id&&F.type);if(E.length>0)try{const F=E.map(it=>it.id),ht=await gt(F,E[0].type);if(ht&&ht.records){let it=!1;const Rt=R.map(rt=>{const Ot=ht.records.find(zt=>zt.id===rt.id);return Ot&&!rt.display?(it=!0,{...rt,...Ot}):rt});it&&(t("input",Rt),t("update:value",Rt))}}catch(F){console.error("Batch fetch detail failed:",F)}return}const D=A;if(!D){o.value=!1,i.value="";return}if(typeof D=="object")if(D.id&&D.type&&!D.display)try{const E=(await gt(D.id,D.type)).records.find(F=>F.id===D.id);E&&(i.value=W(E),o.value=!0)}catch(R){console.error("Single fetch detail failed:",R)}else i.value=W(D),o.value=!!i.value;else i.value=String(D),o.value=!!D},{immediate:!0,deep:!0}),y.onBeforeUnmount(_),{query:n,isSelected:o,isDropdownVisible:s,applyDataVisible:c,selectedLabel:i,inputRef:a,referenceRef:l,floatingRef:u,searchHistory:f,searchResults:m,loading:h,isFetchingMore:v,isFinished:g,currentPage:w,floatingStyles:C,saveToHistory:p,clearHistory:d,fetchData:b,filterByTypes:S,startTrack:N,stopTrack:_,onFocus:U,handleBlur:H,onInput:I,handleDelete:j,handleConfirmApplyData:q,SearchIcon:ze,ICON_MORE:Xe}},computed:{isEn(){if(this.lang&&this.lang!=="")return this.lang==="en"||this.lang==="en-US";try{if(typeof useCookie=="function"){const e=useCookie("jc-language")?.value;if(e)return/^en(-US)?$/.test(e)}}catch{}if(typeof document<"u"){const e=document.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(e)}try{if(typeof useNuxtApp=="function"){const t=useNuxtApp()?.ssrContext?.event?.node?.req?.headers?.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(t)}}catch{}return!1},selectedItems(){return this.value?Array.isArray(this.value)?this.value:[this.value]:[]},displayedTags(){return this.collapseTags?this.selectedItems.slice(0,1):this.selectedItems},hasValue(){return this.query||this.selectedItems.length>0},inputWidth(){return this.multiple?this.query?`${this.query.length*10+20}px`:"10px":"100%"},currentPlaceholder(){return this.multiple&&this.selectedItems.length>0?"":this.isSelected&&!this.multiple?this.selectedLabel:this.placeholder?this.placeholder:this.isEn?"Please enter...":"请输入..."}},methods:{focusInput(){this.$refs.inputRef?.focus()},getItemLabel(e){return this.isEn?e.displayEn||e.display||"":e.displayCn||e.display||""},getItemType(e){const t={City:{en:"City",cn:"城市"},Country:{en:"Country",cn:"国家"},Region:{en:"Region",cn:"区域"},Airport:{en:"Airport",cn:"机场"},Seaport:{en:"Seaport",cn:"港口"}};return this.isEn?t[e].en:t[e].cn},isItemActive(e){return this.selectedItems.some(t=>t.id===e.id)},selectItem(e){this.saveToHistory(e),this.multiple?this.isItemActive(e)||(this.$emit("input",[...this.selectedItems,e]),this.$emit("update:value",[...this.selectedItems,e])):(this.isSelected=!0,this.selectedLabel=this.getItemLabel(e),this.$emit("input",e),this.$emit("update:value",e),this.isDropdownVisible=!1),this.query="",this.$emit("select",e),this.$emit("change",e)},removeItem(e){const t=this.selectedItems.filter(n=>n.id!==e.id);this.$emit("input",t),this.$emit("update:value",t),this.$emit("remove",e)},clearAll(){this.query="",this.isSelected=!1,this.selectedLabel="",this.$emit("input",this.multiple?[]:null),this.$emit("update:value",this.multiple?[]:null)},handleSearch(){const e=this.multiple?this.selectedItems:this.isSelected?this.value:null;this.$emit("submit-search",e),this.isDropdownVisible=!1},getIconUrl(e){return{City:Ze,Seaport:tn,Airport:en,Country:nn}[e]||on},handleScroll(e){const{scrollTop:t,scrollHeight:n,clientHeight:o}=e.target;t+o>=n-20&&!this.loading&&!this.isFetchingMore&&!this.isFinished&&this.query&&this.fetchData(this.currentPage+1,!0)}}});function St(e,t,n,o,s,i,r,a){var l=typeof e=="function"?e.options:e;return t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),i&&(l._scopeId="data-v-"+i),{exports:e,options:l}}var rn=function(){var t=this,n=t._self._c;return t._self._setupProxy,n("div",{staticClass:"search-container"},[n("div",{ref:"referenceRef",staticClass:"search-input-wrapper",class:{"is-multiple":t.multiple},on:{click:t.focusInput}},[n("div",{staticClass:"selection-wrapper"},[t.multiple&&t.selectedItems.length>0?[t._l(t.displayedTags,function(o,s){return n("div",{key:o.id||s,staticClass:"search-tag"},[n("span",{staticClass:"tag-text"},[t._v(t._s(t.getItemLabel(o)))]),n("span",{staticClass:"tag-close",on:{click:function(i){return i.stopPropagation(),t.removeItem(o)}}},[t._v("×")])])}),t.collapseTags&&t.selectedItems.length>1?n("div",{staticClass:"search-tag collapse"},[t._v(" + "+t._s(t.selectedItems.length-1)+" ")]):t._e()]:t._e(),n("input",{directives:[{name:"model",rawName:"v-model",value:t.query,expression:"query"}],ref:"inputRef",class:{"is-selected-state":t.isSelected&&!t.multiple},style:{width:t.inputWidth},attrs:{type:"text",placeholder:t.currentPlaceholder},domProps:{value:t.query},on:{focus:t.onFocus,blur:t.handleBlur,input:[function(o){o.target.composing||(t.query=o.target.value)},t.onInput],keydown:function(o){return!o.type.indexOf("key")&&t._k(o.keyCode,"delete",[8,46],o.key,["Backspace","Delete","Del"])?null:t.handleDelete.apply(null,arguments)}}})],2),n("div",{staticClass:"suffix-area"},[t.hasValue?n("span",{staticClass:"clear-icon",on:{mousedown:function(o){o.preventDefault()},click:function(o){return o.stopPropagation(),t.clearAll.apply(null,arguments)}}},[t._v("ⓧ")]):t._e(),t.loading&&!t.isFetchingMore?n("div",{staticClass:"loading-spinner"}):!t.loading&&t.showSearchIcon?n("button",{staticClass:"search-btn",on:{click:function(o){return o.stopPropagation(),t.handleSearch.apply(null,arguments)}}},[n("span",{staticClass:"search-icon"},[n("img",{attrs:{src:t.SearchIcon,alt:"search"}})])]):t._e()])]),n("div",{directives:[{name:"show",rawName:"v-show",value:t.isDropdownVisible&&(t.searchResults.length>0||t.loading||t.query||t.searchHistory.length>0),expression:`
2
2
  isDropdownVisible &&
3
3
  (searchResults.length > 0 ||
4
4
  loading ||
5
5
  query ||
6
6
  searchHistory.length > 0)
7
- `}],ref:"floatingRef",staticClass:"dropdown-list",style:t.floatingStyles,on:{scroll:t.handleScroll}},[t._t("history",function(){return[t.searchHistory.length>0&&!t.query?n("div",{staticClass:"history-section"},[n("div",{staticClass:"history-header"},[n("span",[t._v(t._s(t.isEn?"Recent search":"最近搜索"))]),n("span",{staticClass:"clear-btn",on:{mousedown:function(o){o.preventDefault()},click:function(o){return o.stopPropagation(),t.clearHistory.apply(null,arguments)}}},[t._v(" "+t._s(t.isEn?"Clear":"清空")+" ")])]),t._l(t.searchHistory,function(o,s){return n("div",{key:"hist-"+s,staticClass:"dropdown-item",on:{mousedown:function(i){return t.selectItem(o)}}},[n("div",{staticClass:"category-tag",style:t.showItemTag?{}:{display:"none"}},[n("img",{staticClass:"type-icon",attrs:{src:t.getIconUrl(o.type),alt:""}}),n("span",{staticClass:"type-text"},[t._v(t._s(t.getItemType(o.type)))])]),n("div",{staticClass:"result-text"},[t._v(t._s(t.getItemLabel(o)))])])}),n("hr",{staticClass:"divider"})],2):t._e()]},{searchHistory:t.searchHistory}),t.loading&&!t.isFetchingMore?n("div",{staticClass:"status-msg"},[t._v(" "+t._s(t.isEn?"Searching...":"正在搜索中...")+" ")]):t.searchResults.length>0?[t._t("results",function(){return t._l(t.searchResults,function(o,s){return n("div",{key:s,staticClass:"dropdown-item",class:{"is-active":t.isItemActive(o)},on:{mousedown:function(i){return t.selectItem(o)}}},[n("div",{staticClass:"category-tag",style:t.showItemTag?{}:{display:"none"}},[n("img",{staticClass:"type-icon",attrs:{src:t.getIconUrl(o.type),alt:""}}),n("span",{staticClass:"type-text"},[t._v(t._s(t.getItemType(o.type)))])]),n("div",{staticClass:"result-text"},[t._v(t._s(t.getItemLabel(o)))])])})},{searchResults:t.searchResults}),t.isFetchingMore?n("div",{staticClass:"load-more-msg"},[t._v(" "+t._s(t.isEn?"Loading more...":"正在加载更多...")+" ")]):t.isFinished&&t.query?n("div",{staticClass:"load-more-msg no-more"},[t._v(" "+t._s(t.isEn?"All results have been loaded":"已加载全部结果")+" ")]):t._e()]:t.query&&!t.loading?n("div",{staticClass:"status-msg"},[t._t("noData",function(){return[t._v(" "+t._s(t.isEn?`No results found related to "${t.query}".`:`未找到与 "${t.query}" 相关的结果`)+" ")]})],2):t._e()],2)])},on=[],sn=xt(en,nn,on,!1,null,"4a9cd69d");const Ct=sn.exports,rn={__name:"ApplyDataDialog",props:{value:{type:Boolean,default:!1},lang:{type:String,default:"en",validator:e=>["en","en-US","zh-CN","cn"].includes(e)},placeholder:{type:String,default:""}},emits:["update:value","confirm"],setup(e,{emit:t}){const n=e,o=[{typeCn:"城市",typeEn:"City",type:"City"},{typeCn:"海运港口",typeEn:"Port",type:"Seaport"},{typeCn:"机场",typeEn:"Airport",type:"Airport"}],s=v.ref(null),i=v.reactive({name:"",country:""}),r=v.reactive({name:"",type:"City"}),a=v.computed(()=>{if(n.lang&&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 f=useNuxtApp()?.ssrContext?.event?.node?.req?.headers?.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(f)}}catch{}return!1});return{__sfc:!0,props:n,emit:t,typeOptions:o,displayQuery:s,errors:i,formData:r,isEn:a,handleClose:()=>{i.name="",i.country="",t("update:value",!1)},handleConfirm:()=>{i.name="",i.country="";let c=!0;r.name.trim()||(i.name="Data name is required",c=!1),s.value||(i.country="Please select a country",c=!1),c&&(console.log("🍉 ~ ApplyDataDialog.vue:115 ~ handleConfirm ~ data:",{...r,country:s.value}),t("confirm",{...r,country:s.value}))},Search:Ct}}};var an=function(){var t=this,n=t._self._c,o=t._self._setupProxy;return t.value?n("div",{staticClass:"modal-mask",on:{click:function(s){return s.target!==s.currentTarget?null:o.handleClose.apply(null,arguments)}}},[n("div",{staticClass:"modal-container"},[n("div",{staticClass:"modal-header"},[n("span",{staticClass:"header-title"},[t._v(t._s(o.isEn?"Apply for data addition":"申请补充数据"))]),n("div",{staticClass:"close-btn",on:{click:o.handleClose}},[t._v("×")])]),n("div",{staticClass:"modal-body"},[n("div",{staticClass:"form-item"},[n("label",{staticClass:"required"},[t._v(t._s(o.isEn?"Data To Add":"需补充的数据"))]),n("div",{staticClass:"input-box"},[n("input",{directives:[{name:"model",rawName:"v-model",value:o.formData.name,expression:"formData.name"}],class:["custom-input",{"input-error":o.errors.name}],attrs:{type:"text",placeholder:t.placeholder??(o.isEn?" Please enter":"请输入")},domProps:{value:o.formData.name},on:{input:[function(s){s.target.composing||t.$set(o.formData,"name",s.target.value)},function(s){o.errors.name=""}]}})]),o.errors.name?n("div",{staticClass:"error-message"},[t._v(t._s(o.errors.name))]):t._e()]),n("div",{staticClass:"form-item"},[n("label",{staticClass:"required"},[t._v(t._s(o.isEn?"Type":"所属类别"))]),n("div",{staticClass:"type-group"},t._l(o.typeOptions,function(s){return n("div",{key:s.type,class:["type-btn",{active:o.formData.type===s.type}],on:{click:function(i){o.formData.type=s.type}}},[t._v(" "+t._s(o.isEn?s.typeEn:s.typeCn)+" "),o.formData.type===s.type?n("div",{staticClass:"check-mark"}):t._e()])}),0)]),n("div",{staticClass:"form-item"},[n("label",{staticClass:"required"},[t._v(t._s(o.isEn?"Country":"国家"))]),n("div",{class:{"search-error-wrap":o.errors.country}},[n(o.Search,{style:{margin:"0 auto"},attrs:{"search-type-list":["Country"],lang:t.lang,placeholder:t.placeholder??(o.isEn?" Please enter":"请输入")},on:{"update:model-value":function(s){o.errors.country=""}},model:{value:o.displayQuery,callback:function(s){o.displayQuery=s},expression:"displayQuery"}})],1),o.errors.country?n("div",{staticClass:"error-message"},[t._v(" "+t._s(o.errors.country)+" ")]):t._e()])]),n("div",{staticClass:"modal-footer"},[n("button",{staticClass:"confirm-btn",on:{click:o.handleConfirm}},[t._v(" "+t._s(o.isEn?"Submit":"申请补充")+" ")])])])]):t._e()},ln=[],cn=xt(rn,an,ln,!1,null,"77035ea3");const Kt=cn.exports,un={components:{[R.Dialog.name]:R.Dialog,[R.Form.name]:R.Form,[R.FormItem.name]:R.FormItem,[R.Input.name]:R.Input,[R.Button.name]:R.Button,[R.Checkbox.name]:R.Checkbox,[R.Row.name]:R.Row,[R.Col.name]:R.Col},data(){return{isVisible:!1,formData:{city:"",company:"",email:"",phone:"",name:"",agreement:!1},formRules:{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:(e,t,n)=>{t?n():n(new Error("请同意隐私政策"))},trigger:"change"}]}}},mounted(){S.emitter.on(S.MODAL_ACTION.Open,this.handleOpen)},beforeDestroy(){S.emitter.off(S.MODAL_ACTION.Open,this.handleOpen)},methods:{handleOpen(){console.log("🍉 ~ GlobalModal.vue:150 ~ methods.handleOpen:",this.handleOpen),this.isVisible=!0},closeModal(){this.isVisible=!1,S.emitter.emit(S.MODAL_ACTION.Close),this.$refs.formRef.resetFields()},handleSubmit(){this.$refs.formRef.validate(e=>{e&&(S.emitter.emit(S.MODAL_ACTION.Submit,{...this.formData}),this.closeModal())})}}};var fn=function(){var t=this,n=t._self._c;return n("el-dialog",{attrs:{visible:t.isVisible,"before-close":t.closeModal,"show-close":!1,"close-on-click-modal":!0,width:"500px","custom-class":"global-modal-custom"},on:{"update:visible":function(o){t.isVisible=o}}},[n("div",{staticClass:"global-modal-header-custom",attrs:{slot:"title"},slot:"title"},[n("h2",[t._v("即刻链接全球货代")]),n("el-button",{staticClass:"close-button-custom",attrs:{type:"text"},on:{click:t.closeModal}},[n("span",{staticStyle:{"font-size":"2rem"}},[t._v("×")])])],1),n("div",{staticClass:"global-modal-body-custom"},[n("el-form",{ref:"formRef",attrs:{model:t.formData,rules:t.formRules,"label-position":"top"},nativeOn:{submit:function(o){o.preventDefault()}}},[n("el-row",{attrs:{gutter:20}},[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"所在地(城市)",prop:"city"}},[n("el-input",{attrs:{placeholder:"请输入城市"},model:{value:t.formData.city,callback:function(o){t.$set(t.formData,"city",o)},expression:"formData.city"}})],1)],1),n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"公司名称",prop:"company"}},[n("el-input",{attrs:{placeholder:"请输入公司名称"},model:{value:t.formData.company,callback:function(o){t.$set(t.formData,"company",o)},expression:"formData.company"}})],1)],1)],1),n("el-row",{attrs:{gutter:20}},[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"邮箱",prop:"email"}},[n("el-input",{attrs:{placeholder:"请输入邮箱"},model:{value:t.formData.email,callback:function(o){t.$set(t.formData,"email",o)},expression:"formData.email"}})],1)],1),n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"电话",prop:"phone"}},[n("el-input",{attrs:{placeholder:"请输入电话"},model:{value:t.formData.phone,callback:function(o){t.$set(t.formData,"phone",o)},expression:"formData.phone"}})],1)],1)],1),n("el-row",[n("el-col",{attrs:{span:24}},[n("el-form-item",{attrs:{label:"姓名",prop:"name"}},[n("el-input",{attrs:{placeholder:"请输入您的全名"},model:{value:t.formData.name,callback:function(o){t.$set(t.formData,"name",o)},expression:"formData.name"}})],1)],1)],1),n("el-form-item",{staticClass:"agreement-item",attrs:{prop:"agreement"}},[n("el-checkbox",{model:{value:t.formData.agreement,callback:function(o){t.$set(t.formData,"agreement",o)},expression:"formData.agreement"}},[t._v("我同意")]),n("a",{staticClass:"privacy-link",attrs:{href:"#"}},[t._v("隐私政策")])],1)],1)],1),n("div",{staticClass:"global-modal-footer-custom",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{staticClass:"submit-button-custom",attrs:{type:"primary"},on:{click:t.handleSubmit}},[t._v(" 加入会员 ")])],1)])},dn=[],mn=xt(un,fn,dn,!1,null,null);const Yt=mn.exports;let pn={open(){S.emitter.emit(S.MODAL_ACTION.Open)},close(){S.emitter.emit(S.MODAL_ACTION.Close)},onSubmit(e){S.emitter.on(S.MODAL_ACTION.Submit,e)}};function hn(){let e=!1;return{install(t){if(typeof window<"u"&&!e){const n=document.createElement("div");n.setAttribute("id","global-modal-root"),document.body.appendChild(n);const o=t.extend(Yt);new o().$mount(n),e=!0}t.prototype.$globalModal=pn}}}const Ft={ApplyDataDialog:Kt,JcSearch:Ct};let Bt=!1;const gn={install(e,t){Bt||(Bt=!0,t?.sharedConfig&&S.initSharedConfig(t.sharedConfig),Object.keys(Ft).forEach(n=>{e.component(n,Ft[n])}))}};Object.defineProperty(exports,"MODAL_ACTION",{enumerable:!0,get:()=>S.MODAL_ACTION});Object.defineProperty(exports,"emitter",{enumerable:!0,get:()=>S.emitter});exports.ApplyDataDialog=Kt;exports.GlobalModal=Yt;exports.JcSearch=Ct;exports.createGlobalModalPlugin=hn;exports.default=gn;
7
+ `}],ref:"floatingRef",staticClass:"dropdown-list",style:t.floatingStyles,on:{scroll:t.handleScroll}},[t._t("history",function(){return[t.searchHistory.length>0&&!t.query?n("div",{staticClass:"history-section"},[n("div",{staticClass:"history-header"},[n("span",[t._v(t._s(t.isEn?"Recent search":"最近搜索"))]),n("span",{staticClass:"clear-btn",on:{mousedown:function(o){o.preventDefault()},click:function(o){return o.stopPropagation(),t.clearHistory.apply(null,arguments)}}},[t._v(" "+t._s(t.isEn?"Clear":"清空")+" ")])]),t._l(t.searchHistory,function(o,s){return n("div",{key:"hist-"+s,staticClass:"dropdown-item",on:{mousedown:function(i){return t.selectItem(o)}}},[n("div",{staticClass:"category-tag",style:t.showItemTag?{}:{display:"none"}},[n("img",{staticClass:"type-icon",attrs:{src:t.getIconUrl(o.type),alt:""}}),n("span",{staticClass:"type-text"},[t._v(t._s(t.getItemType(o.type)))])]),n("div",{staticClass:"result-text"},[t._v(t._s(t.getItemLabel(o)))])])}),n("hr",{staticClass:"divider"})],2):t._e()]},{searchHistory:t.searchHistory}),t.loading&&!t.isFetchingMore?n("div",{staticClass:"status-msg"},[t._v(" "+t._s(t.isEn?"Searching...":"正在搜索中...")+" ")]):t.searchResults.length>0?[t._t("results",function(){return t._l(t.searchResults,function(o,s){return n("div",{key:s,staticClass:"dropdown-item",class:{"is-active":t.isItemActive(o)},on:{mousedown:function(i){return t.selectItem(o)}}},[n("div",{staticClass:"category-tag",style:t.showItemTag?{}:{display:"none"}},[n("img",{staticClass:"type-icon",attrs:{src:t.getIconUrl(o.type),alt:""}}),n("span",{staticClass:"type-text"},[t._v(t._s(t.getItemType(o.type)))])]),n("div",{staticClass:"result-text"},[t._v(t._s(t.getItemLabel(o)))])])})},{searchResults:t.searchResults}),t.isFetchingMore?n("div",{staticClass:"load-more-msg"},[t._v(" "+t._s(t.isEn?"Loading more...":"正在加载更多...")+" ")]):t.isFinished&&t.query?n("div",{staticClass:"load-more-msg no-more"},[t._v(" "+t._s(t.isEn?"All results have been loaded":"已加载全部结果")+" ")]):t._e()]:t.query&&!t.loading?n("div",{staticClass:"status-msg"},[t._t("noData",function(){return[t.showApplyData?n("p",{staticClass:"no-result-label"},[t._v(" "+t._s(t.isEn?"No results found .":"暂无结果,")+" "),n("span",{staticClass:"apply-data",on:{click:function(o){return o.stopPropagation(),(()=>t.applyDataVisible=!0).apply(null,arguments)}}},[t._v(" "+t._s(t.isEn?"Apply for data addition":"申请补充数据 "))]),n("img",{staticClass:"apply-data-more-icon",attrs:{src:t.ICON_MORE,alt:""},on:{click:function(o){return o.stopPropagation(),(()=>t.applyDataVisible=!0).apply(null,arguments)}}})]):n("p",{staticClass:"no-result-label"},[t._v(" "+t._s(t.isEn?`No results found related to "${t.query}".`:`未找到与 "${t.query}" 相关的结果`)+" ")])]})],2):t._e()],2),n("ApplyDataDialog",{attrs:{value:t.applyDataVisible},on:{"update:value":function(o){t.applyDataVisible=o},confirm:t.handleConfirmApplyData}})],1)},an=[],ln=St(sn,rn,an,!1,null,"d41f13f3");const Dt=ln.exports,cn={__name:"ApplyDataDialog",props:{value:{type:Boolean,default:!1},lang:{type:String,default:"",validator:e=>["","en","en-US","zh-CN","cn"].includes(e)},placeholder:{type:String,default:""}},emits:["update:value","confirm"],setup(e,{emit:t}){const n=e,o=[{typeCn:"城市",typeEn:"City",type:"City"},{typeCn:"海运港口",typeEn:"Port",type:"Seaport"},{typeCn:"机场",typeEn:"Airport",type:"Airport"}],s=y.ref(null),i=y.reactive({name:"",country:""}),r=y.reactive({name:"",type:"City"}),a=y.computed(()=>{if(n.lang&&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 f=useNuxtApp()?.ssrContext?.event?.node?.req?.headers?.cookie||"";return/(^|;\s*)jc-language=en(-US)?(;|$)/.test(f)}}catch{}return!1}),l=()=>{i.name="",i.country="",t("update:value",!1)};function u(){i.name="",i.country="";let c=!0;r.name.trim()||(i.name=a.value?"Please enter the data":"请输入需要补充的数据",c=!1),s.value||(i.country=a.value?"Please select a country":"请选择国家",c=!1),c&&(console.log("🍉 ~ ApplyDataDialog.vue:115 ~ handleConfirm ~ data:",{...r,country:s.value}),x.reportNewTypeDataApi({reportData:r.name,reportType:r.type.toLocaleLowerCase(),countryId:s.value.id}).then(f=>{console.log("🍉 ~ ApplyDataDialog.vue:185 ~ handleConfirm ~ res:",f)}).catch(f=>{console.log("🍉 ~ ApplyDataDialog.vue:187 ~ handleConfirm ~ err:",f)}),t("confirm",{...r,country:s.value}))}return{__sfc:!0,props:n,emit:t,typeOptions:o,displayQuery:s,errors:i,formData:r,isEn:a,handleClose:l,handleConfirm:u,Search:Dt}}};var un=function(){var t=this,n=t._self._c,o=t._self._setupProxy;return t.value?n("div",{staticClass:"modal-mask",on:{click:function(s){return s.target!==s.currentTarget?null:o.handleClose.apply(null,arguments)}}},[n("div",{staticClass:"modal-container"},[n("div",{staticClass:"modal-header"},[n("span",{staticClass:"header-title"},[t._v(t._s(o.isEn?"Apply for data addition":"申请补充数据"))]),n("div",{staticClass:"close-btn",on:{click:o.handleClose}},[t._v("×")])]),n("div",{staticClass:"modal-body"},[n("div",{staticClass:"form-item"},[n("label",{staticClass:"required"},[t._v(t._s(o.isEn?"Data To Add":"需补充的数据"))]),n("div",{staticClass:"input-box"},[n("input",{directives:[{name:"model",rawName:"v-model",value:o.formData.name,expression:"formData.name"}],class:["custom-input",{"input-error":o.errors.name}],attrs:{type:"text",placeholder:t.placeholder??(o.isEn?" Please enter":"请输入")},domProps:{value:o.formData.name},on:{input:[function(s){s.target.composing||t.$set(o.formData,"name",s.target.value)},function(s){o.errors.name=""}]}})]),o.errors.name?n("div",{staticClass:"error-message"},[t._v(t._s(o.errors.name))]):t._e()]),n("div",{staticClass:"form-item"},[n("label",{staticClass:"required"},[t._v(t._s(o.isEn?"Type":"所属类别"))]),n("div",{staticClass:"type-group"},t._l(o.typeOptions,function(s){return n("div",{key:s.type,class:["type-btn",{active:o.formData.type===s.type}],on:{click:function(i){o.formData.type=s.type}}},[t._v(" "+t._s(o.isEn?s.typeEn:s.typeCn)+" "),o.formData.type===s.type?n("div",{staticClass:"check-mark"}):t._e()])}),0)]),n("div",{staticClass:"form-item"},[n("label",{staticClass:"required"},[t._v(t._s(o.isEn?"Country":"国家"))]),n("div",{class:{"search-error-wrap":o.errors.country}},[n(o.Search,{style:{margin:"0 auto"},attrs:{"search-type-list":["Country"],lang:t.lang,"show-apply-data":!1,"show-search-icon":!1,placeholder:t.placeholder??(o.isEn?" Please enter":"请输入")},on:{"update:model-value":function(s){o.errors.country=""}},model:{value:o.displayQuery,callback:function(s){o.displayQuery=s},expression:"displayQuery"}})],1),o.errors.country?n("div",{staticClass:"error-message"},[t._v(" "+t._s(o.errors.country)+" ")]):t._e()])]),n("div",{staticClass:"modal-footer"},[n("button",{staticClass:"confirm-btn",on:{click:o.handleConfirm}},[t._v(" "+t._s(o.isEn?"Submit":"申请补充")+" ")])])])]):t._e()},fn=[],dn=St(cn,un,fn,!1,null,"93a70c74");const Yt=dn.exports,pn={components:{[O.Dialog.name]:O.Dialog,[O.Form.name]:O.Form,[O.FormItem.name]:O.FormItem,[O.Input.name]:O.Input,[O.Button.name]:O.Button,[O.Checkbox.name]:O.Checkbox,[O.Row.name]:O.Row,[O.Col.name]:O.Col},data(){return{isVisible:!1,formData:{city:"",company:"",email:"",phone:"",name:"",agreement:!1},formRules:{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:(e,t,n)=>{t?n():n(new Error("请同意隐私政策"))},trigger:"change"}]}}},mounted(){x.emitter.on(x.MODAL_ACTION.Open,this.handleOpen)},beforeDestroy(){x.emitter.off(x.MODAL_ACTION.Open,this.handleOpen)},methods:{handleOpen(){console.log("🍉 ~ GlobalModal.vue:150 ~ methods.handleOpen:",this.handleOpen),this.isVisible=!0},closeModal(){this.isVisible=!1,x.emitter.emit(x.MODAL_ACTION.Close),this.$refs.formRef.resetFields()},handleSubmit(){this.$refs.formRef.validate(e=>{e&&(x.emitter.emit(x.MODAL_ACTION.Submit,{...this.formData}),this.closeModal())})}}};var mn=function(){var t=this,n=t._self._c;return n("el-dialog",{attrs:{visible:t.isVisible,"before-close":t.closeModal,"show-close":!1,"close-on-click-modal":!0,width:"500px","custom-class":"global-modal-custom"},on:{"update:visible":function(o){t.isVisible=o}}},[n("div",{staticClass:"global-modal-header-custom",attrs:{slot:"title"},slot:"title"},[n("h2",[t._v("即刻链接全球货代")]),n("el-button",{staticClass:"close-button-custom",attrs:{type:"text"},on:{click:t.closeModal}},[n("span",{staticStyle:{"font-size":"2rem"}},[t._v("×")])])],1),n("div",{staticClass:"global-modal-body-custom"},[n("el-form",{ref:"formRef",attrs:{model:t.formData,rules:t.formRules,"label-position":"top"},nativeOn:{submit:function(o){o.preventDefault()}}},[n("el-row",{attrs:{gutter:20}},[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"所在地(城市)",prop:"city"}},[n("el-input",{attrs:{placeholder:"请输入城市"},model:{value:t.formData.city,callback:function(o){t.$set(t.formData,"city",o)},expression:"formData.city"}})],1)],1),n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"公司名称",prop:"company"}},[n("el-input",{attrs:{placeholder:"请输入公司名称"},model:{value:t.formData.company,callback:function(o){t.$set(t.formData,"company",o)},expression:"formData.company"}})],1)],1)],1),n("el-row",{attrs:{gutter:20}},[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"邮箱",prop:"email"}},[n("el-input",{attrs:{placeholder:"请输入邮箱"},model:{value:t.formData.email,callback:function(o){t.$set(t.formData,"email",o)},expression:"formData.email"}})],1)],1),n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:"电话",prop:"phone"}},[n("el-input",{attrs:{placeholder:"请输入电话"},model:{value:t.formData.phone,callback:function(o){t.$set(t.formData,"phone",o)},expression:"formData.phone"}})],1)],1)],1),n("el-row",[n("el-col",{attrs:{span:24}},[n("el-form-item",{attrs:{label:"姓名",prop:"name"}},[n("el-input",{attrs:{placeholder:"请输入您的全名"},model:{value:t.formData.name,callback:function(o){t.$set(t.formData,"name",o)},expression:"formData.name"}})],1)],1)],1),n("el-form-item",{staticClass:"agreement-item",attrs:{prop:"agreement"}},[n("el-checkbox",{model:{value:t.formData.agreement,callback:function(o){t.$set(t.formData,"agreement",o)},expression:"formData.agreement"}},[t._v("我同意")]),n("a",{staticClass:"privacy-link",attrs:{href:"#"}},[t._v("隐私政策")])],1)],1)],1),n("div",{staticClass:"global-modal-footer-custom",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{staticClass:"submit-button-custom",attrs:{type:"primary"},on:{click:t.handleSubmit}},[t._v(" 加入会员 ")])],1)])},hn=[],gn=St(pn,mn,hn,!1,null,null);const $t=gn.exports;let yn={open(){x.emitter.emit(x.MODAL_ACTION.Open)},close(){x.emitter.emit(x.MODAL_ACTION.Close)},onSubmit(e){x.emitter.on(x.MODAL_ACTION.Submit,e)}};function vn(){let e=!1;return{install(t){if(typeof window<"u"&&!e){const n=document.createElement("div");n.setAttribute("id","global-modal-root"),document.body.appendChild(n);const o=t.extend($t);new o().$mount(n),e=!0}t.prototype.$globalModal=yn}}}const Bt={ApplyDataDialog:Yt,JcSearch:Dt};let Nt=!1;const An={install(e,t){Nt||(Nt=!0,t?.sharedConfig&&x.initSharedConfig(t.sharedConfig),Object.keys(Bt).forEach(n=>{e.component(n,Bt[n])}))}};Object.defineProperty(exports,"MODAL_ACTION",{enumerable:!0,get:()=>x.MODAL_ACTION});Object.defineProperty(exports,"emitter",{enumerable:!0,get:()=>x.emitter});exports.ApplyDataDialog=Yt;exports.GlobalModal=$t;exports.JcSearch=Dt;exports.createGlobalModalPlugin=vn;exports.default=An;