@zwayam/apply-experience-library 0.0.27 → 0.0.28
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.
|
@@ -27,4 +27,4 @@ Error generating stack: `+n.message+`
|
|
|
27
27
|
font-size: .6rem;
|
|
28
28
|
font-weight: bold;
|
|
29
29
|
color: hsl(${Math.max(0,Math.min(120-120*w,120))}deg 100% 31%);`,l?.key)}return l?.onChange&&!(n&&l.skipInitialOnChange)&&l.onChange(o),n=!1,o}return h.updateDeps=v=>{i=v},h}function pl(t,r){if(t===void 0)throw new Error(`Unexpected undefined${r?`: ${r}`:""}`);return t}var Xc=(t,r)=>Math.abs(t-r)<1.01,Qc=(t,r,l)=>{let i;return function(...o){t.clearTimeout(i),i=t.setTimeout(()=>r.apply(this,o),l)}};var Jc=t=>{let{offsetWidth:r,offsetHeight:l}=t;return{width:r,height:l}},kp=t=>t,Up=t=>{let r=Math.max(t.startIndex-t.overscan,0),l=Math.min(t.endIndex+t.overscan,t.count-1),i=[];for(let o=r;o<=l;o++)i.push(o);return i},rh=(t,r)=>{let l=t.scrollElement;if(!l)return;let i=t.targetWindow;if(!i)return;let o=h=>{let{width:v,height:u}=h;r({width:Math.round(v),height:Math.round(u)})};if(o(Jc(l)),!i.ResizeObserver)return()=>{};let n=new i.ResizeObserver(h=>{let v=()=>{let u=h[0];if(u?.borderBoxSize){let s=u.borderBoxSize[0];if(s){o({width:s.inlineSize,height:s.blockSize});return}}o(Jc(l))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(v):v()});return n.observe(l,{box:"border-box"}),()=>{n.unobserve(l)}},th={passive:!0};var ah=typeof window>"u"?!0:"onscrollend"in window,lh=(t,r)=>{let l=t.scrollElement;if(!l)return;let i=t.targetWindow;if(!i)return;let o=0,n=t.options.useScrollendEvent&&ah?()=>{}:Qc(i,()=>{r(o,!1)},t.options.isScrollingResetDelay),h=p=>()=>{let{horizontal:A,isRtl:M}=t.options;o=A?l.scrollLeft*(M&&-1||1):l.scrollTop,n(),r(o,p)},v=h(!0),u=h(!1);l.addEventListener("scroll",v,th);let s=t.options.useScrollendEvent&&ah;return s&&l.addEventListener("scrollend",u,th),()=>{l.removeEventListener("scroll",v),s&&l.removeEventListener("scrollend",u)}};var Gp=(t,r,l)=>{if(r?.borderBoxSize){let i=r.borderBoxSize[0];if(i)return Math.round(i[l.options.horizontal?"inlineSize":"blockSize"])}return t[l.options.horizontal?"offsetWidth":"offsetHeight"]};var eh=(t,{adjustments:r=0,behavior:l},i)=>{var o,n;let h=t+r;(n=(o=i.scrollElement)==null?void 0:o.scrollTo)==null||n.call(o,{[i.options.horizontal?"left":"top"]:h,behavior:l})},La=class{constructor(r){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var l,i,o;return((o=(i=(l=this.targetWindow)==null?void 0:l.performance)==null?void 0:i.now)==null?void 0:o.call(i))??Date.now()},this.observer=(()=>{let l=null,i=()=>l||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:l=new this.targetWindow.ResizeObserver(o=>{o.forEach(n=>{let h=()=>{let v=n.target,u=this.indexFromElement(v);if(!v.isConnected){this.observer.unobserve(v);return}this.shouldMeasureDuringScroll(u)&&this.resizeItem(u,this.options.measureElement(v,n,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(h):h()})}));return{disconnect:()=>{var o;(o=i())==null||o.disconnect(),l=null},observe:o=>{var n;return(n=i())==null?void 0:n.observe(o,{box:"border-box"})},unobserve:o=>{var n;return(n=i())==null?void 0:n.unobserve(o)}}})(),this.range=null,this.setOptions=l=>{Object.entries(l).forEach(([i,o])=>{typeof o>"u"&&delete l[i]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:kp,rangeExtractor:Up,onChange:()=>{},measureElement:Gp,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...l}},this.notify=l=>{var i,o;(o=(i=this.options).onChange)==null||o.call(i,this,l)},this.maybeNotify=Z6(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),l=>{this.notify(l)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(l=>l()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var l;let i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((l=this.scrollElement)==null?void 0:l.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,n)=>{this.scrollAdjustments=0,this.scrollDirection=n?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=n,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(l,i)=>{let o=new Map,n=new Map;for(let h=i-1;h>=0;h--){let v=l[h];if(o.has(v.lane))continue;let u=n.get(v.lane);if(u==null||v.end>u.end?n.set(v.lane,v):v.end<u.end&&o.set(v.lane,!0),o.size===this.options.lanes)break}return n.size===this.options.lanes?Array.from(n.values()).sort((h,v)=>h.end===v.end?h.index-v.index:h.end-v.end)[0]:void 0},this.getMeasurementOptions=Z6(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(l,i,o,n,h,v)=>(this.prevLanes!==void 0&&this.prevLanes!==v&&(this.lanesChangedFlag=!0),this.prevLanes=v,this.pendingMeasuredCacheIndexes=[],{count:l,paddingStart:i,scrollMargin:o,getItemKey:n,enabled:h,lanes:v}),{key:!1}),this.getMeasurements=Z6(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:l,paddingStart:i,scrollMargin:o,getItemKey:n,enabled:h,lanes:v},u)=>{if(!h)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>l)for(let M of this.laneAssignments.keys())M>=l&&this.laneAssignments.delete(M);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(M=>{this.itemSizeCache.set(M.key,M.size)}));let s=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===l&&(this.lanesSettling=!1);let p=this.measurementsCache.slice(0,s),A=new Array(v).fill(void 0);for(let M=0;M<s;M++){let H=p[M];H&&(A[H.lane]=M)}for(let M=s;M<l;M++){let H=n(M),m=this.laneAssignments.get(M),L,w;if(m!==void 0&&this.options.lanes>1){L=m;let z=A[L],B=z!==void 0?p[z]:void 0;w=B?B.end+this.options.gap:i+o}else{let z=this.options.lanes===1?p[M-1]:this.getFurthestMeasurement(p,M);w=z?z.end+this.options.gap:i+o,L=z?z.lane:M%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(M,L)}let Z=u.get(H),V=typeof Z=="number"?Z:this.options.estimateSize(M),x=w+V;p[M]={index:M,start:w,size:V,end:x,key:H,lane:L},A[L]=M}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Z6(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(l,i,o,n)=>this.range=l.length>0&&i>0?Wp({measurements:l,outerSize:i,scrollOffset:o,lanes:n}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Z6(()=>{let l=null,i=null,o=this.calculateRange();return o&&(l=o.startIndex,i=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,l,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,l,i]},(l,i,o,n,h)=>n===null||h===null?[]:l({startIndex:n,endIndex:h,overscan:i,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=l=>{let i=this.options.indexAttribute,o=l.getAttribute(i);return o?parseInt(o,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=l=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;let o=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(o!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),h=Math.max(0,o-n),v=Math.min(this.options.count-1,o+n);return l>=h&&l<=v}return!0},this.measureElement=l=>{if(!l){this.elementsCache.forEach((h,v)=>{h.isConnected||(this.observer.unobserve(h),this.elementsCache.delete(v))});return}let i=this.indexFromElement(l),o=this.options.getItemKey(i),n=this.elementsCache.get(o);n!==l&&(n&&this.observer.unobserve(n),this.observer.observe(l),this.elementsCache.set(o,l)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(l,void 0,this))},this.resizeItem=(l,i)=>{var o;let n=this.measurementsCache[l];if(!n)return;let h=this.itemSizeCache.get(n.key)??n.size,v=i-h;v!==0&&(((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(n,v,this):n.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=v,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,i)),this.notify(!1))},this.getVirtualItems=Z6(()=>[this.getVirtualIndexes(),this.getMeasurements()],(l,i)=>{let o=[];for(let n=0,h=l.length;n<h;n++){let v=l[n],u=i[v];o.push(u)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=l=>{let i=this.getMeasurements();if(i.length!==0)return pl(i[ih(0,i.length-1,o=>pl(i[o]).start,l)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let l=this.scrollElement.document.documentElement;return this.options.horizontal?l.scrollWidth-this.scrollElement.innerWidth:l.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(l,i,o=0)=>{if(!this.scrollElement)return 0;let n=this.getSize(),h=this.getScrollOffset();i==="auto"&&(i=l>=h+n?"end":"start"),i==="center"?l+=(o-n)/2:i==="end"&&(l-=n);let v=this.getMaxScrollOffset();return Math.max(Math.min(v,l),0)},this.getOffsetForIndex=(l,i="auto")=>{l=Math.max(0,Math.min(l,this.options.count-1));let o=this.getSize(),n=this.getScrollOffset(),h=this.measurementsCache[l];if(!h)return;if(i==="auto")if(h.end>=n+o-this.options.scrollPaddingEnd)i="end";else if(h.start<=n+this.options.scrollPaddingStart)i="start";else return[n,i];if(i==="end"&&l===this.options.count-1)return[this.getMaxScrollOffset(),i];let v=i==="end"?h.end+this.options.scrollPaddingEnd:h.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(v,i,h.size),i]},this.scrollToOffset=(l,{align:i="start",behavior:o="auto"}={})=>{let n=this.getOffsetForAlignment(l,i),h=this.now();this.scrollState={index:null,align:i,behavior:o,startedAt:h,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToIndex=(l,{align:i="auto",behavior:o="auto"}={})=>{l=Math.max(0,Math.min(l,this.options.count-1));let n=this.getOffsetForIndex(l,i);if(!n)return;let[h,v]=n,u=this.now();this.scrollState={index:l,align:v,behavior:o,startedAt:u,lastTargetOffset:h,stableFrames:0},this._scrollToOffset(h,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(l,{behavior:i="auto"}={})=>{let o=this.getScrollOffset()+l,n=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:n,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var l;let i=this.getMeasurements(),o;if(i.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((l=i[i.length-1])==null?void 0:l.end)??0;else{let n=Array(this.options.lanes).fill(null),h=i.length-1;for(;h>=0&&n.some(v=>v===null);){let v=i[h];n[v.lane]===null&&(n[v.lane]=v.end),h--}o=Math.max(...n.filter(v=>v!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(l,{adjustments:i,behavior:o})=>{this.options.scrollToFn(l,{behavior:o,adjustments:i},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(r)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,o=i?i[0]:this.scrollState.lastTargetOffset,n=1,h=o!==this.scrollState.lastTargetOffset;if(!h&&Xc(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=n){this.scrollState=null;return}}else this.scrollState.stableFrames=0,h&&(this.scrollState.lastTargetOffset=o,this.scrollState.behavior="auto",this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}},ih=(t,r,l,i)=>{for(;t<=r;){let o=(t+r)/2|0,n=l(o);if(n<i)t=o+1;else if(n>i)r=o-1;else return o}return t>0?t-1:0};function Wp({measurements:t,outerSize:r,scrollOffset:l,lanes:i}){let o=t.length-1,n=u=>t[u].start;if(t.length<=i)return{startIndex:0,endIndex:o};let h=ih(0,o,n,l),v=h;if(i===1)for(;v<o&&t[v].end<l+r;)v++;else if(i>1){let u=Array(i).fill(0);for(;v<o&&u.some(p=>p<l+r);){let p=t[v];u[p.lane]=p.end,v++}let s=Array(i).fill(l+r);for(;h>=0&&s.some(p=>p>=l);){let p=t[h];s[p.lane]=p.start,h--}h=Math.max(0,h-h%i),v=Math.min(o,v+(i-1-v%i))}return{startIndex:h,endIndex:v}}var oh=typeof document<"u"?U4.useLayoutEffect:U4.useEffect;function jp({useFlushSync:t=!0,...r}){let l=U4.useReducer(()=>({}),{})[1],i={...r,onChange:(n,h)=>{var v;t&&h?(0,nh.flushSync)(l):l(),(v=r.onChange)==null||v.call(r,n,h)}},[o]=U4.useState(()=>new La(i));return o.setOptions(i),oh(()=>o._didMount(),[]),oh(()=>o._willUpdate()),o}function ch(t){return jp({observeElementRect:rh,observeElementOffset:lh,scrollToFn:eh,...t})}var t1=E(k(),1),y6=E(T2(),1);var hh=E(k(),1);function qp(t,r){return t!==null&&r!==null&&typeof t=="object"&&typeof r=="object"&&"id"in t&&"id"in r?t.id===r.id:t===r}function za(t=qp){return(0,hh.useCallback)((r,l)=>{if(typeof t=="string"){let i=t;return r?.[i]===l?.[i]}return t(r,l)},[t])}var vh=E(k(),1);function dh(t){if(t===null)return{width:0,height:0};let{width:r,height:l}=t.getBoundingClientRect();return{width:r,height:l}}function t5(t,r,l=!1){let[i,o]=(0,vh.useState)(()=>dh(r));return a1(()=>{if(!r||!t)return;let n=T1();return n.requestAnimationFrame(function h(){n.requestAnimationFrame(h),o(v=>{let u=dh(r);return u.width===v.width&&u.height===v.height?v:u})}),()=>{n.dispose()}},[r,t]),l?{width:`${i.width}px`,height:`${i.height}px`}:i}var gh=E(k(),1);var a5=(t=>(t[t.Left=0]="Left",t[t.Right=2]="Right",t))(a5||{});function Ca(t){let r=(0,gh.useRef)(null),l=_(o=>{r.current=o.pointerType,!Qt(o.currentTarget)&&o.pointerType==="mouse"&&o.button===a5.Left&&(o.preventDefault(),t(o))}),i=_(o=>{r.current!=="mouse"&&(Qt(o.currentTarget)||t(o))});return{onPointerDown:l,onClick:i}}var Ba=E(k(),1);var A8=class extends Map{constructor(r){super(),this.factory=r}get(r){let l=super.get(r);return l===void 0&&(l=this.factory(r),this.set(r,l)),l}};var Kp=Object.defineProperty,Yp=(t,r,l)=>r in t?Kp(t,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[r]=l,Xp=(t,r,l)=>(Yp(t,typeof r!="symbol"?r+"":r,l),l),ph=(t,r,l)=>{if(!r.has(t))throw TypeError("Cannot "+l)},r2=(t,r,l)=>(ph(t,r,"read from private field"),l?l.call(t):r.get(t)),Hl=(t,r,l)=>{if(r.has(t))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(t):r.set(t,l)},uh=(t,r,l,i)=>(ph(t,r,"write to private field"),i?i.call(t,l):r.set(t,l),l),N2,r5,l5,G4=class{constructor(r){Hl(this,N2,{}),Hl(this,r5,new A8(()=>new Set)),Hl(this,l5,new Set),Xp(this,"disposables",T1()),uh(this,N2,r),x0.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return r2(this,N2)}subscribe(r,l){if(x0.isServer)return()=>{};let i={selector:r,callback:l,current:r(r2(this,N2))};return r2(this,l5).add(i),this.disposables.add(()=>{r2(this,l5).delete(i)})}on(r,l){return x0.isServer?()=>{}:(r2(this,r5).get(r).add(l),this.disposables.add(()=>{r2(this,r5).get(r).delete(l)}))}send(r){let l=this.reduce(r2(this,N2),r);if(l!==r2(this,N2)){uh(this,N2,l);for(let i of r2(this,l5)){let o=i.selector(r2(this,N2));fl(i.current,o)||(i.current=o,i.callback(o))}for(let i of r2(this,r5).get(r.type))i(r2(this,N2),r)}}};N2=new WeakMap,r5=new WeakMap,l5=new WeakMap;function fl(t,r){return Object.is(t,r)?!0:typeof t!="object"||t===null||typeof r!="object"||r===null?!1:Array.isArray(t)&&Array.isArray(r)?t.length!==r.length?!1:Ml(t[Symbol.iterator](),r[Symbol.iterator]()):t instanceof Map&&r instanceof Map||t instanceof Set&&r instanceof Set?t.size!==r.size?!1:Ml(t.entries(),r.entries()):sh(t)&&sh(r)?Ml(Object.entries(t)[Symbol.iterator](),Object.entries(r)[Symbol.iterator]()):!1}function Ml(t,r){do{let l=t.next(),i=r.next();if(l.done&&i.done)return!0;if(l.done||i.done||!Object.is(l.value,i.value))return!1}while(!0)}function sh(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;let r=Object.getPrototypeOf(t);return r===null||Object.getPrototypeOf(r)===null}function wa(t){let[r,l]=t(),i=T1();return(...o)=>{r(...o),i.dispose(),i.microTask(l)}}var Qp=Object.defineProperty,Jp=(t,r,l)=>r in t?Qp(t,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[r]=l,Hh=(t,r,l)=>(Jp(t,typeof r!="symbol"?r+"":r,l),l),e5=(t=>(t[t.Push=0]="Push",t[t.Pop=1]="Pop",t))(e5||{}),tH={0(t,r){let l=r.id,i=t.stack,o=t.stack.indexOf(l);if(o!==-1){let n=t.stack.slice();return n.splice(o,1),n.push(l),i=n,{...t,stack:i}}return{...t,stack:[...t.stack,l]}},1(t,r){let l=r.id,i=t.stack.indexOf(l);if(i===-1)return t;let o=t.stack.slice();return o.splice(i,1),{...t,stack:o}}},Al=class t extends G4{constructor(){super(...arguments),Hh(this,"actions",{push:r=>this.send({type:0,id:r}),pop:r=>this.send({type:1,id:r})}),Hh(this,"selectors",{isTop:(r,l)=>r.stack[r.stack.length-1]===l,inStack:(r,l)=>r.stack.includes(l)})}static new(){return new t({stack:[]})}reduce(r,l){return x1(l.type,tH,r,l)}},l2=new A8(()=>Al.new());var mh=E(Vh(),1);function f1(t,r,l=fl){return(0,mh.useSyncExternalStoreWithSelector)(_(i=>t.subscribe(cH,i)),_(()=>t.state),_(()=>t.state),_(r),l)}function cH(t){return t}function h4(t,r){let l=(0,Ba.useId)(),i=l2.get(r),[o,n]=f1(i,(0,Ba.useCallback)(h=>[i.selectors.isTop(h,l),i.selectors.inStack(h,l)],[i,l]));return a1(()=>{if(t)return i.actions.push(l),()=>i.actions.pop(l)},[i,t,l]),t?n?o:!0:!1}var Vl=new Map,o5=new Map;function Zh(t){var r;let l=(r=o5.get(t))!=null?r:0;return o5.set(t,l+1),l!==0?()=>xh(t):(Vl.set(t,{"aria-hidden":t.getAttribute("aria-hidden"),inert:t.inert}),t.setAttribute("aria-hidden","true"),t.inert=!0,()=>xh(t))}function xh(t){var r;let l=(r=o5.get(t))!=null?r:1;if(l===1?o5.delete(t):o5.set(t,l-1),l!==1)return;let i=Vl.get(t);i&&(i["aria-hidden"]===null?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden",i["aria-hidden"]),t.inert=i.inert,Vl.delete(t))}function V8(t,{allowed:r,disallowed:l}={}){let i=h4(t,"inert-others");a1(()=>{var o,n;if(!i)return;let h=T1();for(let u of(o=l?.())!=null?o:[])u&&h.add(Zh(u));let v=(n=r?.())!=null?n:[];for(let u of v){if(!u)continue;let s=R0(u);if(!s)continue;let p=u.parentElement;for(;p&&p!==s.body;){for(let A of p.children)v.some(M=>A.contains(M))||h.add(Zh(A));p=p.parentElement}}return h.dispose},[i,r,l])}var Lh=E(k(),1);function m8(t,r,l){let i=t0(o=>{let n=o.getBoundingClientRect();n.x===0&&n.y===0&&n.width===0&&n.height===0&&l()});(0,Lh.useEffect)(()=>{if(!t)return;let o=r===null?null:j1(r)?r:r.current;if(!o)return;let n=T1();if(typeof ResizeObserver<"u"){let h=new ResizeObserver(()=>i.current(o));h.observe(o),n.add(()=>h.disconnect())}if(typeof IntersectionObserver<"u"){let h=new IntersectionObserver(()=>i.current(o));h.observe(o),n.add(()=>h.disconnect())}return()=>n.dispose()},[r,i,t])}var v5=E(k(),1);var n5=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(t=>`${t}:not([tabindex='-1'])`).join(","),hH=["[data-autofocus]"].map(t=>`${t}:not([tabindex='-1'])`).join(","),I0=(t=>(t[t.First=1]="First",t[t.Previous=2]="Previous",t[t.Next=4]="Next",t[t.Last=8]="Last",t[t.WrapAround=16]="WrapAround",t[t.NoScroll=32]="NoScroll",t[t.AutoFocus=64]="AutoFocus",t))(I0||{}),Pa=(t=>(t[t.Error=0]="Error",t[t.Overflow=1]="Overflow",t[t.Success=2]="Success",t[t.Underflow=3]="Underflow",t))(Pa||{}),dH=(t=>(t[t.Previous=-1]="Previous",t[t.Next=1]="Next",t))(dH||{});function zh(t=document.body){return t==null?[]:Array.from(t.querySelectorAll(n5)).sort((r,l)=>Math.sign((r.tabIndex||Number.MAX_SAFE_INTEGER)-(l.tabIndex||Number.MAX_SAFE_INTEGER)))}function vH(t=document.body){return t==null?[]:Array.from(t.querySelectorAll(hH)).sort((r,l)=>Math.sign((r.tabIndex||Number.MAX_SAFE_INTEGER)-(l.tabIndex||Number.MAX_SAFE_INTEGER)))}var c5=(t=>(t[t.Strict=0]="Strict",t[t.Loose=1]="Loose",t))(c5||{});function Sa(t,r=0){var l;return t===((l=R0(t))==null?void 0:l.body)?!1:x1(r,{0(){return t.matches(n5)},1(){let i=t;for(;i!==null;){if(i.matches(n5))return!0;i=i.parentElement}return!1}})}var gH=(t=>(t[t.Keyboard=0]="Keyboard",t[t.Mouse=1]="Mouse",t))(gH||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",t=>{t.metaKey||t.altKey||t.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",t=>{t.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:t.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function _2(t){t?.focus({preventScroll:!0})}var uH=["textarea","input"].join(",");function sH(t){var r,l;return(l=(r=t?.matches)==null?void 0:r.call(t,uH))!=null?l:!1}function h5(t,r=l=>l){return t.slice().sort((l,i)=>{let o=r(l),n=r(i);if(o===null||n===null)return 0;let h=o.compareDocumentPosition(n);return h&Node.DOCUMENT_POSITION_FOLLOWING?-1:h&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Ch(t,r,l=t===null?document.body:g8(t)){return x6(zh(l),r,{relativeTo:t})}function x6(t,r,{sorted:l=!0,relativeTo:i=null,skipElements:o=[]}={}){let n=Array.isArray(t)?t.length>0?g8(t[0]):document:g8(t),h=Array.isArray(t)?l?h5(t):t:r&64?vH(t):zh(t);o.length>0&&h.length>1&&(h=h.filter(H=>!o.some(m=>m!=null&&"current"in m?m?.current===H:m===H))),i=i??n?.activeElement;let v=(()=>{if(r&5)return 1;if(r&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=(()=>{if(r&1)return 0;if(r&2)return Math.max(0,h.indexOf(i))-1;if(r&4)return Math.max(0,h.indexOf(i))+1;if(r&8)return h.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),s=r&32?{preventScroll:!0}:{},p=0,A=h.length,M;do{if(p>=A||p+A<=0)return 0;let H=u+p;if(r&16)H=(H+A)%A;else{if(H<0)return 3;if(H>=A)return 1}M=h[H],M?.focus(s),p+=v}while(M!==hl(M));return r&6&&sH(M)&&M.select(),2}function ml(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function pH(){return/Android/gi.test(window.navigator.userAgent)}function d5(){return ml()||pH()}var wh=E(k(),1);function W4(t,r,l,i){let o=t0(l);(0,wh.useEffect)(()=>{if(!t)return;function n(h){o.current(h)}return document.addEventListener(r,n,i),()=>document.removeEventListener(r,n,i)},[t,r,i])}var Bh=E(k(),1);function ya(t,r,l,i){let o=t0(l);(0,Bh.useEffect)(()=>{if(!t)return;function n(h){o.current(h)}return window.addEventListener(r,n,i),()=>window.removeEventListener(r,n,i)},[t,r,i])}var Ph=30;function Z8(t,r,l){let i=t0(l),o=(0,v5.useCallback)(function(v,u){if(v.defaultPrevented)return;let s=u(v);if(s===null||!s.getRootNode().contains(s)||!s.isConnected)return;let p=(function A(M){return typeof M=="function"?A(M()):Array.isArray(M)||M instanceof Set?M:[M]})(r);for(let A of p)if(A!==null&&(A.contains(s)||v.composed&&v.composedPath().includes(A)))return;return!Sa(s,c5.Loose)&&s.tabIndex!==-1&&v.preventDefault(),i.current(v,s)},[i,r]),n=(0,v5.useRef)(null);W4(t,"pointerdown",v=>{var u,s;d5()||(n.current=((s=(u=v.composedPath)==null?void 0:u.call(v))==null?void 0:s[0])||v.target)},!0),W4(t,"pointerup",v=>{if(d5()||!n.current)return;let u=n.current;return n.current=null,o(v,()=>u)},!0);let h=(0,v5.useRef)({x:0,y:0});W4(t,"touchstart",v=>{h.current.x=v.touches[0].clientX,h.current.y=v.touches[0].clientY},!0),W4(t,"touchend",v=>{let u={x:v.changedTouches[0].clientX,y:v.changedTouches[0].clientY};if(!(Math.abs(u.x-h.current.x)>=Ph||Math.abs(u.y-h.current.y)>=Ph))return o(v,()=>S0(v.target)?v.target:null)},!0),ya(t,"blur",v=>o(v,()=>_c(window.document.activeElement)?window.document.activeElement:null),!0)}var Sh=E(k(),1);function e2(...t){return(0,Sh.useMemo)(()=>R0(...t),[...t])}var ba=E(k(),1);var HH=(t=>(t[t.Ignore=0]="Ignore",t[t.Select=1]="Select",t[t.Close=2]="Close",t))(HH||{}),m2={Ignore:{kind:0},Select:t=>({kind:1,target:t}),Close:{kind:2}},MH=200,yh=5;function Ta(t,{trigger:r,action:l,close:i,select:o}){let n=(0,ba.useRef)(null),h=(0,ba.useRef)(null),v=(0,ba.useRef)(null);W4(t&&r!==null,"pointerdown",u=>{gl(u?.target)&&r!=null&&r.contains(u.target)&&(h.current=u.x,v.current=u.y,n.current=u.timeStamp)}),W4(t&&r!==null,"pointerup",u=>{var s,p;let A=n.current;if(A===null||(n.current=null,!S0(u.target))||Math.abs(u.x-((s=h.current)!=null?s:u.x))<yh&&Math.abs(u.y-((p=v.current)!=null?p:u.y))<yh)return;let M=l(u);switch(M.kind){case 0:return;case 1:{u.timeStamp-A>MH&&(o(M.target),i());break}case 2:{i();break}}},{capture:!0})}var Th=E(k(),1);var bh=E(k(),1);function x8(t,r,l,i){let o=t0(l);(0,bh.useEffect)(()=>{t=t??window;function n(h){o.current(h)}return t.addEventListener(r,n,i),()=>t.removeEventListener(r,n,i)},[t,r,i])}function Zl(t){let r=(0,Th.useRef)({value:"",selectionStart:null,selectionEnd:null});return x8(t,"blur",l=>{let i=l.target;m6(i)&&(r.current={value:i.value,selectionStart:i.selectionStart,selectionEnd:i.selectionEnd})}),_(()=>{if(!_4(t)&&m6(t)&&t.isConnected){if(t.focus({preventScroll:!0}),t.value!==r.current.value)t.setSelectionRange(t.value.length,t.value.length);else{let{selectionStart:l,selectionEnd:i}=r.current;l!==null&&i!==null&&t.setSelectionRange(l,i)}r.current={value:"",selectionStart:null,selectionEnd:null}}})}var $h=E(k(),1);function $a(t,r){return(0,$h.useMemo)(()=>{var l;if(t.type)return t.type;let i=(l=t.as)!=null?l:"button";if(typeof i=="string"&&i.toLowerCase()==="button"||r?.tagName==="BUTTON"&&!r.hasAttribute("type"))return"button"},[t.type,t.as,r])}var Oh=E(k(),1);function Fh(t){return(0,Oh.useSyncExternalStore)(t.subscribe,t.getSnapshot,t.getSnapshot)}function Dh(t,r){let l=t(),i=new Set;return{getSnapshot(){return l},subscribe(o){return i.add(o),()=>i.delete(o)},dispatch(o,...n){let h=r[o].call(l,...n);h&&(l=h,i.forEach(v=>v()))}}}function Eh(){let t;return{before({doc:r}){var l;let i=r.documentElement,o=(l=r.defaultView)!=null?l:window;t=Math.max(0,o.innerWidth-i.clientWidth)},after({doc:r,d:l}){let i=r.documentElement,o=Math.max(0,i.clientWidth-i.offsetWidth),n=Math.max(0,t-o);l.style(i,"paddingRight",`${n}px`)}}}function Nh(){return ml()?{before({doc:t,d:r,meta:l}){function i(o){for(let n of l().containers)for(let h of n())if(h.contains(o))return!0;return!1}r.microTask(()=>{var o;if(window.getComputedStyle(t.documentElement).scrollBehavior!=="auto"){let v=T1();v.style(t.documentElement,"scrollBehavior","auto"),r.add(()=>r.microTask(()=>v.dispose()))}let n=(o=window.scrollY)!=null?o:window.pageYOffset,h=null;r.addEventListener(t,"click",v=>{if(S0(v.target))try{let u=v.target.closest("a");if(!u)return;let{hash:s}=new URL(u.href),p=t.querySelector(s);S0(p)&&!i(p)&&(h=p)}catch{}},!0),r.group(v=>{r.addEventListener(t,"touchstart",u=>{if(v.dispose(),S0(u.target)&&Nc(u.target))if(i(u.target)){let s=u.target;for(;s.parentElement&&i(s.parentElement);)s=s.parentElement;v.style(s,"overscrollBehavior","contain")}else v.style(u.target,"touchAction","none")})}),r.addEventListener(t,"touchmove",v=>{if(S0(v.target)){if(m6(v.target))return;if(i(v.target)){let u=v.target;for(;u.parentElement&&u.dataset.headlessuiPortal!==""&&!(u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth);)u=u.parentElement;u.dataset.headlessuiPortal===""&&v.preventDefault()}else v.preventDefault()}},{passive:!1}),r.add(()=>{var v;let u=(v=window.scrollY)!=null?v:window.pageYOffset;n!==u&&window.scrollTo(0,n),h&&h.isConnected&&(h.scrollIntoView({block:"nearest"}),h=null)})})}}:{}}function _h(){return{before({doc:t,d:r}){r.style(t.documentElement,"overflow","hidden")}}}function Rh(t){let r={};for(let l of t)Object.assign(r,l(r));return r}var j4=Dh(()=>new Map,{PUSH(t,r){var l;let i=(l=this.get(t))!=null?l:{doc:t,count:0,d:T1(),meta:new Set,computedMeta:{}};return i.count++,i.meta.add(r),i.computedMeta=Rh(i.meta),this.set(t,i),this},POP(t,r){let l=this.get(t);return l&&(l.count--,l.meta.delete(r),l.computedMeta=Rh(l.meta)),this},SCROLL_PREVENT(t){let r={doc:t.doc,d:t.d,meta(){return t.computedMeta}},l=[Nh(),Eh(),_h()];l.forEach(({before:i})=>i?.(r)),l.forEach(({after:i})=>i?.(r))},SCROLL_ALLOW({d:t}){t.dispose()},TEARDOWN({doc:t}){this.delete(t)}});j4.subscribe(()=>{let t=j4.getSnapshot(),r=new Map;for(let[l]of t)r.set(l,l.documentElement.style.overflow);for(let l of t.values()){let i=r.get(l.doc)==="hidden",o=l.count!==0;(o&&!i||!o&&i)&&j4.dispatch(l.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",l),l.count===0&&j4.dispatch("TEARDOWN",l)}});function Ih(t,r,l=()=>({containers:[]})){let i=Fh(j4),o=r?i.get(r):void 0,n=o?o.count>0:!1;return a1(()=>{if(!(!r||!t))return j4.dispatch("PUSH",r,l),()=>j4.dispatch("POP",r,l)},[t,r]),n}function L8(t,r,l=()=>[document.body]){let i=h4(t,"scroll-lock");Ih(i,r,o=>{var n;return{containers:[...(n=o.containers)!=null?n:[],l]}})}var Uh=E(k(),1);function kh(t){return[t.screenX,t.screenY]}function Oa(){let t=(0,Uh.useRef)([-1,-1]);return{wasMoved(r){let l=kh(r);return t.current[0]===l[0]&&t.current[1]===l[1]?!1:(t.current=l,!0)},update(r){t.current=kh(r)}}}var g5=E(k(),1);var q4=E(k(),1);function Gh(t=0){let[r,l]=(0,q4.useState)(t),i=(0,q4.useCallback)(u=>l(u),[]),o=(0,q4.useCallback)(u=>l(s=>s|u),[]),n=(0,q4.useCallback)(u=>(r&u)===u,[r]),h=(0,q4.useCallback)(u=>l(s=>s&~u),[]),v=(0,q4.useCallback)(u=>l(s=>s^u),[]);return{flags:r,setFlag:i,addFlag:o,hasFlag:n,removeFlag:h,toggleFlag:v}}var Wh,jh;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((Wh=process==null?void 0:process.env)==null?void 0:Wh.NODE_ENV)==="test"&&typeof((jh=Element?.prototype)==null?void 0:jh.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
|
|
30
|
-
`)),[]});var fH=(t=>(t[t.None=0]="None",t[t.Closed=1]="Closed",t[t.Enter=2]="Enter",t[t.Leave=4]="Leave",t))(fH||{});function z8(t){let r={};for(let l in t)t[l]===!0&&(r[`data-${l}`]="");return r}function C8(t,r,l,i){let[o,n]=(0,g5.useState)(l),{hasFlag:h,addFlag:v,removeFlag:u}=Gh(t&&o?3:0),s=(0,g5.useRef)(!1),p=(0,g5.useRef)(!1),A=W1();return a1(()=>{var M;if(t){if(l&&n(!0),!r){l&&v(3);return}return(M=i?.start)==null||M.call(i,l),AH(r,{inFlight:s,prepare(){p.current?p.current=!1:p.current=s.current,s.current=!0,!p.current&&(l?(v(3),u(4)):(v(4),u(2)))},run(){p.current?l?(u(3),v(4)):(u(4),v(3)):l?u(1):v(1)},done(){var H;p.current&&ZH(r)||(s.current=!1,u(7),l||n(!1),(H=i?.end)==null||H.call(i,l))}})}},[t,l,r,A]),t?[o,{closed:h(1),enter:h(2),leave:h(4),transition:h(2)||h(4)}]:[l,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function AH(t,{prepare:r,run:l,done:i,inFlight:o}){let n=T1();return mH(t,{prepare:r,inFlight:o}),n.nextFrame(()=>{l(),n.requestAnimationFrame(()=>{n.add(VH(t,i))})}),n.dispose}function VH(t,r){var l,i;let o=T1();if(!t)return o.dispose;let n=!1;o.add(()=>{n=!0});let h=(i=(l=t.getAnimations)==null?void 0:l.call(t).filter(v=>v instanceof CSSTransition))!=null?i:[];return h.length===0?(r(),o.dispose):(Promise.allSettled(h.map(v=>v.finished)).then(()=>{n||r()}),o.dispose)}function mH(t,{inFlight:r,prepare:l}){if(r!=null&&r.current){l();return}let i=t.style.transition;t.style.transition="none",l(),t.offsetHeight,t.style.transition=i}function ZH(t){var r,l;return((l=(r=t.getAnimations)==null?void 0:r.call(t))!=null?l:[]).some(i=>i instanceof CSSTransition&&i.playState!=="finished")}var u5=E(k(),1);function qh(t,{container:r,accept:l,walk:i}){let o=(0,u5.useRef)(l),n=(0,u5.useRef)(i);(0,u5.useEffect)(()=>{o.current=l,n.current=i},[l,i]),a1(()=>{if(!r||!t)return;let h=R0(r);if(!h)return;let v=o.current,u=n.current,s=Object.assign(A=>v(A),{acceptNode:v}),p=h.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,s,!1);for(;p.nextNode();)u(p.currentNode)},[r,t,o,n])}var Fa=E(k(),1);function L6(t,r){let l=(0,Fa.useRef)([]),i=_(t);(0,Fa.useEffect)(()=>{let o=[...l.current];for(let[n,h]of r.entries())if(l.current[n]!==h){let v=i(r,o);return l.current=r,v}},[i,...r])}var r1=E(k(),1),V5=E(k(),1);function Da(){return typeof window<"u"}function K4(t){return Yh(t)?(t.nodeName||"").toLowerCase():"#document"}function L0(t){var r;return(t==null||(r=t.ownerDocument)==null?void 0:r.defaultView)||window}function Z2(t){var r;return(r=(Yh(t)?t.ownerDocument:t.document)||window.document)==null?void 0:r.documentElement}function Yh(t){return Da()?t instanceof Node||t instanceof L0(t).Node:!1}function h0(t){return Da()?t instanceof Element||t instanceof L0(t).Element:!1}function x2(t){return Da()?t instanceof HTMLElement||t instanceof L0(t).HTMLElement:!1}function Kh(t){return!Da()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof L0(t).ShadowRoot}function w8(t){let{overflow:r,overflowX:l,overflowY:i,display:o}=k0(t);return/auto|scroll|overlay|hidden|clip/.test(r+i+l)&&o!=="inline"&&o!=="contents"}function Xh(t){return/^(table|td|th)$/.test(K4(t))}function s5(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}var xH=/transform|translate|scale|rotate|perspective|filter/,LH=/paint|layout|strict|content/,z6=t=>!!t&&t!=="none",xl;function Ea(t){let r=h0(t)?k0(t):t;return z6(r.transform)||z6(r.translate)||z6(r.scale)||z6(r.rotate)||z6(r.perspective)||!p5()&&(z6(r.backdropFilter)||z6(r.filter))||xH.test(r.willChange||"")||LH.test(r.contain||"")}function Qh(t){let r=R2(t);for(;x2(r)&&!Y4(r);){if(Ea(r))return r;if(s5(r))return null;r=R2(r)}return null}function p5(){return xl==null&&(xl=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),xl}function Y4(t){return/^(html|body|#document)$/.test(K4(t))}function k0(t){return L0(t).getComputedStyle(t)}function H5(t){return h0(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function R2(t){if(K4(t)==="html")return t;let r=t.assignedSlot||t.parentNode||Kh(t)&&t.host||Z2(t);return Kh(r)?r.host:r}function Jh(t){let r=R2(t);return Y4(r)?t.ownerDocument?t.ownerDocument.body:t.body:x2(r)&&w8(r)?r:Jh(r)}function d4(t,r,l){var i;r===void 0&&(r=[]),l===void 0&&(l=!0);let o=Jh(t),n=o===((i=t.ownerDocument)==null?void 0:i.body),h=L0(o);if(n){let v=Na(h);return r.concat(h,h.visualViewport||[],w8(o)?o:[],v&&l?d4(v):[])}else return r.concat(o,d4(o,[],l))}function Na(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function td(){let t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(r=>{let{brand:l,version:i}=r;return l+"/"+i}).join(" "):navigator.userAgent}var I2=Math.min,X1=Math.max,C6=Math.round,B8=Math.floor,L2=t=>({x:t,y:t}),zH={left:"right",right:"left",bottom:"top",top:"bottom"};function Ll(t,r,l){return X1(t,I2(r,l))}function X4(t,r){return typeof t=="function"?t(r):t}function v4(t){return t.split("-")[0]}function P8(t){return t.split("-")[1]}function zl(t){return t==="x"?"y":"x"}function Cl(t){return t==="y"?"height":"width"}function k2(t){let r=t[0];return r==="t"||r==="b"?"y":"x"}function wl(t){return zl(k2(t))}function ld(t,r,l){l===void 0&&(l=!1);let i=P8(t),o=wl(t),n=Cl(o),h=o==="x"?i===(l?"end":"start")?"right":"left":i==="start"?"bottom":"top";return r.reference[n]>r.floating[n]&&(h=M5(h)),[h,M5(h)]}function ed(t){let r=M5(t);return[_a(t),r,_a(r)]}function _a(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}var ad=["left","right"],rd=["right","left"],CH=["top","bottom"],wH=["bottom","top"];function BH(t,r,l){switch(t){case"top":case"bottom":return l?r?rd:ad:r?ad:rd;case"left":case"right":return r?CH:wH;default:return[]}}function id(t,r,l,i){let o=P8(t),n=BH(v4(t),l==="start",i);return o&&(n=n.map(h=>h+"-"+o),r&&(n=n.concat(n.map(_a)))),n}function M5(t){let r=v4(t);return zH[r]+t.slice(r.length)}function PH(t){return{top:0,right:0,bottom:0,left:0,...t}}function od(t){return typeof t!="number"?PH(t):{top:t,right:t,bottom:t,left:t}}function w6(t){let{x:r,y:l,width:i,height:o}=t;return{width:i,height:o,top:l,left:r,right:r+i,bottom:l+o,x:r,y:l}}var A5=E(T2(),1);function nd(t,r,l){let{reference:i,floating:o}=t,n=k2(r),h=wl(r),v=Cl(h),u=v4(r),s=n==="y",p=i.x+i.width/2-o.width/2,A=i.y+i.height/2-o.height/2,M=i[v]/2-o[v]/2,H;switch(u){case"top":H={x:p,y:i.y-o.height};break;case"bottom":H={x:p,y:i.y+i.height};break;case"right":H={x:i.x+i.width,y:A};break;case"left":H={x:i.x-o.width,y:A};break;default:H={x:i.x,y:i.y}}switch(P8(r)){case"start":H[h]-=M*(l&&s?-1:1);break;case"end":H[h]+=M*(l&&s?-1:1);break}return H}async function Bl(t,r){var l;r===void 0&&(r={});let{x:i,y:o,platform:n,rects:h,elements:v,strategy:u}=t,{boundary:s="clippingAncestors",rootBoundary:p="viewport",elementContext:A="floating",altBoundary:M=!1,padding:H=0}=X4(r,t),m=od(H),w=v[M?A==="floating"?"reference":"floating":A],Z=w6(await n.getClippingRect({element:(l=await(n.isElement==null?void 0:n.isElement(w)))==null||l?w:w.contextElement||await(n.getDocumentElement==null?void 0:n.getDocumentElement(v.floating)),boundary:s,rootBoundary:p,strategy:u})),V=A==="floating"?{x:i,y:o,width:h.floating.width,height:h.floating.height}:h.reference,x=await(n.getOffsetParent==null?void 0:n.getOffsetParent(v.floating)),z=await(n.isElement==null?void 0:n.isElement(x))?await(n.getScale==null?void 0:n.getScale(x))||{x:1,y:1}:{x:1,y:1},B=w6(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:v,rect:V,offsetParent:x,strategy:u}):V);return{top:(Z.top-B.top+m.top)/z.y,bottom:(B.bottom-Z.bottom+m.bottom)/z.y,left:(Z.left-B.left+m.left)/z.x,right:(B.right-Z.right+m.right)/z.x}}var SH=50,cd=async(t,r,l)=>{let{placement:i="bottom",strategy:o="absolute",middleware:n=[],platform:h}=l,v=h.detectOverflow?h:{...h,detectOverflow:Bl},u=await(h.isRTL==null?void 0:h.isRTL(r)),s=await h.getElementRects({reference:t,floating:r,strategy:o}),{x:p,y:A}=nd(s,i,u),M=i,H=0,m={};for(let L=0;L<n.length;L++){let w=n[L];if(!w)continue;let{name:Z,fn:V}=w,{x,y:z,data:B,reset:P}=await V({x:p,y:A,initialPlacement:i,placement:M,strategy:o,middlewareData:m,rects:s,platform:v,elements:{reference:t,floating:r}});p=x??p,A=z??A,m[Z]={...m[Z],...B},P&&H<SH&&(H++,typeof P=="object"&&(P.placement&&(M=P.placement),P.rects&&(s=P.rects===!0?await h.getElementRects({reference:t,floating:r,strategy:o}):P.rects),{x:p,y:A}=nd(s,M,u)),L=-1)}return{x:p,y:A,placement:M,strategy:o,middlewareData:m}};var hd=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(r){var l,i;let{placement:o,middlewareData:n,rects:h,initialPlacement:v,platform:u,elements:s}=r,{mainAxis:p=!0,crossAxis:A=!0,fallbackPlacements:M,fallbackStrategy:H="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:L=!0,...w}=X4(t,r);if((l=n.arrow)!=null&&l.alignmentOffset)return{};let Z=v4(o),V=k2(v),x=v4(v)===v,z=await(u.isRTL==null?void 0:u.isRTL(s.floating)),B=M||(x||!L?[M5(v)]:ed(v)),P=m!=="none";!M&&P&&B.push(...id(v,L,m,z));let $=[v,...B],S=await u.detectOverflow(r,w),O=[],y=((i=n.flip)==null?void 0:i.overflows)||[];if(p&&O.push(S[Z]),A){let G=ld(o,h,z);O.push(S[G[0]],S[G[1]])}if(y=[...y,{placement:o,overflows:O}],!O.every(G=>G<=0)){var F,U;let G=(((F=n.flip)==null?void 0:F.index)||0)+1,I=$[G];if(I&&(!(A==="alignment"?V!==k2(I):!1)||y.every(X=>k2(X.placement)===V?X.overflows[0]>0:!0)))return{data:{index:G,overflows:y},reset:{placement:I}};let J=(U=y.filter(A1=>A1.overflows[0]<=0).sort((A1,X)=>A1.overflows[1]-X.overflows[1])[0])==null?void 0:U.placement;if(!J)switch(H){case"bestFit":{var q;let A1=(q=y.filter(X=>{if(P){let l1=k2(X.placement);return l1===V||l1==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(l1=>l1>0).reduce((l1,T)=>l1+T,0)]).sort((X,l1)=>X[1]-l1[1])[0])==null?void 0:q[0];A1&&(J=A1);break}case"initialPlacement":J=v;break}if(o!==J)return{reset:{placement:J}}}return{}}}};var yH=new Set(["left","top"]);async function bH(t,r){let{placement:l,platform:i,elements:o}=t,n=await(i.isRTL==null?void 0:i.isRTL(o.floating)),h=v4(l),v=P8(l),u=k2(l)==="y",s=yH.has(h)?-1:1,p=n&&u?-1:1,A=X4(r,t),{mainAxis:M,crossAxis:H,alignmentAxis:m}=typeof A=="number"?{mainAxis:A,crossAxis:0,alignmentAxis:null}:{mainAxis:A.mainAxis||0,crossAxis:A.crossAxis||0,alignmentAxis:A.alignmentAxis};return v&&typeof m=="number"&&(H=v==="end"?m*-1:m),u?{x:H*p,y:M*s}:{x:M*s,y:H*p}}var dd=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(r){var l,i;let{x:o,y:n,placement:h,middlewareData:v}=r,u=await bH(r,t);return h===((l=v.offset)==null?void 0:l.placement)&&(i=v.arrow)!=null&&i.alignmentOffset?{}:{x:o+u.x,y:n+u.y,data:{...u,placement:h}}}}},vd=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(r){let{x:l,y:i,placement:o,platform:n}=r,{mainAxis:h=!0,crossAxis:v=!1,limiter:u={fn:Z=>{let{x:V,y:x}=Z;return{x:V,y:x}}},...s}=X4(t,r),p={x:l,y:i},A=await n.detectOverflow(r,s),M=k2(v4(o)),H=zl(M),m=p[H],L=p[M];if(h){let Z=H==="y"?"top":"left",V=H==="y"?"bottom":"right",x=m+A[Z],z=m-A[V];m=Ll(x,m,z)}if(v){let Z=M==="y"?"top":"left",V=M==="y"?"bottom":"right",x=L+A[Z],z=L-A[V];L=Ll(x,L,z)}let w=u.fn({...r,[H]:m,[M]:L});return{...w,data:{x:w.x-l,y:w.y-i,enabled:{[H]:h,[M]:v}}}}}};var gd=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(r){var l,i;let{placement:o,rects:n,platform:h,elements:v}=r,{apply:u=()=>{},...s}=X4(t,r),p=await h.detectOverflow(r,s),A=v4(o),M=P8(o),H=k2(o)==="y",{width:m,height:L}=n.floating,w,Z;A==="top"||A==="bottom"?(w=A,Z=M===(await(h.isRTL==null?void 0:h.isRTL(v.floating))?"start":"end")?"left":"right"):(Z=A,w=M==="end"?"top":"bottom");let V=L-p.top-p.bottom,x=m-p.left-p.right,z=I2(L-p[w],V),B=I2(m-p[Z],x),P=!r.middlewareData.shift,$=z,S=B;if((l=r.middlewareData.shift)!=null&&l.enabled.x&&(S=x),(i=r.middlewareData.shift)!=null&&i.enabled.y&&($=V),P&&!M){let y=X1(p.left,0),F=X1(p.right,0),U=X1(p.top,0),q=X1(p.bottom,0);H?S=m-2*(y!==0||F!==0?y+F:X1(p.left,p.right)):$=L-2*(U!==0||q!==0?U+q:X1(p.top,p.bottom))}await u({...r,availableWidth:S,availableHeight:$});let O=await h.getDimensions(v.floating);return m!==O.width||L!==O.height?{reset:{rects:!0}}:{}}}};function Hd(t){let r=k0(t),l=parseFloat(r.width)||0,i=parseFloat(r.height)||0,o=x2(t),n=o?t.offsetWidth:l,h=o?t.offsetHeight:i,v=C6(l)!==n||C6(i)!==h;return v&&(l=n,i=h),{width:l,height:i,$:v}}function Sl(t){return h0(t)?t:t.contextElement}function S8(t){let r=Sl(t);if(!x2(r))return L2(1);let l=r.getBoundingClientRect(),{width:i,height:o,$:n}=Hd(r),h=(n?C6(l.width):l.width)/i,v=(n?C6(l.height):l.height)/o;return(!h||!Number.isFinite(h))&&(h=1),(!v||!Number.isFinite(v))&&(v=1),{x:h,y:v}}var TH=L2(0);function Md(t){let r=L0(t);return!p5()||!r.visualViewport?TH:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function $H(t,r,l){return r===void 0&&(r=!1),!l||r&&l!==L0(t)?!1:r}function B6(t,r,l,i){r===void 0&&(r=!1),l===void 0&&(l=!1);let o=t.getBoundingClientRect(),n=Sl(t),h=L2(1);r&&(i?h0(i)&&(h=S8(i)):h=S8(t));let v=$H(n,l,i)?Md(n):L2(0),u=(o.left+v.x)/h.x,s=(o.top+v.y)/h.y,p=o.width/h.x,A=o.height/h.y;if(n){let M=L0(n),H=i&&h0(i)?L0(i):i,m=M,L=Na(m);for(;L&&i&&H!==m;){let w=S8(L),Z=L.getBoundingClientRect(),V=k0(L),x=Z.left+(L.clientLeft+parseFloat(V.paddingLeft))*w.x,z=Z.top+(L.clientTop+parseFloat(V.paddingTop))*w.y;u*=w.x,s*=w.y,p*=w.x,A*=w.y,u+=x,s+=z,m=L0(L),L=Na(m)}}return w6({width:p,height:A,x:u,y:s})}function Ra(t,r){let l=H5(t).scrollLeft;return r?r.left+l:B6(Z2(t)).left+l}function fd(t,r){let l=t.getBoundingClientRect(),i=l.left+r.scrollLeft-Ra(t,l),o=l.top+r.scrollTop;return{x:i,y:o}}function OH(t){let{elements:r,rect:l,offsetParent:i,strategy:o}=t,n=o==="fixed",h=Z2(i),v=r?s5(r.floating):!1;if(i===h||v&&n)return l;let u={scrollLeft:0,scrollTop:0},s=L2(1),p=L2(0),A=x2(i);if((A||!A&&!n)&&((K4(i)!=="body"||w8(h))&&(u=H5(i)),A)){let H=B6(i);s=S8(i),p.x=H.x+i.clientLeft,p.y=H.y+i.clientTop}let M=h&&!A&&!n?fd(h,u):L2(0);return{width:l.width*s.x,height:l.height*s.y,x:l.x*s.x-u.scrollLeft*s.x+p.x+M.x,y:l.y*s.y-u.scrollTop*s.y+p.y+M.y}}function FH(t){return Array.from(t.getClientRects())}function DH(t){let r=Z2(t),l=H5(t),i=t.ownerDocument.body,o=X1(r.scrollWidth,r.clientWidth,i.scrollWidth,i.clientWidth),n=X1(r.scrollHeight,r.clientHeight,i.scrollHeight,i.clientHeight),h=-l.scrollLeft+Ra(t),v=-l.scrollTop;return k0(i).direction==="rtl"&&(h+=X1(r.clientWidth,i.clientWidth)-o),{width:o,height:n,x:h,y:v}}var ud=25;function EH(t,r){let l=L0(t),i=Z2(t),o=l.visualViewport,n=i.clientWidth,h=i.clientHeight,v=0,u=0;if(o){n=o.width,h=o.height;let p=p5();(!p||p&&r==="fixed")&&(v=o.offsetLeft,u=o.offsetTop)}let s=Ra(i);if(s<=0){let p=i.ownerDocument,A=p.body,M=getComputedStyle(A),H=p.compatMode==="CSS1Compat"&&parseFloat(M.marginLeft)+parseFloat(M.marginRight)||0,m=Math.abs(i.clientWidth-A.clientWidth-H);m<=ud&&(n-=m)}else s<=ud&&(n+=s);return{width:n,height:h,x:v,y:u}}function NH(t,r){let l=B6(t,!0,r==="fixed"),i=l.top+t.clientTop,o=l.left+t.clientLeft,n=x2(t)?S8(t):L2(1),h=t.clientWidth*n.x,v=t.clientHeight*n.y,u=o*n.x,s=i*n.y;return{width:h,height:v,x:u,y:s}}function sd(t,r,l){let i;if(r==="viewport")i=EH(t,l);else if(r==="document")i=DH(Z2(t));else if(h0(r))i=NH(r,l);else{let o=Md(t);i={x:r.x-o.x,y:r.y-o.y,width:r.width,height:r.height}}return w6(i)}function Ad(t,r){let l=R2(t);return l===r||!h0(l)||Y4(l)?!1:k0(l).position==="fixed"||Ad(l,r)}function _H(t,r){let l=r.get(t);if(l)return l;let i=d4(t,[],!1).filter(v=>h0(v)&&K4(v)!=="body"),o=null,n=k0(t).position==="fixed",h=n?R2(t):t;for(;h0(h)&&!Y4(h);){let v=k0(h),u=Ea(h);!u&&v.position==="fixed"&&(o=null),(n?!u&&!o:!u&&v.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||w8(h)&&!u&&Ad(t,h))?i=i.filter(p=>p!==h):o=v,h=R2(h)}return r.set(t,i),i}function RH(t){let{element:r,boundary:l,rootBoundary:i,strategy:o}=t,h=[...l==="clippingAncestors"?s5(r)?[]:_H(r,this._c):[].concat(l),i],v=sd(r,h[0],o),u=v.top,s=v.right,p=v.bottom,A=v.left;for(let M=1;M<h.length;M++){let H=sd(r,h[M],o);u=X1(H.top,u),s=I2(H.right,s),p=I2(H.bottom,p),A=X1(H.left,A)}return{width:s-A,height:p-u,x:A,y:u}}function IH(t){let{width:r,height:l}=Hd(t);return{width:r,height:l}}function kH(t,r,l){let i=x2(r),o=Z2(r),n=l==="fixed",h=B6(t,!0,n,r),v={scrollLeft:0,scrollTop:0},u=L2(0);function s(){u.x=Ra(o)}if(i||!i&&!n)if((K4(r)!=="body"||w8(o))&&(v=H5(r)),i){let H=B6(r,!0,n,r);u.x=H.x+r.clientLeft,u.y=H.y+r.clientTop}else o&&s();n&&!i&&o&&s();let p=o&&!i&&!n?fd(o,v):L2(0),A=h.left+v.scrollLeft-u.x-p.x,M=h.top+v.scrollTop-u.y-p.y;return{x:A,y:M,width:h.width,height:h.height}}function Pl(t){return k0(t).position==="static"}function pd(t,r){if(!x2(t)||k0(t).position==="fixed")return null;if(r)return r(t);let l=t.offsetParent;return Z2(t)===l&&(l=l.ownerDocument.body),l}function Vd(t,r){let l=L0(t);if(s5(t))return l;if(!x2(t)){let o=R2(t);for(;o&&!Y4(o);){if(h0(o)&&!Pl(o))return o;o=R2(o)}return l}let i=pd(t,r);for(;i&&Xh(i)&&Pl(i);)i=pd(i,r);return i&&Y4(i)&&Pl(i)&&!Ea(i)?l:i||Qh(t)||l}var UH=async function(t){let r=this.getOffsetParent||Vd,l=this.getDimensions,i=await l(t.floating);return{reference:kH(t.reference,await r(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function GH(t){return k0(t).direction==="rtl"}var yl={convertOffsetParentRelativeRectToViewportRelativeRect:OH,getDocumentElement:Z2,getClippingRect:RH,getOffsetParent:Vd,getElementRects:UH,getClientRects:FH,getDimensions:IH,getScale:S8,isElement:h0,isRTL:GH};function md(t,r){return t.x===r.x&&t.y===r.y&&t.width===r.width&&t.height===r.height}function WH(t,r){let l=null,i,o=Z2(t);function n(){var v;clearTimeout(i),(v=l)==null||v.disconnect(),l=null}function h(v,u){v===void 0&&(v=!1),u===void 0&&(u=1),n();let s=t.getBoundingClientRect(),{left:p,top:A,width:M,height:H}=s;if(v||r(),!M||!H)return;let m=B8(A),L=B8(o.clientWidth-(p+M)),w=B8(o.clientHeight-(A+H)),Z=B8(p),x={rootMargin:-m+"px "+-L+"px "+-w+"px "+-Z+"px",threshold:X1(0,I2(1,u))||1},z=!0;function B(P){let $=P[0].intersectionRatio;if($!==u){if(!z)return h();$?h(!1,$):i=setTimeout(()=>{h(!1,1e-7)},1e3)}$===1&&!md(s,t.getBoundingClientRect())&&h(),z=!1}try{l=new IntersectionObserver(B,{...x,root:o.ownerDocument})}catch{l=new IntersectionObserver(B,x)}l.observe(t)}return h(!0),n}function Ia(t,r,l,i){i===void 0&&(i={});let{ancestorScroll:o=!0,ancestorResize:n=!0,elementResize:h=typeof ResizeObserver=="function",layoutShift:v=typeof IntersectionObserver=="function",animationFrame:u=!1}=i,s=Sl(t),p=o||n?[...s?d4(s):[],...r?d4(r):[]]:[];p.forEach(Z=>{o&&Z.addEventListener("scroll",l,{passive:!0}),n&&Z.addEventListener("resize",l)});let A=s&&v?WH(s,l):null,M=-1,H=null;h&&(H=new ResizeObserver(Z=>{let[V]=Z;V&&V.target===s&&H&&r&&(H.unobserve(r),cancelAnimationFrame(M),M=requestAnimationFrame(()=>{var x;(x=H)==null||x.observe(r)})),l()}),s&&!u&&H.observe(s),r&&H.observe(r));let m,L=u?B6(t):null;u&&w();function w(){let Z=B6(t);L&&!md(L,Z)&&l(),L=Z,m=requestAnimationFrame(w)}return l(),()=>{var Z;p.forEach(V=>{o&&V.removeEventListener("scroll",l),n&&V.removeEventListener("resize",l)}),A?.(),(Z=H)==null||Z.disconnect(),H=null,u&&cancelAnimationFrame(m)}}var y8=Bl,Zd=dd;var xd=vd,Ld=hd,zd=gd;var ka=(t,r,l)=>{let i=new Map,o={platform:yl,...l},n={...o.platform,_c:i};return cd(t,r,{...o,platform:n})};var q1=E(k(),1),wd=E(k(),1),Bd=E(T2(),1),jH=typeof document<"u",qH=function(){},Ua=jH?wd.useLayoutEffect:qH;function Ga(t,r){if(t===r)return!0;if(typeof t!=typeof r)return!1;if(typeof t=="function"&&t.toString()===r.toString())return!0;let l,i,o;if(t&&r&&typeof t=="object"){if(Array.isArray(t)){if(l=t.length,l!==r.length)return!1;for(i=l;i--!==0;)if(!Ga(t[i],r[i]))return!1;return!0}if(o=Object.keys(t),l=o.length,l!==Object.keys(r).length)return!1;for(i=l;i--!==0;)if(!{}.hasOwnProperty.call(r,o[i]))return!1;for(i=l;i--!==0;){let n=o[i];if(!(n==="_owner"&&t.$$typeof)&&!Ga(t[n],r[n]))return!1}return!0}return t!==t&&r!==r}function Pd(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Cd(t,r){let l=Pd(t);return Math.round(r*l)/l}function bl(t){let r=q1.useRef(t);return Ua(()=>{r.current=t}),r}function Sd(t){t===void 0&&(t={});let{placement:r="bottom",strategy:l="absolute",middleware:i=[],platform:o,elements:{reference:n,floating:h}={},transform:v=!0,whileElementsMounted:u,open:s}=t,[p,A]=q1.useState({x:0,y:0,strategy:l,placement:r,middlewareData:{},isPositioned:!1}),[M,H]=q1.useState(i);Ga(M,i)||H(i);let[m,L]=q1.useState(null),[w,Z]=q1.useState(null),V=q1.useCallback(X=>{X!==P.current&&(P.current=X,L(X))},[]),x=q1.useCallback(X=>{X!==$.current&&($.current=X,Z(X))},[]),z=n||m,B=h||w,P=q1.useRef(null),$=q1.useRef(null),S=q1.useRef(p),O=u!=null,y=bl(u),F=bl(o),U=bl(s),q=q1.useCallback(()=>{if(!P.current||!$.current)return;let X={placement:r,strategy:l,middleware:M};F.current&&(X.platform=F.current),ka(P.current,$.current,X).then(l1=>{let T={...l1,isPositioned:U.current!==!1};G.current&&!Ga(S.current,T)&&(S.current=T,Bd.flushSync(()=>{A(T)}))})},[M,r,l,F,U]);Ua(()=>{s===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,A(X=>({...X,isPositioned:!1})))},[s]);let G=q1.useRef(!1);Ua(()=>(G.current=!0,()=>{G.current=!1}),[]),Ua(()=>{if(z&&(P.current=z),B&&($.current=B),z&&B){if(y.current)return y.current(z,B,q);q()}},[z,B,q,y,O]);let I=q1.useMemo(()=>({reference:P,floating:$,setReference:V,setFloating:x}),[V,x]),J=q1.useMemo(()=>({reference:z,floating:B}),[z,B]),A1=q1.useMemo(()=>{let X={position:l,left:0,top:0};if(!J.floating)return X;let l1=Cd(J.floating,p.x),T=Cd(J.floating,p.y);return v?{...X,transform:"translate("+l1+"px, "+T+"px)",...Pd(J.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:l1,top:T}},[l,v,J.floating,p.x,p.y]);return q1.useMemo(()=>({...p,update:q,refs:I,elements:J,floatingStyles:A1}),[p,q,I,J,A1])}var f5=(t,r)=>{let l=Zd(t);return{name:l.name,fn:l.fn,options:[t,r]}},Tl=(t,r)=>{let l=xd(t);return{name:l.name,fn:l.fn,options:[t,r]}};var $l=(t,r)=>{let l=Ld(t);return{name:l.name,fn:l.fn,options:[t,r]}},Ol=(t,r)=>{let l=zd(t);return{name:l.name,fn:l.fn,options:[t,r]}};var Fd={...r1},KH=Fd.useInsertionEffect,YH=KH||(t=>t());function Dd(t){let r=r1.useRef(()=>{});return YH(()=>{r.current=t}),r1.useCallback(function(){for(var l=arguments.length,i=new Array(l),o=0;o<l;o++)i[o]=arguments[o];return r.current==null?void 0:r.current(...i)},[])}var XH="ArrowUp",QH="ArrowDown",JH="ArrowLeft",tM="ArrowRight";var Dl=typeof document<"u"?V5.useLayoutEffect:V5.useEffect;var aM=[JH,tM],rM=[XH,QH],az=[...aM,...rM];var yd=!1,lM=0,bd=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+lM++;function eM(){let[t,r]=r1.useState(()=>yd?bd():void 0);return Dl(()=>{t==null&&r(bd())},[]),r1.useEffect(()=>{yd=!0},[]),t}var iM=Fd.useId,oM=iM||eM;function nM(){let t=new Map;return{emit(r,l){var i;(i=t.get(r))==null||i.forEach(o=>o(l))},on(r,l){t.set(r,[...t.get(r)||[],l])},off(r,l){var i;t.set(r,((i=t.get(r))==null?void 0:i.filter(o=>o!==l))||[])}}}var cM=r1.createContext(null),hM=r1.createContext(null),dM=()=>{var t;return((t=r1.useContext(cM))==null?void 0:t.id)||null},vM=()=>r1.useContext(hM);var gM="data-floating-ui-focusable";function uM(t){let{open:r=!1,onOpenChange:l,elements:i}=t,o=oM(),n=r1.useRef({}),[h]=r1.useState(()=>nM()),v=dM()!=null,[u,s]=r1.useState(i.reference),p=Dd((H,m,L)=>{n.current.openEvent=H?m:void 0,h.emit("openchange",{open:H,event:m,reason:L,nested:v}),l?.(H,m,L)}),A=r1.useMemo(()=>({setPositionReference:s}),[]),M=r1.useMemo(()=>({reference:u||i.reference||null,floating:i.floating||null,domReference:i.reference}),[u,i.reference,i.floating]);return r1.useMemo(()=>({dataRef:n,open:r,onOpenChange:p,elements:M,events:h,floatingId:o,refs:A}),[r,p,M,h,o,A])}function Ed(t){t===void 0&&(t={});let{nodeId:r}=t,l=uM({...t,elements:{reference:null,floating:null,...t.elements}}),i=t.rootContext||l,o=i.elements,[n,h]=r1.useState(null),[v,u]=r1.useState(null),p=o?.domReference||n,A=r1.useRef(null),M=vM();Dl(()=>{p&&(A.current=p)},[p]);let H=Sd({...t,elements:{...o,...v&&{reference:v}}}),m=r1.useCallback(x=>{let z=h0(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),contextElement:x}:x;u(z),H.refs.setReference(z)},[H.refs]),L=r1.useCallback(x=>{(h0(x)||x===null)&&(A.current=x,h(x)),(h0(H.refs.reference.current)||H.refs.reference.current===null||x!==null&&!h0(x))&&H.refs.setReference(x)},[H.refs]),w=r1.useMemo(()=>({...H.refs,setReference:L,setPositionReference:m,domReference:A}),[H.refs,L,m]),Z=r1.useMemo(()=>({...H.elements,domReference:p}),[H.elements,p]),V=r1.useMemo(()=>({...H,...i,refs:w,elements:Z,nodeId:r}),[H,w,Z,r,i]);return Dl(()=>{i.dataRef.current.floatingContext=V;let x=M?.nodesRef.current.find(z=>z.id===r);x&&(x.context=V)}),r1.useMemo(()=>({...H,context:V,refs:w,elements:Z}),[H,w,Z,V])}var Td="active",$d="selected";function Fl(t,r,l){let i=new Map,o=l==="item",n=t;if(o&&t){let{[Td]:h,[$d]:v,...u}=t;n=u}return{...l==="floating"&&{tabIndex:-1,[gM]:""},...n,...r.map(h=>{let v=h?h[l]:null;return typeof v=="function"?t?v(t):null:v}).concat(t).reduce((h,v)=>(v&&Object.entries(v).forEach(u=>{let[s,p]=u;if(!(o&&[Td,$d].includes(s)))if(s.indexOf("on")===0){if(i.has(s)||i.set(s,[]),typeof p=="function"){var A;(A=i.get(s))==null||A.push(p),h[s]=function(){for(var M,H=arguments.length,m=new Array(H),L=0;L<H;L++)m[L]=arguments[L];return(M=i.get(s))==null?void 0:M.map(w=>w(...m)).find(w=>w!==void 0)}}}else h[s]=p}),h),{})}}function Nd(t){t===void 0&&(t=[]);let r=t.map(v=>v?.reference),l=t.map(v=>v?.floating),i=t.map(v=>v?.item),o=r1.useCallback(v=>Fl(v,t,"reference"),r),n=r1.useCallback(v=>Fl(v,t,"floating"),l),h=r1.useCallback(v=>Fl(v,t,"item"),i);return r1.useMemo(()=>({getReferenceProps:o,getFloatingProps:n,getItemProps:h}),[o,n,h])}function Od(t,r){return{...t,rects:{...t.rects,floating:{...t.rects.floating,height:r}}}}var _d=t=>({name:"inner",options:t,async fn(r){let{listRef:l,overflowRef:i,onFallbackChange:o,offset:n=0,index:h=0,minItemsVisible:v=4,referenceOverflowThreshold:u=0,scrollRef:s,...p}=X4(t,r),{rects:A,elements:{floating:M}}=r,H=l.current[h],m=s?.current||M,L=M.clientTop||m.clientTop,w=M.clientTop!==0,Z=m.clientTop!==0,V=M===m;if(!H)return{};let x={...r,...await f5(-H.offsetTop-M.clientTop-A.reference.height/2-H.offsetHeight/2-n).fn(r)},z=await y8(Od(x,m.scrollHeight+L+M.clientTop),p),B=await y8(x,{...p,elementContext:"reference"}),P=X1(0,z.top),$=x.y+P,y=(m.scrollHeight>m.clientHeight?F=>F:C6)(X1(0,m.scrollHeight+(w&&V||Z?L*2:0)-P-X1(0,z.bottom)));if(m.style.maxHeight=y+"px",m.scrollTop=P,o){let F=m.offsetHeight<H.offsetHeight*I2(v,l.current.length)-1||B.top>=-u||B.bottom>=-u;A5.flushSync(()=>o(F))}return i&&(i.current=await y8(Od({...x,y:$},m.offsetHeight+L+M.clientTop),p)),{y:$}}});function Rd(t,r){let{open:l,elements:i}=t,{enabled:o=!0,overflowRef:n,scrollRef:h,onChange:v}=r,u=Dd(v),s=r1.useRef(!1),p=r1.useRef(null),A=r1.useRef(null);r1.useEffect(()=>{if(!o)return;function H(L){if(L.ctrlKey||!m||n.current==null)return;let w=L.deltaY,Z=n.current.top>=-.5,V=n.current.bottom>=-.5,x=m.scrollHeight-m.clientHeight,z=w<0?-1:1,B=w<0?"max":"min";m.scrollHeight<=m.clientHeight||(!Z&&w>0||!V&&w<0?(L.preventDefault(),A5.flushSync(()=>{u(P=>P+Math[B](w,x*z))})):/firefox/i.test(td())&&(m.scrollTop+=w))}let m=h?.current||i.floating;if(l&&m)return m.addEventListener("wheel",H),requestAnimationFrame(()=>{p.current=m.scrollTop,n.current!=null&&(A.current={...n.current})}),()=>{p.current=null,A.current=null,m.removeEventListener("wheel",H)}},[o,l,i.floating,n,h,u]);let M=r1.useMemo(()=>({onKeyDown(){s.current=!0},onWheel(){s.current=!1},onPointerMove(){s.current=!1},onScroll(){let H=h?.current||i.floating;if(!(!n.current||!H||!s.current)){if(p.current!==null){let m=H.scrollTop-p.current;(n.current.bottom<-.5&&m<-1||n.current.top<-.5&&m>1)&&A5.flushSync(()=>u(L=>L+m))}requestAnimationFrame(()=>{p.current=H.scrollTop})}}}),[i.floating,u,n,h]);return r1.useMemo(()=>o?{floating:M}:{},[o,M])}var Nl=E(k(),1),F1=E(k(),1);var b8=(0,F1.createContext)({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});b8.displayName="FloatingContext";var _l=(0,F1.createContext)(null);_l.displayName="PlacementContext";function Wa(t){return(0,F1.useMemo)(()=>t?typeof t=="string"?{to:t}:t:null,[t])}function ja(){return(0,F1.useContext)(b8).setReference}function Ud(){return(0,F1.useContext)(b8).getReferenceProps}function qa(){let{getFloatingProps:t,slot:r}=(0,F1.useContext)(b8);return(0,F1.useCallback)((...l)=>Object.assign({},t(...l),{"data-anchor":r.anchor}),[t,r])}function Ka(t=null){t===!1&&(t=null),typeof t=="string"&&(t={to:t});let r=(0,F1.useContext)(_l),l=(0,F1.useMemo)(()=>t,[JSON.stringify(t,(o,n)=>{var h;return(h=n?.outerHTML)!=null?h:n})]);a1(()=>{r?.(l??null)},[r,l]);let i=(0,F1.useContext)(b8);return(0,F1.useMemo)(()=>[i.setFloating,t?i.styles:{}],[i.setFloating,t,i.styles])}var Id=4;function Ya({children:t,enabled:r=!0}){let[l,i]=(0,F1.useState)(null),[o,n]=(0,F1.useState)(0),h=(0,F1.useRef)(null),[v,u]=(0,F1.useState)(null);sM(v);let s=r&&l!==null&&v!==null,{to:p="bottom",gap:A=0,offset:M=0,padding:H=0,inner:m}=pM(l,v),[L,w="center"]=p.split(" ");a1(()=>{s&&n(0)},[s]);let{refs:Z,floatingStyles:V,context:x}=Ed({open:s,placement:L==="selection"?w==="center"?"bottom":`bottom-${w}`:w==="center"?`${L}`:`${L}-${w}`,strategy:"absolute",transform:!1,middleware:[f5({mainAxis:L==="selection"?0:A,crossAxis:M}),Tl({padding:H}),L!=="selection"&&$l({padding:H}),L==="selection"&&m?_d({...m,padding:H,overflowRef:h,offset:o,minItemsVisible:Id,referenceOverflowThreshold:H,onFallbackChange(F){var U,q;if(!F)return;let G=x.elements.floating;if(!G)return;let I=parseFloat(getComputedStyle(G).scrollPaddingBottom)||0,J=Math.min(Id,G.childElementCount),A1=0,X=0;for(let l1 of(q=(U=x.elements.floating)==null?void 0:U.childNodes)!=null?q:[])if(j1(l1)){let T=l1.offsetTop,W=T+l1.clientHeight+I,D=G.scrollTop,R=D+G.clientHeight;if(T>=D&&W<=R)J--;else{X=Math.max(0,Math.min(W,R)-Math.max(T,D)),A1=l1.clientHeight;break}}J>=1&&n(l1=>{let T=A1*J-X+I;return l1>=T?l1:T})}}):null,Ol({padding:H,apply({availableWidth:F,availableHeight:U,elements:q}){Object.assign(q.floating.style,{overflow:"auto",maxWidth:`${F}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${U}px)`})}})].filter(Boolean),whileElementsMounted:Ia}),[z=L,B=w]=x.placement.split("-");L==="selection"&&(z="selection");let P=(0,F1.useMemo)(()=>({anchor:[z,B].filter(Boolean).join(" ")}),[z,B]),$=Rd(x,{overflowRef:h,onChange:n}),{getReferenceProps:S,getFloatingProps:O}=Nd([$]),y=_(F=>{u(F),Z.setFloating(F)});return Nl.createElement(_l.Provider,{value:i},Nl.createElement(b8.Provider,{value:{setFloating:y,setReference:Z.setReference,styles:V,getReferenceProps:S,getFloatingProps:O,slot:P}},t))}function sM(t){a1(()=>{if(!t)return;let r=new MutationObserver(()=>{let l=window.getComputedStyle(t).maxHeight,i=parseFloat(l);if(isNaN(i))return;let o=parseInt(l);isNaN(o)||i!==o&&(t.style.maxHeight=`${Math.ceil(i)}px`)});return r.observe(t,{attributes:!0,attributeFilter:["style"]}),()=>{r.disconnect()}},[t])}function pM(t,r){var l,i,o;let n=El((l=t?.gap)!=null?l:"var(--anchor-gap, 0)",r),h=El((i=t?.offset)!=null?i:"var(--anchor-offset, 0)",r),v=El((o=t?.padding)!=null?o:"var(--anchor-padding, 0)",r);return{...t,gap:n,offset:h,padding:v}}function El(t,r,l=void 0){let i=W1(),o=_((u,s)=>{if(u==null)return[l,null];if(typeof u=="number")return[u,null];if(typeof u=="string"){if(!s)return[l,null];let p=kd(u,s);return[p,A=>{let M=Gd(u);{let H=M.map(m=>window.getComputedStyle(s).getPropertyValue(m));i.requestAnimationFrame(function m(){i.nextFrame(m);let L=!1;for(let[Z,V]of M.entries()){let x=window.getComputedStyle(s).getPropertyValue(V);if(H[Z]!==x){H[Z]=x,L=!0;break}}if(!L)return;let w=kd(u,s);p!==w&&(A(w),p=w)})}return i.dispose}]}return[l,null]}),n=(0,F1.useMemo)(()=>o(t,r)[0],[t,r]),[h=n,v]=(0,F1.useState)();return a1(()=>{let[u,s]=o(t,r);if(v(u),!!s)return s(v)},[t,r]),h}function Gd(t){let r=/var\((.*)\)/.exec(t);if(r){let l=r[1].indexOf(",");if(l===-1)return[r[1]];let i=r[1].slice(0,l).trim(),o=r[1].slice(l+1).trim();return o?[i,...Gd(o)]:[i]}return[]}function kd(t,r){let l=document.createElement("div");r.appendChild(l),l.style.setProperty("margin-top","0px","important"),l.style.setProperty("margin-top",t,"important");let i=parseFloat(window.getComputedStyle(l).marginTop)||0;return r.removeChild(l),i}var U2=E(k(),1);function HM({children:t,freeze:r},l){let i=T8(r,t);return(0,U2.isValidElement)(i)?(0,U2.cloneElement)(i,{ref:l}):U2.default.createElement(U2.default.Fragment,null,i)}var Wd=U2.default.forwardRef(HM);function T8(t,r){let[l,i]=(0,U2.useState)(r);return!t&&l!==r&&i(r),t?l:r}var P6=E(k(),1),Xa=(0,P6.createContext)(null);Xa.displayName="OpenClosedContext";var _1=(t=>(t[t.Open=1]="Open",t[t.Closed=2]="Closed",t[t.Closing=4]="Closing",t[t.Opening=8]="Opening",t))(_1||{});function G2(){return(0,P6.useContext)(Xa)}function $8({value:t,children:r}){return P6.default.createElement(Xa.Provider,{value:t},r)}function jd({children:t}){return P6.default.createElement(Xa.Provider,{value:null},t)}function qd(t){function r(){document.readyState!=="loading"&&(t(),document.removeEventListener("DOMContentLoaded",r))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",r),r())}var i2=[];qd(()=>{function t(r){if(!S0(r.target)||r.target===document.body||i2[0]===r.target)return;let l=r.target;l=l.closest(n5),i2.unshift(l??r.target),i2=i2.filter(i=>i!=null&&i.isConnected),i2.splice(10)}window.addEventListener("click",t,{capture:!0}),window.addEventListener("mousedown",t,{capture:!0}),window.addEventListener("focus",t,{capture:!0}),document.body.addEventListener("click",t,{capture:!0}),document.body.addEventListener("mousedown",t,{capture:!0}),document.body.addEventListener("focus",t,{capture:!0})});function MM(t){throw new Error("Unexpected object: "+t)}var i1=(t=>(t[t.First=0]="First",t[t.Previous=1]="Previous",t[t.Next=2]="Next",t[t.Last=3]="Last",t[t.Specific=4]="Specific",t[t.Nothing=5]="Nothing",t))(i1||{});function Q4(t,r){let l=r.resolveItems();if(l.length<=0)return null;let i=r.resolveActiveIndex(),o=i??-1;switch(t.focus){case 0:{for(let n=0;n<l.length;++n)if(!r.resolveDisabled(l[n],n,l))return n;return i}case 1:{o===-1&&(o=l.length);for(let n=o-1;n>=0;--n)if(!r.resolveDisabled(l[n],n,l))return n;return i}case 2:{for(let n=o+1;n<l.length;++n)if(!r.resolveDisabled(l[n],n,l))return n;return i}case 3:{for(let n=l.length-1;n>=0;--n)if(!r.resolveDisabled(l[n],n,l))return n;return i}case 4:{for(let n=0;n<l.length;++n)if(r.resolveId(l[n],n,l)===t.id)return n;return i}case 5:return null;default:MM(t)}}var S1=E(k(),1),Xd=E(T2(),1);var Qa=E(k(),1);function J4(t){let r=_(t),l=(0,Qa.useRef)(!1);(0,Qa.useEffect)(()=>(l.current=!1,()=>{l.current=!0,V6(()=>{l.current&&r()})}),[r])}var S6=E(k(),1);function fM(){let t=typeof document>"u";return"useSyncExternalStore"in S6?(r=>r.useSyncExternalStore)(S6)(()=>()=>{},()=>!1,()=>!t):!1}function g4(){let t=fM(),[r,l]=S6.useState(x0.isHandoffComplete);return r&&x0.isHandoffComplete===!1&&l(!1),S6.useEffect(()=>{r!==!0&&l(!0)},[r]),S6.useEffect(()=>x0.handoff(),[]),t?!1:r}var O8=E(k(),1),Kd=(0,O8.createContext)(!1);function Yd(){return(0,O8.useContext)(Kd)}function Rl(t){return O8.default.createElement(Kd.Provider,{value:t.force},t.children)}function AM(t){let r=Yd(),l=(0,S1.useContext)(Jd),[i,o]=(0,S1.useState)(()=>{var n;if(!r&&l!==null)return(n=l.current)!=null?n:null;if(x0.isServer)return null;let h=t?.getElementById("headlessui-portal-root");if(h)return h;if(t===null)return null;let v=t.createElement("div");return v.setAttribute("id","headlessui-portal-root"),t.body.appendChild(v)});return(0,S1.useEffect)(()=>{i!==null&&(t!=null&&t.body.contains(i)||t==null||t.body.appendChild(i))},[i,t]),(0,S1.useEffect)(()=>{r||l!==null&&o(l.current)},[l,o,r]),i}var Qd=S1.Fragment,VM=d1(function(t,r){let{ownerDocument:l=null,...i}=t,o=(0,S1.useRef)(null),n=z1(Uc(H=>{o.current=H}),r),h=e2(o.current),v=l??h,u=AM(v),s=(0,S1.useContext)(Il),p=W1(),A=g4(),M=M1();return J4(()=>{var H;u&&u.childNodes.length<=0&&((H=u.parentElement)==null||H.removeChild(u))}),!u||!A?null:(0,Xd.createPortal)(S1.default.createElement("div",{"data-headlessui-portal":"",ref:H=>{p.dispose(),s&&H&&p.add(s.register(H))}},M({ourProps:{ref:n},theirProps:i,slot:{},defaultTag:Qd,name:"Portal"})),u)});function mM(t,r){let l=z1(r),{enabled:i=!0,ownerDocument:o,...n}=t,h=M1();return i?S1.default.createElement(VM,{...n,ownerDocument:o,ref:l}):h({ourProps:{ref:l},theirProps:n,slot:{},defaultTag:Qd,name:"Portal"})}var ZM=S1.Fragment,Jd=(0,S1.createContext)(null);function xM(t,r){let{target:l,...i}=t,o={ref:z1(r)},n=M1();return S1.default.createElement(Jd.Provider,{value:l},n({ourProps:o,theirProps:i,defaultTag:ZM,name:"Popover.Group"}))}var Il=(0,S1.createContext)(null);function tv(){let t=(0,S1.useContext)(Il),r=(0,S1.useRef)([]),l=_(n=>(r.current.push(n),t&&t.register(n),()=>i(n))),i=_(n=>{let h=r.current.indexOf(n);h!==-1&&r.current.splice(h,1),t&&t.unregister(n)}),o=(0,S1.useMemo)(()=>({register:l,unregister:i,portals:r}),[l,i,r]);return[r,(0,S1.useMemo)(()=>function({children:n}){return S1.default.createElement(Il.Provider,{value:o},n)},[o])]}var LM=d1(mM),kl=d1(xM),F8=Object.assign(LM,{Group:kl});var z2={Idle:{kind:"Idle"},Tracked:t=>({kind:"Tracked",position:t}),Moved:{kind:"Moved"}};function m5(t){let r=t.getBoundingClientRect();return`${r.x},${r.y}`}function Ja(t,r,l){let i=T1();if(r.kind==="Tracked"){let n=function(){h!==m5(t)&&(i.dispose(),l())};var o=n;let{position:h}=r,v=new ResizeObserver(n);v.observe(t),i.add(()=>v.disconnect()),i.addEventListener(window,"scroll",n,{passive:!0}),i.addEventListener(window,"resize",n)}return()=>i.dispose()}var zM=Object.defineProperty,CM=(t,r,l)=>r in t?zM(t,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[r]=l,av=(t,r,l)=>(CM(t,typeof r!="symbol"?r+"":r,l),l),v1=(t=>(t[t.Open=0]="Open",t[t.Closed=1]="Closed",t))(v1||{}),b0=(t=>(t[t.Single=0]="Single",t[t.Multi=1]="Multi",t))(b0||{}),C2=(t=>(t[t.Pointer=0]="Pointer",t[t.Focus=1]="Focus",t[t.Other=2]="Other",t))(C2||{}),Gl=(t=>(t[t.OpenCombobox=0]="OpenCombobox",t[t.CloseCombobox=1]="CloseCombobox",t[t.GoToOption=2]="GoToOption",t[t.SetTyping=3]="SetTyping",t[t.RegisterOption=4]="RegisterOption",t[t.UnregisterOption=5]="UnregisterOption",t[t.DefaultToFirstOption=6]="DefaultToFirstOption",t[t.SetActivationTrigger=7]="SetActivationTrigger",t[t.UpdateVirtualConfiguration=8]="UpdateVirtualConfiguration",t[t.SetInputElement=9]="SetInputElement",t[t.SetButtonElement=10]="SetButtonElement",t[t.SetOptionsElement=11]="SetOptionsElement",t[t.MarkInputAsMoved=12]="MarkInputAsMoved",t))(Gl||{});function Ul(t,r=l=>l){let l=t.activeOptionIndex!==null?t.options[t.activeOptionIndex]:null,i=r(t.options.slice()),o=i.length>0&&i[0].dataRef.current.order!==null?i.sort((h,v)=>h.dataRef.current.order-v.dataRef.current.order):h5(i,h=>h.dataRef.current.domRef.current),n=l?o.indexOf(l):null;return n===-1&&(n=null),{options:o,activeOptionIndex:n}}var wM={1(t){var r;if((r=t.dataRef.current)!=null&&r.disabled||t.comboboxState===1)return t;let l=t.inputElement?z2.Tracked(m5(t.inputElement)):t.inputPositionState;return{...t,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,inputPositionState:l,__demoMode:!1}},0(t){var r,l;if((r=t.dataRef.current)!=null&&r.disabled||t.comboboxState===0)return t;if((l=t.dataRef.current)!=null&&l.value){let i=t.dataRef.current.calculateIndex(t.dataRef.current.value);if(i!==-1)return{...t,activeOptionIndex:i,comboboxState:0,__demoMode:!1,inputPositionState:z2.Idle}}return{...t,comboboxState:0,inputPositionState:z2.Idle,__demoMode:!1}},3(t,r){return t.isTyping===r.isTyping?t:{...t,isTyping:r.isTyping}},2(t,r){var l,i,o,n;if((l=t.dataRef.current)!=null&&l.disabled||t.optionsElement&&!((i=t.dataRef.current)!=null&&i.optionsPropsRef.current.static)&&t.comboboxState===1)return t;if(t.virtual){let{options:s,disabled:p}=t.virtual,A=r.focus===i1.Specific?r.idx:Q4(r,{resolveItems:()=>s,resolveActiveIndex:()=>{var H,m;return(m=(H=t.activeOptionIndex)!=null?H:s.findIndex(L=>!p(L)))!=null?m:null},resolveDisabled:p,resolveId(){throw new Error("Function not implemented.")}}),M=(o=r.trigger)!=null?o:2;return t.activeOptionIndex===A&&t.activationTrigger===M?t:{...t,activeOptionIndex:A,activationTrigger:M,isTyping:!1,__demoMode:!1}}let h=Ul(t);if(h.activeOptionIndex===null){let s=h.options.findIndex(p=>!p.dataRef.current.disabled);s!==-1&&(h.activeOptionIndex=s)}let v=r.focus===i1.Specific?r.idx:Q4(r,{resolveItems:()=>h.options,resolveActiveIndex:()=>h.activeOptionIndex,resolveId:s=>s.id,resolveDisabled:s=>s.dataRef.current.disabled}),u=(n=r.trigger)!=null?n:2;return t.activeOptionIndex===v&&t.activationTrigger===u?t:{...t,...h,isTyping:!1,activeOptionIndex:v,activationTrigger:u,__demoMode:!1}},4:(t,r)=>{var l,i,o,n;if((l=t.dataRef.current)!=null&&l.virtual)return{...t,options:[...t.options,r.payload]};let h=r.payload,v=Ul(t,s=>(s.push(h),s));t.activeOptionIndex===null&&(o=(i=t.dataRef.current).isSelected)!=null&&o.call(i,r.payload.dataRef.current.value)&&(v.activeOptionIndex=v.options.indexOf(h));let u={...t,...v,activationTrigger:2};return(n=t.dataRef.current)!=null&&n.__demoMode&&t.dataRef.current.value===void 0&&(u.activeOptionIndex=0),u},5:(t,r)=>{var l;if((l=t.dataRef.current)!=null&&l.virtual)return{...t,options:t.options.filter(o=>o.id!==r.id)};let i=Ul(t,o=>{let n=o.findIndex(h=>h.id===r.id);return n!==-1&&o.splice(n,1),o});return{...t,...i,activationTrigger:2}},6:(t,r)=>t.defaultToFirstOption===r.value?t:{...t,defaultToFirstOption:r.value},7:(t,r)=>t.activationTrigger===r.trigger?t:{...t,activationTrigger:r.trigger},8:(t,r)=>{var l,i;if(t.virtual===null)return{...t,virtual:{options:r.options,disabled:(l=r.disabled)!=null?l:()=>!1}};if(t.virtual.options===r.options&&t.virtual.disabled===r.disabled)return t;let o=t.activeOptionIndex;if(t.activeOptionIndex!==null){let n=r.options.indexOf(t.virtual.options[t.activeOptionIndex]);n!==-1?o=n:o=null}return{...t,activeOptionIndex:o,virtual:{options:r.options,disabled:(i=r.disabled)!=null?i:()=>!1}}},9:(t,r)=>t.inputElement===r.element?t:{...t,inputElement:r.element},10:(t,r)=>t.buttonElement===r.element?t:{...t,buttonElement:r.element},11:(t,r)=>t.optionsElement===r.element?t:{...t,optionsElement:r.element},12(t){return t.inputPositionState.kind!=="Tracked"?t:{...t,inputPositionState:z2.Moved}}},t7=class t extends G4{constructor(r){super(r),av(this,"actions",{onChange:l=>{let{onChange:i,compare:o,mode:n,value:h}=this.state.dataRef.current;return x1(n,{0:()=>i?.(l),1:()=>{let v=h.slice(),u=v.findIndex(s=>o(s,l));return u===-1?v.push(l):v.splice(u,1),i?.(v)}})},registerOption:(l,i)=>(this.send({type:4,payload:{id:l,dataRef:i}}),()=>{this.state.activeOptionIndex===this.state.dataRef.current.calculateIndex(i.current.value)&&this.send({type:6,value:!0}),this.send({type:5,id:l})}),goToOption:(l,i)=>(this.send({type:6,value:!1}),this.send({type:2,...l,trigger:i})),setIsTyping:l=>{this.send({type:3,isTyping:l})},closeCombobox:()=>{var l,i;this.send({type:1}),this.send({type:6,value:!1}),(i=(l=this.state.dataRef.current).onClose)==null||i.call(l)},openCombobox:()=>{this.send({type:0}),this.send({type:6,value:!0})},setActivationTrigger:l=>{this.send({type:7,trigger:l})},selectActiveOption:()=>{let l=this.selectors.activeOptionIndex(this.state);if(l!==null){if(this.actions.setIsTyping(!1),this.state.virtual)this.actions.onChange(this.state.virtual.options[l]);else{let{dataRef:i}=this.state.options[l];this.actions.onChange(i.current.value)}this.actions.goToOption({focus:i1.Specific,idx:l})}},setInputElement:l=>{this.send({type:9,element:l})},setButtonElement:l=>{this.send({type:10,element:l})},setOptionsElement:l=>{this.send({type:11,element:l})}}),av(this,"selectors",{activeDescendantId:l=>{var i,o;let n=this.selectors.activeOptionIndex(l);if(n!==null)return l.virtual?(o=l.options.find(h=>!h.dataRef.current.disabled&&l.dataRef.current.compare(h.dataRef.current.value,l.virtual.options[n])))==null?void 0:o.id:(i=l.options[n])==null?void 0:i.id},activeOptionIndex:l=>{if(l.defaultToFirstOption&&l.activeOptionIndex===null&&(l.virtual?l.virtual.options.length>0:l.options.length>0)){if(l.virtual){let{options:o,disabled:n}=l.virtual,h=o.findIndex(v=>{var u;return!((u=n?.(v))!=null&&u)});if(h!==-1)return h}let i=l.options.findIndex(o=>!o.dataRef.current.disabled);if(i!==-1)return i}return l.activeOptionIndex},activeOption:l=>{var i,o;let n=this.selectors.activeOptionIndex(l);return n===null?null:l.virtual?l.virtual.options[n??0]:(o=(i=l.options[n])==null?void 0:i.dataRef.current.value)!=null?o:null},isActive:(l,i,o)=>{var n;let h=this.selectors.activeOptionIndex(l);return h===null?!1:l.virtual?h===l.dataRef.current.calculateIndex(i):((n=l.options[h])==null?void 0:n.id)===o},shouldScrollIntoView:(l,i,o)=>!(l.virtual||l.__demoMode||l.comboboxState!==0||l.activationTrigger===0||!this.selectors.isActive(l,i,o)),didInputMove(l){return l.inputPositionState.kind==="Moved"}});{let l=this.state.id,i=l2.get(null);this.disposables.add(i.on(e5.Push,o=>{!i.selectors.isTop(o,l)&&this.state.comboboxState===0&&this.actions.closeCombobox()})),this.on(0,()=>i.actions.push(l)),this.on(1,()=>i.actions.pop(l))}this.disposables.group(l=>{this.on(1,i=>{i.inputElement&&(l.dispose(),l.add(Ja(i.inputElement,i.inputPositionState,()=>{this.send({type:12})})))})})}static new({id:r,virtual:l=null,__demoMode:i=!1}){var o;return new t({id:r,dataRef:{current:{}},comboboxState:i?0:1,isTyping:!1,options:[],virtual:l?{options:l.options,disabled:(o=l.disabled)!=null?o:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:i,inputPositionState:z2.Idle})}reduce(r,l){return x1(l.type,wM,r,l)}};var D8=E(k(),1);var Wl=(0,D8.createContext)(null);function E8(t){let r=(0,D8.useContext)(Wl);if(r===null){let l=new Error(`<${t} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(l,jl),l}return r}function jl({id:t,virtual:r=null,__demoMode:l=!1}){let i=(0,D8.useMemo)(()=>t7.new({id:t,virtual:r,__demoMode:l}),[]);return J4(()=>i.dispose()),i}var Z5=(0,t1.createContext)(null);Z5.displayName="ComboboxDataContext";function N8(t){let r=(0,t1.useContext)(Z5);if(r===null){let l=new Error(`<${t} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(l,N8),l}return r}var rv=(0,t1.createContext)(null);function BM(t){let r=E8("VirtualProvider"),l=N8("VirtualProvider"),{options:i}=l.virtual,o=f1(r,H=>H.optionsElement),[n,h]=(0,t1.useMemo)(()=>{let H=o;if(!H)return[0,0];let m=window.getComputedStyle(H);return[parseFloat(m.paddingBlockStart||m.paddingTop),parseFloat(m.paddingBlockEnd||m.paddingBottom)]},[o]),v=ch({enabled:i.length!==0,scrollPaddingStart:n,scrollPaddingEnd:h,count:i.length,estimateSize(){return 40},getScrollElement(){return r.state.optionsElement},overscan:12}),[u,s]=(0,t1.useState)(0);a1(()=>{s(H=>H+1)},[i]);let p=v.getVirtualItems(),A=f1(r,H=>H.activationTrigger===C2.Pointer),M=f1(r,r.selectors.activeOptionIndex);return p.length===0?null:t1.default.createElement(rv.Provider,{value:v},t1.default.createElement("div",{style:{position:"relative",width:"100%",height:`${v.getTotalSize()}px`},ref:H=>{H&&(A||M!==null&&i.length>M&&v.scrollToIndex(M))}},p.map(H=>{var m;return t1.default.createElement(t1.Fragment,{key:H.key},t1.default.cloneElement((m=t.children)==null?void 0:m.call(t,{...t.slot,option:i[H.index]}),{key:`${u}-${H.key}`,"data-index":H.index,"aria-setsize":i.length,"aria-posinset":H.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${H.start}px)`,overflowAnchor:"none"}}))})))}var PM=t1.Fragment;function SM(t,r){let l=(0,O1.useId)(),i=Q0(),{value:o,defaultValue:n,onChange:h,form:v,name:u,by:s,invalid:p=!1,disabled:A=i||!1,onClose:M,__demoMode:H=!1,multiple:m=!1,immediate:L=!1,virtual:w=null,nullable:Z,...V}=t,x=M8(n),[z=m?[]:void 0,B]=H8(o,h,x),P=jl({id:l,virtual:w,__demoMode:H}),$=(0,t1.useRef)({static:!1,hold:!1}),S=za(s),O=_(Q=>w?s===null?w.options.indexOf(Q):w.options.findIndex(r0=>S(r0,Q)):P.state.options.findIndex(r0=>S(r0.dataRef.current.value,Q))),y=(0,t1.useCallback)(Q=>x1(q.mode,{[b0.Multi]:()=>z.some(r0=>S(r0,Q)),[b0.Single]:()=>S(z,Q)}),[z]),F=f1(P,Q=>Q.virtual),U=_(()=>M?.()),q=(0,t1.useMemo)(()=>({__demoMode:H,immediate:L,optionsPropsRef:$,value:z,defaultValue:x,disabled:A,invalid:p,mode:m?b0.Multi:b0.Single,virtual:w?F:null,onChange:B,isSelected:y,calculateIndex:O,compare:S,onClose:U}),[H,L,$,z,x,A,p,m,w,F,B,y,O,S,U]);a1(()=>{var Q;w&&P.send({type:Gl.UpdateVirtualConfiguration,options:w.options,disabled:(Q=w.disabled)!=null?Q:null})},[w,w?.options,w?.disabled]),a1(()=>{P.state.dataRef.current=q},[q]);let[G,I,J,A1]=f1(P,Q=>[Q.comboboxState,Q.buttonElement,Q.inputElement,Q.optionsElement]),X=l2.get(null),l1=f1(X,(0,t1.useCallback)(Q=>X.selectors.isTop(Q,l),[X,l]));Z8(l1,[I,J,A1],()=>P.actions.closeCombobox());let T=f1(P,P.selectors.activeOptionIndex),W=f1(P,P.selectors.activeOption),D=P1({open:G===v1.Open,disabled:A,invalid:p,activeIndex:T,activeOption:W,value:z}),[R,c1]=Za(),Z1=r===null?{}:{ref:r},j=(0,t1.useCallback)(()=>{if(x!==void 0)return B?.(x)},[B,x]),m1=M1();return t1.default.createElement(c1,{value:R,props:{htmlFor:J?.id},slot:{open:G===v1.Open,disabled:A}},t1.default.createElement(Ya,null,t1.default.createElement(Z5.Provider,{value:q},t1.default.createElement(Wl.Provider,{value:P},t1.default.createElement($8,{value:x1(G,{[v1.Open]:_1.Open,[v1.Closed]:_1.Closed})},u!=null&&t1.default.createElement(f8,{disabled:A,data:z!=null?{[u]:z}:{},form:v,onReset:j}),m1({ourProps:Z1,theirProps:V,slot:D,defaultTag:PM,name:"Combobox"}))))))}var yM="input";function bM(t,r){var l,i;let o=E8("Combobox.Input"),n=N8("Combobox.Input"),h=(0,O1.useId)(),v=E2(),{id:u=v||`headlessui-combobox-input-${h}`,onChange:s,displayValue:p,disabled:A=n.disabled||!1,autoFocus:M=!1,type:H="text",...m}=t,L=(0,t1.useRef)(null),w=z1(L,r,ja(),o.actions.setInputElement),[Z,V]=f1(o,D=>[D.comboboxState,D.isTyping]),x=W1(),z=_(()=>{o.actions.onChange(null),o.state.optionsElement&&(o.state.optionsElement.scrollTop=0),o.actions.goToOption({focus:i1.Nothing})}),B=(0,t1.useMemo)(()=>{var D;return typeof p=="function"&&n.value!==void 0?(D=p(n.value))!=null?D:"":typeof n.value=="string"?n.value:""},[n.value,p]);L6(([D,R],[c1,Z1])=>{if(o.state.isTyping)return;let j=L.current;j&&((Z1===v1.Open&&R===v1.Closed||D!==c1)&&(j.value=D),requestAnimationFrame(()=>{if(o.state.isTyping||!j||_4(j))return;let{selectionStart:m1,selectionEnd:Q}=j;Math.abs((Q??0)-(m1??0))===0&&m1===0&&j.setSelectionRange(j.value.length,j.value.length)}))},[B,Z,V]),L6(([D],[R])=>{if(D===v1.Open&&R===v1.Closed){if(o.state.isTyping)return;let c1=L.current;if(!c1)return;let Z1=c1.value,{selectionStart:j,selectionEnd:m1,selectionDirection:Q}=c1;c1.value="",c1.value=Z1,Q!==null?c1.setSelectionRange(j,m1,Q):c1.setSelectionRange(j,m1)}},[Z]);let P=(0,t1.useRef)(!1),$=_(()=>{P.current=!0}),S=_(()=>{x.nextFrame(()=>{P.current=!1})}),O=_(D=>{switch(o.actions.setIsTyping(!0),D.key){case h1.Enter:if(o.state.comboboxState!==v1.Open||P.current)return;if(D.preventDefault(),D.stopPropagation(),o.selectors.activeOptionIndex(o.state)===null){o.actions.closeCombobox();return}o.actions.selectActiveOption(),n.mode===b0.Single&&o.actions.closeCombobox();break;case h1.ArrowDown:return D.preventDefault(),D.stopPropagation(),x1(o.state.comboboxState,{[v1.Open]:()=>o.actions.goToOption({focus:i1.Next}),[v1.Closed]:()=>o.actions.openCombobox()});case h1.ArrowUp:return D.preventDefault(),D.stopPropagation(),x1(o.state.comboboxState,{[v1.Open]:()=>o.actions.goToOption({focus:i1.Previous}),[v1.Closed]:()=>{(0,y6.flushSync)(()=>o.actions.openCombobox()),n.value||o.actions.goToOption({focus:i1.Last})}});case h1.Home:if(o.state.comboboxState===v1.Closed||D.shiftKey)break;return D.preventDefault(),D.stopPropagation(),o.actions.goToOption({focus:i1.First});case h1.PageUp:return D.preventDefault(),D.stopPropagation(),o.actions.goToOption({focus:i1.First});case h1.End:if(o.state.comboboxState===v1.Closed||D.shiftKey)break;return D.preventDefault(),D.stopPropagation(),o.actions.goToOption({focus:i1.Last});case h1.PageDown:return D.preventDefault(),D.stopPropagation(),o.actions.goToOption({focus:i1.Last});case h1.Escape:return o.state.comboboxState!==v1.Open?void 0:(D.preventDefault(),o.state.optionsElement&&!n.optionsPropsRef.current.static&&D.stopPropagation(),n.mode===b0.Single&&n.value===null&&z(),o.actions.closeCombobox());case h1.Tab:if(o.actions.setIsTyping(!1),o.state.comboboxState!==v1.Open)return;n.mode===b0.Single&&o.state.activationTrigger!==C2.Focus&&o.actions.selectActiveOption(),o.actions.closeCombobox();break}}),y=_(D=>{s?.(D),n.mode===b0.Single&&D.target.value===""&&z(),o.actions.openCombobox()}),F=_(D=>{var R,c1,Z1;let j=(R=D.relatedTarget)!=null?R:i2.find(m1=>m1!==D.currentTarget);if(!((c1=o.state.optionsElement)!=null&&c1.contains(j))&&!((Z1=o.state.buttonElement)!=null&&Z1.contains(j))&&o.state.comboboxState===v1.Open)return D.preventDefault(),n.mode===b0.Single&&n.value===null&&z(),o.actions.closeCombobox()}),U=_(D=>{var R,c1,Z1;let j=(R=D.relatedTarget)!=null?R:i2.find(m1=>m1!==D.currentTarget);(c1=o.state.buttonElement)!=null&&c1.contains(j)||(Z1=o.state.optionsElement)!=null&&Z1.contains(j)||n.disabled||n.immediate&&o.state.comboboxState!==v1.Open&&x.microTask(()=>{(0,y6.flushSync)(()=>o.actions.openCombobox()),o.actions.setActivationTrigger(C2.Focus)})}),q=V2(),G=I4(),{isFocused:I,focusProps:J}=F2({autoFocus:M}),{isHovered:A1,hoverProps:X}=O2({isDisabled:A}),l1=f1(o,D=>D.optionsElement),T=P1({open:Z===v1.Open,disabled:A,invalid:n.invalid,hover:A1,focus:I,autofocus:M}),W=f2({ref:w,id:u,role:"combobox",type:H,"aria-controls":l1?.id,"aria-expanded":Z===v1.Open,"aria-activedescendant":f1(o,o.selectors.activeDescendantId),"aria-labelledby":q,"aria-describedby":G,"aria-autocomplete":"list",defaultValue:(i=(l=t.defaultValue)!=null?l:n.defaultValue!==void 0?p?.(n.defaultValue):null)!=null?i:n.defaultValue,disabled:A||void 0,autoFocus:M,onCompositionStart:$,onCompositionEnd:S,onKeyDown:O,onChange:y,onFocus:U,onBlur:F},J,X);return M1()({ourProps:W,theirProps:m,slot:T,defaultTag:yM,name:"Combobox.Input"})}var TM="button";function $M(t,r){let l=E8("Combobox.Button"),i=N8("Combobox.Button"),[o,n]=(0,t1.useState)(null),h=z1(r,n,l.actions.setButtonElement),v=(0,O1.useId)(),{id:u=`headlessui-combobox-button-${v}`,disabled:s=i.disabled||!1,autoFocus:p=!1,...A}=t,[M,H,m]=f1(l,U=>[U.comboboxState,U.inputElement,U.optionsElement]),L=Zl(H),w=M===v1.Open;Ta(w,{trigger:o,action:(0,t1.useCallback)(U=>{if(o!=null&&o.contains(U.target))return m2.Ignore;if(H!=null&&H.contains(U.target))return m2.Ignore;let q=U.target.closest('[role="option"]:not([data-disabled])');return j1(q)?m2.Select(q):m!=null&&m.contains(U.target)?m2.Ignore:m2.Close},[o,H,m]),close:l.actions.closeCombobox,select:l.actions.selectActiveOption});let Z=_(U=>{switch(U.key){case h1.Space:case h1.Enter:U.preventDefault(),U.stopPropagation(),l.state.comboboxState===v1.Closed&&(0,y6.flushSync)(()=>l.actions.openCombobox()),L();return;case h1.ArrowDown:U.preventDefault(),U.stopPropagation(),l.state.comboboxState===v1.Closed&&((0,y6.flushSync)(()=>l.actions.openCombobox()),l.state.dataRef.current.value||l.actions.goToOption({focus:i1.First})),L();return;case h1.ArrowUp:U.preventDefault(),U.stopPropagation(),l.state.comboboxState===v1.Closed&&((0,y6.flushSync)(()=>l.actions.openCombobox()),l.state.dataRef.current.value||l.actions.goToOption({focus:i1.Last})),L();return;case h1.Escape:if(l.state.comboboxState!==v1.Open)return;U.preventDefault(),l.state.optionsElement&&!i.optionsPropsRef.current.static&&U.stopPropagation(),(0,y6.flushSync)(()=>l.actions.closeCombobox()),L();return;default:return}}),V=Ca(()=>{l.state.comboboxState===v1.Open?l.actions.closeCombobox():l.actions.openCombobox(),L()}),x=V2([u]),{isFocusVisible:z,focusProps:B}=F2({autoFocus:p}),{isHovered:P,hoverProps:$}=O2({isDisabled:s}),{pressed:S,pressProps:O}=u8({disabled:s}),y=P1({open:M===v1.Open,active:S||M===v1.Open,disabled:s,invalid:i.invalid,value:i.value,hover:P,focus:z}),F=f2({ref:h,id:u,type:$a(t,o),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":m?.id,"aria-expanded":M===v1.Open,"aria-labelledby":x,disabled:s||void 0,autoFocus:p,onKeyDown:Z},V,B,$,O);return M1()({ourProps:F,theirProps:A,slot:y,defaultTag:TM,name:"Combobox.Button"})}var OM="div",FM=J0.RenderStrategy|J0.Static;function DM(t,r){var l,i,o;let n=(0,O1.useId)(),{id:h=`headlessui-combobox-options-${n}`,hold:v=!1,anchor:u,portal:s=!1,modal:p=!0,transition:A=!1,...M}=t,H=E8("Combobox.Options"),m=N8("Combobox.Options"),L=Wa(u);L&&(s=!0);let[w,Z]=Ka(L),[V,x]=(0,t1.useState)(null),z=qa(),B=z1(r,L?w:null,H.actions.setOptionsElement,x),[P,$,S,O,y]=f1(H,Y=>[Y.comboboxState,Y.inputElement,Y.buttonElement,Y.optionsElement,Y.activationTrigger]),F=e2($||S),U=e2(O),q=G2(),[G,I]=C8(A,V,q!==null?(q&_1.Open)===_1.Open:P===v1.Open);m8(G,$,H.actions.closeCombobox);let J=m.__demoMode?!1:p&&P===v1.Open;L8(J,U);let A1=m.__demoMode?!1:p&&P===v1.Open;V8(A1,{allowed:(0,t1.useCallback)(()=>[$,S,O],[$,S,O])});let X=f1(H,H.selectors.didInputMove)?!1:G;a1(()=>{var Y;m.optionsPropsRef.current.static=(Y=t.static)!=null?Y:!1},[m.optionsPropsRef,t.static]),a1(()=>{m.optionsPropsRef.current.hold=v},[m.optionsPropsRef,v]),qh(P===v1.Open,{container:O,accept(Y){return Y.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:Y.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(Y){Y.setAttribute("role","none")}});let l1=V2([S?.id]),T=P1({open:P===v1.Open,option:void 0}),W=_(()=>{H.actions.setActivationTrigger(C2.Pointer)}),D=_(Y=>{Y.preventDefault(),H.actions.setActivationTrigger(C2.Pointer)}),R=f2(L?z():{},{"aria-labelledby":l1,role:"listbox","aria-multiselectable":m.mode===b0.Multi?!0:void 0,id:h,ref:B,style:{...M.style,...Z,"--input-width":t5(G,$,!0).width,"--button-width":t5(G,S,!0).width},onWheel:y===C2.Pointer?void 0:W,onMouseDown:D,...z8(I)}),c1=G&&P===v1.Closed&&!t.static,Z1=T8(c1,(l=m.virtual)==null?void 0:l.options),j=T8(c1,m.value),m1=(0,t1.useCallback)(Y=>m.compare(j,Y),[m.compare,j]),Q=(0,t1.useMemo)(()=>{if(!m.virtual)return m;if(Z1===void 0)throw new Error("Missing `options` in virtual mode");return Z1!==m.virtual.options?{...m,virtual:{...m.virtual,options:Z1}}:m},[m,Z1,(i=m.virtual)==null?void 0:i.options]);m.virtual&&Object.assign(M,{children:t1.default.createElement(Z5.Provider,{value:Q},t1.default.createElement(BM,{slot:T},M.children))});let r0=M1(),m7=(0,t1.useMemo)(()=>m.mode===b0.Multi?m:{...m,isSelected:m1},[m,m1]);return t1.default.createElement(F8,{enabled:s?t.static||G:!1,ownerDocument:F},t1.default.createElement(Z5.Provider,{value:m7},r0({ourProps:R,theirProps:{...M,children:t1.default.createElement(Wd,{freeze:c1},typeof M.children=="function"?(o=M.children)==null?void 0:o.call(M,T):M.children)},slot:T,defaultTag:OM,features:FM,visible:X,name:"Combobox.Options"})))}var EM="div";function NM(t,r){var l,i,o;let n=N8("Combobox.Option"),h=E8("Combobox.Option"),v=(0,O1.useId)(),{id:u=`headlessui-combobox-option-${v}`,value:s,disabled:p=(o=(i=(l=n.virtual)==null?void 0:l.disabled)==null?void 0:i.call(l,s))!=null?o:!1,order:A=null,...M}=t,[H]=f1(h,I=>[I.inputElement]),m=Zl(H),L=f1(h,(0,t1.useCallback)(I=>h.selectors.isActive(I,s,u),[s,u])),w=n.isSelected(s),Z=(0,t1.useRef)(null),V=t0({disabled:p,value:s,domRef:Z,order:A}),x=(0,t1.useContext)(rv),z=z1(r,Z,x?x.measureElement:null),B=_(()=>{h.actions.setIsTyping(!1),h.actions.onChange(s)});a1(()=>h.actions.registerOption(u,V),[V,u]);let P=f1(h,(0,t1.useCallback)(I=>h.selectors.shouldScrollIntoView(I,s,u),[s,u]));a1(()=>{if(P)return T1().requestAnimationFrame(()=>{var I,J;(J=(I=Z.current)==null?void 0:I.scrollIntoView)==null||J.call(I,{block:"nearest"})})},[P,Z]);let $=_(I=>{I.preventDefault(),I.button===a5.Left&&(p||(B(),d5()||requestAnimationFrame(()=>m()),n.mode===b0.Single&&h.actions.closeCombobox()))}),S=_(()=>{if(p)return h.actions.goToOption({focus:i1.Nothing});let I=n.calculateIndex(s);h.actions.goToOption({focus:i1.Specific,idx:I})}),O=Oa(),y=_(I=>O.update(I)),F=_(I=>{if(!O.wasMoved(I)||p||L&&h.state.activationTrigger===C2.Pointer)return;let J=n.calculateIndex(s);h.actions.goToOption({focus:i1.Specific,idx:J},C2.Pointer)}),U=_(I=>{O.wasMoved(I)&&(p||L&&(n.optionsPropsRef.current.hold||h.state.activationTrigger===C2.Pointer&&h.actions.goToOption({focus:i1.Nothing})))}),q=P1({active:L,focus:L,selected:w,disabled:p}),G={id:u,ref:z,role:"option",tabIndex:p===!0?void 0:-1,"aria-disabled":p===!0?!0:void 0,"aria-selected":w,disabled:void 0,onMouseDown:$,onFocus:S,onPointerEnter:y,onMouseEnter:y,onPointerMove:F,onMouseMove:F,onPointerLeave:U,onMouseLeave:U};return M1()({ourProps:G,theirProps:M,slot:q,defaultTag:EM,name:"Combobox.Option"})}var _M=d1(SM),ql=d1($M),Kl=d1(bM),RM=xa,Yl=d1(DM),Xl=d1(NM),lv=Object.assign(_M,{Input:Kl,Button:ql,Label:RM,Options:Yl,Option:Xl});var g1=E(k(),1);function ev(t,r=typeof document<"u"?document.defaultView:null,l){let i=h4(t,"escape");x8(r,"keydown",o=>{i&&(o.defaultPrevented||o.key===h1.Escape&&l(o))})}var Ql=E(k(),1);function iv(){var t;let[r]=(0,Ql.useState)(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[l,i]=(0,Ql.useState)((t=r?.matches)!=null?t:!1);return a1(()=>{if(!r)return;function o(n){i(n.matches)}return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[r]),l}var u4=E(k(),1);function ov({defaultContainers:t=[],portals:r,mainTreeNode:l}={}){let i=_(()=>{var o,n;let h=R0(l),v=[];for(let u of t)u!==null&&(A2(u)?v.push(u):"current"in u&&A2(u.current)&&v.push(u.current));if(r!=null&&r.current)for(let u of r.current)v.push(u);for(let u of(o=h?.querySelectorAll("html > *, body > *"))!=null?o:[])u!==document.body&&u!==document.head&&A2(u)&&u.id!=="headlessui-portal-root"&&(l&&(u.contains(l)||u.contains((n=l?.getRootNode())==null?void 0:n.host))||v.some(s=>u.contains(s))||v.push(u));return v});return{resolveContainers:i,contains:_(o=>i().some(n=>n.contains(o)))}}var nv=(0,u4.createContext)(null);function Jl({children:t,node:r}){let[l,i]=(0,u4.useState)(null),o=te(r??l);return u4.default.createElement(nv.Provider,{value:o},t,o===null&&u4.default.createElement(R4,{features:c4.Hidden,ref:n=>{var h,v;if(n){for(let u of(v=(h=R0(n))==null?void 0:h.querySelectorAll("html > *, body > *"))!=null?v:[])if(u!==document.body&&u!==document.head&&A2(u)&&u!=null&&u.contains(n)){i(u);break}}}}))}function te(t=null){var r;return(r=(0,u4.useContext)(nv))!=null?r:t}var W2=E(k(),1);var cv=E(k(),1);function x5(){let t=(0,cv.useRef)(!1);return a1(()=>(t.current=!0,()=>{t.current=!1}),[]),t}var hv=E(k(),1);var _8=(t=>(t[t.Forwards=0]="Forwards",t[t.Backwards=1]="Backwards",t))(_8||{});function dv(){let t=(0,hv.useRef)(0);return ya(!0,"keydown",r=>{r.key==="Tab"&&(t.current=r.shiftKey?1:0)},!0),t}function vv(t){if(!t)return new Set;if(typeof t=="function")return new Set(t());let r=new Set;for(let l of t.current)A2(l.current)&&r.add(l.current);return r}var IM="div",t6=(t=>(t[t.None=0]="None",t[t.InitialFocus=1]="InitialFocus",t[t.TabLock=2]="TabLock",t[t.FocusLock=4]="FocusLock",t[t.RestoreFocus=8]="RestoreFocus",t[t.AutoFocus=16]="AutoFocus",t))(t6||{});function kM(t,r){let l=(0,W2.useRef)(null),i=z1(l,r),{initialFocus:o,initialFocusFallback:n,containers:h,features:v=15,...u}=t;g4()||(v=0);let s=e2(l.current);WM(v,{ownerDocument:s});let p=jM(v,{ownerDocument:s,container:l,initialFocus:o,initialFocusFallback:n});qM(v,{ownerDocument:s,container:l,containers:h,previousActiveElement:p});let A=dv(),M=_(V=>{if(!j1(l.current))return;let x=l.current;(z=>z())(()=>{x1(A.current,{[_8.Forwards]:()=>{x6(x,I0.First,{skipElements:[V.relatedTarget,n]})},[_8.Backwards]:()=>{x6(x,I0.Last,{skipElements:[V.relatedTarget,n]})}})})}),H=h4(!!(v&2),"focus-trap#tab-lock"),m=W1(),L=(0,W2.useRef)(!1),w={ref:i,onKeyDown(V){V.key=="Tab"&&(L.current=!0,m.requestAnimationFrame(()=>{L.current=!1}))},onBlur(V){if(!(v&4))return;let x=vv(h);j1(l.current)&&x.add(l.current);let z=V.relatedTarget;S0(z)&&z.dataset.headlessuiFocusGuard!=="true"&&(uv(x,z)||(L.current?x6(l.current,x1(A.current,{[_8.Forwards]:()=>I0.Next,[_8.Backwards]:()=>I0.Previous})|I0.WrapAround,{relativeTo:V.target}):S0(V.target)&&_2(V.target)))}},Z=M1();return W2.default.createElement(W2.default.Fragment,null,H&&W2.default.createElement(R4,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:M,features:c4.Focusable}),Z({ourProps:w,theirProps:u,defaultTag:IM,name:"FocusTrap"}),H&&W2.default.createElement(R4,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:M,features:c4.Focusable}))}var UM=d1(kM),gv=Object.assign(UM,{features:t6});function GM(t=!0){let r=(0,W2.useRef)(i2.slice());return L6(([l],[i])=>{i===!0&&l===!1&&V6(()=>{r.current.splice(0)}),i===!1&&l===!0&&(r.current=i2.slice())},[t,i2,r]),_(()=>{var l;return(l=r.current.find(i=>i!=null&&i.isConnected))!=null?l:null})}function WM(t,{ownerDocument:r}){let l=!!(t&8),i=GM(l);L6(()=>{l||_4(r?.body)&&_2(i())},[l]),J4(()=>{l&&_2(i())})}function jM(t,{ownerDocument:r,container:l,initialFocus:i,initialFocusFallback:o}){let n=(0,W2.useRef)(null),h=h4(!!(t&1),"focus-trap#initial-focus"),v=x5();return L6(()=>{if(t===0)return;if(!h){o!=null&&o.current&&_2(o.current);return}let u=l.current;u&&V6(()=>{if(!v.current)return;let s=r?.activeElement;if(i!=null&&i.current){if(i?.current===s){n.current=s;return}}else if(u.contains(s)){n.current=s;return}if(i!=null&&i.current)_2(i.current);else{if(t&16){if(x6(u,I0.First|I0.AutoFocus)!==Pa.Error)return}else if(x6(u,I0.First)!==Pa.Error)return;if(o!=null&&o.current&&(_2(o.current),r?.activeElement===o.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}n.current=r?.activeElement})},[o,h,t]),n}function qM(t,{ownerDocument:r,container:l,containers:i,previousActiveElement:o}){let n=x5(),h=!!(t&4);x8(r?.defaultView,"focus",v=>{if(!h||!n.current)return;let u=vv(i);j1(l.current)&&u.add(l.current);let s=o.current;if(!s)return;let p=v.target;j1(p)?uv(u,p)?(o.current=p,_2(p)):(v.preventDefault(),v.stopPropagation(),_2(s)):_2(o.current)},!0)}function uv(t,r){for(let l of t)if(l.contains(r))return!0;return!1}var n1=E(k(),1);function sv(t){var r;return!!(t.enter||t.enterFrom||t.enterTo||t.leave||t.leaveFrom||t.leaveTo)||!s8((r=t.as)!=null?r:Hv)||n1.default.Children.count(t.children)===1}var a7=(0,n1.createContext)(null);a7.displayName="TransitionContext";var KM=(t=>(t.Visible="visible",t.Hidden="hidden",t))(KM||{});function YM(){let t=(0,n1.useContext)(a7);if(t===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return t}function XM(){let t=(0,n1.useContext)(r7);if(t===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return t}var r7=(0,n1.createContext)(null);r7.displayName="NestingContext";function l7(t){return"children"in t?l7(t.children):t.current.filter(({el:r})=>r.current!==null).filter(({state:r})=>r==="visible").length>0}function pv(t,r){let l=t0(t),i=(0,n1.useRef)([]),o=x5(),n=W1(),h=_((H,m=n4.Hidden)=>{let L=i.current.findIndex(({el:w})=>w===H);L!==-1&&(x1(m,{[n4.Unmount](){i.current.splice(L,1)},[n4.Hidden](){i.current[L].state="hidden"}}),n.microTask(()=>{var w;!l7(i)&&o.current&&((w=l.current)==null||w.call(l))}))}),v=_(H=>{let m=i.current.find(({el:L})=>L===H);return m?m.state!=="visible"&&(m.state="visible"):i.current.push({el:H,state:"visible"}),()=>h(H,n4.Unmount)}),u=(0,n1.useRef)([]),s=(0,n1.useRef)(Promise.resolve()),p=(0,n1.useRef)({enter:[],leave:[]}),A=_((H,m,L)=>{u.current.splice(0),r&&(r.chains.current[m]=r.chains.current[m].filter(([w])=>w!==H)),r?.chains.current[m].push([H,new Promise(w=>{u.current.push(w)})]),r?.chains.current[m].push([H,new Promise(w=>{Promise.all(p.current[m].map(([Z,V])=>V)).then(()=>w())})]),m==="enter"?s.current=s.current.then(()=>r?.wait.current).then(()=>L(m)):L(m)}),M=_((H,m,L)=>{Promise.all(p.current[m].splice(0).map(([w,Z])=>Z)).then(()=>{var w;(w=u.current.shift())==null||w()}).then(()=>L(m))});return(0,n1.useMemo)(()=>({children:i,register:v,unregister:h,onStart:A,onStop:M,wait:s,chains:p}),[v,h,i,A,M,p,s])}var Hv=n1.Fragment,Mv=J0.RenderStrategy;function QM(t,r){var l,i;let{transition:o=!0,beforeEnter:n,afterEnter:h,beforeLeave:v,afterLeave:u,enter:s,enterFrom:p,enterTo:A,entered:M,leave:H,leaveFrom:m,leaveTo:L,...w}=t,[Z,V]=(0,n1.useState)(null),x=(0,n1.useRef)(null),z=sv(t),B=z1(...z?[x,r,V]:r===null?[]:[r]),P=(l=w.unmount)==null||l?n4.Unmount:n4.Hidden,{show:$,appear:S,initial:O}=YM(),[y,F]=(0,n1.useState)($?"visible":"hidden"),U=XM(),{register:q,unregister:G}=U;a1(()=>q(x),[q,x]),a1(()=>{if(P===n4.Hidden&&x.current){if($&&y!=="visible"){F("visible");return}return x1(y,{hidden:()=>G(x),visible:()=>q(x)})}},[y,x,q,G,$,P]);let I=g4();a1(()=>{if(z&&I&&y==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,y,I,z]);let J=O&&!S,A1=S&&$&&O,X=(0,n1.useRef)(!1),l1=pv(()=>{X.current||(F("hidden"),G(x))},U),T=_(m1=>{X.current=!0;let Q=m1?"enter":"leave";l1.onStart(x,Q,r0=>{r0==="enter"?n?.():r0==="leave"&&v?.()})}),W=_(m1=>{let Q=m1?"enter":"leave";X.current=!1,l1.onStop(x,Q,r0=>{r0==="enter"?h?.():r0==="leave"&&u?.()}),Q==="leave"&&!l7(l1)&&(F("hidden"),G(x))});(0,n1.useEffect)(()=>{z&&o||(T($),W($))},[$,z,o]);let D=!(!o||!z||!I||J),[,R]=C8(D,Z,$,{start:T,end:W}),c1=D2({ref:B,className:((i=Yt(w.className,A1&&s,A1&&p,R.enter&&s,R.enter&&R.closed&&p,R.enter&&!R.closed&&A,R.leave&&H,R.leave&&!R.closed&&m,R.leave&&R.closed&&L,!R.transition&&$&&M))==null?void 0:i.trim())||void 0,...z8(R)}),Z1=0;y==="visible"&&(Z1|=_1.Open),y==="hidden"&&(Z1|=_1.Closed),$&&y==="hidden"&&(Z1|=_1.Opening),!$&&y==="visible"&&(Z1|=_1.Closing);let j=M1();return n1.default.createElement(r7.Provider,{value:l1},n1.default.createElement($8,{value:Z1},j({ourProps:c1,theirProps:w,defaultTag:Hv,features:Mv,visible:y==="visible",name:"Transition.Child"})))}function JM(t,r){let{show:l,appear:i=!1,unmount:o=!0,...n}=t,h=(0,n1.useRef)(null),v=sv(t),u=z1(...v?[h,r]:r===null?[]:[r]);g4();let s=G2();if(l===void 0&&s!==null&&(l=(s&_1.Open)===_1.Open),l===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[p,A]=(0,n1.useState)(l?"visible":"hidden"),M=pv(()=>{l||A("hidden")}),[H,m]=(0,n1.useState)(!0),L=(0,n1.useRef)([l]);a1(()=>{H!==!1&&L.current[L.current.length-1]!==l&&(L.current.push(l),m(!1))},[L,l]);let w=(0,n1.useMemo)(()=>({show:l,appear:i,initial:H}),[l,i,H]);a1(()=>{l?A("visible"):!l7(M)&&h.current!==null&&A("hidden")},[l,M]);let Z={unmount:o},V=_(()=>{var B;H&&m(!1),(B=t.beforeEnter)==null||B.call(t)}),x=_(()=>{var B;H&&m(!1),(B=t.beforeLeave)==null||B.call(t)}),z=M1();return n1.default.createElement(r7.Provider,{value:M},n1.default.createElement(a7.Provider,{value:w},z({ourProps:{...Z,as:n1.Fragment,children:n1.default.createElement(fv,{ref:u,...Z,...n,beforeEnter:V,beforeLeave:x})},theirProps:{},defaultTag:n1.Fragment,features:Mv,visible:p==="visible",name:"Transition"})))}function tf(t,r){let l=(0,n1.useContext)(a7)!==null,i=G2()!==null;return n1.default.createElement(n1.default.Fragment,null,!l&&i?n1.default.createElement(ae,{ref:r,...t}):n1.default.createElement(fv,{ref:r,...t}))}var ae=d1(JM),fv=d1(QM),e7=d1(tf),Av=Object.assign(ae,{Child:e7,Root:ae});var af=(t=>(t[t.Open=0]="Open",t[t.Closed=1]="Closed",t))(af||{}),rf=(t=>(t[t.SetTitleId=0]="SetTitleId",t))(rf||{}),lf={0(t,r){return t.titleId===r.id?t:{...t,titleId:r.id}}},re=(0,g1.createContext)(null);re.displayName="DialogContext";function i7(t){let r=(0,g1.useContext)(re);if(r===null){let l=new Error(`<${t} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(l,i7),l}return r}function ef(t,r){return x1(r.type,lf,t,r)}var Vv=d1(function(t,r){let l=(0,O1.useId)(),{id:i=`headlessui-dialog-${l}`,open:o,onClose:n,initialFocus:h,role:v="dialog",autoFocus:u=!0,__demoMode:s=!1,unmount:p=!1,...A}=t,M=(0,g1.useRef)(!1);v=(function(){return v==="dialog"||v==="alertdialog"?v:(M.current||(M.current=!0,console.warn(`Invalid role [${v}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")})();let H=G2();o===void 0&&H!==null&&(o=(H&_1.Open)===_1.Open);let m=(0,g1.useRef)(null),L=z1(m,r),w=e2(m.current),Z=o?0:1,[V,x]=(0,g1.useReducer)(ef,{titleId:null,descriptionId:null,panelRef:(0,g1.createRef)()}),z=_(()=>n(!1)),B=_(R=>x({type:0,id:R})),P=g4()?Z===0:!1,[$,S]=tv(),O={get current(){var R;return(R=V.panelRef.current)!=null?R:m.current}},y=te(),{resolveContainers:F}=ov({mainTreeNode:y,portals:$,defaultContainers:[O]}),U=H!==null?(H&_1.Closing)===_1.Closing:!1;V8(s||U?!1:P,{allowed:_(()=>{var R,c1;return[(c1=(R=m.current)==null?void 0:R.closest("[data-headlessui-portal]"))!=null?c1:null]}),disallowed:_(()=>{var R;return[(R=y?.closest("body > *:not(#headlessui-portal-root)"))!=null?R:null]})});let q=l2.get(null);a1(()=>{if(P)return q.actions.push(i),()=>q.actions.pop(i)},[q,i,P]);let G=f1(q,(0,g1.useCallback)(R=>q.selectors.isTop(R,i),[q,i]));Z8(G,F,R=>{R.preventDefault(),z()}),ev(G,w?.defaultView,R=>{R.preventDefault(),R.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),z()}),L8(s||U?!1:P,w,F),m8(P,m,z);let[I,J]=Wc(),A1=(0,g1.useMemo)(()=>[{dialogState:Z,close:z,setTitleId:B,unmount:p},V],[Z,z,B,p,V]),X=P1({open:Z===0}),l1={ref:L,id:i,role:v,tabIndex:-1,"aria-modal":s?void 0:Z===0?!0:void 0,"aria-labelledby":V.titleId,"aria-describedby":I,unmount:p},T=!iv(),W=t6.None;P&&!s&&(W|=t6.RestoreFocus,W|=t6.TabLock,u&&(W|=t6.AutoFocus),T&&(W|=t6.InitialFocus));let D=M1();return g1.default.createElement(jd,null,g1.default.createElement(Rl,{force:!0},g1.default.createElement(F8,null,g1.default.createElement(re.Provider,{value:A1},g1.default.createElement(kl,{target:m},g1.default.createElement(Rl,{force:!1},g1.default.createElement(J,{slot:X},g1.default.createElement(S,null,g1.default.createElement(gv,{initialFocus:h,initialFocusFallback:m,containers:F,features:W},g1.default.createElement(Yc,{value:z},D({ourProps:l1,theirProps:A,slot:X,defaultTag:of,features:nf,visible:Z===0,name:"Dialog"})))))))))))}),of="div",nf=J0.RenderStrategy|J0.Static;function cf(t,r){let{transition:l=!1,open:i,...o}=t,n=G2(),h=t.hasOwnProperty("open")||n!==null,v=t.hasOwnProperty("onClose");if(!h&&!v)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!h)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!v)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!n&&typeof t.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${t.open}`);if(typeof t.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${t.onClose}`);return(i!==void 0||l)&&!o.static?g1.default.createElement(Jl,null,g1.default.createElement(Av,{show:i,transition:l,unmount:o.unmount},g1.default.createElement(Vv,{ref:r,...o}))):g1.default.createElement(Jl,null,g1.default.createElement(Vv,{ref:r,open:i,...o}))}var hf="div";function df(t,r){let l=(0,O1.useId)(),{id:i=`headlessui-dialog-panel-${l}`,transition:o=!1,...n}=t,[{dialogState:h,unmount:v},u]=i7("Dialog.Panel"),s=z1(r,u.panelRef),p=P1({open:h===0}),A=_(w=>{w.stopPropagation()}),M={ref:s,id:i,onClick:A},H=o?e7:g1.Fragment,m=o?{unmount:v}:{},L=M1();return g1.default.createElement(H,{...m},L({ourProps:M,theirProps:n,slot:p,defaultTag:hf,name:"Dialog.Panel"}))}var vf="div";function gf(t,r){let{transition:l=!1,...i}=t,[{dialogState:o,unmount:n}]=i7("Dialog.Backdrop"),h=P1({open:o===0}),v={ref:r,"aria-hidden":!0},u=l?e7:g1.Fragment,s=l?{unmount:n}:{},p=M1();return g1.default.createElement(u,{...s},p({ourProps:v,theirProps:i,slot:h,defaultTag:vf,name:"Dialog.Backdrop"}))}var uf="h2";function sf(t,r){let l=(0,O1.useId)(),{id:i=`headlessui-dialog-title-${l}`,...o}=t,[{dialogState:n,setTitleId:h}]=i7("Dialog.Title"),v=z1(r);(0,g1.useEffect)(()=>(h(i),()=>h(null)),[i,h]);let u=P1({open:n===0}),s={ref:v,id:i};return M1()({ourProps:s,theirProps:o,slot:u,defaultTag:uf,name:"Dialog.Title"})}var pf=d1(cf),L5=d1(df),eB=d1(gf),z5=d1(sf);var o7=Object.assign(pf,{Panel:L5,Title:z5,Description:jc});var Hf="input";function Mf(t,r){let l=(0,O1.useId)(),i=E2(),o=Q0(),{id:n=i||`headlessui-input-${l}`,disabled:h=o||!1,autoFocus:v=!1,invalid:u=!1,...s}=t,p=V2(),A=I4(),{isFocused:M,focusProps:H}=F2({autoFocus:v}),{isHovered:m,hoverProps:L}=O2({isDisabled:h}),w=f2({ref:r,id:n,"aria-labelledby":p,"aria-describedby":A,"aria-invalid":u?"true":void 0,disabled:h||void 0,autoFocus:v},H,L),Z=P1({disabled:h,invalid:u,hover:m,focus:M,autofocus:v});return M1()({ourProps:w,theirProps:s,slot:Z,defaultTag:Hf,name:"Input"})}var le=d1(Mf);var u1=E(k(),1),h7=E(T2(),1);var ee=E(k(),1);var mv=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Zv(t){var r,l;let i=(r=t.innerText)!=null?r:"",o=t.cloneNode(!0);if(!j1(o))return i;let n=!1;for(let v of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))v.remove(),n=!0;let h=n?(l=o.innerText)!=null?l:"":i;return mv.test(h)&&(h=h.replace(mv,"")),h}function xv(t){let r=t.getAttribute("aria-label");if(typeof r=="string")return r.trim();let l=t.getAttribute("aria-labelledby");if(l){let i=l.split(" ").map(o=>{let n=document.getElementById(o);if(n){let h=n.getAttribute("aria-label");return typeof h=="string"?h.trim():Zv(n).trim()}return null}).filter(Boolean);if(i.length>0)return i.join(", ")}return Zv(t).trim()}function Lv(t){let r=(0,ee.useRef)(""),l=(0,ee.useRef)("");return _(()=>{let i=t.current;if(!i)return"";let o=i.innerText;if(r.current===o)return l.current;let n=xv(i).trim().toLowerCase();return r.current=o,l.current=n,n})}var ff=Object.defineProperty,Af=(t,r,l)=>r in t?ff(t,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[r]=l,zv=(t,r,l)=>(Af(t,typeof r!="symbol"?r+"":r,l),l),d0=(t=>(t[t.Open=0]="Open",t[t.Closed=1]="Closed",t))(d0||{}),s4=(t=>(t[t.Single=0]="Single",t[t.Multi=1]="Multi",t))(s4||{}),C5=(t=>(t[t.Pointer=0]="Pointer",t[t.Other=1]="Other",t))(C5||{}),ie=(t=>(t[t.OpenListbox=0]="OpenListbox",t[t.CloseListbox=1]="CloseListbox",t[t.GoToOption=2]="GoToOption",t[t.Search=3]="Search",t[t.ClearSearch=4]="ClearSearch",t[t.SelectOption=5]="SelectOption",t[t.RegisterOptions=6]="RegisterOptions",t[t.UnregisterOptions=7]="UnregisterOptions",t[t.SetButtonElement=8]="SetButtonElement",t[t.SetOptionsElement=9]="SetOptionsElement",t[t.SortOptions=10]="SortOptions",t[t.MarkButtonAsMoved=11]="MarkButtonAsMoved",t))(ie||{});function Cv(t,r=l=>l){let l=t.activeOptionIndex!==null?t.options[t.activeOptionIndex]:null,i=h5(r(t.options.slice()),n=>n.dataRef.current.domRef.current),o=l?i.indexOf(l):null;return o===-1&&(o=null),{options:i,activeOptionIndex:o}}var Vf={1(t){if(t.dataRef.current.disabled||t.listboxState===1)return t;let r=t.buttonElement?z2.Tracked(m5(t.buttonElement)):t.buttonPositionState;return{...t,activeOptionIndex:null,pendingFocus:{focus:i1.Nothing},listboxState:1,__demoMode:!1,buttonPositionState:r}},0(t,r){if(t.dataRef.current.disabled||t.listboxState===0)return t;let l=t.activeOptionIndex,{isSelected:i}=t.dataRef.current,o=t.options.findIndex(n=>i(n.dataRef.current.value));return o!==-1&&(l=o),{...t,frozenValue:!1,pendingFocus:r.focus,listboxState:0,activeOptionIndex:l,__demoMode:!1,buttonPositionState:z2.Idle}},2(t,r){var l,i,o,n,h;if(t.dataRef.current.disabled||t.listboxState===1)return t;let v={...t,searchQuery:"",activationTrigger:(l=r.trigger)!=null?l:1,__demoMode:!1};if(r.focus===i1.Nothing)return{...v,activeOptionIndex:null};if(r.focus===i1.Specific)return{...v,activeOptionIndex:t.options.findIndex(p=>p.id===r.id)};if(r.focus===i1.Previous){let p=t.activeOptionIndex;if(p!==null){let A=t.options[p].dataRef.current.domRef,M=Q4(r,{resolveItems:()=>t.options,resolveActiveIndex:()=>t.activeOptionIndex,resolveId:H=>H.id,resolveDisabled:H=>H.dataRef.current.disabled});if(M!==null){let H=t.options[M].dataRef.current.domRef;if(((i=A.current)==null?void 0:i.previousElementSibling)===H.current||((o=H.current)==null?void 0:o.previousElementSibling)===null)return{...v,activeOptionIndex:M}}}}else if(r.focus===i1.Next){let p=t.activeOptionIndex;if(p!==null){let A=t.options[p].dataRef.current.domRef,M=Q4(r,{resolveItems:()=>t.options,resolveActiveIndex:()=>t.activeOptionIndex,resolveId:H=>H.id,resolveDisabled:H=>H.dataRef.current.disabled});if(M!==null){let H=t.options[M].dataRef.current.domRef;if(((n=A.current)==null?void 0:n.nextElementSibling)===H.current||((h=H.current)==null?void 0:h.nextElementSibling)===null)return{...v,activeOptionIndex:M}}}}let u=Cv(t),s=Q4(r,{resolveItems:()=>u.options,resolveActiveIndex:()=>u.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});return{...v,...u,activeOptionIndex:s}},3:(t,r)=>{if(t.dataRef.current.disabled||t.listboxState===1)return t;let l=t.searchQuery!==""?0:1,i=t.searchQuery+r.value.toLowerCase(),o=(t.activeOptionIndex!==null?t.options.slice(t.activeOptionIndex+l).concat(t.options.slice(0,t.activeOptionIndex+l)):t.options).find(h=>{var v;return!h.dataRef.current.disabled&&((v=h.dataRef.current.textValue)==null?void 0:v.startsWith(i))}),n=o?t.options.indexOf(o):-1;return n===-1||n===t.activeOptionIndex?{...t,searchQuery:i}:{...t,searchQuery:i,activeOptionIndex:n,activationTrigger:1}},4(t){return t.dataRef.current.disabled||t.listboxState===1||t.searchQuery===""?t:{...t,searchQuery:""}},5(t){return t.dataRef.current.mode===0?{...t,frozenValue:!0}:{...t}},6:(t,r)=>{let l=t.options.concat(r.options),i=t.activeOptionIndex;if(t.pendingFocus.focus!==i1.Nothing&&(i=Q4(t.pendingFocus,{resolveItems:()=>l,resolveActiveIndex:()=>t.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),t.activeOptionIndex===null){let{isSelected:o}=t.dataRef.current;if(o){let n=l.findIndex(h=>o?.(h.dataRef.current.value));n!==-1&&(i=n)}}return{...t,options:l,activeOptionIndex:i,pendingFocus:{focus:i1.Nothing},pendingShouldSort:!0}},7:(t,r)=>{let l=t.options,i=[],o=new Set(r.options);for(let[n,h]of l.entries())if(o.has(h.id)&&(i.push(n),o.delete(h.id),o.size===0))break;if(i.length>0){l=l.slice();for(let n of i.reverse())l.splice(n,1)}return{...t,options:l,activationTrigger:1}},8:(t,r)=>t.buttonElement===r.element?t:{...t,buttonElement:r.element},9:(t,r)=>t.optionsElement===r.element?t:{...t,optionsElement:r.element},10:t=>t.pendingShouldSort?{...t,...Cv(t),pendingShouldSort:!1}:t,11(t){return t.buttonPositionState.kind!=="Tracked"?t:{...t,buttonPositionState:z2.Moved}}},n7=class t extends G4{constructor(r){super(r),zv(this,"actions",{onChange:l=>{let{onChange:i,compare:o,mode:n,value:h}=this.state.dataRef.current;return x1(n,{0:()=>i?.(l),1:()=>{let v=h.slice(),u=v.findIndex(s=>o(s,l));return u===-1?v.push(l):v.splice(u,1),i?.(v)}})},registerOption:wa(()=>{let l=[],i=new Set;return[(o,n)=>{i.has(n)||(i.add(n),l.push({id:o,dataRef:n}))},()=>(i.clear(),this.send({type:6,options:l.splice(0)}))]}),unregisterOption:wa(()=>{let l=[];return[i=>l.push(i),()=>{this.send({type:7,options:l.splice(0)})}]}),goToOption:wa(()=>{let l=null;return[(i,o)=>{l={type:2,...i,trigger:o}},()=>l&&this.send(l)]}),closeListbox:()=>{this.send({type:1})},openListbox:l=>{this.send({type:0,focus:l})},selectActiveOption:()=>{var l;if(this.state.activeOptionIndex!==null){let{dataRef:i}=this.state.options[this.state.activeOptionIndex];this.actions.selectOption(i.current.value)}else this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(l=this.state.buttonElement)==null||l.focus({preventScroll:!0}))},selectOption:l=>{this.send({type:5,value:l})},search:l=>{this.send({type:3,value:l})},clearSearch:()=>{this.send({type:4})},setButtonElement:l=>{this.send({type:8,element:l})},setOptionsElement:l=>{this.send({type:9,element:l})}}),zv(this,"selectors",{activeDescendantId(l){var i;let o=l.activeOptionIndex,n=l.options;return o===null||(i=n[o])==null?void 0:i.id},isActive(l,i){var o;let n=l.activeOptionIndex,h=l.options;return n!==null?((o=h[n])==null?void 0:o.id)===i:!1},hasFrozenValue(l){return l.frozenValue},shouldScrollIntoView(l,i){return l.__demoMode||l.listboxState!==0||l.activationTrigger===0?!1:this.isActive(l,i)},didButtonMove(l){return l.buttonPositionState.kind==="Moved"}}),this.on(6,()=>{requestAnimationFrame(()=>{this.send({type:10})})});{let l=this.state.id,i=l2.get(null);this.disposables.add(i.on(e5.Push,o=>{!i.selectors.isTop(o,l)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>i.actions.push(l)),this.on(1,()=>i.actions.pop(l))}this.disposables.group(l=>{this.on(1,i=>{i.buttonElement&&(l.dispose(),l.add(Ja(i.buttonElement,i.buttonPositionState,()=>{this.send({type:11})})))})}),this.on(5,(l,i)=>{var o;this.actions.onChange(i.value),this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(o=this.state.buttonElement)==null||o.focus({preventScroll:!0}))})}static new({id:r,__demoMode:l=!1}){return new t({id:r,dataRef:{current:{}},listboxState:l?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:i1.Nothing},frozenValue:!1,__demoMode:l,buttonPositionState:z2.Idle})}reduce(r,l){return x1(l.type,Vf,r,l)}};var R8=E(k(),1);var oe=(0,R8.createContext)(null);function c7(t){let r=(0,R8.useContext)(oe);if(r===null){let l=new Error(`<${t} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(l,ne),l}return r}function ne({id:t,__demoMode:r=!1}){let l=(0,R8.useMemo)(()=>n7.new({id:t,__demoMode:r}),[]);return J4(()=>l.dispose()),l}var d7=(0,u1.createContext)(null);d7.displayName="ListboxDataContext";function w5(t){let r=(0,u1.useContext)(d7);if(r===null){let l=new Error(`<${t} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(l,w5),l}return r}var mf=u1.Fragment;function Zf(t,r){let l=(0,O1.useId)(),i=Q0(),{value:o,defaultValue:n,form:h,name:v,onChange:u,by:s,invalid:p=!1,disabled:A=i||!1,horizontal:M=!1,multiple:H=!1,__demoMode:m=!1,...L}=t,w=M?"horizontal":"vertical",Z=z1(r),V=M8(n),[x=H?[]:void 0,z]=H8(o,u,V),B=ne({id:l,__demoMode:m}),P=(0,u1.useRef)({static:!1,hold:!1}),$=(0,u1.useRef)(new Map),S=za(s),O=(0,u1.useCallback)(D=>x1(y.mode,{[s4.Multi]:()=>x.some(R=>S(R,D)),[s4.Single]:()=>S(x,D)}),[x]),y=P1({value:x,disabled:A,invalid:p,mode:H?s4.Multi:s4.Single,orientation:w,onChange:z,compare:S,isSelected:O,optionsPropsRef:P,listRef:$});a1(()=>{B.state.dataRef.current=y},[y]);let F=f1(B,D=>D.listboxState),U=l2.get(null),q=f1(U,(0,u1.useCallback)(D=>U.selectors.isTop(D,l),[U,l])),[G,I]=f1(B,D=>[D.buttonElement,D.optionsElement]);Z8(q,[G,I],(D,R)=>{B.send({type:ie.CloseListbox}),Sa(R,c5.Loose)||(D.preventDefault(),G?.focus())});let J=P1({open:F===d0.Open,disabled:A,invalid:p,value:x}),[A1,X]=Za({inherit:!0}),l1={ref:Z},T=(0,u1.useCallback)(()=>{if(V!==void 0)return z?.(V)},[z,V]),W=M1();return u1.default.createElement(X,{value:A1,props:{htmlFor:G?.id},slot:{open:F===d0.Open,disabled:A}},u1.default.createElement(Ya,null,u1.default.createElement(oe.Provider,{value:B},u1.default.createElement(d7.Provider,{value:y},u1.default.createElement($8,{value:x1(F,{[d0.Open]:_1.Open,[d0.Closed]:_1.Closed})},v!=null&&x!=null&&u1.default.createElement(f8,{disabled:A,data:{[v]:x},form:h,onReset:T}),W({ourProps:l1,theirProps:L,slot:J,defaultTag:mf,name:"Listbox"}))))))}var xf="button";function Lf(t,r){let l=(0,O1.useId)(),i=E2(),o=w5("Listbox.Button"),n=c7("Listbox.Button"),{id:h=i||`headlessui-listbox-button-${l}`,disabled:v=o.disabled||!1,autoFocus:u=!1,...s}=t,p=z1(r,ja(),n.actions.setButtonElement),A=Ud(),[M,H,m]=f1(n,I=>[I.listboxState,I.buttonElement,I.optionsElement]),L=M===d0.Open;Ta(L,{trigger:H,action:(0,u1.useCallback)(I=>{if(H!=null&&H.contains(I.target))return m2.Ignore;let J=I.target.closest('[role="option"]:not([data-disabled])');return j1(J)?m2.Select(J):m!=null&&m.contains(I.target)?m2.Ignore:m2.Close},[H,m]),close:n.actions.closeListbox,select:n.actions.selectActiveOption});let w=_(I=>{switch(I.key){case h1.Enter:fa(I.currentTarget);break;case h1.Space:case h1.ArrowDown:I.preventDefault(),n.actions.openListbox({focus:o.value?i1.Nothing:i1.First});break;case h1.ArrowUp:I.preventDefault(),n.actions.openListbox({focus:o.value?i1.Nothing:i1.Last});break}}),Z=_(I=>{I.key===h1.Space&&I.preventDefault()}),V=Ca(I=>{var J;n.state.listboxState===d0.Open?((0,h7.flushSync)(()=>n.actions.closeListbox()),(J=n.state.buttonElement)==null||J.focus({preventScroll:!0})):(I.preventDefault(),n.actions.openListbox({focus:i1.Nothing}))}),x=_(I=>I.preventDefault()),z=V2([h]),B=I4(),{isFocusVisible:P,focusProps:$}=F2({autoFocus:u}),{isHovered:S,hoverProps:O}=O2({isDisabled:v}),{pressed:y,pressProps:F}=u8({disabled:v}),U=P1({open:M===d0.Open,active:y||M===d0.Open,disabled:v,invalid:o.invalid,value:o.value,hover:S,focus:P,autofocus:u}),q=f1(n,I=>I.listboxState===d0.Open),G=f2(A(),{ref:p,id:h,type:$a(t,H),"aria-haspopup":"listbox","aria-controls":m?.id,"aria-expanded":q,"aria-labelledby":z,"aria-describedby":B,disabled:v||void 0,autoFocus:u,onKeyDown:w,onKeyUp:Z,onKeyPress:x},V,$,O,F);return M1()({ourProps:G,theirProps:s,slot:U,defaultTag:xf,name:"Listbox.Button"})}var wv=(0,u1.createContext)(!1),zf="div",Cf=J0.RenderStrategy|J0.Static;function wf(t,r){let l=(0,O1.useId)(),{id:i=`headlessui-listbox-options-${l}`,anchor:o,portal:n=!1,modal:h=!0,transition:v=!1,...u}=t,s=Wa(o),[p,A]=(0,u1.useState)(null);s&&(n=!0);let M=w5("Listbox.Options"),H=c7("Listbox.Options"),[m,L,w,Z]=f1(H,j=>[j.listboxState,j.buttonElement,j.optionsElement,j.__demoMode]),V=e2(L),x=e2(w),z=G2(),[B,P]=C8(v,p,z!==null?(z&_1.Open)===_1.Open:m===d0.Open);m8(B,L,H.actions.closeListbox);let $=Z?!1:h&&m===d0.Open;L8($,x);let S=Z?!1:h&&m===d0.Open;V8(S,{allowed:(0,u1.useCallback)(()=>[L,w],[L,w])});let O=f1(H,H.selectors.didButtonMove)?!1:B,y=f1(H,H.selectors.hasFrozenValue)&&!t.static,F=T8(y,M.value),U=(0,u1.useCallback)(j=>M.compare(F,j),[M.compare,F]),q=f1(H,j=>{var m1;if(s==null||!((m1=s?.to)!=null&&m1.includes("selection")))return null;let Q=j.options.findIndex(r0=>U(r0.dataRef.current.value));return Q===-1&&(Q=0),Q}),G=(()=>{if(s==null)return;if(q===null)return{...s,inner:void 0};let j=Array.from(M.listRef.current.values());return{...s,inner:{listRef:{current:j},index:q}}})(),[I,J]=Ka(G),A1=qa(),X=z1(r,s?I:null,H.actions.setOptionsElement,A),l1=W1();(0,u1.useEffect)(()=>{let j=w;j&&m===d0.Open&&(_4(j)||j==null||j.focus({preventScroll:!0}))},[m,w]);let T=_(j=>{var m1;switch(l1.dispose(),j.key){case h1.Space:if(H.state.searchQuery!=="")return j.preventDefault(),j.stopPropagation(),H.actions.search(j.key);case h1.Enter:j.preventDefault(),j.stopPropagation(),H.actions.selectActiveOption();break;case x1(M.orientation,{vertical:h1.ArrowDown,horizontal:h1.ArrowRight}):return j.preventDefault(),j.stopPropagation(),H.actions.goToOption({focus:i1.Next});case x1(M.orientation,{vertical:h1.ArrowUp,horizontal:h1.ArrowLeft}):return j.preventDefault(),j.stopPropagation(),H.actions.goToOption({focus:i1.Previous});case h1.Home:case h1.PageUp:return j.preventDefault(),j.stopPropagation(),H.actions.goToOption({focus:i1.First});case h1.End:case h1.PageDown:return j.preventDefault(),j.stopPropagation(),H.actions.goToOption({focus:i1.Last});case h1.Escape:j.preventDefault(),j.stopPropagation(),(0,h7.flushSync)(()=>H.actions.closeListbox()),(m1=H.state.buttonElement)==null||m1.focus({preventScroll:!0});return;case h1.Tab:j.preventDefault(),j.stopPropagation(),(0,h7.flushSync)(()=>H.actions.closeListbox()),Ch(H.state.buttonElement,j.shiftKey?I0.Previous:I0.Next);break;default:j.key.length===1&&(H.actions.search(j.key),l1.setTimeout(()=>H.actions.clearSearch(),350));break}}),W=f1(H,j=>{var m1;return(m1=j.buttonElement)==null?void 0:m1.id}),D=P1({open:m===d0.Open}),R=f2(s?A1():{},{id:i,ref:X,"aria-activedescendant":f1(H,H.selectors.activeDescendantId),"aria-multiselectable":M.mode===s4.Multi?!0:void 0,"aria-labelledby":W,"aria-orientation":M.orientation,onKeyDown:T,role:"listbox",tabIndex:m===d0.Open?0:void 0,style:{...u.style,...J,"--button-width":t5(B,L,!0).width},...z8(P)}),c1=M1(),Z1=(0,u1.useMemo)(()=>M.mode===s4.Multi?M:{...M,isSelected:U},[M,U]);return u1.default.createElement(F8,{enabled:n?t.static||B:!1,ownerDocument:V},u1.default.createElement(d7.Provider,{value:Z1},c1({ourProps:R,theirProps:u,slot:D,defaultTag:zf,features:Cf,visible:O,name:"Listbox.Options"})))}var Bf="div";function Pf(t,r){let l=(0,O1.useId)(),{id:i=`headlessui-listbox-option-${l}`,disabled:o=!1,value:n,...h}=t,v=(0,u1.useContext)(wv)===!0,u=w5("Listbox.Option"),s=c7("Listbox.Option"),p=f1(s,y=>s.selectors.isActive(y,i)),A=u.isSelected(n),M=(0,u1.useRef)(null),H=Lv(M),m=t0({disabled:o,value:n,domRef:M,get textValue(){return H()}}),L=z1(r,M,y=>{y?u.listRef.current.set(i,y):u.listRef.current.delete(i)}),w=f1(s,y=>s.selectors.shouldScrollIntoView(y,i));a1(()=>{if(w)return T1().requestAnimationFrame(()=>{var y,F;(F=(y=M.current)==null?void 0:y.scrollIntoView)==null||F.call(y,{block:"nearest"})})},[w,M]),a1(()=>{if(!v)return s.actions.registerOption(i,m),()=>s.actions.unregisterOption(i)},[m,i,v]);let Z=_(y=>{if(o)return y.preventDefault();s.actions.selectOption(n)}),V=_(()=>{if(o)return s.actions.goToOption({focus:i1.Nothing});s.actions.goToOption({focus:i1.Specific,id:i})}),x=Oa(),z=_(y=>x.update(y)),B=_(y=>{x.wasMoved(y)&&(o||p&&s.state.activationTrigger===C5.Pointer||s.actions.goToOption({focus:i1.Specific,id:i},C5.Pointer))}),P=_(y=>{x.wasMoved(y)&&(o||p&&s.state.activationTrigger===C5.Pointer&&s.actions.goToOption({focus:i1.Nothing}))}),$=P1({active:p,focus:p,selected:A,disabled:o,selectedOption:A&&v}),S=v?{}:{id:i,ref:L,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":A,disabled:void 0,onClick:Z,onFocus:V,onPointerEnter:z,onMouseEnter:z,onPointerMove:B,onMouseMove:B,onPointerLeave:P,onMouseLeave:P},O=M1();return!A&&v?null:O({ourProps:S,theirProps:h,slot:$,defaultTag:Bf,name:"Listbox.Option"})}var Sf=u1.Fragment;function yf(t,r){let{options:l,placeholder:i,...o}=t,n={ref:z1(r)},h=w5("ListboxSelectedOption"),v=P1({}),u=h.value===void 0||h.value===null||h.mode===s4.Multi&&Array.isArray(h.value)&&h.value.length===0,s=M1();return u1.default.createElement(wv.Provider,{value:!0},s({ourProps:n,theirProps:{...o,children:u1.default.createElement(u1.default.Fragment,null,i&&u?i:l)},slot:v,defaultTag:Sf,name:"ListboxSelectedOption"}))}var bf=d1(Zf),ce=d1(Lf),Tf=xa,he=d1(wf),de=d1(Pf),$f=d1(yf),Bv=Object.assign(bf,{Button:ce,Label:Tf,Options:he,Option:de,SelectedOption:$f});var I8=E(k(),1);var ve=E(k(),1),ge={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ue=ve.default.createContext&&ve.default.createContext(ge);var Of=["attr","size","title"];function Ff(t,r){if(t==null)return{};var l,i,o=Df(t,r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(i=0;i<n.length;i++)l=n[i],r.indexOf(l)===-1&&{}.propertyIsEnumerable.call(t,l)&&(o[l]=t[l])}return o}function Df(t,r){if(t==null)return{};var l={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(r.indexOf(i)!==-1)continue;l[i]=t[i]}return l}function v7(){return v7=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var l=arguments[r];for(var i in l)({}).hasOwnProperty.call(l,i)&&(t[i]=l[i])}return t},v7.apply(null,arguments)}function Pv(t,r){var l=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),l.push.apply(l,i)}return l}function g7(t){for(var r=1;r<arguments.length;r++){var l=arguments[r]!=null?arguments[r]:{};r%2?Pv(Object(l),!0).forEach(function(i){Ef(t,i,l[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(l)):Pv(Object(l)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(l,i))})}return t}function Ef(t,r,l){return(r=Nf(r))in t?Object.defineProperty(t,r,{value:l,enumerable:!0,configurable:!0,writable:!0}):t[r]=l,t}function Nf(t){var r=_f(t,"string");return typeof r=="symbol"?r:r+""}function _f(t,r){if(typeof t!="object"||!t)return t;var l=t[Symbol.toPrimitive];if(l!==void 0){var i=l.call(t,r||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}function Sv(t){return t&&t.map((r,l)=>I8.default.createElement(r.tag,g7({key:l},r.attr),Sv(r.child)))}function p4(t){return r=>I8.default.createElement(Rf,v7({attr:g7({},t.attr)},r),Sv(t.child))}function Rf(t){var r=l=>{var{attr:i,size:o,title:n}=t,h=Ff(t,Of),v=o||l.size||"1em",u;return l.className&&(u=l.className),t.className&&(u=(u?u+" ":"")+t.className),I8.default.createElement("svg",v7({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},l.attr,i,h,{className:u,style:g7(g7({color:t.color||l.color},l.style),t.style),height:v,width:v,xmlns:"http://www.w3.org/2000/svg"}),n&&I8.default.createElement("title",null,n),t.children)};return ue!==void 0?I8.default.createElement(ue.Consumer,null,l=>r(l)):r(ge)}function yv(t){return p4({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M12 7V3H2v18h20V7H12zM6 19H4v-2h2v2zm0-4H4v-2h2v2zm0-4H4V9h2v2zm0-4H4V5h2v2zm4 12H8v-2h2v2zm0-4H8v-2h2v2zm0-4H8V9h2v2zm0-4H8V5h2v2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8v10zm-2-8h-2v2h2v-2zm0 4h-2v2h2v-2z"},child:[]}]})(t)}function bv(t){return p4({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zM7 9l1.41 1.41L11 7.83V16h2V7.83l2.59 2.58L17 9l-5-5-5 5z"},child:[]}]})(t)}function Tv(t){return p4({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M3 10h11v2H3v-2zm0-2h11V6H3v2zm0 8h7v-2H3v2zm15.01-3.13.71-.71a.996.996 0 0 1 1.41 0l.71.71c.39.39.39 1.02 0 1.41l-.71.71-2.12-2.12zm-.71.71-5.3 5.3V21h2.12l5.3-5.3-2.12-2.12z"},child:[]}]})(t)}function $v(t){return p4({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M4 19V8h16v3.29c.72.22 1.4.54 2 .97V8c0-1.11-.89-2-2-2h-4V4c0-1.11-.89-2-2-2h-4c-1.11 0-2 .89-2 2v2H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h7.68c-.3-.62-.5-1.29-.6-2H4zm6-15h4v2h-4V4z"},child:[]},{tag:"path",attr:{d:"M18 13c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm1.65 7.35L17.5 18.2V15h1v2.79l1.85 1.85-.7.71z"},child:[]}]})(t)}function Ov(t){return p4({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"},child:[]}]})(t)}var k8=[{name:"Afghanistan",iso2:"af",dialCode:"93"},{name:"Albania",iso2:"al",dialCode:"355"},{name:"Algeria",iso2:"dz",dialCode:"213"},{name:"American Samoa",iso2:"as",dialCode:"1",priority:5,areaCodes:["684"]},{name:"Andorra",iso2:"ad",dialCode:"376"},{name:"Angola",iso2:"ao",dialCode:"244"},{name:"Anguilla",iso2:"ai",dialCode:"1",priority:6,areaCodes:["264"]},{name:"Antigua & Barbuda",iso2:"ag",dialCode:"1",priority:7,areaCodes:["268"]},{name:"Argentina",iso2:"ar",dialCode:"54"},{name:"Armenia",iso2:"am",dialCode:"374"},{name:"Aruba",iso2:"aw",dialCode:"297"},{name:"Ascension Island",iso2:"ac",dialCode:"247"},{name:"Australia",iso2:"au",dialCode:"61",priority:0},{name:"Austria",iso2:"at",dialCode:"43"},{name:"Azerbaijan",iso2:"az",dialCode:"994"},{name:"Bahamas",iso2:"bs",dialCode:"1",priority:8,areaCodes:["242"]},{name:"Bahrain",iso2:"bh",dialCode:"973"},{name:"Bangladesh",iso2:"bd",dialCode:"880"},{name:"Barbados",iso2:"bb",dialCode:"1",priority:9,areaCodes:["246"]},{name:"Belarus",iso2:"by",dialCode:"375"},{name:"Belgium",iso2:"be",dialCode:"32"},{name:"Belize",iso2:"bz",dialCode:"501"},{name:"Benin",iso2:"bj",dialCode:"229"},{name:"Bermuda",iso2:"bm",dialCode:"1",priority:10,areaCodes:["441"]},{name:"Bhutan",iso2:"bt",dialCode:"975"},{name:"Bolivia",iso2:"bo",dialCode:"591"},{name:"Bosnia & Herzegovina",iso2:"ba",dialCode:"387"},{name:"Botswana",iso2:"bw",dialCode:"267"},{name:"Brazil",iso2:"br",dialCode:"55"},{name:"British Indian Ocean Territory",iso2:"io",dialCode:"246"},{name:"British Virgin Islands",iso2:"vg",dialCode:"1",priority:11,areaCodes:["284"]},{name:"Brunei",iso2:"bn",dialCode:"673"},{name:"Bulgaria",iso2:"bg",dialCode:"359"},{name:"Burkina Faso",iso2:"bf",dialCode:"226"},{name:"Burundi",iso2:"bi",dialCode:"257"},{name:"Cambodia",iso2:"kh",dialCode:"855"},{name:"Cameroon",iso2:"cm",dialCode:"237"},{name:"Canada",iso2:"ca",dialCode:"1",priority:1,areaCodes:["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","902","905"]},{name:"Cape Verde",iso2:"cv",dialCode:"238"},{name:"Caribbean Netherlands",iso2:"bq",dialCode:"599",priority:1,areaCodes:["3","4","7"]},{name:"Cayman Islands",iso2:"ky",dialCode:"1",priority:12,areaCodes:["345"]},{name:"Central African Republic",iso2:"cf",dialCode:"236"},{name:"Chad",iso2:"td",dialCode:"235"},{name:"Chile",iso2:"cl",dialCode:"56"},{name:"China",iso2:"cn",dialCode:"86"},{name:"Christmas Island",iso2:"cx",dialCode:"61",priority:2,areaCodes:["89164"]},{name:"Cocos (Keeling) Islands",iso2:"cc",dialCode:"61",priority:1,areaCodes:["89162"]},{name:"Colombia",iso2:"co",dialCode:"57"},{name:"Comoros",iso2:"km",dialCode:"269"},{name:"Congo - Brazzaville",iso2:"cg",dialCode:"242"},{name:"Congo - Kinshasa",iso2:"cd",dialCode:"243"},{name:"Cook Islands",iso2:"ck",dialCode:"682"},{name:"Costa Rica",iso2:"cr",dialCode:"506"},{name:"C\xF4te d\u2019Ivoire",iso2:"ci",dialCode:"225"},{name:"Croatia",iso2:"hr",dialCode:"385"},{name:"Cuba",iso2:"cu",dialCode:"53"},{name:"Cura\xE7ao",iso2:"cw",dialCode:"599",priority:0},{name:"Cyprus",iso2:"cy",dialCode:"357"},{name:"Czech Republic",iso2:"cz",dialCode:"420"},{name:"Denmark",iso2:"dk",dialCode:"45"},{name:"Djibouti",iso2:"dj",dialCode:"253"},{name:"Dominica",iso2:"dm",dialCode:"1",priority:13,areaCodes:["767"]},{name:"Dominican Republic",iso2:"do",dialCode:"1",priority:2,areaCodes:["809","829","849"]},{name:"Ecuador",iso2:"ec",dialCode:"593"},{name:"Egypt",iso2:"eg",dialCode:"20"},{name:"El Salvador",iso2:"sv",dialCode:"503"},{name:"Equatorial Guinea",iso2:"gq",dialCode:"240"},{name:"Eritrea",iso2:"er",dialCode:"291"},{name:"Estonia",iso2:"ee",dialCode:"372"},{name:"Eswatini",iso2:"sz",dialCode:"268"},{name:"Ethiopia",iso2:"et",dialCode:"251"},{name:"Falkland Islands",iso2:"fk",dialCode:"500"},{name:"Faroe Islands",iso2:"fo",dialCode:"298"},{name:"Fiji",iso2:"fj",dialCode:"679"},{name:"Finland",iso2:"fi",dialCode:"358",priority:0},{name:"France",iso2:"fr",dialCode:"33"},{name:"French Guiana",iso2:"gf",dialCode:"594"},{name:"French Polynesia",iso2:"pf",dialCode:"689"},{name:"Gabon",iso2:"ga",dialCode:"241"},{name:"Gambia",iso2:"gm",dialCode:"220"},{name:"Georgia",iso2:"ge",dialCode:"995"},{name:"Germany",iso2:"de",dialCode:"49"},{name:"Ghana",iso2:"gh",dialCode:"233"},{name:"Gibraltar",iso2:"gi",dialCode:"350"},{name:"Greece",iso2:"gr",dialCode:"30"},{name:"Greenland",iso2:"gl",dialCode:"299"},{name:"Grenada",iso2:"gd",dialCode:"1",priority:14,areaCodes:["473"]},{name:"Guadeloupe",iso2:"gp",dialCode:"590",priority:0},{name:"Guam",iso2:"gu",dialCode:"1",priority:15,areaCodes:["671"]},{name:"Guatemala",iso2:"gt",dialCode:"502"},{name:"Guernsey",iso2:"gg",dialCode:"44",priority:1,areaCodes:["1481","7781","7839","7911"]},{name:"Guinea",iso2:"gn",dialCode:"224"},{name:"Guinea-Bissau",iso2:"gw",dialCode:"245"},{name:"Guyana",iso2:"gy",dialCode:"592"},{name:"Haiti",iso2:"ht",dialCode:"509"},{name:"Honduras",iso2:"hn",dialCode:"504"},{name:"Hong Kong",iso2:"hk",dialCode:"852"},{name:"Hungary",iso2:"hu",dialCode:"36"},{name:"Iceland",iso2:"is",dialCode:"354"},{name:"India",iso2:"in",dialCode:"91"},{name:"Indonesia",iso2:"id",dialCode:"62"},{name:"Iran",iso2:"ir",dialCode:"98"},{name:"Iraq",iso2:"iq",dialCode:"964"},{name:"Ireland",iso2:"ie",dialCode:"353"},{name:"Isle of Man",iso2:"im",dialCode:"44",priority:2,areaCodes:["1624","74576","7524","7924","7624"]},{name:"Israel",iso2:"il",dialCode:"972"},{name:"Italy",iso2:"it",dialCode:"39",priority:0},{name:"Jamaica",iso2:"jm",dialCode:"1",priority:4,areaCodes:["876","658"]},{name:"Japan",iso2:"jp",dialCode:"81"},{name:"Jersey",iso2:"je",dialCode:"44",priority:3,areaCodes:["1534","7509","7700","7797","7829","7937"]},{name:"Jordan",iso2:"jo",dialCode:"962"},{name:"Kazakhstan",iso2:"kz",dialCode:"7",priority:1,areaCodes:["33","7"]},{name:"Kenya",iso2:"ke",dialCode:"254"},{name:"Kiribati",iso2:"ki",dialCode:"686"},{name:"Kosovo",iso2:"xk",dialCode:"383"},{name:"Kuwait",iso2:"kw",dialCode:"965"},{name:"Kyrgyzstan",iso2:"kg",dialCode:"996"},{name:"Laos",iso2:"la",dialCode:"856"},{name:"Latvia",iso2:"lv",dialCode:"371"},{name:"Lebanon",iso2:"lb",dialCode:"961"},{name:"Lesotho",iso2:"ls",dialCode:"266"},{name:"Liberia",iso2:"lr",dialCode:"231"},{name:"Libya",iso2:"ly",dialCode:"218"},{name:"Liechtenstein",iso2:"li",dialCode:"423"},{name:"Lithuania",iso2:"lt",dialCode:"370"},{name:"Luxembourg",iso2:"lu",dialCode:"352"},{name:"Macau",iso2:"mo",dialCode:"853"},{name:"Madagascar",iso2:"mg",dialCode:"261"},{name:"Malawi",iso2:"mw",dialCode:"265"},{name:"Malaysia",iso2:"my",dialCode:"60"},{name:"Maldives",iso2:"mv",dialCode:"960"},{name:"Mali",iso2:"ml",dialCode:"223"},{name:"Malta",iso2:"mt",dialCode:"356"},{name:"Marshall Islands",iso2:"mh",dialCode:"692"},{name:"Martinique",iso2:"mq",dialCode:"596"},{name:"Mauritania",iso2:"mr",dialCode:"222"},{name:"Mauritius",iso2:"mu",dialCode:"230"},{name:"Mayotte",iso2:"yt",dialCode:"262",priority:1,areaCodes:["269","639"]},{name:"Mexico",iso2:"mx",dialCode:"52"},{name:"Micronesia",iso2:"fm",dialCode:"691"},{name:"Moldova",iso2:"md",dialCode:"373"},{name:"Monaco",iso2:"mc",dialCode:"377"},{name:"Mongolia",iso2:"mn",dialCode:"976"},{name:"Montenegro",iso2:"me",dialCode:"382"},{name:"Montserrat",iso2:"ms",dialCode:"1",priority:16,areaCodes:["664"]},{name:"Morocco",iso2:"ma",dialCode:"212",priority:0},{name:"Mozambique",iso2:"mz",dialCode:"258"},{name:"Myanmar (Burma)",iso2:"mm",dialCode:"95"},{name:"Namibia",iso2:"na",dialCode:"264"},{name:"Nauru",iso2:"nr",dialCode:"674"},{name:"Nepal",iso2:"np",dialCode:"977"},{name:"Netherlands",iso2:"nl",dialCode:"31"},{name:"New Caledonia",iso2:"nc",dialCode:"687"},{name:"New Zealand",iso2:"nz",dialCode:"64"},{name:"Nicaragua",iso2:"ni",dialCode:"505"},{name:"Niger",iso2:"ne",dialCode:"227"},{name:"Nigeria",iso2:"ng",dialCode:"234"},{name:"Niue",iso2:"nu",dialCode:"683"},{name:"Norfolk Island",iso2:"nf",dialCode:"672"},{name:"North Korea",iso2:"kp",dialCode:"850"},{name:"North Macedonia",iso2:"mk",dialCode:"389"},{name:"Northern Mariana Islands",iso2:"mp",dialCode:"1",priority:17,areaCodes:["670"]},{name:"Norway",iso2:"no",dialCode:"47",priority:0},{name:"Oman",iso2:"om",dialCode:"968"},{name:"Pakistan",iso2:"pk",dialCode:"92"},{name:"Palau",iso2:"pw",dialCode:"680"},{name:"Palestine",iso2:"ps",dialCode:"970"},{name:"Panama",iso2:"pa",dialCode:"507"},{name:"Papua New Guinea",iso2:"pg",dialCode:"675"},{name:"Paraguay",iso2:"py",dialCode:"595"},{name:"Peru",iso2:"pe",dialCode:"51"},{name:"Philippines",iso2:"ph",dialCode:"63"},{name:"Poland",iso2:"pl",dialCode:"48"},{name:"Portugal",iso2:"pt",dialCode:"351"},{name:"Puerto Rico",iso2:"pr",dialCode:"1",priority:3,areaCodes:["787","939"]},{name:"Qatar",iso2:"qa",dialCode:"974"},{name:"R\xE9union",iso2:"re",dialCode:"262",priority:0},{name:"Romania",iso2:"ro",dialCode:"40"},{name:"Russia",iso2:"ru",dialCode:"7",priority:0},{name:"Rwanda",iso2:"rw",dialCode:"250"},{name:"Samoa",iso2:"ws",dialCode:"685"},{name:"San Marino",iso2:"sm",dialCode:"378"},{name:"S\xE3o Tom\xE9 & Pr\xEDncipe",iso2:"st",dialCode:"239"},{name:"Saudi Arabia",iso2:"sa",dialCode:"966"},{name:"Senegal",iso2:"sn",dialCode:"221"},{name:"Serbia",iso2:"rs",dialCode:"381"},{name:"Seychelles",iso2:"sc",dialCode:"248"},{name:"Sierra Leone",iso2:"sl",dialCode:"232"},{name:"Singapore",iso2:"sg",dialCode:"65"},{name:"Sint Maarten",iso2:"sx",dialCode:"1",priority:21,areaCodes:["721"]},{name:"Slovakia",iso2:"sk",dialCode:"421"},{name:"Slovenia",iso2:"si",dialCode:"386"},{name:"Solomon Islands",iso2:"sb",dialCode:"677"},{name:"Somalia",iso2:"so",dialCode:"252"},{name:"South Africa",iso2:"za",dialCode:"27"},{name:"South Korea",iso2:"kr",dialCode:"82"},{name:"South Sudan",iso2:"ss",dialCode:"211"},{name:"Spain",iso2:"es",dialCode:"34"},{name:"Sri Lanka",iso2:"lk",dialCode:"94"},{name:"St Barth\xE9lemy",iso2:"bl",dialCode:"590",priority:1},{name:"St Helena",iso2:"sh",dialCode:"290"},{name:"St Kitts & Nevis",iso2:"kn",dialCode:"1",priority:18,areaCodes:["869"]},{name:"St Lucia",iso2:"lc",dialCode:"1",priority:19,areaCodes:["758"]},{name:"St Martin",iso2:"mf",dialCode:"590",priority:2},{name:"St Pierre & Miquelon",iso2:"pm",dialCode:"508"},{name:"St Vincent & Grenadines",iso2:"vc",dialCode:"1",priority:20,areaCodes:["784"]},{name:"Sudan",iso2:"sd",dialCode:"249"},{name:"Suriname",iso2:"sr",dialCode:"597"},{name:"Svalbard & Jan Mayen",iso2:"sj",dialCode:"47",priority:1,areaCodes:["79"]},{name:"Sweden",iso2:"se",dialCode:"46"},{name:"Switzerland",iso2:"ch",dialCode:"41"},{name:"Syria",iso2:"sy",dialCode:"963"},{name:"Taiwan",iso2:"tw",dialCode:"886"},{name:"Tajikistan",iso2:"tj",dialCode:"992"},{name:"Tanzania",iso2:"tz",dialCode:"255"},{name:"Thailand",iso2:"th",dialCode:"66"},{name:"Timor-Leste",iso2:"tl",dialCode:"670"},{name:"Togo",iso2:"tg",dialCode:"228"},{name:"Tokelau",iso2:"tk",dialCode:"690"},{name:"Tonga",iso2:"to",dialCode:"676"},{name:"Trinidad & Tobago",iso2:"tt",dialCode:"1",priority:22,areaCodes:["868"]},{name:"Tunisia",iso2:"tn",dialCode:"216"},{name:"Turkey",iso2:"tr",dialCode:"90"},{name:"Turkmenistan",iso2:"tm",dialCode:"993"},{name:"Turks & Caicos Islands",iso2:"tc",dialCode:"1",priority:23,areaCodes:["649"]},{name:"Tuvalu",iso2:"tv",dialCode:"688"},{name:"Uganda",iso2:"ug",dialCode:"256"},{name:"Ukraine",iso2:"ua",dialCode:"380"},{name:"United Arab Emirates",iso2:"ae",dialCode:"971"},{name:"United Kingdom",iso2:"gb",dialCode:"44",priority:0},{name:"United States",iso2:"us",dialCode:"1",priority:0},{name:"Uruguay",iso2:"uy",dialCode:"598"},{name:"US Virgin Islands",iso2:"vi",dialCode:"1",priority:24,areaCodes:["340"]},{name:"Uzbekistan",iso2:"uz",dialCode:"998"},{name:"Vanuatu",iso2:"vu",dialCode:"678"},{name:"Vatican City",iso2:"va",dialCode:"39",priority:1,areaCodes:["06698"]},{name:"Venezuela",iso2:"ve",dialCode:"58"},{name:"Vietnam",iso2:"vn",dialCode:"84"},{name:"Wallis & Futuna",iso2:"wf",dialCode:"681"},{name:"Western Sahara",iso2:"eh",dialCode:"212",priority:1,areaCodes:["5288","5289"]},{name:"Yemen",iso2:"ye",dialCode:"967"},{name:"Zambia",iso2:"zm",dialCode:"260"},{name:"Zimbabwe",iso2:"zw",dialCode:"263"},{name:"\xC5land Islands",iso2:"ax",dialCode:"358",priority:1,areaCodes:["18"]}];function se(t){return t?t.toUpperCase().split("").map(r=>String.fromCodePoint(127397+r.charCodeAt(0))).join(""):"\u{1F310}"}function b6(t){if(t)return k8.find(r=>r.iso2.toLowerCase()===t.toLowerCase())}function T6(t){if(!t)return;let r=String(t).replace(/[^0-9]/g,"");if(r)return k8.find(l=>l.dialCode===r||l.areaCodes?.includes(r))}function B5(t){return`+${t.dialCode}`}var _v=E(Fv(),1);var If=/^([\w-.]+@([\w-]+\.)+[\w-]{2,25})?$/,pe=_v.default.PhoneNumberUtil.getInstance();function Rv(t){return t.formGroupName||t.masterApplyFields.fieldNameForApply}function He(t){return String(t?.phoneNumField?.nationalNumber||t?.phoneNumField?.number||"").trim()}function kf(t){return P5(t?.phoneNumField?.dialCode)}function $6(t){return String(t||"").replace(/\D+/g,"")}function P5(t){let r=$6(t);return r?`+${r}`:""}function Me(t,r){let l=$6(r);return l?`${P5(t)}${l}`:""}var Uf=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Gf(t){if(!t)return t;if(t instanceof Date&&!Number.isNaN(t.getTime())){let n=t.getFullYear(),h=String(t.getMonth()+1).padStart(2,"0"),v=String(t.getDate()).padStart(2,"0");return`${n}-${h}-${v}`}let r=String(t).trim(),l=r.match(/^(\d{4})-(\d{2})-(\d{2})/);if(l)return`${l[1]}-${l[2]}-${l[3]}`;let i=r.match(/^(\d{1,2})\s+([A-Za-z]{3,})\s+(\d{4})$/);if(i){let n=Uf.findIndex(h=>h.toLowerCase()===i[2].slice(0,3).toLowerCase());if(n>=0)return`${i[3]}-${String(n+1).padStart(2,"0")}-${String(Number(i[1])).padStart(2,"0")}`}let o=new Date(r);if(!Number.isNaN(o.getTime())){let n=o.getFullYear(),h=String(o.getMonth()+1).padStart(2,"0"),v=String(o.getDate()).padStart(2,"0");return`${n}-${h}-${v}`}return t}function j2(t){return t?t.split(",").map(r=>r.trim()).filter(Boolean):[]}function Iv(t,r=2){if(t===0)return"0 Bytes";let l=["Bytes","KB","MB","GB","TB"],i=1024,o=Math.floor(Math.log(t)/Math.log(i));return`${(t/Math.pow(i,o)).toFixed(r)} ${l[o]}`}function s7(t,r=4){let l=t==null?"":String(t);if(!l)return"";let i=Array.from(l),o=0;for(let n=i.length-1;n>=0;n-=1)if(!/\s/.test(i[n])){if(o<r){o+=1;continue}i[n]="\u2022"}return i.join("")}function p7(t){let r=t instanceof Date?t:new Date(t);if(Number.isNaN(r.getTime()))return null;let l=new Date,i=l.getFullYear()-r.getFullYear(),o=l.getMonth()-r.getMonth();return(o<0||o===0&&l.getDate()<r.getDate())&&(i-=1),i}function u7(t,r){let l=r?.reponseObject?.parsedResult?.profile,i=l?.PersonalDetails,o=r?.reponseObject?.jobApplication;return[i?.[t],l?.[t],o?.[t]].find(h=>h!=null&&h!=="null")??""}function kv(t){return t.fieldOptions?Array.isArray(t.fieldOptions)?t.fieldOptions.map(r=>r.value):j2(t.fieldOptions):[]}function H7(t,r){let l=r.trim().toLowerCase();return l?t.filter(i=>i.toLowerCase().includes(l)):t}function Wf(t){return t.recruiterUploads==="Mandatory"}function o2(t){return String(t.fieldType||"").toLowerCase()==="consent"}function n2(t,r,l){let i=r.find(v=>j2(v.dependentFieldsName).includes(t));if(!i)return!0;let o=j2(i.dependentFieldsName),n=j2(i.dependentFieldsValues),h=l[i.masterApplyFields.fieldNameForApply];return o.some((v,u)=>v===t&&n[u]===h)}function Dv(t,r,l){return Wf(t)&&n2(t.masterApplyFields.fieldNameForApply,r,l)}function Uv(t){return t.recruiterUploadsLabel?.trim()||t.masterApplyFields.fieldNameForApply||"This field"}function Ev(t){let r=Uv(t);return t.fieldType==="checkbox"||o2(t)?`Please select ${r}`:t.fieldType==="D"?`Please select ${r}`:`${r} is required`}function Nv(t){let r=Uv(t);return t.fieldType==="email"||t.masterApplyFields.fieldNameForApply==="emailId"?"Please enter a valid email address":t.fieldType==="D"?`Please select a valid ${r}`:t.fieldType==="date"?`Please enter a valid ${r}`:t.fieldType==="location"?`Please enter a valid ${r}`:`Please enter a valid ${r}`}function jf(t){let r=String(t||"").trim();return r?new RegExp(`^(?:${r})$`):null}function qf(t,r){let l=b6(t.selectedCountryCode);return(T6(kf(r))||l)?.iso2?.toUpperCase()||void 0}function Kf(t,r){let l=$6(He(r));if(!l)return!0;let i=qf(t,r);try{let o=pe.parseAndKeepRawInput(l,i);return i?pe.isValidNumberForRegion(o,i):pe.isValidNumber(o)}catch{return!1}}function U8(t,r,l,i){let o=t.masterApplyFields.fieldNameForApply;if(!o||o==="uploadResume")return null;let n=t.errorMessage&&t.errorMessage.toUpperCase()!=="NULL"?t.errorMessage:null;if(t.fieldType==="phone"){let h=He(r);return Dv(t,l,i)&&!h?Ev(t):h?Kf(t,r)?null:n||"Provide a valid Phone number":null}if(Dv(t,l,i)&&(r==null||r===""||typeof r=="boolean"&&r===!1))return Ev(t);if(typeof r!="string"||!r)return null;if(t.fieldType==="email"&&!If.test(r))return n||Nv(t);if(t.pattern)try{let h=jf(t.pattern);if(!h)return null;if(!h.test(r))return n||Nv(t)}catch{return null}return null}function Gv(t,r){if(!r)return{isValid:!0};let l=(r.fileFormat||[]).map(n=>String(n).trim().toLowerCase().replace(/^\./,"")),i=t.name.includes(".")&&t.name.split(".").pop()?.trim().toLowerCase()||"";if(!(l.length===0||l.includes(i)))return{isValid:!1,reason:r?.errorFormat||`Unsupported file type for: ${t.name}. Please upload a supported file.`};if(r.fileSize){let n=r.fileSize*1024*1024;if(t.size>n)return{isValid:!1,reason:r?.errorSize||`File size should be ${r.fileSize} MB or less.`}}return{isValid:!0}}function fe(t){return{countryIsoCode:t?.countryIsoCode??"IN",whatsAppEnabled:t?.whatsAppEnabled??!1,maxCount:t?.maxCount??3}}function Wv(t){return{phoneType:"Mobile",phoneNumField:null,whatsAppEnabled:fe(t).whatsAppEnabled}}function jv(t,r){let l=fe(r),i=1;return t.map(o=>{if(o.fieldType!=="phone")return{...o};let n=`phoneField${i}`;return i+=1,{...o,formGroupName:n,selectedCountryCode:l.countryIsoCode,primaryPhoneNumber:n==="phoneField1"}})}function G8(t){let r={},l=fe(t.phoneConfiguration);return t.fields.forEach(i=>{let o=i.masterApplyFields.fieldNameForApply;if(!o||o==="uploadResume")return;if(i.fieldType==="phone"){let h=u7("phoneNoWithoutCountryCode",t.parsedResume),v=u7("countryCode",t.parsedResume)||l.countryIsoCode;r[i.formGroupName||"phoneField1"]={phoneType:"Mobile",phoneNumField:h?{nationalNumber:$6(h),dialCode:P5(v),number:$6(h),e164Number:String(u7("phoneNo",t.parsedResume)||Me(v,h))}:null,whatsAppEnabled:l.whatsAppEnabled};return}if(i.fieldType==="checkbox"||o2(i)){r[o]=!1;return}if(i.fieldType==="T"&&o==="subSource"&&!t.parsedResume){r[o]=t.userName;return}let n=u7(o,t.parsedResume);r[o]=n}),r}function qv(t,r){let l=t.filter(i=>o2(i)).map(i=>{let o=Rv(i);return[i.masterApplyFields.fieldNameForApply,!!r[o]]}).filter(([i])=>!!i);return Object.fromEntries(l)}function W8(t,r){let l=new Map,i={};return t.filter(o=>o.fieldType==="phone").forEach(o=>{let n=Rv(o),h=r[n],v=He(h);if(!v)return;let u=Me(h?.phoneNumField?.dialCode,v);if(l.has(u)){i[n]="Duplicate phone numbers are not allowed";let s=l.get(u);s&&!i[s]&&(i[s]="Duplicate phone numbers are not allowed");return}l.set(u,n)}),i}function Kv(t,r){let l={...t};return r.forEach(i=>{l[i]=Gf(l[i])}),l}function Yv(t){let{profileSources:r,selectedSourceOfProfile:l,selectedProfileSource:i,freeTextSubSource:o}=t,n=o?.trim()||"";if(!l&&!i)return n;let h=r.find(u=>(u.sourceOfProfile||"")===(l||"")&&u.profileSource===i);if(!l)return i||n;let v=`${l}-${i||h?.profileSource||""}`;return n?`${v}-${n}`:v}function Xv(t,r){return t.filter(l=>l.fieldType==="phone").map(l=>({field:l,phoneValue:r[l.formGroupName||"phoneField1"]})).filter(l=>!!l.phoneValue?.phoneNumField).map(({field:l,phoneValue:i})=>{let o=P5(i.phoneNumField?.dialCode),n=$6(i.phoneNumField?.nationalNumber||i.phoneNumField?.number);return{phoneType:i.phoneType,associatedEntityType:"CANDIDATE",primary:!!l.primaryPhoneNumber,whatsappEnabled:i.whatsAppEnabled,countryCode:o,number:n}})}function Qv(t){let r={...t.values},l=t.parsedResume?.reponseObject?.jobApplication||{};t.fields.filter(s=>s.fieldType==="phone").map(s=>s.formGroupName||"phoneField1").forEach(s=>{delete r[s]});let o=t.fields.find(s=>s.fieldType==="phone"&&s.primaryPhoneNumber),n=o?t.values[o.formGroupName||"phoneField1"]:void 0,h={...l,...r,subSource:t.subSourceValue,companyId:t.context.job.companyId,jobId:t.context.job.id,fileName:t.file?.name||""};n?.phoneNumField&&(h.phoneNo=n.phoneNumField.e164Number||Me(n.phoneNumField.dialCode,n.phoneNumField.nationalNumber),h.phoneNoWithoutCountryCode=$6(n.phoneNumField.number??n.phoneNumField.nationalNumber),h.countryCode=P5(n.phoneNumField.dialCode));let v={data:JSON.stringify(h),referrerEmailId:t.context.user.email,referrerId:t.context.user.id,sendNotification:t.sendNotification?"Yes":"No",profile:"{}"},u=new FormData;return u.append("addProfileReqBody",JSON.stringify(v)),t.file&&u.append("file",t.file),u.append("parsedResultId",String(t.parsedResume?.reponseObject?.parsedObjectId||"")),u.append("isAsync","false"),t.contactInformation&&t.contactInformation.length>0&&u.append("contactInformation",JSON.stringify(t.contactInformation)),t.consent&&Object.keys(t.consent).length>0&&u.append("consent",JSON.stringify(t.consent)),u}async function Jv(t,r){let l=await t.loadInitialData(r),i=jv(l.applyFields,l.phoneConfiguration),o=G8({fields:i,userName:r.user.name,phoneConfiguration:l.phoneConfiguration});return{initialization:l,fields:i,values:o}}function tg(t){return G8({fields:t.fields,parsedResume:t.parsedResume,userName:t.context.user.name,phoneConfiguration:t.initialization.phoneConfiguration})}async function ag(t){let r=t.fields.filter(v=>v.fieldType==="date").map(v=>v.masterApplyFields.fieldNameForApply),l=Kv(t.values,r),i=Xv(t.fields,l),o=qv(t.fields,l),n=Yv({profileSources:t.profileSources,selectedSourceOfProfile:t.selectedSourceOfProfile,selectedProfileSource:t.selectedProfileSource,freeTextSubSource:t.subSourceText}),h=Qv({fields:t.fields,context:t.context,file:t.file,values:l,parsedResume:t.parsedResume,contactInformation:i,consent:Object.keys(o).length>0?o:t.consent,sendNotification:t.sendNotification,subSourceValue:n});return t.api.submitProfile(h,t.context)}var I1=E(k(),1);function j8(t){return t.formGroupName||t.masterApplyFields.fieldNameForApply}function rg(t,r){return t.find(l=>j8(l)===r||l.masterApplyFields.fieldNameForApply===r)}function Ae(t,r,l){let i={};return t.forEach(o=>{let n=j8(o);if(!n)return;let h=U8(o,l[n],r,l);h&&(i[n]=h)}),Object.assign(i,W8(t,l)),i}function Yf(t,r,l,i){let o={...i},n=rg(r,t);if(!n?.dependentFieldsName)return o;let h=j2(n.dependentFieldsName);return[...new Set(h)].forEach(u=>{let s=r.find(M=>M.masterApplyFields.fieldNameForApply===u);if(!s)return;let p=j8(s);if(!n2(u,r,l)){delete o[p];return}let A=U8(s,l[p],r,l);A?o[p]=A:delete o[p]}),o}function lg(t){let[r,l]=(0,I1.useState)(null),[i,o]=(0,I1.useState)([]),[n,h]=(0,I1.useState)({}),[v,u]=(0,I1.useState)(null),[s,p]=(0,I1.useState)(null),[A,M]=(0,I1.useState)(null),[H,m]=(0,I1.useState)(!1),[L,w]=(0,I1.useState)(!1),[Z,V]=(0,I1.useState)(!1),[x,z]=(0,I1.useState)({}),[B,P]=(0,I1.useState)(!1),[$,S]=(0,I1.useState)(""),[O,y]=(0,I1.useState)(""),[F,U]=(0,I1.useState)(""),[q,G]=(0,I1.useState)(!0);(0,I1.useEffect)(()=>{if(!t.open)return;let Y=!1;return m(!0),M(null),p(null),u(null),z({}),P(!1),Jv(t.api,t.context).then(o1=>{Y||(l(o1.initialization),o(o1.fields),h(o1.values),U(o1.initialization.profileSources?.length?"":t.context.user.name))}).finally(()=>{Y||m(!1)}),()=>{Y=!0}},[t.api,t.context,t.open]);let I=(0,I1.useMemo)(()=>i.filter(Y=>{let o1=Y.masterApplyFields.fieldNameForApply;return o1&&o1!=="uploadResume"&&!o2(Y)&&n2(o1,i,n)}),[i,n]),J=(0,I1.useMemo)(()=>i.filter(Y=>Y.fieldType==="phone"),[i]),A1=!!(r&&J.length<r.phoneConfiguration.maxCount),X=r?.resumeOptional===!0,T=!!(!!(s||X&&A==="manual")&&!H&&!L&&!Z);(0,I1.useEffect)(()=>{let Y=new Set(I.map(o1=>j8(o1)).filter(Boolean));z(o1=>{let e1={};return Object.entries(o1).forEach(([l0,e0])=>{(l0==="file"||Y.has(l0))&&(e1[l0]=e0)}),B?{...e1,...Ae(I,i,n)}:e1})},[i,n,B,I]);function W(Y,o1){let e1={...n,[Y]:o1};if(Y==="dateOfBirth"){let C1=p7(String(o1));C1!=null&&"agee"in e1&&(e1.agee=C1)}h(e1),z(C1=>{let l0={...C1};delete l0[Y];let e0=Yf(Y,i,e1,l0);if(!B)return e0;let M0=new Set(i.filter(f0=>{let q2=f0.masterApplyFields.fieldNameForApply;return q2&&q2!=="uploadResume"&&!o2(f0)&&n2(q2,i,e1)}).map(f0=>j8(f0)));return Object.keys(e0).forEach(f0=>{f0!=="file"&&!M0.has(f0)&&delete e0[f0]}),{...e0,...Ae(i.filter(f0=>{let q2=f0.masterApplyFields.fieldNameForApply;return q2&&q2!=="uploadResume"&&!o2(f0)&&n2(q2,i,e1)}),i,e1)}})}function D(Y){let o1=rg(i,Y);if(!o1)return;let e1={...n},C1=j8(o1);if(!n2(o1.masterApplyFields.fieldNameForApply,i,e1)){z(e0=>{let M0={...e0};return delete M0[C1],M0});return}let l0=U8(o1,e1[C1],i,e1);z(e0=>{let M0={...e0};return l0?M0[C1]=l0:delete M0[C1],Object.assign(M0,W8(I,e1)),M0})}function R(){if(p(null),u(null),M(null),z(Y=>{let o1={...Y};return delete o1.file,o1}),!r){h({});return}h(G8({fields:i,userName:t.context.user.name,phoneConfiguration:r.phoneConfiguration}))}function c1(){r?.resumeOptional===!0&&(M("manual"),p(null),u(null),P(!1),z(Y=>{let o1={...Y};return delete o1.file,o1}),r&&h(G8({fields:i,userName:t.context.user.name,phoneConfiguration:r.phoneConfiguration})))}async function Z1(Y){if(!r)return;let o1=Gv(Y,r.supportedFiles.addProfile);if(!o1.isValid){z(e1=>({...e1,file:o1.reason||"Unsupported file"}));return}M("resume"),p(Y),w(!0),z(e1=>{let C1={...e1};return delete C1.file,C1});try{let e1=await t.api.parseResume(Y,t.context),C1=e1?.responseStatus,l0=e1?.responseCode;if(C1==="FAILURE"||typeof l0=="number"&&l0!==200){let f0=e1?.reponseObject?.errorMessage||"Failed to process the file. Please try again.";p(null),M(null),u(null),z(q2=>({...q2,file:f0}));return}let M0=tg({fields:i,context:t.context,parsedResume:e1,initialization:r});return u(e1),h(f0=>({...f0,...M0})),{isSuccess:!0}}catch{u(null),p(null),M(null),z(e1=>({...e1,file:"Failed to process the file. Please try again."}))}finally{w(!1)}}async function j(){if(!r)return null;if(!(r.resumeOptional===!0&&A==="manual")&&!s)return z(e1=>({...e1,file:"Please upload a resume before submitting"})),null;P(!0);let o1=Ae(I,i,n);if(Object.keys(o1).length>0)return z(e1=>({...e1,...o1})),null;V(!0);try{return await ag({api:t.api,context:t.context,fields:i,values:n,file:s,parsedResume:v,sendNotification:q,profileSources:r.profileSources,selectedSourceOfProfile:$||void 0,selectedProfileSource:O||void 0,subSourceText:F})}finally{V(!1)}}function m1(){return I}function Q(Y,o1){let e1=Array.isArray(Y.fieldOptions)?Y.fieldOptions.map(C1=>C1.value):String(Y.fieldOptions||"").split(",").map(C1=>C1.trim()).filter(Boolean);return H7(e1,o1)}function r0(Y){if(!r||!A1)return;let o1=J.reduce((C1,l0)=>{let e0=l0.formGroupName?.match(/^phoneField(\d+)$/),M0=e0?Number(e0[1]):1;return Math.max(C1,M0)},1)+1,e1={...Y,recruiterUploads:"Non Mandatory",primaryPhoneNumber:!1,formGroupName:`phoneField${o1}`,selectedCountryCode:r.phoneConfiguration.countryIsoCode};o(C1=>{let l0=C1.findIndex(M0=>M0.formGroupName===Y.formGroupName);if(l0===-1)return[...C1,e1];let e0=[...C1];return e0.splice(l0+1,0,e1),e0}),h(C1=>({...C1,[e1.formGroupName||`phoneField${o1}`]:Wv(r.phoneConfiguration)}))}function m7(Y){Y.primaryPhoneNumber||!Y.formGroupName||(o(o1=>o1.filter(e1=>e1.formGroupName!==Y.formGroupName)),h(o1=>{let e1={...o1};return delete e1[Y.formGroupName],e1}))}return{initialization:r,fields:i,formValues:n,parsedResume:v,selectedFile:s,creationMode:A,isInitializing:H,isParsing:L,isSubmitting:Z,errors:x,sourceOfProfile:$,profileSource:O,subSourceText:F,sendNotification:q,canSubmit:T,setFieldValue:W,validateField:D,setSourceOfProfile:S,setProfileSource:y,setSubSourceText:U,setSendNotification:G,clearSelectedFile:R,startManualEntry:c1,uploadFile:Z1,submit:j,getVisibleFields:m1,getDropdownOptions:Q,addPhoneField:r0,removePhoneField:m7,canAddMorePhoneFields:A1,phoneFieldCount:J.length}}var sg=E(ra(),1),eg=["in","us"];function q8(){return(0,C.jsx)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:(0,C.jsx)("path",{d:"M6 6l12 12M18 6L6 18",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}function ig(){return(0,C.jsx)(bv,{"aria-hidden":"true"})}function Xf(){return(0,C.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,C.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:"currentColor",strokeWidth:"1.8"}),(0,C.jsx)("path",{d:"M12 10.2v5.2",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),(0,C.jsx)("circle",{cx:"12",cy:"7.4",r:"1.1",fill:"currentColor"})]})}function Qf(){return(0,C.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,C.jsx)("path",{d:"M12 21s-6-5.1-6-11a6 6 0 1112 0c0 5.9-6 11-6 11z",fill:"none",stroke:"currentColor",strokeWidth:"2"}),(0,C.jsx)("circle",{cx:"12",cy:"10",r:"2.5",fill:"currentColor"})]})}function Jf(){return(0,C.jsx)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:(0,C.jsx)("path",{d:"M7 3v3m10-3v3M4 9h16M6 5h12a1 1 0 011 1v13a1 1 0 01-1 1H6a1 1 0 01-1-1V6a1 1 0 011-1z",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})}function cg(){return(0,C.jsx)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:(0,C.jsx)("path",{d:"M12 5v14M5 12h14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}function tA(){return(0,C.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,C.jsx)("path",{d:"M6 12h12",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round"}),(0,C.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:"currentColor",strokeWidth:"1.8"})]})}function aA({onAdd:t,onRemove:r}){let[l,i]=(0,s1.useState)(!1),o=(0,s1.useRef)(null);return(0,s1.useEffect)(()=>{if(!l)return;function n(h){o.current&&!o.current.contains(h.target)&&i(!1)}return document.addEventListener("pointerdown",n),()=>document.removeEventListener("pointerdown",n)},[l]),(0,C.jsxs)("div",{ref:o,className:"rae-phone-menu",children:[(0,C.jsx)("button",{type:"button",className:"rae-phone-action rae-phone-action--edit","aria-label":"Phone options",onClick:()=>i(n=>!n),children:(0,C.jsx)(Ov,{"aria-hidden":!0})}),l?(0,C.jsxs)("div",{className:"rae-phone-menu__dropdown",children:[(0,C.jsx)("button",{type:"button",className:"rae-phone-menu__item",onClick:()=>{t(),i(!1)},children:"Add another"}),(0,C.jsx)("button",{type:"button",className:"rae-phone-menu__item rae-phone-menu__item--remove",onClick:()=>{r(),i(!1)},children:"Remove"})]}):null]})}function Le(){return(0,C.jsx)("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:(0,C.jsx)("path",{d:"M5 10.5l3 3 7-7",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function rA(){return(0,C.jsx)("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:(0,C.jsx)("path",{d:"M8.5 14a5.5 5.5 0 114.1-1.83L16 15.58 14.58 17l-3.4-3.4A5.47 5.47 0 018.5 14zm0-2a3.5 3.5 0 100-7 3.5 3.5 0 000 7z",fill:"currentColor"})})}function K8(){return(0,C.jsx)("span",{className:"rae-spinner","aria-hidden":"true"})}function hg(t,r=".rae-select-options",l=12){t instanceof HTMLElement&&window.requestAnimationFrame(()=>{let i=t.closest(".rae-modal__body--expanded")||t.closest(".rae-modal__body"),o=t.querySelector(r);if(!(i instanceof HTMLElement)||!(o instanceof HTMLElement))return;let n=i.getBoundingClientRect(),h=o.getBoundingClientRect(),v=h.bottom-(n.bottom-l),u=n.top+l-h.top;if(v>0){i.scrollTop+=v;return}u>0&&(i.scrollTop-=u)})}function lA(t){let r=t.minYearOfExperience,l=t.maxYearOfExperience;return!r&&!l?"Not Specified":r&&l?`${r} - ${l} Years`:r?`${r}+ Years`:`Up to ${l} Years`}var dg=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function vg(t){if(!t)return"";if(t instanceof Date&&!Number.isNaN(t.getTime())){let n=t.getFullYear(),h=String(t.getMonth()+1).padStart(2,"0"),v=String(t.getDate()).padStart(2,"0");return`${n}-${h}-${v}`}let r=String(t).trim(),l=r.match(/^(\d{4})-(\d{2})-(\d{2})/);if(l)return`${l[1]}-${l[2]}-${l[3]}`;let i=r.match(/^(\d{1,2})\s+([A-Za-z]{3,})\s+(\d{4})$/);if(i){let n=dg.findIndex(h=>h.toLowerCase()===i[2].slice(0,3).toLowerCase());if(n>=0)return`${i[3]}-${String(n+1).padStart(2,"0")}-${String(Number(i[1])).padStart(2,"0")}`}let o=new Date(r);if(!Number.isNaN(o.getTime())){let n=o.getFullYear(),h=String(o.getMonth()+1).padStart(2,"0"),v=String(o.getDate()).padStart(2,"0");return`${n}-${h}-${v}`}return""}function eA(t){let r=vg(t);if(!r)return"";let[l,i,o]=r.split("-");return`${o} ${dg[Number(i)-1]} ${l}`}function b5(t){return t.formGroupName||t.masterApplyFields.fieldNameForApply}function Ze(t){return String(t||"").replace(/\D+/g,"")}function M7(t){let r=Ze(t);return r?`+${r}`:""}function iA(t){let r=t||{},l=r.code??r.responseCode,i=typeof l=="number"?l:void 0,o=typeof r.message=="string"&&r.message||typeof r.errorMessage=="string"&&r.errorMessage||"Something went wrong, Please try again!";return i===void 0||i===200?{isSuccess:!0,toast:{kind:"success",message:typeof r.message=="string"&&r.message?r.message:"Profile Added Successfully"}}:i===403||i===500?{isSuccess:!1,toast:{kind:"warning",message:o}}:{isSuccess:!1,toast:{kind:"error",message:o}}}function oA(t){t instanceof HTMLElement&&window.setTimeout(()=>{let r=t.querySelector(".rae-field-error");if(!(r instanceof HTMLElement))return;let l=r.closest(".rae-field")||r;if(!(l instanceof HTMLElement))return;let i=t.querySelector(".rae-modal__body--expanded")||t.querySelector(".rae-modal__body");if(i instanceof HTMLElement){let n=l.getBoundingClientRect(),h=i.getBoundingClientRect(),v=n.top-h.top+i.scrollTop-80;i.scrollTo({top:Math.max(0,v),behavior:"smooth"})}else l.scrollIntoView({behavior:"smooth",block:"center"});let o=l.querySelector("input, button, textarea, [role='combobox'], [role='button']");o instanceof HTMLElement&&o.focus({preventScroll:!0})},100)}function nA(t){let[r,l]=(0,s1.useState)(""),i=T6(t.selectedDialCode)||b6(t.selectedIso2)||b6("IN")||k8[0],o=s1.default.useMemo(()=>{let n=r.trim().toLowerCase(),h=s=>n?s.name.toLowerCase().includes(n)||s.iso2.toLowerCase().includes(n)||`+${s.dialCode}`.includes(n):!0,v=k8.filter(s=>eg.includes(s.iso2.toLowerCase())&&h(s)),u=k8.filter(s=>!eg.includes(s.iso2.toLowerCase())&&h(s));return[...v,...u]},[r]);return(0,C.jsxs)(lv,{value:i,onChange:n=>{n&&t.onSelect(n),l("")},immediate:!0,children:[(0,C.jsx)("input",{type:"hidden",name:t.name||"countryCode",value:i?.iso2||""}),(0,C.jsxs)("div",{className:"rae-country-select",children:[(0,C.jsxs)("div",{className:"rae-country-select__trigger-shell",children:[(0,C.jsx)("span",{className:"rae-country-select__flag","aria-hidden":"true",children:se(i?.iso2)}),(0,C.jsx)(Kl,{className:"rae-country-select__trigger",displayValue:()=>i?B5(i):"+91",onChange:n=>l(n.target.value),autoComplete:"off",placeholder:"+91","aria-label":"Search country code"}),(0,C.jsx)(ql,{className:"rae-country-select__button",children:(0,C.jsx)("span",{className:"rae-country-select__arrow","aria-hidden":"true",children:"\u25BE"})})]}),(0,C.jsx)(Yl,{className:"rae-country-select__menu",children:(0,C.jsx)("div",{className:"rae-country-select__list",role:"listbox","aria-label":"Country code options",children:o.map(n=>(0,C.jsxs)(Xl,{value:n,className:"rae-country-select__option",children:[(0,C.jsx)("span",{className:"rae-country-select__flag","aria-hidden":"true",children:se(n.iso2)}),(0,C.jsx)("span",{className:"rae-country-select__option-code",children:B5(n)}),(0,C.jsx)("span",{className:"rae-country-select__name",children:n.name})]},`${n.iso2}-${n.dialCode}-${n.priority??0}`))})})]})]})}function a6(t){return(0,C.jsx)(le,{id:t.id,name:t.name,className:`rae-field-input${t.className?` ${t.className}`:""}`,type:t.type||"text",value:t.value,placeholder:t.placeholder||"",onChange:t.onChange,onBlur:t.onBlur,"aria-invalid":t.invalid||void 0,autoComplete:t.autoComplete,inputMode:t.inputMode,readOnly:t.readOnly})}function gg(){return(0,C.jsx)("svg",{"aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,C.jsx)("polyline",{points:"6 9 12 15 18 9"})})}function y5(t){let r=t.options.find(n=>n.value===t.value),l=(0,s1.useRef)(null),i=t.id==="rae-source-of-profile"||t.id==="rae-profile-source"||t.id==="rae-sub-source-select"||t.id==="rae-profile-source-fallback",o=`rae-select-shell${t.shellClassName?` ${t.shellClassName}`:""}${i?" rae-footer-select":""}`;return(0,C.jsxs)(Bv,{value:t.value||"",onChange:n=>{t.onChange({target:{value:n}})},children:[(0,C.jsx)("input",{type:"hidden",id:t.id,name:t.name,value:t.value||""}),(0,C.jsxs)("div",{ref:l,className:o,children:[(0,C.jsxs)(ce,{className:`rae-field-input rae-field-input--button rae-select-button${t.invalid?" rae-field-input--invalid":""}`,onClick:()=>{hg(l.current)},onBlur:t.onBlur,children:[(0,C.jsx)("span",{className:`rae-select-button__text${r?"":" rae-select-button__text--placeholder"}`,children:r?.label||t.placeholder||"Select an option"}),(0,C.jsx)("span",{className:"rae-select-arrow","aria-hidden":"true",children:(0,C.jsx)(gg,{})})]}),(0,C.jsx)(he,{className:"rae-select-options",children:t.options.map(n=>(0,C.jsxs)(de,{value:n.value,className:"rae-select-option",children:[(0,C.jsx)("span",{className:"rae-select-option__label",children:n.label}),(0,C.jsx)("span",{className:"rae-select-option__check",children:(0,C.jsx)(Le,{})})]},n.value))})]})]})}function cA(t){let[r,l]=(0,s1.useState)(""),[i,o]=(0,s1.useState)(!1),[n,h]=(0,s1.useState)(-1),v=(0,s1.useRef)(null),u=(0,s1.useRef)(null),s=H=>{H.stopPropagation()},p=t.options.find(H=>H.value===t.value)||null,A=s1.default.useMemo(()=>{let H=r.trim().toLowerCase();return H?t.options.filter(m=>m.label.toLowerCase().includes(H)):t.options},[t.options,r]);(0,s1.useEffect)(()=>{if(!i)return;let H=m=>{v.current?.contains(m.target)||(o(!1),l(""),t.onBlur?.())};return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[i]),(0,s1.useEffect)(()=>{i&&(window.requestAnimationFrame(()=>u.current?.focus()),hg(v.current))},[i]),(0,s1.useEffect)(()=>{if(!i||!A.length){h(-1);return}let H=A.findIndex(m=>m.value===t.value);h(H>=0?H:0)},[A,i,t.value]);let M=H=>{t.onChange({target:{value:H.value}}),o(!1),l("")};return(0,C.jsxs)("div",{ref:v,className:`rae-select-shell rae-searchable-select${i?" rae-select-shell--open":""}${t.shellClassName?` ${t.shellClassName}`:""}`,onBlur:H=>{H.currentTarget.contains(H.relatedTarget)||t.onBlur?.()},children:[(0,C.jsx)("input",{type:"hidden",id:t.id,name:t.name,value:t.value||""}),(0,C.jsxs)("button",{type:"button",className:`rae-field-input rae-field-input--button rae-select-button${t.invalid?" rae-field-input--invalid":""}`,onClick:()=>{o(H=>!H),i&&l("")},"aria-haspopup":"listbox","aria-expanded":i,children:[(0,C.jsx)("span",{className:`rae-select-button__text${p?"":" rae-select-button__text--placeholder"}`,children:p?.label||t.placeholder||"Select an option"}),(0,C.jsx)("span",{className:"rae-select-arrow","aria-hidden":"true",children:(0,C.jsx)(gg,{})})]}),i?(0,C.jsxs)("div",{className:"rae-select-options rae-searchable-options",role:"listbox",onMouseDown:s,onPointerDown:s,onClick:s,onWheel:s,children:[(0,C.jsx)("div",{className:"rae-searchable-options__search",children:(0,C.jsxs)("div",{className:"rae-searchable-options__search-box",children:[(0,C.jsx)(rA,{}),(0,C.jsx)("input",{ref:u,className:"rae-searchable-options__input",value:r,onChange:H=>l(H.target.value),placeholder:"Search...",autoComplete:"off","aria-label":`Search ${t.placeholder||"options"}`,onMouseDown:s,onPointerDown:s,onClick:s,onKeyDown:H=>{if(H.key==="ArrowDown"){H.preventDefault(),h(m=>A.length?Math.min(m+1,A.length-1):-1);return}if(H.key==="ArrowUp"){H.preventDefault(),h(m=>A.length?Math.max(m-1,0):-1);return}if(H.key==="Enter"&&n>=0&&A[n]){H.preventDefault(),M(A[n]);return}H.key==="Escape"&&(o(!1),l(""),t.onBlur?.())}})]})}),(0,C.jsx)("div",{className:"rae-searchable-options__list",children:A.length?A.map((H,m)=>(0,C.jsxs)("button",{type:"button",role:"option","aria-selected":H.value===t.value,className:`rae-select-option${H.value===t.value?" rae-select-option--selected":""}${n===m?" rae-select-option--active":""}`,onMouseEnter:()=>h(m),onMouseDown:L=>{L.preventDefault(),L.stopPropagation()},onPointerDown:s,onClick:L=>{L.stopPropagation(),M(H)},children:[(0,C.jsx)("span",{className:"rae-select-option__label",children:H.label}),H.value===t.value?(0,C.jsx)("span",{className:"rae-select-option__check",children:(0,C.jsx)(Le,{})}):null]},H.value)):(0,C.jsx)("div",{className:"rae-select-option rae-select-option--empty",children:"No results found."})})]}):null]})}function xe(t){return(0,C.jsxs)("label",{className:t.className||"rae-checkbox-field",children:[(0,C.jsx)("input",{type:"hidden",name:t.name,value:t.checked?"true":"false"}),(0,C.jsxs)(Kc,{checked:t.checked,onChange:r=>t.onChange({target:{checked:r}}),className:"rae-headless-checkbox",children:[(0,C.jsx)("span",{className:"rae-headless-checkbox__bg"}),(0,C.jsx)("span",{className:"rae-headless-checkbox__icon",children:(0,C.jsx)(Le,{})})]}),(0,C.jsx)("span",{children:t.label})]})}function hA({field:t,value:r,error:l,inputId:i,inputName:o,onBlur:n,onLocationInput:h,onLocationSuggestionSelect:v,onLocationBlur:u,locationSuggestions:s,isLoadingLocationSuggestions:p,readOnly:A}){let M=(0,s1.useRef)(null),[H,m]=(0,s1.useState)(null);return(0,s1.useEffect)(()=>{if(!s||s.length===0){m(null);return}let L=M.current?.querySelector("input");if(!L)return;let w=L.getBoundingClientRect();m({position:"fixed",top:`${w.bottom+4}px`,left:`${w.left}px`,width:`${w.width}px`,zIndex:99999})},[s]),(0,s1.useEffect)(()=>{M.current&&(M.current.__raeOnSuggestionSelect=v)}),(0,C.jsxs)("div",{ref:M,className:"rae-location-field rae-location-shell",onBlur:L=>{L.currentTarget.contains(L.relatedTarget)||u?.()},children:[(0,C.jsx)(a6,{id:i,name:o,value:typeof r=="string"||typeof r=="number"?String(r):"",placeholder:t.placeholder||"",invalid:!!l,onChange:L=>h?.(L.target.value),onBlur:n,autoComplete:"off",readOnly:A}),p?(0,C.jsx)("div",{className:"rae-location-status",children:"Fetching locations..."}):null,s&&s.length>0?(0,C.jsx)("div",{className:"rae-location-suggestions",role:"listbox","aria-label":`${t.recruiterUploadsLabel} suggestions`,style:H||{},children:s.map(L=>(0,C.jsx)("button",{type:"button",className:"rae-location-suggestion","data-suggestion":L,onMouseDown:w=>{w.preventDefault(),v?.(L)},children:L},L))}):null]})}function ze(t){let{field:r,value:l,error:i,inputId:o,inputName:n,onChange:h,onBlur:v,getDropdownOptions:u,onAddPhoneField:s,onRemovePhoneField:p,canAddMorePhoneFields:A,phoneFieldCount:M,locationSuggestions:H,isLoadingLocationSuggestions:m,onLocationInput:L,onLocationSuggestionSelect:w,onLocationBlur:Z,readOnly:V}=t,x=r.fieldType;if(x==="checkbox")return(0,C.jsx)(xe,{id:o,name:n,checked:!!l,onChange:z=>h(z.target.checked),label:r.recruiterUploadsLabel});if(x==="D")return(0,C.jsx)(cA,{id:o,name:n,value:String(l??""),placeholder:r.placeholder||"Select an option",invalid:!!i,onChange:z=>h(z.target.value),onBlur:v,options:u(r,"").map(z=>({label:z,value:z}))});if(x==="date"){let z=vg(l);return(0,C.jsxs)("label",{className:"rae-date-shell",children:[(0,C.jsx)(le,{id:o,name:`${n}-display`,className:"rae-field-input rae-field-input--date",type:"text",value:eA(l),placeholder:"",readOnly:!0,onBlur:v,onClick:B=>{let P=B.currentTarget.parentElement?.querySelector("input[type='date']");P instanceof HTMLInputElement&&(P.showPicker?.(),P.focus())},"aria-invalid":i||void 0}),(0,C.jsx)("input",{className:"rae-native-date-input",type:"date",value:z,onChange:B=>h(B.target.value),onBlur:v,"aria-label":`Select ${r.recruiterUploadsLabel}`,tabIndex:-1}),(0,C.jsx)("button",{type:"button",className:"rae-date-trigger",onClick:B=>{let P=B.currentTarget.parentElement?.querySelector("input[type='date']");P instanceof HTMLInputElement&&(P.showPicker?.(),P.focus())},"aria-label":`Select ${r.recruiterUploadsLabel}`,children:(0,C.jsx)(Jf,{})})]})}if(x==="phone"){let z=l||{phoneType:"Mobile",phoneNumField:null,whatsAppEnabled:!1},B=T6(z.phoneNumField?.dialCode)||b6(r.selectedCountryCode)||b6("IN"),P=B?M7(B5(B)):"+91",$=Ze(z.phoneNumField?.nationalNumber||"");return(0,C.jsxs)("div",{className:"rae-phone-stack",children:[(0,C.jsxs)("div",{className:"rae-phone-row",children:[(0,C.jsx)(y5,{id:`${o}-type`,name:`${n}-type`,shellClassName:"rae-phone-type",value:z.phoneType,onChange:S=>h({...z,phoneType:S.target.value}),options:[{label:"Mobile",value:"Mobile"},{label:"Home",value:"Home"},{label:"Work",value:"Work"},{label:"Other",value:"Other"}]}),(0,C.jsxs)("div",{className:"rae-phone-number-shell",children:[(0,C.jsx)(nA,{name:`${n}-country`,selectedIso2:r.selectedCountryCode,selectedDialCode:z.phoneNumField?.dialCode,onSelect:S=>{let O=M7(B5(S));h({...z,phoneNumField:{...z.phoneNumField,dialCode:O,nationalNumber:$,number:$,e164Number:`${O}${$}`}})}}),(0,C.jsx)(a6,{id:`${o}-number`,name:`${n}-number`,value:$,placeholder:"Phone number",inputMode:"tel",invalid:!!i,onChange:S=>{let O=Ze(S.target.value);h({...z,phoneNumField:{...z.phoneNumField,nationalNumber:O,number:O,dialCode:M7(z.phoneNumField?.dialCode||P),e164Number:`${M7(z.phoneNumField?.dialCode||P)}${O}`}})}})]}),r.primaryPhoneNumber?M===1?(0,C.jsx)("button",{type:"button",className:"rae-phone-action rae-phone-action--add","aria-label":"Add phone field",onClick:()=>s?.(r),children:(0,C.jsx)(cg,{})}):null:A?(0,C.jsx)(aA,{onAdd:()=>s?.(r),onRemove:()=>p?.(r)}):(0,C.jsx)("button",{type:"button",className:"rae-phone-action rae-phone-action--remove","aria-label":"Remove phone field",onClick:()=>p?.(r),children:(0,C.jsx)(tA,{})})]}),(0,C.jsx)(xe,{id:`${o}-whatsapp`,name:`${n}-whatsapp`,className:"rae-checkbox-field rae-checkbox-field--inline",checked:!!z.whatsAppEnabled,onChange:S=>h({...z,whatsAppEnabled:S.target.checked}),label:"This number is WhatsApp enabled"})]})}return x==="location"?(0,C.jsx)(hA,{field:r,value:l,error:i,inputId:o,inputName:n,onBlur:v,onLocationInput:L,onLocationSuggestionSelect:w,onLocationBlur:Z,locationSuggestions:H,isLoadingLocationSuggestions:m,readOnly:V}):(0,C.jsx)(a6,{id:o,name:n,type:x==="email"?"email":"text",value:typeof l=="string"||typeof l=="number"?String(l):"",placeholder:r.placeholder||"",invalid:!!i,onChange:z=>h(z.target.value),onBlur:v,readOnly:V})}function ug(t){let r=lg({open:t.open,api:t.api,context:t.context}),l=(0,s1.useId)(),i=(0,s1.useRef)(null),[o,n]=(0,s1.useState)(null),[h,v]=(0,s1.useState)({}),[u,s]=(0,s1.useState)({}),[p,A]=(0,s1.useState)(""),[M,H]=(0,s1.useState)({}),m=(0,s1.useRef)({}),L=(0,s1.useRef)({});if((0,s1.useEffect)(()=>{if(!o)return;let T=window.setTimeout(()=>{n(null)},4500);return()=>{window.clearTimeout(T)}},[o]),(0,s1.useEffect)(()=>()=>{Object.values(L.current).forEach(T=>{window.clearTimeout(T)})},[]),(0,s1.useEffect)(()=>{H(T=>{let W={...T};return r.fields.forEach(D=>{let R=b5(D);if(!R||!D.masterApplyFields.maskable)return;let c1=r.formValues[R];if(!(c1!=null&&String(c1).trim()!=="")){W[R]=!1;return}(W[R]===void 0||r.parsedResume)&&(W[R]=!0)}),W})},[r.fields,r.formValues,r.parsedResume]),!t.open)return null;let w=[...r.getVisibleFields().filter(T=>T.fieldType!=="checkbox"),...r.getVisibleFields().filter(T=>T.fieldType==="checkbox")],Z=r.initialization?.supportedFiles.addProfile,V=r.initialization?.resumeOptional===!0,x=!!((r.selectedFile||V&&r.creationMode==="manual")&&!r.isParsing),z=!!(V&&!r.selectedFile&&r.creationMode!=="manual"),B=!V&&!r.selectedFile,P=r.initialization?.profileSources||[],$=[...new Set(P.map(T=>T.sourceOfProfile).filter(Boolean))],S=!!$[0],O=S?r.sourceOfProfile?P.filter(T=>T.sourceOfProfile===r.sourceOfProfile):[]:P,y=S?P.find(T=>T.sourceOfProfile===r.sourceOfProfile&&T.profileSource===r.profileSource):P.find(T=>T.profileSource===r.profileSource),F=j2(y?.subSourceValues),U=!!(S&&y?.sourceOfProfile&&y?.subSourceValues),q=!!(S&&y?.sourceOfProfile&&!y?.subSourceValues);function G(T){r.setSourceOfProfile(T),r.setProfileSource(""),r.setSubSourceText(""),A("")}function I(T){r.setProfileSource(T),A("");let W=S?P.find(D=>D.sourceOfProfile===r.sourceOfProfile&&D.profileSource===T):P.find(D=>D.profileSource===T);if(!W){r.setSubSourceText("");return}if(!S){r.setSubSourceText(W.profileSource||"");return}if(W.subSourceValues){r.setSubSourceText(t.context.user.name?.trim()||"");return}r.setSubSourceText(t.context.user.name?.trim()||"")}function J(T){A(T),r.setSubSourceText(T)}async function A1(){n(null);try{let T=await r.submit();if(!T){oA(i.current);return}let W=iA(T);t.showSubmitToast!==!1&&n(W.toast),W.isSuccess&&t.onSuccess?.(T)}catch(T){let W=T instanceof Error&&T.message?T.message:"Something went wrong, Please try again!";t.showSubmitToast!==!1&&n({kind:"error",message:W})}}function X(T,W){if(r.setFieldValue(T,W),!t.api.getLocationSuggestions){v(D=>({...D,[T]:[]}));return}if(L.current[T]&&window.clearTimeout(L.current[T]),!W.trim()){v(D=>({...D,[T]:[]})),s(D=>({...D,[T]:!1}));return}L.current[T]=window.setTimeout(async()=>{let D=(m.current[T]||0)+1;m.current[T]=D,s(R=>({...R,[T]:!0}));try{let R=await t.api.getLocationSuggestions?.(W,t.context);if(m.current[T]!==D)return;v(c1=>({...c1,[T]:R||[]}))}catch{if(m.current[T]!==D)return;v(R=>({...R,[T]:[]}))}finally{m.current[T]===D&&s(R=>({...R,[T]:!1}))}},250)}function l1(T,W){r.setFieldValue(T,W),v(D=>({...D,[T]:[]})),s(D=>({...D,[T]:!1}))}return(0,C.jsxs)(o7,{open:t.open,onClose:()=>{},className:"rae-overlay",children:[(0,C.jsx)("div",{className:"rae-overlay__backdrop","aria-hidden":"true"}),(0,C.jsx)("div",{className:"rae-overlay__viewport",children:(0,C.jsxs)(L5,{ref:i,className:`rae-modal ${x?"rae-modal--expanded":"rae-modal--compact"}`,children:[o?(0,C.jsxs)("div",{className:`rae-toast rae-toast--${o.kind}`,role:"status","aria-live":"polite",children:[(0,C.jsx)("span",{children:o.message}),(0,C.jsx)("button",{type:"button",className:"rae-toast__close",onClick:()=>n(null),"aria-label":"Dismiss notification",children:(0,C.jsx)(q8,{})})]}):null,r.isInitializing?(0,C.jsx)("div",{className:"rae-loader-overlay","aria-live":"polite","aria-busy":"true",children:(0,C.jsx)(K8,{})}):null,r.isParsing?(0,C.jsxs)("div",{className:"rae-loader-overlay","aria-live":"polite","aria-busy":"true",children:[(0,C.jsx)(K8,{}),(0,C.jsx)("p",{className:"rae-loader-text",children:"Parsing resume and populating fields..."})]}):null,r.isSubmitting?(0,C.jsxs)("div",{className:"rae-loader-overlay","aria-live":"polite","aria-busy":"true",children:[(0,C.jsx)(K8,{}),(0,C.jsx)("p",{className:"rae-loader-text",children:"Submitting profile..."})]}):null,(0,C.jsxs)("div",{className:"rae-modal__header",children:[(0,C.jsx)(z5,{as:"div",className:"rae-modal__title",children:t.title||"Add Profile"}),(0,C.jsx)("button",{type:"button",className:"rae-icon-button",onClick:t.onClose,"aria-label":"Close add profile modal",children:(0,C.jsx)(q8,{})})]}),(0,C.jsxs)("div",{className:`rae-modal__body ${x?"rae-modal__body--expanded":"rae-modal__body--compact"}`,children:[(0,C.jsxs)("section",{className:"rae-section rae-section--job",children:[(0,C.jsxs)("div",{className:"rae-job-title",children:[t.context.job.jobTitle," ",(0,C.jsx)("span",{children:"|"})," ",t.context.job.jobCode]}),(0,C.jsxs)("div",{className:"rae-job-meta",children:[(0,C.jsxs)("div",{className:"rae-meta-pill",children:[(0,C.jsx)(Qf,{}),(0,C.jsx)("span",{children:t.context.job.location||"NA"})]}),(0,C.jsxs)("div",{className:"rae-meta-pill",children:[(0,C.jsx)($v,{"aria-hidden":"true"}),(0,C.jsx)("span",{children:lA(t.context.job)})]}),(0,C.jsxs)("div",{className:"rae-meta-pill",children:[(0,C.jsx)(yv,{"aria-hidden":"true"}),(0,C.jsx)("span",{children:t.context.job.departmentName||"All Departments"})]})]})]}),(0,C.jsxs)("section",{className:"rae-section rae-section--upload",children:[z?(0,C.jsxs)(s1.default.Fragment,{children:[(0,C.jsx)("div",{className:"rae-profile-method-question",children:"How would you like to create this profile?"}),(0,C.jsxs)("div",{className:"rae-profile-method-grid",children:[(0,C.jsxs)("label",{htmlFor:l,className:"rae-profile-method-card",children:[(0,C.jsx)("span",{className:"rae-profile-method-card__icon",children:(0,C.jsx)(ig,{})}),(0,C.jsxs)("span",{className:"rae-profile-method-card__content",children:[(0,C.jsx)("span",{className:"rae-profile-method-card__title",children:"Upload resume"}),(0,C.jsx)("span",{className:"rae-profile-method-card__description",children:"Auto-extract candidate details from a resume"})]}),(0,C.jsx)("span",{className:"rae-profile-method-card__info",title:`Supported: ${Z?.fileFormat.join(", ")||"Loading..."}${Z?.fileSize?` | Max size: ${Z.fileSize} MB`:""}`,"aria-label":`Supported file types: ${Z?.fileFormat.join(", ")||"Loading"}${Z?.fileSize?` and maximum file size ${Z.fileSize} MB`:""}`,children:(0,C.jsx)(Xf,{})}),(0,C.jsx)("input",{id:l,type:"file",accept:Z?.fileFormat?.map(T=>`.${String(T).trim().toLowerCase().replace(/^\./,"")}`).join(",")||void 0,hidden:!0,onChange:T=>{let W=T.target.files?.[0];W&&r.uploadFile(W)}})]}),(0,C.jsxs)("button",{type:"button",className:"rae-profile-method-card",onClick:r.startManualEntry,children:[(0,C.jsx)("span",{className:"rae-profile-method-card__icon",children:(0,C.jsx)(Tv,{"aria-hidden":"true"})}),(0,C.jsxs)("span",{className:"rae-profile-method-card__content",children:[(0,C.jsx)("span",{className:"rae-profile-method-card__title",children:"Manual entry"}),(0,C.jsx)("span",{className:"rae-profile-method-card__description",children:"Fill in candidate details step by step"})]})]})]})]}):B?(0,C.jsxs)("label",{htmlFor:l,className:"rae-upload-card",children:[(0,C.jsx)("div",{className:"rae-upload-card__icon",children:(0,C.jsx)(ig,{})}),(0,C.jsxs)("div",{className:"rae-upload-card__title",children:["Drag and Drop or ",(0,C.jsx)("span",{children:"Click Here"})," to upload resume."]}),(0,C.jsxs)("div",{className:"rae-upload-card__meta",children:["File Types Supported : ",Z?.fileFormat.join(", ")||"Loading..."]}),(0,C.jsxs)("div",{className:"rae-upload-card__meta",children:["(File size should be ",Z?.fileSize||2," MB or less)"]}),(0,C.jsx)("input",{id:l,type:"file",accept:Z?.fileFormat?.map(T=>`.${String(T).trim().toLowerCase().replace(/^\./,"")}`).join(",")||void 0,hidden:!0,onChange:T=>{let W=T.target.files?.[0];W&&r.uploadFile(W)}})]}):r.selectedFile?(0,C.jsxs)("div",{className:"rae-file-card",children:[(0,C.jsxs)("div",{className:"rae-file-card__content",children:[(0,C.jsx)("div",{className:"rae-file-card__name",children:r.selectedFile.name}),(0,C.jsx)("div",{className:"rae-file-card__size",children:Iv(r.selectedFile.size)})]}),(0,C.jsx)("button",{type:"button",className:"rae-icon-button rae-file-card__remove",onClick:r.clearSelectedFile,"aria-label":"Remove uploaded resume",children:(0,C.jsx)(q8,{})})]}):null,r.errors.file?(0,C.jsx)("div",{className:"rae-field-error",children:r.errors.file}):null]}),x?(0,C.jsxs)("section",{className:"rae-section",children:[r.isParsing?(0,C.jsx)("div",{className:"rae-state-text",children:"Parsing resume and populating fields..."}):null,(0,C.jsx)("div",{className:"rae-form-grid",children:w.map(T=>{let W=b5(T),D=r.formValues[W],R=r.errors[W],c1=T.fieldType==="checkbox",Z1=`rae-field-${W}`,j=!!(T.masterApplyFields.maskable&&D&&T.fieldType!=="location"&&T.fieldType!=="date"&&T.fieldType!=="phone"&&T.fieldType!=="checkbox"&&T.fieldType!=="D"),m1=!!(j&&M[W]);return(0,C.jsxs)("div",{className:`rae-field ${c1?"rae-field--checkbox":""}${R?" rae-field--invalid":""}`,onBlur:Q=>{Q.currentTarget.contains(Q.relatedTarget)||r.validateField(W)},children:[c1?null:(0,C.jsxs)("label",{htmlFor:Z1,className:"rae-field-label",children:[T.recruiterUploadsLabel,T.recruiterUploads==="Mandatory"?(0,C.jsx)("span",{children:"*"}):null,T.fieldType==="phone"&&T.primaryPhoneNumber?(0,C.jsx)("span",{className:"rae-phone-primary-badge",children:"Primary"}):null]}),m1?(0,C.jsxs)("div",{className:"rae-mask-shell",children:[(0,C.jsx)(a6,{id:Z1,name:W,value:s7(D),readOnly:!0,invalid:!!R}),(0,C.jsx)("button",{type:"button",className:"rae-mask-toggle",onClick:()=>H(Q=>({...Q,[W]:!1})),children:"Show"})]}):(0,C.jsxs)(s1.default.Fragment,{children:[ze({field:T,value:D,error:R,inputId:Z1,inputName:W,onChange:Q=>r.setFieldValue(W,Q),onBlur:()=>r.validateField(W),getDropdownOptions:r.getDropdownOptions,onAddPhoneField:r.addPhoneField,onRemovePhoneField:r.removePhoneField,canAddMorePhoneFields:r.canAddMorePhoneFields,phoneFieldCount:r.phoneFieldCount,locationSuggestions:h[W]||[],isLoadingLocationSuggestions:!!u[W],onLocationInput:Q=>X(W,Q),onLocationSuggestionSelect:Q=>l1(W,Q),onLocationBlur:()=>{L.current[W]&&window.clearTimeout(L.current[W]),v(Q=>({...Q,[W]:[]})),s(Q=>({...Q,[W]:!1}))}}),j?(0,C.jsx)("button",{type:"button",className:"rae-mask-toggle rae-mask-toggle--inline",onClick:()=>H(Q=>({...Q,[W]:!0})),children:"Hide"}):null]}),R?(0,C.jsx)("div",{className:"rae-field-error",children:R}):null]},W)})})]}):null]}),(0,C.jsxs)("div",{className:"rae-modal__footer",children:[(0,C.jsxs)("div",{className:"rae-footer__left",children:[(0,C.jsx)(xe,{id:"rae-send-notification",name:"sendNotification",className:"rae-checkbox-field rae-checkbox-field--footer",checked:r.sendNotification,onChange:T=>r.setSendNotification(T.target.checked),label:"Send notification to candidate"}),r.isInitializing?null:$.length>0?(0,C.jsxs)("div",{className:"rae-footer-fields",children:[(0,C.jsx)("div",{className:"rae-footer-field rae-footer-field--required",children:(0,C.jsx)(y5,{id:"rae-source-of-profile",name:"sourceOfProfile",value:r.sourceOfProfile,onChange:T=>G(T.target.value),placeholder:"Source Of Profile",options:$.map(T=>({label:T,value:T}))})}),r.sourceOfProfile?(0,C.jsx)("div",{className:"rae-footer-field rae-footer-field--required",children:(0,C.jsx)(y5,{id:"rae-profile-source",name:"profileSource",value:r.profileSource,onChange:T=>I(T.target.value),placeholder:"Source Type",options:O.map(T=>({label:T.profileSource,value:T.profileSource}))})}):null,r.profileSource&&U?(0,C.jsx)("div",{className:"rae-footer-field rae-footer-field--required",children:(0,C.jsx)(y5,{id:"rae-sub-source-select",name:"subSourceSelect",value:p,onChange:T=>J(T.target.value),placeholder:"Sub Source",options:F.map(T=>({label:T,value:T}))})}):null,r.profileSource&&q?(0,C.jsx)("div",{className:"rae-footer-field rae-footer-field--required",children:(0,C.jsx)(a6,{id:"rae-sub-source-input",name:"subSourceText",value:r.subSourceText,placeholder:"Sub Source *",onChange:T=>r.setSubSourceText(T.target.value)})}):null]}):(0,C.jsx)("div",{className:"rae-footer-fields",children:P.length?(0,C.jsx)("div",{className:"rae-footer-field rae-footer-field--required",children:(0,C.jsx)(y5,{id:"rae-profile-source-fallback",name:"profileSource",value:r.profileSource,onChange:T=>I(T.target.value),placeholder:"Source Type",options:O.map(T=>({label:T.profileSource,value:T.profileSource}))})}):(0,C.jsx)("div",{className:"rae-footer-field rae-footer-field--required",children:(0,C.jsx)(a6,{id:"rae-sub-source-fallback",name:"subSourceText",value:r.subSourceText,placeholder:"Sub Source *",onChange:T=>r.setSubSourceText(T.target.value)})})})]}),(0,C.jsxs)("div",{className:"rae-footer__actions",children:[(0,C.jsx)("button",{type:"button",className:"rae-button rae-button--ghost",onClick:t.onClose,children:"Cancel"}),(0,C.jsx)("button",{type:"button",className:"rae-button rae-button--primary",onClick:()=>{A1()},disabled:!r.canSubmit,children:r.isSubmitting?"Submitting...":"Submit"})]})]})]})})]})}function dA(t){let r=String(t??"").replace(/[^\d]/g,"");if(!r)return"";let l=r.slice(-3),i=r.slice(0,-3);return i?`${i.replace(/\B(?=(\d{2})+(?!\d))/g,",")},${l}`:l}function og(){if(typeof document>"u")return;let t=[".rae-phone-add-button",".rae-phone-field__add",".rae-phone-action--add",".rae-phone-inline__add"].join(", "),r=new Set;document.querySelectorAll(t).forEach(l=>r.add(l)),document.querySelectorAll(".rae-modal *").forEach(l=>{if(!(l instanceof HTMLElement)||l.children.length>0||(l.textContent||"").trim()!=="+")return;let i=l.closest(".rae-field")||l.closest("[class*='phone']")||l.parentElement;String(i?.textContent||"").toLowerCase().includes("phone")&&r.add(l)}),r.forEach(l=>{if(!(l instanceof HTMLElement)||l.dataset.raePhoneIconMounted==="true")return;l.dataset.raePhoneIconMounted="true",l.classList.add("rae-phone-action","rae-phone-action--accent"),l.textContent="";let i=document.createElement("span");i.className="rae-phone-add-icon",l.appendChild(i),(0,sg.createRoot)(i).render((0,C.jsx)(cg,{}))})}function f7(t){if(!(t instanceof HTMLElement))return;document.querySelectorAll('.rae-select[data-overlay-active="true"], .rae-searchable-select[data-overlay-active="true"]').forEach(Z=>{Z instanceof HTMLElement&&Z!==t&&delete Z.dataset.overlayActive});let r=t.querySelector('button[aria-expanded="true"]')||t.querySelector("button"),l=t.querySelector(".rae-select-options")||t.querySelector(".rae-searchable-select__options");if(!(r instanceof HTMLElement)||!(l instanceof HTMLElement))return;let i=r.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight||0,n=window.innerWidth||document.documentElement.clientWidth||0,h=4,v=12,u=Math.min(l.scrollHeight||240,280),s=o-i.bottom-v,p=i.top-v,A=s<Math.min(u,180)&&p>s,M=Math.max(140,Math.min(u,A?p:s)),H=Math.min(i.width,n-v*2),m=Math.min(Math.max(v,i.left),n-H-v),L=A?Math.max(v,i.top-M-h):Math.max(v,i.bottom+h),w=t.closest(".rae-field");document.querySelectorAll('.rae-field[data-overlay-active="true"]').forEach(Z=>{Z instanceof HTMLElement&&Z!==w&&delete Z.dataset.overlayActive}),t.dataset.overlayActive="true",w instanceof HTMLElement&&(w.dataset.overlayActive="true"),l.dataset.overlayOpen="true",l.style.setProperty("--rae-overlay-top",`${L}px`),l.style.setProperty("--rae-overlay-left",`${m}px`),l.style.setProperty("--rae-overlay-width",`${H}px`),l.style.setProperty("--rae-overlay-max-height",`${M}px`)}function vA(t){if(!(t instanceof HTMLElement))return;delete t.dataset.overlayActive;let r=t.closest(".rae-field");r instanceof HTMLElement&&delete r.dataset.overlayActive;let l=t.querySelector(".rae-select-options")||t.querySelector(".rae-searchable-select__options");l instanceof HTMLElement&&(delete l.dataset.overlayOpen,l.style.removeProperty("--rae-overlay-top"),l.style.removeProperty("--rae-overlay-left"),l.style.removeProperty("--rae-overlay-width"),l.style.removeProperty("--rae-overlay-max-height"))}function S5(t){if(!(t instanceof HTMLElement))return;let r=t.querySelector("input"),l=t.__raePortaledLocationSuggestions||t.querySelector(".rae-location-suggestions");if(!(r instanceof HTMLElement)||!(l instanceof HTMLElement))return;let i=r.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight||0,n=window.innerWidth||document.documentElement.clientWidth||0,h=4,v=12,u=Math.min(l.scrollHeight||240,280),s=o-i.bottom-v,p=i.top-v,A=s<Math.min(u,180)&&p>s,M=Math.max(120,Math.min(u,A?p:s)),H=Math.min(i.width,n-v*2),m=Math.min(Math.max(v,i.left),n-H-v),L=A?Math.max(v,i.top-M-h):Math.max(v,i.bottom+h);l.dataset.overlayOpen="true",l.style.setProperty("--rae-location-overlay-top",`${L}px`),l.style.setProperty("--rae-location-overlay-left",`${m}px`),l.style.setProperty("--rae-location-overlay-width",`${H}px`),l.style.setProperty("--rae-location-overlay-max-height",`${M}px`)}function ng(t){if(!(t instanceof HTMLElement))return;let r=t.__raePortaledLocationSuggestions||t.querySelector(".rae-location-suggestions");if(r instanceof HTMLElement){if(delete r.dataset.overlayOpen,r.style.removeProperty("--rae-location-overlay-top"),r.style.removeProperty("--rae-location-overlay-left"),r.style.removeProperty("--rae-location-overlay-width"),r.style.removeProperty("--rae-location-overlay-max-height"),t.__raeLocationOriginalParent instanceof HTMLElement){let l=t.__raeLocationOriginalParent,i=t.__raeLocationOriginalNextSibling||null;i&&i.parentNode===l?l.insertBefore(r,i):l.appendChild(r)}delete t.__raePortaledLocationSuggestions,delete t.__raeLocationOriginalParent,delete t.__raeLocationOriginalNextSibling}}function Ve(t){if(!(t instanceof HTMLElement)||typeof document>"u")return;let r=t.__raePortaledLocationSuggestions;if(r instanceof HTMLElement&&r.isConnected&&r.parentElement===document.body)return r;let l=t.querySelector(".rae-location-suggestions");return l instanceof HTMLElement?(t.__raeLocationOriginalParent=l.parentElement,t.__raeLocationOriginalNextSibling=l.nextSibling,t.__raePortaledLocationSuggestions=l,document.body.appendChild(l),l):null}function me(t){if(!(t instanceof HTMLElement))return;let r=t.closest(".rae-modal__body--expanded")||t.closest(".rae-modal__body"),l=t.closest(".rae-modal")?.querySelector?.(".rae-modal__footer"),i=t.__raePortaledLocationSuggestions||t.querySelector(".rae-location-suggestions"),o=t.querySelector("input");if(!(r instanceof HTMLElement)||!(i instanceof HTMLElement)||!(o instanceof HTMLElement))return;let n=o.getBoundingClientRect(),h=r.getBoundingClientRect(),v=l instanceof HTMLElement?l.getBoundingClientRect():null,u=v?Math.min(h.bottom,v.top):h.bottom,s=Math.min(Math.max(i.scrollHeight||0,180),280),M=n.bottom+8+s-u;M>0&&(r.scrollTop+=M+12)}typeof document<"u"&&!window.__raeCurrentCtcFormatterBound&&(window.__raeCurrentCtcFormatterBound=!0,document.addEventListener("input",t=>{let r=t.target;if(!(r instanceof HTMLInputElement))return;let i=r.closest(".rae-field")?.querySelector?.(".rae-field-label");if(!String(i?.textContent||"").toLowerCase().includes("current ctc"))return;let n=dA(r.value);if(n!==r.value){let h=r.selectionStart===r.value.length;if(r.value=n,h){let v=n.length;window.requestAnimationFrame(()=>{try{r.setSelectionRange(v,v)}catch{}})}}},!0));if(typeof document<"u"&&!window.__raeDropdownOverlayBound){window.__raeDropdownOverlayBound=!0;let t=r=>{let l=r?.closest?.(".rae-select, .rae-searchable-select");l instanceof HTMLElement&&window.requestAnimationFrame(()=>f7(l))};document.addEventListener("click",r=>{t(r.target),document.querySelectorAll(".rae-select, .rae-searchable-select").forEach(i=>{if(!(i instanceof HTMLElement))return;i.querySelector('button[aria-expanded="true"]')?f7(i):vA(i)})},!0),window.addEventListener("resize",()=>{document.querySelectorAll(".rae-select, .rae-searchable-select").forEach(r=>f7(r))},{passive:!0}),document.addEventListener("scroll",()=>{document.querySelectorAll(".rae-select, .rae-searchable-select").forEach(r=>f7(r))},!0)}typeof document<"u"&&!window.__raePhoneAddIconBound&&(window.__raePhoneAddIconBound=!0,new MutationObserver(()=>og()).observe(document.body,{childList:!0,subtree:!0}),window.requestAnimationFrame(()=>og()));if(typeof document<"u"&&!window.__raeSubmitButtonEnableBound){window.__raeSubmitButtonEnableBound=!0;let t=()=>{document.querySelectorAll("button").forEach(l=>{!(l instanceof HTMLButtonElement)||(l.textContent||"").trim().toLowerCase()!=="submit"||l.dataset.raeForceSubmitDisabled!=="true"&&l.disabled&&(l.disabled=!1,l.removeAttribute("disabled"),l.setAttribute("aria-disabled","false"))})};new MutationObserver(()=>t()).observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["disabled","aria-disabled"]}),window.requestAnimationFrame(()=>t())}if(typeof document<"u"&&!window.__raeLocationCloseBound){window.__raeLocationCloseBound=!0;let t=l=>{document.querySelectorAll(".rae-location-field").forEach(i=>{if(!(i instanceof HTMLElement))return;let o=l instanceof Node?i.contains(l):!1,n=i.__raePortaledLocationSuggestions||i.querySelector(".rae-location-suggestions");if(o){let v=Ve(i);i.dataset.locationOpen="true";let u=v||i.__raePortaledLocationSuggestions||n;u instanceof HTMLElement&&(u.style.display="block"),window.requestAnimationFrame(()=>{me(i),S5(i)});return}delete i.dataset.locationOpen,n instanceof HTMLElement&&(n.style.display="none"),ng(i);let h=i.querySelector("input");h instanceof HTMLInputElement&&document.activeElement===h&&h.blur()})};document.addEventListener("focusin",l=>{t(l.target)},!0),document.addEventListener("pointerdown",l=>{let i=l.target;if(i instanceof HTMLElement&&i.classList.contains("rae-location-suggestion")){let o=i.dataset.suggestion||i.textContent?.trim(),n=document.querySelectorAll(".rae-location-field[data-location-open='true']");for(let h of n){if(!(h instanceof HTMLElement)||!h.__raeOnSuggestionSelect||!o)continue;l.preventDefault(),h.__raeOnSuggestionSelect(o),delete h.dataset.locationOpen;let v=h.__raePortaledLocationSuggestions||h.querySelector(".rae-location-suggestions");v instanceof HTMLElement&&(v.style.display="none"),ng(h);return}}t(l.target)},!0),document.addEventListener("input",l=>{let i=l.target;if(!(i instanceof HTMLElement))return;let o=i.closest(".rae-location-field");o instanceof HTMLElement&&o.dataset.locationOpen==="true"&&window.requestAnimationFrame(()=>{let n=Ve(o);n instanceof HTMLElement&&(n.style.display="block"),me(o),S5(o)})},!0),new MutationObserver(()=>{document.querySelectorAll(".rae-location-field[data-location-open='true']").forEach(l=>{if(!(l instanceof HTMLElement))return;let i=Ve(l);i instanceof HTMLElement&&(i.style.display="block"),me(l),S5(l)})}).observe(document.body,{childList:!0,subtree:!0}),window.addEventListener("resize",()=>{document.querySelectorAll(".rae-location-field[data-location-open='true']").forEach(l=>{S5(l)})},{passive:!0}),document.addEventListener("scroll",()=>{document.querySelectorAll(".rae-location-field[data-location-open='true']").forEach(l=>{S5(l)})},!0)}if(typeof document<"u"&&!window.__raeBusyOverlayBound){window.__raeBusyOverlayBound=!0;let t=[".rae-loading-overlay",".rae-loading-state",".rae-modal__loading",".rae-spinner-overlay",".rae-submit-overlay","[aria-busy='true']"].join(", "),r=()=>{document.querySelectorAll(".rae-modal").forEach(i=>{if(!(i instanceof HTMLElement))return;i.matches("[aria-busy='true']")||!!i.querySelector(t)||!!i.querySelector(".rae-modal__body [role='progressbar']")?i.dataset.busyOverlay="true":delete i.dataset.busyOverlay})};new MutationObserver(()=>r()).observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","style","aria-busy"]}),window.requestAnimationFrame(()=>r())}typeof document<"u"&&!window.__raeValidationScrollBound&&(window.__raeValidationScrollBound=!0);if(typeof document<"u"&&!window.__raeLocationPortalBridgeBound){window.__raeLocationPortalBridgeBound=!0;let t=document.createElement("div");t.className="rae-location-portal-overlay",t.hidden=!0,document.body.appendChild(t);let r=null,l=null,i=A=>A instanceof HTMLElement?A.__raePortaledLocationSuggestions||A.querySelector(".rae-location-suggestions"):null,o=(A,M)=>{let H=i(A);H instanceof HTMLElement&&(H.style.visibility=M?"hidden":"",H.style.pointerEvents=M?"none":"")},n=()=>{r&&o(r,!1),r=null,t.hidden=!0,t.innerHTML=""},h=(A,M)=>{let H=A.querySelector("input");if(!(H instanceof HTMLElement)||!(M instanceof HTMLElement))return;let m=H.getBoundingClientRect(),L=window.innerHeight||document.documentElement.clientHeight||0,w=window.innerWidth||document.documentElement.clientWidth||0,Z=12,V=4,x=Math.min(M.scrollHeight||240,280),z=L-m.bottom-Z,B=m.top-Z,P=z<Math.min(x,180)&&B>z,$=Math.max(120,Math.min(x,P?B:z)),S=Math.min(m.width,w-Z*2),O=Math.min(Math.max(Z,m.left),w-S-Z),y=P?Math.max(Z,m.top-$-V):Math.max(Z,m.bottom+V);t.style.left=`${O}px`,t.style.top=`${y}px`,t.style.width=`${S}px`,t.style.maxHeight=`${$}px`},v=()=>{if(!(r instanceof HTMLElement))return n();let A=i(r);if(!(A instanceof HTMLElement))return n();let M=Array.from(A.children).filter(H=>H instanceof HTMLElement);if(!M.length)return n();o(r,!0),t.innerHTML="",M.forEach((H,m)=>{let L=H.cloneNode(!0);L instanceof HTMLElement&&(L.dataset.portalIndex=String(m),t.appendChild(L))}),h(r,A),t.hidden=!1},u=()=>{l&&window.clearTimeout(l),l=window.setTimeout(()=>{l=null,v()},0)},s=A=>{A instanceof HTMLElement&&(r=A,u())};document.addEventListener("input",A=>{let M=A.target instanceof HTMLElement?A.target.closest(".rae-location-field"):null;M instanceof HTMLElement&&s(M)},!0),document.addEventListener("focusin",A=>{let M=A.target instanceof HTMLElement?A.target:null,H=M?.closest?.(".rae-location-field");if(H instanceof HTMLElement){s(H);return}t.contains(M)||n()},!0),document.addEventListener("pointerdown",A=>{let M=A.target instanceof HTMLElement?A.target:null;if(t.contains(M)){let m=M?.closest?.("[data-portal-index]"),L=i(r);if(m instanceof HTMLElement&&L instanceof HTMLElement){let w=Number(m.dataset.portalIndex),Z=L.children[w];Z instanceof HTMLElement&&(Z.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0})),Z.dispatchEvent(new MouseEvent("click",{bubbles:!0})))}n();return}let H=M?.closest?.(".rae-location-field");if(H instanceof HTMLElement){s(H);return}n()},!0),new MutationObserver(()=>{r&&u()}).observe(document.body,{childList:!0,subtree:!0}),window.addEventListener("resize",()=>u(),{passive:!0}),document.addEventListener("scroll",()=>u(),!0)}var p1=E(kt(),1),v0=E(k(),1);var T0=E(k(),1);function r6(t){return t.formGroupName||t.masterApplyFields.fieldNameForApply}function fg(t,r){return t.find(l=>r6(l)===r||l.masterApplyFields.fieldNameForApply===r)}function we(t){return String(t||"").replace(/\D+/g,"")}function Ag(t){let r=we(t);return r?`+${r}`:""}function pg(t){if(!t)return t;let r=t instanceof Date?t:new Date(t);if(Number.isNaN(r.getTime()))return t;let l=r.getFullYear(),i=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0");return`${l}-${i}-${o}`}function gA(t,r){let l={...t};return r.forEach(i=>{let o=r6(i);i.fieldType==="date"&&l[o]&&(l[o]=pg(l[o]))}),Object.entries(l).forEach(([i,o])=>{if(i!=="dateOfBirth"&&o){let n=new Date(o);!Number.isNaN(n.getTime())&&String(o).match(/\d{4}-\d{2}-\d{2}|T\d{2}:/)&&(l[i]=pg(o))}}),l}function Hg(t){return{...t,recruiterUploads:t.editProfile||t.recruiterUploads}}function Be(t,r,l,i){return o2(t)?null:U8(Hg(t),r,l.map(Hg),i)}function Ce(t,r,l){let i={};return t.forEach(o=>{let n=r6(o);if(!n)return;let h=Be(o,l[n],r,l);h&&(i[n]=h)}),Object.assign(i,W8(t,l)),i}function uA(t,r,l,i){let o={...i},n=fg(r,t);return n?.dependentFieldsName&&[...new Set(j2(n.dependentFieldsName))].forEach(v=>{let u=r.find(A=>A.masterApplyFields.fieldNameForApply===v);if(!u)return;let s=r6(u);if(!n2(v,r,l)){delete o[s];return}let p=Be(u,l[s],r,l);p?o[s]=p:delete o[s]}),o}function A7(t){return{countryIsoCode:t?.countryIsoCode||"IN",whatsAppEnabled:!!t?.whatsAppEnabled,maxCount:t?.maxCount||3}}function Mg(t,r){return T6(t)?.iso2||r||"IN"}function Vg(t,r,l=!1){let i=Ag(t?.countryCode||r),o=we(t?.number||t?.phoneNoWithoutCountryCode||"");return{phoneType:t?.phoneType||"Home",phoneNumField:o?{nationalNumber:o,number:o,dialCode:i,e164Number:`${i}${o}`}:null,whatsAppEnabled:t?.whatsappEnabled??t?.whatsAppEnabled??l}}function sA(t,r,l,i){let o=A7(r),n=[],h=1;return t.forEach(v=>{if(v.fieldType!=="phone"){n.push({...v});return}let u=[...l||[]].sort((s,p)=>+!!p.primary-+!!s.primary);if(!u.length){let s=`phoneField${h}`;h+=1,n.push({...v,formGroupName:s,selectedCountryCode:Mg(i?.countryCode,o.countryIsoCode),primaryPhoneNumber:!0});return}u.forEach((s,p)=>{let A=`phoneField${h}`;h+=1,n.push({...v,editProfile:p===0?v.editProfile:"Non Mandatory",formGroupName:A,selectedCountryCode:Mg(s.countryCode,o.countryIsoCode),primaryPhoneNumber:!!s.primary})})}),n}function pA(t,r){let l={},i=r.applyFieldsObject||{},o=[...r.phoneNumbers||[]].sort((v,u)=>+!!u.primary-+!!v.primary),n=A7(r.phoneConfiguration),h=0;return t.forEach(v=>{let u=v.masterApplyFields.fieldNameForApply,s=r6(v);if(!(!u||u==="uploadResume")){if(v.fieldType==="phone"){let p=o[h];h+=1,l[s]=Vg(p||{number:i.phoneNoWithoutCountryCode||i.phoneNo,countryCode:i.countryCode,phoneType:"Home",whatsappEnabled:n.whatsAppEnabled},n.countryIsoCode,n.whatsAppEnabled);return}if(v.fieldType==="checkbox"||o2(v)){l[s]=!!i[u];return}l[s]=i[u]??""}}),l}function HA(t,r,l){return t.filter(i=>i.fieldType==="phone").map(i=>({field:i,phoneValue:r[i.formGroupName||"phoneField1"]})).filter(i=>!!i.phoneValue?.phoneNumField).map(({field:i,phoneValue:o})=>({phoneType:o.phoneType,associatedEntityType:"CANDIDATE",associatedEntityId:l,primary:!!i.primaryPhoneNumber,whatsappEnabled:!!o.whatsAppEnabled,countryCode:Ag(o.phoneNumField?.dialCode),number:we(o.phoneNumField?.nationalNumber||o.phoneNumField?.number)}))}function MA(t){let r=gA(t.values,t.fields),l={...r};t.fields.filter(h=>h.fieldType==="phone").forEach(h=>{delete l[h.formGroupName||"phoneField1"]});let i=HA(t.fields,r,t.context.applyId),o=i.find(h=>h.primary),n={...t.initialization.jobApplication||{}};if(Object.keys(l).forEach(h=>{Object.prototype.hasOwnProperty.call(n,h)&&(n[h]=l[h])}),o){let h=`${o.countryCode||""}${o.number||""}`;n.phoneNo=h,n.primaryNumWithoutCC=o.number||"",n.countryCode=o.countryCode||"",l.phoneNo=h,l.phoneNoWithoutCountryCode=o.number||"",l.countryCode=o.countryCode||""}return{additionalFieldsMapObject:JSON.stringify({}),applyFieldsObject:JSON.stringify(l),fName:String(l.firstName||""),lName:String(l.lastName||""),jobApplication:n,contactInformation:i}}function mg(t){let[r,l]=(0,T0.useState)(null),[i,o]=(0,T0.useState)([]),[n,h]=(0,T0.useState)({}),[v,u]=(0,T0.useState)(!1),[s,p]=(0,T0.useState)(!1),[A,M]=(0,T0.useState)({}),[H,m]=(0,T0.useState)(!1);(0,T0.useEffect)(()=>{if(!t.open)return;let S=!1;return u(!0),t.api.loadInitialData(t.context).then(O=>{if(S)return;let y=sA(O.applyFields||[],O.phoneConfiguration,O.phoneNumbers||[],O.applyFieldsObject||{});l(O),o(y),h(pA(y,O)),M({}),m(!1)}).finally(()=>{S||u(!1)}),()=>{S=!0}},[t.api,t.context,t.open]);let L=(0,T0.useMemo)(()=>i.filter(S=>{let O=S.masterApplyFields.fieldNameForApply;return O&&O!=="uploadResume"&&!o2(S)&&n2(O,i,n)}),[i,n]),w=(0,T0.useMemo)(()=>i.filter(S=>S.fieldType==="phone"),[i]),Z=!!(r&&w.length<A7(r.phoneConfiguration).maxCount),V=!v&&!s;(0,T0.useEffect)(()=>{let S=new Set(L.map(O=>r6(O)).filter(Boolean));M(O=>{let y={};return Object.entries(O).forEach(([F,U])=>{S.has(F)&&(y[F]=U)}),H?{...y,...Ce(L,i,n)}:y})},[i,n,H,L]);function x(S,O){let y={...n,[S]:O};if(S==="dateOfBirth"){let F=p7(String(O));F!=null&&"agee"in y&&(y.agee=F)}h(y),M(F=>{let U={...F};delete U[S];let q=uA(S,i,y,U);return H?{...q,...Ce(i.filter(G=>{let I=G.masterApplyFields.fieldNameForApply;return I&&I!=="uploadResume"&&!o2(G)&&n2(I,i,y)}),i,y)}:q})}function z(S){let O=fg(i,S);if(!O)return;let y=r6(O),F={...n};if(!n2(O.masterApplyFields.fieldNameForApply,i,F)){M(q=>{let G={...q};return delete G[y],G});return}let U=Be(O,F[y],i,F);M(q=>{let G={...q};return U?G[y]=U:delete G[y],Object.assign(G,W8(L,F)),G})}function B(S){if(!r||!Z)return;let y=`phoneField${w.length+1}`,F=A7(r.phoneConfiguration),U={...S,editProfile:"Non Mandatory",formGroupName:y,selectedCountryCode:F.countryIsoCode,primaryPhoneNumber:!1},q=i.indexOf(S);o(G=>[...G.slice(0,q+1),U,...G.slice(q+1)]),h(G=>({...G,[y]:Vg(null,F.countryIsoCode,F.whatsAppEnabled)}))}function P(S){if(S.primaryPhoneNumber)return;let O=r6(S);o(y=>y.filter(F=>F!==S)),h(y=>{let F={...y};return delete F[O],F})}async function $(){if(!r)return null;m(!0);let S=Ce(L,i,n);if(Object.keys(S).length>0)return M(O=>({...O,...S})),null;p(!0);try{let O=MA({fields:i,values:n,initialization:r,context:t.context});return await t.api.submitProfile(O,t.context)}finally{p(!1)}}return{initialization:r,fields:i,formValues:n,isInitializing:v,isSubmitting:s,errors:A,canSubmit:V,canAddMorePhoneFields:Z,phoneFieldCount:w.length,setFieldValue:x,validateField:z,submit:$,getVisibleFields(){return L},getDropdownOptions(S,O){return H7(kv(S),O)},addPhoneField:B,removePhoneField:P}}var zg=E(ra(),1);function Zg(t){return p4({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M363 277h-86v86h-42v-86h-86v-42h86v-86h42v86h86v42z"},child:[]},{tag:"path",attr:{d:"M256 90c44.3 0 86 17.3 117.4 48.6C404.7 170 422 211.7 422 256s-17.3 86-48.6 117.4C342 404.7 300.3 422 256 422c-44.3 0-86-17.3-117.4-48.6C107.3 342 90 300.3 90 256c0-44.3 17.3-86 48.6-117.4C170 107.3 211.7 90 256 90m0-42C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z"},child:[]}]})(t)}var Cg=E(kt(),1);function fA(t){let r=t||{},l=r.responseCode??r.code,i=typeof l=="number"?l:void 0,o=typeof r.reponseObject=="string"&&r.reponseObject||typeof r.message=="string"&&r.message||typeof r.errorMessage=="string"&&r.errorMessage||"Something went wrong, Please try again!";return i===void 0||i===200?{isSuccess:!0,toast:{kind:"success",message:o==="Something went wrong, Please try again!"?"Profile updated successfully":o}}:{isSuccess:!1,toast:{kind:i===403||i===500?"warning":"error",message:o}}}function AA(t){t instanceof HTMLElement&&window.setTimeout(()=>{let r=t.querySelector(".rae-field-error");if(!(r instanceof HTMLElement))return;let l=r.closest(".rae-field")||r;if(!(l instanceof HTMLElement))return;let i=t.querySelector(".rae-modal__body--expanded")||t.querySelector(".rae-modal__body");if(i instanceof HTMLElement){let n=l.getBoundingClientRect(),h=i.getBoundingClientRect(),v=n.top-h.top+i.scrollTop-80;i.scrollTo({top:Math.max(0,v),behavior:"smooth"})}else l.scrollIntoView({behavior:"smooth",block:"center"});let o=l.querySelector("input, button, textarea, [role='combobox'], [role='button']");o instanceof HTMLElement&&o.focus({preventScroll:!0})},100)}function Lg(t){let r=mg({open:t.open,api:t.api,context:t.context}),l=(0,v0.useRef)(null),[i,o]=(0,v0.useState)(null),[n,h]=(0,v0.useState)({}),[v,u]=(0,v0.useState)({}),[s,p]=(0,v0.useState)({}),A=(0,v0.useRef)({}),M=(0,v0.useRef)({}),H=(0,v0.useId)();if((0,v0.useEffect)(()=>{if(!i)return;let V=window.setTimeout(()=>o(null),4500);return()=>window.clearTimeout(V)},[i]),(0,v0.useEffect)(()=>()=>{Object.values(M.current).forEach(V=>window.clearTimeout(V))},[]),(0,v0.useEffect)(()=>{p(V=>{let x={...V};return r.fields.forEach(z=>{let B=b5(z);if(!B||!z.masterApplyFields.maskable)return;let P=r.formValues[B],$=P!=null&&String(P).trim()!=="";x[B]=$?x[B]??!0:!1}),x})},[r.fields,r.formValues]),!t.open)return null;function m(V,x){if(r.setFieldValue(V,x),!t.api.getLocationSuggestions){h(z=>({...z,[V]:[]}));return}if(M.current[V]&&window.clearTimeout(M.current[V]),!x.trim()){h(z=>({...z,[V]:[]})),u(z=>({...z,[V]:!1}));return}M.current[V]=window.setTimeout(async()=>{let z=(A.current[V]||0)+1;A.current[V]=z,u(B=>({...B,[V]:!0}));try{let B=await t.api.getLocationSuggestions?.(x,t.context);if(A.current[V]!==z)return;h(P=>({...P,[V]:B||[]}))}catch{if(A.current[V]!==z)return;h(B=>({...B,[V]:[]}))}finally{A.current[V]===z&&u(B=>({...B,[V]:!1}))}},250)}function L(V,x){r.setFieldValue(V,x),h(z=>({...z,[V]:[]})),u(z=>({...z,[V]:!1}))}async function w(){o(null);try{let V=await r.submit();if(!V){AA(l.current);return}let x=fA(V);t.showSubmitToast!==!1&&o(x.toast),x.isSuccess&&t.onSuccess?.(V)}catch(V){t.showSubmitToast!==!1&&o({kind:"error",message:V instanceof Error&&V.message?V.message:"Something went wrong, Please try again!"})}}let Z=[...r.getVisibleFields().filter(V=>V.fieldType!=="checkbox"),...r.getVisibleFields().filter(V=>V.fieldType==="checkbox")];return(0,p1.jsxs)(o7,{open:t.open,onClose:()=>{},className:"rae-overlay",children:[(0,p1.jsx)("div",{className:"rae-overlay__backdrop","aria-hidden":"true"}),(0,p1.jsx)("div",{className:"rae-overlay__viewport",children:(0,p1.jsxs)(L5,{ref:l,className:`rae-modal ${r.isInitializing?"rae-modal--edit-loading":"rae-modal--expanded"} rae-modal--edit-profile`,children:[i?(0,p1.jsxs)("div",{className:`rae-toast rae-toast--${i.kind}`,role:"status","aria-live":"polite",children:[(0,p1.jsx)("span",{children:i.message}),(0,p1.jsx)("button",{type:"button",className:"rae-toast__close",onClick:()=>o(null),"aria-label":"Dismiss notification",children:(0,p1.jsx)(q8,{})})]}):null,r.isSubmitting?(0,p1.jsxs)("div",{className:"rae-loader-overlay","aria-live":"polite","aria-busy":"true",children:[(0,p1.jsx)(K8,{}),(0,p1.jsx)("p",{className:"rae-loader-text",children:"Saving profile changes..."})]}):null,(0,p1.jsxs)("div",{className:"rae-modal__header",children:[(0,p1.jsx)(z5,{as:"div",className:"rae-modal__title",children:t.title||"Edit Profile"}),(0,p1.jsx)("button",{type:"button",className:"rae-icon-button",onClick:t.onClose,"aria-label":"Close edit profile modal",children:(0,p1.jsx)(q8,{})})]}),r.isInitializing?(0,p1.jsx)("div",{className:"rae-modal__body rae-modal__body--loading",children:(0,p1.jsx)("div",{className:"rae-inline-loader","aria-live":"polite","aria-busy":"true",children:(0,p1.jsx)(K8,{})})}):(0,p1.jsx)("div",{className:"rae-modal__body rae-modal__body--expanded",children:(0,p1.jsx)("section",{className:"rae-section rae-section--edit-profile",children:(0,p1.jsx)("div",{className:"rae-form-grid",children:Z.map(V=>{let x=b5(V),z=r.formValues[x],B=r.errors[x],P=V.fieldType==="checkbox",$=V.editProfile==="Mandatory",S=`${H}-field-${x}`,O=!!(V.masterApplyFields.maskable&&z&&V.fieldType!=="location"&&V.fieldType!=="date"&&V.fieldType!=="phone"&&V.fieldType!=="checkbox"&&V.fieldType!=="D"),y=!!(O&&s[x]);return(0,p1.jsxs)("div",{className:`rae-field ${P?"rae-field--checkbox":""}${B?" rae-field--invalid":""}`,onBlur:F=>{F.currentTarget.contains(F.relatedTarget)||r.validateField(x)},children:[P?null:(0,p1.jsxs)("label",{htmlFor:S,className:"rae-field-label",children:[V.recruiterUploadsLabel,$?(0,p1.jsx)("span",{children:"*"}):null,V.fieldType==="phone"&&V.primaryPhoneNumber?(0,p1.jsx)("span",{className:"rae-phone-primary-badge",children:"Primary"}):null]}),y?(0,p1.jsxs)("div",{className:"rae-mask-shell",children:[(0,p1.jsx)(a6,{id:S,name:x,value:s7(z),readOnly:!0,invalid:!!B}),(0,p1.jsx)("button",{type:"button",className:"rae-mask-toggle",onClick:()=>p(F=>({...F,[x]:!1})),children:"Show"})]}):(0,p1.jsxs)(v0.default.Fragment,{children:[ze({field:V,value:z,error:B,inputId:S,inputName:x,readOnly:V.masterApplyFields.fieldNameForApply==="emailId",onChange:F=>r.setFieldValue(x,F),onBlur:()=>r.validateField(x),getDropdownOptions:r.getDropdownOptions,onAddPhoneField:r.addPhoneField,onRemovePhoneField:r.removePhoneField,canAddMorePhoneFields:r.canAddMorePhoneFields,phoneFieldCount:r.phoneFieldCount,locationSuggestions:n[x]||[],isLoadingLocationSuggestions:!!v[x],onLocationInput:F=>m(x,F),onLocationSuggestionSelect:F=>L(x,F)}),O?(0,p1.jsx)("button",{type:"button",className:"rae-mask-toggle rae-mask-toggle--inline",onClick:()=>p(F=>({...F,[x]:!0})),children:"Hide"}):null]}),B?(0,p1.jsx)("div",{className:"rae-field-error",children:B}):null]},x)})})})}),r.isInitializing?null:(0,p1.jsxs)("div",{className:"rae-modal__footer",children:[(0,p1.jsx)("div",{className:"rae-footer__left"}),(0,p1.jsxs)("div",{className:"rae-footer__actions",children:[(0,p1.jsx)("button",{type:"button",className:"rae-button rae-button--ghost",onClick:t.onClose,children:"Cancel"}),(0,p1.jsx)("button",{type:"button",className:"rae-button rae-button--primary",onClick:()=>{w()},disabled:!r.canSubmit,children:r.isSubmitting?"Saving...":"Save Changes"})]})]})]})})]})}function VA(t){let r=String(t??"").replace(/[^\d]/g,"");if(!r)return"";let l=r.slice(-3),i=r.slice(0,-3);return i?`${i.replace(/\B(?=(\d{2})+(?!\d))/g,",")},${l}`:l}function xg(){if(typeof document>"u")return;let t=[".rae-phone-add-button",".rae-phone-field__add",".rae-phone-action--add",".rae-phone-inline__add"].join(", "),r=new Set;document.querySelectorAll(t).forEach(l=>r.add(l)),document.querySelectorAll(".rae-modal *").forEach(l=>{if(!(l instanceof HTMLElement)||l.children.length>0||(l.textContent||"").trim()!=="+")return;let i=l.closest(".rae-field")||l.closest("[class*='phone']")||l.parentElement;String(i?.textContent||"").toLowerCase().includes("phone")&&r.add(l)}),r.forEach(l=>{if(!(l instanceof HTMLElement)||l.dataset.raePhoneIconMounted==="true")return;l.dataset.raePhoneIconMounted="true",l.classList.add("rae-phone-add-button"),l.textContent="";let i=document.createElement("span");i.className="rae-phone-add-icon",l.appendChild(i),(0,zg.createRoot)(i).render((0,Cg.jsx)(Zg,{"aria-hidden":"true",focusable:"false"}))})}function V7(t){if(!(t instanceof HTMLElement))return;document.querySelectorAll('.rae-select[data-overlay-active="true"], .rae-searchable-select[data-overlay-active="true"]').forEach(Z=>{Z instanceof HTMLElement&&Z!==t&&delete Z.dataset.overlayActive});let r=t.querySelector('button[aria-expanded="true"]')||t.querySelector("button"),l=t.querySelector(".rae-select-options")||t.querySelector(".rae-searchable-select__options");if(!(r instanceof HTMLElement)||!(l instanceof HTMLElement))return;let i=r.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight||0,n=window.innerWidth||document.documentElement.clientWidth||0,h=4,v=12,u=Math.min(l.scrollHeight||240,280),s=o-i.bottom-v,p=i.top-v,A=s<Math.min(u,180)&&p>s,M=Math.max(140,Math.min(u,A?p:s)),H=Math.min(i.width,n-v*2),m=Math.min(Math.max(v,i.left),n-H-v),L=A?Math.max(v,i.top-M-h):Math.max(v,i.bottom+h),w=t.closest(".rae-field");document.querySelectorAll('.rae-field[data-overlay-active="true"]').forEach(Z=>{Z instanceof HTMLElement&&Z!==w&&delete Z.dataset.overlayActive}),t.dataset.overlayActive="true",w instanceof HTMLElement&&(w.dataset.overlayActive="true"),l.dataset.overlayOpen="true",l.style.setProperty("--rae-overlay-top",`${L}px`),l.style.setProperty("--rae-overlay-left",`${m}px`),l.style.setProperty("--rae-overlay-width",`${H}px`),l.style.setProperty("--rae-overlay-max-height",`${M}px`)}function mA(t){if(!(t instanceof HTMLElement))return;delete t.dataset.overlayActive;let r=t.closest(".rae-field");r instanceof HTMLElement&&delete r.dataset.overlayActive;let l=t.querySelector(".rae-select-options")||t.querySelector(".rae-searchable-select__options");l instanceof HTMLElement&&(delete l.dataset.overlayOpen,l.style.removeProperty("--rae-overlay-top"),l.style.removeProperty("--rae-overlay-left"),l.style.removeProperty("--rae-overlay-width"),l.style.removeProperty("--rae-overlay-max-height"))}function T5(t){if(!(t instanceof HTMLElement))return;let r=t.querySelector("input"),l=t.__raePortaledLocationSuggestions||t.querySelector(".rae-location-suggestions");if(!(r instanceof HTMLElement)||!(l instanceof HTMLElement))return;let i=r.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight||0,n=window.innerWidth||document.documentElement.clientWidth||0,h=4,v=12,u=Math.min(l.scrollHeight||240,280),s=o-i.bottom-v,p=i.top-v,A=s<Math.min(u,180)&&p>s,M=Math.max(120,Math.min(u,A?p:s)),H=Math.min(i.width,n-v*2),m=Math.min(Math.max(v,i.left),n-H-v),L=A?Math.max(v,i.top-M-h):Math.max(v,i.bottom+h);l.dataset.overlayOpen="true",l.style.setProperty("--rae-location-overlay-top",`${L}px`),l.style.setProperty("--rae-location-overlay-left",`${m}px`),l.style.setProperty("--rae-location-overlay-width",`${H}px`),l.style.setProperty("--rae-location-overlay-max-height",`${M}px`)}function ZA(t){if(!(t instanceof HTMLElement))return;let r=t.__raePortaledLocationSuggestions||t.querySelector(".rae-location-suggestions");if(r instanceof HTMLElement){if(delete r.dataset.overlayOpen,r.style.removeProperty("--rae-location-overlay-top"),r.style.removeProperty("--rae-location-overlay-left"),r.style.removeProperty("--rae-location-overlay-width"),r.style.removeProperty("--rae-location-overlay-max-height"),t.__raeLocationOriginalParent instanceof HTMLElement){let l=t.__raeLocationOriginalParent,i=t.__raeLocationOriginalNextSibling||null;i&&i.parentNode===l?l.insertBefore(r,i):l.appendChild(r)}delete t.__raePortaledLocationSuggestions,delete t.__raeLocationOriginalParent,delete t.__raeLocationOriginalNextSibling}}function Pe(t){if(!(t instanceof HTMLElement)||typeof document>"u")return;let r=t.__raePortaledLocationSuggestions;if(r instanceof HTMLElement&&r.isConnected&&r.parentElement===document.body)return r;let l=t.querySelector(".rae-location-suggestions");return l instanceof HTMLElement?(t.__raeLocationOriginalParent=l.parentElement,t.__raeLocationOriginalNextSibling=l.nextSibling,t.__raePortaledLocationSuggestions=l,document.body.appendChild(l),l):null}function Se(t){if(!(t instanceof HTMLElement))return;let r=t.closest(".rae-modal__body--expanded")||t.closest(".rae-modal__body"),l=t.closest(".rae-modal")?.querySelector?.(".rae-modal__footer"),i=t.__raePortaledLocationSuggestions||t.querySelector(".rae-location-suggestions"),o=t.querySelector("input");if(!(r instanceof HTMLElement)||!(i instanceof HTMLElement)||!(o instanceof HTMLElement))return;let n=o.getBoundingClientRect(),h=r.getBoundingClientRect(),v=l instanceof HTMLElement?l.getBoundingClientRect():null,u=v?Math.min(h.bottom,v.top):h.bottom,s=Math.min(Math.max(i.scrollHeight||0,180),280),M=n.bottom+8+s-u;M>0&&(r.scrollTop+=M+12)}typeof document<"u"&&!window.__raeCurrentCtcFormatterBound&&(window.__raeCurrentCtcFormatterBound=!0,document.addEventListener("input",t=>{let r=t.target;if(!(r instanceof HTMLInputElement))return;let i=r.closest(".rae-field")?.querySelector?.(".rae-field-label");if(!String(i?.textContent||"").toLowerCase().includes("current ctc"))return;let n=VA(r.value);if(n!==r.value){let h=r.selectionStart===r.value.length;if(r.value=n,h){let v=n.length;window.requestAnimationFrame(()=>{try{r.setSelectionRange(v,v)}catch{}})}}},!0));if(typeof document<"u"&&!window.__raeDropdownOverlayBound){window.__raeDropdownOverlayBound=!0;let t=r=>{let l=r?.closest?.(".rae-select, .rae-searchable-select");l instanceof HTMLElement&&window.requestAnimationFrame(()=>V7(l))};document.addEventListener("click",r=>{t(r.target),document.querySelectorAll(".rae-select, .rae-searchable-select").forEach(i=>{if(!(i instanceof HTMLElement))return;i.querySelector('button[aria-expanded="true"]')?V7(i):mA(i)})},!0),window.addEventListener("resize",()=>{document.querySelectorAll(".rae-select, .rae-searchable-select").forEach(r=>V7(r))},{passive:!0}),document.addEventListener("scroll",()=>{document.querySelectorAll(".rae-select, .rae-searchable-select").forEach(r=>V7(r))},!0)}typeof document<"u"&&!window.__raePhoneAddIconBound&&(window.__raePhoneAddIconBound=!0,new MutationObserver(()=>xg()).observe(document.body,{childList:!0,subtree:!0}),window.requestAnimationFrame(()=>xg()));if(typeof document<"u"&&!window.__raeLocationCloseBound){window.__raeLocationCloseBound=!0;let t=l=>{document.querySelectorAll(".rae-location-field").forEach(i=>{if(!(i instanceof HTMLElement))return;let o=l instanceof Node?i.contains(l):!1,n=i.__raePortaledLocationSuggestions||i.querySelector(".rae-location-suggestions");if(o){let v=Pe(i);i.dataset.locationOpen="true";let u=v||i.__raePortaledLocationSuggestions||n;u instanceof HTMLElement&&(u.style.display="block"),window.requestAnimationFrame(()=>{Se(i),T5(i)});return}delete i.dataset.locationOpen,n instanceof HTMLElement&&(n.style.display="none"),ZA(i);let h=i.querySelector("input");h instanceof HTMLInputElement&&document.activeElement===h&&h.blur()})};document.addEventListener("focusin",l=>{t(l.target)},!0),document.addEventListener("pointerdown",l=>{t(l.target)},!0),document.addEventListener("input",l=>{let i=l.target;if(!(i instanceof HTMLElement))return;let o=i.closest(".rae-location-field");o instanceof HTMLElement&&o.dataset.locationOpen==="true"&&window.requestAnimationFrame(()=>{let n=Pe(o);n instanceof HTMLElement&&(n.style.display="block"),Se(o),T5(o)})},!0),new MutationObserver(()=>{document.querySelectorAll(".rae-location-field[data-location-open='true']").forEach(l=>{if(!(l instanceof HTMLElement))return;let i=Pe(l);i instanceof HTMLElement&&(i.style.display="block"),Se(l),T5(l)})}).observe(document.body,{childList:!0,subtree:!0}),window.addEventListener("resize",()=>{document.querySelectorAll(".rae-location-field[data-location-open='true']").forEach(l=>{T5(l)})},{passive:!0}),document.addEventListener("scroll",()=>{document.querySelectorAll(".rae-location-field[data-location-open='true']").forEach(l=>{T5(l)})},!0)}typeof document<"u"&&!window.__raeValidationScrollBound&&(window.__raeValidationScrollBound=!0);function wg(t,r){t.render(ye.default.createElement(ug,{open:!0,api:r.api,context:r.context,onClose:r.onClose||(()=>{}),onSuccess:r.onSuccess,showSubmitToast:r.showSubmitToast,title:r.title}))}function xA(t){let r=(0,be.createRoot)(t.container);return wg(r,t),{update(l){wg(r,l)},unmount(){r.unmount()}}}function mS(t){let r=t.tagName||"apply-experience-add-profile";if(!customElements.get(r)){class l extends HTMLElement{connectedCallback(){this.__mountedWidget=xA({container:this,api:t.getApi(),context:t.getContext(),title:this.getAttribute("title")||void 0,onClose:t.onClose,onSuccess:t.onSuccess,showSubmitToast:t.showSubmitToast})}disconnectedCallback(){this.__mountedWidget?.unmount()}}customElements.define(r,l)}return r}function Bg(t,r){t.render(ye.default.createElement(Lg,{open:!0,api:r.api,context:r.context,onClose:r.onClose||(()=>{}),onSuccess:r.onSuccess,showSubmitToast:r.showSubmitToast,title:r.title}))}function LA(t){let r=(0,be.createRoot)(t.container);return Bg(r,t),{update(l){Bg(r,l)},unmount(){r.unmount()}}}function ZS(t){let r=t.tagName||"apply-experience-edit-profile";if(!customElements.get(r)){class l extends HTMLElement{connectedCallback(){this.__mountedWidget=LA({container:this,api:t.getApi(),context:t.getContext(),title:this.getAttribute("title")||void 0,onClose:t.onClose,onSuccess:t.onSuccess,showSubmitToast:t.showSubmitToast})}disconnectedCallback(){this.__mountedWidget?.unmount()}}customElements.define(r,l)}return r}export{xA as mountAddProfile,LA as mountEditProfile,mS as registerAddProfileElement,ZS as registerEditProfileElement};
|
|
30
|
+
`)),[]});var fH=(t=>(t[t.None=0]="None",t[t.Closed=1]="Closed",t[t.Enter=2]="Enter",t[t.Leave=4]="Leave",t))(fH||{});function z8(t){let r={};for(let l in t)t[l]===!0&&(r[`data-${l}`]="");return r}function C8(t,r,l,i){let[o,n]=(0,g5.useState)(l),{hasFlag:h,addFlag:v,removeFlag:u}=Gh(t&&o?3:0),s=(0,g5.useRef)(!1),p=(0,g5.useRef)(!1),A=W1();return a1(()=>{var M;if(t){if(l&&n(!0),!r){l&&v(3);return}return(M=i?.start)==null||M.call(i,l),AH(r,{inFlight:s,prepare(){p.current?p.current=!1:p.current=s.current,s.current=!0,!p.current&&(l?(v(3),u(4)):(v(4),u(2)))},run(){p.current?l?(u(3),v(4)):(u(4),v(3)):l?u(1):v(1)},done(){var H;p.current&&ZH(r)||(s.current=!1,u(7),l||n(!1),(H=i?.end)==null||H.call(i,l))}})}},[t,l,r,A]),t?[o,{closed:h(1),enter:h(2),leave:h(4),transition:h(2)||h(4)}]:[l,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function AH(t,{prepare:r,run:l,done:i,inFlight:o}){let n=T1();return mH(t,{prepare:r,inFlight:o}),n.nextFrame(()=>{l(),n.requestAnimationFrame(()=>{n.add(VH(t,i))})}),n.dispose}function VH(t,r){var l,i;let o=T1();if(!t)return o.dispose;let n=!1;o.add(()=>{n=!0});let h=(i=(l=t.getAnimations)==null?void 0:l.call(t).filter(v=>v instanceof CSSTransition))!=null?i:[];return h.length===0?(r(),o.dispose):(Promise.allSettled(h.map(v=>v.finished)).then(()=>{n||r()}),o.dispose)}function mH(t,{inFlight:r,prepare:l}){if(r!=null&&r.current){l();return}let i=t.style.transition;t.style.transition="none",l(),t.offsetHeight,t.style.transition=i}function ZH(t){var r,l;return((l=(r=t.getAnimations)==null?void 0:r.call(t))!=null?l:[]).some(i=>i instanceof CSSTransition&&i.playState!=="finished")}var u5=E(k(),1);function qh(t,{container:r,accept:l,walk:i}){let o=(0,u5.useRef)(l),n=(0,u5.useRef)(i);(0,u5.useEffect)(()=>{o.current=l,n.current=i},[l,i]),a1(()=>{if(!r||!t)return;let h=R0(r);if(!h)return;let v=o.current,u=n.current,s=Object.assign(A=>v(A),{acceptNode:v}),p=h.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,s,!1);for(;p.nextNode();)u(p.currentNode)},[r,t,o,n])}var Fa=E(k(),1);function L6(t,r){let l=(0,Fa.useRef)([]),i=_(t);(0,Fa.useEffect)(()=>{let o=[...l.current];for(let[n,h]of r.entries())if(l.current[n]!==h){let v=i(r,o);return l.current=r,v}},[i,...r])}var r1=E(k(),1),V5=E(k(),1);function Da(){return typeof window<"u"}function K4(t){return Yh(t)?(t.nodeName||"").toLowerCase():"#document"}function L0(t){var r;return(t==null||(r=t.ownerDocument)==null?void 0:r.defaultView)||window}function Z2(t){var r;return(r=(Yh(t)?t.ownerDocument:t.document)||window.document)==null?void 0:r.documentElement}function Yh(t){return Da()?t instanceof Node||t instanceof L0(t).Node:!1}function h0(t){return Da()?t instanceof Element||t instanceof L0(t).Element:!1}function x2(t){return Da()?t instanceof HTMLElement||t instanceof L0(t).HTMLElement:!1}function Kh(t){return!Da()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof L0(t).ShadowRoot}function w8(t){let{overflow:r,overflowX:l,overflowY:i,display:o}=k0(t);return/auto|scroll|overlay|hidden|clip/.test(r+i+l)&&o!=="inline"&&o!=="contents"}function Xh(t){return/^(table|td|th)$/.test(K4(t))}function s5(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}var xH=/transform|translate|scale|rotate|perspective|filter/,LH=/paint|layout|strict|content/,z6=t=>!!t&&t!=="none",xl;function Ea(t){let r=h0(t)?k0(t):t;return z6(r.transform)||z6(r.translate)||z6(r.scale)||z6(r.rotate)||z6(r.perspective)||!p5()&&(z6(r.backdropFilter)||z6(r.filter))||xH.test(r.willChange||"")||LH.test(r.contain||"")}function Qh(t){let r=R2(t);for(;x2(r)&&!Y4(r);){if(Ea(r))return r;if(s5(r))return null;r=R2(r)}return null}function p5(){return xl==null&&(xl=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),xl}function Y4(t){return/^(html|body|#document)$/.test(K4(t))}function k0(t){return L0(t).getComputedStyle(t)}function H5(t){return h0(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function R2(t){if(K4(t)==="html")return t;let r=t.assignedSlot||t.parentNode||Kh(t)&&t.host||Z2(t);return Kh(r)?r.host:r}function Jh(t){let r=R2(t);return Y4(r)?t.ownerDocument?t.ownerDocument.body:t.body:x2(r)&&w8(r)?r:Jh(r)}function d4(t,r,l){var i;r===void 0&&(r=[]),l===void 0&&(l=!0);let o=Jh(t),n=o===((i=t.ownerDocument)==null?void 0:i.body),h=L0(o);if(n){let v=Na(h);return r.concat(h,h.visualViewport||[],w8(o)?o:[],v&&l?d4(v):[])}else return r.concat(o,d4(o,[],l))}function Na(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function td(){let t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(r=>{let{brand:l,version:i}=r;return l+"/"+i}).join(" "):navigator.userAgent}var I2=Math.min,X1=Math.max,C6=Math.round,B8=Math.floor,L2=t=>({x:t,y:t}),zH={left:"right",right:"left",bottom:"top",top:"bottom"};function Ll(t,r,l){return X1(t,I2(r,l))}function X4(t,r){return typeof t=="function"?t(r):t}function v4(t){return t.split("-")[0]}function P8(t){return t.split("-")[1]}function zl(t){return t==="x"?"y":"x"}function Cl(t){return t==="y"?"height":"width"}function k2(t){let r=t[0];return r==="t"||r==="b"?"y":"x"}function wl(t){return zl(k2(t))}function ld(t,r,l){l===void 0&&(l=!1);let i=P8(t),o=wl(t),n=Cl(o),h=o==="x"?i===(l?"end":"start")?"right":"left":i==="start"?"bottom":"top";return r.reference[n]>r.floating[n]&&(h=M5(h)),[h,M5(h)]}function ed(t){let r=M5(t);return[_a(t),r,_a(r)]}function _a(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}var ad=["left","right"],rd=["right","left"],CH=["top","bottom"],wH=["bottom","top"];function BH(t,r,l){switch(t){case"top":case"bottom":return l?r?rd:ad:r?ad:rd;case"left":case"right":return r?CH:wH;default:return[]}}function id(t,r,l,i){let o=P8(t),n=BH(v4(t),l==="start",i);return o&&(n=n.map(h=>h+"-"+o),r&&(n=n.concat(n.map(_a)))),n}function M5(t){let r=v4(t);return zH[r]+t.slice(r.length)}function PH(t){return{top:0,right:0,bottom:0,left:0,...t}}function od(t){return typeof t!="number"?PH(t):{top:t,right:t,bottom:t,left:t}}function w6(t){let{x:r,y:l,width:i,height:o}=t;return{width:i,height:o,top:l,left:r,right:r+i,bottom:l+o,x:r,y:l}}var A5=E(T2(),1);function nd(t,r,l){let{reference:i,floating:o}=t,n=k2(r),h=wl(r),v=Cl(h),u=v4(r),s=n==="y",p=i.x+i.width/2-o.width/2,A=i.y+i.height/2-o.height/2,M=i[v]/2-o[v]/2,H;switch(u){case"top":H={x:p,y:i.y-o.height};break;case"bottom":H={x:p,y:i.y+i.height};break;case"right":H={x:i.x+i.width,y:A};break;case"left":H={x:i.x-o.width,y:A};break;default:H={x:i.x,y:i.y}}switch(P8(r)){case"start":H[h]-=M*(l&&s?-1:1);break;case"end":H[h]+=M*(l&&s?-1:1);break}return H}async function Bl(t,r){var l;r===void 0&&(r={});let{x:i,y:o,platform:n,rects:h,elements:v,strategy:u}=t,{boundary:s="clippingAncestors",rootBoundary:p="viewport",elementContext:A="floating",altBoundary:M=!1,padding:H=0}=X4(r,t),m=od(H),w=v[M?A==="floating"?"reference":"floating":A],Z=w6(await n.getClippingRect({element:(l=await(n.isElement==null?void 0:n.isElement(w)))==null||l?w:w.contextElement||await(n.getDocumentElement==null?void 0:n.getDocumentElement(v.floating)),boundary:s,rootBoundary:p,strategy:u})),V=A==="floating"?{x:i,y:o,width:h.floating.width,height:h.floating.height}:h.reference,x=await(n.getOffsetParent==null?void 0:n.getOffsetParent(v.floating)),z=await(n.isElement==null?void 0:n.isElement(x))?await(n.getScale==null?void 0:n.getScale(x))||{x:1,y:1}:{x:1,y:1},B=w6(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:v,rect:V,offsetParent:x,strategy:u}):V);return{top:(Z.top-B.top+m.top)/z.y,bottom:(B.bottom-Z.bottom+m.bottom)/z.y,left:(Z.left-B.left+m.left)/z.x,right:(B.right-Z.right+m.right)/z.x}}var SH=50,cd=async(t,r,l)=>{let{placement:i="bottom",strategy:o="absolute",middleware:n=[],platform:h}=l,v=h.detectOverflow?h:{...h,detectOverflow:Bl},u=await(h.isRTL==null?void 0:h.isRTL(r)),s=await h.getElementRects({reference:t,floating:r,strategy:o}),{x:p,y:A}=nd(s,i,u),M=i,H=0,m={};for(let L=0;L<n.length;L++){let w=n[L];if(!w)continue;let{name:Z,fn:V}=w,{x,y:z,data:B,reset:P}=await V({x:p,y:A,initialPlacement:i,placement:M,strategy:o,middlewareData:m,rects:s,platform:v,elements:{reference:t,floating:r}});p=x??p,A=z??A,m[Z]={...m[Z],...B},P&&H<SH&&(H++,typeof P=="object"&&(P.placement&&(M=P.placement),P.rects&&(s=P.rects===!0?await h.getElementRects({reference:t,floating:r,strategy:o}):P.rects),{x:p,y:A}=nd(s,M,u)),L=-1)}return{x:p,y:A,placement:M,strategy:o,middlewareData:m}};var hd=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(r){var l,i;let{placement:o,middlewareData:n,rects:h,initialPlacement:v,platform:u,elements:s}=r,{mainAxis:p=!0,crossAxis:A=!0,fallbackPlacements:M,fallbackStrategy:H="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:L=!0,...w}=X4(t,r);if((l=n.arrow)!=null&&l.alignmentOffset)return{};let Z=v4(o),V=k2(v),x=v4(v)===v,z=await(u.isRTL==null?void 0:u.isRTL(s.floating)),B=M||(x||!L?[M5(v)]:ed(v)),P=m!=="none";!M&&P&&B.push(...id(v,L,m,z));let $=[v,...B],S=await u.detectOverflow(r,w),O=[],y=((i=n.flip)==null?void 0:i.overflows)||[];if(p&&O.push(S[Z]),A){let G=ld(o,h,z);O.push(S[G[0]],S[G[1]])}if(y=[...y,{placement:o,overflows:O}],!O.every(G=>G<=0)){var F,U;let G=(((F=n.flip)==null?void 0:F.index)||0)+1,I=$[G];if(I&&(!(A==="alignment"?V!==k2(I):!1)||y.every(X=>k2(X.placement)===V?X.overflows[0]>0:!0)))return{data:{index:G,overflows:y},reset:{placement:I}};let J=(U=y.filter(A1=>A1.overflows[0]<=0).sort((A1,X)=>A1.overflows[1]-X.overflows[1])[0])==null?void 0:U.placement;if(!J)switch(H){case"bestFit":{var q;let A1=(q=y.filter(X=>{if(P){let l1=k2(X.placement);return l1===V||l1==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(l1=>l1>0).reduce((l1,T)=>l1+T,0)]).sort((X,l1)=>X[1]-l1[1])[0])==null?void 0:q[0];A1&&(J=A1);break}case"initialPlacement":J=v;break}if(o!==J)return{reset:{placement:J}}}return{}}}};var yH=new Set(["left","top"]);async function bH(t,r){let{placement:l,platform:i,elements:o}=t,n=await(i.isRTL==null?void 0:i.isRTL(o.floating)),h=v4(l),v=P8(l),u=k2(l)==="y",s=yH.has(h)?-1:1,p=n&&u?-1:1,A=X4(r,t),{mainAxis:M,crossAxis:H,alignmentAxis:m}=typeof A=="number"?{mainAxis:A,crossAxis:0,alignmentAxis:null}:{mainAxis:A.mainAxis||0,crossAxis:A.crossAxis||0,alignmentAxis:A.alignmentAxis};return v&&typeof m=="number"&&(H=v==="end"?m*-1:m),u?{x:H*p,y:M*s}:{x:M*s,y:H*p}}var dd=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(r){var l,i;let{x:o,y:n,placement:h,middlewareData:v}=r,u=await bH(r,t);return h===((l=v.offset)==null?void 0:l.placement)&&(i=v.arrow)!=null&&i.alignmentOffset?{}:{x:o+u.x,y:n+u.y,data:{...u,placement:h}}}}},vd=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(r){let{x:l,y:i,placement:o,platform:n}=r,{mainAxis:h=!0,crossAxis:v=!1,limiter:u={fn:Z=>{let{x:V,y:x}=Z;return{x:V,y:x}}},...s}=X4(t,r),p={x:l,y:i},A=await n.detectOverflow(r,s),M=k2(v4(o)),H=zl(M),m=p[H],L=p[M];if(h){let Z=H==="y"?"top":"left",V=H==="y"?"bottom":"right",x=m+A[Z],z=m-A[V];m=Ll(x,m,z)}if(v){let Z=M==="y"?"top":"left",V=M==="y"?"bottom":"right",x=L+A[Z],z=L-A[V];L=Ll(x,L,z)}let w=u.fn({...r,[H]:m,[M]:L});return{...w,data:{x:w.x-l,y:w.y-i,enabled:{[H]:h,[M]:v}}}}}};var gd=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(r){var l,i;let{placement:o,rects:n,platform:h,elements:v}=r,{apply:u=()=>{},...s}=X4(t,r),p=await h.detectOverflow(r,s),A=v4(o),M=P8(o),H=k2(o)==="y",{width:m,height:L}=n.floating,w,Z;A==="top"||A==="bottom"?(w=A,Z=M===(await(h.isRTL==null?void 0:h.isRTL(v.floating))?"start":"end")?"left":"right"):(Z=A,w=M==="end"?"top":"bottom");let V=L-p.top-p.bottom,x=m-p.left-p.right,z=I2(L-p[w],V),B=I2(m-p[Z],x),P=!r.middlewareData.shift,$=z,S=B;if((l=r.middlewareData.shift)!=null&&l.enabled.x&&(S=x),(i=r.middlewareData.shift)!=null&&i.enabled.y&&($=V),P&&!M){let y=X1(p.left,0),F=X1(p.right,0),U=X1(p.top,0),q=X1(p.bottom,0);H?S=m-2*(y!==0||F!==0?y+F:X1(p.left,p.right)):$=L-2*(U!==0||q!==0?U+q:X1(p.top,p.bottom))}await u({...r,availableWidth:S,availableHeight:$});let O=await h.getDimensions(v.floating);return m!==O.width||L!==O.height?{reset:{rects:!0}}:{}}}};function Hd(t){let r=k0(t),l=parseFloat(r.width)||0,i=parseFloat(r.height)||0,o=x2(t),n=o?t.offsetWidth:l,h=o?t.offsetHeight:i,v=C6(l)!==n||C6(i)!==h;return v&&(l=n,i=h),{width:l,height:i,$:v}}function Sl(t){return h0(t)?t:t.contextElement}function S8(t){let r=Sl(t);if(!x2(r))return L2(1);let l=r.getBoundingClientRect(),{width:i,height:o,$:n}=Hd(r),h=(n?C6(l.width):l.width)/i,v=(n?C6(l.height):l.height)/o;return(!h||!Number.isFinite(h))&&(h=1),(!v||!Number.isFinite(v))&&(v=1),{x:h,y:v}}var TH=L2(0);function Md(t){let r=L0(t);return!p5()||!r.visualViewport?TH:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function $H(t,r,l){return r===void 0&&(r=!1),!l||r&&l!==L0(t)?!1:r}function B6(t,r,l,i){r===void 0&&(r=!1),l===void 0&&(l=!1);let o=t.getBoundingClientRect(),n=Sl(t),h=L2(1);r&&(i?h0(i)&&(h=S8(i)):h=S8(t));let v=$H(n,l,i)?Md(n):L2(0),u=(o.left+v.x)/h.x,s=(o.top+v.y)/h.y,p=o.width/h.x,A=o.height/h.y;if(n){let M=L0(n),H=i&&h0(i)?L0(i):i,m=M,L=Na(m);for(;L&&i&&H!==m;){let w=S8(L),Z=L.getBoundingClientRect(),V=k0(L),x=Z.left+(L.clientLeft+parseFloat(V.paddingLeft))*w.x,z=Z.top+(L.clientTop+parseFloat(V.paddingTop))*w.y;u*=w.x,s*=w.y,p*=w.x,A*=w.y,u+=x,s+=z,m=L0(L),L=Na(m)}}return w6({width:p,height:A,x:u,y:s})}function Ra(t,r){let l=H5(t).scrollLeft;return r?r.left+l:B6(Z2(t)).left+l}function fd(t,r){let l=t.getBoundingClientRect(),i=l.left+r.scrollLeft-Ra(t,l),o=l.top+r.scrollTop;return{x:i,y:o}}function OH(t){let{elements:r,rect:l,offsetParent:i,strategy:o}=t,n=o==="fixed",h=Z2(i),v=r?s5(r.floating):!1;if(i===h||v&&n)return l;let u={scrollLeft:0,scrollTop:0},s=L2(1),p=L2(0),A=x2(i);if((A||!A&&!n)&&((K4(i)!=="body"||w8(h))&&(u=H5(i)),A)){let H=B6(i);s=S8(i),p.x=H.x+i.clientLeft,p.y=H.y+i.clientTop}let M=h&&!A&&!n?fd(h,u):L2(0);return{width:l.width*s.x,height:l.height*s.y,x:l.x*s.x-u.scrollLeft*s.x+p.x+M.x,y:l.y*s.y-u.scrollTop*s.y+p.y+M.y}}function FH(t){return Array.from(t.getClientRects())}function DH(t){let r=Z2(t),l=H5(t),i=t.ownerDocument.body,o=X1(r.scrollWidth,r.clientWidth,i.scrollWidth,i.clientWidth),n=X1(r.scrollHeight,r.clientHeight,i.scrollHeight,i.clientHeight),h=-l.scrollLeft+Ra(t),v=-l.scrollTop;return k0(i).direction==="rtl"&&(h+=X1(r.clientWidth,i.clientWidth)-o),{width:o,height:n,x:h,y:v}}var ud=25;function EH(t,r){let l=L0(t),i=Z2(t),o=l.visualViewport,n=i.clientWidth,h=i.clientHeight,v=0,u=0;if(o){n=o.width,h=o.height;let p=p5();(!p||p&&r==="fixed")&&(v=o.offsetLeft,u=o.offsetTop)}let s=Ra(i);if(s<=0){let p=i.ownerDocument,A=p.body,M=getComputedStyle(A),H=p.compatMode==="CSS1Compat"&&parseFloat(M.marginLeft)+parseFloat(M.marginRight)||0,m=Math.abs(i.clientWidth-A.clientWidth-H);m<=ud&&(n-=m)}else s<=ud&&(n+=s);return{width:n,height:h,x:v,y:u}}function NH(t,r){let l=B6(t,!0,r==="fixed"),i=l.top+t.clientTop,o=l.left+t.clientLeft,n=x2(t)?S8(t):L2(1),h=t.clientWidth*n.x,v=t.clientHeight*n.y,u=o*n.x,s=i*n.y;return{width:h,height:v,x:u,y:s}}function sd(t,r,l){let i;if(r==="viewport")i=EH(t,l);else if(r==="document")i=DH(Z2(t));else if(h0(r))i=NH(r,l);else{let o=Md(t);i={x:r.x-o.x,y:r.y-o.y,width:r.width,height:r.height}}return w6(i)}function Ad(t,r){let l=R2(t);return l===r||!h0(l)||Y4(l)?!1:k0(l).position==="fixed"||Ad(l,r)}function _H(t,r){let l=r.get(t);if(l)return l;let i=d4(t,[],!1).filter(v=>h0(v)&&K4(v)!=="body"),o=null,n=k0(t).position==="fixed",h=n?R2(t):t;for(;h0(h)&&!Y4(h);){let v=k0(h),u=Ea(h);!u&&v.position==="fixed"&&(o=null),(n?!u&&!o:!u&&v.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||w8(h)&&!u&&Ad(t,h))?i=i.filter(p=>p!==h):o=v,h=R2(h)}return r.set(t,i),i}function RH(t){let{element:r,boundary:l,rootBoundary:i,strategy:o}=t,h=[...l==="clippingAncestors"?s5(r)?[]:_H(r,this._c):[].concat(l),i],v=sd(r,h[0],o),u=v.top,s=v.right,p=v.bottom,A=v.left;for(let M=1;M<h.length;M++){let H=sd(r,h[M],o);u=X1(H.top,u),s=I2(H.right,s),p=I2(H.bottom,p),A=X1(H.left,A)}return{width:s-A,height:p-u,x:A,y:u}}function IH(t){let{width:r,height:l}=Hd(t);return{width:r,height:l}}function kH(t,r,l){let i=x2(r),o=Z2(r),n=l==="fixed",h=B6(t,!0,n,r),v={scrollLeft:0,scrollTop:0},u=L2(0);function s(){u.x=Ra(o)}if(i||!i&&!n)if((K4(r)!=="body"||w8(o))&&(v=H5(r)),i){let H=B6(r,!0,n,r);u.x=H.x+r.clientLeft,u.y=H.y+r.clientTop}else o&&s();n&&!i&&o&&s();let p=o&&!i&&!n?fd(o,v):L2(0),A=h.left+v.scrollLeft-u.x-p.x,M=h.top+v.scrollTop-u.y-p.y;return{x:A,y:M,width:h.width,height:h.height}}function Pl(t){return k0(t).position==="static"}function pd(t,r){if(!x2(t)||k0(t).position==="fixed")return null;if(r)return r(t);let l=t.offsetParent;return Z2(t)===l&&(l=l.ownerDocument.body),l}function Vd(t,r){let l=L0(t);if(s5(t))return l;if(!x2(t)){let o=R2(t);for(;o&&!Y4(o);){if(h0(o)&&!Pl(o))return o;o=R2(o)}return l}let i=pd(t,r);for(;i&&Xh(i)&&Pl(i);)i=pd(i,r);return i&&Y4(i)&&Pl(i)&&!Ea(i)?l:i||Qh(t)||l}var UH=async function(t){let r=this.getOffsetParent||Vd,l=this.getDimensions,i=await l(t.floating);return{reference:kH(t.reference,await r(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function GH(t){return k0(t).direction==="rtl"}var yl={convertOffsetParentRelativeRectToViewportRelativeRect:OH,getDocumentElement:Z2,getClippingRect:RH,getOffsetParent:Vd,getElementRects:UH,getClientRects:FH,getDimensions:IH,getScale:S8,isElement:h0,isRTL:GH};function md(t,r){return t.x===r.x&&t.y===r.y&&t.width===r.width&&t.height===r.height}function WH(t,r){let l=null,i,o=Z2(t);function n(){var v;clearTimeout(i),(v=l)==null||v.disconnect(),l=null}function h(v,u){v===void 0&&(v=!1),u===void 0&&(u=1),n();let s=t.getBoundingClientRect(),{left:p,top:A,width:M,height:H}=s;if(v||r(),!M||!H)return;let m=B8(A),L=B8(o.clientWidth-(p+M)),w=B8(o.clientHeight-(A+H)),Z=B8(p),x={rootMargin:-m+"px "+-L+"px "+-w+"px "+-Z+"px",threshold:X1(0,I2(1,u))||1},z=!0;function B(P){let $=P[0].intersectionRatio;if($!==u){if(!z)return h();$?h(!1,$):i=setTimeout(()=>{h(!1,1e-7)},1e3)}$===1&&!md(s,t.getBoundingClientRect())&&h(),z=!1}try{l=new IntersectionObserver(B,{...x,root:o.ownerDocument})}catch{l=new IntersectionObserver(B,x)}l.observe(t)}return h(!0),n}function Ia(t,r,l,i){i===void 0&&(i={});let{ancestorScroll:o=!0,ancestorResize:n=!0,elementResize:h=typeof ResizeObserver=="function",layoutShift:v=typeof IntersectionObserver=="function",animationFrame:u=!1}=i,s=Sl(t),p=o||n?[...s?d4(s):[],...r?d4(r):[]]:[];p.forEach(Z=>{o&&Z.addEventListener("scroll",l,{passive:!0}),n&&Z.addEventListener("resize",l)});let A=s&&v?WH(s,l):null,M=-1,H=null;h&&(H=new ResizeObserver(Z=>{let[V]=Z;V&&V.target===s&&H&&r&&(H.unobserve(r),cancelAnimationFrame(M),M=requestAnimationFrame(()=>{var x;(x=H)==null||x.observe(r)})),l()}),s&&!u&&H.observe(s),r&&H.observe(r));let m,L=u?B6(t):null;u&&w();function w(){let Z=B6(t);L&&!md(L,Z)&&l(),L=Z,m=requestAnimationFrame(w)}return l(),()=>{var Z;p.forEach(V=>{o&&V.removeEventListener("scroll",l),n&&V.removeEventListener("resize",l)}),A?.(),(Z=H)==null||Z.disconnect(),H=null,u&&cancelAnimationFrame(m)}}var y8=Bl,Zd=dd;var xd=vd,Ld=hd,zd=gd;var ka=(t,r,l)=>{let i=new Map,o={platform:yl,...l},n={...o.platform,_c:i};return cd(t,r,{...o,platform:n})};var q1=E(k(),1),wd=E(k(),1),Bd=E(T2(),1),jH=typeof document<"u",qH=function(){},Ua=jH?wd.useLayoutEffect:qH;function Ga(t,r){if(t===r)return!0;if(typeof t!=typeof r)return!1;if(typeof t=="function"&&t.toString()===r.toString())return!0;let l,i,o;if(t&&r&&typeof t=="object"){if(Array.isArray(t)){if(l=t.length,l!==r.length)return!1;for(i=l;i--!==0;)if(!Ga(t[i],r[i]))return!1;return!0}if(o=Object.keys(t),l=o.length,l!==Object.keys(r).length)return!1;for(i=l;i--!==0;)if(!{}.hasOwnProperty.call(r,o[i]))return!1;for(i=l;i--!==0;){let n=o[i];if(!(n==="_owner"&&t.$$typeof)&&!Ga(t[n],r[n]))return!1}return!0}return t!==t&&r!==r}function Pd(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Cd(t,r){let l=Pd(t);return Math.round(r*l)/l}function bl(t){let r=q1.useRef(t);return Ua(()=>{r.current=t}),r}function Sd(t){t===void 0&&(t={});let{placement:r="bottom",strategy:l="absolute",middleware:i=[],platform:o,elements:{reference:n,floating:h}={},transform:v=!0,whileElementsMounted:u,open:s}=t,[p,A]=q1.useState({x:0,y:0,strategy:l,placement:r,middlewareData:{},isPositioned:!1}),[M,H]=q1.useState(i);Ga(M,i)||H(i);let[m,L]=q1.useState(null),[w,Z]=q1.useState(null),V=q1.useCallback(X=>{X!==P.current&&(P.current=X,L(X))},[]),x=q1.useCallback(X=>{X!==$.current&&($.current=X,Z(X))},[]),z=n||m,B=h||w,P=q1.useRef(null),$=q1.useRef(null),S=q1.useRef(p),O=u!=null,y=bl(u),F=bl(o),U=bl(s),q=q1.useCallback(()=>{if(!P.current||!$.current)return;let X={placement:r,strategy:l,middleware:M};F.current&&(X.platform=F.current),ka(P.current,$.current,X).then(l1=>{let T={...l1,isPositioned:U.current!==!1};G.current&&!Ga(S.current,T)&&(S.current=T,Bd.flushSync(()=>{A(T)}))})},[M,r,l,F,U]);Ua(()=>{s===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,A(X=>({...X,isPositioned:!1})))},[s]);let G=q1.useRef(!1);Ua(()=>(G.current=!0,()=>{G.current=!1}),[]),Ua(()=>{if(z&&(P.current=z),B&&($.current=B),z&&B){if(y.current)return y.current(z,B,q);q()}},[z,B,q,y,O]);let I=q1.useMemo(()=>({reference:P,floating:$,setReference:V,setFloating:x}),[V,x]),J=q1.useMemo(()=>({reference:z,floating:B}),[z,B]),A1=q1.useMemo(()=>{let X={position:l,left:0,top:0};if(!J.floating)return X;let l1=Cd(J.floating,p.x),T=Cd(J.floating,p.y);return v?{...X,transform:"translate("+l1+"px, "+T+"px)",...Pd(J.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:l1,top:T}},[l,v,J.floating,p.x,p.y]);return q1.useMemo(()=>({...p,update:q,refs:I,elements:J,floatingStyles:A1}),[p,q,I,J,A1])}var f5=(t,r)=>{let l=Zd(t);return{name:l.name,fn:l.fn,options:[t,r]}},Tl=(t,r)=>{let l=xd(t);return{name:l.name,fn:l.fn,options:[t,r]}};var $l=(t,r)=>{let l=Ld(t);return{name:l.name,fn:l.fn,options:[t,r]}},Ol=(t,r)=>{let l=zd(t);return{name:l.name,fn:l.fn,options:[t,r]}};var Fd={...r1},KH=Fd.useInsertionEffect,YH=KH||(t=>t());function Dd(t){let r=r1.useRef(()=>{});return YH(()=>{r.current=t}),r1.useCallback(function(){for(var l=arguments.length,i=new Array(l),o=0;o<l;o++)i[o]=arguments[o];return r.current==null?void 0:r.current(...i)},[])}var XH="ArrowUp",QH="ArrowDown",JH="ArrowLeft",tM="ArrowRight";var Dl=typeof document<"u"?V5.useLayoutEffect:V5.useEffect;var aM=[JH,tM],rM=[XH,QH],az=[...aM,...rM];var yd=!1,lM=0,bd=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+lM++;function eM(){let[t,r]=r1.useState(()=>yd?bd():void 0);return Dl(()=>{t==null&&r(bd())},[]),r1.useEffect(()=>{yd=!0},[]),t}var iM=Fd.useId,oM=iM||eM;function nM(){let t=new Map;return{emit(r,l){var i;(i=t.get(r))==null||i.forEach(o=>o(l))},on(r,l){t.set(r,[...t.get(r)||[],l])},off(r,l){var i;t.set(r,((i=t.get(r))==null?void 0:i.filter(o=>o!==l))||[])}}}var cM=r1.createContext(null),hM=r1.createContext(null),dM=()=>{var t;return((t=r1.useContext(cM))==null?void 0:t.id)||null},vM=()=>r1.useContext(hM);var gM="data-floating-ui-focusable";function uM(t){let{open:r=!1,onOpenChange:l,elements:i}=t,o=oM(),n=r1.useRef({}),[h]=r1.useState(()=>nM()),v=dM()!=null,[u,s]=r1.useState(i.reference),p=Dd((H,m,L)=>{n.current.openEvent=H?m:void 0,h.emit("openchange",{open:H,event:m,reason:L,nested:v}),l?.(H,m,L)}),A=r1.useMemo(()=>({setPositionReference:s}),[]),M=r1.useMemo(()=>({reference:u||i.reference||null,floating:i.floating||null,domReference:i.reference}),[u,i.reference,i.floating]);return r1.useMemo(()=>({dataRef:n,open:r,onOpenChange:p,elements:M,events:h,floatingId:o,refs:A}),[r,p,M,h,o,A])}function Ed(t){t===void 0&&(t={});let{nodeId:r}=t,l=uM({...t,elements:{reference:null,floating:null,...t.elements}}),i=t.rootContext||l,o=i.elements,[n,h]=r1.useState(null),[v,u]=r1.useState(null),p=o?.domReference||n,A=r1.useRef(null),M=vM();Dl(()=>{p&&(A.current=p)},[p]);let H=Sd({...t,elements:{...o,...v&&{reference:v}}}),m=r1.useCallback(x=>{let z=h0(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),contextElement:x}:x;u(z),H.refs.setReference(z)},[H.refs]),L=r1.useCallback(x=>{(h0(x)||x===null)&&(A.current=x,h(x)),(h0(H.refs.reference.current)||H.refs.reference.current===null||x!==null&&!h0(x))&&H.refs.setReference(x)},[H.refs]),w=r1.useMemo(()=>({...H.refs,setReference:L,setPositionReference:m,domReference:A}),[H.refs,L,m]),Z=r1.useMemo(()=>({...H.elements,domReference:p}),[H.elements,p]),V=r1.useMemo(()=>({...H,...i,refs:w,elements:Z,nodeId:r}),[H,w,Z,r,i]);return Dl(()=>{i.dataRef.current.floatingContext=V;let x=M?.nodesRef.current.find(z=>z.id===r);x&&(x.context=V)}),r1.useMemo(()=>({...H,context:V,refs:w,elements:Z}),[H,w,Z,V])}var Td="active",$d="selected";function Fl(t,r,l){let i=new Map,o=l==="item",n=t;if(o&&t){let{[Td]:h,[$d]:v,...u}=t;n=u}return{...l==="floating"&&{tabIndex:-1,[gM]:""},...n,...r.map(h=>{let v=h?h[l]:null;return typeof v=="function"?t?v(t):null:v}).concat(t).reduce((h,v)=>(v&&Object.entries(v).forEach(u=>{let[s,p]=u;if(!(o&&[Td,$d].includes(s)))if(s.indexOf("on")===0){if(i.has(s)||i.set(s,[]),typeof p=="function"){var A;(A=i.get(s))==null||A.push(p),h[s]=function(){for(var M,H=arguments.length,m=new Array(H),L=0;L<H;L++)m[L]=arguments[L];return(M=i.get(s))==null?void 0:M.map(w=>w(...m)).find(w=>w!==void 0)}}}else h[s]=p}),h),{})}}function Nd(t){t===void 0&&(t=[]);let r=t.map(v=>v?.reference),l=t.map(v=>v?.floating),i=t.map(v=>v?.item),o=r1.useCallback(v=>Fl(v,t,"reference"),r),n=r1.useCallback(v=>Fl(v,t,"floating"),l),h=r1.useCallback(v=>Fl(v,t,"item"),i);return r1.useMemo(()=>({getReferenceProps:o,getFloatingProps:n,getItemProps:h}),[o,n,h])}function Od(t,r){return{...t,rects:{...t.rects,floating:{...t.rects.floating,height:r}}}}var _d=t=>({name:"inner",options:t,async fn(r){let{listRef:l,overflowRef:i,onFallbackChange:o,offset:n=0,index:h=0,minItemsVisible:v=4,referenceOverflowThreshold:u=0,scrollRef:s,...p}=X4(t,r),{rects:A,elements:{floating:M}}=r,H=l.current[h],m=s?.current||M,L=M.clientTop||m.clientTop,w=M.clientTop!==0,Z=m.clientTop!==0,V=M===m;if(!H)return{};let x={...r,...await f5(-H.offsetTop-M.clientTop-A.reference.height/2-H.offsetHeight/2-n).fn(r)},z=await y8(Od(x,m.scrollHeight+L+M.clientTop),p),B=await y8(x,{...p,elementContext:"reference"}),P=X1(0,z.top),$=x.y+P,y=(m.scrollHeight>m.clientHeight?F=>F:C6)(X1(0,m.scrollHeight+(w&&V||Z?L*2:0)-P-X1(0,z.bottom)));if(m.style.maxHeight=y+"px",m.scrollTop=P,o){let F=m.offsetHeight<H.offsetHeight*I2(v,l.current.length)-1||B.top>=-u||B.bottom>=-u;A5.flushSync(()=>o(F))}return i&&(i.current=await y8(Od({...x,y:$},m.offsetHeight+L+M.clientTop),p)),{y:$}}});function Rd(t,r){let{open:l,elements:i}=t,{enabled:o=!0,overflowRef:n,scrollRef:h,onChange:v}=r,u=Dd(v),s=r1.useRef(!1),p=r1.useRef(null),A=r1.useRef(null);r1.useEffect(()=>{if(!o)return;function H(L){if(L.ctrlKey||!m||n.current==null)return;let w=L.deltaY,Z=n.current.top>=-.5,V=n.current.bottom>=-.5,x=m.scrollHeight-m.clientHeight,z=w<0?-1:1,B=w<0?"max":"min";m.scrollHeight<=m.clientHeight||(!Z&&w>0||!V&&w<0?(L.preventDefault(),A5.flushSync(()=>{u(P=>P+Math[B](w,x*z))})):/firefox/i.test(td())&&(m.scrollTop+=w))}let m=h?.current||i.floating;if(l&&m)return m.addEventListener("wheel",H),requestAnimationFrame(()=>{p.current=m.scrollTop,n.current!=null&&(A.current={...n.current})}),()=>{p.current=null,A.current=null,m.removeEventListener("wheel",H)}},[o,l,i.floating,n,h,u]);let M=r1.useMemo(()=>({onKeyDown(){s.current=!0},onWheel(){s.current=!1},onPointerMove(){s.current=!1},onScroll(){let H=h?.current||i.floating;if(!(!n.current||!H||!s.current)){if(p.current!==null){let m=H.scrollTop-p.current;(n.current.bottom<-.5&&m<-1||n.current.top<-.5&&m>1)&&A5.flushSync(()=>u(L=>L+m))}requestAnimationFrame(()=>{p.current=H.scrollTop})}}}),[i.floating,u,n,h]);return r1.useMemo(()=>o?{floating:M}:{},[o,M])}var Nl=E(k(),1),F1=E(k(),1);var b8=(0,F1.createContext)({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});b8.displayName="FloatingContext";var _l=(0,F1.createContext)(null);_l.displayName="PlacementContext";function Wa(t){return(0,F1.useMemo)(()=>t?typeof t=="string"?{to:t}:t:null,[t])}function ja(){return(0,F1.useContext)(b8).setReference}function Ud(){return(0,F1.useContext)(b8).getReferenceProps}function qa(){let{getFloatingProps:t,slot:r}=(0,F1.useContext)(b8);return(0,F1.useCallback)((...l)=>Object.assign({},t(...l),{"data-anchor":r.anchor}),[t,r])}function Ka(t=null){t===!1&&(t=null),typeof t=="string"&&(t={to:t});let r=(0,F1.useContext)(_l),l=(0,F1.useMemo)(()=>t,[JSON.stringify(t,(o,n)=>{var h;return(h=n?.outerHTML)!=null?h:n})]);a1(()=>{r?.(l??null)},[r,l]);let i=(0,F1.useContext)(b8);return(0,F1.useMemo)(()=>[i.setFloating,t?i.styles:{}],[i.setFloating,t,i.styles])}var Id=4;function Ya({children:t,enabled:r=!0}){let[l,i]=(0,F1.useState)(null),[o,n]=(0,F1.useState)(0),h=(0,F1.useRef)(null),[v,u]=(0,F1.useState)(null);sM(v);let s=r&&l!==null&&v!==null,{to:p="bottom",gap:A=0,offset:M=0,padding:H=0,inner:m}=pM(l,v),[L,w="center"]=p.split(" ");a1(()=>{s&&n(0)},[s]);let{refs:Z,floatingStyles:V,context:x}=Ed({open:s,placement:L==="selection"?w==="center"?"bottom":`bottom-${w}`:w==="center"?`${L}`:`${L}-${w}`,strategy:"absolute",transform:!1,middleware:[f5({mainAxis:L==="selection"?0:A,crossAxis:M}),Tl({padding:H}),L!=="selection"&&$l({padding:H}),L==="selection"&&m?_d({...m,padding:H,overflowRef:h,offset:o,minItemsVisible:Id,referenceOverflowThreshold:H,onFallbackChange(F){var U,q;if(!F)return;let G=x.elements.floating;if(!G)return;let I=parseFloat(getComputedStyle(G).scrollPaddingBottom)||0,J=Math.min(Id,G.childElementCount),A1=0,X=0;for(let l1 of(q=(U=x.elements.floating)==null?void 0:U.childNodes)!=null?q:[])if(j1(l1)){let T=l1.offsetTop,W=T+l1.clientHeight+I,D=G.scrollTop,R=D+G.clientHeight;if(T>=D&&W<=R)J--;else{X=Math.max(0,Math.min(W,R)-Math.max(T,D)),A1=l1.clientHeight;break}}J>=1&&n(l1=>{let T=A1*J-X+I;return l1>=T?l1:T})}}):null,Ol({padding:H,apply({availableWidth:F,availableHeight:U,elements:q}){Object.assign(q.floating.style,{overflow:"auto",maxWidth:`${F}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${U}px)`})}})].filter(Boolean),whileElementsMounted:Ia}),[z=L,B=w]=x.placement.split("-");L==="selection"&&(z="selection");let P=(0,F1.useMemo)(()=>({anchor:[z,B].filter(Boolean).join(" ")}),[z,B]),$=Rd(x,{overflowRef:h,onChange:n}),{getReferenceProps:S,getFloatingProps:O}=Nd([$]),y=_(F=>{u(F),Z.setFloating(F)});return Nl.createElement(_l.Provider,{value:i},Nl.createElement(b8.Provider,{value:{setFloating:y,setReference:Z.setReference,styles:V,getReferenceProps:S,getFloatingProps:O,slot:P}},t))}function sM(t){a1(()=>{if(!t)return;let r=new MutationObserver(()=>{let l=window.getComputedStyle(t).maxHeight,i=parseFloat(l);if(isNaN(i))return;let o=parseInt(l);isNaN(o)||i!==o&&(t.style.maxHeight=`${Math.ceil(i)}px`)});return r.observe(t,{attributes:!0,attributeFilter:["style"]}),()=>{r.disconnect()}},[t])}function pM(t,r){var l,i,o;let n=El((l=t?.gap)!=null?l:"var(--anchor-gap, 0)",r),h=El((i=t?.offset)!=null?i:"var(--anchor-offset, 0)",r),v=El((o=t?.padding)!=null?o:"var(--anchor-padding, 0)",r);return{...t,gap:n,offset:h,padding:v}}function El(t,r,l=void 0){let i=W1(),o=_((u,s)=>{if(u==null)return[l,null];if(typeof u=="number")return[u,null];if(typeof u=="string"){if(!s)return[l,null];let p=kd(u,s);return[p,A=>{let M=Gd(u);{let H=M.map(m=>window.getComputedStyle(s).getPropertyValue(m));i.requestAnimationFrame(function m(){i.nextFrame(m);let L=!1;for(let[Z,V]of M.entries()){let x=window.getComputedStyle(s).getPropertyValue(V);if(H[Z]!==x){H[Z]=x,L=!0;break}}if(!L)return;let w=kd(u,s);p!==w&&(A(w),p=w)})}return i.dispose}]}return[l,null]}),n=(0,F1.useMemo)(()=>o(t,r)[0],[t,r]),[h=n,v]=(0,F1.useState)();return a1(()=>{let[u,s]=o(t,r);if(v(u),!!s)return s(v)},[t,r]),h}function Gd(t){let r=/var\((.*)\)/.exec(t);if(r){let l=r[1].indexOf(",");if(l===-1)return[r[1]];let i=r[1].slice(0,l).trim(),o=r[1].slice(l+1).trim();return o?[i,...Gd(o)]:[i]}return[]}function kd(t,r){let l=document.createElement("div");r.appendChild(l),l.style.setProperty("margin-top","0px","important"),l.style.setProperty("margin-top",t,"important");let i=parseFloat(window.getComputedStyle(l).marginTop)||0;return r.removeChild(l),i}var U2=E(k(),1);function HM({children:t,freeze:r},l){let i=T8(r,t);return(0,U2.isValidElement)(i)?(0,U2.cloneElement)(i,{ref:l}):U2.default.createElement(U2.default.Fragment,null,i)}var Wd=U2.default.forwardRef(HM);function T8(t,r){let[l,i]=(0,U2.useState)(r);return!t&&l!==r&&i(r),t?l:r}var P6=E(k(),1),Xa=(0,P6.createContext)(null);Xa.displayName="OpenClosedContext";var _1=(t=>(t[t.Open=1]="Open",t[t.Closed=2]="Closed",t[t.Closing=4]="Closing",t[t.Opening=8]="Opening",t))(_1||{});function G2(){return(0,P6.useContext)(Xa)}function $8({value:t,children:r}){return P6.default.createElement(Xa.Provider,{value:t},r)}function jd({children:t}){return P6.default.createElement(Xa.Provider,{value:null},t)}function qd(t){function r(){document.readyState!=="loading"&&(t(),document.removeEventListener("DOMContentLoaded",r))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",r),r())}var i2=[];qd(()=>{function t(r){if(!S0(r.target)||r.target===document.body||i2[0]===r.target)return;let l=r.target;l=l.closest(n5),i2.unshift(l??r.target),i2=i2.filter(i=>i!=null&&i.isConnected),i2.splice(10)}window.addEventListener("click",t,{capture:!0}),window.addEventListener("mousedown",t,{capture:!0}),window.addEventListener("focus",t,{capture:!0}),document.body.addEventListener("click",t,{capture:!0}),document.body.addEventListener("mousedown",t,{capture:!0}),document.body.addEventListener("focus",t,{capture:!0})});function MM(t){throw new Error("Unexpected object: "+t)}var i1=(t=>(t[t.First=0]="First",t[t.Previous=1]="Previous",t[t.Next=2]="Next",t[t.Last=3]="Last",t[t.Specific=4]="Specific",t[t.Nothing=5]="Nothing",t))(i1||{});function Q4(t,r){let l=r.resolveItems();if(l.length<=0)return null;let i=r.resolveActiveIndex(),o=i??-1;switch(t.focus){case 0:{for(let n=0;n<l.length;++n)if(!r.resolveDisabled(l[n],n,l))return n;return i}case 1:{o===-1&&(o=l.length);for(let n=o-1;n>=0;--n)if(!r.resolveDisabled(l[n],n,l))return n;return i}case 2:{for(let n=o+1;n<l.length;++n)if(!r.resolveDisabled(l[n],n,l))return n;return i}case 3:{for(let n=l.length-1;n>=0;--n)if(!r.resolveDisabled(l[n],n,l))return n;return i}case 4:{for(let n=0;n<l.length;++n)if(r.resolveId(l[n],n,l)===t.id)return n;return i}case 5:return null;default:MM(t)}}var S1=E(k(),1),Xd=E(T2(),1);var Qa=E(k(),1);function J4(t){let r=_(t),l=(0,Qa.useRef)(!1);(0,Qa.useEffect)(()=>(l.current=!1,()=>{l.current=!0,V6(()=>{l.current&&r()})}),[r])}var S6=E(k(),1);function fM(){let t=typeof document>"u";return"useSyncExternalStore"in S6?(r=>r.useSyncExternalStore)(S6)(()=>()=>{},()=>!1,()=>!t):!1}function g4(){let t=fM(),[r,l]=S6.useState(x0.isHandoffComplete);return r&&x0.isHandoffComplete===!1&&l(!1),S6.useEffect(()=>{r!==!0&&l(!0)},[r]),S6.useEffect(()=>x0.handoff(),[]),t?!1:r}var O8=E(k(),1),Kd=(0,O8.createContext)(!1);function Yd(){return(0,O8.useContext)(Kd)}function Rl(t){return O8.default.createElement(Kd.Provider,{value:t.force},t.children)}function AM(t){let r=Yd(),l=(0,S1.useContext)(Jd),[i,o]=(0,S1.useState)(()=>{var n;if(!r&&l!==null)return(n=l.current)!=null?n:null;if(x0.isServer)return null;let h=t?.getElementById("headlessui-portal-root");if(h)return h;if(t===null)return null;let v=t.createElement("div");return v.setAttribute("id","headlessui-portal-root"),t.body.appendChild(v)});return(0,S1.useEffect)(()=>{i!==null&&(t!=null&&t.body.contains(i)||t==null||t.body.appendChild(i))},[i,t]),(0,S1.useEffect)(()=>{r||l!==null&&o(l.current)},[l,o,r]),i}var Qd=S1.Fragment,VM=d1(function(t,r){let{ownerDocument:l=null,...i}=t,o=(0,S1.useRef)(null),n=z1(Uc(H=>{o.current=H}),r),h=e2(o.current),v=l??h,u=AM(v),s=(0,S1.useContext)(Il),p=W1(),A=g4(),M=M1();return J4(()=>{var H;u&&u.childNodes.length<=0&&((H=u.parentElement)==null||H.removeChild(u))}),!u||!A?null:(0,Xd.createPortal)(S1.default.createElement("div",{"data-headlessui-portal":"",ref:H=>{p.dispose(),s&&H&&p.add(s.register(H))}},M({ourProps:{ref:n},theirProps:i,slot:{},defaultTag:Qd,name:"Portal"})),u)});function mM(t,r){let l=z1(r),{enabled:i=!0,ownerDocument:o,...n}=t,h=M1();return i?S1.default.createElement(VM,{...n,ownerDocument:o,ref:l}):h({ourProps:{ref:l},theirProps:n,slot:{},defaultTag:Qd,name:"Portal"})}var ZM=S1.Fragment,Jd=(0,S1.createContext)(null);function xM(t,r){let{target:l,...i}=t,o={ref:z1(r)},n=M1();return S1.default.createElement(Jd.Provider,{value:l},n({ourProps:o,theirProps:i,defaultTag:ZM,name:"Popover.Group"}))}var Il=(0,S1.createContext)(null);function tv(){let t=(0,S1.useContext)(Il),r=(0,S1.useRef)([]),l=_(n=>(r.current.push(n),t&&t.register(n),()=>i(n))),i=_(n=>{let h=r.current.indexOf(n);h!==-1&&r.current.splice(h,1),t&&t.unregister(n)}),o=(0,S1.useMemo)(()=>({register:l,unregister:i,portals:r}),[l,i,r]);return[r,(0,S1.useMemo)(()=>function({children:n}){return S1.default.createElement(Il.Provider,{value:o},n)},[o])]}var LM=d1(mM),kl=d1(xM),F8=Object.assign(LM,{Group:kl});var z2={Idle:{kind:"Idle"},Tracked:t=>({kind:"Tracked",position:t}),Moved:{kind:"Moved"}};function m5(t){let r=t.getBoundingClientRect();return`${r.x},${r.y}`}function Ja(t,r,l){let i=T1();if(r.kind==="Tracked"){let n=function(){h!==m5(t)&&(i.dispose(),l())};var o=n;let{position:h}=r,v=new ResizeObserver(n);v.observe(t),i.add(()=>v.disconnect()),i.addEventListener(window,"scroll",n,{passive:!0}),i.addEventListener(window,"resize",n)}return()=>i.dispose()}var zM=Object.defineProperty,CM=(t,r,l)=>r in t?zM(t,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[r]=l,av=(t,r,l)=>(CM(t,typeof r!="symbol"?r+"":r,l),l),v1=(t=>(t[t.Open=0]="Open",t[t.Closed=1]="Closed",t))(v1||{}),b0=(t=>(t[t.Single=0]="Single",t[t.Multi=1]="Multi",t))(b0||{}),C2=(t=>(t[t.Pointer=0]="Pointer",t[t.Focus=1]="Focus",t[t.Other=2]="Other",t))(C2||{}),Gl=(t=>(t[t.OpenCombobox=0]="OpenCombobox",t[t.CloseCombobox=1]="CloseCombobox",t[t.GoToOption=2]="GoToOption",t[t.SetTyping=3]="SetTyping",t[t.RegisterOption=4]="RegisterOption",t[t.UnregisterOption=5]="UnregisterOption",t[t.DefaultToFirstOption=6]="DefaultToFirstOption",t[t.SetActivationTrigger=7]="SetActivationTrigger",t[t.UpdateVirtualConfiguration=8]="UpdateVirtualConfiguration",t[t.SetInputElement=9]="SetInputElement",t[t.SetButtonElement=10]="SetButtonElement",t[t.SetOptionsElement=11]="SetOptionsElement",t[t.MarkInputAsMoved=12]="MarkInputAsMoved",t))(Gl||{});function Ul(t,r=l=>l){let l=t.activeOptionIndex!==null?t.options[t.activeOptionIndex]:null,i=r(t.options.slice()),o=i.length>0&&i[0].dataRef.current.order!==null?i.sort((h,v)=>h.dataRef.current.order-v.dataRef.current.order):h5(i,h=>h.dataRef.current.domRef.current),n=l?o.indexOf(l):null;return n===-1&&(n=null),{options:o,activeOptionIndex:n}}var wM={1(t){var r;if((r=t.dataRef.current)!=null&&r.disabled||t.comboboxState===1)return t;let l=t.inputElement?z2.Tracked(m5(t.inputElement)):t.inputPositionState;return{...t,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,inputPositionState:l,__demoMode:!1}},0(t){var r,l;if((r=t.dataRef.current)!=null&&r.disabled||t.comboboxState===0)return t;if((l=t.dataRef.current)!=null&&l.value){let i=t.dataRef.current.calculateIndex(t.dataRef.current.value);if(i!==-1)return{...t,activeOptionIndex:i,comboboxState:0,__demoMode:!1,inputPositionState:z2.Idle}}return{...t,comboboxState:0,inputPositionState:z2.Idle,__demoMode:!1}},3(t,r){return t.isTyping===r.isTyping?t:{...t,isTyping:r.isTyping}},2(t,r){var l,i,o,n;if((l=t.dataRef.current)!=null&&l.disabled||t.optionsElement&&!((i=t.dataRef.current)!=null&&i.optionsPropsRef.current.static)&&t.comboboxState===1)return t;if(t.virtual){let{options:s,disabled:p}=t.virtual,A=r.focus===i1.Specific?r.idx:Q4(r,{resolveItems:()=>s,resolveActiveIndex:()=>{var H,m;return(m=(H=t.activeOptionIndex)!=null?H:s.findIndex(L=>!p(L)))!=null?m:null},resolveDisabled:p,resolveId(){throw new Error("Function not implemented.")}}),M=(o=r.trigger)!=null?o:2;return t.activeOptionIndex===A&&t.activationTrigger===M?t:{...t,activeOptionIndex:A,activationTrigger:M,isTyping:!1,__demoMode:!1}}let h=Ul(t);if(h.activeOptionIndex===null){let s=h.options.findIndex(p=>!p.dataRef.current.disabled);s!==-1&&(h.activeOptionIndex=s)}let v=r.focus===i1.Specific?r.idx:Q4(r,{resolveItems:()=>h.options,resolveActiveIndex:()=>h.activeOptionIndex,resolveId:s=>s.id,resolveDisabled:s=>s.dataRef.current.disabled}),u=(n=r.trigger)!=null?n:2;return t.activeOptionIndex===v&&t.activationTrigger===u?t:{...t,...h,isTyping:!1,activeOptionIndex:v,activationTrigger:u,__demoMode:!1}},4:(t,r)=>{var l,i,o,n;if((l=t.dataRef.current)!=null&&l.virtual)return{...t,options:[...t.options,r.payload]};let h=r.payload,v=Ul(t,s=>(s.push(h),s));t.activeOptionIndex===null&&(o=(i=t.dataRef.current).isSelected)!=null&&o.call(i,r.payload.dataRef.current.value)&&(v.activeOptionIndex=v.options.indexOf(h));let u={...t,...v,activationTrigger:2};return(n=t.dataRef.current)!=null&&n.__demoMode&&t.dataRef.current.value===void 0&&(u.activeOptionIndex=0),u},5:(t,r)=>{var l;if((l=t.dataRef.current)!=null&&l.virtual)return{...t,options:t.options.filter(o=>o.id!==r.id)};let i=Ul(t,o=>{let n=o.findIndex(h=>h.id===r.id);return n!==-1&&o.splice(n,1),o});return{...t,...i,activationTrigger:2}},6:(t,r)=>t.defaultToFirstOption===r.value?t:{...t,defaultToFirstOption:r.value},7:(t,r)=>t.activationTrigger===r.trigger?t:{...t,activationTrigger:r.trigger},8:(t,r)=>{var l,i;if(t.virtual===null)return{...t,virtual:{options:r.options,disabled:(l=r.disabled)!=null?l:()=>!1}};if(t.virtual.options===r.options&&t.virtual.disabled===r.disabled)return t;let o=t.activeOptionIndex;if(t.activeOptionIndex!==null){let n=r.options.indexOf(t.virtual.options[t.activeOptionIndex]);n!==-1?o=n:o=null}return{...t,activeOptionIndex:o,virtual:{options:r.options,disabled:(i=r.disabled)!=null?i:()=>!1}}},9:(t,r)=>t.inputElement===r.element?t:{...t,inputElement:r.element},10:(t,r)=>t.buttonElement===r.element?t:{...t,buttonElement:r.element},11:(t,r)=>t.optionsElement===r.element?t:{...t,optionsElement:r.element},12(t){return t.inputPositionState.kind!=="Tracked"?t:{...t,inputPositionState:z2.Moved}}},t7=class t extends G4{constructor(r){super(r),av(this,"actions",{onChange:l=>{let{onChange:i,compare:o,mode:n,value:h}=this.state.dataRef.current;return x1(n,{0:()=>i?.(l),1:()=>{let v=h.slice(),u=v.findIndex(s=>o(s,l));return u===-1?v.push(l):v.splice(u,1),i?.(v)}})},registerOption:(l,i)=>(this.send({type:4,payload:{id:l,dataRef:i}}),()=>{this.state.activeOptionIndex===this.state.dataRef.current.calculateIndex(i.current.value)&&this.send({type:6,value:!0}),this.send({type:5,id:l})}),goToOption:(l,i)=>(this.send({type:6,value:!1}),this.send({type:2,...l,trigger:i})),setIsTyping:l=>{this.send({type:3,isTyping:l})},closeCombobox:()=>{var l,i;this.send({type:1}),this.send({type:6,value:!1}),(i=(l=this.state.dataRef.current).onClose)==null||i.call(l)},openCombobox:()=>{this.send({type:0}),this.send({type:6,value:!0})},setActivationTrigger:l=>{this.send({type:7,trigger:l})},selectActiveOption:()=>{let l=this.selectors.activeOptionIndex(this.state);if(l!==null){if(this.actions.setIsTyping(!1),this.state.virtual)this.actions.onChange(this.state.virtual.options[l]);else{let{dataRef:i}=this.state.options[l];this.actions.onChange(i.current.value)}this.actions.goToOption({focus:i1.Specific,idx:l})}},setInputElement:l=>{this.send({type:9,element:l})},setButtonElement:l=>{this.send({type:10,element:l})},setOptionsElement:l=>{this.send({type:11,element:l})}}),av(this,"selectors",{activeDescendantId:l=>{var i,o;let n=this.selectors.activeOptionIndex(l);if(n!==null)return l.virtual?(o=l.options.find(h=>!h.dataRef.current.disabled&&l.dataRef.current.compare(h.dataRef.current.value,l.virtual.options[n])))==null?void 0:o.id:(i=l.options[n])==null?void 0:i.id},activeOptionIndex:l=>{if(l.defaultToFirstOption&&l.activeOptionIndex===null&&(l.virtual?l.virtual.options.length>0:l.options.length>0)){if(l.virtual){let{options:o,disabled:n}=l.virtual,h=o.findIndex(v=>{var u;return!((u=n?.(v))!=null&&u)});if(h!==-1)return h}let i=l.options.findIndex(o=>!o.dataRef.current.disabled);if(i!==-1)return i}return l.activeOptionIndex},activeOption:l=>{var i,o;let n=this.selectors.activeOptionIndex(l);return n===null?null:l.virtual?l.virtual.options[n??0]:(o=(i=l.options[n])==null?void 0:i.dataRef.current.value)!=null?o:null},isActive:(l,i,o)=>{var n;let h=this.selectors.activeOptionIndex(l);return h===null?!1:l.virtual?h===l.dataRef.current.calculateIndex(i):((n=l.options[h])==null?void 0:n.id)===o},shouldScrollIntoView:(l,i,o)=>!(l.virtual||l.__demoMode||l.comboboxState!==0||l.activationTrigger===0||!this.selectors.isActive(l,i,o)),didInputMove(l){return l.inputPositionState.kind==="Moved"}});{let l=this.state.id,i=l2.get(null);this.disposables.add(i.on(e5.Push,o=>{!i.selectors.isTop(o,l)&&this.state.comboboxState===0&&this.actions.closeCombobox()})),this.on(0,()=>i.actions.push(l)),this.on(1,()=>i.actions.pop(l))}this.disposables.group(l=>{this.on(1,i=>{i.inputElement&&(l.dispose(),l.add(Ja(i.inputElement,i.inputPositionState,()=>{this.send({type:12})})))})})}static new({id:r,virtual:l=null,__demoMode:i=!1}){var o;return new t({id:r,dataRef:{current:{}},comboboxState:i?0:1,isTyping:!1,options:[],virtual:l?{options:l.options,disabled:(o=l.disabled)!=null?o:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:i,inputPositionState:z2.Idle})}reduce(r,l){return x1(l.type,wM,r,l)}};var D8=E(k(),1);var Wl=(0,D8.createContext)(null);function E8(t){let r=(0,D8.useContext)(Wl);if(r===null){let l=new Error(`<${t} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(l,jl),l}return r}function jl({id:t,virtual:r=null,__demoMode:l=!1}){let i=(0,D8.useMemo)(()=>t7.new({id:t,virtual:r,__demoMode:l}),[]);return J4(()=>i.dispose()),i}var Z5=(0,t1.createContext)(null);Z5.displayName="ComboboxDataContext";function N8(t){let r=(0,t1.useContext)(Z5);if(r===null){let l=new Error(`<${t} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(l,N8),l}return r}var rv=(0,t1.createContext)(null);function BM(t){let r=E8("VirtualProvider"),l=N8("VirtualProvider"),{options:i}=l.virtual,o=f1(r,H=>H.optionsElement),[n,h]=(0,t1.useMemo)(()=>{let H=o;if(!H)return[0,0];let m=window.getComputedStyle(H);return[parseFloat(m.paddingBlockStart||m.paddingTop),parseFloat(m.paddingBlockEnd||m.paddingBottom)]},[o]),v=ch({enabled:i.length!==0,scrollPaddingStart:n,scrollPaddingEnd:h,count:i.length,estimateSize(){return 40},getScrollElement(){return r.state.optionsElement},overscan:12}),[u,s]=(0,t1.useState)(0);a1(()=>{s(H=>H+1)},[i]);let p=v.getVirtualItems(),A=f1(r,H=>H.activationTrigger===C2.Pointer),M=f1(r,r.selectors.activeOptionIndex);return p.length===0?null:t1.default.createElement(rv.Provider,{value:v},t1.default.createElement("div",{style:{position:"relative",width:"100%",height:`${v.getTotalSize()}px`},ref:H=>{H&&(A||M!==null&&i.length>M&&v.scrollToIndex(M))}},p.map(H=>{var m;return t1.default.createElement(t1.Fragment,{key:H.key},t1.default.cloneElement((m=t.children)==null?void 0:m.call(t,{...t.slot,option:i[H.index]}),{key:`${u}-${H.key}`,"data-index":H.index,"aria-setsize":i.length,"aria-posinset":H.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${H.start}px)`,overflowAnchor:"none"}}))})))}var PM=t1.Fragment;function SM(t,r){let l=(0,O1.useId)(),i=Q0(),{value:o,defaultValue:n,onChange:h,form:v,name:u,by:s,invalid:p=!1,disabled:A=i||!1,onClose:M,__demoMode:H=!1,multiple:m=!1,immediate:L=!1,virtual:w=null,nullable:Z,...V}=t,x=M8(n),[z=m?[]:void 0,B]=H8(o,h,x),P=jl({id:l,virtual:w,__demoMode:H}),$=(0,t1.useRef)({static:!1,hold:!1}),S=za(s),O=_(Q=>w?s===null?w.options.indexOf(Q):w.options.findIndex(r0=>S(r0,Q)):P.state.options.findIndex(r0=>S(r0.dataRef.current.value,Q))),y=(0,t1.useCallback)(Q=>x1(q.mode,{[b0.Multi]:()=>z.some(r0=>S(r0,Q)),[b0.Single]:()=>S(z,Q)}),[z]),F=f1(P,Q=>Q.virtual),U=_(()=>M?.()),q=(0,t1.useMemo)(()=>({__demoMode:H,immediate:L,optionsPropsRef:$,value:z,defaultValue:x,disabled:A,invalid:p,mode:m?b0.Multi:b0.Single,virtual:w?F:null,onChange:B,isSelected:y,calculateIndex:O,compare:S,onClose:U}),[H,L,$,z,x,A,p,m,w,F,B,y,O,S,U]);a1(()=>{var Q;w&&P.send({type:Gl.UpdateVirtualConfiguration,options:w.options,disabled:(Q=w.disabled)!=null?Q:null})},[w,w?.options,w?.disabled]),a1(()=>{P.state.dataRef.current=q},[q]);let[G,I,J,A1]=f1(P,Q=>[Q.comboboxState,Q.buttonElement,Q.inputElement,Q.optionsElement]),X=l2.get(null),l1=f1(X,(0,t1.useCallback)(Q=>X.selectors.isTop(Q,l),[X,l]));Z8(l1,[I,J,A1],()=>P.actions.closeCombobox());let T=f1(P,P.selectors.activeOptionIndex),W=f1(P,P.selectors.activeOption),D=P1({open:G===v1.Open,disabled:A,invalid:p,activeIndex:T,activeOption:W,value:z}),[R,c1]=Za(),Z1=r===null?{}:{ref:r},j=(0,t1.useCallback)(()=>{if(x!==void 0)return B?.(x)},[B,x]),m1=M1();return t1.default.createElement(c1,{value:R,props:{htmlFor:J?.id},slot:{open:G===v1.Open,disabled:A}},t1.default.createElement(Ya,null,t1.default.createElement(Z5.Provider,{value:q},t1.default.createElement(Wl.Provider,{value:P},t1.default.createElement($8,{value:x1(G,{[v1.Open]:_1.Open,[v1.Closed]:_1.Closed})},u!=null&&t1.default.createElement(f8,{disabled:A,data:z!=null?{[u]:z}:{},form:v,onReset:j}),m1({ourProps:Z1,theirProps:V,slot:D,defaultTag:PM,name:"Combobox"}))))))}var yM="input";function bM(t,r){var l,i;let o=E8("Combobox.Input"),n=N8("Combobox.Input"),h=(0,O1.useId)(),v=E2(),{id:u=v||`headlessui-combobox-input-${h}`,onChange:s,displayValue:p,disabled:A=n.disabled||!1,autoFocus:M=!1,type:H="text",...m}=t,L=(0,t1.useRef)(null),w=z1(L,r,ja(),o.actions.setInputElement),[Z,V]=f1(o,D=>[D.comboboxState,D.isTyping]),x=W1(),z=_(()=>{o.actions.onChange(null),o.state.optionsElement&&(o.state.optionsElement.scrollTop=0),o.actions.goToOption({focus:i1.Nothing})}),B=(0,t1.useMemo)(()=>{var D;return typeof p=="function"&&n.value!==void 0?(D=p(n.value))!=null?D:"":typeof n.value=="string"?n.value:""},[n.value,p]);L6(([D,R],[c1,Z1])=>{if(o.state.isTyping)return;let j=L.current;j&&((Z1===v1.Open&&R===v1.Closed||D!==c1)&&(j.value=D),requestAnimationFrame(()=>{if(o.state.isTyping||!j||_4(j))return;let{selectionStart:m1,selectionEnd:Q}=j;Math.abs((Q??0)-(m1??0))===0&&m1===0&&j.setSelectionRange(j.value.length,j.value.length)}))},[B,Z,V]),L6(([D],[R])=>{if(D===v1.Open&&R===v1.Closed){if(o.state.isTyping)return;let c1=L.current;if(!c1)return;let Z1=c1.value,{selectionStart:j,selectionEnd:m1,selectionDirection:Q}=c1;c1.value="",c1.value=Z1,Q!==null?c1.setSelectionRange(j,m1,Q):c1.setSelectionRange(j,m1)}},[Z]);let P=(0,t1.useRef)(!1),$=_(()=>{P.current=!0}),S=_(()=>{x.nextFrame(()=>{P.current=!1})}),O=_(D=>{switch(o.actions.setIsTyping(!0),D.key){case h1.Enter:if(o.state.comboboxState!==v1.Open||P.current)return;if(D.preventDefault(),D.stopPropagation(),o.selectors.activeOptionIndex(o.state)===null){o.actions.closeCombobox();return}o.actions.selectActiveOption(),n.mode===b0.Single&&o.actions.closeCombobox();break;case h1.ArrowDown:return D.preventDefault(),D.stopPropagation(),x1(o.state.comboboxState,{[v1.Open]:()=>o.actions.goToOption({focus:i1.Next}),[v1.Closed]:()=>o.actions.openCombobox()});case h1.ArrowUp:return D.preventDefault(),D.stopPropagation(),x1(o.state.comboboxState,{[v1.Open]:()=>o.actions.goToOption({focus:i1.Previous}),[v1.Closed]:()=>{(0,y6.flushSync)(()=>o.actions.openCombobox()),n.value||o.actions.goToOption({focus:i1.Last})}});case h1.Home:if(o.state.comboboxState===v1.Closed||D.shiftKey)break;return D.preventDefault(),D.stopPropagation(),o.actions.goToOption({focus:i1.First});case h1.PageUp:return D.preventDefault(),D.stopPropagation(),o.actions.goToOption({focus:i1.First});case h1.End:if(o.state.comboboxState===v1.Closed||D.shiftKey)break;return D.preventDefault(),D.stopPropagation(),o.actions.goToOption({focus:i1.Last});case h1.PageDown:return D.preventDefault(),D.stopPropagation(),o.actions.goToOption({focus:i1.Last});case h1.Escape:return o.state.comboboxState!==v1.Open?void 0:(D.preventDefault(),o.state.optionsElement&&!n.optionsPropsRef.current.static&&D.stopPropagation(),n.mode===b0.Single&&n.value===null&&z(),o.actions.closeCombobox());case h1.Tab:if(o.actions.setIsTyping(!1),o.state.comboboxState!==v1.Open)return;n.mode===b0.Single&&o.state.activationTrigger!==C2.Focus&&o.actions.selectActiveOption(),o.actions.closeCombobox();break}}),y=_(D=>{s?.(D),n.mode===b0.Single&&D.target.value===""&&z(),o.actions.openCombobox()}),F=_(D=>{var R,c1,Z1;let j=(R=D.relatedTarget)!=null?R:i2.find(m1=>m1!==D.currentTarget);if(!((c1=o.state.optionsElement)!=null&&c1.contains(j))&&!((Z1=o.state.buttonElement)!=null&&Z1.contains(j))&&o.state.comboboxState===v1.Open)return D.preventDefault(),n.mode===b0.Single&&n.value===null&&z(),o.actions.closeCombobox()}),U=_(D=>{var R,c1,Z1;let j=(R=D.relatedTarget)!=null?R:i2.find(m1=>m1!==D.currentTarget);(c1=o.state.buttonElement)!=null&&c1.contains(j)||(Z1=o.state.optionsElement)!=null&&Z1.contains(j)||n.disabled||n.immediate&&o.state.comboboxState!==v1.Open&&x.microTask(()=>{(0,y6.flushSync)(()=>o.actions.openCombobox()),o.actions.setActivationTrigger(C2.Focus)})}),q=V2(),G=I4(),{isFocused:I,focusProps:J}=F2({autoFocus:M}),{isHovered:A1,hoverProps:X}=O2({isDisabled:A}),l1=f1(o,D=>D.optionsElement),T=P1({open:Z===v1.Open,disabled:A,invalid:n.invalid,hover:A1,focus:I,autofocus:M}),W=f2({ref:w,id:u,role:"combobox",type:H,"aria-controls":l1?.id,"aria-expanded":Z===v1.Open,"aria-activedescendant":f1(o,o.selectors.activeDescendantId),"aria-labelledby":q,"aria-describedby":G,"aria-autocomplete":"list",defaultValue:(i=(l=t.defaultValue)!=null?l:n.defaultValue!==void 0?p?.(n.defaultValue):null)!=null?i:n.defaultValue,disabled:A||void 0,autoFocus:M,onCompositionStart:$,onCompositionEnd:S,onKeyDown:O,onChange:y,onFocus:U,onBlur:F},J,X);return M1()({ourProps:W,theirProps:m,slot:T,defaultTag:yM,name:"Combobox.Input"})}var TM="button";function $M(t,r){let l=E8("Combobox.Button"),i=N8("Combobox.Button"),[o,n]=(0,t1.useState)(null),h=z1(r,n,l.actions.setButtonElement),v=(0,O1.useId)(),{id:u=`headlessui-combobox-button-${v}`,disabled:s=i.disabled||!1,autoFocus:p=!1,...A}=t,[M,H,m]=f1(l,U=>[U.comboboxState,U.inputElement,U.optionsElement]),L=Zl(H),w=M===v1.Open;Ta(w,{trigger:o,action:(0,t1.useCallback)(U=>{if(o!=null&&o.contains(U.target))return m2.Ignore;if(H!=null&&H.contains(U.target))return m2.Ignore;let q=U.target.closest('[role="option"]:not([data-disabled])');return j1(q)?m2.Select(q):m!=null&&m.contains(U.target)?m2.Ignore:m2.Close},[o,H,m]),close:l.actions.closeCombobox,select:l.actions.selectActiveOption});let Z=_(U=>{switch(U.key){case h1.Space:case h1.Enter:U.preventDefault(),U.stopPropagation(),l.state.comboboxState===v1.Closed&&(0,y6.flushSync)(()=>l.actions.openCombobox()),L();return;case h1.ArrowDown:U.preventDefault(),U.stopPropagation(),l.state.comboboxState===v1.Closed&&((0,y6.flushSync)(()=>l.actions.openCombobox()),l.state.dataRef.current.value||l.actions.goToOption({focus:i1.First})),L();return;case h1.ArrowUp:U.preventDefault(),U.stopPropagation(),l.state.comboboxState===v1.Closed&&((0,y6.flushSync)(()=>l.actions.openCombobox()),l.state.dataRef.current.value||l.actions.goToOption({focus:i1.Last})),L();return;case h1.Escape:if(l.state.comboboxState!==v1.Open)return;U.preventDefault(),l.state.optionsElement&&!i.optionsPropsRef.current.static&&U.stopPropagation(),(0,y6.flushSync)(()=>l.actions.closeCombobox()),L();return;default:return}}),V=Ca(()=>{l.state.comboboxState===v1.Open?l.actions.closeCombobox():l.actions.openCombobox(),L()}),x=V2([u]),{isFocusVisible:z,focusProps:B}=F2({autoFocus:p}),{isHovered:P,hoverProps:$}=O2({isDisabled:s}),{pressed:S,pressProps:O}=u8({disabled:s}),y=P1({open:M===v1.Open,active:S||M===v1.Open,disabled:s,invalid:i.invalid,value:i.value,hover:P,focus:z}),F=f2({ref:h,id:u,type:$a(t,o),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":m?.id,"aria-expanded":M===v1.Open,"aria-labelledby":x,disabled:s||void 0,autoFocus:p,onKeyDown:Z},V,B,$,O);return M1()({ourProps:F,theirProps:A,slot:y,defaultTag:TM,name:"Combobox.Button"})}var OM="div",FM=J0.RenderStrategy|J0.Static;function DM(t,r){var l,i,o;let n=(0,O1.useId)(),{id:h=`headlessui-combobox-options-${n}`,hold:v=!1,anchor:u,portal:s=!1,modal:p=!0,transition:A=!1,...M}=t,H=E8("Combobox.Options"),m=N8("Combobox.Options"),L=Wa(u);L&&(s=!0);let[w,Z]=Ka(L),[V,x]=(0,t1.useState)(null),z=qa(),B=z1(r,L?w:null,H.actions.setOptionsElement,x),[P,$,S,O,y]=f1(H,Y=>[Y.comboboxState,Y.inputElement,Y.buttonElement,Y.optionsElement,Y.activationTrigger]),F=e2($||S),U=e2(O),q=G2(),[G,I]=C8(A,V,q!==null?(q&_1.Open)===_1.Open:P===v1.Open);m8(G,$,H.actions.closeCombobox);let J=m.__demoMode?!1:p&&P===v1.Open;L8(J,U);let A1=m.__demoMode?!1:p&&P===v1.Open;V8(A1,{allowed:(0,t1.useCallback)(()=>[$,S,O],[$,S,O])});let X=f1(H,H.selectors.didInputMove)?!1:G;a1(()=>{var Y;m.optionsPropsRef.current.static=(Y=t.static)!=null?Y:!1},[m.optionsPropsRef,t.static]),a1(()=>{m.optionsPropsRef.current.hold=v},[m.optionsPropsRef,v]),qh(P===v1.Open,{container:O,accept(Y){return Y.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:Y.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(Y){Y.setAttribute("role","none")}});let l1=V2([S?.id]),T=P1({open:P===v1.Open,option:void 0}),W=_(()=>{H.actions.setActivationTrigger(C2.Pointer)}),D=_(Y=>{Y.preventDefault(),H.actions.setActivationTrigger(C2.Pointer)}),R=f2(L?z():{},{"aria-labelledby":l1,role:"listbox","aria-multiselectable":m.mode===b0.Multi?!0:void 0,id:h,ref:B,style:{...M.style,...Z,"--input-width":t5(G,$,!0).width,"--button-width":t5(G,S,!0).width},onWheel:y===C2.Pointer?void 0:W,onMouseDown:D,...z8(I)}),c1=G&&P===v1.Closed&&!t.static,Z1=T8(c1,(l=m.virtual)==null?void 0:l.options),j=T8(c1,m.value),m1=(0,t1.useCallback)(Y=>m.compare(j,Y),[m.compare,j]),Q=(0,t1.useMemo)(()=>{if(!m.virtual)return m;if(Z1===void 0)throw new Error("Missing `options` in virtual mode");return Z1!==m.virtual.options?{...m,virtual:{...m.virtual,options:Z1}}:m},[m,Z1,(i=m.virtual)==null?void 0:i.options]);m.virtual&&Object.assign(M,{children:t1.default.createElement(Z5.Provider,{value:Q},t1.default.createElement(BM,{slot:T},M.children))});let r0=M1(),m7=(0,t1.useMemo)(()=>m.mode===b0.Multi?m:{...m,isSelected:m1},[m,m1]);return t1.default.createElement(F8,{enabled:s?t.static||G:!1,ownerDocument:F},t1.default.createElement(Z5.Provider,{value:m7},r0({ourProps:R,theirProps:{...M,children:t1.default.createElement(Wd,{freeze:c1},typeof M.children=="function"?(o=M.children)==null?void 0:o.call(M,T):M.children)},slot:T,defaultTag:OM,features:FM,visible:X,name:"Combobox.Options"})))}var EM="div";function NM(t,r){var l,i,o;let n=N8("Combobox.Option"),h=E8("Combobox.Option"),v=(0,O1.useId)(),{id:u=`headlessui-combobox-option-${v}`,value:s,disabled:p=(o=(i=(l=n.virtual)==null?void 0:l.disabled)==null?void 0:i.call(l,s))!=null?o:!1,order:A=null,...M}=t,[H]=f1(h,I=>[I.inputElement]),m=Zl(H),L=f1(h,(0,t1.useCallback)(I=>h.selectors.isActive(I,s,u),[s,u])),w=n.isSelected(s),Z=(0,t1.useRef)(null),V=t0({disabled:p,value:s,domRef:Z,order:A}),x=(0,t1.useContext)(rv),z=z1(r,Z,x?x.measureElement:null),B=_(()=>{h.actions.setIsTyping(!1),h.actions.onChange(s)});a1(()=>h.actions.registerOption(u,V),[V,u]);let P=f1(h,(0,t1.useCallback)(I=>h.selectors.shouldScrollIntoView(I,s,u),[s,u]));a1(()=>{if(P)return T1().requestAnimationFrame(()=>{var I,J;(J=(I=Z.current)==null?void 0:I.scrollIntoView)==null||J.call(I,{block:"nearest"})})},[P,Z]);let $=_(I=>{I.preventDefault(),I.button===a5.Left&&(p||(B(),d5()||requestAnimationFrame(()=>m()),n.mode===b0.Single&&h.actions.closeCombobox()))}),S=_(()=>{if(p)return h.actions.goToOption({focus:i1.Nothing});let I=n.calculateIndex(s);h.actions.goToOption({focus:i1.Specific,idx:I})}),O=Oa(),y=_(I=>O.update(I)),F=_(I=>{if(!O.wasMoved(I)||p||L&&h.state.activationTrigger===C2.Pointer)return;let J=n.calculateIndex(s);h.actions.goToOption({focus:i1.Specific,idx:J},C2.Pointer)}),U=_(I=>{O.wasMoved(I)&&(p||L&&(n.optionsPropsRef.current.hold||h.state.activationTrigger===C2.Pointer&&h.actions.goToOption({focus:i1.Nothing})))}),q=P1({active:L,focus:L,selected:w,disabled:p}),G={id:u,ref:z,role:"option",tabIndex:p===!0?void 0:-1,"aria-disabled":p===!0?!0:void 0,"aria-selected":w,disabled:void 0,onMouseDown:$,onFocus:S,onPointerEnter:y,onMouseEnter:y,onPointerMove:F,onMouseMove:F,onPointerLeave:U,onMouseLeave:U};return M1()({ourProps:G,theirProps:M,slot:q,defaultTag:EM,name:"Combobox.Option"})}var _M=d1(SM),ql=d1($M),Kl=d1(bM),RM=xa,Yl=d1(DM),Xl=d1(NM),lv=Object.assign(_M,{Input:Kl,Button:ql,Label:RM,Options:Yl,Option:Xl});var g1=E(k(),1);function ev(t,r=typeof document<"u"?document.defaultView:null,l){let i=h4(t,"escape");x8(r,"keydown",o=>{i&&(o.defaultPrevented||o.key===h1.Escape&&l(o))})}var Ql=E(k(),1);function iv(){var t;let[r]=(0,Ql.useState)(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[l,i]=(0,Ql.useState)((t=r?.matches)!=null?t:!1);return a1(()=>{if(!r)return;function o(n){i(n.matches)}return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[r]),l}var u4=E(k(),1);function ov({defaultContainers:t=[],portals:r,mainTreeNode:l}={}){let i=_(()=>{var o,n;let h=R0(l),v=[];for(let u of t)u!==null&&(A2(u)?v.push(u):"current"in u&&A2(u.current)&&v.push(u.current));if(r!=null&&r.current)for(let u of r.current)v.push(u);for(let u of(o=h?.querySelectorAll("html > *, body > *"))!=null?o:[])u!==document.body&&u!==document.head&&A2(u)&&u.id!=="headlessui-portal-root"&&(l&&(u.contains(l)||u.contains((n=l?.getRootNode())==null?void 0:n.host))||v.some(s=>u.contains(s))||v.push(u));return v});return{resolveContainers:i,contains:_(o=>i().some(n=>n.contains(o)))}}var nv=(0,u4.createContext)(null);function Jl({children:t,node:r}){let[l,i]=(0,u4.useState)(null),o=te(r??l);return u4.default.createElement(nv.Provider,{value:o},t,o===null&&u4.default.createElement(R4,{features:c4.Hidden,ref:n=>{var h,v;if(n){for(let u of(v=(h=R0(n))==null?void 0:h.querySelectorAll("html > *, body > *"))!=null?v:[])if(u!==document.body&&u!==document.head&&A2(u)&&u!=null&&u.contains(n)){i(u);break}}}}))}function te(t=null){var r;return(r=(0,u4.useContext)(nv))!=null?r:t}var W2=E(k(),1);var cv=E(k(),1);function x5(){let t=(0,cv.useRef)(!1);return a1(()=>(t.current=!0,()=>{t.current=!1}),[]),t}var hv=E(k(),1);var _8=(t=>(t[t.Forwards=0]="Forwards",t[t.Backwards=1]="Backwards",t))(_8||{});function dv(){let t=(0,hv.useRef)(0);return ya(!0,"keydown",r=>{r.key==="Tab"&&(t.current=r.shiftKey?1:0)},!0),t}function vv(t){if(!t)return new Set;if(typeof t=="function")return new Set(t());let r=new Set;for(let l of t.current)A2(l.current)&&r.add(l.current);return r}var IM="div",t6=(t=>(t[t.None=0]="None",t[t.InitialFocus=1]="InitialFocus",t[t.TabLock=2]="TabLock",t[t.FocusLock=4]="FocusLock",t[t.RestoreFocus=8]="RestoreFocus",t[t.AutoFocus=16]="AutoFocus",t))(t6||{});function kM(t,r){let l=(0,W2.useRef)(null),i=z1(l,r),{initialFocus:o,initialFocusFallback:n,containers:h,features:v=15,...u}=t;g4()||(v=0);let s=e2(l.current);WM(v,{ownerDocument:s});let p=jM(v,{ownerDocument:s,container:l,initialFocus:o,initialFocusFallback:n});qM(v,{ownerDocument:s,container:l,containers:h,previousActiveElement:p});let A=dv(),M=_(V=>{if(!j1(l.current))return;let x=l.current;(z=>z())(()=>{x1(A.current,{[_8.Forwards]:()=>{x6(x,I0.First,{skipElements:[V.relatedTarget,n]})},[_8.Backwards]:()=>{x6(x,I0.Last,{skipElements:[V.relatedTarget,n]})}})})}),H=h4(!!(v&2),"focus-trap#tab-lock"),m=W1(),L=(0,W2.useRef)(!1),w={ref:i,onKeyDown(V){V.key=="Tab"&&(L.current=!0,m.requestAnimationFrame(()=>{L.current=!1}))},onBlur(V){if(!(v&4))return;let x=vv(h);j1(l.current)&&x.add(l.current);let z=V.relatedTarget;S0(z)&&z.dataset.headlessuiFocusGuard!=="true"&&(uv(x,z)||(L.current?x6(l.current,x1(A.current,{[_8.Forwards]:()=>I0.Next,[_8.Backwards]:()=>I0.Previous})|I0.WrapAround,{relativeTo:V.target}):S0(V.target)&&_2(V.target)))}},Z=M1();return W2.default.createElement(W2.default.Fragment,null,H&&W2.default.createElement(R4,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:M,features:c4.Focusable}),Z({ourProps:w,theirProps:u,defaultTag:IM,name:"FocusTrap"}),H&&W2.default.createElement(R4,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:M,features:c4.Focusable}))}var UM=d1(kM),gv=Object.assign(UM,{features:t6});function GM(t=!0){let r=(0,W2.useRef)(i2.slice());return L6(([l],[i])=>{i===!0&&l===!1&&V6(()=>{r.current.splice(0)}),i===!1&&l===!0&&(r.current=i2.slice())},[t,i2,r]),_(()=>{var l;return(l=r.current.find(i=>i!=null&&i.isConnected))!=null?l:null})}function WM(t,{ownerDocument:r}){let l=!!(t&8),i=GM(l);L6(()=>{l||_4(r?.body)&&_2(i())},[l]),J4(()=>{l&&_2(i())})}function jM(t,{ownerDocument:r,container:l,initialFocus:i,initialFocusFallback:o}){let n=(0,W2.useRef)(null),h=h4(!!(t&1),"focus-trap#initial-focus"),v=x5();return L6(()=>{if(t===0)return;if(!h){o!=null&&o.current&&_2(o.current);return}let u=l.current;u&&V6(()=>{if(!v.current)return;let s=r?.activeElement;if(i!=null&&i.current){if(i?.current===s){n.current=s;return}}else if(u.contains(s)){n.current=s;return}if(i!=null&&i.current)_2(i.current);else{if(t&16){if(x6(u,I0.First|I0.AutoFocus)!==Pa.Error)return}else if(x6(u,I0.First)!==Pa.Error)return;if(o!=null&&o.current&&(_2(o.current),r?.activeElement===o.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}n.current=r?.activeElement})},[o,h,t]),n}function qM(t,{ownerDocument:r,container:l,containers:i,previousActiveElement:o}){let n=x5(),h=!!(t&4);x8(r?.defaultView,"focus",v=>{if(!h||!n.current)return;let u=vv(i);j1(l.current)&&u.add(l.current);let s=o.current;if(!s)return;let p=v.target;j1(p)?uv(u,p)?(o.current=p,_2(p)):(v.preventDefault(),v.stopPropagation(),_2(s)):_2(o.current)},!0)}function uv(t,r){for(let l of t)if(l.contains(r))return!0;return!1}var n1=E(k(),1);function sv(t){var r;return!!(t.enter||t.enterFrom||t.enterTo||t.leave||t.leaveFrom||t.leaveTo)||!s8((r=t.as)!=null?r:Hv)||n1.default.Children.count(t.children)===1}var a7=(0,n1.createContext)(null);a7.displayName="TransitionContext";var KM=(t=>(t.Visible="visible",t.Hidden="hidden",t))(KM||{});function YM(){let t=(0,n1.useContext)(a7);if(t===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return t}function XM(){let t=(0,n1.useContext)(r7);if(t===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return t}var r7=(0,n1.createContext)(null);r7.displayName="NestingContext";function l7(t){return"children"in t?l7(t.children):t.current.filter(({el:r})=>r.current!==null).filter(({state:r})=>r==="visible").length>0}function pv(t,r){let l=t0(t),i=(0,n1.useRef)([]),o=x5(),n=W1(),h=_((H,m=n4.Hidden)=>{let L=i.current.findIndex(({el:w})=>w===H);L!==-1&&(x1(m,{[n4.Unmount](){i.current.splice(L,1)},[n4.Hidden](){i.current[L].state="hidden"}}),n.microTask(()=>{var w;!l7(i)&&o.current&&((w=l.current)==null||w.call(l))}))}),v=_(H=>{let m=i.current.find(({el:L})=>L===H);return m?m.state!=="visible"&&(m.state="visible"):i.current.push({el:H,state:"visible"}),()=>h(H,n4.Unmount)}),u=(0,n1.useRef)([]),s=(0,n1.useRef)(Promise.resolve()),p=(0,n1.useRef)({enter:[],leave:[]}),A=_((H,m,L)=>{u.current.splice(0),r&&(r.chains.current[m]=r.chains.current[m].filter(([w])=>w!==H)),r?.chains.current[m].push([H,new Promise(w=>{u.current.push(w)})]),r?.chains.current[m].push([H,new Promise(w=>{Promise.all(p.current[m].map(([Z,V])=>V)).then(()=>w())})]),m==="enter"?s.current=s.current.then(()=>r?.wait.current).then(()=>L(m)):L(m)}),M=_((H,m,L)=>{Promise.all(p.current[m].splice(0).map(([w,Z])=>Z)).then(()=>{var w;(w=u.current.shift())==null||w()}).then(()=>L(m))});return(0,n1.useMemo)(()=>({children:i,register:v,unregister:h,onStart:A,onStop:M,wait:s,chains:p}),[v,h,i,A,M,p,s])}var Hv=n1.Fragment,Mv=J0.RenderStrategy;function QM(t,r){var l,i;let{transition:o=!0,beforeEnter:n,afterEnter:h,beforeLeave:v,afterLeave:u,enter:s,enterFrom:p,enterTo:A,entered:M,leave:H,leaveFrom:m,leaveTo:L,...w}=t,[Z,V]=(0,n1.useState)(null),x=(0,n1.useRef)(null),z=sv(t),B=z1(...z?[x,r,V]:r===null?[]:[r]),P=(l=w.unmount)==null||l?n4.Unmount:n4.Hidden,{show:$,appear:S,initial:O}=YM(),[y,F]=(0,n1.useState)($?"visible":"hidden"),U=XM(),{register:q,unregister:G}=U;a1(()=>q(x),[q,x]),a1(()=>{if(P===n4.Hidden&&x.current){if($&&y!=="visible"){F("visible");return}return x1(y,{hidden:()=>G(x),visible:()=>q(x)})}},[y,x,q,G,$,P]);let I=g4();a1(()=>{if(z&&I&&y==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,y,I,z]);let J=O&&!S,A1=S&&$&&O,X=(0,n1.useRef)(!1),l1=pv(()=>{X.current||(F("hidden"),G(x))},U),T=_(m1=>{X.current=!0;let Q=m1?"enter":"leave";l1.onStart(x,Q,r0=>{r0==="enter"?n?.():r0==="leave"&&v?.()})}),W=_(m1=>{let Q=m1?"enter":"leave";X.current=!1,l1.onStop(x,Q,r0=>{r0==="enter"?h?.():r0==="leave"&&u?.()}),Q==="leave"&&!l7(l1)&&(F("hidden"),G(x))});(0,n1.useEffect)(()=>{z&&o||(T($),W($))},[$,z,o]);let D=!(!o||!z||!I||J),[,R]=C8(D,Z,$,{start:T,end:W}),c1=D2({ref:B,className:((i=Yt(w.className,A1&&s,A1&&p,R.enter&&s,R.enter&&R.closed&&p,R.enter&&!R.closed&&A,R.leave&&H,R.leave&&!R.closed&&m,R.leave&&R.closed&&L,!R.transition&&$&&M))==null?void 0:i.trim())||void 0,...z8(R)}),Z1=0;y==="visible"&&(Z1|=_1.Open),y==="hidden"&&(Z1|=_1.Closed),$&&y==="hidden"&&(Z1|=_1.Opening),!$&&y==="visible"&&(Z1|=_1.Closing);let j=M1();return n1.default.createElement(r7.Provider,{value:l1},n1.default.createElement($8,{value:Z1},j({ourProps:c1,theirProps:w,defaultTag:Hv,features:Mv,visible:y==="visible",name:"Transition.Child"})))}function JM(t,r){let{show:l,appear:i=!1,unmount:o=!0,...n}=t,h=(0,n1.useRef)(null),v=sv(t),u=z1(...v?[h,r]:r===null?[]:[r]);g4();let s=G2();if(l===void 0&&s!==null&&(l=(s&_1.Open)===_1.Open),l===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[p,A]=(0,n1.useState)(l?"visible":"hidden"),M=pv(()=>{l||A("hidden")}),[H,m]=(0,n1.useState)(!0),L=(0,n1.useRef)([l]);a1(()=>{H!==!1&&L.current[L.current.length-1]!==l&&(L.current.push(l),m(!1))},[L,l]);let w=(0,n1.useMemo)(()=>({show:l,appear:i,initial:H}),[l,i,H]);a1(()=>{l?A("visible"):!l7(M)&&h.current!==null&&A("hidden")},[l,M]);let Z={unmount:o},V=_(()=>{var B;H&&m(!1),(B=t.beforeEnter)==null||B.call(t)}),x=_(()=>{var B;H&&m(!1),(B=t.beforeLeave)==null||B.call(t)}),z=M1();return n1.default.createElement(r7.Provider,{value:M},n1.default.createElement(a7.Provider,{value:w},z({ourProps:{...Z,as:n1.Fragment,children:n1.default.createElement(fv,{ref:u,...Z,...n,beforeEnter:V,beforeLeave:x})},theirProps:{},defaultTag:n1.Fragment,features:Mv,visible:p==="visible",name:"Transition"})))}function tf(t,r){let l=(0,n1.useContext)(a7)!==null,i=G2()!==null;return n1.default.createElement(n1.default.Fragment,null,!l&&i?n1.default.createElement(ae,{ref:r,...t}):n1.default.createElement(fv,{ref:r,...t}))}var ae=d1(JM),fv=d1(QM),e7=d1(tf),Av=Object.assign(ae,{Child:e7,Root:ae});var af=(t=>(t[t.Open=0]="Open",t[t.Closed=1]="Closed",t))(af||{}),rf=(t=>(t[t.SetTitleId=0]="SetTitleId",t))(rf||{}),lf={0(t,r){return t.titleId===r.id?t:{...t,titleId:r.id}}},re=(0,g1.createContext)(null);re.displayName="DialogContext";function i7(t){let r=(0,g1.useContext)(re);if(r===null){let l=new Error(`<${t} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(l,i7),l}return r}function ef(t,r){return x1(r.type,lf,t,r)}var Vv=d1(function(t,r){let l=(0,O1.useId)(),{id:i=`headlessui-dialog-${l}`,open:o,onClose:n,initialFocus:h,role:v="dialog",autoFocus:u=!0,__demoMode:s=!1,unmount:p=!1,...A}=t,M=(0,g1.useRef)(!1);v=(function(){return v==="dialog"||v==="alertdialog"?v:(M.current||(M.current=!0,console.warn(`Invalid role [${v}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")})();let H=G2();o===void 0&&H!==null&&(o=(H&_1.Open)===_1.Open);let m=(0,g1.useRef)(null),L=z1(m,r),w=e2(m.current),Z=o?0:1,[V,x]=(0,g1.useReducer)(ef,{titleId:null,descriptionId:null,panelRef:(0,g1.createRef)()}),z=_(()=>n(!1)),B=_(R=>x({type:0,id:R})),P=g4()?Z===0:!1,[$,S]=tv(),O={get current(){var R;return(R=V.panelRef.current)!=null?R:m.current}},y=te(),{resolveContainers:F}=ov({mainTreeNode:y,portals:$,defaultContainers:[O]}),U=H!==null?(H&_1.Closing)===_1.Closing:!1;V8(s||U?!1:P,{allowed:_(()=>{var R,c1;return[(c1=(R=m.current)==null?void 0:R.closest("[data-headlessui-portal]"))!=null?c1:null]}),disallowed:_(()=>{var R;return[(R=y?.closest("body > *:not(#headlessui-portal-root)"))!=null?R:null]})});let q=l2.get(null);a1(()=>{if(P)return q.actions.push(i),()=>q.actions.pop(i)},[q,i,P]);let G=f1(q,(0,g1.useCallback)(R=>q.selectors.isTop(R,i),[q,i]));Z8(G,F,R=>{R.preventDefault(),z()}),ev(G,w?.defaultView,R=>{R.preventDefault(),R.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),z()}),L8(s||U?!1:P,w,F),m8(P,m,z);let[I,J]=Wc(),A1=(0,g1.useMemo)(()=>[{dialogState:Z,close:z,setTitleId:B,unmount:p},V],[Z,z,B,p,V]),X=P1({open:Z===0}),l1={ref:L,id:i,role:v,tabIndex:-1,"aria-modal":s?void 0:Z===0?!0:void 0,"aria-labelledby":V.titleId,"aria-describedby":I,unmount:p},T=!iv(),W=t6.None;P&&!s&&(W|=t6.RestoreFocus,W|=t6.TabLock,u&&(W|=t6.AutoFocus),T&&(W|=t6.InitialFocus));let D=M1();return g1.default.createElement(jd,null,g1.default.createElement(Rl,{force:!0},g1.default.createElement(F8,null,g1.default.createElement(re.Provider,{value:A1},g1.default.createElement(kl,{target:m},g1.default.createElement(Rl,{force:!1},g1.default.createElement(J,{slot:X},g1.default.createElement(S,null,g1.default.createElement(gv,{initialFocus:h,initialFocusFallback:m,containers:F,features:W},g1.default.createElement(Yc,{value:z},D({ourProps:l1,theirProps:A,slot:X,defaultTag:of,features:nf,visible:Z===0,name:"Dialog"})))))))))))}),of="div",nf=J0.RenderStrategy|J0.Static;function cf(t,r){let{transition:l=!1,open:i,...o}=t,n=G2(),h=t.hasOwnProperty("open")||n!==null,v=t.hasOwnProperty("onClose");if(!h&&!v)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!h)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!v)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!n&&typeof t.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${t.open}`);if(typeof t.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${t.onClose}`);return(i!==void 0||l)&&!o.static?g1.default.createElement(Jl,null,g1.default.createElement(Av,{show:i,transition:l,unmount:o.unmount},g1.default.createElement(Vv,{ref:r,...o}))):g1.default.createElement(Jl,null,g1.default.createElement(Vv,{ref:r,open:i,...o}))}var hf="div";function df(t,r){let l=(0,O1.useId)(),{id:i=`headlessui-dialog-panel-${l}`,transition:o=!1,...n}=t,[{dialogState:h,unmount:v},u]=i7("Dialog.Panel"),s=z1(r,u.panelRef),p=P1({open:h===0}),A=_(w=>{w.stopPropagation()}),M={ref:s,id:i,onClick:A},H=o?e7:g1.Fragment,m=o?{unmount:v}:{},L=M1();return g1.default.createElement(H,{...m},L({ourProps:M,theirProps:n,slot:p,defaultTag:hf,name:"Dialog.Panel"}))}var vf="div";function gf(t,r){let{transition:l=!1,...i}=t,[{dialogState:o,unmount:n}]=i7("Dialog.Backdrop"),h=P1({open:o===0}),v={ref:r,"aria-hidden":!0},u=l?e7:g1.Fragment,s=l?{unmount:n}:{},p=M1();return g1.default.createElement(u,{...s},p({ourProps:v,theirProps:i,slot:h,defaultTag:vf,name:"Dialog.Backdrop"}))}var uf="h2";function sf(t,r){let l=(0,O1.useId)(),{id:i=`headlessui-dialog-title-${l}`,...o}=t,[{dialogState:n,setTitleId:h}]=i7("Dialog.Title"),v=z1(r);(0,g1.useEffect)(()=>(h(i),()=>h(null)),[i,h]);let u=P1({open:n===0}),s={ref:v,id:i};return M1()({ourProps:s,theirProps:o,slot:u,defaultTag:uf,name:"Dialog.Title"})}var pf=d1(cf),L5=d1(df),eB=d1(gf),z5=d1(sf);var o7=Object.assign(pf,{Panel:L5,Title:z5,Description:jc});var Hf="input";function Mf(t,r){let l=(0,O1.useId)(),i=E2(),o=Q0(),{id:n=i||`headlessui-input-${l}`,disabled:h=o||!1,autoFocus:v=!1,invalid:u=!1,...s}=t,p=V2(),A=I4(),{isFocused:M,focusProps:H}=F2({autoFocus:v}),{isHovered:m,hoverProps:L}=O2({isDisabled:h}),w=f2({ref:r,id:n,"aria-labelledby":p,"aria-describedby":A,"aria-invalid":u?"true":void 0,disabled:h||void 0,autoFocus:v},H,L),Z=P1({disabled:h,invalid:u,hover:m,focus:M,autofocus:v});return M1()({ourProps:w,theirProps:s,slot:Z,defaultTag:Hf,name:"Input"})}var le=d1(Mf);var u1=E(k(),1),h7=E(T2(),1);var ee=E(k(),1);var mv=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Zv(t){var r,l;let i=(r=t.innerText)!=null?r:"",o=t.cloneNode(!0);if(!j1(o))return i;let n=!1;for(let v of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))v.remove(),n=!0;let h=n?(l=o.innerText)!=null?l:"":i;return mv.test(h)&&(h=h.replace(mv,"")),h}function xv(t){let r=t.getAttribute("aria-label");if(typeof r=="string")return r.trim();let l=t.getAttribute("aria-labelledby");if(l){let i=l.split(" ").map(o=>{let n=document.getElementById(o);if(n){let h=n.getAttribute("aria-label");return typeof h=="string"?h.trim():Zv(n).trim()}return null}).filter(Boolean);if(i.length>0)return i.join(", ")}return Zv(t).trim()}function Lv(t){let r=(0,ee.useRef)(""),l=(0,ee.useRef)("");return _(()=>{let i=t.current;if(!i)return"";let o=i.innerText;if(r.current===o)return l.current;let n=xv(i).trim().toLowerCase();return r.current=o,l.current=n,n})}var ff=Object.defineProperty,Af=(t,r,l)=>r in t?ff(t,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[r]=l,zv=(t,r,l)=>(Af(t,typeof r!="symbol"?r+"":r,l),l),d0=(t=>(t[t.Open=0]="Open",t[t.Closed=1]="Closed",t))(d0||{}),s4=(t=>(t[t.Single=0]="Single",t[t.Multi=1]="Multi",t))(s4||{}),C5=(t=>(t[t.Pointer=0]="Pointer",t[t.Other=1]="Other",t))(C5||{}),ie=(t=>(t[t.OpenListbox=0]="OpenListbox",t[t.CloseListbox=1]="CloseListbox",t[t.GoToOption=2]="GoToOption",t[t.Search=3]="Search",t[t.ClearSearch=4]="ClearSearch",t[t.SelectOption=5]="SelectOption",t[t.RegisterOptions=6]="RegisterOptions",t[t.UnregisterOptions=7]="UnregisterOptions",t[t.SetButtonElement=8]="SetButtonElement",t[t.SetOptionsElement=9]="SetOptionsElement",t[t.SortOptions=10]="SortOptions",t[t.MarkButtonAsMoved=11]="MarkButtonAsMoved",t))(ie||{});function Cv(t,r=l=>l){let l=t.activeOptionIndex!==null?t.options[t.activeOptionIndex]:null,i=h5(r(t.options.slice()),n=>n.dataRef.current.domRef.current),o=l?i.indexOf(l):null;return o===-1&&(o=null),{options:i,activeOptionIndex:o}}var Vf={1(t){if(t.dataRef.current.disabled||t.listboxState===1)return t;let r=t.buttonElement?z2.Tracked(m5(t.buttonElement)):t.buttonPositionState;return{...t,activeOptionIndex:null,pendingFocus:{focus:i1.Nothing},listboxState:1,__demoMode:!1,buttonPositionState:r}},0(t,r){if(t.dataRef.current.disabled||t.listboxState===0)return t;let l=t.activeOptionIndex,{isSelected:i}=t.dataRef.current,o=t.options.findIndex(n=>i(n.dataRef.current.value));return o!==-1&&(l=o),{...t,frozenValue:!1,pendingFocus:r.focus,listboxState:0,activeOptionIndex:l,__demoMode:!1,buttonPositionState:z2.Idle}},2(t,r){var l,i,o,n,h;if(t.dataRef.current.disabled||t.listboxState===1)return t;let v={...t,searchQuery:"",activationTrigger:(l=r.trigger)!=null?l:1,__demoMode:!1};if(r.focus===i1.Nothing)return{...v,activeOptionIndex:null};if(r.focus===i1.Specific)return{...v,activeOptionIndex:t.options.findIndex(p=>p.id===r.id)};if(r.focus===i1.Previous){let p=t.activeOptionIndex;if(p!==null){let A=t.options[p].dataRef.current.domRef,M=Q4(r,{resolveItems:()=>t.options,resolveActiveIndex:()=>t.activeOptionIndex,resolveId:H=>H.id,resolveDisabled:H=>H.dataRef.current.disabled});if(M!==null){let H=t.options[M].dataRef.current.domRef;if(((i=A.current)==null?void 0:i.previousElementSibling)===H.current||((o=H.current)==null?void 0:o.previousElementSibling)===null)return{...v,activeOptionIndex:M}}}}else if(r.focus===i1.Next){let p=t.activeOptionIndex;if(p!==null){let A=t.options[p].dataRef.current.domRef,M=Q4(r,{resolveItems:()=>t.options,resolveActiveIndex:()=>t.activeOptionIndex,resolveId:H=>H.id,resolveDisabled:H=>H.dataRef.current.disabled});if(M!==null){let H=t.options[M].dataRef.current.domRef;if(((n=A.current)==null?void 0:n.nextElementSibling)===H.current||((h=H.current)==null?void 0:h.nextElementSibling)===null)return{...v,activeOptionIndex:M}}}}let u=Cv(t),s=Q4(r,{resolveItems:()=>u.options,resolveActiveIndex:()=>u.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});return{...v,...u,activeOptionIndex:s}},3:(t,r)=>{if(t.dataRef.current.disabled||t.listboxState===1)return t;let l=t.searchQuery!==""?0:1,i=t.searchQuery+r.value.toLowerCase(),o=(t.activeOptionIndex!==null?t.options.slice(t.activeOptionIndex+l).concat(t.options.slice(0,t.activeOptionIndex+l)):t.options).find(h=>{var v;return!h.dataRef.current.disabled&&((v=h.dataRef.current.textValue)==null?void 0:v.startsWith(i))}),n=o?t.options.indexOf(o):-1;return n===-1||n===t.activeOptionIndex?{...t,searchQuery:i}:{...t,searchQuery:i,activeOptionIndex:n,activationTrigger:1}},4(t){return t.dataRef.current.disabled||t.listboxState===1||t.searchQuery===""?t:{...t,searchQuery:""}},5(t){return t.dataRef.current.mode===0?{...t,frozenValue:!0}:{...t}},6:(t,r)=>{let l=t.options.concat(r.options),i=t.activeOptionIndex;if(t.pendingFocus.focus!==i1.Nothing&&(i=Q4(t.pendingFocus,{resolveItems:()=>l,resolveActiveIndex:()=>t.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),t.activeOptionIndex===null){let{isSelected:o}=t.dataRef.current;if(o){let n=l.findIndex(h=>o?.(h.dataRef.current.value));n!==-1&&(i=n)}}return{...t,options:l,activeOptionIndex:i,pendingFocus:{focus:i1.Nothing},pendingShouldSort:!0}},7:(t,r)=>{let l=t.options,i=[],o=new Set(r.options);for(let[n,h]of l.entries())if(o.has(h.id)&&(i.push(n),o.delete(h.id),o.size===0))break;if(i.length>0){l=l.slice();for(let n of i.reverse())l.splice(n,1)}return{...t,options:l,activationTrigger:1}},8:(t,r)=>t.buttonElement===r.element?t:{...t,buttonElement:r.element},9:(t,r)=>t.optionsElement===r.element?t:{...t,optionsElement:r.element},10:t=>t.pendingShouldSort?{...t,...Cv(t),pendingShouldSort:!1}:t,11(t){return t.buttonPositionState.kind!=="Tracked"?t:{...t,buttonPositionState:z2.Moved}}},n7=class t extends G4{constructor(r){super(r),zv(this,"actions",{onChange:l=>{let{onChange:i,compare:o,mode:n,value:h}=this.state.dataRef.current;return x1(n,{0:()=>i?.(l),1:()=>{let v=h.slice(),u=v.findIndex(s=>o(s,l));return u===-1?v.push(l):v.splice(u,1),i?.(v)}})},registerOption:wa(()=>{let l=[],i=new Set;return[(o,n)=>{i.has(n)||(i.add(n),l.push({id:o,dataRef:n}))},()=>(i.clear(),this.send({type:6,options:l.splice(0)}))]}),unregisterOption:wa(()=>{let l=[];return[i=>l.push(i),()=>{this.send({type:7,options:l.splice(0)})}]}),goToOption:wa(()=>{let l=null;return[(i,o)=>{l={type:2,...i,trigger:o}},()=>l&&this.send(l)]}),closeListbox:()=>{this.send({type:1})},openListbox:l=>{this.send({type:0,focus:l})},selectActiveOption:()=>{var l;if(this.state.activeOptionIndex!==null){let{dataRef:i}=this.state.options[this.state.activeOptionIndex];this.actions.selectOption(i.current.value)}else this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(l=this.state.buttonElement)==null||l.focus({preventScroll:!0}))},selectOption:l=>{this.send({type:5,value:l})},search:l=>{this.send({type:3,value:l})},clearSearch:()=>{this.send({type:4})},setButtonElement:l=>{this.send({type:8,element:l})},setOptionsElement:l=>{this.send({type:9,element:l})}}),zv(this,"selectors",{activeDescendantId(l){var i;let o=l.activeOptionIndex,n=l.options;return o===null||(i=n[o])==null?void 0:i.id},isActive(l,i){var o;let n=l.activeOptionIndex,h=l.options;return n!==null?((o=h[n])==null?void 0:o.id)===i:!1},hasFrozenValue(l){return l.frozenValue},shouldScrollIntoView(l,i){return l.__demoMode||l.listboxState!==0||l.activationTrigger===0?!1:this.isActive(l,i)},didButtonMove(l){return l.buttonPositionState.kind==="Moved"}}),this.on(6,()=>{requestAnimationFrame(()=>{this.send({type:10})})});{let l=this.state.id,i=l2.get(null);this.disposables.add(i.on(e5.Push,o=>{!i.selectors.isTop(o,l)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>i.actions.push(l)),this.on(1,()=>i.actions.pop(l))}this.disposables.group(l=>{this.on(1,i=>{i.buttonElement&&(l.dispose(),l.add(Ja(i.buttonElement,i.buttonPositionState,()=>{this.send({type:11})})))})}),this.on(5,(l,i)=>{var o;this.actions.onChange(i.value),this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(o=this.state.buttonElement)==null||o.focus({preventScroll:!0}))})}static new({id:r,__demoMode:l=!1}){return new t({id:r,dataRef:{current:{}},listboxState:l?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:i1.Nothing},frozenValue:!1,__demoMode:l,buttonPositionState:z2.Idle})}reduce(r,l){return x1(l.type,Vf,r,l)}};var R8=E(k(),1);var oe=(0,R8.createContext)(null);function c7(t){let r=(0,R8.useContext)(oe);if(r===null){let l=new Error(`<${t} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(l,ne),l}return r}function ne({id:t,__demoMode:r=!1}){let l=(0,R8.useMemo)(()=>n7.new({id:t,__demoMode:r}),[]);return J4(()=>l.dispose()),l}var d7=(0,u1.createContext)(null);d7.displayName="ListboxDataContext";function w5(t){let r=(0,u1.useContext)(d7);if(r===null){let l=new Error(`<${t} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(l,w5),l}return r}var mf=u1.Fragment;function Zf(t,r){let l=(0,O1.useId)(),i=Q0(),{value:o,defaultValue:n,form:h,name:v,onChange:u,by:s,invalid:p=!1,disabled:A=i||!1,horizontal:M=!1,multiple:H=!1,__demoMode:m=!1,...L}=t,w=M?"horizontal":"vertical",Z=z1(r),V=M8(n),[x=H?[]:void 0,z]=H8(o,u,V),B=ne({id:l,__demoMode:m}),P=(0,u1.useRef)({static:!1,hold:!1}),$=(0,u1.useRef)(new Map),S=za(s),O=(0,u1.useCallback)(D=>x1(y.mode,{[s4.Multi]:()=>x.some(R=>S(R,D)),[s4.Single]:()=>S(x,D)}),[x]),y=P1({value:x,disabled:A,invalid:p,mode:H?s4.Multi:s4.Single,orientation:w,onChange:z,compare:S,isSelected:O,optionsPropsRef:P,listRef:$});a1(()=>{B.state.dataRef.current=y},[y]);let F=f1(B,D=>D.listboxState),U=l2.get(null),q=f1(U,(0,u1.useCallback)(D=>U.selectors.isTop(D,l),[U,l])),[G,I]=f1(B,D=>[D.buttonElement,D.optionsElement]);Z8(q,[G,I],(D,R)=>{B.send({type:ie.CloseListbox}),Sa(R,c5.Loose)||(D.preventDefault(),G?.focus())});let J=P1({open:F===d0.Open,disabled:A,invalid:p,value:x}),[A1,X]=Za({inherit:!0}),l1={ref:Z},T=(0,u1.useCallback)(()=>{if(V!==void 0)return z?.(V)},[z,V]),W=M1();return u1.default.createElement(X,{value:A1,props:{htmlFor:G?.id},slot:{open:F===d0.Open,disabled:A}},u1.default.createElement(Ya,null,u1.default.createElement(oe.Provider,{value:B},u1.default.createElement(d7.Provider,{value:y},u1.default.createElement($8,{value:x1(F,{[d0.Open]:_1.Open,[d0.Closed]:_1.Closed})},v!=null&&x!=null&&u1.default.createElement(f8,{disabled:A,data:{[v]:x},form:h,onReset:T}),W({ourProps:l1,theirProps:L,slot:J,defaultTag:mf,name:"Listbox"}))))))}var xf="button";function Lf(t,r){let l=(0,O1.useId)(),i=E2(),o=w5("Listbox.Button"),n=c7("Listbox.Button"),{id:h=i||`headlessui-listbox-button-${l}`,disabled:v=o.disabled||!1,autoFocus:u=!1,...s}=t,p=z1(r,ja(),n.actions.setButtonElement),A=Ud(),[M,H,m]=f1(n,I=>[I.listboxState,I.buttonElement,I.optionsElement]),L=M===d0.Open;Ta(L,{trigger:H,action:(0,u1.useCallback)(I=>{if(H!=null&&H.contains(I.target))return m2.Ignore;let J=I.target.closest('[role="option"]:not([data-disabled])');return j1(J)?m2.Select(J):m!=null&&m.contains(I.target)?m2.Ignore:m2.Close},[H,m]),close:n.actions.closeListbox,select:n.actions.selectActiveOption});let w=_(I=>{switch(I.key){case h1.Enter:fa(I.currentTarget);break;case h1.Space:case h1.ArrowDown:I.preventDefault(),n.actions.openListbox({focus:o.value?i1.Nothing:i1.First});break;case h1.ArrowUp:I.preventDefault(),n.actions.openListbox({focus:o.value?i1.Nothing:i1.Last});break}}),Z=_(I=>{I.key===h1.Space&&I.preventDefault()}),V=Ca(I=>{var J;n.state.listboxState===d0.Open?((0,h7.flushSync)(()=>n.actions.closeListbox()),(J=n.state.buttonElement)==null||J.focus({preventScroll:!0})):(I.preventDefault(),n.actions.openListbox({focus:i1.Nothing}))}),x=_(I=>I.preventDefault()),z=V2([h]),B=I4(),{isFocusVisible:P,focusProps:$}=F2({autoFocus:u}),{isHovered:S,hoverProps:O}=O2({isDisabled:v}),{pressed:y,pressProps:F}=u8({disabled:v}),U=P1({open:M===d0.Open,active:y||M===d0.Open,disabled:v,invalid:o.invalid,value:o.value,hover:S,focus:P,autofocus:u}),q=f1(n,I=>I.listboxState===d0.Open),G=f2(A(),{ref:p,id:h,type:$a(t,H),"aria-haspopup":"listbox","aria-controls":m?.id,"aria-expanded":q,"aria-labelledby":z,"aria-describedby":B,disabled:v||void 0,autoFocus:u,onKeyDown:w,onKeyUp:Z,onKeyPress:x},V,$,O,F);return M1()({ourProps:G,theirProps:s,slot:U,defaultTag:xf,name:"Listbox.Button"})}var wv=(0,u1.createContext)(!1),zf="div",Cf=J0.RenderStrategy|J0.Static;function wf(t,r){let l=(0,O1.useId)(),{id:i=`headlessui-listbox-options-${l}`,anchor:o,portal:n=!1,modal:h=!0,transition:v=!1,...u}=t,s=Wa(o),[p,A]=(0,u1.useState)(null);s&&(n=!0);let M=w5("Listbox.Options"),H=c7("Listbox.Options"),[m,L,w,Z]=f1(H,j=>[j.listboxState,j.buttonElement,j.optionsElement,j.__demoMode]),V=e2(L),x=e2(w),z=G2(),[B,P]=C8(v,p,z!==null?(z&_1.Open)===_1.Open:m===d0.Open);m8(B,L,H.actions.closeListbox);let $=Z?!1:h&&m===d0.Open;L8($,x);let S=Z?!1:h&&m===d0.Open;V8(S,{allowed:(0,u1.useCallback)(()=>[L,w],[L,w])});let O=f1(H,H.selectors.didButtonMove)?!1:B,y=f1(H,H.selectors.hasFrozenValue)&&!t.static,F=T8(y,M.value),U=(0,u1.useCallback)(j=>M.compare(F,j),[M.compare,F]),q=f1(H,j=>{var m1;if(s==null||!((m1=s?.to)!=null&&m1.includes("selection")))return null;let Q=j.options.findIndex(r0=>U(r0.dataRef.current.value));return Q===-1&&(Q=0),Q}),G=(()=>{if(s==null)return;if(q===null)return{...s,inner:void 0};let j=Array.from(M.listRef.current.values());return{...s,inner:{listRef:{current:j},index:q}}})(),[I,J]=Ka(G),A1=qa(),X=z1(r,s?I:null,H.actions.setOptionsElement,A),l1=W1();(0,u1.useEffect)(()=>{let j=w;j&&m===d0.Open&&(_4(j)||j==null||j.focus({preventScroll:!0}))},[m,w]);let T=_(j=>{var m1;switch(l1.dispose(),j.key){case h1.Space:if(H.state.searchQuery!=="")return j.preventDefault(),j.stopPropagation(),H.actions.search(j.key);case h1.Enter:j.preventDefault(),j.stopPropagation(),H.actions.selectActiveOption();break;case x1(M.orientation,{vertical:h1.ArrowDown,horizontal:h1.ArrowRight}):return j.preventDefault(),j.stopPropagation(),H.actions.goToOption({focus:i1.Next});case x1(M.orientation,{vertical:h1.ArrowUp,horizontal:h1.ArrowLeft}):return j.preventDefault(),j.stopPropagation(),H.actions.goToOption({focus:i1.Previous});case h1.Home:case h1.PageUp:return j.preventDefault(),j.stopPropagation(),H.actions.goToOption({focus:i1.First});case h1.End:case h1.PageDown:return j.preventDefault(),j.stopPropagation(),H.actions.goToOption({focus:i1.Last});case h1.Escape:j.preventDefault(),j.stopPropagation(),(0,h7.flushSync)(()=>H.actions.closeListbox()),(m1=H.state.buttonElement)==null||m1.focus({preventScroll:!0});return;case h1.Tab:j.preventDefault(),j.stopPropagation(),(0,h7.flushSync)(()=>H.actions.closeListbox()),Ch(H.state.buttonElement,j.shiftKey?I0.Previous:I0.Next);break;default:j.key.length===1&&(H.actions.search(j.key),l1.setTimeout(()=>H.actions.clearSearch(),350));break}}),W=f1(H,j=>{var m1;return(m1=j.buttonElement)==null?void 0:m1.id}),D=P1({open:m===d0.Open}),R=f2(s?A1():{},{id:i,ref:X,"aria-activedescendant":f1(H,H.selectors.activeDescendantId),"aria-multiselectable":M.mode===s4.Multi?!0:void 0,"aria-labelledby":W,"aria-orientation":M.orientation,onKeyDown:T,role:"listbox",tabIndex:m===d0.Open?0:void 0,style:{...u.style,...J,"--button-width":t5(B,L,!0).width},...z8(P)}),c1=M1(),Z1=(0,u1.useMemo)(()=>M.mode===s4.Multi?M:{...M,isSelected:U},[M,U]);return u1.default.createElement(F8,{enabled:n?t.static||B:!1,ownerDocument:V},u1.default.createElement(d7.Provider,{value:Z1},c1({ourProps:R,theirProps:u,slot:D,defaultTag:zf,features:Cf,visible:O,name:"Listbox.Options"})))}var Bf="div";function Pf(t,r){let l=(0,O1.useId)(),{id:i=`headlessui-listbox-option-${l}`,disabled:o=!1,value:n,...h}=t,v=(0,u1.useContext)(wv)===!0,u=w5("Listbox.Option"),s=c7("Listbox.Option"),p=f1(s,y=>s.selectors.isActive(y,i)),A=u.isSelected(n),M=(0,u1.useRef)(null),H=Lv(M),m=t0({disabled:o,value:n,domRef:M,get textValue(){return H()}}),L=z1(r,M,y=>{y?u.listRef.current.set(i,y):u.listRef.current.delete(i)}),w=f1(s,y=>s.selectors.shouldScrollIntoView(y,i));a1(()=>{if(w)return T1().requestAnimationFrame(()=>{var y,F;(F=(y=M.current)==null?void 0:y.scrollIntoView)==null||F.call(y,{block:"nearest"})})},[w,M]),a1(()=>{if(!v)return s.actions.registerOption(i,m),()=>s.actions.unregisterOption(i)},[m,i,v]);let Z=_(y=>{if(o)return y.preventDefault();s.actions.selectOption(n)}),V=_(()=>{if(o)return s.actions.goToOption({focus:i1.Nothing});s.actions.goToOption({focus:i1.Specific,id:i})}),x=Oa(),z=_(y=>x.update(y)),B=_(y=>{x.wasMoved(y)&&(o||p&&s.state.activationTrigger===C5.Pointer||s.actions.goToOption({focus:i1.Specific,id:i},C5.Pointer))}),P=_(y=>{x.wasMoved(y)&&(o||p&&s.state.activationTrigger===C5.Pointer&&s.actions.goToOption({focus:i1.Nothing}))}),$=P1({active:p,focus:p,selected:A,disabled:o,selectedOption:A&&v}),S=v?{}:{id:i,ref:L,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":A,disabled:void 0,onClick:Z,onFocus:V,onPointerEnter:z,onMouseEnter:z,onPointerMove:B,onMouseMove:B,onPointerLeave:P,onMouseLeave:P},O=M1();return!A&&v?null:O({ourProps:S,theirProps:h,slot:$,defaultTag:Bf,name:"Listbox.Option"})}var Sf=u1.Fragment;function yf(t,r){let{options:l,placeholder:i,...o}=t,n={ref:z1(r)},h=w5("ListboxSelectedOption"),v=P1({}),u=h.value===void 0||h.value===null||h.mode===s4.Multi&&Array.isArray(h.value)&&h.value.length===0,s=M1();return u1.default.createElement(wv.Provider,{value:!0},s({ourProps:n,theirProps:{...o,children:u1.default.createElement(u1.default.Fragment,null,i&&u?i:l)},slot:v,defaultTag:Sf,name:"ListboxSelectedOption"}))}var bf=d1(Zf),ce=d1(Lf),Tf=xa,he=d1(wf),de=d1(Pf),$f=d1(yf),Bv=Object.assign(bf,{Button:ce,Label:Tf,Options:he,Option:de,SelectedOption:$f});var I8=E(k(),1);var ve=E(k(),1),ge={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ue=ve.default.createContext&&ve.default.createContext(ge);var Of=["attr","size","title"];function Ff(t,r){if(t==null)return{};var l,i,o=Df(t,r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(i=0;i<n.length;i++)l=n[i],r.indexOf(l)===-1&&{}.propertyIsEnumerable.call(t,l)&&(o[l]=t[l])}return o}function Df(t,r){if(t==null)return{};var l={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(r.indexOf(i)!==-1)continue;l[i]=t[i]}return l}function v7(){return v7=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var l=arguments[r];for(var i in l)({}).hasOwnProperty.call(l,i)&&(t[i]=l[i])}return t},v7.apply(null,arguments)}function Pv(t,r){var l=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);r&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),l.push.apply(l,i)}return l}function g7(t){for(var r=1;r<arguments.length;r++){var l=arguments[r]!=null?arguments[r]:{};r%2?Pv(Object(l),!0).forEach(function(i){Ef(t,i,l[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(l)):Pv(Object(l)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(l,i))})}return t}function Ef(t,r,l){return(r=Nf(r))in t?Object.defineProperty(t,r,{value:l,enumerable:!0,configurable:!0,writable:!0}):t[r]=l,t}function Nf(t){var r=_f(t,"string");return typeof r=="symbol"?r:r+""}function _f(t,r){if(typeof t!="object"||!t)return t;var l=t[Symbol.toPrimitive];if(l!==void 0){var i=l.call(t,r||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}function Sv(t){return t&&t.map((r,l)=>I8.default.createElement(r.tag,g7({key:l},r.attr),Sv(r.child)))}function p4(t){return r=>I8.default.createElement(Rf,v7({attr:g7({},t.attr)},r),Sv(t.child))}function Rf(t){var r=l=>{var{attr:i,size:o,title:n}=t,h=Ff(t,Of),v=o||l.size||"1em",u;return l.className&&(u=l.className),t.className&&(u=(u?u+" ":"")+t.className),I8.default.createElement("svg",v7({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},l.attr,i,h,{className:u,style:g7(g7({color:t.color||l.color},l.style),t.style),height:v,width:v,xmlns:"http://www.w3.org/2000/svg"}),n&&I8.default.createElement("title",null,n),t.children)};return ue!==void 0?I8.default.createElement(ue.Consumer,null,l=>r(l)):r(ge)}function yv(t){return p4({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M12 7V3H2v18h20V7H12zM6 19H4v-2h2v2zm0-4H4v-2h2v2zm0-4H4V9h2v2zm0-4H4V5h2v2zm4 12H8v-2h2v2zm0-4H8v-2h2v2zm0-4H8V9h2v2zm0-4H8V5h2v2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8v10zm-2-8h-2v2h2v-2zm0 4h-2v2h2v-2z"},child:[]}]})(t)}function bv(t){return p4({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zM7 9l1.41 1.41L11 7.83V16h2V7.83l2.59 2.58L17 9l-5-5-5 5z"},child:[]}]})(t)}function Tv(t){return p4({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M3 10h11v2H3v-2zm0-2h11V6H3v2zm0 8h7v-2H3v2zm15.01-3.13.71-.71a.996.996 0 0 1 1.41 0l.71.71c.39.39.39 1.02 0 1.41l-.71.71-2.12-2.12zm-.71.71-5.3 5.3V21h2.12l5.3-5.3-2.12-2.12z"},child:[]}]})(t)}function $v(t){return p4({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M4 19V8h16v3.29c.72.22 1.4.54 2 .97V8c0-1.11-.89-2-2-2h-4V4c0-1.11-.89-2-2-2h-4c-1.11 0-2 .89-2 2v2H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h7.68c-.3-.62-.5-1.29-.6-2H4zm6-15h4v2h-4V4z"},child:[]},{tag:"path",attr:{d:"M18 13c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm1.65 7.35L17.5 18.2V15h1v2.79l1.85 1.85-.7.71z"},child:[]}]})(t)}function Ov(t){return p4({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"},child:[]}]})(t)}var k8=[{name:"Afghanistan",iso2:"af",dialCode:"93"},{name:"Albania",iso2:"al",dialCode:"355"},{name:"Algeria",iso2:"dz",dialCode:"213"},{name:"American Samoa",iso2:"as",dialCode:"1",priority:5,areaCodes:["684"]},{name:"Andorra",iso2:"ad",dialCode:"376"},{name:"Angola",iso2:"ao",dialCode:"244"},{name:"Anguilla",iso2:"ai",dialCode:"1",priority:6,areaCodes:["264"]},{name:"Antigua & Barbuda",iso2:"ag",dialCode:"1",priority:7,areaCodes:["268"]},{name:"Argentina",iso2:"ar",dialCode:"54"},{name:"Armenia",iso2:"am",dialCode:"374"},{name:"Aruba",iso2:"aw",dialCode:"297"},{name:"Ascension Island",iso2:"ac",dialCode:"247"},{name:"Australia",iso2:"au",dialCode:"61",priority:0},{name:"Austria",iso2:"at",dialCode:"43"},{name:"Azerbaijan",iso2:"az",dialCode:"994"},{name:"Bahamas",iso2:"bs",dialCode:"1",priority:8,areaCodes:["242"]},{name:"Bahrain",iso2:"bh",dialCode:"973"},{name:"Bangladesh",iso2:"bd",dialCode:"880"},{name:"Barbados",iso2:"bb",dialCode:"1",priority:9,areaCodes:["246"]},{name:"Belarus",iso2:"by",dialCode:"375"},{name:"Belgium",iso2:"be",dialCode:"32"},{name:"Belize",iso2:"bz",dialCode:"501"},{name:"Benin",iso2:"bj",dialCode:"229"},{name:"Bermuda",iso2:"bm",dialCode:"1",priority:10,areaCodes:["441"]},{name:"Bhutan",iso2:"bt",dialCode:"975"},{name:"Bolivia",iso2:"bo",dialCode:"591"},{name:"Bosnia & Herzegovina",iso2:"ba",dialCode:"387"},{name:"Botswana",iso2:"bw",dialCode:"267"},{name:"Brazil",iso2:"br",dialCode:"55"},{name:"British Indian Ocean Territory",iso2:"io",dialCode:"246"},{name:"British Virgin Islands",iso2:"vg",dialCode:"1",priority:11,areaCodes:["284"]},{name:"Brunei",iso2:"bn",dialCode:"673"},{name:"Bulgaria",iso2:"bg",dialCode:"359"},{name:"Burkina Faso",iso2:"bf",dialCode:"226"},{name:"Burundi",iso2:"bi",dialCode:"257"},{name:"Cambodia",iso2:"kh",dialCode:"855"},{name:"Cameroon",iso2:"cm",dialCode:"237"},{name:"Canada",iso2:"ca",dialCode:"1",priority:1,areaCodes:["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","902","905"]},{name:"Cape Verde",iso2:"cv",dialCode:"238"},{name:"Caribbean Netherlands",iso2:"bq",dialCode:"599",priority:1,areaCodes:["3","4","7"]},{name:"Cayman Islands",iso2:"ky",dialCode:"1",priority:12,areaCodes:["345"]},{name:"Central African Republic",iso2:"cf",dialCode:"236"},{name:"Chad",iso2:"td",dialCode:"235"},{name:"Chile",iso2:"cl",dialCode:"56"},{name:"China",iso2:"cn",dialCode:"86"},{name:"Christmas Island",iso2:"cx",dialCode:"61",priority:2,areaCodes:["89164"]},{name:"Cocos (Keeling) Islands",iso2:"cc",dialCode:"61",priority:1,areaCodes:["89162"]},{name:"Colombia",iso2:"co",dialCode:"57"},{name:"Comoros",iso2:"km",dialCode:"269"},{name:"Congo - Brazzaville",iso2:"cg",dialCode:"242"},{name:"Congo - Kinshasa",iso2:"cd",dialCode:"243"},{name:"Cook Islands",iso2:"ck",dialCode:"682"},{name:"Costa Rica",iso2:"cr",dialCode:"506"},{name:"C\xF4te d\u2019Ivoire",iso2:"ci",dialCode:"225"},{name:"Croatia",iso2:"hr",dialCode:"385"},{name:"Cuba",iso2:"cu",dialCode:"53"},{name:"Cura\xE7ao",iso2:"cw",dialCode:"599",priority:0},{name:"Cyprus",iso2:"cy",dialCode:"357"},{name:"Czech Republic",iso2:"cz",dialCode:"420"},{name:"Denmark",iso2:"dk",dialCode:"45"},{name:"Djibouti",iso2:"dj",dialCode:"253"},{name:"Dominica",iso2:"dm",dialCode:"1",priority:13,areaCodes:["767"]},{name:"Dominican Republic",iso2:"do",dialCode:"1",priority:2,areaCodes:["809","829","849"]},{name:"Ecuador",iso2:"ec",dialCode:"593"},{name:"Egypt",iso2:"eg",dialCode:"20"},{name:"El Salvador",iso2:"sv",dialCode:"503"},{name:"Equatorial Guinea",iso2:"gq",dialCode:"240"},{name:"Eritrea",iso2:"er",dialCode:"291"},{name:"Estonia",iso2:"ee",dialCode:"372"},{name:"Eswatini",iso2:"sz",dialCode:"268"},{name:"Ethiopia",iso2:"et",dialCode:"251"},{name:"Falkland Islands",iso2:"fk",dialCode:"500"},{name:"Faroe Islands",iso2:"fo",dialCode:"298"},{name:"Fiji",iso2:"fj",dialCode:"679"},{name:"Finland",iso2:"fi",dialCode:"358",priority:0},{name:"France",iso2:"fr",dialCode:"33"},{name:"French Guiana",iso2:"gf",dialCode:"594"},{name:"French Polynesia",iso2:"pf",dialCode:"689"},{name:"Gabon",iso2:"ga",dialCode:"241"},{name:"Gambia",iso2:"gm",dialCode:"220"},{name:"Georgia",iso2:"ge",dialCode:"995"},{name:"Germany",iso2:"de",dialCode:"49"},{name:"Ghana",iso2:"gh",dialCode:"233"},{name:"Gibraltar",iso2:"gi",dialCode:"350"},{name:"Greece",iso2:"gr",dialCode:"30"},{name:"Greenland",iso2:"gl",dialCode:"299"},{name:"Grenada",iso2:"gd",dialCode:"1",priority:14,areaCodes:["473"]},{name:"Guadeloupe",iso2:"gp",dialCode:"590",priority:0},{name:"Guam",iso2:"gu",dialCode:"1",priority:15,areaCodes:["671"]},{name:"Guatemala",iso2:"gt",dialCode:"502"},{name:"Guernsey",iso2:"gg",dialCode:"44",priority:1,areaCodes:["1481","7781","7839","7911"]},{name:"Guinea",iso2:"gn",dialCode:"224"},{name:"Guinea-Bissau",iso2:"gw",dialCode:"245"},{name:"Guyana",iso2:"gy",dialCode:"592"},{name:"Haiti",iso2:"ht",dialCode:"509"},{name:"Honduras",iso2:"hn",dialCode:"504"},{name:"Hong Kong",iso2:"hk",dialCode:"852"},{name:"Hungary",iso2:"hu",dialCode:"36"},{name:"Iceland",iso2:"is",dialCode:"354"},{name:"India",iso2:"in",dialCode:"91"},{name:"Indonesia",iso2:"id",dialCode:"62"},{name:"Iran",iso2:"ir",dialCode:"98"},{name:"Iraq",iso2:"iq",dialCode:"964"},{name:"Ireland",iso2:"ie",dialCode:"353"},{name:"Isle of Man",iso2:"im",dialCode:"44",priority:2,areaCodes:["1624","74576","7524","7924","7624"]},{name:"Israel",iso2:"il",dialCode:"972"},{name:"Italy",iso2:"it",dialCode:"39",priority:0},{name:"Jamaica",iso2:"jm",dialCode:"1",priority:4,areaCodes:["876","658"]},{name:"Japan",iso2:"jp",dialCode:"81"},{name:"Jersey",iso2:"je",dialCode:"44",priority:3,areaCodes:["1534","7509","7700","7797","7829","7937"]},{name:"Jordan",iso2:"jo",dialCode:"962"},{name:"Kazakhstan",iso2:"kz",dialCode:"7",priority:1,areaCodes:["33","7"]},{name:"Kenya",iso2:"ke",dialCode:"254"},{name:"Kiribati",iso2:"ki",dialCode:"686"},{name:"Kosovo",iso2:"xk",dialCode:"383"},{name:"Kuwait",iso2:"kw",dialCode:"965"},{name:"Kyrgyzstan",iso2:"kg",dialCode:"996"},{name:"Laos",iso2:"la",dialCode:"856"},{name:"Latvia",iso2:"lv",dialCode:"371"},{name:"Lebanon",iso2:"lb",dialCode:"961"},{name:"Lesotho",iso2:"ls",dialCode:"266"},{name:"Liberia",iso2:"lr",dialCode:"231"},{name:"Libya",iso2:"ly",dialCode:"218"},{name:"Liechtenstein",iso2:"li",dialCode:"423"},{name:"Lithuania",iso2:"lt",dialCode:"370"},{name:"Luxembourg",iso2:"lu",dialCode:"352"},{name:"Macau",iso2:"mo",dialCode:"853"},{name:"Madagascar",iso2:"mg",dialCode:"261"},{name:"Malawi",iso2:"mw",dialCode:"265"},{name:"Malaysia",iso2:"my",dialCode:"60"},{name:"Maldives",iso2:"mv",dialCode:"960"},{name:"Mali",iso2:"ml",dialCode:"223"},{name:"Malta",iso2:"mt",dialCode:"356"},{name:"Marshall Islands",iso2:"mh",dialCode:"692"},{name:"Martinique",iso2:"mq",dialCode:"596"},{name:"Mauritania",iso2:"mr",dialCode:"222"},{name:"Mauritius",iso2:"mu",dialCode:"230"},{name:"Mayotte",iso2:"yt",dialCode:"262",priority:1,areaCodes:["269","639"]},{name:"Mexico",iso2:"mx",dialCode:"52"},{name:"Micronesia",iso2:"fm",dialCode:"691"},{name:"Moldova",iso2:"md",dialCode:"373"},{name:"Monaco",iso2:"mc",dialCode:"377"},{name:"Mongolia",iso2:"mn",dialCode:"976"},{name:"Montenegro",iso2:"me",dialCode:"382"},{name:"Montserrat",iso2:"ms",dialCode:"1",priority:16,areaCodes:["664"]},{name:"Morocco",iso2:"ma",dialCode:"212",priority:0},{name:"Mozambique",iso2:"mz",dialCode:"258"},{name:"Myanmar (Burma)",iso2:"mm",dialCode:"95"},{name:"Namibia",iso2:"na",dialCode:"264"},{name:"Nauru",iso2:"nr",dialCode:"674"},{name:"Nepal",iso2:"np",dialCode:"977"},{name:"Netherlands",iso2:"nl",dialCode:"31"},{name:"New Caledonia",iso2:"nc",dialCode:"687"},{name:"New Zealand",iso2:"nz",dialCode:"64"},{name:"Nicaragua",iso2:"ni",dialCode:"505"},{name:"Niger",iso2:"ne",dialCode:"227"},{name:"Nigeria",iso2:"ng",dialCode:"234"},{name:"Niue",iso2:"nu",dialCode:"683"},{name:"Norfolk Island",iso2:"nf",dialCode:"672"},{name:"North Korea",iso2:"kp",dialCode:"850"},{name:"North Macedonia",iso2:"mk",dialCode:"389"},{name:"Northern Mariana Islands",iso2:"mp",dialCode:"1",priority:17,areaCodes:["670"]},{name:"Norway",iso2:"no",dialCode:"47",priority:0},{name:"Oman",iso2:"om",dialCode:"968"},{name:"Pakistan",iso2:"pk",dialCode:"92"},{name:"Palau",iso2:"pw",dialCode:"680"},{name:"Palestine",iso2:"ps",dialCode:"970"},{name:"Panama",iso2:"pa",dialCode:"507"},{name:"Papua New Guinea",iso2:"pg",dialCode:"675"},{name:"Paraguay",iso2:"py",dialCode:"595"},{name:"Peru",iso2:"pe",dialCode:"51"},{name:"Philippines",iso2:"ph",dialCode:"63"},{name:"Poland",iso2:"pl",dialCode:"48"},{name:"Portugal",iso2:"pt",dialCode:"351"},{name:"Puerto Rico",iso2:"pr",dialCode:"1",priority:3,areaCodes:["787","939"]},{name:"Qatar",iso2:"qa",dialCode:"974"},{name:"R\xE9union",iso2:"re",dialCode:"262",priority:0},{name:"Romania",iso2:"ro",dialCode:"40"},{name:"Russia",iso2:"ru",dialCode:"7",priority:0},{name:"Rwanda",iso2:"rw",dialCode:"250"},{name:"Samoa",iso2:"ws",dialCode:"685"},{name:"San Marino",iso2:"sm",dialCode:"378"},{name:"S\xE3o Tom\xE9 & Pr\xEDncipe",iso2:"st",dialCode:"239"},{name:"Saudi Arabia",iso2:"sa",dialCode:"966"},{name:"Senegal",iso2:"sn",dialCode:"221"},{name:"Serbia",iso2:"rs",dialCode:"381"},{name:"Seychelles",iso2:"sc",dialCode:"248"},{name:"Sierra Leone",iso2:"sl",dialCode:"232"},{name:"Singapore",iso2:"sg",dialCode:"65"},{name:"Sint Maarten",iso2:"sx",dialCode:"1",priority:21,areaCodes:["721"]},{name:"Slovakia",iso2:"sk",dialCode:"421"},{name:"Slovenia",iso2:"si",dialCode:"386"},{name:"Solomon Islands",iso2:"sb",dialCode:"677"},{name:"Somalia",iso2:"so",dialCode:"252"},{name:"South Africa",iso2:"za",dialCode:"27"},{name:"South Korea",iso2:"kr",dialCode:"82"},{name:"South Sudan",iso2:"ss",dialCode:"211"},{name:"Spain",iso2:"es",dialCode:"34"},{name:"Sri Lanka",iso2:"lk",dialCode:"94"},{name:"St Barth\xE9lemy",iso2:"bl",dialCode:"590",priority:1},{name:"St Helena",iso2:"sh",dialCode:"290"},{name:"St Kitts & Nevis",iso2:"kn",dialCode:"1",priority:18,areaCodes:["869"]},{name:"St Lucia",iso2:"lc",dialCode:"1",priority:19,areaCodes:["758"]},{name:"St Martin",iso2:"mf",dialCode:"590",priority:2},{name:"St Pierre & Miquelon",iso2:"pm",dialCode:"508"},{name:"St Vincent & Grenadines",iso2:"vc",dialCode:"1",priority:20,areaCodes:["784"]},{name:"Sudan",iso2:"sd",dialCode:"249"},{name:"Suriname",iso2:"sr",dialCode:"597"},{name:"Svalbard & Jan Mayen",iso2:"sj",dialCode:"47",priority:1,areaCodes:["79"]},{name:"Sweden",iso2:"se",dialCode:"46"},{name:"Switzerland",iso2:"ch",dialCode:"41"},{name:"Syria",iso2:"sy",dialCode:"963"},{name:"Taiwan",iso2:"tw",dialCode:"886"},{name:"Tajikistan",iso2:"tj",dialCode:"992"},{name:"Tanzania",iso2:"tz",dialCode:"255"},{name:"Thailand",iso2:"th",dialCode:"66"},{name:"Timor-Leste",iso2:"tl",dialCode:"670"},{name:"Togo",iso2:"tg",dialCode:"228"},{name:"Tokelau",iso2:"tk",dialCode:"690"},{name:"Tonga",iso2:"to",dialCode:"676"},{name:"Trinidad & Tobago",iso2:"tt",dialCode:"1",priority:22,areaCodes:["868"]},{name:"Tunisia",iso2:"tn",dialCode:"216"},{name:"Turkey",iso2:"tr",dialCode:"90"},{name:"Turkmenistan",iso2:"tm",dialCode:"993"},{name:"Turks & Caicos Islands",iso2:"tc",dialCode:"1",priority:23,areaCodes:["649"]},{name:"Tuvalu",iso2:"tv",dialCode:"688"},{name:"Uganda",iso2:"ug",dialCode:"256"},{name:"Ukraine",iso2:"ua",dialCode:"380"},{name:"United Arab Emirates",iso2:"ae",dialCode:"971"},{name:"United Kingdom",iso2:"gb",dialCode:"44",priority:0},{name:"United States",iso2:"us",dialCode:"1",priority:0},{name:"Uruguay",iso2:"uy",dialCode:"598"},{name:"US Virgin Islands",iso2:"vi",dialCode:"1",priority:24,areaCodes:["340"]},{name:"Uzbekistan",iso2:"uz",dialCode:"998"},{name:"Vanuatu",iso2:"vu",dialCode:"678"},{name:"Vatican City",iso2:"va",dialCode:"39",priority:1,areaCodes:["06698"]},{name:"Venezuela",iso2:"ve",dialCode:"58"},{name:"Vietnam",iso2:"vn",dialCode:"84"},{name:"Wallis & Futuna",iso2:"wf",dialCode:"681"},{name:"Western Sahara",iso2:"eh",dialCode:"212",priority:1,areaCodes:["5288","5289"]},{name:"Yemen",iso2:"ye",dialCode:"967"},{name:"Zambia",iso2:"zm",dialCode:"260"},{name:"Zimbabwe",iso2:"zw",dialCode:"263"},{name:"\xC5land Islands",iso2:"ax",dialCode:"358",priority:1,areaCodes:["18"]}];function se(t){return t?t.toUpperCase().split("").map(r=>String.fromCodePoint(127397+r.charCodeAt(0))).join(""):"\u{1F310}"}function b6(t){if(t)return k8.find(r=>r.iso2.toLowerCase()===t.toLowerCase())}function T6(t){if(!t)return;let r=String(t).replace(/[^0-9]/g,"");if(r)return k8.find(l=>l.dialCode===r||l.areaCodes?.includes(r))}function B5(t){return`+${t.dialCode}`}var _v=E(Fv(),1);var If=/^([\w-.]+@([\w-]+\.)+[\w-]{2,25})?$/,pe=_v.default.PhoneNumberUtil.getInstance();function Rv(t){return t.formGroupName||t.masterApplyFields.fieldNameForApply}function He(t){return String(t?.phoneNumField?.nationalNumber||t?.phoneNumField?.number||"").trim()}function kf(t){return P5(t?.phoneNumField?.dialCode)}function $6(t){return String(t||"").replace(/\D+/g,"")}function P5(t){let r=$6(t);return r?`+${r}`:""}function Me(t,r){let l=$6(r);return l?`${P5(t)}${l}`:""}var Uf=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Gf(t){if(!t)return t;if(t instanceof Date&&!Number.isNaN(t.getTime())){let n=t.getFullYear(),h=String(t.getMonth()+1).padStart(2,"0"),v=String(t.getDate()).padStart(2,"0");return`${n}-${h}-${v}`}let r=String(t).trim(),l=r.match(/^(\d{4})-(\d{2})-(\d{2})/);if(l)return`${l[1]}-${l[2]}-${l[3]}`;let i=r.match(/^(\d{1,2})\s+([A-Za-z]{3,})\s+(\d{4})$/);if(i){let n=Uf.findIndex(h=>h.toLowerCase()===i[2].slice(0,3).toLowerCase());if(n>=0)return`${i[3]}-${String(n+1).padStart(2,"0")}-${String(Number(i[1])).padStart(2,"0")}`}let o=new Date(r);if(!Number.isNaN(o.getTime())){let n=o.getFullYear(),h=String(o.getMonth()+1).padStart(2,"0"),v=String(o.getDate()).padStart(2,"0");return`${n}-${h}-${v}`}return t}function j2(t){return t?t.split(",").map(r=>r.trim()).filter(Boolean):[]}function Iv(t,r=2){if(t===0)return"0 Bytes";let l=["Bytes","KB","MB","GB","TB"],i=1024,o=Math.floor(Math.log(t)/Math.log(i));return`${(t/Math.pow(i,o)).toFixed(r)} ${l[o]}`}function s7(t,r=4){let l=t==null?"":String(t);if(!l)return"";let i=Array.from(l),o=0;for(let n=i.length-1;n>=0;n-=1)if(!/\s/.test(i[n])){if(o<r){o+=1;continue}i[n]="\u2022"}return i.join("")}function p7(t){let r=t instanceof Date?t:new Date(t);if(Number.isNaN(r.getTime()))return null;let l=new Date,i=l.getFullYear()-r.getFullYear(),o=l.getMonth()-r.getMonth();return(o<0||o===0&&l.getDate()<r.getDate())&&(i-=1),i}function u7(t,r){let l=r?.reponseObject?.parsedResult?.profile,i=l?.PersonalDetails,o=r?.reponseObject?.jobApplication;return[i?.[t],l?.[t],o?.[t]].find(h=>h!=null&&h!=="null")??""}function kv(t){return t.fieldOptions?Array.isArray(t.fieldOptions)?t.fieldOptions.map(r=>r.value):j2(t.fieldOptions):[]}function H7(t,r){let l=r.trim().toLowerCase();return l?t.filter(i=>i.toLowerCase().includes(l)):t}function Wf(t){return t.recruiterUploads==="Mandatory"}function o2(t){return String(t.fieldType||"").toLowerCase()==="consent"}function n2(t,r,l){let i=r.find(v=>j2(v.dependentFieldsName).includes(t));if(!i)return!0;let o=j2(i.dependentFieldsName),n=j2(i.dependentFieldsValues),h=l[i.masterApplyFields.fieldNameForApply];return o.some((v,u)=>v===t&&n[u]===h)}function Dv(t,r,l){return Wf(t)&&n2(t.masterApplyFields.fieldNameForApply,r,l)}function Uv(t){return t.recruiterUploadsLabel?.trim()||t.masterApplyFields.fieldNameForApply||"This field"}function Ev(t){let r=Uv(t);return t.fieldType==="checkbox"||o2(t)?`Please select ${r}`:t.fieldType==="D"?`Please select ${r}`:`${r} is required`}function Nv(t){let r=Uv(t);return t.fieldType==="email"||t.masterApplyFields.fieldNameForApply==="emailId"?"Please enter a valid email address":t.fieldType==="D"?`Please select a valid ${r}`:t.fieldType==="date"?`Please enter a valid ${r}`:t.fieldType==="location"?`Please enter a valid ${r}`:`Please enter a valid ${r}`}function jf(t){let r=String(t||"").trim();return r?new RegExp(`^(?:${r})$`):null}function qf(t,r){let l=b6(t.selectedCountryCode);return(T6(kf(r))||l)?.iso2?.toUpperCase()||void 0}function Kf(t,r){let l=$6(He(r));if(!l)return!0;let i=qf(t,r);try{let o=pe.parseAndKeepRawInput(l,i);return i?pe.isValidNumberForRegion(o,i):pe.isValidNumber(o)}catch{return!1}}function U8(t,r,l,i){let o=t.masterApplyFields.fieldNameForApply;if(!o||o==="uploadResume")return null;let n=t.errorMessage&&t.errorMessage.toUpperCase()!=="NULL"?t.errorMessage:null;if(t.fieldType==="phone"){let h=He(r);return Dv(t,l,i)&&!h?Ev(t):h?Kf(t,r)?null:n||"Provide a valid Phone number":null}if(Dv(t,l,i)&&(r==null||r===""||typeof r=="boolean"&&r===!1))return Ev(t);if(typeof r!="string"||!r)return null;if(t.fieldType==="email"&&!If.test(r))return n||Nv(t);if(t.pattern)try{let h=jf(t.pattern);if(!h)return null;if(!h.test(r))return n||Nv(t)}catch{return null}return null}function Gv(t,r){if(!r)return{isValid:!0};let l=(r.fileFormat||[]).map(n=>String(n).trim().toLowerCase().replace(/^\./,"")),i=t.name.includes(".")&&t.name.split(".").pop()?.trim().toLowerCase()||"";if(!(l.length===0||l.includes(i)))return{isValid:!1,reason:r?.errorFormat||`Unsupported file type for: ${t.name}. Please upload a supported file.`};if(r.fileSize){let n=r.fileSize*1024*1024;if(t.size>n)return{isValid:!1,reason:r?.errorSize||`File size should be ${r.fileSize} MB or less.`}}return{isValid:!0}}function fe(t){return{countryIsoCode:t?.countryIsoCode??"IN",whatsAppEnabled:t?.whatsAppEnabled??!1,maxCount:t?.maxCount??3}}function Wv(t){return{phoneType:"Mobile",phoneNumField:null,whatsAppEnabled:fe(t).whatsAppEnabled}}function jv(t,r){let l=fe(r),i=1;return t.map(o=>{if(o.fieldType!=="phone")return{...o};let n=`phoneField${i}`;return i+=1,{...o,formGroupName:n,selectedCountryCode:l.countryIsoCode,primaryPhoneNumber:n==="phoneField1"}})}function G8(t){let r={},l=fe(t.phoneConfiguration);return t.fields.forEach(i=>{let o=i.masterApplyFields.fieldNameForApply;if(!o||o==="uploadResume")return;if(i.fieldType==="phone"){let h=u7("phoneNoWithoutCountryCode",t.parsedResume),v=u7("countryCode",t.parsedResume)||l.countryIsoCode;r[i.formGroupName||"phoneField1"]={phoneType:"Mobile",phoneNumField:h?{nationalNumber:$6(h),dialCode:P5(v),number:$6(h),e164Number:String(u7("phoneNo",t.parsedResume)||Me(v,h))}:null,whatsAppEnabled:l.whatsAppEnabled};return}if(i.fieldType==="checkbox"||o2(i)){r[o]=!1;return}if(i.fieldType==="T"&&o==="subSource"&&!t.parsedResume){r[o]=t.userName;return}let n=u7(o,t.parsedResume);r[o]=n}),r}function qv(t,r){let l=t.filter(i=>o2(i)).map(i=>{let o=Rv(i);return[i.masterApplyFields.fieldNameForApply,!!r[o]]}).filter(([i])=>!!i);return Object.fromEntries(l)}function W8(t,r){let l=new Map,i={};return t.filter(o=>o.fieldType==="phone").forEach(o=>{let n=Rv(o),h=r[n],v=He(h);if(!v)return;let u=Me(h?.phoneNumField?.dialCode,v);if(l.has(u)){i[n]="Duplicate phone numbers are not allowed";let s=l.get(u);s&&!i[s]&&(i[s]="Duplicate phone numbers are not allowed");return}l.set(u,n)}),i}function Kv(t,r){let l={...t};return r.forEach(i=>{l[i]=Gf(l[i])}),l}function Yv(t){let{profileSources:r,selectedSourceOfProfile:l,selectedProfileSource:i,freeTextSubSource:o}=t,n=o?.trim()||"";if(!l&&!i)return n;let h=r.find(u=>(u.sourceOfProfile||"")===(l||"")&&u.profileSource===i);if(!l)return i||n;let v=`${l}-${i||h?.profileSource||""}`;return n?`${v}-${n}`:v}function Xv(t,r){return t.filter(l=>l.fieldType==="phone").map(l=>({field:l,phoneValue:r[l.formGroupName||"phoneField1"]})).filter(l=>!!l.phoneValue?.phoneNumField).map(({field:l,phoneValue:i})=>{let o=P5(i.phoneNumField?.dialCode),n=$6(i.phoneNumField?.nationalNumber||i.phoneNumField?.number);return{phoneType:i.phoneType,associatedEntityType:"CANDIDATE",primary:!!l.primaryPhoneNumber,whatsappEnabled:i.whatsAppEnabled,countryCode:o,number:n}})}function Qv(t){let r={...t.values},l=t.parsedResume?.reponseObject?.jobApplication||{};t.fields.filter(s=>s.fieldType==="phone").map(s=>s.formGroupName||"phoneField1").forEach(s=>{delete r[s]});let o=t.fields.find(s=>s.fieldType==="phone"&&s.primaryPhoneNumber),n=o?t.values[o.formGroupName||"phoneField1"]:void 0,h={...l,...r,subSource:t.subSourceValue,companyId:t.context.job.companyId,jobId:t.context.job.id,fileName:t.file?.name||""};n?.phoneNumField&&(h.phoneNo=n.phoneNumField.e164Number||Me(n.phoneNumField.dialCode,n.phoneNumField.nationalNumber),h.phoneNoWithoutCountryCode=$6(n.phoneNumField.number??n.phoneNumField.nationalNumber),h.countryCode=P5(n.phoneNumField.dialCode));let v={data:JSON.stringify(h),referrerEmailId:t.context.user.email,referrerId:t.context.user.id,sendNotification:t.sendNotification?"Yes":"No",profile:"{}"},u=new FormData;return u.append("addProfileReqBody",JSON.stringify(v)),t.file&&u.append("file",t.file),u.append("parsedResultId",String(t.parsedResume?.reponseObject?.parsedObjectId||"")),u.append("isAsync","false"),t.contactInformation&&t.contactInformation.length>0&&u.append("contactInformation",JSON.stringify(t.contactInformation)),t.consent&&Object.keys(t.consent).length>0&&u.append("consent",JSON.stringify(t.consent)),u}async function Jv(t,r){let l=await t.loadInitialData(r),i=jv(l.applyFields,l.phoneConfiguration),o=G8({fields:i,userName:r.user.name,phoneConfiguration:l.phoneConfiguration});return{initialization:l,fields:i,values:o}}function tg(t){return G8({fields:t.fields,parsedResume:t.parsedResume,userName:t.context.user.name,phoneConfiguration:t.initialization.phoneConfiguration})}async function ag(t){let r=t.fields.filter(v=>v.fieldType==="date").map(v=>v.masterApplyFields.fieldNameForApply),l=Kv(t.values,r),i=Xv(t.fields,l),o=qv(t.fields,l),n=Yv({profileSources:t.profileSources,selectedSourceOfProfile:t.selectedSourceOfProfile,selectedProfileSource:t.selectedProfileSource,freeTextSubSource:t.subSourceText}),h=Qv({fields:t.fields,context:t.context,file:t.file,values:l,parsedResume:t.parsedResume,contactInformation:i,consent:Object.keys(o).length>0?o:t.consent,sendNotification:t.sendNotification,subSourceValue:n});return t.api.submitProfile(h,t.context)}var I1=E(k(),1);function j8(t){return t.formGroupName||t.masterApplyFields.fieldNameForApply}function rg(t,r){return t.find(l=>j8(l)===r||l.masterApplyFields.fieldNameForApply===r)}function Ae(t,r,l){let i={};return t.forEach(o=>{let n=j8(o);if(!n)return;let h=U8(o,l[n],r,l);h&&(i[n]=h)}),Object.assign(i,W8(t,l)),i}function Yf(t,r,l,i){let o={...i},n=rg(r,t);if(!n?.dependentFieldsName)return o;let h=j2(n.dependentFieldsName);return[...new Set(h)].forEach(u=>{let s=r.find(M=>M.masterApplyFields.fieldNameForApply===u);if(!s)return;let p=j8(s);if(!n2(u,r,l)){delete o[p];return}let A=U8(s,l[p],r,l);A?o[p]=A:delete o[p]}),o}function lg(t){let[r,l]=(0,I1.useState)(null),[i,o]=(0,I1.useState)([]),[n,h]=(0,I1.useState)({}),[v,u]=(0,I1.useState)(null),[s,p]=(0,I1.useState)(null),[A,M]=(0,I1.useState)(null),[H,m]=(0,I1.useState)(!1),[L,w]=(0,I1.useState)(!1),[Z,V]=(0,I1.useState)(!1),[x,z]=(0,I1.useState)({}),[B,P]=(0,I1.useState)(!1),[$,S]=(0,I1.useState)(""),[O,y]=(0,I1.useState)(""),[F,U]=(0,I1.useState)(""),[q,G]=(0,I1.useState)(!0);(0,I1.useEffect)(()=>{if(!t.open)return;let Y=!1;return m(!0),M(null),p(null),u(null),z({}),P(!1),Jv(t.api,t.context).then(o1=>{Y||(l(o1.initialization),o(o1.fields),h(o1.values),U(o1.initialization.profileSources?.length?"":t.context.user.name))}).finally(()=>{Y||m(!1)}),()=>{Y=!0}},[t.api,t.context,t.open]);let I=(0,I1.useMemo)(()=>i.filter(Y=>{let o1=Y.masterApplyFields.fieldNameForApply;return o1&&o1!=="uploadResume"&&!o2(Y)&&n2(o1,i,n)}),[i,n]),J=(0,I1.useMemo)(()=>i.filter(Y=>Y.fieldType==="phone"),[i]),A1=!!(r&&J.length<r.phoneConfiguration.maxCount),X=r?.resumeOptional===!0,T=!!(!!(s||X&&A==="manual")&&!H&&!L&&!Z);(0,I1.useEffect)(()=>{let Y=new Set(I.map(o1=>j8(o1)).filter(Boolean));z(o1=>{let e1={};return Object.entries(o1).forEach(([l0,e0])=>{(l0==="file"||Y.has(l0))&&(e1[l0]=e0)}),B?{...e1,...Ae(I,i,n)}:e1})},[i,n,B,I]);function W(Y,o1){let e1={...n,[Y]:o1};if(Y==="dateOfBirth"){let C1=p7(String(o1));C1!=null&&"agee"in e1&&(e1.agee=C1)}h(e1),z(C1=>{let l0={...C1};delete l0[Y];let e0=Yf(Y,i,e1,l0);if(!B)return e0;let M0=new Set(i.filter(f0=>{let q2=f0.masterApplyFields.fieldNameForApply;return q2&&q2!=="uploadResume"&&!o2(f0)&&n2(q2,i,e1)}).map(f0=>j8(f0)));return Object.keys(e0).forEach(f0=>{f0!=="file"&&!M0.has(f0)&&delete e0[f0]}),{...e0,...Ae(i.filter(f0=>{let q2=f0.masterApplyFields.fieldNameForApply;return q2&&q2!=="uploadResume"&&!o2(f0)&&n2(q2,i,e1)}),i,e1)}})}function D(Y){let o1=rg(i,Y);if(!o1)return;let e1={...n},C1=j8(o1);if(!n2(o1.masterApplyFields.fieldNameForApply,i,e1)){z(e0=>{let M0={...e0};return delete M0[C1],M0});return}let l0=U8(o1,e1[C1],i,e1);z(e0=>{let M0={...e0};return l0?M0[C1]=l0:delete M0[C1],Object.assign(M0,W8(I,e1)),M0})}function R(){if(p(null),u(null),M(null),z(Y=>{let o1={...Y};return delete o1.file,o1}),!r){h({});return}h(G8({fields:i,userName:t.context.user.name,phoneConfiguration:r.phoneConfiguration}))}function c1(){r?.resumeOptional===!0&&(M("manual"),p(null),u(null),P(!1),z(Y=>{let o1={...Y};return delete o1.file,o1}),r&&h(G8({fields:i,userName:t.context.user.name,phoneConfiguration:r.phoneConfiguration})))}async function Z1(Y){if(!r)return;let o1=Gv(Y,r.supportedFiles.addProfile);if(!o1.isValid){z(e1=>({...e1,file:o1.reason||"Unsupported file"}));return}M("resume"),p(Y),w(!0),z(e1=>{let C1={...e1};return delete C1.file,C1});try{let e1=await t.api.parseResume(Y,t.context),C1=e1?.responseStatus,l0=e1?.responseCode;if(C1==="FAILURE"||typeof l0=="number"&&l0!==200){let f0=e1?.reponseObject?.errorMessage||"Failed to process the file. Please try again.";p(null),M(null),u(null),z(q2=>({...q2,file:f0}));return}let M0=tg({fields:i,context:t.context,parsedResume:e1,initialization:r});return u(e1),h(f0=>({...f0,...M0})),{isSuccess:!0}}catch{u(null),p(null),M(null),z(e1=>({...e1,file:"Failed to process the file. Please try again."}))}finally{w(!1)}}async function j(){if(!r)return null;if(!(r.resumeOptional===!0&&A==="manual")&&!s)return z(e1=>({...e1,file:"Please upload a resume before submitting"})),null;P(!0);let o1=Ae(I,i,n);if(Object.keys(o1).length>0)return z(e1=>({...e1,...o1})),null;V(!0);try{return await ag({api:t.api,context:t.context,fields:i,values:n,file:s,parsedResume:v,sendNotification:q,profileSources:r.profileSources,selectedSourceOfProfile:$||void 0,selectedProfileSource:O||void 0,subSourceText:F})}finally{V(!1)}}function m1(){return I}function Q(Y,o1){let e1=Array.isArray(Y.fieldOptions)?Y.fieldOptions.map(C1=>C1.value):String(Y.fieldOptions||"").split(",").map(C1=>C1.trim()).filter(Boolean);return H7(e1,o1)}function r0(Y){if(!r||!A1)return;let o1=J.reduce((C1,l0)=>{let e0=l0.formGroupName?.match(/^phoneField(\d+)$/),M0=e0?Number(e0[1]):1;return Math.max(C1,M0)},1)+1,e1={...Y,recruiterUploads:"Non Mandatory",primaryPhoneNumber:!1,formGroupName:`phoneField${o1}`,selectedCountryCode:r.phoneConfiguration.countryIsoCode};o(C1=>{let l0=C1.findIndex(M0=>M0.formGroupName===Y.formGroupName);if(l0===-1)return[...C1,e1];let e0=[...C1];return e0.splice(l0+1,0,e1),e0}),h(C1=>({...C1,[e1.formGroupName||`phoneField${o1}`]:Wv(r.phoneConfiguration)}))}function m7(Y){Y.primaryPhoneNumber||!Y.formGroupName||(o(o1=>o1.filter(e1=>e1.formGroupName!==Y.formGroupName)),h(o1=>{let e1={...o1};return delete e1[Y.formGroupName],e1}))}return{initialization:r,fields:i,formValues:n,parsedResume:v,selectedFile:s,creationMode:A,isInitializing:H,isParsing:L,isSubmitting:Z,errors:x,sourceOfProfile:$,profileSource:O,subSourceText:F,sendNotification:q,canSubmit:T,setFieldValue:W,validateField:D,setSourceOfProfile:S,setProfileSource:y,setSubSourceText:U,setSendNotification:G,clearSelectedFile:R,startManualEntry:c1,uploadFile:Z1,submit:j,getVisibleFields:m1,getDropdownOptions:Q,addPhoneField:r0,removePhoneField:m7,canAddMorePhoneFields:A1,phoneFieldCount:J.length}}var sg=E(ra(),1),eg=["in","us"];function q8(){return(0,C.jsx)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:(0,C.jsx)("path",{d:"M6 6l12 12M18 6L6 18",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}function ig(){return(0,C.jsx)(bv,{"aria-hidden":"true"})}function Xf(){return(0,C.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,C.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:"currentColor",strokeWidth:"1.8"}),(0,C.jsx)("path",{d:"M12 10.2v5.2",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),(0,C.jsx)("circle",{cx:"12",cy:"7.4",r:"1.1",fill:"currentColor"})]})}function Qf(){return(0,C.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,C.jsx)("path",{d:"M12 21s-6-5.1-6-11a6 6 0 1112 0c0 5.9-6 11-6 11z",fill:"none",stroke:"currentColor",strokeWidth:"2"}),(0,C.jsx)("circle",{cx:"12",cy:"10",r:"2.5",fill:"currentColor"})]})}function Jf(){return(0,C.jsx)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:(0,C.jsx)("path",{d:"M7 3v3m10-3v3M4 9h16M6 5h12a1 1 0 011 1v13a1 1 0 01-1 1H6a1 1 0 01-1-1V6a1 1 0 011-1z",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})}function cg(){return(0,C.jsx)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:(0,C.jsx)("path",{d:"M12 5v14M5 12h14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}function tA(){return(0,C.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,C.jsx)("path",{d:"M6 12h12",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round"}),(0,C.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:"currentColor",strokeWidth:"1.8"})]})}function aA({onAdd:t,onRemove:r}){let[l,i]=(0,s1.useState)(!1),o=(0,s1.useRef)(null);return(0,s1.useEffect)(()=>{if(!l)return;function n(h){o.current&&!o.current.contains(h.target)&&i(!1)}return document.addEventListener("pointerdown",n),()=>document.removeEventListener("pointerdown",n)},[l]),(0,C.jsxs)("div",{ref:o,className:"rae-phone-menu",children:[(0,C.jsx)("button",{type:"button",className:"rae-phone-action rae-phone-action--edit","aria-label":"Phone options",onClick:()=>i(n=>!n),children:(0,C.jsx)(Ov,{"aria-hidden":!0})}),l?(0,C.jsxs)("div",{className:"rae-phone-menu__dropdown",children:[(0,C.jsx)("button",{type:"button",className:"rae-phone-menu__item",onClick:()=>{t(),i(!1)},children:"Add another"}),(0,C.jsx)("button",{type:"button",className:"rae-phone-menu__item rae-phone-menu__item--remove",onClick:()=>{r(),i(!1)},children:"Remove"})]}):null]})}function Le(){return(0,C.jsx)("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:(0,C.jsx)("path",{d:"M5 10.5l3 3 7-7",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function rA(){return(0,C.jsx)("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:(0,C.jsx)("path",{d:"M8.5 14a5.5 5.5 0 114.1-1.83L16 15.58 14.58 17l-3.4-3.4A5.47 5.47 0 018.5 14zm0-2a3.5 3.5 0 100-7 3.5 3.5 0 000 7z",fill:"currentColor"})})}function K8(){return(0,C.jsx)("span",{className:"rae-spinner","aria-hidden":"true"})}function hg(t,r=".rae-select-options",l=12){t instanceof HTMLElement&&window.requestAnimationFrame(()=>{let i=t.closest(".rae-modal__body--expanded")||t.closest(".rae-modal__body"),o=t.querySelector(r);if(!(i instanceof HTMLElement)||!(o instanceof HTMLElement))return;let n=i.getBoundingClientRect(),h=o.getBoundingClientRect(),v=h.bottom-(n.bottom-l),u=n.top+l-h.top;if(v>0){i.scrollTop+=v;return}u>0&&(i.scrollTop-=u)})}function lA(t){let r=t.minYearOfExperience,l=t.maxYearOfExperience;return!r&&!l?"Not Specified":r&&l?`${r} - ${l} Years`:r?`${r}+ Years`:`Up to ${l} Years`}var dg=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function vg(t){if(!t)return"";if(t instanceof Date&&!Number.isNaN(t.getTime())){let n=t.getFullYear(),h=String(t.getMonth()+1).padStart(2,"0"),v=String(t.getDate()).padStart(2,"0");return`${n}-${h}-${v}`}let r=String(t).trim(),l=r.match(/^(\d{4})-(\d{2})-(\d{2})/);if(l)return`${l[1]}-${l[2]}-${l[3]}`;let i=r.match(/^(\d{1,2})\s+([A-Za-z]{3,})\s+(\d{4})$/);if(i){let n=dg.findIndex(h=>h.toLowerCase()===i[2].slice(0,3).toLowerCase());if(n>=0)return`${i[3]}-${String(n+1).padStart(2,"0")}-${String(Number(i[1])).padStart(2,"0")}`}let o=new Date(r);if(!Number.isNaN(o.getTime())){let n=o.getFullYear(),h=String(o.getMonth()+1).padStart(2,"0"),v=String(o.getDate()).padStart(2,"0");return`${n}-${h}-${v}`}return""}function eA(t){let r=vg(t);if(!r)return"";let[l,i,o]=r.split("-");return`${o} ${dg[Number(i)-1]} ${l}`}function b5(t){return t.formGroupName||t.masterApplyFields.fieldNameForApply}function Ze(t){return String(t||"").replace(/\D+/g,"")}function M7(t){let r=Ze(t);return r?`+${r}`:""}function iA(t){let r=t||{},l=r.code??r.responseCode,i=typeof l=="number"?l:void 0,o=typeof r.message=="string"&&r.message||typeof r.errorMessage=="string"&&r.errorMessage||"Something went wrong, Please try again!";return i===void 0||i===200?{isSuccess:!0,toast:{kind:"success",message:typeof r.message=="string"&&r.message?r.message:"Profile Added Successfully"}}:i===403||i===500?{isSuccess:!1,toast:{kind:"warning",message:o}}:{isSuccess:!1,toast:{kind:"error",message:o}}}function oA(t){t instanceof HTMLElement&&window.setTimeout(()=>{let r=t.querySelector(".rae-field-error");if(!(r instanceof HTMLElement))return;let l=r.closest(".rae-field")||r;if(!(l instanceof HTMLElement))return;let i=t.querySelector(".rae-modal__body--expanded")||t.querySelector(".rae-modal__body");if(i instanceof HTMLElement){let n=l.getBoundingClientRect(),h=i.getBoundingClientRect(),v=n.top-h.top+i.scrollTop-80;i.scrollTo({top:Math.max(0,v),behavior:"smooth"})}else l.scrollIntoView({behavior:"smooth",block:"center"});let o=l.querySelector("input, button, textarea, [role='combobox'], [role='button']");o instanceof HTMLElement&&o.focus({preventScroll:!0})},100)}function nA(t){let[r,l]=(0,s1.useState)(""),i=T6(t.selectedDialCode)||b6(t.selectedIso2)||b6("IN")||k8[0],o=s1.default.useMemo(()=>{let n=r.trim().toLowerCase(),h=s=>n?s.name.toLowerCase().includes(n)||s.iso2.toLowerCase().includes(n)||`+${s.dialCode}`.includes(n):!0,v=k8.filter(s=>eg.includes(s.iso2.toLowerCase())&&h(s)),u=k8.filter(s=>!eg.includes(s.iso2.toLowerCase())&&h(s));return[...v,...u]},[r]);return(0,C.jsxs)(lv,{value:i,onChange:n=>{n&&t.onSelect(n),l("")},immediate:!0,children:[(0,C.jsx)("input",{type:"hidden",name:t.name||"countryCode",value:i?.iso2||""}),(0,C.jsxs)("div",{className:"rae-country-select",children:[(0,C.jsxs)("div",{className:"rae-country-select__trigger-shell",children:[(0,C.jsx)("span",{className:"rae-country-select__flag","aria-hidden":"true",children:se(i?.iso2)}),(0,C.jsx)(Kl,{className:"rae-country-select__trigger",displayValue:()=>i?B5(i):"+91",onChange:n=>l(n.target.value),autoComplete:"off",placeholder:"+91","aria-label":"Search country code"}),(0,C.jsx)(ql,{className:"rae-country-select__button",children:(0,C.jsx)("span",{className:"rae-country-select__arrow","aria-hidden":"true",children:"\u25BE"})})]}),(0,C.jsx)(Yl,{className:"rae-country-select__menu",children:(0,C.jsx)("div",{className:"rae-country-select__list",role:"listbox","aria-label":"Country code options",children:o.map(n=>(0,C.jsxs)(Xl,{value:n,className:"rae-country-select__option",children:[(0,C.jsx)("span",{className:"rae-country-select__flag","aria-hidden":"true",children:se(n.iso2)}),(0,C.jsx)("span",{className:"rae-country-select__option-code",children:B5(n)}),(0,C.jsx)("span",{className:"rae-country-select__name",children:n.name})]},`${n.iso2}-${n.dialCode}-${n.priority??0}`))})})]})]})}function a6(t){return(0,C.jsx)(le,{id:t.id,name:t.name,className:`rae-field-input${t.className?` ${t.className}`:""}`,type:t.type||"text",value:t.value,placeholder:t.placeholder||"",onChange:t.onChange,onBlur:t.onBlur,"aria-invalid":t.invalid||void 0,autoComplete:t.autoComplete,inputMode:t.inputMode,readOnly:t.readOnly})}function gg(){return(0,C.jsx)("svg",{"aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,C.jsx)("polyline",{points:"6 9 12 15 18 9"})})}function y5(t){let r=t.options.find(n=>n.value===t.value),l=(0,s1.useRef)(null),i=t.id==="rae-source-of-profile"||t.id==="rae-profile-source"||t.id==="rae-sub-source-select"||t.id==="rae-profile-source-fallback",o=`rae-select-shell${t.shellClassName?` ${t.shellClassName}`:""}${i?" rae-footer-select":""}`;return(0,C.jsxs)(Bv,{value:t.value||"",onChange:n=>{t.onChange({target:{value:n}})},children:[(0,C.jsx)("input",{type:"hidden",id:t.id,name:t.name,value:t.value||""}),(0,C.jsxs)("div",{ref:l,className:o,children:[(0,C.jsxs)(ce,{className:`rae-field-input rae-field-input--button rae-select-button${t.invalid?" rae-field-input--invalid":""}`,onClick:()=>{hg(l.current)},onBlur:t.onBlur,children:[(0,C.jsx)("span",{className:`rae-select-button__text${r?"":" rae-select-button__text--placeholder"}`,children:r?.label||t.placeholder||"Select an option"}),(0,C.jsx)("span",{className:"rae-select-arrow","aria-hidden":"true",children:(0,C.jsx)(gg,{})})]}),(0,C.jsx)(he,{className:"rae-select-options",children:t.options.map(n=>(0,C.jsxs)(de,{value:n.value,className:"rae-select-option",children:[(0,C.jsx)("span",{className:"rae-select-option__label",children:n.label}),(0,C.jsx)("span",{className:"rae-select-option__check",children:(0,C.jsx)(Le,{})})]},n.value))})]})]})}function cA(t){let[r,l]=(0,s1.useState)(""),[i,o]=(0,s1.useState)(!1),[n,h]=(0,s1.useState)(-1),v=(0,s1.useRef)(null),u=(0,s1.useRef)(null),s=H=>{H.stopPropagation()},p=t.options.find(H=>H.value===t.value)||null,A=s1.default.useMemo(()=>{let H=r.trim().toLowerCase();return H?t.options.filter(m=>m.label.toLowerCase().includes(H)):t.options},[t.options,r]);(0,s1.useEffect)(()=>{if(!i)return;let H=m=>{v.current?.contains(m.target)||(o(!1),l(""),t.onBlur?.())};return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[i]),(0,s1.useEffect)(()=>{i&&(window.requestAnimationFrame(()=>u.current?.focus()),hg(v.current))},[i]),(0,s1.useEffect)(()=>{if(!i||!A.length){h(-1);return}let H=A.findIndex(m=>m.value===t.value);h(H>=0?H:0)},[A,i,t.value]);let M=H=>{t.onChange({target:{value:H.value}}),o(!1),l("")};return(0,C.jsxs)("div",{ref:v,className:`rae-select-shell rae-searchable-select${i?" rae-select-shell--open":""}${t.shellClassName?` ${t.shellClassName}`:""}`,onBlur:H=>{H.currentTarget.contains(H.relatedTarget)||t.onBlur?.()},children:[(0,C.jsx)("input",{type:"hidden",id:t.id,name:t.name,value:t.value||""}),(0,C.jsxs)("button",{type:"button",className:`rae-field-input rae-field-input--button rae-select-button${t.invalid?" rae-field-input--invalid":""}`,onClick:()=>{o(H=>!H),i&&l("")},"aria-haspopup":"listbox","aria-expanded":i,children:[(0,C.jsx)("span",{className:`rae-select-button__text${p?"":" rae-select-button__text--placeholder"}`,children:p?.label||t.placeholder||"Select an option"}),(0,C.jsx)("span",{className:"rae-select-arrow","aria-hidden":"true",children:(0,C.jsx)(gg,{})})]}),i?(0,C.jsxs)("div",{className:"rae-select-options rae-searchable-options",role:"listbox",onMouseDown:s,onPointerDown:s,onClick:s,onWheel:s,children:[(0,C.jsx)("div",{className:"rae-searchable-options__search",children:(0,C.jsxs)("div",{className:"rae-searchable-options__search-box",children:[(0,C.jsx)(rA,{}),(0,C.jsx)("input",{ref:u,className:"rae-searchable-options__input",value:r,onChange:H=>l(H.target.value),placeholder:"Search...",autoComplete:"off","aria-label":`Search ${t.placeholder||"options"}`,onMouseDown:s,onPointerDown:s,onClick:s,onKeyDown:H=>{if(H.key==="ArrowDown"){H.preventDefault(),h(m=>A.length?Math.min(m+1,A.length-1):-1);return}if(H.key==="ArrowUp"){H.preventDefault(),h(m=>A.length?Math.max(m-1,0):-1);return}if(H.key==="Enter"&&n>=0&&A[n]){H.preventDefault(),M(A[n]);return}H.key==="Escape"&&(o(!1),l(""),t.onBlur?.())}})]})}),(0,C.jsx)("div",{className:"rae-searchable-options__list",children:A.length?A.map((H,m)=>(0,C.jsxs)("button",{type:"button",role:"option","aria-selected":H.value===t.value,className:`rae-select-option${H.value===t.value?" rae-select-option--selected":""}${n===m?" rae-select-option--active":""}`,onMouseEnter:()=>h(m),onMouseDown:L=>{L.preventDefault(),L.stopPropagation()},onPointerDown:s,onClick:L=>{L.stopPropagation(),M(H)},children:[(0,C.jsx)("span",{className:"rae-select-option__label",children:H.label}),H.value===t.value?(0,C.jsx)("span",{className:"rae-select-option__check",children:(0,C.jsx)(Le,{})}):null]},H.value)):(0,C.jsx)("div",{className:"rae-select-option rae-select-option--empty",children:"No results found."})})]}):null]})}function xe(t){return(0,C.jsxs)("label",{className:t.className||"rae-checkbox-field",children:[(0,C.jsx)("input",{type:"hidden",name:t.name,value:t.checked?"true":"false"}),(0,C.jsxs)(Kc,{checked:t.checked,onChange:r=>t.onChange({target:{checked:r}}),className:"rae-headless-checkbox",children:[(0,C.jsx)("span",{className:"rae-headless-checkbox__bg"}),(0,C.jsx)("span",{className:"rae-headless-checkbox__icon",children:(0,C.jsx)(Le,{})})]}),(0,C.jsx)("span",{children:t.label})]})}function hA({field:t,value:r,error:l,inputId:i,inputName:o,onBlur:n,onLocationInput:h,onLocationSuggestionSelect:v,onLocationBlur:u,locationSuggestions:s,isLoadingLocationSuggestions:p,readOnly:A}){let M=(0,s1.useRef)(null),[H,m]=(0,s1.useState)(null);return(0,s1.useEffect)(()=>{if(!s||s.length===0){m(null);return}let L=M.current?.querySelector("input");if(!L)return;let w=L.getBoundingClientRect();m({position:"fixed",top:`${w.bottom+4}px`,left:`${w.left}px`,width:`${w.width}px`,zIndex:99999})},[s]),(0,s1.useEffect)(()=>{M.current&&(M.current.__raeOnSuggestionSelect=v)}),(0,C.jsxs)("div",{ref:M,className:"rae-location-field rae-location-shell",onBlur:L=>{L.currentTarget.contains(L.relatedTarget)||u?.()},children:[(0,C.jsx)(a6,{id:i,name:o,value:typeof r=="string"||typeof r=="number"?String(r):"",placeholder:t.placeholder||"",invalid:!!l,onChange:L=>h?.(L.target.value),onBlur:n,autoComplete:"off",readOnly:A}),p?(0,C.jsx)("div",{className:"rae-location-status",children:"Fetching locations..."}):null,s&&s.length>0?(0,C.jsx)("div",{className:"rae-location-suggestions",role:"listbox","aria-label":`${t.recruiterUploadsLabel} suggestions`,style:H||{},children:s.map(L=>(0,C.jsx)("button",{type:"button",className:"rae-location-suggestion","data-suggestion":L,onMouseDown:w=>{w.preventDefault(),v?.(L)},children:L},L))}):null]})}function ze(t){let{field:r,value:l,error:i,inputId:o,inputName:n,onChange:h,onBlur:v,getDropdownOptions:u,onAddPhoneField:s,onRemovePhoneField:p,canAddMorePhoneFields:A,phoneFieldCount:M,locationSuggestions:H,isLoadingLocationSuggestions:m,onLocationInput:L,onLocationSuggestionSelect:w,onLocationBlur:Z,readOnly:V}=t,x=r.fieldType;if(x==="checkbox")return(0,C.jsx)(xe,{id:o,name:n,checked:!!l,onChange:z=>h(z.target.checked),label:r.recruiterUploadsLabel});if(x==="D")return(0,C.jsx)(cA,{id:o,name:n,value:String(l??""),placeholder:r.placeholder||"Select an option",invalid:!!i,onChange:z=>h(z.target.value),onBlur:v,options:u(r,"").map(z=>({label:z,value:z}))});if(x==="date"){let z=vg(l);return(0,C.jsxs)("label",{className:"rae-date-shell",children:[(0,C.jsx)(le,{id:o,name:`${n}-display`,className:"rae-field-input rae-field-input--date",type:"text",value:eA(l),placeholder:"",readOnly:!0,onBlur:v,onClick:B=>{let P=B.currentTarget.parentElement?.querySelector("input[type='date']");P instanceof HTMLInputElement&&(P.showPicker?.(),P.focus())},"aria-invalid":i||void 0}),(0,C.jsx)("input",{className:"rae-native-date-input",type:"date",value:z,onChange:B=>h(B.target.value),onBlur:v,"aria-label":`Select ${r.recruiterUploadsLabel}`,tabIndex:-1}),(0,C.jsx)("button",{type:"button",className:"rae-date-trigger",onClick:B=>{let P=B.currentTarget.parentElement?.querySelector("input[type='date']");P instanceof HTMLInputElement&&(P.showPicker?.(),P.focus())},"aria-label":`Select ${r.recruiterUploadsLabel}`,children:(0,C.jsx)(Jf,{})})]})}if(x==="phone"){let z=l||{phoneType:"Mobile",phoneNumField:null,whatsAppEnabled:!1},B=T6(z.phoneNumField?.dialCode)||b6(r.selectedCountryCode)||b6("IN"),P=B?M7(B5(B)):"+91",$=Ze(z.phoneNumField?.nationalNumber||"");return(0,C.jsxs)("div",{className:"rae-phone-stack",children:[(0,C.jsxs)("div",{className:"rae-phone-row",children:[(0,C.jsx)(y5,{id:`${o}-type`,name:`${n}-type`,shellClassName:"rae-phone-type",value:z.phoneType,onChange:S=>h({...z,phoneType:S.target.value}),options:[{label:"Mobile",value:"Mobile"},{label:"Home",value:"Home"},{label:"Work",value:"Work"},{label:"Other",value:"Other"}]}),(0,C.jsxs)("div",{className:"rae-phone-number-shell",children:[(0,C.jsx)(nA,{name:`${n}-country`,selectedIso2:r.selectedCountryCode,selectedDialCode:z.phoneNumField?.dialCode,onSelect:S=>{let O=M7(B5(S));h({...z,phoneNumField:{...z.phoneNumField,dialCode:O,nationalNumber:$,number:$,e164Number:`${O}${$}`}})}}),(0,C.jsx)(a6,{id:`${o}-number`,name:`${n}-number`,value:$,placeholder:"Phone number",inputMode:"tel",invalid:!!i,onChange:S=>{let O=Ze(S.target.value);h({...z,phoneNumField:{...z.phoneNumField,nationalNumber:O,number:O,dialCode:M7(z.phoneNumField?.dialCode||P),e164Number:`${M7(z.phoneNumField?.dialCode||P)}${O}`}})}})]}),r.primaryPhoneNumber?M===1?(0,C.jsx)("button",{type:"button",className:"rae-phone-action rae-phone-action--add","aria-label":"Add phone field",onClick:()=>s?.(r),children:(0,C.jsx)(cg,{})}):null:A?(0,C.jsx)(aA,{onAdd:()=>s?.(r),onRemove:()=>p?.(r)}):(0,C.jsx)("button",{type:"button",className:"rae-phone-action rae-phone-action--remove","aria-label":"Remove phone field",onClick:()=>p?.(r),children:(0,C.jsx)(tA,{})})]}),(0,C.jsx)(xe,{id:`${o}-whatsapp`,name:`${n}-whatsapp`,className:"rae-checkbox-field rae-checkbox-field--inline",checked:!!z.whatsAppEnabled,onChange:S=>h({...z,whatsAppEnabled:S.target.checked}),label:"This number is WhatsApp enabled"})]})}return x==="location"?(0,C.jsx)(hA,{field:r,value:l,error:i,inputId:o,inputName:n,onBlur:v,onLocationInput:L,onLocationSuggestionSelect:w,onLocationBlur:Z,locationSuggestions:H,isLoadingLocationSuggestions:m,readOnly:V}):(0,C.jsx)(a6,{id:o,name:n,type:x==="email"?"email":"text",value:typeof l=="string"||typeof l=="number"?String(l):"",placeholder:r.placeholder||"",invalid:!!i,onChange:z=>h(z.target.value),onBlur:v,readOnly:V})}function ug(t){let r=lg({open:t.open,api:t.api,context:t.context}),l=(0,s1.useId)(),i=(0,s1.useRef)(null),[o,n]=(0,s1.useState)(null),[h,v]=(0,s1.useState)({}),[u,s]=(0,s1.useState)({}),[p,A]=(0,s1.useState)(""),[M,H]=(0,s1.useState)({}),m=(0,s1.useRef)({}),L=(0,s1.useRef)({});if((0,s1.useEffect)(()=>{if(!o)return;let T=window.setTimeout(()=>{n(null)},4500);return()=>{window.clearTimeout(T)}},[o]),(0,s1.useEffect)(()=>()=>{Object.values(L.current).forEach(T=>{window.clearTimeout(T)})},[]),(0,s1.useEffect)(()=>{H(T=>{let W={...T};return r.fields.forEach(D=>{let R=b5(D);if(!R||!D.masterApplyFields.maskable)return;let c1=r.formValues[R];if(!(c1!=null&&String(c1).trim()!=="")){W[R]=!1;return}(W[R]===void 0||r.parsedResume)&&(W[R]=!0)}),W})},[r.fields,r.formValues,r.parsedResume]),!t.open)return null;let w=[...r.getVisibleFields().filter(T=>T.fieldType!=="checkbox"),...r.getVisibleFields().filter(T=>T.fieldType==="checkbox")],Z=r.initialization?.supportedFiles.addProfile,V=r.initialization?.resumeOptional===!0,x=!!((r.selectedFile||V&&r.creationMode==="manual")&&!r.isParsing),z=!!(V&&!r.selectedFile&&r.creationMode!=="manual"),B=!V&&!r.selectedFile,P=r.initialization?.profileSources||[],$=[...new Set(P.map(T=>T.sourceOfProfile).filter(Boolean))],S=!!$[0],O=S?r.sourceOfProfile?P.filter(T=>T.sourceOfProfile===r.sourceOfProfile):[]:P,y=S?P.find(T=>T.sourceOfProfile===r.sourceOfProfile&&T.profileSource===r.profileSource):P.find(T=>T.profileSource===r.profileSource),F=j2(y?.subSourceValues),U=!!(S&&y?.sourceOfProfile&&y?.subSourceValues),q=!!(S&&y?.sourceOfProfile&&!y?.subSourceValues);function G(T){r.setSourceOfProfile(T),r.setProfileSource(""),r.setSubSourceText(""),A("")}function I(T){r.setProfileSource(T),A("");let W=S?P.find(D=>D.sourceOfProfile===r.sourceOfProfile&&D.profileSource===T):P.find(D=>D.profileSource===T);if(!W){r.setSubSourceText("");return}if(!S){r.setSubSourceText(W.profileSource||"");return}if(W.subSourceValues){r.setSubSourceText(t.context.user.name?.trim()||"");return}r.setSubSourceText(t.context.user.name?.trim()||"")}function J(T){A(T),r.setSubSourceText(T)}async function A1(){if(n(null),$.length>0){if(!r.sourceOfProfile){n({kind:"error",message:"Please select a Source Of Profile before submitting."});return}if(!r.profileSource){n({kind:"error",message:"Please select a Source Type before submitting."});return}if(U&&!p){n({kind:"error",message:"Please select a Sub Source before submitting."});return}if(q&&!r.subSourceText.trim()){n({kind:"error",message:"Please enter a Sub Source before submitting."});return}}else if(P.length>0){if(!r.profileSource){n({kind:"error",message:"Please select a Source Type before submitting."});return}}else if(!r.subSourceText.trim()){n({kind:"error",message:"Please enter a Sub Source before submitting."});return}try{let T=await r.submit();if(!T){oA(i.current);return}let W=iA(T);t.showSubmitToast!==!1&&n(W.toast),W.isSuccess&&t.onSuccess?.(T)}catch(T){let W=T instanceof Error&&T.message?T.message:"Something went wrong, Please try again!";t.showSubmitToast!==!1&&n({kind:"error",message:W})}}function X(T,W){if(r.setFieldValue(T,W),!t.api.getLocationSuggestions){v(D=>({...D,[T]:[]}));return}if(L.current[T]&&window.clearTimeout(L.current[T]),!W.trim()){v(D=>({...D,[T]:[]})),s(D=>({...D,[T]:!1}));return}L.current[T]=window.setTimeout(async()=>{let D=(m.current[T]||0)+1;m.current[T]=D,s(R=>({...R,[T]:!0}));try{let R=await t.api.getLocationSuggestions?.(W,t.context);if(m.current[T]!==D)return;v(c1=>({...c1,[T]:R||[]}))}catch{if(m.current[T]!==D)return;v(R=>({...R,[T]:[]}))}finally{m.current[T]===D&&s(R=>({...R,[T]:!1}))}},250)}function l1(T,W){r.setFieldValue(T,W),v(D=>({...D,[T]:[]})),s(D=>({...D,[T]:!1}))}return(0,C.jsxs)(o7,{open:t.open,onClose:()=>{},className:"rae-overlay",children:[(0,C.jsx)("div",{className:"rae-overlay__backdrop","aria-hidden":"true"}),(0,C.jsx)("div",{className:"rae-overlay__viewport",children:(0,C.jsxs)(L5,{ref:i,className:`rae-modal ${x?"rae-modal--expanded":"rae-modal--compact"}`,children:[o?(0,C.jsxs)("div",{className:`rae-toast rae-toast--${o.kind}`,role:"status","aria-live":"polite",children:[(0,C.jsx)("span",{children:o.message}),(0,C.jsx)("button",{type:"button",className:"rae-toast__close",onClick:()=>n(null),"aria-label":"Dismiss notification",children:(0,C.jsx)(q8,{})})]}):null,r.isInitializing?(0,C.jsx)("div",{className:"rae-loader-overlay","aria-live":"polite","aria-busy":"true",children:(0,C.jsx)(K8,{})}):null,r.isParsing?(0,C.jsxs)("div",{className:"rae-loader-overlay","aria-live":"polite","aria-busy":"true",children:[(0,C.jsx)(K8,{}),(0,C.jsx)("p",{className:"rae-loader-text",children:"Parsing resume and populating fields..."})]}):null,r.isSubmitting?(0,C.jsxs)("div",{className:"rae-loader-overlay","aria-live":"polite","aria-busy":"true",children:[(0,C.jsx)(K8,{}),(0,C.jsx)("p",{className:"rae-loader-text",children:"Submitting profile..."})]}):null,(0,C.jsxs)("div",{className:"rae-modal__header",children:[(0,C.jsx)(z5,{as:"div",className:"rae-modal__title",children:t.title||"Add Profile"}),(0,C.jsx)("button",{type:"button",className:"rae-icon-button",onClick:t.onClose,"aria-label":"Close add profile modal",children:(0,C.jsx)(q8,{})})]}),(0,C.jsxs)("div",{className:`rae-modal__body ${x?"rae-modal__body--expanded":"rae-modal__body--compact"}`,children:[(0,C.jsxs)("section",{className:"rae-section rae-section--job",children:[(0,C.jsxs)("div",{className:"rae-job-title",children:[t.context.job.jobTitle," ",(0,C.jsx)("span",{children:"|"})," ",t.context.job.jobCode]}),(0,C.jsxs)("div",{className:"rae-job-meta",children:[(0,C.jsxs)("div",{className:"rae-meta-pill",children:[(0,C.jsx)(Qf,{}),(0,C.jsx)("span",{children:t.context.job.location||"NA"})]}),(0,C.jsxs)("div",{className:"rae-meta-pill",children:[(0,C.jsx)($v,{"aria-hidden":"true"}),(0,C.jsx)("span",{children:lA(t.context.job)})]}),(0,C.jsxs)("div",{className:"rae-meta-pill",children:[(0,C.jsx)(yv,{"aria-hidden":"true"}),(0,C.jsx)("span",{children:t.context.job.departmentName||"All Departments"})]})]})]}),(0,C.jsxs)("section",{className:"rae-section rae-section--upload",children:[z?(0,C.jsxs)(s1.default.Fragment,{children:[(0,C.jsx)("div",{className:"rae-profile-method-question",children:"How would you like to create this profile?"}),(0,C.jsxs)("div",{className:"rae-profile-method-grid",children:[(0,C.jsxs)("label",{htmlFor:l,className:"rae-profile-method-card",children:[(0,C.jsx)("span",{className:"rae-profile-method-card__icon",children:(0,C.jsx)(ig,{})}),(0,C.jsxs)("span",{className:"rae-profile-method-card__content",children:[(0,C.jsx)("span",{className:"rae-profile-method-card__title",children:"Upload resume"}),(0,C.jsx)("span",{className:"rae-profile-method-card__description",children:"Auto-extract candidate details from a resume"})]}),(0,C.jsx)("span",{className:"rae-profile-method-card__info",title:`Supported: ${Z?.fileFormat.join(", ")||"Loading..."}${Z?.fileSize?` | Max size: ${Z.fileSize} MB`:""}`,"aria-label":`Supported file types: ${Z?.fileFormat.join(", ")||"Loading"}${Z?.fileSize?` and maximum file size ${Z.fileSize} MB`:""}`,children:(0,C.jsx)(Xf,{})}),(0,C.jsx)("input",{id:l,type:"file",accept:Z?.fileFormat?.map(T=>`.${String(T).trim().toLowerCase().replace(/^\./,"")}`).join(",")||void 0,hidden:!0,onChange:T=>{let W=T.target.files?.[0];W&&r.uploadFile(W)}})]}),(0,C.jsxs)("button",{type:"button",className:"rae-profile-method-card",onClick:r.startManualEntry,children:[(0,C.jsx)("span",{className:"rae-profile-method-card__icon",children:(0,C.jsx)(Tv,{"aria-hidden":"true"})}),(0,C.jsxs)("span",{className:"rae-profile-method-card__content",children:[(0,C.jsx)("span",{className:"rae-profile-method-card__title",children:"Manual entry"}),(0,C.jsx)("span",{className:"rae-profile-method-card__description",children:"Fill in candidate details step by step"})]})]})]})]}):B?(0,C.jsxs)("label",{htmlFor:l,className:"rae-upload-card",children:[(0,C.jsx)("div",{className:"rae-upload-card__icon",children:(0,C.jsx)(ig,{})}),(0,C.jsxs)("div",{className:"rae-upload-card__title",children:["Drag and Drop or ",(0,C.jsx)("span",{children:"Click Here"})," to upload resume."]}),(0,C.jsxs)("div",{className:"rae-upload-card__meta",children:["File Types Supported : ",Z?.fileFormat.join(", ")||"Loading..."]}),(0,C.jsxs)("div",{className:"rae-upload-card__meta",children:["(File size should be ",Z?.fileSize||2," MB or less)"]}),(0,C.jsx)("input",{id:l,type:"file",accept:Z?.fileFormat?.map(T=>`.${String(T).trim().toLowerCase().replace(/^\./,"")}`).join(",")||void 0,hidden:!0,onChange:T=>{let W=T.target.files?.[0];W&&r.uploadFile(W)}})]}):r.selectedFile?(0,C.jsxs)("div",{className:"rae-file-card",children:[(0,C.jsxs)("div",{className:"rae-file-card__content",children:[(0,C.jsx)("div",{className:"rae-file-card__name",children:r.selectedFile.name}),(0,C.jsx)("div",{className:"rae-file-card__size",children:Iv(r.selectedFile.size)})]}),(0,C.jsx)("button",{type:"button",className:"rae-icon-button rae-file-card__remove",onClick:r.clearSelectedFile,"aria-label":"Remove uploaded resume",children:(0,C.jsx)(q8,{})})]}):null,r.errors.file?(0,C.jsx)("div",{className:"rae-field-error",children:r.errors.file}):null]}),x?(0,C.jsxs)("section",{className:"rae-section",children:[r.isParsing?(0,C.jsx)("div",{className:"rae-state-text",children:"Parsing resume and populating fields..."}):null,(0,C.jsx)("div",{className:"rae-form-grid",children:w.map(T=>{let W=b5(T),D=r.formValues[W],R=r.errors[W],c1=T.fieldType==="checkbox",Z1=`rae-field-${W}`,j=!!(T.masterApplyFields.maskable&&D&&T.fieldType!=="location"&&T.fieldType!=="date"&&T.fieldType!=="phone"&&T.fieldType!=="checkbox"&&T.fieldType!=="D"),m1=!!(j&&M[W]);return(0,C.jsxs)("div",{className:`rae-field ${c1?"rae-field--checkbox":""}${R?" rae-field--invalid":""}`,onBlur:Q=>{Q.currentTarget.contains(Q.relatedTarget)||r.validateField(W)},children:[c1?null:(0,C.jsxs)("label",{htmlFor:Z1,className:"rae-field-label",children:[T.recruiterUploadsLabel,T.recruiterUploads==="Mandatory"?(0,C.jsx)("span",{children:"*"}):null,T.fieldType==="phone"&&T.primaryPhoneNumber?(0,C.jsx)("span",{className:"rae-phone-primary-badge",children:"Primary"}):null]}),m1?(0,C.jsxs)("div",{className:"rae-mask-shell",children:[(0,C.jsx)(a6,{id:Z1,name:W,value:s7(D),readOnly:!0,invalid:!!R}),(0,C.jsx)("button",{type:"button",className:"rae-mask-toggle",onClick:()=>H(Q=>({...Q,[W]:!1})),children:"Show"})]}):(0,C.jsxs)(s1.default.Fragment,{children:[ze({field:T,value:D,error:R,inputId:Z1,inputName:W,onChange:Q=>r.setFieldValue(W,Q),onBlur:()=>r.validateField(W),getDropdownOptions:r.getDropdownOptions,onAddPhoneField:r.addPhoneField,onRemovePhoneField:r.removePhoneField,canAddMorePhoneFields:r.canAddMorePhoneFields,phoneFieldCount:r.phoneFieldCount,locationSuggestions:h[W]||[],isLoadingLocationSuggestions:!!u[W],onLocationInput:Q=>X(W,Q),onLocationSuggestionSelect:Q=>l1(W,Q),onLocationBlur:()=>{L.current[W]&&window.clearTimeout(L.current[W]),v(Q=>({...Q,[W]:[]})),s(Q=>({...Q,[W]:!1}))}}),j?(0,C.jsx)("button",{type:"button",className:"rae-mask-toggle rae-mask-toggle--inline",onClick:()=>H(Q=>({...Q,[W]:!0})),children:"Hide"}):null]}),R?(0,C.jsx)("div",{className:"rae-field-error",children:R}):null]},W)})})]}):null]}),(0,C.jsxs)("div",{className:"rae-modal__footer",children:[(0,C.jsxs)("div",{className:"rae-footer__left",children:[(0,C.jsx)(xe,{id:"rae-send-notification",name:"sendNotification",className:"rae-checkbox-field rae-checkbox-field--footer",checked:r.sendNotification,onChange:T=>r.setSendNotification(T.target.checked),label:"Send notification to candidate"}),r.isInitializing?null:$.length>0?(0,C.jsxs)("div",{className:"rae-footer-fields",children:[(0,C.jsx)("div",{className:"rae-footer-field rae-footer-field--required",children:(0,C.jsx)(y5,{id:"rae-source-of-profile",name:"sourceOfProfile",value:r.sourceOfProfile,onChange:T=>G(T.target.value),placeholder:"Source Of Profile",options:$.map(T=>({label:T,value:T}))})}),r.sourceOfProfile?(0,C.jsx)("div",{className:"rae-footer-field rae-footer-field--required",children:(0,C.jsx)(y5,{id:"rae-profile-source",name:"profileSource",value:r.profileSource,onChange:T=>I(T.target.value),placeholder:"Source Type",options:O.map(T=>({label:T.profileSource,value:T.profileSource}))})}):null,r.profileSource&&U?(0,C.jsx)("div",{className:"rae-footer-field rae-footer-field--required",children:(0,C.jsx)(y5,{id:"rae-sub-source-select",name:"subSourceSelect",value:p,onChange:T=>J(T.target.value),placeholder:"Sub Source",options:F.map(T=>({label:T,value:T}))})}):null,r.profileSource&&q?(0,C.jsx)("div",{className:"rae-footer-field rae-footer-field--required",children:(0,C.jsx)(a6,{id:"rae-sub-source-input",name:"subSourceText",value:r.subSourceText,placeholder:"Sub Source *",onChange:T=>r.setSubSourceText(T.target.value)})}):null]}):(0,C.jsx)("div",{className:"rae-footer-fields",children:P.length?(0,C.jsx)("div",{className:"rae-footer-field rae-footer-field--required",children:(0,C.jsx)(y5,{id:"rae-profile-source-fallback",name:"profileSource",value:r.profileSource,onChange:T=>I(T.target.value),placeholder:"Source Type",options:O.map(T=>({label:T.profileSource,value:T.profileSource}))})}):(0,C.jsx)("div",{className:"rae-footer-field rae-footer-field--required",children:(0,C.jsx)(a6,{id:"rae-sub-source-fallback",name:"subSourceText",value:r.subSourceText,placeholder:"Sub Source *",onChange:T=>r.setSubSourceText(T.target.value)})})})]}),(0,C.jsxs)("div",{className:"rae-footer__actions",children:[(0,C.jsx)("button",{type:"button",className:"rae-button rae-button--ghost",onClick:t.onClose,children:"Cancel"}),(0,C.jsx)("button",{type:"button",className:"rae-button rae-button--primary",onClick:()=>{A1()},disabled:!r.canSubmit,children:r.isSubmitting?"Submitting...":"Submit"})]})]})]})})]})}function dA(t){let r=String(t??"").replace(/[^\d]/g,"");if(!r)return"";let l=r.slice(-3),i=r.slice(0,-3);return i?`${i.replace(/\B(?=(\d{2})+(?!\d))/g,",")},${l}`:l}function og(){if(typeof document>"u")return;let t=[".rae-phone-add-button",".rae-phone-field__add",".rae-phone-action--add",".rae-phone-inline__add"].join(", "),r=new Set;document.querySelectorAll(t).forEach(l=>r.add(l)),document.querySelectorAll(".rae-modal *").forEach(l=>{if(!(l instanceof HTMLElement)||l.children.length>0||(l.textContent||"").trim()!=="+")return;let i=l.closest(".rae-field")||l.closest("[class*='phone']")||l.parentElement;String(i?.textContent||"").toLowerCase().includes("phone")&&r.add(l)}),r.forEach(l=>{if(!(l instanceof HTMLElement)||l.dataset.raePhoneIconMounted==="true")return;l.dataset.raePhoneIconMounted="true",l.classList.add("rae-phone-action","rae-phone-action--accent"),l.textContent="";let i=document.createElement("span");i.className="rae-phone-add-icon",l.appendChild(i),(0,sg.createRoot)(i).render((0,C.jsx)(cg,{}))})}function f7(t){if(!(t instanceof HTMLElement))return;document.querySelectorAll('.rae-select[data-overlay-active="true"], .rae-searchable-select[data-overlay-active="true"]').forEach(Z=>{Z instanceof HTMLElement&&Z!==t&&delete Z.dataset.overlayActive});let r=t.querySelector('button[aria-expanded="true"]')||t.querySelector("button"),l=t.querySelector(".rae-select-options")||t.querySelector(".rae-searchable-select__options");if(!(r instanceof HTMLElement)||!(l instanceof HTMLElement))return;let i=r.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight||0,n=window.innerWidth||document.documentElement.clientWidth||0,h=4,v=12,u=Math.min(l.scrollHeight||240,280),s=o-i.bottom-v,p=i.top-v,A=s<Math.min(u,180)&&p>s,M=Math.max(140,Math.min(u,A?p:s)),H=Math.min(i.width,n-v*2),m=Math.min(Math.max(v,i.left),n-H-v),L=A?Math.max(v,i.top-M-h):Math.max(v,i.bottom+h),w=t.closest(".rae-field");document.querySelectorAll('.rae-field[data-overlay-active="true"]').forEach(Z=>{Z instanceof HTMLElement&&Z!==w&&delete Z.dataset.overlayActive}),t.dataset.overlayActive="true",w instanceof HTMLElement&&(w.dataset.overlayActive="true"),l.dataset.overlayOpen="true",l.style.setProperty("--rae-overlay-top",`${L}px`),l.style.setProperty("--rae-overlay-left",`${m}px`),l.style.setProperty("--rae-overlay-width",`${H}px`),l.style.setProperty("--rae-overlay-max-height",`${M}px`)}function vA(t){if(!(t instanceof HTMLElement))return;delete t.dataset.overlayActive;let r=t.closest(".rae-field");r instanceof HTMLElement&&delete r.dataset.overlayActive;let l=t.querySelector(".rae-select-options")||t.querySelector(".rae-searchable-select__options");l instanceof HTMLElement&&(delete l.dataset.overlayOpen,l.style.removeProperty("--rae-overlay-top"),l.style.removeProperty("--rae-overlay-left"),l.style.removeProperty("--rae-overlay-width"),l.style.removeProperty("--rae-overlay-max-height"))}function S5(t){if(!(t instanceof HTMLElement))return;let r=t.querySelector("input"),l=t.__raePortaledLocationSuggestions||t.querySelector(".rae-location-suggestions");if(!(r instanceof HTMLElement)||!(l instanceof HTMLElement))return;let i=r.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight||0,n=window.innerWidth||document.documentElement.clientWidth||0,h=4,v=12,u=Math.min(l.scrollHeight||240,280),s=o-i.bottom-v,p=i.top-v,A=s<Math.min(u,180)&&p>s,M=Math.max(120,Math.min(u,A?p:s)),H=Math.min(i.width,n-v*2),m=Math.min(Math.max(v,i.left),n-H-v),L=A?Math.max(v,i.top-M-h):Math.max(v,i.bottom+h);l.dataset.overlayOpen="true",l.style.setProperty("--rae-location-overlay-top",`${L}px`),l.style.setProperty("--rae-location-overlay-left",`${m}px`),l.style.setProperty("--rae-location-overlay-width",`${H}px`),l.style.setProperty("--rae-location-overlay-max-height",`${M}px`)}function ng(t){if(!(t instanceof HTMLElement))return;let r=t.__raePortaledLocationSuggestions||t.querySelector(".rae-location-suggestions");if(r instanceof HTMLElement){if(delete r.dataset.overlayOpen,r.style.removeProperty("--rae-location-overlay-top"),r.style.removeProperty("--rae-location-overlay-left"),r.style.removeProperty("--rae-location-overlay-width"),r.style.removeProperty("--rae-location-overlay-max-height"),t.__raeLocationOriginalParent instanceof HTMLElement){let l=t.__raeLocationOriginalParent,i=t.__raeLocationOriginalNextSibling||null;i&&i.parentNode===l?l.insertBefore(r,i):l.appendChild(r)}delete t.__raePortaledLocationSuggestions,delete t.__raeLocationOriginalParent,delete t.__raeLocationOriginalNextSibling}}function Ve(t){if(!(t instanceof HTMLElement)||typeof document>"u")return;let r=t.__raePortaledLocationSuggestions;if(r instanceof HTMLElement&&r.isConnected&&r.parentElement===document.body)return r;let l=t.querySelector(".rae-location-suggestions");return l instanceof HTMLElement?(t.__raeLocationOriginalParent=l.parentElement,t.__raeLocationOriginalNextSibling=l.nextSibling,t.__raePortaledLocationSuggestions=l,document.body.appendChild(l),l):null}function me(t){if(!(t instanceof HTMLElement))return;let r=t.closest(".rae-modal__body--expanded")||t.closest(".rae-modal__body"),l=t.closest(".rae-modal")?.querySelector?.(".rae-modal__footer"),i=t.__raePortaledLocationSuggestions||t.querySelector(".rae-location-suggestions"),o=t.querySelector("input");if(!(r instanceof HTMLElement)||!(i instanceof HTMLElement)||!(o instanceof HTMLElement))return;let n=o.getBoundingClientRect(),h=r.getBoundingClientRect(),v=l instanceof HTMLElement?l.getBoundingClientRect():null,u=v?Math.min(h.bottom,v.top):h.bottom,s=Math.min(Math.max(i.scrollHeight||0,180),280),M=n.bottom+8+s-u;M>0&&(r.scrollTop+=M+12)}typeof document<"u"&&!window.__raeCurrentCtcFormatterBound&&(window.__raeCurrentCtcFormatterBound=!0,document.addEventListener("input",t=>{let r=t.target;if(!(r instanceof HTMLInputElement))return;let i=r.closest(".rae-field")?.querySelector?.(".rae-field-label");if(!String(i?.textContent||"").toLowerCase().includes("current ctc"))return;let n=dA(r.value);if(n!==r.value){let h=r.selectionStart===r.value.length;if(r.value=n,h){let v=n.length;window.requestAnimationFrame(()=>{try{r.setSelectionRange(v,v)}catch{}})}}},!0));if(typeof document<"u"&&!window.__raeDropdownOverlayBound){window.__raeDropdownOverlayBound=!0;let t=r=>{let l=r?.closest?.(".rae-select, .rae-searchable-select");l instanceof HTMLElement&&window.requestAnimationFrame(()=>f7(l))};document.addEventListener("click",r=>{t(r.target),document.querySelectorAll(".rae-select, .rae-searchable-select").forEach(i=>{if(!(i instanceof HTMLElement))return;i.querySelector('button[aria-expanded="true"]')?f7(i):vA(i)})},!0),window.addEventListener("resize",()=>{document.querySelectorAll(".rae-select, .rae-searchable-select").forEach(r=>f7(r))},{passive:!0}),document.addEventListener("scroll",()=>{document.querySelectorAll(".rae-select, .rae-searchable-select").forEach(r=>f7(r))},!0)}typeof document<"u"&&!window.__raePhoneAddIconBound&&(window.__raePhoneAddIconBound=!0,new MutationObserver(()=>og()).observe(document.body,{childList:!0,subtree:!0}),window.requestAnimationFrame(()=>og()));if(typeof document<"u"&&!window.__raeSubmitButtonEnableBound){window.__raeSubmitButtonEnableBound=!0;let t=()=>{document.querySelectorAll("button").forEach(l=>{!(l instanceof HTMLButtonElement)||(l.textContent||"").trim().toLowerCase()!=="submit"||l.dataset.raeForceSubmitDisabled!=="true"&&l.disabled&&(l.disabled=!1,l.removeAttribute("disabled"),l.setAttribute("aria-disabled","false"))})};new MutationObserver(()=>t()).observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["disabled","aria-disabled"]}),window.requestAnimationFrame(()=>t())}if(typeof document<"u"&&!window.__raeLocationCloseBound){window.__raeLocationCloseBound=!0;let t=l=>{document.querySelectorAll(".rae-location-field").forEach(i=>{if(!(i instanceof HTMLElement))return;let o=l instanceof Node?i.contains(l):!1,n=i.__raePortaledLocationSuggestions||i.querySelector(".rae-location-suggestions");if(o){let v=Ve(i);i.dataset.locationOpen="true";let u=v||i.__raePortaledLocationSuggestions||n;u instanceof HTMLElement&&(u.style.display="block"),window.requestAnimationFrame(()=>{me(i),S5(i)});return}delete i.dataset.locationOpen,n instanceof HTMLElement&&(n.style.display="none"),ng(i);let h=i.querySelector("input");h instanceof HTMLInputElement&&document.activeElement===h&&h.blur()})};document.addEventListener("focusin",l=>{t(l.target)},!0),document.addEventListener("pointerdown",l=>{let i=l.target;if(i instanceof HTMLElement&&i.classList.contains("rae-location-suggestion")){let o=i.dataset.suggestion||i.textContent?.trim(),n=document.querySelectorAll(".rae-location-field[data-location-open='true']");for(let h of n){if(!(h instanceof HTMLElement)||!h.__raeOnSuggestionSelect||!o)continue;l.preventDefault(),h.__raeOnSuggestionSelect(o),delete h.dataset.locationOpen;let v=h.__raePortaledLocationSuggestions||h.querySelector(".rae-location-suggestions");v instanceof HTMLElement&&(v.style.display="none"),ng(h);return}}t(l.target)},!0),document.addEventListener("input",l=>{let i=l.target;if(!(i instanceof HTMLElement))return;let o=i.closest(".rae-location-field");o instanceof HTMLElement&&o.dataset.locationOpen==="true"&&window.requestAnimationFrame(()=>{let n=Ve(o);n instanceof HTMLElement&&(n.style.display="block"),me(o),S5(o)})},!0),new MutationObserver(()=>{document.querySelectorAll(".rae-location-field[data-location-open='true']").forEach(l=>{if(!(l instanceof HTMLElement))return;let i=Ve(l);i instanceof HTMLElement&&(i.style.display="block"),me(l),S5(l)})}).observe(document.body,{childList:!0,subtree:!0}),window.addEventListener("resize",()=>{document.querySelectorAll(".rae-location-field[data-location-open='true']").forEach(l=>{S5(l)})},{passive:!0}),document.addEventListener("scroll",()=>{document.querySelectorAll(".rae-location-field[data-location-open='true']").forEach(l=>{S5(l)})},!0)}if(typeof document<"u"&&!window.__raeBusyOverlayBound){window.__raeBusyOverlayBound=!0;let t=[".rae-loading-overlay",".rae-loading-state",".rae-modal__loading",".rae-spinner-overlay",".rae-submit-overlay","[aria-busy='true']"].join(", "),r=()=>{document.querySelectorAll(".rae-modal").forEach(i=>{if(!(i instanceof HTMLElement))return;i.matches("[aria-busy='true']")||!!i.querySelector(t)||!!i.querySelector(".rae-modal__body [role='progressbar']")?i.dataset.busyOverlay="true":delete i.dataset.busyOverlay})};new MutationObserver(()=>r()).observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","style","aria-busy"]}),window.requestAnimationFrame(()=>r())}typeof document<"u"&&!window.__raeValidationScrollBound&&(window.__raeValidationScrollBound=!0);if(typeof document<"u"&&!window.__raeLocationPortalBridgeBound){window.__raeLocationPortalBridgeBound=!0;let t=document.createElement("div");t.className="rae-location-portal-overlay",t.hidden=!0,document.body.appendChild(t);let r=null,l=null,i=A=>A instanceof HTMLElement?A.__raePortaledLocationSuggestions||A.querySelector(".rae-location-suggestions"):null,o=(A,M)=>{let H=i(A);H instanceof HTMLElement&&(H.style.visibility=M?"hidden":"",H.style.pointerEvents=M?"none":"")},n=()=>{r&&o(r,!1),r=null,t.hidden=!0,t.innerHTML=""},h=(A,M)=>{let H=A.querySelector("input");if(!(H instanceof HTMLElement)||!(M instanceof HTMLElement))return;let m=H.getBoundingClientRect(),L=window.innerHeight||document.documentElement.clientHeight||0,w=window.innerWidth||document.documentElement.clientWidth||0,Z=12,V=4,x=Math.min(M.scrollHeight||240,280),z=L-m.bottom-Z,B=m.top-Z,P=z<Math.min(x,180)&&B>z,$=Math.max(120,Math.min(x,P?B:z)),S=Math.min(m.width,w-Z*2),O=Math.min(Math.max(Z,m.left),w-S-Z),y=P?Math.max(Z,m.top-$-V):Math.max(Z,m.bottom+V);t.style.left=`${O}px`,t.style.top=`${y}px`,t.style.width=`${S}px`,t.style.maxHeight=`${$}px`},v=()=>{if(!(r instanceof HTMLElement))return n();let A=i(r);if(!(A instanceof HTMLElement))return n();let M=Array.from(A.children).filter(H=>H instanceof HTMLElement);if(!M.length)return n();o(r,!0),t.innerHTML="",M.forEach((H,m)=>{let L=H.cloneNode(!0);L instanceof HTMLElement&&(L.dataset.portalIndex=String(m),t.appendChild(L))}),h(r,A),t.hidden=!1},u=()=>{l&&window.clearTimeout(l),l=window.setTimeout(()=>{l=null,v()},0)},s=A=>{A instanceof HTMLElement&&(r=A,u())};document.addEventListener("input",A=>{let M=A.target instanceof HTMLElement?A.target.closest(".rae-location-field"):null;M instanceof HTMLElement&&s(M)},!0),document.addEventListener("focusin",A=>{let M=A.target instanceof HTMLElement?A.target:null,H=M?.closest?.(".rae-location-field");if(H instanceof HTMLElement){s(H);return}t.contains(M)||n()},!0),document.addEventListener("pointerdown",A=>{let M=A.target instanceof HTMLElement?A.target:null;if(t.contains(M)){let m=M?.closest?.("[data-portal-index]"),L=i(r);if(m instanceof HTMLElement&&L instanceof HTMLElement){let w=Number(m.dataset.portalIndex),Z=L.children[w];Z instanceof HTMLElement&&(Z.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0})),Z.dispatchEvent(new MouseEvent("click",{bubbles:!0})))}n();return}let H=M?.closest?.(".rae-location-field");if(H instanceof HTMLElement){s(H);return}n()},!0),new MutationObserver(()=>{r&&u()}).observe(document.body,{childList:!0,subtree:!0}),window.addEventListener("resize",()=>u(),{passive:!0}),document.addEventListener("scroll",()=>u(),!0)}var p1=E(kt(),1),v0=E(k(),1);var T0=E(k(),1);function r6(t){return t.formGroupName||t.masterApplyFields.fieldNameForApply}function fg(t,r){return t.find(l=>r6(l)===r||l.masterApplyFields.fieldNameForApply===r)}function we(t){return String(t||"").replace(/\D+/g,"")}function Ag(t){let r=we(t);return r?`+${r}`:""}function pg(t){if(!t)return t;let r=t instanceof Date?t:new Date(t);if(Number.isNaN(r.getTime()))return t;let l=r.getFullYear(),i=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0");return`${l}-${i}-${o}`}function gA(t,r){let l={...t};return r.forEach(i=>{let o=r6(i);i.fieldType==="date"&&l[o]&&(l[o]=pg(l[o]))}),Object.entries(l).forEach(([i,o])=>{if(i!=="dateOfBirth"&&o){let n=new Date(o);!Number.isNaN(n.getTime())&&String(o).match(/\d{4}-\d{2}-\d{2}|T\d{2}:/)&&(l[i]=pg(o))}}),l}function Hg(t){return{...t,recruiterUploads:t.editProfile||t.recruiterUploads}}function Be(t,r,l,i){return o2(t)?null:U8(Hg(t),r,l.map(Hg),i)}function Ce(t,r,l){let i={};return t.forEach(o=>{let n=r6(o);if(!n)return;let h=Be(o,l[n],r,l);h&&(i[n]=h)}),Object.assign(i,W8(t,l)),i}function uA(t,r,l,i){let o={...i},n=fg(r,t);return n?.dependentFieldsName&&[...new Set(j2(n.dependentFieldsName))].forEach(v=>{let u=r.find(A=>A.masterApplyFields.fieldNameForApply===v);if(!u)return;let s=r6(u);if(!n2(v,r,l)){delete o[s];return}let p=Be(u,l[s],r,l);p?o[s]=p:delete o[s]}),o}function A7(t){return{countryIsoCode:t?.countryIsoCode||"IN",whatsAppEnabled:!!t?.whatsAppEnabled,maxCount:t?.maxCount||3}}function Mg(t,r){return T6(t)?.iso2||r||"IN"}function Vg(t,r,l=!1){let i=Ag(t?.countryCode||r),o=we(t?.number||t?.phoneNoWithoutCountryCode||"");return{phoneType:t?.phoneType||"Home",phoneNumField:o?{nationalNumber:o,number:o,dialCode:i,e164Number:`${i}${o}`}:null,whatsAppEnabled:t?.whatsappEnabled??t?.whatsAppEnabled??l}}function sA(t,r,l,i){let o=A7(r),n=[],h=1;return t.forEach(v=>{if(v.fieldType!=="phone"){n.push({...v});return}let u=[...l||[]].sort((s,p)=>+!!p.primary-+!!s.primary);if(!u.length){let s=`phoneField${h}`;h+=1,n.push({...v,formGroupName:s,selectedCountryCode:Mg(i?.countryCode,o.countryIsoCode),primaryPhoneNumber:!0});return}u.forEach((s,p)=>{let A=`phoneField${h}`;h+=1,n.push({...v,editProfile:p===0?v.editProfile:"Non Mandatory",formGroupName:A,selectedCountryCode:Mg(s.countryCode,o.countryIsoCode),primaryPhoneNumber:!!s.primary})})}),n}function pA(t,r){let l={},i=r.applyFieldsObject||{},o=[...r.phoneNumbers||[]].sort((v,u)=>+!!u.primary-+!!v.primary),n=A7(r.phoneConfiguration),h=0;return t.forEach(v=>{let u=v.masterApplyFields.fieldNameForApply,s=r6(v);if(!(!u||u==="uploadResume")){if(v.fieldType==="phone"){let p=o[h];h+=1,l[s]=Vg(p||{number:i.phoneNoWithoutCountryCode||i.phoneNo,countryCode:i.countryCode,phoneType:"Home",whatsappEnabled:n.whatsAppEnabled},n.countryIsoCode,n.whatsAppEnabled);return}if(v.fieldType==="checkbox"||o2(v)){l[s]=!!i[u];return}l[s]=i[u]??""}}),l}function HA(t,r,l){return t.filter(i=>i.fieldType==="phone").map(i=>({field:i,phoneValue:r[i.formGroupName||"phoneField1"]})).filter(i=>!!i.phoneValue?.phoneNumField).map(({field:i,phoneValue:o})=>({phoneType:o.phoneType,associatedEntityType:"CANDIDATE",associatedEntityId:l,primary:!!i.primaryPhoneNumber,whatsappEnabled:!!o.whatsAppEnabled,countryCode:Ag(o.phoneNumField?.dialCode),number:we(o.phoneNumField?.nationalNumber||o.phoneNumField?.number)}))}function MA(t){let r=gA(t.values,t.fields),l={...r};t.fields.filter(h=>h.fieldType==="phone").forEach(h=>{delete l[h.formGroupName||"phoneField1"]});let i=HA(t.fields,r,t.context.applyId),o=i.find(h=>h.primary),n={...t.initialization.jobApplication||{}};if(Object.keys(l).forEach(h=>{Object.prototype.hasOwnProperty.call(n,h)&&(n[h]=l[h])}),o){let h=`${o.countryCode||""}${o.number||""}`;n.phoneNo=h,n.primaryNumWithoutCC=o.number||"",n.countryCode=o.countryCode||"",l.phoneNo=h,l.phoneNoWithoutCountryCode=o.number||"",l.countryCode=o.countryCode||""}return{additionalFieldsMapObject:JSON.stringify({}),applyFieldsObject:JSON.stringify(l),fName:String(l.firstName||""),lName:String(l.lastName||""),jobApplication:n,contactInformation:i}}function mg(t){let[r,l]=(0,T0.useState)(null),[i,o]=(0,T0.useState)([]),[n,h]=(0,T0.useState)({}),[v,u]=(0,T0.useState)(!1),[s,p]=(0,T0.useState)(!1),[A,M]=(0,T0.useState)({}),[H,m]=(0,T0.useState)(!1);(0,T0.useEffect)(()=>{if(!t.open)return;let S=!1;return u(!0),t.api.loadInitialData(t.context).then(O=>{if(S)return;let y=sA(O.applyFields||[],O.phoneConfiguration,O.phoneNumbers||[],O.applyFieldsObject||{});l(O),o(y),h(pA(y,O)),M({}),m(!1)}).finally(()=>{S||u(!1)}),()=>{S=!0}},[t.api,t.context,t.open]);let L=(0,T0.useMemo)(()=>i.filter(S=>{let O=S.masterApplyFields.fieldNameForApply;return O&&O!=="uploadResume"&&!o2(S)&&n2(O,i,n)}),[i,n]),w=(0,T0.useMemo)(()=>i.filter(S=>S.fieldType==="phone"),[i]),Z=!!(r&&w.length<A7(r.phoneConfiguration).maxCount),V=!v&&!s;(0,T0.useEffect)(()=>{let S=new Set(L.map(O=>r6(O)).filter(Boolean));M(O=>{let y={};return Object.entries(O).forEach(([F,U])=>{S.has(F)&&(y[F]=U)}),H?{...y,...Ce(L,i,n)}:y})},[i,n,H,L]);function x(S,O){let y={...n,[S]:O};if(S==="dateOfBirth"){let F=p7(String(O));F!=null&&"agee"in y&&(y.agee=F)}h(y),M(F=>{let U={...F};delete U[S];let q=uA(S,i,y,U);return H?{...q,...Ce(i.filter(G=>{let I=G.masterApplyFields.fieldNameForApply;return I&&I!=="uploadResume"&&!o2(G)&&n2(I,i,y)}),i,y)}:q})}function z(S){let O=fg(i,S);if(!O)return;let y=r6(O),F={...n};if(!n2(O.masterApplyFields.fieldNameForApply,i,F)){M(q=>{let G={...q};return delete G[y],G});return}let U=Be(O,F[y],i,F);M(q=>{let G={...q};return U?G[y]=U:delete G[y],Object.assign(G,W8(L,F)),G})}function B(S){if(!r||!Z)return;let y=`phoneField${w.length+1}`,F=A7(r.phoneConfiguration),U={...S,editProfile:"Non Mandatory",formGroupName:y,selectedCountryCode:F.countryIsoCode,primaryPhoneNumber:!1},q=i.indexOf(S);o(G=>[...G.slice(0,q+1),U,...G.slice(q+1)]),h(G=>({...G,[y]:Vg(null,F.countryIsoCode,F.whatsAppEnabled)}))}function P(S){if(S.primaryPhoneNumber)return;let O=r6(S);o(y=>y.filter(F=>F!==S)),h(y=>{let F={...y};return delete F[O],F})}async function $(){if(!r)return null;m(!0);let S=Ce(L,i,n);if(Object.keys(S).length>0)return M(O=>({...O,...S})),null;p(!0);try{let O=MA({fields:i,values:n,initialization:r,context:t.context});return await t.api.submitProfile(O,t.context)}finally{p(!1)}}return{initialization:r,fields:i,formValues:n,isInitializing:v,isSubmitting:s,errors:A,canSubmit:V,canAddMorePhoneFields:Z,phoneFieldCount:w.length,setFieldValue:x,validateField:z,submit:$,getVisibleFields(){return L},getDropdownOptions(S,O){return H7(kv(S),O)},addPhoneField:B,removePhoneField:P}}var zg=E(ra(),1);function Zg(t){return p4({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M363 277h-86v86h-42v-86h-86v-42h86v-86h42v86h86v42z"},child:[]},{tag:"path",attr:{d:"M256 90c44.3 0 86 17.3 117.4 48.6C404.7 170 422 211.7 422 256s-17.3 86-48.6 117.4C342 404.7 300.3 422 256 422c-44.3 0-86-17.3-117.4-48.6C107.3 342 90 300.3 90 256c0-44.3 17.3-86 48.6-117.4C170 107.3 211.7 90 256 90m0-42C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z"},child:[]}]})(t)}var Cg=E(kt(),1);function fA(t){let r=t||{},l=r.responseCode??r.code,i=typeof l=="number"?l:void 0,o=typeof r.reponseObject=="string"&&r.reponseObject||typeof r.message=="string"&&r.message||typeof r.errorMessage=="string"&&r.errorMessage||"Something went wrong, Please try again!";return i===void 0||i===200?{isSuccess:!0,toast:{kind:"success",message:o==="Something went wrong, Please try again!"?"Profile updated successfully":o}}:{isSuccess:!1,toast:{kind:i===403||i===500?"warning":"error",message:o}}}function AA(t){t instanceof HTMLElement&&window.setTimeout(()=>{let r=t.querySelector(".rae-field-error");if(!(r instanceof HTMLElement))return;let l=r.closest(".rae-field")||r;if(!(l instanceof HTMLElement))return;let i=t.querySelector(".rae-modal__body--expanded")||t.querySelector(".rae-modal__body");if(i instanceof HTMLElement){let n=l.getBoundingClientRect(),h=i.getBoundingClientRect(),v=n.top-h.top+i.scrollTop-80;i.scrollTo({top:Math.max(0,v),behavior:"smooth"})}else l.scrollIntoView({behavior:"smooth",block:"center"});let o=l.querySelector("input, button, textarea, [role='combobox'], [role='button']");o instanceof HTMLElement&&o.focus({preventScroll:!0})},100)}function Lg(t){let r=mg({open:t.open,api:t.api,context:t.context}),l=(0,v0.useRef)(null),[i,o]=(0,v0.useState)(null),[n,h]=(0,v0.useState)({}),[v,u]=(0,v0.useState)({}),[s,p]=(0,v0.useState)({}),A=(0,v0.useRef)({}),M=(0,v0.useRef)({}),H=(0,v0.useId)();if((0,v0.useEffect)(()=>{if(!i)return;let V=window.setTimeout(()=>o(null),4500);return()=>window.clearTimeout(V)},[i]),(0,v0.useEffect)(()=>()=>{Object.values(M.current).forEach(V=>window.clearTimeout(V))},[]),(0,v0.useEffect)(()=>{p(V=>{let x={...V};return r.fields.forEach(z=>{let B=b5(z);if(!B||!z.masterApplyFields.maskable)return;let P=r.formValues[B],$=P!=null&&String(P).trim()!=="";x[B]=$?x[B]??!0:!1}),x})},[r.fields,r.formValues]),!t.open)return null;function m(V,x){if(r.setFieldValue(V,x),!t.api.getLocationSuggestions){h(z=>({...z,[V]:[]}));return}if(M.current[V]&&window.clearTimeout(M.current[V]),!x.trim()){h(z=>({...z,[V]:[]})),u(z=>({...z,[V]:!1}));return}M.current[V]=window.setTimeout(async()=>{let z=(A.current[V]||0)+1;A.current[V]=z,u(B=>({...B,[V]:!0}));try{let B=await t.api.getLocationSuggestions?.(x,t.context);if(A.current[V]!==z)return;h(P=>({...P,[V]:B||[]}))}catch{if(A.current[V]!==z)return;h(B=>({...B,[V]:[]}))}finally{A.current[V]===z&&u(B=>({...B,[V]:!1}))}},250)}function L(V,x){r.setFieldValue(V,x),h(z=>({...z,[V]:[]})),u(z=>({...z,[V]:!1}))}async function w(){o(null);try{let V=await r.submit();if(!V){AA(l.current);return}let x=fA(V);t.showSubmitToast!==!1&&o(x.toast),x.isSuccess&&t.onSuccess?.(V)}catch(V){t.showSubmitToast!==!1&&o({kind:"error",message:V instanceof Error&&V.message?V.message:"Something went wrong, Please try again!"})}}let Z=[...r.getVisibleFields().filter(V=>V.fieldType!=="checkbox"),...r.getVisibleFields().filter(V=>V.fieldType==="checkbox")];return(0,p1.jsxs)(o7,{open:t.open,onClose:()=>{},className:"rae-overlay",children:[(0,p1.jsx)("div",{className:"rae-overlay__backdrop","aria-hidden":"true"}),(0,p1.jsx)("div",{className:"rae-overlay__viewport",children:(0,p1.jsxs)(L5,{ref:l,className:`rae-modal ${r.isInitializing?"rae-modal--edit-loading":"rae-modal--expanded"} rae-modal--edit-profile`,children:[i?(0,p1.jsxs)("div",{className:`rae-toast rae-toast--${i.kind}`,role:"status","aria-live":"polite",children:[(0,p1.jsx)("span",{children:i.message}),(0,p1.jsx)("button",{type:"button",className:"rae-toast__close",onClick:()=>o(null),"aria-label":"Dismiss notification",children:(0,p1.jsx)(q8,{})})]}):null,r.isSubmitting?(0,p1.jsxs)("div",{className:"rae-loader-overlay","aria-live":"polite","aria-busy":"true",children:[(0,p1.jsx)(K8,{}),(0,p1.jsx)("p",{className:"rae-loader-text",children:"Saving profile changes..."})]}):null,(0,p1.jsxs)("div",{className:"rae-modal__header",children:[(0,p1.jsx)(z5,{as:"div",className:"rae-modal__title",children:t.title||"Edit Profile"}),(0,p1.jsx)("button",{type:"button",className:"rae-icon-button",onClick:t.onClose,"aria-label":"Close edit profile modal",children:(0,p1.jsx)(q8,{})})]}),r.isInitializing?(0,p1.jsx)("div",{className:"rae-modal__body rae-modal__body--loading",children:(0,p1.jsx)("div",{className:"rae-inline-loader","aria-live":"polite","aria-busy":"true",children:(0,p1.jsx)(K8,{})})}):(0,p1.jsx)("div",{className:"rae-modal__body rae-modal__body--expanded",children:(0,p1.jsx)("section",{className:"rae-section rae-section--edit-profile",children:(0,p1.jsx)("div",{className:"rae-form-grid",children:Z.map(V=>{let x=b5(V),z=r.formValues[x],B=r.errors[x],P=V.fieldType==="checkbox",$=V.editProfile==="Mandatory",S=`${H}-field-${x}`,O=!!(V.masterApplyFields.maskable&&z&&V.fieldType!=="location"&&V.fieldType!=="date"&&V.fieldType!=="phone"&&V.fieldType!=="checkbox"&&V.fieldType!=="D"),y=!!(O&&s[x]);return(0,p1.jsxs)("div",{className:`rae-field ${P?"rae-field--checkbox":""}${B?" rae-field--invalid":""}`,onBlur:F=>{F.currentTarget.contains(F.relatedTarget)||r.validateField(x)},children:[P?null:(0,p1.jsxs)("label",{htmlFor:S,className:"rae-field-label",children:[V.recruiterUploadsLabel,$?(0,p1.jsx)("span",{children:"*"}):null,V.fieldType==="phone"&&V.primaryPhoneNumber?(0,p1.jsx)("span",{className:"rae-phone-primary-badge",children:"Primary"}):null]}),y?(0,p1.jsxs)("div",{className:"rae-mask-shell",children:[(0,p1.jsx)(a6,{id:S,name:x,value:s7(z),readOnly:!0,invalid:!!B}),(0,p1.jsx)("button",{type:"button",className:"rae-mask-toggle",onClick:()=>p(F=>({...F,[x]:!1})),children:"Show"})]}):(0,p1.jsxs)(v0.default.Fragment,{children:[ze({field:V,value:z,error:B,inputId:S,inputName:x,readOnly:V.masterApplyFields.fieldNameForApply==="emailId",onChange:F=>r.setFieldValue(x,F),onBlur:()=>r.validateField(x),getDropdownOptions:r.getDropdownOptions,onAddPhoneField:r.addPhoneField,onRemovePhoneField:r.removePhoneField,canAddMorePhoneFields:r.canAddMorePhoneFields,phoneFieldCount:r.phoneFieldCount,locationSuggestions:n[x]||[],isLoadingLocationSuggestions:!!v[x],onLocationInput:F=>m(x,F),onLocationSuggestionSelect:F=>L(x,F)}),O?(0,p1.jsx)("button",{type:"button",className:"rae-mask-toggle rae-mask-toggle--inline",onClick:()=>p(F=>({...F,[x]:!0})),children:"Hide"}):null]}),B?(0,p1.jsx)("div",{className:"rae-field-error",children:B}):null]},x)})})})}),r.isInitializing?null:(0,p1.jsxs)("div",{className:"rae-modal__footer",children:[(0,p1.jsx)("div",{className:"rae-footer__left"}),(0,p1.jsxs)("div",{className:"rae-footer__actions",children:[(0,p1.jsx)("button",{type:"button",className:"rae-button rae-button--ghost",onClick:t.onClose,children:"Cancel"}),(0,p1.jsx)("button",{type:"button",className:"rae-button rae-button--primary",onClick:()=>{w()},disabled:!r.canSubmit,children:r.isSubmitting?"Saving...":"Save Changes"})]})]})]})})]})}function VA(t){let r=String(t??"").replace(/[^\d]/g,"");if(!r)return"";let l=r.slice(-3),i=r.slice(0,-3);return i?`${i.replace(/\B(?=(\d{2})+(?!\d))/g,",")},${l}`:l}function xg(){if(typeof document>"u")return;let t=[".rae-phone-add-button",".rae-phone-field__add",".rae-phone-action--add",".rae-phone-inline__add"].join(", "),r=new Set;document.querySelectorAll(t).forEach(l=>r.add(l)),document.querySelectorAll(".rae-modal *").forEach(l=>{if(!(l instanceof HTMLElement)||l.children.length>0||(l.textContent||"").trim()!=="+")return;let i=l.closest(".rae-field")||l.closest("[class*='phone']")||l.parentElement;String(i?.textContent||"").toLowerCase().includes("phone")&&r.add(l)}),r.forEach(l=>{if(!(l instanceof HTMLElement)||l.dataset.raePhoneIconMounted==="true")return;l.dataset.raePhoneIconMounted="true",l.classList.add("rae-phone-add-button"),l.textContent="";let i=document.createElement("span");i.className="rae-phone-add-icon",l.appendChild(i),(0,zg.createRoot)(i).render((0,Cg.jsx)(Zg,{"aria-hidden":"true",focusable:"false"}))})}function V7(t){if(!(t instanceof HTMLElement))return;document.querySelectorAll('.rae-select[data-overlay-active="true"], .rae-searchable-select[data-overlay-active="true"]').forEach(Z=>{Z instanceof HTMLElement&&Z!==t&&delete Z.dataset.overlayActive});let r=t.querySelector('button[aria-expanded="true"]')||t.querySelector("button"),l=t.querySelector(".rae-select-options")||t.querySelector(".rae-searchable-select__options");if(!(r instanceof HTMLElement)||!(l instanceof HTMLElement))return;let i=r.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight||0,n=window.innerWidth||document.documentElement.clientWidth||0,h=4,v=12,u=Math.min(l.scrollHeight||240,280),s=o-i.bottom-v,p=i.top-v,A=s<Math.min(u,180)&&p>s,M=Math.max(140,Math.min(u,A?p:s)),H=Math.min(i.width,n-v*2),m=Math.min(Math.max(v,i.left),n-H-v),L=A?Math.max(v,i.top-M-h):Math.max(v,i.bottom+h),w=t.closest(".rae-field");document.querySelectorAll('.rae-field[data-overlay-active="true"]').forEach(Z=>{Z instanceof HTMLElement&&Z!==w&&delete Z.dataset.overlayActive}),t.dataset.overlayActive="true",w instanceof HTMLElement&&(w.dataset.overlayActive="true"),l.dataset.overlayOpen="true",l.style.setProperty("--rae-overlay-top",`${L}px`),l.style.setProperty("--rae-overlay-left",`${m}px`),l.style.setProperty("--rae-overlay-width",`${H}px`),l.style.setProperty("--rae-overlay-max-height",`${M}px`)}function mA(t){if(!(t instanceof HTMLElement))return;delete t.dataset.overlayActive;let r=t.closest(".rae-field");r instanceof HTMLElement&&delete r.dataset.overlayActive;let l=t.querySelector(".rae-select-options")||t.querySelector(".rae-searchable-select__options");l instanceof HTMLElement&&(delete l.dataset.overlayOpen,l.style.removeProperty("--rae-overlay-top"),l.style.removeProperty("--rae-overlay-left"),l.style.removeProperty("--rae-overlay-width"),l.style.removeProperty("--rae-overlay-max-height"))}function T5(t){if(!(t instanceof HTMLElement))return;let r=t.querySelector("input"),l=t.__raePortaledLocationSuggestions||t.querySelector(".rae-location-suggestions");if(!(r instanceof HTMLElement)||!(l instanceof HTMLElement))return;let i=r.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight||0,n=window.innerWidth||document.documentElement.clientWidth||0,h=4,v=12,u=Math.min(l.scrollHeight||240,280),s=o-i.bottom-v,p=i.top-v,A=s<Math.min(u,180)&&p>s,M=Math.max(120,Math.min(u,A?p:s)),H=Math.min(i.width,n-v*2),m=Math.min(Math.max(v,i.left),n-H-v),L=A?Math.max(v,i.top-M-h):Math.max(v,i.bottom+h);l.dataset.overlayOpen="true",l.style.setProperty("--rae-location-overlay-top",`${L}px`),l.style.setProperty("--rae-location-overlay-left",`${m}px`),l.style.setProperty("--rae-location-overlay-width",`${H}px`),l.style.setProperty("--rae-location-overlay-max-height",`${M}px`)}function ZA(t){if(!(t instanceof HTMLElement))return;let r=t.__raePortaledLocationSuggestions||t.querySelector(".rae-location-suggestions");if(r instanceof HTMLElement){if(delete r.dataset.overlayOpen,r.style.removeProperty("--rae-location-overlay-top"),r.style.removeProperty("--rae-location-overlay-left"),r.style.removeProperty("--rae-location-overlay-width"),r.style.removeProperty("--rae-location-overlay-max-height"),t.__raeLocationOriginalParent instanceof HTMLElement){let l=t.__raeLocationOriginalParent,i=t.__raeLocationOriginalNextSibling||null;i&&i.parentNode===l?l.insertBefore(r,i):l.appendChild(r)}delete t.__raePortaledLocationSuggestions,delete t.__raeLocationOriginalParent,delete t.__raeLocationOriginalNextSibling}}function Pe(t){if(!(t instanceof HTMLElement)||typeof document>"u")return;let r=t.__raePortaledLocationSuggestions;if(r instanceof HTMLElement&&r.isConnected&&r.parentElement===document.body)return r;let l=t.querySelector(".rae-location-suggestions");return l instanceof HTMLElement?(t.__raeLocationOriginalParent=l.parentElement,t.__raeLocationOriginalNextSibling=l.nextSibling,t.__raePortaledLocationSuggestions=l,document.body.appendChild(l),l):null}function Se(t){if(!(t instanceof HTMLElement))return;let r=t.closest(".rae-modal__body--expanded")||t.closest(".rae-modal__body"),l=t.closest(".rae-modal")?.querySelector?.(".rae-modal__footer"),i=t.__raePortaledLocationSuggestions||t.querySelector(".rae-location-suggestions"),o=t.querySelector("input");if(!(r instanceof HTMLElement)||!(i instanceof HTMLElement)||!(o instanceof HTMLElement))return;let n=o.getBoundingClientRect(),h=r.getBoundingClientRect(),v=l instanceof HTMLElement?l.getBoundingClientRect():null,u=v?Math.min(h.bottom,v.top):h.bottom,s=Math.min(Math.max(i.scrollHeight||0,180),280),M=n.bottom+8+s-u;M>0&&(r.scrollTop+=M+12)}typeof document<"u"&&!window.__raeCurrentCtcFormatterBound&&(window.__raeCurrentCtcFormatterBound=!0,document.addEventListener("input",t=>{let r=t.target;if(!(r instanceof HTMLInputElement))return;let i=r.closest(".rae-field")?.querySelector?.(".rae-field-label");if(!String(i?.textContent||"").toLowerCase().includes("current ctc"))return;let n=VA(r.value);if(n!==r.value){let h=r.selectionStart===r.value.length;if(r.value=n,h){let v=n.length;window.requestAnimationFrame(()=>{try{r.setSelectionRange(v,v)}catch{}})}}},!0));if(typeof document<"u"&&!window.__raeDropdownOverlayBound){window.__raeDropdownOverlayBound=!0;let t=r=>{let l=r?.closest?.(".rae-select, .rae-searchable-select");l instanceof HTMLElement&&window.requestAnimationFrame(()=>V7(l))};document.addEventListener("click",r=>{t(r.target),document.querySelectorAll(".rae-select, .rae-searchable-select").forEach(i=>{if(!(i instanceof HTMLElement))return;i.querySelector('button[aria-expanded="true"]')?V7(i):mA(i)})},!0),window.addEventListener("resize",()=>{document.querySelectorAll(".rae-select, .rae-searchable-select").forEach(r=>V7(r))},{passive:!0}),document.addEventListener("scroll",()=>{document.querySelectorAll(".rae-select, .rae-searchable-select").forEach(r=>V7(r))},!0)}typeof document<"u"&&!window.__raePhoneAddIconBound&&(window.__raePhoneAddIconBound=!0,new MutationObserver(()=>xg()).observe(document.body,{childList:!0,subtree:!0}),window.requestAnimationFrame(()=>xg()));if(typeof document<"u"&&!window.__raeLocationCloseBound){window.__raeLocationCloseBound=!0;let t=l=>{document.querySelectorAll(".rae-location-field").forEach(i=>{if(!(i instanceof HTMLElement))return;let o=l instanceof Node?i.contains(l):!1,n=i.__raePortaledLocationSuggestions||i.querySelector(".rae-location-suggestions");if(o){let v=Pe(i);i.dataset.locationOpen="true";let u=v||i.__raePortaledLocationSuggestions||n;u instanceof HTMLElement&&(u.style.display="block"),window.requestAnimationFrame(()=>{Se(i),T5(i)});return}delete i.dataset.locationOpen,n instanceof HTMLElement&&(n.style.display="none"),ZA(i);let h=i.querySelector("input");h instanceof HTMLInputElement&&document.activeElement===h&&h.blur()})};document.addEventListener("focusin",l=>{t(l.target)},!0),document.addEventListener("pointerdown",l=>{t(l.target)},!0),document.addEventListener("input",l=>{let i=l.target;if(!(i instanceof HTMLElement))return;let o=i.closest(".rae-location-field");o instanceof HTMLElement&&o.dataset.locationOpen==="true"&&window.requestAnimationFrame(()=>{let n=Pe(o);n instanceof HTMLElement&&(n.style.display="block"),Se(o),T5(o)})},!0),new MutationObserver(()=>{document.querySelectorAll(".rae-location-field[data-location-open='true']").forEach(l=>{if(!(l instanceof HTMLElement))return;let i=Pe(l);i instanceof HTMLElement&&(i.style.display="block"),Se(l),T5(l)})}).observe(document.body,{childList:!0,subtree:!0}),window.addEventListener("resize",()=>{document.querySelectorAll(".rae-location-field[data-location-open='true']").forEach(l=>{T5(l)})},{passive:!0}),document.addEventListener("scroll",()=>{document.querySelectorAll(".rae-location-field[data-location-open='true']").forEach(l=>{T5(l)})},!0)}typeof document<"u"&&!window.__raeValidationScrollBound&&(window.__raeValidationScrollBound=!0);function wg(t,r){t.render(ye.default.createElement(ug,{open:!0,api:r.api,context:r.context,onClose:r.onClose||(()=>{}),onSuccess:r.onSuccess,showSubmitToast:r.showSubmitToast,title:r.title}))}function xA(t){let r=(0,be.createRoot)(t.container);return wg(r,t),{update(l){wg(r,l)},unmount(){r.unmount()}}}function mS(t){let r=t.tagName||"apply-experience-add-profile";if(!customElements.get(r)){class l extends HTMLElement{connectedCallback(){this.__mountedWidget=xA({container:this,api:t.getApi(),context:t.getContext(),title:this.getAttribute("title")||void 0,onClose:t.onClose,onSuccess:t.onSuccess,showSubmitToast:t.showSubmitToast})}disconnectedCallback(){this.__mountedWidget?.unmount()}}customElements.define(r,l)}return r}function Bg(t,r){t.render(ye.default.createElement(Lg,{open:!0,api:r.api,context:r.context,onClose:r.onClose||(()=>{}),onSuccess:r.onSuccess,showSubmitToast:r.showSubmitToast,title:r.title}))}function LA(t){let r=(0,be.createRoot)(t.container);return Bg(r,t),{update(l){Bg(r,l)},unmount(){r.unmount()}}}function ZS(t){let r=t.tagName||"apply-experience-edit-profile";if(!customElements.get(r)){class l extends HTMLElement{connectedCallback(){this.__mountedWidget=LA({container:this,api:t.getApi(),context:t.getContext(),title:this.getAttribute("title")||void 0,onClose:t.onClose,onSuccess:t.onSuccess,showSubmitToast:t.showSubmitToast})}disconnectedCallback(){this.__mountedWidget?.unmount()}}customElements.define(r,l)}return r}export{xA as mountAddProfile,LA as mountEditProfile,mS as registerAddProfileElement,ZS as registerEditProfileElement};
|