@aiquants/contact-map 0.12.0 → 0.14.0

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.
package/dist/client.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var Bo=Object.create;var Nn=Object.defineProperty;var Uo=Object.getOwnPropertyDescriptor;var $o=Object.getOwnPropertyNames;var Vo=Object.getPrototypeOf,Ko=Object.prototype.hasOwnProperty;var De=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ja=(e,t)=>{for(var n in t)Nn(e,n,{get:t[n],enumerable:!0})},Za=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of $o(t))!Ko.call(e,s)&&s!==n&&Nn(e,s,{get:()=>t[s],enumerable:!(r=Uo(t,s))||r.enumerable});return e};var de=(e,t,n)=>(n=e!=null?Bo(Vo(e)):{},Za(t||!e||!e.__esModule?Nn(n,"default",{value:e,enumerable:!0}):n,e)),jo=e=>Za(Nn({},"__esModule",{value:!0}),e);var He,Mn,er,Lt,Et,Yt,Qe,We,Pn,ma,ga,Be,Z,yt=De(()=>{"use strict";He=e=>{if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null},Mn=e=>!e||typeof e!="object"?null:"item"in e?e.item??null:"person_id"in e?e:null,er=(e,t)=>{if(!e)return{value:null,fieldKey:null};for(let n of t){let r=He(e[n]);if(r)return{value:r,fieldKey:n}}return{value:null,fieldKey:null}},Lt=e=>er(e,["custom_email","email"]),Et=e=>er(e,["custom_mobile_phone_number","mobile_phone_number","company_phone_number"]),Yt=e=>{let t=He(e);if(!t)return null;let n=t.replace(/[^0-9+#*]/g,"");return n.length===0?null:`tel:${n}`},Qe=(e,t)=>{let n=He(e);return n?t?`https://mail.google.com/mail/?view=cm&fs=1&to=${encodeURIComponent(n)}`:`mailto:${encodeURIComponent(n)}`:null},We=(e,t)=>String(e).padStart(t,"0"),Pn=e=>`${We(e.getUTCFullYear(),4)}-${We(e.getUTCMonth()+1,2)}-${We(e.getUTCDate(),2)}`,ma=e=>`${Pn(e)} ${We(e.getUTCHours(),2)}:${We(e.getUTCMinutes(),2)}:${We(e.getUTCSeconds(),2)}`,ga=e=>`${We(e.getFullYear(),4)}-${We(e.getMonth()+1,2)}-${We(e.getDate(),2)} ${We(e.getHours(),2)}:${We(e.getMinutes(),2)}:${We(e.getSeconds(),2)}`,Be=(e,t)=>{if(e==null||e==="")return"-";let n=typeof e=="string"?new Date(e):e;return Number.isNaN(n.getTime())?typeof e=="string"?e:"-":t(n)},Z=e=>e==null?"-":typeof e=="string"?He(e)??"-":typeof e=="number"?Number.isFinite(e)?String(e):"-":String(e)});var se,tr,Ot=De(()=>{"use strict";se=e=>{switch(typeof e){case"string":return JSON.stringify(e);case"bigint":return`${e}n`;case"symbol":return e.toString();case"object":return e===null?"null":tr(e);case"function":return tr(e);case"number":return Object.is(e,-0)?"-0":String(e);default:return String(e)}},tr=e=>{try{return Object.prototype.toString.call(e)}catch{return"[object ?]"}}});var Dt,ke,Wt=De(()=>{"use strict";Dt=e=>{if(typeof e!="object"||e===null)return!1;try{let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}catch{return!1}},ke=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0});var qo,Rn,ha=De(()=>{"use strict";qo=(e,t)=>{let n=Array.from({length:t.length+1},(r,s)=>s);for(let r=1;r<=e.length;r+=1){let s=[r];for(let a=1;a<=t.length;a+=1){let o=n[a-1]+(e[r-1]===t[a-1]?0:1);s.push(Math.min(n[a]+1,s[a-1]+1,o))}n=s}return n[t.length]},Rn=(e,t)=>{let n=e.toLowerCase();if(n.length>=3){let s=t.find(a=>a.toLowerCase().startsWith(n));if(s!==void 0)return s}let r;for(let s of t){let a=qo(n,s.toLowerCase());a<=Math.max(1,Math.floor(s.length/4))&&(r===void 0||a<r.distance)&&(r={key:s,distance:a})}return r?.key}});var Ye,En,Go,X,bt,Ln,ar,Ht,Ue,Qo,nr,rr,Yo,fa,Xo,Jo,Zo,On,ya,ba,xt=De(()=>{"use strict";Ye=require("@aiquants/directory-tree"),En=require("@aiquants/virtualscroll");yt();Ot();Wt();ha();Go=Object.freeze({en:"en-US",ja:"ja-JP"}),X=(e,t)=>t.toLocaleString(Go[e]),bt=(e,t,n)=>e==="1"?t:n,Ln=Object.freeze({en:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"Total:",annotationCompaniesLabel:"Companies:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`Streaming (${X("en",e)} / ${X("en",t)} \xB7 ${n}%)`,annotationStreamingCount:e=>`Streaming (${X("en",e)} loaded)`,annotationLoadFailed:e=>`Failed to load (${X("en",e)} received)`,annotationReconnecting:e=>`Reconnecting (${X("en",e)} received)`,annotationAuthRequired:"Session expired: sign in again, then retry",annotationRetry:"Retry",recordUnit:e=>bt(e,"record","records"),companyUnit:e=>bt(e,"company","companies"),searchTab:"Fuzzy search",searchSettings:"Search settings",searchStatistics:"Search statistics",operatorAndTitle:"AND search (all terms match)",operatorOrTitle:"OR search (any term matches)",operatorAnd:"AND",operatorOr:"OR",operatorAndHint:"All terms",operatorOrHint:"Any term",searchPlaceholder:"Fuzzy search...",searchBusyTitle:"Searching",clearSearch:"Clear search",searching:"Searching...",registeredCountLabel:"Registered:",rebuildingIndex:"Rebuilding index...",errorLabel:"Error:",resultCountLabel:"Results:",resultUnit:e=>bt(e,"match","matches"),listViewTab:"List",treeViewTab:"Tree",columnNo:"No",columnId:"ID",columnScore:"Score",columnName:"Name",columnTitle:"Title",columnCompany:"Company",columnDepartment:"Department",columnPhone:"Phone",columnEmail:"Email",columnUpdatedAt:"Updated",listRowNumber:e=>`No. ${e}`,listNoSearchResults:"No search results found",listNoData:"No data",listResizeHandle:"Resize the border between the contact list and the detail pane",detailHeading:"Contact details",close:"Close",noName:"(No Name)",treeNodeCountTitle:"Number of nodes built in the tree view",treeNodeCountLabel:"Nodes:",treeNodeCount:e=>X("en",e),uncategorizedCompany:"Uncategorized",treeDirectoryName:(e,t)=>`${e} (${X("en",t)})`,treeStreamInterruptedTitle:"Streaming was interrupted. Only the data received so far is shown",treeStreamInterrupted:"Interrupted",treeStreamLoadingTitle:"Receiving data streamed from the network",treeStreamLoading:"Loading...",treeBuildingTitle:"Building and expanding the directory tree from the received data",treeBuilding:"Treeing...",treeCompleteTitle:"Every tree node has been built",treeComplete:"Complete",treeShowEntireCompanyTitle:"Show the whole company of every search hit",treeShowEntireCompany:"Whole company",treeExpandAll:"Expand all directories",treeExpandAllTitle:"Expand all",treeCollapseAll:"Collapse all directories",treeCollapseAllTitle:"Collapse all",treeNoMatches:"No contacts match the criteria",treeEmpty:"No contacts to display",treeResizeHandle:"Resize the border between the directory tree and the detail pane",copyField:e=>`Copy ${e}`,detailEmptyTitle:"Select a contact to see its details",detailEmptyHint:"Choose a person from the list",detailTabSummary:"Summary",detailTabBasic:"Basic info",detailBasicProfile:"Profile",detailTabContact:"Contact",detailTabMeta:"Metadata",preferred:"Preferred",summaryEmail:"Email",summaryPhone:"Phone",summaryLastContact:"Last contact",sectionEmail:"Email",sectionEmailEmpty:"No email addresses registered",sectionPhone:"Phone / Fax",sectionPhoneEmpty:"No phone numbers registered",fieldFullName:"Name",fieldFullNameReading:"Name (reading)",fieldTitle:"Title",fieldDepartment:"Department",fieldCompanyName:"Company",fieldCompanyNameReading:"Company (reading)",fieldAddress:"Address",fieldPostalCode:"Postal code",fieldUrl:"URL",fieldCustomEmail:"Custom email",fieldEmail:"Email",fieldCustomMobilePhone:"Custom mobile",fieldMobilePhone:"Mobile",fieldCompanyPhone:"Company phone",fieldCompanyFax:"Company fax",fieldCreatedBy:"Created by",fieldCreatedAt:"Created at",fieldUpdatedBy:"Updated by",fieldUpdatedAt:"Updated at",recordDateTime:ma,recordDate:Pn,popupCustomMobilePhone:"Mobile (custom)",popupMobilePhone:"Mobile",popupCustomCompanyPhone:"Company phone (custom)",popupCompanyPhone:"Company phone",popupCustomEmail:"Email (custom)",popupEmail:"Email",popupGmailHint:"Double-click or double-tap to open Gmail",popupLastContactDate:"Last contact:",popupNoContactMethods:"No contact information to display",overlayTitle:"Details",overlayBackdrop:"Tap the background to close",settingsResetAllTitle:"Reset all settings",settingsResetAll:"Reset all",settingsTabsLabel:"Search option tabs",settingsBasicTab:"Basic settings",settingsAdvancedTab:"Advanced settings",indexWorkerName:"Index Worker",levenshteinWorkerName:"Levenshtein Worker",currentValueLabel:"Current:",resetToDefaultsTitle:"Reset to defaults",reset:"Reset",relevanceOnlyNotice:"Editable only when sorting by relevance",relevanceWeightsHeading:"Relevance score weights",fieldWeight:"Field weight",scoreTuningHeading:"Score tuning",maxResults:"Maximum results",noLimit:"No limit",basicThresholdHeading:"Final similarity threshold",basicThresholdLabel:"Adjust the minimum score",basicThresholdRangeRelevance:"In relevance mode a score can exceed 1.0 (range: 0.0-1.5)",basicThresholdRange:"Range: 0.0-1.0",basicDisplayHeading:"Display options",basicCaseSensitive:"Case-sensitive",basicHighlight:"Highlight matches",basicOpenEmailsWithGmail:"Open email addresses in Gmail compose",basicMultiTermOperator:"Operator for words inside quotes",basicOperatorOr:"OR (any word matches)",basicOperatorAnd:"AND (all words match)",basicMultiTermHint:'How words between quotation marks ("tanaka taro") are combined (default: AND). Words outside quotation marks are separate keywords combined by the AND / OR button',basicSortHeading:"Sorting",basicSortBy:"Sort by",basicSortByScore:"Score",basicSortByRelevance:"Relevance",basicSortByOriginal:"Original order",basicSortOrder:"Sort order",basicSortDescending:"Descending",basicSortAscending:"Ascending",basicEngineHeading:"Search engine",basicStrategy:"Parallel search strategy",basicStrategyBalanced:"Balanced",basicStrategyIndexFirst:"Index first",basicStrategyLevenshteinFirst:"Levenshtein first",basicIndexFiltering:"Index filtering",basicLevenshtein:"Levenshtein distance",advancedLearningHeading:"Learning weight",advancedLearningLabel:"Weight factor",advancedLearningHint:"Weight applied when re-learning (higher favors past search results)",advancedDebounceHeading:"Debounce time",advancedDebounceLabel:"Input delay (ms)",advancedDebounceHint:"How long input is awaited. Shorter is more real-time, longer reduces load",indexSettingsHeading:"Index Worker settings",indexBuildHeading:"Index build",indexNgramSize:"N-gram size",indexNgramSizeHint:"How many characters each chunk holds. Smaller is faster but less accurate",indexMinNgramOverlap:"Minimum N-gram matches",indexMinNgramOverlapHint:"Candidates with fewer matches are excluded",indexCandidateHeading:"Candidate filtering",indexThreshold:"Index threshold",indexThresholdHint:"Lower bound of the Jaro-Winkler similarity (range: 0.0-1.0)",indexNgramOverlapThreshold:"N-gram overlap threshold",indexNgramOverlapThresholdHint:"How much N-grams must overlap. Higher narrows candidates more strictly",indexStrategyHeading:"Search strategy and candidates",indexStrategy:"Search strategy",indexStrategyFast:"Fast",indexStrategyAccurate:"Accurate",indexStrategyHybrid:"Hybrid (adaptive)",indexStrategyHint:"Balance processing load against accuracy",indexMinCandidatesRatio:"Minimum candidate ratio",indexMinCandidatesRatioHint:"Share of candidates always kept",indexMaxCandidatesRatio:"Maximum candidate ratio",indexMaxCandidatesRatioHint:"Upper bound on candidates; narrowed dynamically when exceeded",indexJaroWinklerPrefix:"Jaro-Winkler prefix weight",indexJaroWinklerPrefixHint:"Bonus given to a matching prefix",indexMaxResultsHint:"Maximum number of results to fetch. Larger is more thorough but slower",indexFieldWeightHint:"How much the number of matched fields counts",indexPerfectMatchBonus:"Exact match bonus",indexPerfectMatchBonusHint:"Bonus added on an exact match",indexContainmentHeading:"Containment score (Japanese / substrings)",indexContainmentBase:"Containment base score (containmentScoreBase)",indexContainmentBaseHint:"Minimum base score when the query is fully contained in the string (rescues short Japanese queries such as 2 characters)",indexContainmentCoverage:"Containment coverage weight (containmentCoverageWeight)",indexContainmentCoverageHint:"Extra score by the query length / field length ratio (total capped at 1.0)",levenshteinSettingsHeading:"Levenshtein Worker settings",levenshteinCandidateHeading:"Candidate filter",levenshteinThreshold:"Levenshtein threshold",levenshteinThresholdHintRelevance:"Keep only results at or above this threshold (range: 0.0-1.5)",levenshteinThresholdHint:"Keep only results at or above this threshold (range: 0.0-1.0)",levenshteinLengthSimilarity:"Length similarity threshold",levenshteinLengthSimilarityHint:"Exclude candidates whose length differs greatly, for speed",levenshteinLengthPenalty:"Length difference penalty",levenshteinLengthPenaltyHint:"How much a length difference is penalized. Larger favors equal lengths",levenshteinResultsHeading:"Result count",levenshteinMaxResultsHint:"Maximum number of results to return. Larger is more thorough but slower",levenshteinFieldWeightHint:"Weight of the number of matched fields",levenshteinPartialBonus:"Partial match bonus",levenshteinPartialBonusHint:"Extra score for a partial match",statsRebuildingTitle:"Rebuilding the index",statsRebuildIndexTabOnlyTitle:"Available on the Index tab only",statsRebuildTitle:"Rebuild the index",statsRebuilding:"Rebuilding...",statsRebuild:"Rebuild Index",statsResetTitle:"Reset statistics",statsOverviewTab:"Overview",statsIndexTab:"Index",statsLevenshteinTab:"Levenshtein",statTotalSearches:"Total searches",statAverageSearchTime:"Average search time",statDataCount:"Data items",statResultCount:"Search results",statDisplayedCount:"Displayed items",statsNoData:"No statistics yet",statsBasicHeading:"Basic statistics",statTotalProcessingTime:"Total processing time",statLastSearchTime:"Last search time",statErrorCount:"Errors",statUpdatedAt:"Statistics updated at",statsTimestamp:ga,statsOperationsHeading:"Operations",statTotalOperations:"Total operations",statsIndexHeading:"Index statistics",statIndexBuilds:"Index builds",statDataSize:"Data size",statLastBuildTime:"Last build time",statsCacheHeading:"Cache statistics",statCacheNgram:"N-gram",statCacheWord:"Words",statCachePhonetic:"Phonetic",statsIndexMetadataHeading:"Index metadata",statsCalculationsHeading:"Calculations",statTotalCalculations:"Total calculations",statDistanceCalculations:"Distance calculations",statAverageDistance:"Average distance",statMinDistance:"Minimum distance",statMaxDistance:"Maximum distance",notAvailable:"N/A",statsMatchesHeading:"Matches",statPartialMatches:"Partial matches",statPerfectMatches:"Exact matches",statEarlyTerminations:"Early terminations",statsSimilarityHeading:"Similarity distribution",statAbove80:"80% or more",statAbove60:"60% or more",statAbove40:"40% or more",statBelow40:"Below 40%",statsDistanceHeading:"Distance distribution (top 6)",statDistance:e=>`Distance ${e}`,statsQueryLengthHeading:"Query lengths (top 6)",statQueryLength:e=>`Length ${e}`,statQueryLengthValue:({count:e,averagePercent:t})=>{let n=X("en",e);return`${n} ${bt(n,"time","times")} / average ${t}%`},statsFieldPerformanceHeading:"Field performance (top 6)",statAverageScore:"Average score",statMatchCount:"Matches",statBestWorstScore:"Best / worst score",statsInsightsHeading:"Performance insights",statBestField:"Best-performing field",statRecentAverageTime:"Recent average processing time",statRecentAverageResults:"Recent average results",statThroughput:"Throughput",statCommonQueryLength:"Most common query length",statHistoryEntries:"History entries",statHighSimilarity:"High similarity",statMediumSimilarity:"Medium similarity",statLowSimilarity:"Low similarity",statVeryLowSimilarity:"Very low similarity",statsRecentHistoryHeading:"Recent history (latest 3)",statsHistoryEntry:({processingTimeMs:e,resultCount:t})=>`Processing time: ${e} ms / results: ${X("en",t)}`,timesUnit:e=>bt(e," time"," times"),itemsUnit:e=>bt(e," item"," items"),charactersUnit:e=>bt(e," character"," characters"),throughputUnit:" ops/s"}),ja:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"\u7DCF\u4EF6\u6570:",annotationCompaniesLabel:"\u4F01\u696D\u6570:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${X("ja",e)} / ${X("ja",t)} \u4EF6\u30FB${n}%)`,annotationStreamingCount:e=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${X("ja",e)} \u4EF6)`,annotationLoadFailed:e=>`\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F (${X("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,annotationReconnecting:e=>`\u518D\u63A5\u7D9A\u4E2D (${X("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,annotationAuthRequired:"\u30BB\u30C3\u30B7\u30E7\u30F3\u304C\u5207\u308C\u307E\u3057\u305F\u3002\u30B5\u30A4\u30F3\u30A4\u30F3\u3057\u76F4\u3057\u3066\u304B\u3089\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044",annotationRetry:"\u518D\u8A66\u884C",recordUnit:()=>"\u4EF6",companyUnit:()=>"\u793E",searchTab:"\u3042\u3044\u307E\u3044\u691C\u7D22",searchSettings:"\u691C\u7D22\u8A2D\u5B9A",searchStatistics:"\u691C\u7D22\u7D71\u8A08",operatorAndTitle:"AND \u691C\u7D22 (\u3059\u3079\u3066\u4E00\u81F4)",operatorOrTitle:"OR \u691C\u7D22 (\u3044\u305A\u308C\u304B\u4E00\u81F4)",operatorAnd:"AND",operatorOr:"OR",operatorAndHint:"\u5168\u8A9E\u4E00\u81F4",operatorOrHint:"\u3044\u305A\u308C\u304B\u4E00\u81F4",searchPlaceholder:"\u3042\u3044\u307E\u3044\u691C\u7D22...",searchBusyTitle:"\u691C\u7D22\u51E6\u7406\u4E2D",clearSearch:"\u691C\u7D22\u3092\u30AF\u30EA\u30A2",searching:"\u691C\u7D22\u4E2D...",registeredCountLabel:"\u767B\u9332\u4EF6\u6570:",rebuildingIndex:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9\u4E2D...",errorLabel:"\u30A8\u30E9\u30FC:",resultCountLabel:"\u691C\u7D22\u7D50\u679C:",resultUnit:()=>"\u4EF6",listViewTab:"\u4E00\u89A7",treeViewTab:"\u30C4\u30EA\u30FC",columnNo:"No",columnId:"ID",columnScore:"\u30B9\u30B3\u30A2",columnName:"\u6C0F\u540D",columnTitle:"\u5F79\u8077",columnCompany:"\u4F1A\u793E\u540D",columnDepartment:"\u90E8\u7F72",columnPhone:"\u96FB\u8A71\u756A\u53F7",columnEmail:"\u30E1\u30FC\u30EB",columnUpdatedAt:"\u66F4\u65B0\u65E5\u6642",listRowNumber:e=>`No. ${e}`,listNoSearchResults:"\u691C\u7D22\u7D50\u679C\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",listNoData:"\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093",listResizeHandle:"\u9023\u7D61\u5148\u4E00\u89A7\u3068\u8A73\u7D30\u30DA\u30A4\u30F3\u306E\u5883\u754C\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u30CF\u30F3\u30C9\u30EB",detailHeading:"\u9023\u7D61\u5148\u8A73\u7D30",close:"\u9589\u3058\u308B",noName:"\u540D\u524D\u672A\u8A2D\u5B9A",treeNodeCountTitle:"\u30C4\u30EA\u30FC\u30D3\u30E5\u30FC\u3067\u69CB\u7BC9\u3055\u308C\u305F\u5168\u30CE\u30FC\u30C9\u6570",treeNodeCountLabel:"\u30CE\u30FC\u30C9:",treeNodeCount:e=>`${X("ja",e)} \u500B`,uncategorizedCompany:"\u672A\u5206\u985E",treeDirectoryName:(e,t)=>`${e} (${X("ja",t)})`,treeStreamInterruptedTitle:"\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u304C\u4E2D\u65AD\u3055\u308C\u307E\u3057\u305F\u3002\u53D7\u4FE1\u6E08\u307F\u30C7\u30FC\u30BF\u306E\u307F\u8868\u793A\u3057\u3066\u3044\u307E\u3059",treeStreamInterrupted:"\u4E2D\u65AD",treeStreamLoadingTitle:"\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u304B\u3089\u306E\u30C7\u30FC\u30BF\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u3092\u53D7\u4FE1\u4E2D",treeStreamLoading:"\u8AAD\u307F\u8FBC\u307F\u4E2D...",treeBuildingTitle:"\u53D7\u53D6\u30C7\u30FC\u30BF\u3092\u57FA\u306B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30C4\u30EA\u30FC\u69CB\u9020\u3092\u6700\u7D42\u69CB\u7BC9\u30FB\u5C55\u958B\u4E2D",treeBuilding:"\u30C4\u30EA\u30FC\u69CB\u7BC9\u4E2D...",treeCompleteTitle:"\u30C4\u30EA\u30FC\u30CE\u30FC\u30C9\u306E\u5168\u4EF6\u69CB\u7BC9\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F",treeComplete:"\u5B8C\u4E86",treeShowEntireCompanyTitle:"\u691C\u7D22\u30D2\u30C3\u30C8\u3057\u305F\u4F1A\u793E\u5168\u4F53\u3092\u8868\u793A",treeShowEntireCompany:"\u5168\u4F53\u8868\u793A",treeExpandAll:"\u5168\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u5C55\u958B",treeExpandAllTitle:"\u3059\u3079\u3066\u5C55\u958B",treeCollapseAll:"\u5168\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6298\u308A\u305F\u305F\u307F",treeCollapseAllTitle:"\u3059\u3079\u3066\u6298\u308A\u305F\u305F\u307F",treeNoMatches:"\u6761\u4EF6\u306B\u4E00\u81F4\u3059\u308B\u9023\u7D61\u5148\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",treeEmpty:"\u8868\u793A\u3059\u308B\u9023\u7D61\u5148\u304C\u3042\u308A\u307E\u305B\u3093",treeResizeHandle:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30C4\u30EA\u30FC\u3068\u8A73\u7D30\u30DA\u30A4\u30F3\u306E\u5883\u754C\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u30CF\u30F3\u30C9\u30EB",copyField:e=>`\u300C${e}\u300D\u3092\u30B3\u30D4\u30FC`,detailEmptyTitle:"\u9023\u7D61\u5148\u3092\u9078\u629E\u3059\u308B\u3068\u8A73\u7D30\u304C\u8868\u793A\u3055\u308C\u307E\u3059",detailEmptyHint:"\u4E00\u89A7\u304B\u3089\u5BFE\u8C61\u306E\u4EBA\u7269\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",detailTabSummary:"\u30B5\u30DE\u30EA\u30FC",detailTabBasic:"\u57FA\u672C\u60C5\u5831",detailBasicProfile:"\u57FA\u672C\u30D7\u30ED\u30D5\u30A3\u30FC\u30EB",detailTabContact:"\u9023\u7D61\u5148",detailTabMeta:"\u30E1\u30BF\u60C5\u5831",preferred:"\u512A\u5148",summaryEmail:"\u30E1\u30FC\u30EB",summaryPhone:"\u96FB\u8A71",summaryLastContact:"\u6700\u7D42\u63A5\u89E6",sectionEmail:"\u30E1\u30FC\u30EB",sectionEmailEmpty:"\u767B\u9332\u3055\u308C\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306F\u3042\u308A\u307E\u305B\u3093",sectionPhone:"\u96FB\u8A71\u30FBFAX",sectionPhoneEmpty:"\u767B\u9332\u3055\u308C\u305F\u96FB\u8A71\u756A\u53F7\u306F\u3042\u308A\u307E\u305B\u3093",fieldFullName:"\u6C0F\u540D",fieldFullNameReading:"\u6C0F\u540D (\u304B\u306A)",fieldTitle:"\u5F79\u8077",fieldDepartment:"\u90E8\u7F72",fieldCompanyName:"\u4F1A\u793E\u540D",fieldCompanyNameReading:"\u4F1A\u793E\u540D (\u304B\u306A)",fieldAddress:"\u4F4F\u6240",fieldPostalCode:"\u90F5\u4FBF\u756A\u53F7",fieldUrl:"URL",fieldCustomEmail:"\u30AB\u30B9\u30BF\u30E0\u30E1\u30FC\u30EB",fieldEmail:"\u30E1\u30FC\u30EB",fieldCustomMobilePhone:"\u30AB\u30B9\u30BF\u30E0\u643A\u5E2F\u756A\u53F7",fieldMobilePhone:"\u643A\u5E2F\u756A\u53F7",fieldCompanyPhone:"\u4F1A\u793E\u96FB\u8A71\u756A\u53F7",fieldCompanyFax:"\u4F1A\u793E FAX \u756A\u53F7",fieldCreatedBy:"\u4F5C\u6210\u8005",fieldCreatedAt:"\u4F5C\u6210\u65E5\u6642",fieldUpdatedBy:"\u66F4\u65B0\u8005",fieldUpdatedAt:"\u66F4\u65B0\u65E5\u6642",recordDateTime:ma,recordDate:Pn,popupCustomMobilePhone:"\u643A\u5E2F\u96FB\u8A71 (\u30AB\u30B9\u30BF\u30E0)",popupMobilePhone:"\u643A\u5E2F\u96FB\u8A71",popupCustomCompanyPhone:"\u4F1A\u793E\u96FB\u8A71 (\u30AB\u30B9\u30BF\u30E0)",popupCompanyPhone:"\u4F1A\u793E\u96FB\u8A71",popupCustomEmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9 (\u30AB\u30B9\u30BF\u30E0)",popupEmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",popupGmailHint:"\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u307E\u305F\u306F\u4E8C\u5EA6\u30BF\u30C3\u30D7\u3067 Gmail \u3092\u958B\u304D\u307E\u3059",popupLastContactDate:"\u6700\u7D42\u30B3\u30F3\u30BF\u30AF\u30C8\u65E5:",popupNoContactMethods:"\u8868\u793A\u3067\u304D\u308B\u9023\u7D61\u5148\u60C5\u5831\u304C\u3042\u308A\u307E\u305B\u3093",overlayTitle:"\u8A73\u7D30",overlayBackdrop:"\u80CC\u666F\u3092\u30BF\u30C3\u30D7\u3057\u3066\u9589\u3058\u308B",settingsResetAllTitle:"\u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u30EA\u30BB\u30C3\u30C8",settingsResetAll:"\u3059\u3079\u3066\u30EA\u30BB\u30C3\u30C8",settingsTabsLabel:"\u691C\u7D22\u30AA\u30D7\u30B7\u30E7\u30F3\u8A2D\u5B9A\u30BF\u30D6",settingsBasicTab:"\u57FA\u672C\u8A2D\u5B9A",settingsAdvancedTab:"\u8A73\u7D30\u8A2D\u5B9A",indexWorkerName:"Index Worker",levenshteinWorkerName:"Levenshtein Worker",currentValueLabel:"\u73FE\u5728\u5024:",resetToDefaultsTitle:"\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u306B\u30EA\u30BB\u30C3\u30C8",reset:"\u30EA\u30BB\u30C3\u30C8",relevanceOnlyNotice:"Relevance \u30BD\u30FC\u30C8\u6642\u306E\u307F\u5909\u66F4\u53EF\u80FD",relevanceWeightsHeading:"Relevance \u30B9\u30B3\u30A2\u91CD\u307F",fieldWeight:"\u30D5\u30A3\u30FC\u30EB\u30C9\u91CD\u307F",scoreTuningHeading:"\u30B9\u30B3\u30A2\u8ABF\u6574",maxResults:"\u6700\u5927\u7D50\u679C\u6570",noLimit:"\u4E0A\u9650\u306A\u3057",basicThresholdHeading:"\u6700\u7D42\u985E\u4F3C\u5EA6\u95BE\u5024",basicThresholdLabel:"\u30B9\u30B3\u30A2\u306E\u4E0B\u9650\u3092\u8ABF\u6574",basicThresholdRangeRelevance:"Relevance \u30E2\u30FC\u30C9\u3067\u306F\u30B9\u30B3\u30A2\u304C 1.0 \u3092\u8D85\u3048\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059 (\u7BC4\u56F2: 0.0-1.5)",basicThresholdRange:"\u7BC4\u56F2: 0.0-1.0",basicDisplayHeading:"\u8868\u793A\u30AA\u30D7\u30B7\u30E7\u30F3",basicCaseSensitive:"\u5927\u6587\u5B57\u5C0F\u6587\u5B57\u3092\u533A\u5225",basicHighlight:"\u30CF\u30A4\u30E9\u30A4\u30C8\u8868\u793A",basicOpenEmailsWithGmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092 Gmail \u306E\u4F5C\u6210\u753B\u9762\u3067\u958B\u304F",basicMultiTermOperator:"\u5F15\u7528\u7B26\u306E\u4E2D\u306E\u8A9E\u306E\u6F14\u7B97\u5B50",basicOperatorOr:"OR (\u3044\u305A\u308C\u304B\u4E00\u81F4)",basicOperatorAnd:"AND (\u3059\u3079\u3066\u4E00\u81F4)",basicMultiTermHint:'\u5F15\u7528\u7B26\u3067\u56F2\u3093\u3060\u8A9E ("\u7530\u4E2D \u592A\u90CE") \u306E\u7D50\u5408\u65B9\u6CD5 (\u65E2\u5B9A\u306F AND)\u3002\u5F15\u7528\u7B26\u306E\u5916\u306E\u8A9E\u306F\u305D\u308C\u305E\u308C\u5225\u306E\u30AD\u30FC\u30EF\u30FC\u30C9\u3067\u3001AND / OR \u30DC\u30BF\u30F3\u3067\u7D50\u5408\u3059\u308B',basicSortHeading:"\u30BD\u30FC\u30C8\u8A2D\u5B9A",basicSortBy:"\u30BD\u30FC\u30C8\u57FA\u6E96",basicSortByScore:"\u30B9\u30B3\u30A2",basicSortByRelevance:"\u95A2\u9023\u6027",basicSortByOriginal:"\u5143\u306E\u9806\u5E8F",basicSortOrder:"\u30BD\u30FC\u30C8\u9806\u5E8F",basicSortDescending:"\u964D\u9806",basicSortAscending:"\u6607\u9806",basicEngineHeading:"\u691C\u7D22\u30A8\u30F3\u30B8\u30F3\u8A2D\u5B9A",basicStrategy:"\u4E26\u5217\u691C\u7D22\u6226\u7565",basicStrategyBalanced:"\u30D0\u30E9\u30F3\u30B9",basicStrategyIndexFirst:"Index \u512A\u5148",basicStrategyLevenshteinFirst:"Levenshtein \u512A\u5148",basicIndexFiltering:"Index \u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0",basicLevenshtein:"Levenshtein \u8DDD\u96E2\u8A08\u7B97",advancedLearningHeading:"\u5B66\u7FD2\u91CD\u307F",advancedLearningLabel:"\u91CD\u307F\u4FC2\u6570",advancedLearningHint:"\u518D\u5B66\u7FD2\u6642\u306E\u91CD\u307F\u4ED8\u3051 (\u5927\u304D\u3044\u307B\u3069\u904E\u53BB\u306E\u691C\u7D22\u7D50\u679C\u3092\u512A\u5148)",advancedDebounceHeading:"\u30C7\u30D0\u30A6\u30F3\u30B9\u6642\u9593",advancedDebounceLabel:"\u5165\u529B\u9045\u5EF6 (ms)",advancedDebounceHint:"\u5165\u529B\u306E\u5F85\u3061\u6642\u9593\u3002\u77ED\u3044\u307B\u3069\u30EA\u30A2\u30EB\u30BF\u30A4\u30E0\u3001\u9577\u3044\u307B\u3069\u8CA0\u8377\u8EFD\u6E1B",indexSettingsHeading:"Index Worker \u8A2D\u5B9A",indexBuildHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u69CB\u7BC9",indexNgramSize:"N-gram \u30B5\u30A4\u30BA",indexNgramSizeHint:"\u6587\u5B57\u5217\u3092\u4F55\u6587\u5B57\u5358\u4F4D\u3067\u5206\u5272\u3059\u308B\u304B\u3002\u5C0F\u3055\u3044\u307B\u3069\u9AD8\u901F\u3060\u304C\u7CBE\u5EA6\u4F4E\u4E0B",indexMinNgramOverlap:"\u6700\u5C0F N-gram \u4E00\u81F4\u6570",indexMinNgramOverlapHint:"\u4E00\u81F4\u6570\u304C\u3053\u306E\u5024\u3092\u4E0B\u56DE\u308B\u5019\u88DC\u306F\u9664\u5916",indexCandidateHeading:"\u5019\u88DC\u7D5E\u308A\u8FBC\u307F",indexThreshold:"Index \u95BE\u5024",indexThresholdHint:"Jaro-Winkler \u985E\u4F3C\u5EA6\u306E\u4E0B\u9650 (\u7BC4\u56F2: 0.0-1.0)",indexNgramOverlapThreshold:"N-gram \u91CD\u8907\u5EA6\u95BE\u5024",indexNgramOverlapThresholdHint:"N-gram \u306E\u91CD\u306A\u308A\u5177\u5408\u3002\u9AD8\u3044\u307B\u3069\u53B3\u5BC6\u306B\u5019\u88DC\u3092\u7D5E\u308B",indexStrategyHeading:"\u691C\u7D22\u6226\u7565\u3068\u5019\u88DC\u6570",indexStrategy:"\u691C\u7D22\u6226\u7565",indexStrategyFast:"Fast (\u9AD8\u901F)",indexStrategyAccurate:"Accurate (\u6B63\u78BA)",indexStrategyHybrid:"Hybrid (\u52D5\u7684)",indexStrategyHint:"\u51E6\u7406\u8CA0\u8377\u3068\u7CBE\u5EA6\u306E\u30D0\u30E9\u30F3\u30B9\u3092\u9078\u629E",indexMinCandidatesRatio:"\u6700\u5C0F\u5019\u88DC\u6BD4\u7387",indexMinCandidatesRatioHint:"\u6700\u4F4E\u9650\u78BA\u4FDD\u3059\u308B\u5019\u88DC\u5272\u5408",indexMaxCandidatesRatio:"\u6700\u5927\u5019\u88DC\u6BD4\u7387",indexMaxCandidatesRatioHint:"\u5019\u88DC\u6570\u306E\u4E0A\u9650\u3002\u8D85\u3048\u308B\u3068\u52D5\u7684\u306B\u7D5E\u308A\u8FBC\u307F",indexJaroWinklerPrefix:"Jaro-Winkler \u63A5\u982D\u8F9E\u91CD\u307F",indexJaroWinklerPrefixHint:"\u5148\u982D\u4E00\u81F4\u306B\u4ED8\u4E0E\u3059\u308B\u30DC\u30FC\u30CA\u30B9\u5024",indexMaxResultsHint:"\u53D6\u5F97\u3059\u308B\u6700\u5927\u4EF6\u6570\u3002\u5927\u304D\u3044\u307B\u3069\u5305\u62EC\u7684\u3060\u304C\u9045\u5EF6\u304C\u5897\u52A0",indexFieldWeightHint:"\u30DE\u30C3\u30C1\u30D5\u30A3\u30FC\u30EB\u30C9\u6570\u306B\u3069\u308C\u3060\u3051\u91CD\u307F\u4ED8\u3051\u3059\u308B\u304B",indexPerfectMatchBonus:"\u5B8C\u5168\u4E00\u81F4\u30DC\u30FC\u30CA\u30B9",indexPerfectMatchBonusHint:"\u5B8C\u5168\u4E00\u81F4\u6642\u306B\u8FFD\u52A0\u3059\u308B\u30DC\u30FC\u30CA\u30B9\u5024",indexContainmentHeading:"\u548C\u6587\u30FB\u90E8\u5206\u6587\u5B57\u5217\u5305\u542B\u30B9\u30B3\u30A2",indexContainmentBase:"\u5305\u542B \u57FA\u790E\u30B9\u30B3\u30A2 (containmentScoreBase)",indexContainmentBaseHint:"\u30AF\u30A8\u30EA\u304C\u6587\u5B57\u5217\u4E2D\u306B\u5B8C\u5168\u306B\u542B\u307E\u308C\u308B\u5834\u5408\u306E\u6700\u4F4E\u57FA\u790E\u30B9\u30B3\u30A2 (\u548C\u6587 2 \u6587\u5B57\u7B49\u306E\u6551\u6E08)",indexContainmentCoverage:"\u5305\u542B \u88AB\u8986\u7387\u91CD\u307F (containmentCoverageWeight)",indexContainmentCoverageHint:"\u30AF\u30A8\u30EA\u9577 / \u30D5\u30A3\u30FC\u30EB\u30C9\u9577\u306E\u6BD4\u7387\u306B\u5FDC\u3058\u305F\u52A0\u7B97\u30B9\u30B3\u30A2 (\u5408\u8A08 1.0 \u4EE5\u4E0B\u306B\u5236\u9650)",levenshteinSettingsHeading:"Levenshtein Worker \u8A73\u7D30\u8A2D\u5B9A",levenshteinCandidateHeading:"\u5019\u88DC\u30D5\u30A3\u30EB\u30BF",levenshteinThreshold:"Levenshtein \u95BE\u5024",levenshteinThresholdHintRelevance:"\u3053\u306E\u95BE\u5024\u4EE5\u4E0A\u306E\u7D50\u679C\u306E\u307F\u4FDD\u6301 (\u7BC4\u56F2: 0.0-1.5)",levenshteinThresholdHint:"\u3053\u306E\u95BE\u5024\u4EE5\u4E0A\u306E\u7D50\u679C\u306E\u307F\u4FDD\u6301 (\u7BC4\u56F2: 0.0-1.0)",levenshteinLengthSimilarity:"\u9577\u3055\u985E\u4F3C\u5EA6\u95BE\u5024",levenshteinLengthSimilarityHint:"\u9577\u3055\u304C\u5927\u304D\u304F\u7570\u306A\u308B\u5019\u88DC\u3092\u4E8B\u524D\u306B\u9664\u5916\u3057\u3066\u901F\u5EA6\u5411\u4E0A",levenshteinLengthPenalty:"\u9577\u3055\u5DEE\u30DA\u30CA\u30EB\u30C6\u30A3",levenshteinLengthPenaltyHint:"\u9577\u3055\u5DEE\u3092\u3069\u308C\u3060\u3051\u6E1B\u70B9\u3059\u308B\u304B\u3002\u5927\u304D\u3044\u307B\u3069\u9577\u3055\u4E00\u81F4\u3092\u91CD\u8996",levenshteinResultsHeading:"\u7D50\u679C\u6570\u5236\u5FA1",levenshteinMaxResultsHint:"\u8FD4\u5374\u3059\u308B\u6700\u5927\u4EF6\u6570\u3002\u5927\u304D\u3044\u307B\u3069\u7DB2\u7F85\u7684\u3060\u304C\u51E6\u7406\u6642\u9593\u304C\u5897\u52A0",levenshteinFieldWeightHint:"\u4E00\u81F4\u30D5\u30A3\u30FC\u30EB\u30C9\u6570\u306E\u8A55\u4FA1\u91CD\u307F",levenshteinPartialBonus:"\u90E8\u5206\u4E00\u81F4\u30DC\u30FC\u30CA\u30B9",levenshteinPartialBonusHint:"\u90E8\u5206\u4E00\u81F4\u306B\u4ED8\u4E0E\u3059\u308B\u8FFD\u52A0\u30B9\u30B3\u30A2",statsRebuildingTitle:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9\u4E2D",statsRebuildIndexTabOnlyTitle:"Index \u30BF\u30D6\u3067\u306E\u307F\u4F7F\u7528\u53EF\u80FD",statsRebuildTitle:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u3092\u518D\u69CB\u7BC9",statsRebuilding:"\u518D\u69CB\u7BC9\u4E2D...",statsRebuild:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9",statsResetTitle:"\u7D71\u8A08\u3092\u30EA\u30BB\u30C3\u30C8",statsOverviewTab:"\u6982\u8981",statsIndexTab:"Index",statsLevenshteinTab:"Levenshtein",statTotalSearches:"\u7DCF\u691C\u7D22\u56DE\u6570",statAverageSearchTime:"\u5E73\u5747\u691C\u7D22\u6642\u9593",statDataCount:"\u30C7\u30FC\u30BF\u4EF6\u6570",statResultCount:"\u691C\u7D22\u7D50\u679C\u4EF6\u6570",statDisplayedCount:"\u8868\u793A\u4EF6\u6570",statsNoData:"\u7D71\u8A08\u30C7\u30FC\u30BF\u306A\u3057",statsBasicHeading:"\u57FA\u672C\u7D71\u8A08",statTotalProcessingTime:"\u7DCF\u51E6\u7406\u6642\u9593",statLastSearchTime:"\u6700\u5F8C\u306E\u691C\u7D22\u6642\u9593",statErrorCount:"\u30A8\u30E9\u30FC\u6570",statUpdatedAt:"\u7D71\u8A08\u66F4\u65B0\u6642\u523B",statsTimestamp:ga,statsOperationsHeading:"\u64CD\u4F5C\u7D71\u8A08",statTotalOperations:"\u7DCF\u64CD\u4F5C\u6570",statsIndexHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u7D71\u8A08",statIndexBuilds:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u69CB\u7BC9\u56DE\u6570",statDataSize:"\u30C7\u30FC\u30BF\u30B5\u30A4\u30BA",statLastBuildTime:"\u6700\u5F8C\u306E\u69CB\u7BC9\u6642\u9593",statsCacheHeading:"\u30AD\u30E3\u30C3\u30B7\u30E5\u7D71\u8A08",statCacheNgram:"N-gram",statCacheWord:"\u5358\u8A9E",statCachePhonetic:"\u97F3\u97FB",statsIndexMetadataHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u30E1\u30BF\u30C7\u30FC\u30BF",statsCalculationsHeading:"\u8A08\u7B97\u7D71\u8A08",statTotalCalculations:"\u7DCF\u8A08\u7B97\u6570",statDistanceCalculations:"\u8DDD\u96E2\u8A08\u7B97\u6570",statAverageDistance:"\u5E73\u5747\u8DDD\u96E2",statMinDistance:"\u6700\u5C0F\u8DDD\u96E2",statMaxDistance:"\u6700\u5927\u8DDD\u96E2",notAvailable:"N/A",statsMatchesHeading:"\u30DE\u30C3\u30C1\u7D71\u8A08",statPartialMatches:"\u90E8\u5206\u30DE\u30C3\u30C1\u6570",statPerfectMatches:"\u5B8C\u5168\u30DE\u30C3\u30C1\u6570",statEarlyTerminations:"\u65E9\u671F\u7D42\u4E86\u6570",statsSimilarityHeading:"\u985E\u4F3C\u5EA6\u5206\u5E03",statAbove80:"80% \u4EE5\u4E0A",statAbove60:"60% \u4EE5\u4E0A",statAbove40:"40% \u4EE5\u4E0A",statBelow40:"40% \u672A\u6E80",statsDistanceHeading:"\u8DDD\u96E2\u5206\u5E03 (\u4E0A\u4F4D 6)",statDistance:e=>`\u8DDD\u96E2 ${e}`,statsQueryLengthHeading:"\u30AF\u30A8\u30EA\u9577\u7D71\u8A08 (\u4E0A\u4F4D 6)",statQueryLength:e=>`\u9577\u3055 ${e}`,statQueryLengthValue:({count:e,averagePercent:t})=>`${X("ja",e)} \u56DE / \u5E73\u5747 ${t}%`,statsFieldPerformanceHeading:"\u30D5\u30A3\u30FC\u30EB\u30C9\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9 (\u4E0A\u4F4D 6)",statAverageScore:"\u5E73\u5747\u30B9\u30B3\u30A2",statMatchCount:"\u30DE\u30C3\u30C1\u6570",statBestWorstScore:"\u6700\u9AD8 / \u6700\u4F4E\u30B9\u30B3\u30A2",statsInsightsHeading:"\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6D1E\u5BDF",statBestField:"\u6700\u9AD8\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u30D5\u30A3\u30FC\u30EB\u30C9",statRecentAverageTime:"\u6700\u8FD1\u306E\u5E73\u5747\u51E6\u7406\u6642\u9593",statRecentAverageResults:"\u6700\u8FD1\u306E\u5E73\u5747\u7D50\u679C\u6570",statThroughput:"\u30B9\u30EB\u30FC\u30D7\u30C3\u30C8",statCommonQueryLength:"\u6700\u983B\u51FA\u30AF\u30A8\u30EA\u9577",statHistoryEntries:"\u5C65\u6B74\u30A8\u30F3\u30C8\u30EA\u6570",statHighSimilarity:"\u9AD8\u985E\u4F3C",statMediumSimilarity:"\u4E2D\u985E\u4F3C",statLowSimilarity:"\u4F4E\u985E\u4F3C",statVeryLowSimilarity:"\u6975\u4F4E\u985E\u4F3C",statsRecentHistoryHeading:"\u6700\u8FD1\u306E\u5C65\u6B74 (\u6700\u65B0 3 \u4EF6)",statsHistoryEntry:({processingTimeMs:e,resultCount:t})=>`\u51E6\u7406\u6642\u9593: ${e} ms / \u7D50\u679C: ${X("ja",t)} \u4EF6`,timesUnit:()=>" \u56DE",itemsUnit:()=>" \u4EF6",charactersUnit:()=>" \u6587\u5B57",throughputUnit:" ops/\u79D2"})}),ar=Object.freeze(Object.keys(Ln.en)),Ht=Object.freeze([...Ye.DIRECTORY_TREE_LABEL_KEYS,...ar]),Ue=Object.freeze({en:Object.freeze({...Ye.DIRECTORY_TREE_LABEL_CATALOGS.en,...Ln.en}),ja:Object.freeze({...Ye.DIRECTORY_TREE_LABEL_CATALOGS.ja,...Ln.ja})}),Qo=new Set(Ht),nr=Object.keys(Ue).map(e=>JSON.stringify(e)).join(" or "),rr=Object.freeze({locale:"locale",labels:"labels"}),Yo=(e,t,n)=>{e[t]=n},fa=(e,t=rr.locale)=>{if(e!==void 0&&typeof e!="string")throw new TypeError(`[contact-map] ${t} must be ${nr} or left out; got ${se(e)}`);if(e!==void 0&&!Object.hasOwn(Ue,e))throw new RangeError(`[contact-map] ${t} must be ${nr} or left out; got ${se(e)}`);return(0,En.resolveVirtualScrollLocale)(e)},Xo=(e,t,n,r)=>{if(typeof r=="function"){if(typeof n!="function")throw new TypeError(`[contact-map] ${e}.${t} must be a function; got ${se(n)}`);return}if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string; got ${se(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${se(n)}`)},Jo=(e,t,n)=>{let r=Object.create(null);for(let s of Object.getOwnPropertyNames(e)){if(!Qo.has(s)){let o=Rn(s,Ht);throw new RangeError(`[contact-map] ${n} has a key that is not a label key (${o===void 0?"":`did you mean ${JSON.stringify(o)}? `}CONTACT_MAP_LABEL_KEYS lists every key); got ${se(s)}`)}let a=e[s];a!==void 0&&(Xo(n,s,a,t[s]),r[s]=a)}return r},Zo=e=>{let t={},n=!1;for(let r of Ye.DIRECTORY_TREE_LABEL_KEYS){let s=e[r];s!==void 0&&(t[r]=s,n=!0)}return n?t:void 0},On=(e,t,n=rr)=>{let r=fa(e,n.locale);if(t===void 0)return Ue[r];if(!Dt(t))throw new TypeError(`[contact-map] ${n.labels} must be a plain object or left out; got ${se(t)}`);let s=Jo(t,Ue[r],n.labels),o={...(0,Ye.resolveDirectoryTreeLabels)(r,Zo(s)),...Ln[r]};for(let d of ar){let l=s[d];l!==void 0&&Yo(o,d,l)}return Object.freeze(o)},ya=e=>{let t={};for(let n of Ye.DIRECTORY_TREE_LABEL_KEYS)t[n]=e[n];return Object.freeze(t)},ba=e=>{let t={};for(let n of En.VIRTUAL_SCROLL_LABEL_KEYS)t[n]=e[n];return Object.freeze(t)}});var or,sr,$e,lr,es,va,xa,ir,Se,J,ce=De(()=>{"use strict";or=require("@aiquants/directory-tree"),sr=require("@aiquants/virtualscroll"),$e=require("react");xt();lr=require("react/jsx-runtime"),es=Object.freeze({locale:"en",labels:Ue.en,treeLabels:ya(Ue.en),engineLabels:ba(Ue.en)}),va=(0,$e.createContext)(es),xa=(e,t)=>{let n=(0,$e.useRef)(null),r=n.current;return r!==null&&t.every(s=>r[s]===e[s])?r:(n.current=e,e)},ir=({locale:e,labels:t,surface:n,children:r})=>{let s=fa(e,n.locale),a=(0,$e.useMemo)(()=>On(s,t,n),[s,t,n]),o=xa(a,Ht),d=xa(ya(o),or.DIRECTORY_TREE_LABEL_KEYS),l=xa(ba(o),sr.VIRTUAL_SCROLL_LABEL_KEYS),c=(0,$e.useMemo)(()=>({locale:s,labels:o,treeLabels:d,engineLabels:l}),[s,o,d,l]);return(0,lr.jsx)(va.Provider,{value:c,children:r})},Se=()=>(0,$e.useContext)(va),J=()=>(0,$e.useContext)(va).labels});var Hn,Ca=De(()=>{"use strict";Hn=e=>e.isComposing||e.keyCode===229});var ur,pr,mr,te,gr,B,ts,dr,Jt,At,ns,as,_t,ka,cr,Sa,Zt,Ta=De(()=>{"use strict";ur=de(require("lucide-react/dist/esm/icons/check.js")),pr=de(require("lucide-react/dist/esm/icons/copy.js")),mr=de(require("lucide-react/dist/esm/icons/x.js")),te=require("react"),gr=require("react-dom");yt();ce();Ca();B=require("react/jsx-runtime"),ts=350,dr=["dblclick","pointerdown","pointerup","mousedown","mouseup","touchstart","touchend","contextmenu"],Jt=0,At=null,ns=()=>{let e=document.body.style;Jt+=1,Jt===1&&(At={userSelect:e.userSelect,webkitUserSelect:e.webkitUserSelect}),e.userSelect="none",typeof e.webkitUserSelect<"u"&&(e.webkitUserSelect="none")},as=()=>{if(Jt=Math.max(0,Jt-1),Jt>0||!At)return;let e=document.body.style;e.userSelect=At.userSelect,typeof At.webkitUserSelect<"u"&&(e.webkitUserSelect=At.webkitUserSelect),At=null},_t=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},ka=(e,t)=>{let n=new Set;return e.reduce((r,s)=>{let a=typeof s.value=="string"?s.value.trim():"";if(!a)return r;let{normalized:o,key:d,entry:l}=t(a,s);return o&&!n.has(d)&&(n.add(d),r.push(l(o))),r},[])},cr=(e,t)=>e===t,Sa=({value:e,ariaLabel:t,size:n="md"})=>{let[r,s]=(0,te.useState)(!1),a=(0,te.useRef)(null),o=(0,te.useCallback)(async u=>{if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(u),!0}catch{}if(typeof document>"u")return!1;let i=document.createElement("textarea");i.value=u,i.setAttribute("readonly",""),i.style.position="absolute",i.style.left="-9999px",document.body.appendChild(i),i.select(),i.setSelectionRange(0,i.value.length);let p=document.execCommand("copy");return document.body.removeChild(i),p},[]),d=(0,te.useCallback)(async u=>{u.preventDefault(),u.stopPropagation(),a.current!==null&&typeof window<"u"&&(window.clearTimeout(a.current),a.current=null);let i=await o(e);s(i),i&&typeof window<"u"&&(a.current=window.setTimeout(()=>{s(!1),a.current=null},1500))},[o,e]);(0,te.useEffect)(()=>()=>{a.current!==null&&typeof window<"u"&&(window.clearTimeout(a.current),a.current=null)},[]);let l=n==="sm"?"h-6 w-6":"h-7 w-7",c=n==="sm"?"h-3.5 w-3.5":"h-4 w-4",m=r?ur.default:pr.default;return(0,B.jsx)("button",{type:"button",className:`inline-flex ${l} shrink-0 items-center justify-center rounded-md border border-gray-200 text-slate-600 transition-colors hover:bg-gray-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-200 dark:text-slate-300`,onClick:d,"aria-label":t,title:t,children:(0,B.jsx)(m,{className:c,"aria-hidden":"true"})})},Zt=({contactData:e,openEmailsWithGmail:t,openGmailCompose:n,onRequestClose:r})=>{let s=J(),[a,o]=(0,te.useState)(null);(0,te.useEffect)(()=>{o(document.body)},[]);let d=(0,te.useRef)(null),l=(0,te.useRef)(null),c=(0,te.useMemo)(()=>e.contacted_at?Be(e.contacted_at,s.recordDate):null,[e.contacted_at,s.recordDate]),m=_t(e.full_name)??s.noName,u=_t(e.company_name),i=_t(e.department),p=_t(e.title),f=(0,te.useMemo)(()=>ka([{fieldKey:"company_name",label:s.fieldCompanyName,value:u},{fieldKey:"department",label:s.fieldDepartment,value:i},{fieldKey:"title",label:s.fieldTitle,value:p}],(h,{fieldKey:v,label:F})=>({normalized:h,key:`${v}-${h.toLowerCase()}`,entry:P=>({fieldKey:v,label:F,value:P})})),[u,i,p,s]),T=(0,te.useMemo)(()=>ka([{fieldKey:"custom_mobile_phone_number",label:s.popupCustomMobilePhone,value:e.custom_mobile_phone_number},{fieldKey:"mobile_phone_number",label:s.popupMobilePhone,value:e.mobile_phone_number},{fieldKey:"custom_company_phone_number",label:s.popupCustomCompanyPhone,value:e.custom_company_phone_number},{fieldKey:"company_phone_number",label:s.popupCompanyPhone,value:e.company_phone_number}],(h,{fieldKey:v,label:F})=>{let P=Yt(h);return{normalized:_t(h),key:(P??h).toLowerCase(),entry:L=>({fieldKey:v,label:F,value:L,href:P})}}),[e.custom_mobile_phone_number,e.mobile_phone_number,e.custom_company_phone_number,e.company_phone_number,s]),S=(0,te.useMemo)(()=>ka([{fieldKey:"custom_email",label:s.popupCustomEmail,value:e.custom_email},{fieldKey:"email",label:s.popupEmail,value:e.email}],(h,{fieldKey:v,label:F})=>{let P=_t(h),ae=Qe(h,t),L=!!ae?.startsWith("https://mail.google.com");return{normalized:P,key:h.toLowerCase(),entry:E=>({fieldKey:v,label:F,value:E,href:ae,isGmailLink:L})}}),[e.custom_email,e.email,t,s]),w=T.length>0||S.length>0,V=(0,te.useMemo)(()=>`contact-methods-${e.person_id}`,[e.person_id]),H=(0,te.useCallback)(h=>{r(h),l.current=null},[r]),y=(0,te.useCallback)(h=>{h.stopPropagation(),cr(h.target,h.currentTarget)&&H()},[H]),g=(0,te.useCallback)(h=>{h.stopPropagation(),cr(h.target,h.currentTarget)&&(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),H())},[H]),$=(0,te.useCallback)(h=>{h.stopPropagation(),H()},[H]),q=(0,te.useCallback)((h,v)=>{v.isGmailLink&&(h.preventDefault(),n(v.value))},[n]),k=(0,te.useCallback)((h,v)=>{if(!v.isGmailLink){l.current=null;return}let F=Date.now(),P=l.current;if(P&&P.email===v.value&&F-P.timestamp<=ts){l.current=null,h.preventDefault(),n(v.value);return}l.current={email:v.value,timestamp:F}},[n]);return(0,te.useEffect)(()=>{let h=[];if(typeof window<"u"){let v=F=>{if(F.key==="Escape"&&!Hn(F)){H();return}if(F.key==="Tab"&&d.current){let P=d.current.querySelectorAll('a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])');if(P.length===0)return;let ae=P[0],L=P[P.length-1];F.shiftKey?document.activeElement===ae&&(F.preventDefault(),L.focus()):document.activeElement===L&&(F.preventDefault(),ae.focus())}};window.addEventListener("keydown",v),h.push(()=>window.removeEventListener("keydown",v))}if(typeof document<"u"){let v=d.current;if(v){let L=E=>{E.stopPropagation()};for(let E of dr)v.addEventListener(E,L);h.push(()=>{for(let E of dr)v.removeEventListener(E,L)})}let F=L=>{let E=d.current;return E&&L instanceof Node?E.contains(L):!1},P=L=>{F(L.target)||H({suppressLongPress:!0,cancelLongPressTimer:!0})},ae=["pointerdown","wheel","touchmove"];for(let L of ae)document.addEventListener(L,P,!0);h.push(()=>{for(let L of ae)document.removeEventListener(L,P,!0)}),ns(),h.push(as)}return()=>{for(let v of h)v()}},[H,a]),a?(0,gr.createPortal)((0,B.jsx)("div",{"data-contact-popup-root":"true",className:"fixed top-0 right-0 bottom-0 left-0 z-50 flex items-center justify-center bg-black/50 px-4 py-6",style:{right:"var(--aqcm-overlay-right, 0px)",transition:"right 0.5s"},role:"dialog","aria-modal":"true","aria-labelledby":V,tabIndex:-1,onClick:y,onKeyDown:g,children:(0,B.jsxs)("div",{ref:d,className:"w-full max-w-md rounded-lg border border-slate-200 bg-white p-4 shadow-lg transition-colors dark:border-transparent dark:bg-slate-900 dark:shadow-slate-950/40 dark:ring-1 dark:ring-white/70",children:[(0,B.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,B.jsxs)("div",{children:[(0,B.jsx)("h2",{id:V,className:"font-semibold text-gray-900 text-lg dark:text-slate-100",children:m}),f.length>0?(0,B.jsx)("div",{className:"mt-2 space-y-2 text-slate-700 text-sm dark:text-slate-200",children:f.map(h=>(0,B.jsxs)("div",{className:"flex items-center gap-3",children:[(0,B.jsx)("p",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:h.value}),(0,B.jsx)(Sa,{value:h.value,ariaLabel:s.copyField(h.label),size:"sm"})]},h.fieldKey))}):null]}),(0,B.jsx)("button",{type:"button",className:"rounded-md p-0.5 text-slate-600 transition-colors hover:bg-gray-100 focus:outline-none focus-visible:ring focus-visible:ring-blue-200 dark:text-slate-300 dark:hover:bg-slate-800/70",onClick:$,"aria-label":s.close,children:(0,B.jsx)(mr.default,{className:"h-4 w-4","aria-hidden":"true"})})]}),(0,B.jsxs)("div",{className:"mt-4 space-y-4 text-slate-700 dark:text-slate-200",children:[T.length>0?(0,B.jsx)("div",{children:(0,B.jsx)("ul",{className:"space-y-3 text-sm",children:T.map(h=>(0,B.jsx)("li",{className:"flex items-start gap-3",children:(0,B.jsxs)("div",{className:"flex-1",children:[(0,B.jsx)("span",{className:"text-slate-600 text-xs dark:text-slate-300",children:h.label}),(0,B.jsxs)("div",{className:"mt-1 flex items-center gap-3",children:[(0,B.jsx)("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:h.href?(0,B.jsx)("a",{href:h.href,className:"wrap-break-word text-blue-600 underline-offset-2 transition-colors hover:underline focus:underline focus:outline-none dark:text-blue-300",children:h.value}):(0,B.jsx)("span",{className:"wrap-break-word text-slate-800 dark:text-slate-100",children:h.value})}),(0,B.jsx)(Sa,{value:h.value,ariaLabel:s.copyField(h.label),size:"sm"})]})]})},`${h.fieldKey}-${h.value}`))})}):null,S.length>0?(0,B.jsx)("div",{children:(0,B.jsx)("ul",{className:"space-y-3 text-sm",children:S.map(h=>(0,B.jsx)("li",{className:"flex items-start gap-3",children:(0,B.jsxs)("div",{className:"flex-1",children:[(0,B.jsx)("span",{className:"text-slate-600 text-xs dark:text-slate-300",children:h.label}),(0,B.jsxs)("div",{className:"mt-1 flex items-start gap-3",children:[(0,B.jsxs)("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:[h.href?(0,B.jsx)("a",{href:h.href,className:"wrap-break-word text-blue-600 underline-offset-2 transition-colors hover:underline focus:underline focus:outline-none dark:text-blue-300",target:h.isGmailLink?"_blank":void 0,rel:h.isGmailLink?"noopener noreferrer":void 0,onDoubleClick:v=>q(v,h),onTouchEnd:v=>k(v,h),children:h.value}):(0,B.jsx)("span",{className:"wrap-break-word text-slate-800 dark:text-slate-100",children:h.value}),h.isGmailLink?(0,B.jsx)("span",{className:"mt-1 block text-[11px] text-slate-500 dark:text-slate-400",children:s.popupGmailHint}):null]}),(0,B.jsx)(Sa,{value:h.value,ariaLabel:s.copyField(h.label),size:"sm"})]})]})},`${h.fieldKey}-${h.value}`))})}):null,c?(0,B.jsxs)("div",{className:"mt-2 flex items-center gap-2 text-slate-600 text-sm dark:text-slate-300",children:[(0,B.jsx)("span",{className:"text-xs",children:s.popupLastContactDate}),(0,B.jsx)("span",{children:c})]}):null,w?null:(0,B.jsx)("p",{className:"text-slate-600 text-sm dark:text-slate-300",children:s.popupNoContactMethods})]})]})}),a):null}});var pe,en,wa=De(()=>{"use strict";pe=require("react/jsx-runtime"),en=({fullName:e,title:t="-",companyName:n="-",department:r="-",phoneNumber:s="-",email:a="-",updatedAtText:o="-"})=>(0,pe.jsxs)("div",{className:"flex h-full w-full flex-col justify-center gap-0.5 text-slate-800 text-xs leading-tight transition-colors sm:grid sm:grid-cols-3 sm:gap-2 sm:text-sm xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto] dark:text-slate-200",children:[(0,pe.jsxs)("div",{className:"flex items-center gap-1 sm:hidden",children:[(0,pe.jsx)("div",{className:"flex-1 truncate font-medium text-gray-900 text-sm leading-tight dark:text-slate-100",children:e}),(0,pe.jsx)("div",{className:"shrink-0 whitespace-nowrap text-[11px] text-slate-600 dark:text-slate-300",children:s})]}),(0,pe.jsx)("div",{className:"flex items-center gap-1 sm:hidden",children:(0,pe.jsx)("div",{className:"flex-1 truncate text-slate-700 text-xs leading-tight dark:text-slate-200",children:n})}),(0,pe.jsx)("div",{className:"block sm:hidden",children:(0,pe.jsx)("span",{className:"w-full truncate text-left text-[11px] text-slate-700 leading-tight dark:text-slate-200",children:r})}),(0,pe.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,pe.jsx)("span",{className:"truncate font-medium text-gray-900 dark:text-slate-100",children:e}),(0,pe.jsx)("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:t})]}),(0,pe.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,pe.jsx)("span",{className:"truncate text-slate-800 dark:text-slate-100",children:n}),(0,pe.jsx)("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:r})]}),(0,pe.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,pe.jsx)("span",{className:"truncate text-slate-700 dark:text-slate-200",children:s}),(0,pe.jsx)("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:a})]}),(0,pe.jsx)("div",{className:"hidden items-end justify-end text-[11px] text-slate-600 xl:flex dark:text-slate-300",children:(0,pe.jsx)("span",{className:"truncate",children:o})})]})});var _n,It,yr,rs,os,ss,is,br,xr,ls,ds,cs,us,ps,ms,gs,hs,vr,Cr,hr,fr,An,fs,ys,Na,kr,Ma=De(()=>{"use strict";_n=require("@aiquants/fuzzy-search"),It=require("@aiquants/select-box"),yr=/[​]/g,rs=/^[\s  ]+|[\s  ]+$/g,os=/\s+/,ss=/^[\p{Script=Latin}\s]+$/u,is=/\p{Script=Latin}/u,br=Object.freeze({convertWidth:!0,convertKana:!0,convertCase:!0,convertRomaji:!1,normalizeVariants:!1,ignoreSpaces:!1,ignoreSymbols:!1,ignoreLongVowels:!1}),xr="union",ls=65377,ds=65439,cs=["\uFF9E","\uFF9F"],us=(()=>{let e=new Map;for(let t=ls;t<=ds;t+=1){let n=String.fromCharCode(t);e.set(n.normalize("NFKC"),n);for(let r of cs){let s=(n+r).normalize("NFKC");s.length===1&&e.set(s,n+r)}}return e})(),ps=/[぀-ヿ]/u,ms=e=>{let t=Array.from(e,n=>us.get(n)??n).join("");return ps.test(t)?null:t},gs=e=>(0,It.normalizeText)(e.replace(yr,"").replace(rs,""),br),hs=e=>{if(!ss.test(e))return null;let t=(0,It.romajiToKatakana)(e);return is.test(t)?null:t},vr=e=>e.split(os).filter(Boolean),Cr=e=>(0,_n.parseQuerySets)(e,xr).sets.map(({query:t})=>t),hr=e=>Cr(e).flatMap(t=>vr(t)),fr=e=>(0,_n.formatQuerySets)({combine:xr,sets:Array.from(new Set(e),t=>({query:t}))}),An=e=>{let t=Cr(e.replace(yr,"")).map(r=>vr(gs(r)).join(" ")).filter(r=>r!==""),n=[];for(let r of t){let s=hs(r);if(s===null)return fr(t);n.push(s)}return fr(n)},fs=e=>{let t=new Set([...hr(e),...hr(An(e))]),n=new Set;for(let r of t)for(let s of(0,It.getNormalizedVariants)(r,br)){let a=s.trim();if(!a)continue;n.add(a);let o=ms(a);o!==null&&n.add(o)}return Array.from(n)},ys=/[.*+?^${}()|[\]\\]/g,Na=e=>{let t=fs(e);if(t.length===0)return null;let n=t.map(r=>r.replace(ys,"\\$&")).sort((r,s)=>s.length-r.length);return new RegExp(n.join("|"),"gi")},kr=(e,t)=>{let n=Na(e);if(n===null)return s=>s;let r=s=>t.some(a=>{let o=s[a];return typeof o=="string"&&o.search(n)!==-1});return s=>{let a=[],o=[];for(let d of s)r(d.item)?a.push(d):o.push(d);return[...a,...o]}}});var Sr,Xe,bs,he,In=De(()=>{"use strict";Sr=require("react");Ma();Xe=require("react/jsx-runtime"),bs="rounded bg-yellow-200 px-1 text-gray-900 dark:bg-yellow-900 dark:text-yellow-100",he=(0,Sr.memo)(({text:e,query:t,enabled:n=!0})=>{if(!(n&&t?.trim()&&e))return(0,Xe.jsx)(Xe.Fragment,{children:e});let r=Na(t);if(r===null)return(0,Xe.jsx)(Xe.Fragment,{children:e});let s=[],a=0,o=r.exec(e),d=0;for(;o;){let l=o[0],c=o.index;if(c>a&&s.push(e.substring(a,c)),l.length===0){r.lastIndex++,o=r.exec(e);continue}s.push((0,Xe.jsx)("mark",{className:bs,children:l},`highlight-${c}-${d}`)),a=c+l.length,d+=1,o=r.exec(e)}return a<e.length&&s.push(e.substring(a)),(0,Xe.jsx)(Xe.Fragment,{children:s})});he.displayName="HighlightedText"});var Tr={};Ja(Tr,{ContactDetailGrid:()=>Pa,default:()=>xs});var zn,ut,Fn,Pa,xs,wr=De(()=>{"use strict";zn=require("react");yt();ce();Ta();wa();In();ut=require("react/jsx-runtime"),Fn=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},Pa=({contactData:e,searchTerm:t,enableHighlighting:n,openEmailsWithGmail:r,openGmailCompose:s,isPopupVisible:a,onRequestClose:o})=>{let d=J(),l=(0,zn.useMemo)(()=>Lt(e),[e]),c=(0,zn.useMemo)(()=>Et(e),[e]),m=l.value??"-",u=c.value??"-",i=(0,zn.useMemo)(()=>Be(e.updated_at,d.recordDateTime),[e.updated_at,d.recordDateTime]),p=Fn(e.full_name)??d.noName,f=Fn(e.company_name),T=Fn(e.department),S=(w,V="-")=>(0,ut.jsx)(he,{text:w??V,query:t,enabled:n});return(0,ut.jsxs)(ut.Fragment,{children:[(0,ut.jsx)(en,{fullName:S(p),title:S(Fn(e.title)),companyName:S(f),department:S(T),phoneNumber:u,email:S(m),updatedAtText:i}),a?(0,ut.jsx)(Zt,{contactData:e,openEmailsWithGmail:r,openGmailCompose:s,onRequestClose:o}):null]})},xs=Pa});var vi={};Ja(vi,{AdvancedSearchSettings:()=>Dn,BasicSearchSettings:()=>Wn,CONTACT_MAP_LABEL_CATALOGS:()=>Ue,CONTACT_MAP_LABEL_KEYS:()=>Ht,ContactDetailGrid:()=>Pa,ContactDetailPanel:()=>Je,ContactDetailPopup:()=>Zt,ContactDetailRowLayout:()=>en,ContactMapAnnotation:()=>$n,ContactMapAppView:()=>bi,ContactMapConfigProvider:()=>jr,ContactMapSearchListView:()=>_a,ContactMapSearchPage:()=>Qa,ContactMapSearchTabGroup:()=>Ka,ContactMapSearchTreeView:()=>$a,ContactMapStreamClient:()=>nn,HighlightedText:()=>he,IndexWorkerSettings:()=>Zn,LIST_COLLAPSE_THRESHOLD:()=>As,LIST_DETAIL_PANEL_MIN_WIDTH:()=>ao,LIST_EXPAND_THRESHOLD:()=>Is,LIST_PANEL_MIN_WIDTH:()=>no,LIST_RESIZE_HANDLE_THICKNESS:()=>ro,LevenshteinWorkerSettings:()=>ea,Progress:()=>Da,SearchOptionsPanel:()=>ta,StatItem:()=>O,StatisticsPanel:()=>ra,SwipeOverlay:()=>un,TREE_COLLAPSE_THRESHOLD:()=>Xs,TREE_DETAIL_PANEL_MIN_WIDTH:()=>To,TREE_EXPAND_THRESHOLD:()=>Js,TREE_PANEL_MIN_WIDTH:()=>So,TREE_RESIZE_HANDLE_THICKNESS:()=>wo,Tabs:()=>tn,TabsContent:()=>mt,TabsList:()=>Ft,TabsTrigger:()=>pt,TreeWorkerSession:()=>pn,WorkerStatsSection:()=>Nt,assertContactMapStreamEndpoint:()=>an,assertContactMapTreeWorkerUrl:()=>La,assertContactMapWorkerUrls:()=>Ss,composeTreeVirtualScrollOptions:()=>No,contactMapShouldRevalidate:()=>xi,countContactMapCompanies:()=>Yr,deserializeStreamRecord:()=>qr,getContactMapStreamClient:()=>Gr,getTreeWorkerSession:()=>mo,layerContactMapWorkerUrls:()=>kt,resetContactMapStreamClientForTesting:()=>Ls,resetTreeWorkerSessionForTesting:()=>Qs,resolveContactMapLabels:()=>On,useAnimatedNumber:()=>Ia,useContactMapConfig:()=>Ke,useContactMapLabels:()=>J,useContactMapStream:()=>Qr,useContactPanelSizing:()=>Qn,useDynamicViewportHeight:()=>Wa,useHorizontalDragScroll:()=>Ze,useLongPressPopup:()=>ln,useReportPopupVisibility:()=>so,useResponsiveTwoColumnLayout:()=>dn,useRowPopupRegistry:()=>oo,useStreamedContactMapContext:()=>rn,useTreeWorker:()=>Fa});module.exports=jo(vi);var vt=require("@aiquants/fuzzy-search"),Xt=require("react");ce();var ue=require("react/jsx-runtime"),Dn=(0,Xt.memo)(({searchOptions:e,setSearchOptions:t})=>{let n=J(),r="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",s="text-xs font-semibold",a=(0,Xt.useId)(),o=(0,Xt.useId)(),d=[];return d.push((0,ue.jsxs)("div",{className:`${r} border-sky-200 border-l-4 dark:border-sky-400/60`,children:[(0,ue.jsxs)("div",{className:`${s} text-sky-700 dark:text-sky-300`,children:["\u{1F4D8} ",n.advancedLearningHeading]}),(0,ue.jsx)("label",{htmlFor:a,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.advancedLearningLabel}),(0,ue.jsx)("input",{id:a,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.learningWeight||vt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight,onChange:l=>t(c=>({...c,learningWeight:parseFloat(l.target.value)})),className:"w-full"}),(0,ue.jsxs)("span",{className:"text-sky-600 text-xs dark:text-sky-300",children:[n.currentValueLabel," ",e.learningWeight||vt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight]}),(0,ue.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.advancedLearningHint})]},"learning")),d.push((0,ue.jsxs)("div",{className:`${r} border-indigo-200 border-l-4 dark:border-indigo-400/60`,children:[(0,ue.jsxs)("div",{className:`${s} text-indigo-700 dark:text-indigo-300`,children:["\u23F1\uFE0F ",n.advancedDebounceHeading]}),(0,ue.jsx)("label",{htmlFor:o,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.advancedDebounceLabel}),(0,ue.jsx)("input",{id:o,type:"range",min:"100",max:"1000",step:"50",value:e.debounceMs??vt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs,onChange:l=>t(c=>({...c,debounceMs:parseInt(l.target.value,10)})),className:"w-full"}),(0,ue.jsxs)("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[n.currentValueLabel," ",e.debounceMs??vt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs]}),(0,ue.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.advancedDebounceHint})]},"debounce")),(0,ue.jsxs)("section",{className:"space-y-3",children:[(0,ue.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,ue.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,ue.jsx)("span",{children:"\u26A1"}),(0,ue.jsx)("span",{className:"tracking-wide",children:n.settingsAdvancedTab})]}),(0,ue.jsx)("button",{type:"button",onClick:()=>t(l=>({...l,learningWeight:vt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight,debounceMs:vt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs})),className:"rounded border border-gray-300 bg-gray-100 px-2 py-1 font-medium text-gray-700 text-xs transition-colors hover:bg-gray-200 dark:border-slate-600 dark:bg-slate-800/70 dark:text-slate-200 dark:hover:bg-slate-700/70",title:n.resetToDefaultsTitle,children:n.reset})]}),(0,ue.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:d})]})});Dn.displayName="AdvancedSearchSettings";var ct=require("@aiquants/fuzzy-search"),Me=require("react");ce();var R=require("react/jsx-runtime"),Wn=(0,Me.memo)(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:r,openEmailsWithGmail:s,setOpenEmailsWithGmail:a})=>{let o=J(),d="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",l="text-xs font-semibold",c=(0,Me.useId)(),m=(0,Me.useId)(),u=(0,Me.useId)(),i=(0,Me.useId)(),p=(0,Me.useId)(),f=(0,Me.useId)(),T=(0,Me.useId)(),S=(0,Me.useId)(),w=(0,Me.useId)(),V=(0,Me.useId)(),H=[];return H.push((0,R.jsxs)("div",{className:`${d} border-blue-200 border-l-4 dark:border-blue-500/50`,children:[(0,R.jsxs)("div",{className:`${l} text-blue-700 dark:text-blue-300`,children:["\u{1F3AF} ",o.basicThresholdHeading]}),(0,R.jsx)("label",{htmlFor:c,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:o.basicThresholdLabel}),(0,R.jsx)("input",{id:c,type:"range",min:"0.0",max:e.sortBy==="relevance"?"1.5":"1.0",step:"0.05",value:e.threshold??ct.DEFAULT_FUZZY_SEARCH_OPTIONS.threshold,onChange:y=>t(g=>({...g,threshold:parseFloat(y.target.value)})),className:"w-full"}),(0,R.jsxs)("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[o.currentValueLabel," ",e.threshold??ct.DEFAULT_FUZZY_SEARCH_OPTIONS.threshold]}),(0,R.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:e.sortBy==="relevance"?o.basicThresholdRangeRelevance:o.basicThresholdRange})]},"threshold")),H.push((0,R.jsxs)("div",{className:`${d} border-amber-200 border-l-4 dark:border-amber-400/60`,children:[(0,R.jsxs)("div",{className:`${l} text-amber-700 dark:text-amber-300`,children:["\u{1FA84} ",o.basicDisplayHeading]}),(0,R.jsxs)("label",{htmlFor:m,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,R.jsx)("input",{id:m,type:"checkbox",checked:e.caseSensitive??ct.DEFAULT_FUZZY_SEARCH_OPTIONS.caseSensitive,onChange:y=>t(g=>({...g,caseSensitive:y.target.checked})),className:"h-3 w-3"}),o.basicCaseSensitive]}),(0,R.jsxs)("label",{htmlFor:u,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,R.jsx)("input",{id:u,type:"checkbox",checked:n,onChange:y=>r(y.target.checked),className:"h-3 w-3"}),o.basicHighlight]}),(0,R.jsxs)("label",{htmlFor:i,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,R.jsx)("input",{id:i,type:"checkbox",checked:s,onChange:y=>a(y.target.checked),className:"h-3 w-3"}),o.basicOpenEmailsWithGmail]}),(0,R.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,R.jsx)("label",{htmlFor:p,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:o.basicMultiTermOperator}),(0,R.jsxs)("select",{id:p,value:e.multiTermOperator??ct.DEFAULT_FUZZY_SEARCH_OPTIONS.multiTermOperator,onChange:y=>t(g=>({...g,multiTermOperator:y.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[(0,R.jsx)("option",{value:"or",children:o.basicOperatorOr}),(0,R.jsx)("option",{value:"and",children:o.basicOperatorAnd})]}),(0,R.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:o.basicMultiTermHint})]})]},"display")),H.push((0,R.jsxs)("div",{className:`${d} border-emerald-200 border-l-4 dark:border-emerald-400/60`,children:[(0,R.jsxs)("div",{className:`${l} text-emerald-700 dark:text-emerald-300`,children:["\u{1F4DA} ",o.basicSortHeading]}),(0,R.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,R.jsx)("label",{htmlFor:f,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:o.basicSortBy}),(0,R.jsxs)("select",{id:f,value:e.sortBy||ct.DEFAULT_FUZZY_SEARCH_OPTIONS.sortBy,onChange:y=>t(g=>({...g,sortBy:y.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[(0,R.jsx)("option",{value:"score",children:o.basicSortByScore}),(0,R.jsx)("option",{value:"relevance",children:o.basicSortByRelevance}),(0,R.jsx)("option",{value:"original",children:o.basicSortByOriginal})]})]}),(0,R.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,R.jsx)("label",{htmlFor:T,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:o.basicSortOrder}),(0,R.jsxs)("select",{id:T,value:e.sortOrder||ct.DEFAULT_FUZZY_SEARCH_OPTIONS.sortOrder,onChange:y=>t(g=>({...g,sortOrder:y.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[(0,R.jsx)("option",{value:"desc",children:o.basicSortDescending}),(0,R.jsx)("option",{value:"asc",children:o.basicSortAscending})]})]})]},"sorting")),H.push((0,R.jsxs)("div",{className:`${d} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[(0,R.jsxs)("div",{className:`${l} text-purple-700 dark:text-purple-300`,children:["\u2699\uFE0F ",o.basicEngineHeading]}),(0,R.jsx)("label",{htmlFor:S,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:o.basicStrategy}),(0,R.jsxs)("select",{id:S,value:e.parallelSearchStrategy||ct.DEFAULT_FUZZY_SEARCH_OPTIONS.parallelSearchStrategy,onChange:y=>t(g=>({...g,parallelSearchStrategy:y.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[(0,R.jsx)("option",{value:"balanced",children:o.basicStrategyBalanced}),(0,R.jsx)("option",{value:"index-first",children:o.basicStrategyIndexFirst}),(0,R.jsx)("option",{value:"levenshtein-first",children:o.basicStrategyLevenshteinFirst})]}),(0,R.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,R.jsxs)("label",{htmlFor:w,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,R.jsx)("input",{id:w,type:"checkbox",checked:e.enableIndexFiltering!==!1,onChange:y=>t(g=>({...g,enableIndexFiltering:y.target.checked})),className:"h-3 w-3"}),o.basicIndexFiltering]}),(0,R.jsxs)("label",{htmlFor:V,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,R.jsx)("input",{id:V,type:"checkbox",checked:e.enableLevenshtein!==!1,onChange:y=>t(g=>({...g,enableLevenshtein:y.target.checked})),className:"h-3 w-3"}),o.basicLevenshtein]})]})]},"engine")),(0,R.jsxs)("section",{className:"space-y-3",children:[(0,R.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-blue-700 text-xs transition-colors dark:text-sky-400",children:[(0,R.jsx)("span",{children:"\u{1F527}"}),(0,R.jsx)("span",{className:"tracking-wide",children:o.settingsBasicTab})]}),(0,R.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:H})]})});Wn.displayName="BasicSearchSettings";var Lr=de(require("lucide-react/dist/esm/icons/badge-check.js")),Er=de(require("lucide-react/dist/esm/icons/building-2.js")),Or=de(require("lucide-react/dist/esm/icons/calendar-clock.js")),Dr=de(require("lucide-react/dist/esm/icons/check.js")),Wr=de(require("lucide-react/dist/esm/icons/copy.js")),Hr=de(require("lucide-react/dist/esm/icons/id-card.js")),_r=de(require("lucide-react/dist/esm/icons/mail.js")),Ar=de(require("lucide-react/dist/esm/icons/phone.js")),Ir=de(require("lucide-react/dist/esm/icons/user-round.js")),Pe=require("react");yt();var Ve={info:(e,...t)=>console.info(`[contact-map] ${e}`,...t),warn:(e,...t)=>console.warn(`[contact-map] ${e}`,...t),error:(e,...t)=>console.error(`[contact-map] ${e}`,...t)};ce();var _e=de(require("@radix-ui/react-tabs")),Bn=de(require("react"));var Nr=require("clsx"),Mr=require("tailwind-merge");function Ct(...e){return(0,Mr.twMerge)((0,Nr.clsx)(e))}var Un=require("react/jsx-runtime"),tn=_e.Root,Ft=Bn.forwardRef(({className:e,...t},n)=>(0,Un.jsx)(_e.List,{ref:n,className:Ct("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Ft.displayName=_e.List.displayName;var pt=Bn.forwardRef(({className:e,...t},n)=>(0,Un.jsx)(_e.Trigger,{ref:n,className:Ct("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm ring-offset-background transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-2xs",e),...t}));pt.displayName=_e.Trigger.displayName;var mt=Bn.forwardRef(({className:e,...t},n)=>(0,Un.jsx)(_e.Content,{ref:n,className:Ct("mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=inactive]:hidden",e),...t}));mt.displayName=_e.Content.displayName;In();var C=require("react/jsx-runtime"),Pr={height:"var(--contact-panel-height, 100%)",maxHeight:"100%"},vs=({icon:e,label:t,value:n,fieldKey:r,copyValue:s,onCopy:a,isCopied:o,linkHref:d,searchTerm:l,enableHighlighting:c})=>{let m=J(),u=!!(a&&r&&s),i=d?.startsWith("https://mail.google.com")?"_blank":void 0;return(0,C.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-slate-200 bg-slate-50 px-2.5 py-1.5 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[(0,C.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,C.jsx)("div",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-white text-slate-500 transition-colors dark:bg-slate-800 dark:text-slate-200",children:(0,C.jsx)(e,{size:14})}),(0,C.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,C.jsx)("div",{className:"font-medium text-[10px] text-slate-500 dark:text-slate-400",children:t}),(0,C.jsx)("div",{className:"truncate font-semibold text-slate-900 text-xs dark:text-slate-100",children:d?(0,C.jsx)("a",{href:d,className:"text-inherit underline-offset-2 hover:underline focus:underline focus:outline-none",target:i,rel:i?"noopener noreferrer":void 0,children:(0,C.jsx)(he,{text:n,query:l??"",enabled:c})}):(0,C.jsx)(he,{text:n,query:l??"",enabled:c})})]})]}),u?(0,C.jsx)("button",{type:"button",onClick:()=>a&&r&&s&&a(r,s,t),className:"inline-flex h-6 w-6 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-500 transition-colors hover:border-blue-400 hover:text-blue-500 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:border-blue-400 dark:hover:text-blue-300","aria-label":m.copyField(t),children:o?(0,C.jsx)(Dr.default,{size:14}):(0,C.jsx)(Wr.default,{size:14})}):null]})},Rr=({items:e,searchTerm:t,enableHighlighting:n})=>(0,C.jsx)("dl",{className:"grid grid-cols-1 gap-x-3 gap-y-1.5 sm:grid-cols-2",children:e.map(r=>(0,C.jsxs)("div",{className:"flex flex-col gap-0.5 rounded-md border border-slate-200 bg-white/60 px-2 py-1 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[(0,C.jsx)("dt",{className:"font-semibold text-[10px] text-slate-500 uppercase tracking-wide dark:text-slate-400",children:r.label}),(0,C.jsx)("dd",{className:"wrap-break-word text-slate-900 text-xs dark:text-slate-100",children:(0,C.jsx)(he,{text:r.value,query:t??"",enabled:n})})]},r.fieldKey))}),Ra=({title:e})=>(0,C.jsx)("h3",{className:"font-semibold text-slate-700 text-xs dark:text-slate-200",children:e}),Cs=()=>{let e=J();return(0,C.jsxs)("div",{className:"flex h-full min-h-40 w-full flex-1 flex-col items-center justify-center gap-2 rounded-xl border border-slate-300 border-dashed bg-white/60 p-4 text-center transition-colors dark:border-slate-700 dark:bg-slate-900/40",children:[(0,C.jsx)("p",{className:"font-medium text-slate-600 text-xs dark:text-slate-200",children:e.detailEmptyTitle}),(0,C.jsx)("p",{className:"text-[11px] text-slate-500 dark:text-slate-400",children:e.detailEmptyHint})]})},Je=({contact:e,searchTerm:t,enableHighlighting:n,style:r,className:s=""})=>{let a=J(),[o,d]=(0,Pe.useState)(null),l=(0,Pe.useRef)(null),c=(0,Pe.useMemo)(()=>({...Pr,...r}),[r]);(0,Pe.useEffect)(()=>()=>{l.current!==null&&window.clearTimeout(l.current)},[]);let m=(0,Pe.useMemo)(()=>Lt(e),[e]),u=(0,Pe.useMemo)(()=>Et(e),[e]),i=(0,Pe.useMemo)(()=>Be(e?.contacted_at,a.recordDateTime),[e?.contacted_at,a.recordDateTime]),p=(0,Pe.useCallback)(async(k,h,v)=>{try{await navigator.clipboard.writeText(h),d(k),l.current!==null&&window.clearTimeout(l.current),l.current=window.setTimeout(()=>{d(null)},2e3)}catch(F){Ve.error("Failed to copy contact detail",F)}},[]);if(!e)return(0,C.jsx)("div",{className:"flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950",style:Pr,children:(0,C.jsx)(Cs,{})});let f=[Z(e.title),Z(e.department)].filter(k=>k!=="-"),T=[f.join(" / "),Z(e.company_name)].filter(k=>k&&k!=="-").join(" \u30FB ")||"-",S=He(e.full_name)??a.noName,w=[{fieldKey:"full_name",label:a.fieldFullName,value:S},{fieldKey:"full_name_reading",label:a.fieldFullNameReading,value:Z(e.full_name_reading)},{fieldKey:"title",label:a.fieldTitle,value:Z(e.title)},{fieldKey:"department",label:a.fieldDepartment,value:Z(e.department)},{fieldKey:"company_name",label:a.fieldCompanyName,value:Z(e.company_name)},{fieldKey:"company_name_reading",label:a.fieldCompanyNameReading,value:Z(e.company_name_reading)},{fieldKey:"address",label:a.fieldAddress,value:Z(e.address)},{fieldKey:"postal_code",label:a.fieldPostalCode,value:Z(e.postal_code)},{fieldKey:"url",label:a.fieldUrl,value:Z(e.url)}],V=[{label:a.fieldCustomEmail,value:Z(e.custom_email),fieldKey:"custom_email",rawValue:e.custom_email},{label:a.fieldEmail,value:Z(e.email),fieldKey:"email",rawValue:e.email}].filter(k=>k.value!=="-"),H=[{label:a.fieldCustomMobilePhone,value:Z(e.custom_mobile_phone_number),fieldKey:"custom_mobile_phone_number",rawValue:e.custom_mobile_phone_number},{label:a.fieldMobilePhone,value:Z(e.mobile_phone_number),fieldKey:"mobile_phone_number",rawValue:e.mobile_phone_number},{label:a.fieldCompanyPhone,value:Z(e.company_phone_number),fieldKey:"company_phone_number",rawValue:e.company_phone_number},{label:a.fieldCompanyFax,value:Z(e.company_fax_number),fieldKey:"company_fax_number",rawValue:e.company_fax_number}].filter(k=>k.value!=="-"),y=[{fieldKey:"person_id",label:"person_id",value:Z(e.person_id)},{fieldKey:"person_id_redirect_to",label:"person_id_redirect_to",value:Z(e.person_id_redirect_to)},{fieldKey:"is_active",label:"is_active",value:Z(e.is_active)},{fieldKey:"is_contact_synced",label:"is_contact_synced",value:Z(e.is_contact_synced)},{fieldKey:"is_incomplete",label:"is_incomplete",value:Z(e.is_incomplete)},{fieldKey:"is_in_eight",label:"is_in_eight",value:Z(e.is_in_eight)},{fieldKey:"created_by",label:a.fieldCreatedBy,value:Z(e.created_by)},{fieldKey:"created_at",label:a.fieldCreatedAt,value:Be(e.created_at,a.recordDateTime)},{fieldKey:"updated_by",label:a.fieldUpdatedBy,value:Z(e.updated_by)},{fieldKey:"updated_at",label:a.fieldUpdatedAt,value:Be(e.updated_at,a.recordDateTime)}],g=[{rowKey:"person_id",icon:Hr.default,label:"person_id",value:Z(e.person_id),fieldKey:"person_id",copyValue:String(e.person_id)},{rowKey:"primary_email",icon:_r.default,label:a.summaryEmail,value:m.value??"-",fieldKey:"primary_email",copyValue:m.value,linkHref:Qe(m.value,!1)},{rowKey:"primary_phone",icon:Ar.default,label:a.summaryPhone,value:u.value??"-",fieldKey:"primary_phone",copyValue:u.value,linkHref:Yt(u.value)},{rowKey:"contacted_at",icon:Or.default,label:a.summaryLastContact,value:i}],$=[{sectionKey:"email",title:a.sectionEmail,emptyText:a.sectionEmailEmpty,entries:V,recommendedKey:m.fieldKey??null,resolveHref:k=>Qe(k!=null?String(k):null,!1)},{sectionKey:"phone",title:a.sectionPhone,emptyText:a.sectionPhoneEmpty,entries:H,recommendedKey:u.fieldKey??null,resolveHref:k=>Yt(k!=null?String(k):null)}],q=[{value:"summary",label:a.detailTabSummary,content:(0,C.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,C.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,C.jsxs)("div",{className:"flex items-center gap-2 text-slate-600 text-sm dark:text-slate-300",children:[(0,C.jsx)(Er.default,{size:16}),(0,C.jsx)("span",{children:(0,C.jsx)(he,{text:Z(e.company_name),query:t??"",enabled:n})})]}),f.length>0?(0,C.jsx)("div",{className:"text-slate-600 text-sm dark:text-slate-300",children:f.map((k,h)=>(0,C.jsxs)("span",{children:[h>0&&" / ",(0,C.jsx)(he,{text:k,query:t??"",enabled:n})]},`header-line-${h}`))}):null]}),(0,C.jsx)("div",{className:"flex flex-col gap-3",children:g.map(k=>(0,C.jsx)(vs,{icon:k.icon,label:k.label,value:k.value,fieldKey:k.fieldKey,copyValue:k.copyValue,onCopy:p,isCopied:k.fieldKey?o===k.fieldKey:!1,linkHref:k.linkHref,searchTerm:t,enableHighlighting:n},k.rowKey))})]})},{value:"basic",label:a.detailTabBasic,content:(0,C.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,C.jsx)(Ra,{title:a.detailBasicProfile}),(0,C.jsx)(Rr,{items:w,searchTerm:t,enableHighlighting:n})]})},{value:"contact",label:a.detailTabContact,content:(0,C.jsx)("div",{className:"flex flex-col gap-4",children:$.map(({sectionKey:k,title:h,emptyText:v,entries:F,recommendedKey:P,resolveHref:ae})=>(0,C.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,C.jsx)(Ra,{title:h}),F.length===0?(0,C.jsx)("p",{className:"text-slate-500 text-xs dark:text-slate-400",children:v}):(0,C.jsx)("div",{className:"flex flex-col gap-2",children:F.map(L=>{let E=ae(L.rawValue),I=L.fieldKey===P;return(0,C.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-slate-200 bg-white px-3 py-2 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{className:"font-medium text-slate-500 text-xs dark:text-slate-400",children:L.label}),(0,C.jsx)("div",{className:"text-slate-900 text-sm dark:text-slate-100",children:E?(0,C.jsx)("a",{href:E,className:"text-inherit underline-offset-2 hover:underline focus:underline focus:outline-none",children:(0,C.jsx)(he,{text:L.value,query:t??"",enabled:n})}):(0,C.jsx)(he,{text:L.value,query:t??"",enabled:n})})]}),I?(0,C.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-100 px-2 py-0.5 font-semibold text-[11px] text-emerald-700 transition-colors dark:bg-emerald-300/20 dark:text-emerald-200",children:[(0,C.jsx)(Lr.default,{size:14}),a.preferred]}):null]},L.fieldKey)})})]},k))})},{value:"meta",label:a.detailTabMeta,content:(0,C.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,C.jsx)(Ra,{title:a.detailTabMeta}),(0,C.jsx)(Rr,{items:y,searchTerm:t,enableHighlighting:n})]})}];return(0,C.jsxs)("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950 ${s}`.trim(),style:c,children:[(0,C.jsx)("div",{className:"border-slate-200 border-b px-3 py-1.5 transition-colors dark:border-slate-700 dark:bg-slate-900/50",children:(0,C.jsxs)("div",{className:"flex items-center gap-2",children:[(0,C.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-blue-50 text-blue-600 transition-colors dark:bg-sky-900/40 dark:text-sky-300",children:(0,C.jsx)(Ir.default,{size:16})}),(0,C.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,C.jsx)("div",{className:"truncate font-semibold text-slate-900 text-sm dark:text-slate-100",children:(0,C.jsx)(he,{text:S,query:t??"",enabled:n})}),(0,C.jsx)("div",{className:"truncate text-[11px] text-slate-600 dark:text-slate-300",children:(0,C.jsx)(he,{text:T,query:t??"",enabled:n})})]})]})}),(0,C.jsxs)(tn,{defaultValue:"summary",className:"flex flex-1 flex-col overflow-hidden",children:[(0,C.jsx)(Ft,{className:"flex gap-1.5 border-slate-200 border-b bg-slate-50 px-2 py-1 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:q.map(k=>(0,C.jsx)(pt,{value:k.value,className:"rounded-md px-1.5 py-0.5 font-semibold text-[11px] transition-colors data-[state=active]:bg-white data-[state=active]:text-blue-600 dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-sky-300",children:k.label},k.value))}),q.map(k=>(0,C.jsx)(mt,{value:k.value,className:"scrollbar-thin flex-1 overflow-y-auto px-2.5 py-2 transition-colors dark:text-slate-200",children:k.content},k.value))]})]})};var Fr=require("react");xt();ce();var ve=require("react/jsx-runtime"),$n=(0,Fr.memo)(({recordCount:e,companyCount:t,phase:n,loadedCount:r,totalCount:s,errorMessage:a,onRetry:o})=>{let{locale:d,labels:l}=Se(),c=X(d,e),m=X(d,t);return(0,ve.jsxs)("div",{"data-testid":"contact-map-annotation",className:"flex flex-wrap items-center gap-2 leading-1 transition-colors",role:"status",children:[(0,ve.jsxs)("span",{className:"flex items-baseline gap-1",children:[(0,ve.jsx)("span",{className:"text-slate-600 dark:text-slate-300",children:l.annotationTotalLabel}),(0,ve.jsx)("span",{className:"text-slate-800 dark:text-slate-200","data-testid":"contact-map-record-count",children:c}),(0,ve.jsx)("span",{className:"text-slate-600 dark:text-slate-300",children:l.recordUnit(c)})]}),(0,ve.jsxs)("span",{className:"flex items-baseline gap-1",children:[(0,ve.jsx)("span",{className:"text-slate-600 dark:text-slate-300",children:l.annotationCompaniesLabel}),(0,ve.jsx)("span",{className:"text-slate-800 dark:text-slate-200","data-testid":"contact-map-company-count",children:m}),(0,ve.jsx)("span",{className:"text-slate-600 dark:text-slate-300",children:l.companyUnit(m)})]}),n==="streaming"||n==="idle"?(0,ve.jsx)("span",{"data-testid":"contact-map-stream-badge",className:"ml-2 inline-flex items-center gap-1.5 rounded-full bg-blue-50 px-2 py-0.5 font-medium text-blue-700 text-xs dark:bg-blue-900/30 dark:text-blue-300",children:s!==null&&s>0?l.annotationStreamingProgress({loaded:r,total:s,percent:Math.min(100,Math.round(r/s*100))}):l.annotationStreamingCount(r)}):null,n==="retrying"?(0,ve.jsx)("span",{"data-testid":"contact-map-reconnecting-badge",className:"ml-2 inline-flex items-center gap-1.5 rounded-full bg-amber-50 px-2 py-0.5 font-medium text-amber-900 text-xs dark:bg-amber-900/30 dark:text-amber-200",children:l.annotationReconnecting(r)}):null,n==="failed"||n==="auth-required"?(0,ve.jsxs)("span",{"data-testid":"contact-map-error-badge",className:"ml-2 inline-flex items-center gap-1.5 rounded-full bg-rose-50 px-2 py-0.5 font-medium text-rose-700 text-xs dark:bg-rose-900/30 dark:text-rose-300",title:n==="failed"?a??void 0:void 0,children:["\u26D4 ",n==="auth-required"?l.annotationAuthRequired:l.annotationLoadFailed(r),o?(0,ve.jsx)("button",{type:"button","data-testid":"contact-map-retry-button",onClick:o,className:"rounded border border-rose-300 bg-white px-1.5 py-0.5 font-semibold text-rose-700 transition-colors hover:bg-rose-100 dark:border-rose-700 dark:bg-rose-950 dark:text-rose-200 dark:hover:bg-rose-900",children:l.annotationRetry}):null]}):null]})});$n.displayName="ContactMapAnnotation";var Ya=require("react");Wt();var zt=require("react");Ot();Wt();ce();Ot();Wt();ha();var ks=["indexWorker","levenshteinWorker","treeWorker"];function zr(e,t,n){if(n!==void 0){if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string or left out (pass url.href for a URL object); got ${se(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${se(n)}`)}}var Br={setting:"workerUrls"},Ur=(e,t)=>{if(e===void 0)return;let{setting:n,keys:r=ks,hints:s={}}=t;if(!Dt(e))throw new TypeError(`[contact-map] ${n} must be a plain object or left out; got ${se(e)}`);let a=Object.getOwnPropertyNames(e).map(l=>({key:l,url:e[l]})),o=a.find(({key:l,url:c})=>c!==void 0&&!r.includes(l));if(o!==void 0){let l=Object.hasOwn(s,o.key)?s[o.key]:void 0,c=l===void 0?Rn(o.key,r):void 0;throw new RangeError(`[contact-map] ${n} has a key it does not take (it takes ${r.join(", ")}${l===void 0?"":`; ${l}`}${c===void 0?"":`; did you mean ${JSON.stringify(c)}?`}); got ${se(o.key)}`)}let d=Object.create(null);for(let{key:l,url:c}of a){let m=l;zr(n,m,c),c!==void 0&&(d[m]=c)}return d};function Ss(e,t=Br){Ur(e,t)}function La(e){zr("workerUrls","treeWorker",e)}var kt=(e,t,n=Br)=>{let r=Ur(t,n);return{indexWorker:r?.indexWorker===void 0?e?.indexWorker:r.indexWorker,levenshteinWorker:r?.levenshteinWorker===void 0?e?.levenshteinWorker:r.levenshteinWorker,treeWorker:r?.treeWorker===void 0?e?.treeWorker:r.treeWorker}};var Vn=require("react/jsx-runtime"),$r=e=>{if(!Dt(e))throw new TypeError(`[contact-map] config must be a plain object; got ${se(e)}`);let t=e;return{streamEndpoint:ke(t,"streamEndpoint"),openEmailsWithGmail:ke(t,"openEmailsWithGmail"),treeWorkerFactory:ke(t,"treeWorkerFactory"),workerUrls:kt(void 0,ke(t,"workerUrls")),locale:ke(t,"locale"),labels:ke(t,"labels")}},Vr=({workerUrls:e,...t})=>{let{indexWorker:n,levenshteinWorker:r,treeWorker:s}=e;return Object.freeze(Object.assign(Object.create(null),t,{workerUrls:Object.freeze({indexWorker:n,levenshteinWorker:r,treeWorker:s})}))},Ts=Vr($r({})),Kr=(0,zt.createContext)(Ts),ws=Object.freeze({locale:"locale",labels:"labels"});function Ea({config:e,chromeSurface:t,children:n}){let{streamEndpoint:r,openEmailsWithGmail:s,treeWorkerFactory:a,workerUrls:o,locale:d,labels:l}=$r(e),{indexWorker:c,levenshteinWorker:m,treeWorker:u}=o,i=(0,zt.useMemo)(()=>Vr({streamEndpoint:r,openEmailsWithGmail:s,treeWorkerFactory:a,workerUrls:{indexWorker:c,levenshteinWorker:m,treeWorker:u},locale:d,labels:l}),[r,s,a,c,m,u,d,l]);return(0,Vn.jsx)(Kr.Provider,{value:i,children:(0,Vn.jsx)(ir,{locale:d,labels:l,surface:t,children:n})})}function jr({config:e,children:t}){return(0,Vn.jsx)(Ea,{config:e,chromeSurface:ws,children:t})}function Ke(){return(0,zt.useContext)(Kr)}var Te=require("react");Ot();var Ns=1e3,Ms=3e4,Ps=6;function an(e){if(typeof e!="string")throw new TypeError(`[contact-map] streamEndpoint must be a same-origin absolute path such as "/api/contact_map/stream", set on ContactMapConfigProvider or ContactMapAppView; got ${se(e)}`);if(/[\s\p{Cc}#]/u.test(e))throw new RangeError(`[contact-map] streamEndpoint must not contain whitespace, control characters or "#"; got ${se(e)}`);if(!e.startsWith("/")||e.startsWith("//")||e.startsWith("/\\"))throw new RangeError(`[contact-map] streamEndpoint must be a same-origin absolute path such as "/api/contact_map/stream"; got ${se(e)}`)}var qr=e=>({...e,contacted_at:e.contacted_at?new Date(e.contacted_at):null,created_at:e.created_at?new Date(e.created_at):void 0,updated_at:e.updated_at?new Date(e.updated_at):void 0}),Rs=e=>Array.isArray(e.records),nn=class{constructor(t){this.recordMap=new Map;this.listeners=new Set;this.lastCursor=null;this.consecutiveFailures=0;this.started=!1;this.disposed=!1;this.activeController=null;this.wakeRetryWait=null;this.state={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null};this.handleOnline=()=>{this.wakeRetryWait?.()};an(t.endpoint),this.fetchFn=t.fetchFn??((...n)=>fetch(...n)),this.endpoint=t.endpoint,this.initialRetryDelayMs=t.initialRetryDelayMs??Ns,this.maxRetryDelayMs=t.maxRetryDelayMs??Ms,this.maxConsecutiveFailures=t.maxConsecutiveFailures??Ps,this.logger=t.logger??Ve}getState(){return this.state}getRecordMap(){return this.recordMap}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}start(){this.started||this.disposed||(this.started=!0,typeof window<"u"&&window.addEventListener("online",this.handleOnline),this.runStreamLoop())}retryNow(){if(!this.disposed)switch(this.state.phase){case"retrying":this.wakeRetryWait?.();return;case"failed":case"auth-required":this.consecutiveFailures=0,this.setState({error:null,isLoading:this.recordMap.size===0}),this.runStreamLoop();return;case"idle":case"streaming":case"complete":return}}dispose(){this.disposed=!0,this.activeController?.abort(),this.wakeRetryWait?.(),typeof window<"u"&&window.removeEventListener("online",this.handleOnline)}setState(t){this.state={...this.state,...t};for(let n of this.listeners)n(this.state)}publishRecords(t={}){let n=Array.from(this.recordMap.values());this.setState({records:n,loadedCount:n.length,isLoading:!1,...t})}async runStreamLoop(){this.setState({phase:"streaming"});let t=!1;for(;!this.disposed;){let n=this.lastCursor!==null,r=await this.streamOnce();if(r==="aborted")return;if(r==="complete"){this.publishRecords({isComplete:!0,phase:"complete",error:null});return}if(r==="auth-required"){this.setState({phase:"auth-required",isLoading:!1,error:new Error("Authentication required")});return}if(r==="rejected"){if(n&&!t){t=!0,this.lastCursor=null,this.logger.warn("[ContactMapStream] the server rejected the resume cursor (400); restarting from the beginning");continue}this.setState({phase:"failed",isLoading:!1,error:new Error("[contact-map] the server rejected the stream request (400); reload the page")});return}if(this.consecutiveFailures+=1,this.consecutiveFailures>=this.maxConsecutiveFailures){this.setState({phase:"failed",isLoading:!1});return}let s=Math.min(this.initialRetryDelayMs*2**(this.consecutiveFailures-1),this.maxRetryDelayMs);if(this.setState({phase:"retrying",isLoading:this.recordMap.size===0}),this.logger.warn(`[ContactMapStream] retrying in ${s}ms (attempt ${this.consecutiveFailures})`),await this.waitBeforeRetry(s),this.disposed)return;this.setState({phase:"streaming"})}}waitBeforeRetry(t){return new Promise(n=>{let r=setTimeout(()=>{this.wakeRetryWait=null,n()},t);this.wakeRetryWait=()=>{clearTimeout(r),this.wakeRetryWait=null,n()}})}buildStreamUrl(){if(!this.lastCursor)return this.endpoint;let t=this.endpoint.includes("?")?"&":"?",n=new URLSearchParams;return this.lastCursor.contacted_at!==null&&n.set("cursor_contacted_at",this.lastCursor.contacted_at),n.set("cursor_person_id",String(this.lastCursor.person_id)),`${this.endpoint}${t}${n.toString()}`}async streamOnce(){this.activeController=new AbortController;try{let t=await this.fetchFn(this.buildStreamUrl(),{signal:this.activeController.signal,credentials:"same-origin"});if(t.status===401||t.status===403)return"auth-required";if(t.status===400)return"rejected";if(!(t.ok&&t.body))return this.logger.warn(`[ContactMapStream] unexpected response: ${t.status}`),this.setState({error:new Error(`[contact-map] the stream request failed (status ${t.status})`)}),"retryable";let n=t.body.getReader(),r=new TextDecoder,s="",a=!1,o=!1;for(;;){let{done:d,value:l}=await n.read();if(d)break;let c=r.decode(l,{stream:!0}),m=(s+c).split(`
2
- `);s=m.pop()??"";let u=!1;for(let i of m){let p=i.trim();if(!p)continue;let f;try{f=JSON.parse(p)}catch(T){this.logger.warn("[ContactMapStream] failed to parse NDJSON line:",T);continue}if("type"in f&&f.type==="METADATA"){Number.isSafeInteger(f.total)&&f.total>=0&&this.setState({totalCount:f.total});continue}if(!Rs(f)){this.logger.warn("[ContactMapStream] server reported error:","error"in f?f.error:""),o=!0;continue}for(let T of f.records)T&&typeof T.person_id=="number"&&(this.recordMap.set(T.person_id,qr(T)),u=!0);f.nextCursor&&(this.lastCursor=f.nextCursor),f.isLast&&(a=!0)}u&&(this.consecutiveFailures=0,this.publishRecords({error:null}))}return o?(this.setState({error:new Error("Stream interrupted by server error")}),"retryable"):a?"complete":(this.setState({error:new Error("Stream ended before completion")}),"retryable")}catch(t){if(t instanceof Error&&t.name==="AbortError")return"aborted";let n=t instanceof Error?t:new Error(String(t));return this.setState({error:n}),"retryable"}finally{this.activeController=null}}};var Ae=null,Gr=e=>{if(Ae!==null&&Ae.endpoint===e)return Ae;if(an(e),Ae===null)return Ae=new nn({endpoint:e}),Ae;if(Ae.endpoint!==e)throw new Error(`[contact-map] the stream client already streams from ${JSON.stringify(Ae.endpoint)} and cannot also stream from ${JSON.stringify(e)}; give every contact-map view in the browser tab the same streamEndpoint, on every route (after changing it, reload the page)`);return Ae},Ls=()=>{Ae?.dispose(),Ae=null},Es=new Map,Os={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null},Ds=()=>{let{streamEndpoint:e}=Ke();return(0,Te.useMemo)(()=>(an(e),e),[e])};function Qr(){let e=Ds(),t=(0,Te.useCallback)(()=>Gr(e),[e]);(0,Te.useEffect)(()=>{let o=t();o.start(),o.retryNow()},[t]);let n=(0,Te.useCallback)(o=>t().subscribe(o),[t]),r=(0,Te.useSyncExternalStore)(n,()=>t().getState(),()=>Os),s=(0,Te.useSyncExternalStore)(n,()=>t().getRecordMap(),()=>Es),a=(0,Te.useCallback)(()=>t().retryNow(),[t]);return(0,Te.useMemo)(()=>({...r,recordMap:s,retryNow:a}),[r,s,a])}var Yr=e=>{let t=new Set;for(let{company_name:n}of e)typeof n=="string"&&n.trim().length>0&&t.add(n);return t.size};function rn(){let{records:e,recordMap:t,isComplete:n,phase:r,loadedCount:s,totalCount:a,error:o,retryNow:d}=Qr(),l=(0,Te.useMemo)(()=>Yr(e),[e]);return{context:(0,Te.useMemo)(()=>({contactMapRecords:e,contactMapRecordMap:t,isStreamingComplete:n,isStreamingFailed:r==="failed",streamPhase:r,loadedCount:s,companyCount:l,totalCount:a,errorMessage:o?.message??null}),[e,t,n,r,s,l,a,o]),retryNow:d}}ce();var sa=require("@aiquants/fuzzy-search"),Ao=require("@aiquants/fuzzy-search/react"),Io=de(require("lucide-react/dist/esm/icons/search.js")),z=require("react"),ia=require("react-router");Ma();Wt();var Re=require("react"),Ze=e=>{let t=(0,Re.useRef)(null),n=(0,Re.useRef)({isPointerDown:!1,isDragging:!1,startX:0,scrollLeft:0,pointerId:0,hasCapture:!1,didDrag:!1,pointerType:""}),r=e?.dragThreshold??4,s=(0,Re.useCallback)(u=>{let i=u.currentTarget,p=u.deltaY;!i||p===0||(u.preventDefault(),i.scrollBy({left:p,behavior:"smooth"}))},[]),a=(0,Re.useCallback)(u=>{t.current?.removeEventListener("wheel",s),t.current=u,u?.addEventListener("wheel",s,{passive:!1})},[s]);(0,Re.useEffect)(()=>()=>{t.current&&t.current.removeEventListener("wheel",s)},[s]);let o=(0,Re.useCallback)(u=>{if(u.pointerType==="touch")return;let i=n.current;i.isPointerDown=!0,i.isDragging=!1,i.startX=u.clientX,i.scrollLeft=u.currentTarget.scrollLeft,i.pointerId=u.pointerId,i.hasCapture=!1,i.pointerType=u.pointerType},[]),d=(0,Re.useCallback)(u=>{let i=n.current;if(!i.isPointerDown||i.pointerType==="touch")return;let p=u.currentTarget,f=u.clientX-i.startX;!i.isDragging&&Math.abs(f)>r&&(i.isDragging=!0,i.hasCapture||(p.setPointerCapture?.(u.pointerId),i.hasCapture=!0)),i.isDragging&&(u.preventDefault(),p.scrollLeft=i.scrollLeft-f)},[r]),l=(0,Re.useCallback)(u=>{let i=n.current;if(i.pointerType==="touch")return;let p=u.currentTarget;i.isPointerDown&&i.hasCapture&&p.hasPointerCapture?.(u.pointerId)&&p.releasePointerCapture(u.pointerId),i.isDragging&&(i.didDrag=!0,window.setTimeout(()=>{i.didDrag=!1},0)),i.isPointerDown=!1,i.isDragging=!1,i.pointerId=0,i.hasCapture=!1},[]),c=(0,Re.useCallback)(u=>{l(u)},[l]),m=(0,Re.useCallback)(u=>{n.current.didDrag&&(u.preventDefault(),u.stopPropagation(),n.current.didDrag=!1)},[]);return{setScrollableRef:a,onPointerDown:o,onPointerMove:d,onPointerUp:c,onPointerLeave:c,onPointerCancel:c,onClickCapture:m}};xt();ce();var Xr=require("@aiquants/fuzzy-search"),Kn=e=>{let{indexWorkerOptions:t,levenshteinWorkerOptions:n,...r}=Xr.DEFAULT_FUZZY_SEARCH_OPTIONS;return{...r,autoSearchOnIndexRebuild:!1,multiTermOperator:"and",workerUrls:e,indexWorkerOptions:{...t},levenshteinWorkerOptions:{...n}}};var Oa=require("react/jsx-runtime");function Da({value:e,max:t=100,className:n,indicatorClassName:r,...s}){let a=e===void 0,o=a?0:Math.min(100,Math.max(0,e/t*100));return(0,Oa.jsx)("div",{role:"progressbar","aria-valuenow":a?void 0:o,"aria-valuemin":0,"aria-valuemax":100,"data-slot":"progress",className:Ct("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",n),...s,children:(0,Oa.jsx)("div",{"data-slot":"progress-indicator",className:Ct("h-full rounded-full bg-primary transition-[width] duration-300 ease-in-out will-change-transform",a&&"w-1/3 animate-progress-indeterminate",r),style:a?void 0:{width:`${o}%`}})})}var Jn=require("react"),Ro=require("react-router");ce();var St=require("@aiquants/resize-panels"),Gn=require("@aiquants/virtualscroll"),U=require("react");yt();var on={listPanelMinWidth:320,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35},sn={listPanelMinWidth:280,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35};function jn(e){let t=e.listPanelMinWidth+e.detailPanelMinWidth+e.handleThickness+e.listPaddingAndBorder+e.detailPaddingAndBorder,n=t+e.scrollbarSafetyBuffer,r=n+e.hysteresisSafetyMargin,s=r-n;return{physicalMinWidth:t,collapseThreshold:n,expandThreshold:r,hysteresisWidth:s}}var Bt=require("react"),Wa=(e,t)=>{let{enableMutationObserver:n=!1,bottomGap:r=4,minFallbackHeight:s=240}=t??{},[a,o]=(0,Bt.useState)(600),d=(0,Bt.useCallback)(()=>{if(typeof window>"u")return;let l=e.current;if(!l||l.offsetParent===null&&window.getComputedStyle(l).position!=="fixed")return;let c=v=>Number.parseFloat(v)||0,{top:m}=l.getBoundingClientRect(),u=l.parentElement?.getBoundingClientRect(),i=window.getComputedStyle(document.documentElement),p=c(i.getPropertyValue("--footer-height")),f=c(i.getPropertyValue("--header-height")),T=c(i.getPropertyValue("--scrollbar-height")),S=window.getComputedStyle(l),w=c(S.marginBottom),V=c(S.paddingBottom),H=window.innerHeight-p-T-r,y=u?Math.min(u.bottom,H):H,g=u?Math.max(u.top,f):f,$=Math.max(m,g),q=y-$-w-V,k=Number.isFinite(q)?Math.floor(q):0,h=k>0?k:s;h>0&&Number.isFinite(h)&&o(v=>Math.abs(v-h)>1?h:v)},[r,e,s]);return(0,Bt.useEffect)(()=>{if(typeof window>"u")return;let l=null,c=null,m=null,u=null,i=()=>{l!==null&&window.cancelAnimationFrame(l),l=window.requestAnimationFrame(()=>{d()})};i(),c=window.setTimeout(()=>{i()},150);let p=e.current;return typeof ResizeObserver<"u"&&p&&(m=new ResizeObserver(()=>{i()}),m.observe(p),p.parentElement&&m.observe(p.parentElement)),n&&typeof MutationObserver<"u"&&(u=new MutationObserver(()=>{i()}),u.observe(document.body,{attributes:!0,childList:!0,subtree:!0})),window.addEventListener("resize",i),()=>{l!==null&&window.cancelAnimationFrame(l),c!==null&&window.clearTimeout(c),m&&m.disconnect(),u&&u.disconnect(),window.removeEventListener("resize",i)}},[e,n,d]),{viewportHeight:a,updateViewportHeight:d}};var me=require("react"),Ws=600,Jr=8,ln=({ref:e,onSelect:t,resolveItem:n,item:r})=>{let[s,a]=(0,me.useState)(!1),[o,d]=(0,me.useState)(null),l=(0,me.useRef)(null),c=(0,me.useRef)(!1),m=(0,me.useRef)(!1),u=(0,me.useRef)(null),i=(0,me.useRef)({onSelect:t,resolveItem:n,item:r});(0,me.useEffect)(()=>{i.current={onSelect:t,resolveItem:n,item:r}},[t,n,r]);let p=(0,me.useCallback)(()=>{typeof window>"u"||l.current!==null&&(window.clearTimeout(l.current),l.current=null)},[]),f=(0,me.useCallback)(()=>{u.current&&(p(),m.current=!1,u.current=null)},[p]),T=(0,me.useCallback)(g=>{typeof window>"u"||g.button!==0&&g.pointerType==="mouse"||(p(),m.current=!1,c.current=!1,u.current={x:g.clientX,y:g.clientY,pointerId:g.pointerId},l.current=window.setTimeout(()=>{let $=i.current,q=null;$.item!==void 0?q=$.item:$.resolveItem&&g.target&&(q=$.resolveItem(g.target)),q!==null&&(c.current=!0,$.onSelect?.(q),d(q),a(!0)),f()},Ws))},[p,f]),S=(0,me.useCallback)(g=>{u.current&&g.pointerId===u.current.pointerId&&(p(),u.current=null,m.current=!1)},[p]),w=(0,me.useCallback)(g=>{c.current&&(g.preventDefault(),g.stopPropagation(),c.current=!1)},[]),V=(0,me.useCallback)(g=>{if(!u.current||g.pointerId!==u.current.pointerId)return;let $=Math.abs(g.clientX-u.current.x),q=Math.abs(g.clientY-u.current.y);($>Jr||q>Jr)&&(p(),u.current=null)},[p]),H=(0,me.useCallback)(g=>{(s||l.current!==null)&&(g.preventDefault(),g.stopPropagation())},[s]),y=(0,me.useCallback)(g=>{g?.cancelLongPressTimer&&p(),g?.suppressLongPress&&(m.current=!0),a(!1),d(null),c.current=!1,u.current=null},[p]);return(0,me.useEffect)(()=>{let g=e.current;if(!(g&&typeof window<"u"))return;let $=[["pointerdown",T,void 0],["pointerup",S,void 0],["pointercancel",S,void 0],["pointermove",V,void 0],["pointerleave",S,void 0],["click",w,!0],["contextmenu",H,void 0]],q=[["contextmenu",H,!0],["pointerup",S,!0],["pointercancel",S,!0]];for(let[k,h,v]of $)g.addEventListener(k,h,v);for(let[k,h,v]of q)window.addEventListener(k,h,v);return()=>{for(let[k,h,v]of $)g.removeEventListener(k,h,v);for(let[k,h,v]of q)window.removeEventListener(k,h,v);p()}},[e,T,S,V,w,H,p]),{isPopupVisible:s,popupItem:o,handleClosePopup:y}};var et=require("react");function dn(e,t,n){let r=n?.mediaQuery??"(min-width: 1024px)",s=(0,et.useSyncExternalStore)((0,et.useCallback)(m=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let u=window.matchMedia(r);return u.addEventListener("change",m),()=>u.removeEventListener("change",m)},[r]),()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(r).matches:!0,()=>!1),[a,o]=(0,et.useState)(!1),[d,l]=(0,et.useState)(0);return(0,et.useEffect)(()=>{if(typeof window>"u"||typeof ResizeObserver>"u")return;let m=e.current;if(!m)return;let u=new ResizeObserver(i=>{for(let p of i){if(p.target!==m)continue;let f=0;p.borderBoxSize&&p.borderBoxSize.length>0?f=p.borderBoxSize[0].inlineSize:f=p.contentRect.width,!(!Number.isFinite(f)||f<=0)&&(l(f),o(T=>T&&f>=t.expandThreshold?!1:!T&&f<t.collapseThreshold?!0:T))}});return u.observe(m),()=>u.disconnect()},[e,t.collapseThreshold,t.expandThreshold]),{isTwoColumn:s&&!a,isContainerNarrow:a,isMediaMatches:s,containerWidth:d}}ce();var qn=require("@aiquants/swipe-overlay"),Ut=require("react");ce();Ca();var cn=require("react/jsx-runtime"),un=({isOpen:e,onClose:t,children:n,className:r="",title:s})=>{let a=J(),o=(0,Ut.useRef)(null),{overlayRef:d,overlayStyle:l,attemptClose:c}=(0,qn.useSwipeToDismissOverlay)({isOpen:e,onClose:t,isCloseBlocked:(0,Ut.useCallback)(()=>!1,[]),skipWhenTextSelected:!0}),m=(0,qn.useTapClick)(()=>c());return(0,Ut.useEffect)(()=>{!e&&o.current?.contains(document.activeElement)&&document.activeElement.blur()},[e]),e?(0,cn.jsxs)("div",{ref:o,"data-testid":"contact-map-mobile-overlay",className:`fixed top-0 bottom-0 left-0 z-50 flex touch-manipulation transition-[visibility] duration-200 ${e?"pointer-events-auto visible":"pointer-events-none invisible"}`,style:{right:"var(--aqcm-overlay-right, 0px)",transition:"right 0.5s, visibility 0.2s"},"aria-hidden":!e,children:[(0,cn.jsx)("button",{type:"button","aria-label":a.overlayBackdrop,className:`absolute inset-0 touch-manipulation bg-slate-900/50 transition-opacity duration-200 focus:outline-none ${e?"opacity-100":"opacity-0"}`,...m}),(0,cn.jsx)("aside",{role:"dialog","aria-modal":"true","aria-label":s===void 0?a.overlayTitle:s,style:l,ref:d,className:`relative ml-auto flex h-full w-full max-w-lg transform touch-pan-y flex-col bg-white shadow-xl transition-transform duration-200 ease-out dark:bg-slate-900 ${r}`,onKeyDown:u=>{u.key==="Escape"&&!Hn(u.nativeEvent)&&(u.stopPropagation(),c())},children:n})]}):null};wa();var M=require("react/jsx-runtime"),Hs=(0,U.lazy)(async()=>({default:(await Promise.resolve().then(()=>(wr(),Tr))).default})),to=64,Zr="h-[64px]",eo=240,_s=4,Ha=jn(on),no=on.listPanelMinWidth,ao=on.detailPanelMinWidth,ro=on.handleThickness,As=Ha.collapseThreshold,Is=Ha.expandThreshold,Fs=({contactData:e})=>{let t=J(),n=He(e?.full_name)??t.noName,r=He(e?.title)??"-",s=He(e?.company_name)??"-",a=He(e?.department)??"-",o=Lt(e).value??"-",d=Et(e).value??"-",l=Be(e?.updated_at,t.recordDateTime);return(0,M.jsx)(en,{fullName:n,title:r,companyName:s,department:a,phoneNumber:d,email:o,updatedAtText:l})},zs=e=>({"--contact-panel-height":`${e}px`}),Bs=e=>typeof e=="object"&&e!==null&&"item"in e,Us=(e,t)=>t!==void 0?`${e}:${t.toFixed(3)}`:void 0,$s=(e,t)=>{for(let n of e){let r=Mn(n);if(r?.person_id===t)return r}return null},Qn=(e,t,n)=>{let{viewportHeight:r}=Wa(t,{enableMutationObserver:!0,bottomGap:_s,minFallbackHeight:eo}),[s,a]=(0,U.useState)(0),o=(0,U.useCallback)(()=>{let u=n.current,i=t.current;if(!(u&&i))return;let p=u.getBoundingClientRect(),f=i.getBoundingClientRect(),T=Math.ceil(f.top-p.top);Number.isFinite(T)&&T>0&&a(S=>Math.abs(S-T)>1?T:S)},[t,n]);(0,U.useLayoutEffect)(()=>{if(!e)return;o();let u=requestAnimationFrame(o);return window.addEventListener("resize",o),()=>{cancelAnimationFrame(u),window.removeEventListener("resize",o)}},[e,o]);let d=r>0?r:eo,l=s>0?s:0,c=d+l,m=(0,U.useMemo)(()=>zs(c),[c]);return{normalizedViewportHeight:d,normalizedDetailHeight:c,panelSizingStyle:m}},Vs=new Set,oo=()=>{let[e,t]=(0,U.useState)(Vs),n=(0,U.useCallback)((r,s)=>{t(a=>{if(a.has(r)===s)return a;let o=new Set(a);return s?o.add(r):o.delete(r),o})},[]);return{isAnyPopupVisible:e.size>0,handlePopupVisibilityChange:n}},so=(e,t,n)=>{let r=(0,U.useRef)(n);(0,U.useLayoutEffect)(()=>{r.current=n},[n]),(0,U.useEffect)(()=>{if(e!==null)return r.current(e,t),()=>{r.current(e,!1)}},[e,t])},io=(0,U.memo)(({entry:e,index:t,selectedPersonId:n,onSelect:r,searchQuery:s,enableHighlighting:a,openEmailsWithGmail:o,openGmailCompose:d,onPopupVisibilityChange:l})=>{let c=J(),m=(0,U.useRef)(null),u=(0,M.jsx)("div",{className:Zr}),i=Bs(e)?e:null,p=Mn(e),{isPopupVisible:f,handleClosePopup:T}=ln({ref:m,onSelect:r,item:p?.person_id});if(so(p?.person_id??null,f,l),!e||!p)return u;let{person_id:S}=p,w=n===S,V=t%2===0?"bg-white dark:bg-slate-900":"bg-gray-50 dark:bg-slate-900/70",y=w?"border-blue-300 bg-blue-50 ring-1 ring-blue-200 dark:border-blue-500 dark:bg-blue-500/20 dark:ring-blue-500/40":V,g=["B","F"].map($=>Us($,$==="B"?i?.baseScore:i?.score)).filter(Boolean);return(0,M.jsxs)("div",{ref:m,className:`flex ${Zr} w-full items-center overflow-hidden border-gray-200 border-b px-4 py-2 text-left transition-colors hover:bg-blue-50 dark:border-slate-700 dark:hover:bg-blue-500/10 ${y}`,style:{height:to},role:"button","aria-pressed":w,"data-selected":w?"true":"false",onClick:()=>r(S),children:[(0,M.jsxs)("div",{className:"hidden w-28 shrink-0 flex-col items-center gap-0.5 text-center sm:flex",children:[(0,M.jsx)("div",{className:"whitespace-nowrap font-medium text-slate-700 text-xs leading-tight dark:text-slate-200",children:c.listRowNumber(t+1)}),(0,M.jsx)("div",{className:"truncate text-[11px] text-slate-700 leading-tight dark:text-slate-200",children:S}),(0,M.jsx)("div",{className:"flex items-center gap-1 whitespace-nowrap font-mono text-[11px] text-slate-600 leading-tight dark:text-slate-300",children:g.length?g.map($=>(0,M.jsx)("span",{children:$},$)):(0,M.jsx)("span",{children:"-"})})]}),(0,M.jsx)(U.Suspense,{fallback:(0,M.jsx)(Fs,{contactData:p}),children:(0,M.jsx)(Hs,{contactData:p,searchTerm:s,enableHighlighting:a,openEmailsWithGmail:o,openGmailCompose:d,isPopupVisible:f,onRequestClose:T})})]})});io.displayName="ContactListRow";var _a=({context:e})=>{let{contactMapRecords:t,filteredItems:n,searchQuery:r,hasSearchTerm:s,enableHighlighting:a,openEmailsWithGmail:o,isSearchTabActive:d}=e,{locale:l,labels:c,engineLabels:m}=Se(),u=(0,U.useRef)(null),i=(0,U.useRef)(null),[p,f]=(0,U.useState)(null),{normalizedViewportHeight:T,panelSizingStyle:S}=Qn(d,i,u),{isAnyPopupVisible:w,handlePopupVisibilityChange:V}=oo(),H=(0,U.useMemo)(()=>({enablePointerDrag:!w,enableKeyboardNavigation:!w}),[w]),y=(0,U.useMemo)(()=>s?n:t,[s,n,t]),g=(0,U.useCallback)(le=>{f(le)},[]),$=(0,U.useCallback)(le=>{if(!o)return;let Ee=le.trim();if(!Ee||Ee==="-"||typeof window>"u")return;let gt=Qe(Ee,!0);gt&&window.open(gt,"_blank","noopener,noreferrer")},[o]),[q,k]=(0,U.useState)(!1),h=(0,U.useCallback)(le=>{g(le),k(!0)},[g]),v=(0,U.useCallback)((le,Ee)=>(0,M.jsx)(io,{entry:le,index:Ee,selectedPersonId:p,onSelect:h,searchQuery:r,enableHighlighting:a,openEmailsWithGmail:o,openGmailCompose:$,onPopupVisibilityChange:V}),[p,h,r,a,o,$,V]),F=(0,U.useCallback)(le=>y[le],[y]),P=(0,U.useCallback)(le=>Mn(y[le])?.person_id??`row-${le}`,[y]),ae=(0,U.useCallback)(()=>to,[]),L=y.length,E=(0,U.useMemo)(()=>({enabled:!0,renderVisual:Gn.tapScrollCircleSampleVisual}),[]),I=(0,U.useMemo)(()=>p===null?null:$s(y,p),[p,y]);(0,U.useEffect)(()=>{p!==null&&!I&&f(null)},[p,I]);let G=(0,U.useRef)(null),{isTwoColumn:oe}=dn(G,Ha),ye=(0,M.jsxs)("div",{ref:u,className:"flex min-h-0 flex-1 flex-col gap-1",children:[(0,M.jsx)("div",{className:"hidden rounded-t-lg border border-gray-200 bg-gray-50 px-4 py-2 transition-colors sm:block dark:border-slate-700 dark:bg-slate-900/70",children:(0,M.jsxs)("div",{className:"flex items-center",children:[(0,M.jsxs)("div",{className:"flex w-28 shrink-0 flex-col items-center gap-0.5 text-center text-[11px] text-slate-700 uppercase tracking-wider dark:text-slate-200",children:[(0,M.jsx)("span",{className:"font-semibold text-slate-900 text-xs dark:text-slate-100",children:c.columnNo}),(0,M.jsx)("span",{className:"leading-tight",children:c.columnId}),(0,M.jsx)("span",{className:"whitespace-nowrap leading-tight",children:c.columnScore})]}),(0,M.jsxs)("div",{className:"hidden w-full grid-cols-3 gap-2 font-medium text-slate-700 text-xs uppercase tracking-wider transition-colors sm:grid xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto] dark:text-slate-200",children:[(0,M.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,M.jsx)("span",{children:c.columnName}),(0,M.jsx)("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:c.columnTitle})]}),(0,M.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,M.jsx)("span",{children:c.columnCompany}),(0,M.jsx)("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:c.columnDepartment})]}),(0,M.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,M.jsx)("span",{children:c.columnPhone}),(0,M.jsx)("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:c.columnEmail})]}),(0,M.jsx)("div",{className:"hidden items-end justify-end xl:flex",children:(0,M.jsx)("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:c.columnUpdatedAt})})]})]})}),(0,M.jsx)("div",{ref:i,className:"flex-1",children:(0,M.jsx)(Gn.VirtualScroll,{itemCount:L,getItemKey:P,behaviorOptions:H,getItem:F,getItemHeight:ae,viewportSize:T,overscanCount:10,scrollBarOptions:{width:8,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:E},locale:l,labels:m,className:"w-full rounded-b-lg border border-gray-200 border-t-0 bg-white pr-0.75 transition-colors dark:border-slate-700 dark:bg-slate-950",children:(le,Ee)=>v(le,Ee)})}),n.length===0&&s?(0,M.jsx)("div",{className:"py-8 text-center",children:(0,M.jsx)("p",{className:"text-slate-600 dark:text-slate-300",children:c.listNoSearchResults})}):null,L===0&&!s?(0,M.jsx)("div",{className:"py-8 text-center",children:(0,M.jsx)("p",{className:"text-slate-600 dark:text-slate-300",children:c.listNoData})}):null]});return(0,M.jsx)("div",{ref:G,"data-testid":"contact-map-list-root",className:"flex min-h-0 flex-1 flex-col",style:S,children:oe?(0,M.jsxs)(St.PanelGroup,{id:"contact-map-list-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-list-panel-group",children:[(0,M.jsx)(St.Panel,{id:"contact-map-list-pane",defaultSize:{value:68,unit:"percentage"},minSize:{value:no,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:ye}),(0,M.jsx)(St.PanelResizeHandle,{id:"contact-map-list-handle",thickness:ro,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:"cursor-col-resize rounded transition-colors hover:bg-slate-200/60 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 dark:hover:bg-slate-700/60","aria-label":c.listResizeHandle}),(0,M.jsx)(St.Panel,{id:"contact-map-list-detail-pane",defaultSize:{value:32,unit:"percentage"},minSize:{value:ao,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:(0,M.jsx)(Je,{contact:I,searchTerm:r,enableHighlighting:a})})]}):(0,M.jsxs)(M.Fragment,{children:[ye,(0,M.jsx)("div",{className:"hidden","aria-hidden":"true",children:(0,M.jsx)(Je,{contact:I,searchTerm:r,enableHighlighting:a})}),I?(0,M.jsx)(un,{isOpen:q,onClose:()=>k(!1),className:"z-50 bg-white dark:bg-slate-900",children:(0,M.jsxs)("div",{className:"flex h-full flex-col overflow-hidden p-3 sm:p-4",children:[(0,M.jsxs)("div",{className:"mb-2 flex items-center justify-between border-b pr-10 pb-2 dark:border-slate-700",children:[(0,M.jsx)("h3",{className:"font-semibold text-slate-900 text-sm dark:text-slate-100",children:c.detailHeading}),(0,M.jsx)("button",{type:"button",onClick:()=>k(!1),className:"rounded px-2.5 py-1 font-medium text-slate-600 text-xs hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800",children:c.close})]}),(0,M.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto",style:{height:"100%"},children:(0,M.jsx)(Je,{contact:I,searchTerm:r,enableHighlighting:a})})]})}):null]})})};var bo=require("@aiquants/directory-tree"),wt=require("@aiquants/resize-panels"),xo=require("@aiquants/virtualscroll"),vo=de(require("@heroicons/react/24/solid/FolderMinusIcon.js")),Co=de(require("@heroicons/react/24/solid/FolderPlusIcon.js")),_=require("react"),ko=require("react-dom");yt();var Aa=(e,t)=>e&&e.trim()||t;var tt=require("react"),Ia=(e,t=250)=>{let[n,r]=(0,tt.useState)(e),s=(0,tt.useRef)(null),a=(0,tt.useRef)(e),o=(0,tt.useRef)(null),d=(0,tt.useRef)(!1);return(0,tt.useEffect)(()=>{if(!d.current){d.current=!0,r(e),a.current=e;return}a.current=n,s.current=null;let l=c=>{s.current??(s.current=c);let m=c-s.current,u=Math.min(1,Math.max(0,m/t)),i=1-(1-u)**3,p=Math.max(0,Math.round(a.current+(e-a.current)*i));r(p),u<1&&(o.current=requestAnimationFrame(l))};return o.current=requestAnimationFrame(l),()=>{o.current!==null&&cancelAnimationFrame(o.current)}},[e,t]),Math.max(0,n)};var Ce=require("react");Ot();ce();var po={},Ks=250,js=4e3,Yn=3,lo={treeWorkerFactory:"the view remounts","workerUrls.treeWorker":"the page reloads"},co=(e,t)=>e.uncategorizedCompany===t.uncategorizedCompany&&e.unnamedPerson===t.unnamedPerson,pn=class{constructor(t,{workerSource:n,logger:r=Ve}){this.worker=null;this.generation=0;this.postedCount=0;this.latestSnapshot=null;this.workerNeedsReset=!1;this.lastSyncedRecords=[];this.postedNaming=null;this.lastSyncedNaming=null;this.consecutiveFailures=0;this.finalizeRequest=null;this.finalizedPostedCount=null;this.retryTimer=null;this.listeners=new Set;this.state={snapshot:null,isBuilding:!1};this.getState=()=>this.state;this.subscribe=t=>(this.listeners.add(t),()=>this.listeners.delete(t));this.handleMessage=t=>{let n=t.data;n.type!=="TREE_CHUNK"||n.generation!==this.generation||n.uniquePersonCount===0&&this.postedCount>0&&(this.latestSnapshot?.uniquePersonCount??0)>0||this.latestSnapshot!==null&&n.uniquePersonCount<this.latestSnapshot.uniquePersonCount&&!(n.isIdle&&n.consumedRecords>=this.postedCount)||(n.isIdle&&n.consumedRecords>=this.postedCount&&(this.consecutiveFailures=0),this.latestSnapshot={tree:n.tree,directoryPaths:n.directoryPaths,consumedRecords:n.consumedRecords,uniquePersonCount:n.uniquePersonCount,isIdle:n.isIdle,rebuildEpoch:n.rebuildEpoch},this.updateState())};this.handleFailure=t=>{if(this.worker?.terminate(),this.worker=null,this.postedCount=0,this.consecutiveFailures+=1,this.updateState(),this.consecutiveFailures>=Yn){this.logger.error(`[TreeWorker] the tree Worker failed ${Yn} times in a row; the tree stops updating until ${lo[this.workerSource]} (check ${this.workerSource})`,t);return}let n=Math.min(Ks*2**(this.consecutiveFailures-1),js);this.logger.warn(`[TreeWorker] the tree Worker failed; retrying in ${n}ms (failure ${this.consecutiveFailures} of ${Yn})`,t),this.retryTimer!==null&&clearTimeout(this.retryTimer),this.retryTimer=setTimeout(()=>{this.retryTimer=null;let r=this.lastSyncedNaming;r!==null&&this.syncRecords(this.lastSyncedRecords,r)},n)};if(typeof n!="string")throw new TypeError(`[contact-map] TreeWorkerSession workerSource must be a string; got ${se(n)}`);if(!Object.hasOwn(lo,n))throw new RangeError(`[contact-map] TreeWorkerSession workerSource must be "treeWorkerFactory" or "workerUrls.treeWorker"; got ${se(n)}`);this.workerFactory=t,this.workerSource=n,this.logger=r}updateState(){let t=this.postedCount>(this.latestSnapshot?.consumedRecords??0);this.state.snapshot===this.latestSnapshot&&this.state.isBuilding===t||(this.state={snapshot:this.latestSnapshot,isBuilding:t},this.notify())}notify(){for(let t of this.listeners)t()}ensureWorker(){if(this.consecutiveFailures>=Yn||this.retryTimer!==null)return null;if(!this.worker)try{this.worker=this.workerFactory(),this.workerNeedsReset=!0,this.worker.onerror=this.handleFailure,this.worker.onmessageerror=this.handleFailure,this.worker.onmessage=this.handleMessage}catch(t){return this.handleFailure(t),null}return this.worker}syncRecords(t,n){this.finalizeRequest!==null&&(t.length<this.finalizeRequest.recordCount||this.finalizeRequest.naming===null||!co(this.finalizeRequest.naming,n))&&(this.finalizeRequest=null),this.lastSyncedRecords=t,this.lastSyncedNaming=n;let r=this.ensureWorker();if(!r)return;let s=this.workerNeedsReset,a=this.postedNaming===null||!co(this.postedNaming,n);if((this.workerNeedsReset||a||t.length<this.postedCount)&&(this.generation+=1,this.postedCount=0,this.finalizedPostedCount=null,this.workerNeedsReset=!1,this.postedNaming=n,r.postMessage({type:"RESET_TREE",generation:this.generation,epochBase:this.latestSnapshot?.rebuildEpoch??0,naming:n}),this.updateState()),t.length>this.postedCount){let o=t.slice(this.postedCount);this.postedCount=t.length,r.postMessage({type:"APPEND_RECORDS",generation:this.generation,records:o}),this.updateState()}s&&this.finalizeRequest!==null&&this.finalize()}finalize(){this.finalizeRequest={recordCount:this.lastSyncedRecords.length,naming:this.lastSyncedNaming},!(this.worker===null||this.finalizedPostedCount===this.postedCount)&&(this.finalizedPostedCount=this.postedCount,this.worker.postMessage({type:"FINALIZE_TREE",generation:this.generation}))}cancelWorker(){this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.worker?.terminate(),this.worker=null,this.postedCount=0,this.postedNaming=null,this.finalizedPostedCount=null}stop(){this.cancelWorker(),this.consecutiveFailures=0,this.updateState()}reset(){this.cancelWorker(),this.listeners.clear(),this.latestSnapshot=null,this.lastSyncedRecords=[],this.lastSyncedNaming=null,this.consecutiveFailures=0,this.finalizeRequest=null,this.state={snapshot:null,isBuilding:!1}}},qs=e=>{if(e!==void 0)return new Worker(e,{type:"module"});let t=typeof po<"u"?po.url:void 0;if(t){let r=t.includes(".ts")?"../workers/treeWorker.ts":"./worker/treeWorker.mjs";return new Worker(new URL(r,t),{type:"module"})}throw new Error("[contact-map] the tree Worker needs workerUrls.treeWorker in a build without import.meta.url (CommonJS)")},Tt=null,uo=e=>e===void 0?"the bundled Worker file (workerUrls.treeWorker unset)":JSON.stringify(e),Gs=e=>{if(e===void 0)throw new Error("[contact-map] treeWorkerFactory was removed from the config while its tree session was still in use");return e},mo=e=>{if(La(e),Tt===null){let t=new pn(()=>qs(e),{workerSource:"workerUrls.treeWorker"});return Tt={session:t,workerUrl:e},t}if(Tt.workerUrl!==e)throw new Error(`[contact-map] the tree session already loads its Worker from ${uo(Tt.workerUrl)} and cannot also load it from ${uo(e)}; give every contact-map view in the browser tab the same workerUrls.treeWorker, on every route (after changing it, reload the page)`);return Tt.session},Qs=()=>{Tt?.session.reset(),Tt=null},Ys={snapshot:null,isBuilding:!1};function Fa(e,t=!1){let n=Ke(),r=n.treeWorkerFactory,s=n.workerUrls?.treeWorker,{labels:a}=Se(),o=a.uncategorizedCompany,d=a.noName,l=(0,Ce.useMemo)(()=>({uncategorizedCompany:o,unnamedPerson:d}),[o,d]),c=(0,Ce.useRef)(r);(0,Ce.useEffect)(()=>{c.current=r},[r]);let m=r!==void 0,u=m?void 0:s,i=(0,Ce.useMemo)(()=>m?new pn(()=>Gs(c.current)(),{workerSource:"treeWorkerFactory"}):null,[m]),p=(0,Ce.useCallback)(()=>i===null?mo(u):i,[i,u]),f=(0,Ce.useCallback)(S=>p().subscribe(S),[p]),T=(0,Ce.useCallback)(()=>p().getState(),[p]);return(0,Ce.useEffect)(()=>{let S=p();S.syncRecords(e,l),t&&S.finalize()},[p,e,t,l]),(0,Ce.useEffect)(()=>{if(i!==null)return()=>i.stop()},[i]),(0,Ce.useSyncExternalStore)(f,T,()=>Ys)}ce();Ta();In();var N=require("react/jsx-runtime"),Ua=jn(sn),So=sn.listPanelMinWidth,To=sn.detailPanelMinWidth,wo=sn.handleThickness,Xs=Ua.collapseThreshold,Js=Ua.expandThreshold,Zs=(e,t)=>{let{searchQuery:n,enableHighlighting:r}=t,s=Aa(e.full_name,t.noName),a=Aa(e.title,""),o=(0,N.jsx)(he,{text:s,query:n,enabled:r});return a?(0,N.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,N.jsx)("span",{children:o}),(0,N.jsx)("span",{className:"text-slate-400 text-xs dark:text-slate-500",children:(0,N.jsx)(he,{text:a,query:n,enabled:r})})]}):o},ei="contact-map-tree h-full w-full",ti={hoverClassName:"bg-slate-100/70 dark:bg-slate-800/60",directorySelectedClassName:"bg-sky-100/55 dark:bg-sky-900/40 [&_.directory-tree-name]:text-sky-700 dark:[&_.directory-tree-name]:text-sky-300",itemSelectedClassName:"bg-sky-100/70 dark:bg-sky-900/55 [&_.directory-tree-name]:text-sky-700 dark:[&_.directory-tree-name]:text-sky-300"},za="h-4 w-4 shrink-0 transition-colors duration-150",No=(e,t,n)=>({...e,viewportHeightOverride:t,behaviorOptions:{...e.behaviorOptions,enablePointerDrag:!n}}),Xn=null,go=null,mn=new Map,ho="",fo=null,yo=null,ni=(e,t,n,r,s)=>{let a=`${n?"icons":"plain"}#${r}#${s.noName}`;(a!==ho||s.formatDirectoryName!==fo||t!==yo)&&(mn.clear(),ho=a,fo=s.formatDirectoryName,yo=t);let o={entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},d=new Set;for(let l of e){d.add(l.absolutePath);let c=`${l.name}\0${l.memberCount}`,m=mn.get(l.absolutePath);(!m||m.signature!==c)&&(m={signature:c,result:Po([l],t,n,{searchQuery:"",enableHighlighting:!1,noName:s.noName,formatDirectoryName:s.formatDirectoryName})},mn.set(l.absolutePath,m));let u=m.result;u.entries.length>0&&o.entries.push(u.entries[0]);for(let[i,p]of u.personPathMap){let f=o.personPathMap.get(i);if(f)for(let T of p)f.add(T);else o.personPathMap.set(i,new Set(p))}for(let[i,p]of u.contactByPath)o.contactByPath.set(i,p);for(let[i,p]of u.ancestorsByPath)o.ancestorsByPath.set(i,p);o.totalCount+=u.totalCount,!o.firstPerson&&u.firstPerson&&(o.firstPerson=u.firstPerson)}for(let l of mn.keys())d.has(l)||mn.delete(l);return o},Ba=e=>e.isSelected||e.isItemSelected?"text-sky-600 dark:text-sky-300":e.isExpanded&&e.isDirectory?"text-slate-600 dark:text-slate-200":"text-slate-500 dark:text-slate-400",Mo=e=>{let t=[];for(let n of e)n.type==="directory"&&(t.push(n.absolutePath),n.children&&t.push(...Mo(n.children)));return t},ai=e=>{if(e.memberCount===void 0)throw new Error(`[contact-map] directory entry ${e.absolutePath} has no memberCount`);return e.memberCount},Po=(e,t,n,r,s)=>{let a=new Map,o=new Map,d=new Map,l=0,c=null,m=(i,p)=>{let f=[...p,i.absolutePath];d.set(i.absolutePath,f);let T,S,w=i.type==="directory"?r.formatDirectoryName(i.name,ai(i)):i.name,V=(0,N.jsx)(he,{text:w,query:r.searchQuery,enabled:r.enableHighlighting});if(i.type==="file"&&i.personId){if(s&&!s.has(i.personId))return null;let H=t.get(i.personId);if(H){o.set(i.absolutePath,H),a.has(i.personId)||a.set(i.personId,new Set);let y=a.get(i.personId);y&&y.add(i.absolutePath),l++,c||(c={personId:i.personId,path:i.absolutePath}),n&&(S=g=>{let $=Ba(g);return g.isSelected||g.isItemSelected||i.isPrimary&&($=i.title?"text-indigo-600 dark:text-indigo-400":"text-orange-500 dark:text-orange-400"),(0,N.jsx)(n.person,{"aria-hidden":"true",className:`${za} ${$}`})},i.title&&(V=Zs(H,r))),V=(0,N.jsx)("span",{"data-contact-path":i.absolutePath,className:"block w-full",children:V})}}else if(i.children){let H=i.children.map(y=>m(y,f)).filter(y=>y!==null);if(s&&H.length===0)return null;if(T=H,n){let y=i.relativePath.startsWith("company:")?n.company:n.department;S=g=>(0,N.jsx)(y,{"aria-hidden":"true",className:`${za} ${Ba(g)}`})}}return{name:w,label:V,type:i.type,absolutePath:i.absolutePath,relativePath:i.relativePath,icon:S,children:T}};return{entries:e.map(i=>m(i,[])).filter(i=>i!==null),personPathMap:a,contactByPath:o,ancestorsByPath:d,firstPerson:c,totalCount:l}},ri=(e,t,n)=>{let r=new Set,s=new Set,a=new Map;t.forEach((m,u)=>{a.set(m.item.person_id,u)});for(let m of t){let u=m.item.person_id,i=e.personPathMap.get(u);if(i)for(let p of i){r.add(p);let f=e.ancestorsByPath.get(p);if(f){for(let T of f)r.add(T);n&&f.length>0&&s.add(f[0])}}}let o=new Map,d=m=>{let u=o.get(m.absolutePath);if(u!==void 0)return u;let i=1/0;if(m.type==="file"){let p=e.contactByPath.get(m.absolutePath);p&&(i=a.get(p.person_id)??1/0)}else if(m.children)for(let p of m.children)i=Math.min(i,d(p));return o.set(m.absolutePath,i),i},l=(m,u=0)=>m.filter(i=>n&&u===0&&s.has(i.absolutePath)?!0:r.has(i.absolutePath)).map(i=>n&&u===0&&s.has(i.absolutePath)?i:i.type==="directory"&&i.children?{...i,children:l(i.children,u+1)}:i).sort((i,p)=>u===0?d(i)-d(p):0),c=l(e.entries);return{...e,entries:c}},$a=({context:e,controlsContainer:t})=>{let{contactMapRecords:n,contactMapRecordMap:r,filteredItems:s,hasSearchTerm:a,isSearchInProgress:o,isSearchTabActive:d}=e,{locale:l,labels:c,treeLabels:m}=Se(),u=c.noName,i=c.treeDirectoryName,p=(0,_.useMemo)(()=>({noName:u,formatDirectoryName:i}),[u,i]),[f,T]=(0,_.useState)(null),[S,w]=(0,_.useState)(!1),{snapshot:V,isBuilding:H}=Fa(n,e.isStreamingComplete),y=V?.tree??null,g=V?.rebuildEpoch??0,$=(0,_.useMemo)(()=>y?ni(y,r,f,g,p):null,[y,r,f,g,p]),q=(0,_.useMemo)(()=>{if(!y)return null;if(!a)return $;let W;S||(W=new Set(s.map(ee=>ee.item.person_id)));let Q=Po(y,r,f,{...p,searchQuery:e.searchQuery,enableHighlighting:e.enableHighlighting},W);return ri(Q,s,S)},[y,$,r,f,e.searchQuery,e.enableHighlighting,a,s,S,p]),k=(0,_.useMemo)(()=>q||{entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},[q]),h=a&&e.errorMessage!==null,[v,F]=(0,_.useState)(k),P=(0,_.useRef)(!1);(0,_.useEffect)(()=>{if(!(o||h)){P.current=!!y,F(k);return}!P.current&&y&&k.entries.length>0&&(P.current=!0,F(k))},[k,y,o,h]);let ae=a&&(o||h)?v:k,{entries:L,personPathMap:E,contactByPath:I,totalCount:G}=ae,oe=(0,_.useMemo)(()=>Mo(L),[L]),[ye,le]=(0,_.useState)(()=>go??new Set),Ee=(0,_.useCallback)(W=>!ye.has(W),[ye]),gt=(0,_.useCallback)(W=>{le(Q=>{let ee=new Set(Q);return ee.has(W)?ee.delete(W):ee.add(W),ee})},[]),Mt=(0,_.useCallback)(W=>{W.length!==0&&le(Q=>{let ee=new Set(Q);for(let Oe of W)ee.add(Oe);return ee})},[]),gn=(0,_.useCallback)(W=>{le(Q=>{if(Q.size===0)return Q;let ee=!1,Oe=new Set(Q);for(let K of W)Oe.delete(K)&&(ee=!0);return ee?Oe:Q})},[]);(0,_.useEffect)(()=>{go=ye},[ye]),(0,_.useEffect)(()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem("contact-map.tree-expanded")}catch{}},[]);let[ge,$t]=(0,_.useState)(null),[we,at]=(0,_.useState)(null),[hn,qe]=(0,_.useState)(!1),[la,fn]=(0,_.useState)(!1),yn=(0,_.useRef)(null),Vt=(0,_.useRef)(null),{normalizedViewportHeight:re,panelSizingStyle:bn}=Qn(d,Vt,yn),rt=(0,_.useCallback)(W=>{let Q=I.get(W);Q&&(ge!==Q.person_id&&$t(Q.person_id),W!==we&&at(W),qe(!0))},[I,we,ge]),Kt=(0,_.useCallback)(W=>{rt(W.entry.absolutePath)},[rt]),ot=(0,_.useCallback)(W=>W instanceof Element?W.closest("[data-contact-path]")?.getAttribute("data-contact-path")??null:null,[]),{isPopupVisible:Ne,popupItem:jt,handleClosePopup:qt}=ln({ref:Vt,resolveItem:ot,onSelect:rt}),Ie=(0,_.useCallback)(W=>{if(!e.openEmailsWithGmail)return;let Q=W.trim();if(!Q||Q==="-"||typeof window>"u")return;let ee=Qe(Q,!0);ee&&window.open(ee,"_blank","noopener,noreferrer")},[e.openEmailsWithGmail]),st=jt?I.get(jt):null,Fe=Ne&&st!==null&&st!==void 0;(0,_.useEffect)(()=>{Ne&&!st&&qt()},[Ne,st,qt]);let ht=(0,_.useMemo)(()=>({overscanCount:16,callbackThrottleMs:16,scrollBarOptions:{width:8,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:{enabled:!0,renderVisual:xo.tapScrollCircleSampleVisual}},behaviorOptions:{resetOnGetItemHeightChange:!1},preserveScrollAnchor:!0}),[]),it=(0,_.useMemo)(()=>No(ht,re,Fe),[ht,re,Fe]);(0,_.useEffect)(()=>{let W=!1;return typeof window>"u"?()=>{W=!0}:Xn?(T(Xn),()=>{W=!0}):((async()=>{try{let[ee,Oe,K,Y]=await Promise.all([import("lucide-react/dist/esm/icons/building-2.js"),import("lucide-react/dist/esm/icons/users-round.js"),import("lucide-react/dist/esm/icons/id-card.js"),import("lucide-react/dist/esm/icons/user-round.js")]);if(W)return;let fe=ee.default,ze=Oe.default,pa=K.default,Xa=Y.default;fe&&ze&&pa&&Xa&&(Xn={company:fe,department:ze,title:pa,person:Xa},T(Xn))}catch(ee){Ve.warn("Failed to load lucide icons",ee)}})(),()=>{W=!0})},[]);let ft=(0,_.useMemo)(()=>{if(!f)return;let W=Y=>fe=>(0,N.jsx)(Y,{"aria-hidden":"true",className:`${za} ${Ba(fe)}`}),Q={company:W(f.company),department:W(f.department),title:W(f.title)},ee=W(f.person),Oe=Y=>Y in Q,K=Y=>{let[fe]=Y.entry.relativePath.split(":",1);return(Oe(fe)?Q[fe]:Q.company)(Y)};return{directory:K,directoryExpanded:K,file:ee}},[f]),Pt=(0,_.useCallback)(()=>{le(W=>W.size===0?W:new Set)},[]),da=(0,_.useCallback)(()=>{oe.length>0&&Mt(oe)},[oe,Mt]);(0,_.useEffect)(()=>{if(typeof window>"u")return;let W=document.documentElement,Q=window.matchMedia("(prefers-color-scheme: dark)"),ee=()=>fn(W.classList.contains("dark")||Q.matches);ee(),Q.addEventListener("change",ee);let Oe=new MutationObserver(ee);return Oe.observe(W,{attributes:!0,attributeFilter:["class"]}),()=>{Q.removeEventListener("change",ee),Oe.disconnect()}},[]),(0,_.useEffect)(()=>{if(G===0){ge!==null&&$t(null),we!==null&&at(null);return}if(ge!==null){let W=E.get(ge);if(W){if(we&&W.has(we))return;let Q=W.values().next().value;Q&&at(Q);return}}ge!==null&&$t(null),we!==null&&at(null)},[G,ge,we,E]);let lt=we?I.get(we)??null:null,Ge=la?"#475569":"#94A3B8",Gt=e.isStreamingComplete,ca=e.isStreamingFailed,xn=Gt&&n.length===0,vn=(H||!y)&&!xn,Cn=Ia(G,250),dt=y!==null||xn,Rt=(0,N.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,N.jsxs)("span",{className:"inline-flex h-5 items-center gap-1 rounded bg-slate-100 px-1.5 font-medium font-mono text-[10px] text-slate-700 dark:bg-slate-800 dark:text-slate-200",title:c.treeNodeCountTitle,children:[(0,N.jsx)("span",{className:"text-[10px]",children:"\u{1F333}"})," ",c.treeNodeCountLabel," ",dt?c.treeNodeCount(Cn):"\u2026"]}),ca&&!Gt?(0,N.jsxs)("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-rose-200 bg-rose-50 px-1.5 font-medium text-[10px] text-rose-700 dark:border-rose-800 dark:bg-rose-950/60 dark:text-rose-300",title:c.treeStreamInterruptedTitle,children:[(0,N.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-rose-500"}),(0,N.jsx)("span",{className:"text-[10px]",children:"\u26D4"})," ",c.treeStreamInterrupted]}):Gt?vn?(0,N.jsxs)("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-amber-200 bg-amber-50 px-1.5 font-medium text-[10px] text-amber-700 dark:border-amber-800 dark:bg-amber-950/60 dark:text-amber-300",title:c.treeBuildingTitle,children:[(0,N.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,N.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-amber-400 opacity-75"}),(0,N.jsx)("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-amber-500"})]}),(0,N.jsx)("span",{className:"text-[10px]",children:"\u{1F33F}"})," ",c.treeBuilding]}):(0,N.jsxs)("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-emerald-200 bg-emerald-50 px-1.5 font-medium text-[10px] text-emerald-700 dark:border-emerald-800 dark:bg-emerald-950/60 dark:text-emerald-300",title:c.treeCompleteTitle,children:[(0,N.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500"}),(0,N.jsx)("span",{className:"text-[10px]",children:"\u2705"})," ",c.treeComplete]}):(0,N.jsxs)("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-sky-200 bg-sky-50 px-1.5 font-medium text-[10px] text-sky-700 dark:border-sky-800 dark:bg-sky-950/60 dark:text-sky-300",title:c.treeStreamLoadingTitle,children:[(0,N.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,N.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-sky-400 opacity-75"}),(0,N.jsx)("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-sky-500"})]}),(0,N.jsx)("span",{className:"text-[10px]",children:"\u23F3"})," ",c.treeStreamLoading]}),a&&(0,N.jsxs)("button",{type:"button",onClick:()=>w(!S),className:`inline-flex h-5 items-center rounded px-1.5 text-[10px] transition-colors ${S?"bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300":"text-slate-500 hover:bg-slate-100 dark:text-slate-400 dark:hover:bg-slate-800"}`,title:c.treeShowEntireCompanyTitle,children:[(0,N.jsx)("span",{className:"text-[10px]",children:"\u{1F3E2}"})," ",c.treeShowEntireCompany]}),oe.length>0?(0,N.jsxs)("div",{className:"flex items-center gap-1",children:[(0,N.jsx)("button",{type:"button",onClick:Pt,className:"inline-flex h-5 w-5 items-center justify-center rounded border border-slate-300 bg-white text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 dark:hover:text-slate-100","aria-label":c.treeExpandAll,title:c.treeExpandAllTitle,children:(0,N.jsx)(Co.default,{className:"h-3 w-3"})}),(0,N.jsx)("button",{type:"button",onClick:da,className:"inline-flex h-5 w-5 items-center justify-center rounded border border-slate-300 bg-white text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 dark:hover:text-slate-100","aria-label":c.treeCollapseAll,title:c.treeCollapseAllTitle,children:(0,N.jsx)(vo.default,{className:"h-3 w-3"})})]}):null]}),kn=(0,_.useRef)(null),{isTwoColumn:Sn}=dn(kn,Ua,{mediaQuery:"(min-width: 768px)"}),Tn=(0,_.useMemo)(()=>({toggle:gt,isExpanded:Ee,expandMultiple:gn,collapseMultiple:Mt,isPending:o}),[Mt,gn,Ee,gt,o]),wn=(0,_.useMemo)(()=>({onEntryClick:Kt,selectedPath:we}),[Kt,we]),ua=(0,_.useMemo)(()=>({className:ei,lineColor:Ge,iconOverrides:ft,showDirectoryIcons:!!ft,showFileIcons:!!ft,highlightStyles:ti,entryClassName:"rounded-md px-1 py-0.5",nameClassName:"text-xs tracking-tight",directoryNameClassName:"font-normal text-slate-800 dark:text-slate-100",fileNameClassName:"text-slate-700 dark:text-slate-200"}),[Ge,ft]),Qt=(0,N.jsx)("div",{ref:yn,className:"flex min-h-0 flex-1 flex-col rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950",children:(0,N.jsx)("div",{ref:Vt,className:"flex min-h-0 flex-1 flex-col overflow-hidden p-2",children:L.length>0?(0,N.jsx)(bo.DirectoryTree,{entries:L,expansion:Tn,selection:wn,visual:ua,virtualScroll:it,locale:l,labels:m}):(0,N.jsx)("div",{className:"flex h-full w-full items-center justify-center rounded-lg border border-slate-300 border-dashed bg-white/70 px-6 text-center text-slate-500 text-sm transition-colors dark:border-slate-700 dark:bg-slate-900/50 dark:text-slate-300",children:a?c.treeNoMatches:c.treeEmpty})})});return(0,N.jsxs)("div",{ref:kn,"data-testid":"contact-map-tree-root",className:"flex min-h-0 flex-1 flex-col",style:bn,children:[t&&(0,ko.createPortal)(Rt,t),Sn?(0,N.jsxs)(wt.PanelGroup,{id:"contact-map-tree-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-tree-panel-group",children:[(0,N.jsx)(wt.Panel,{id:"contact-map-tree-pane",defaultSize:{value:60,unit:"percentage"},minSize:{value:So,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:Qt}),(0,N.jsx)(wt.PanelResizeHandle,{id:"contact-map-tree-handle",thickness:wo,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:"cursor-col-resize rounded transition-colors hover:bg-slate-200/60 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 dark:hover:bg-slate-700/60","aria-label":c.treeResizeHandle}),(0,N.jsx)(wt.Panel,{id:"contact-map-tree-detail-pane",defaultSize:{value:40,unit:"percentage"},minSize:{value:To,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:(0,N.jsx)(Je,{contact:lt??null,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})})]}):(0,N.jsxs)(N.Fragment,{children:[Qt,(0,N.jsx)("div",{className:"hidden","aria-hidden":"true",children:(0,N.jsx)(Je,{contact:lt,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})}),hn&&lt?(0,N.jsx)(un,{isOpen:hn,onClose:()=>qe(!1),className:"z-50 bg-white dark:bg-slate-900",children:(0,N.jsxs)("div",{className:"flex h-full flex-col overflow-hidden p-3 sm:p-4",children:[(0,N.jsxs)("div",{className:"mb-2 flex items-center justify-between border-b pr-10 pb-2 dark:border-slate-700",children:[(0,N.jsx)("h3",{className:"font-semibold text-slate-900 text-sm dark:text-slate-100",children:c.detailHeading}),(0,N.jsx)("button",{type:"button",onClick:()=>qe(!1),className:"rounded px-2.5 py-1 font-medium text-slate-600 text-xs hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-800",children:c.close})]}),(0,N.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto",style:{height:"100%"},children:(0,N.jsx)(Je,{contact:lt,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})})]})}):null]}),Fe&&st&&(0,N.jsx)(Zt,{contactData:st,openEmailsWithGmail:e.openEmailsWithGmail,openGmailCompose:Ie,onRequestClose:qt})]})};var Le=require("react/jsx-runtime"),Va="view",oi={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},si=e=>e==="tree"?"tree":"list",Ka=({context:e})=>{let t=J(),[n,r]=(0,Ro.useSearchParams)(),[s,a]=(0,Jn.useState)(null),o=si(n.get(Va)),{setScrollableRef:d,onPointerDown:l,onPointerMove:c,onPointerUp:m,onPointerLeave:u,onPointerCancel:i,onClickCapture:p}=Ze(),f=(0,Jn.useCallback)(T=>{let S=T==="tree"?"tree":"list";if(S===o)return;let w=new URLSearchParams(typeof window<"u"?window.location.search:"");S==="list"?w.delete(Va):w.set(Va,S),r(w,{replace:!0})},[o,r]);return(0,Le.jsxs)("div",{"data-testid":"contact-map-search-tab-group",className:"flex h-full flex-1 flex-col",children:[(0,Le.jsxs)("div",{className:"mt-1 mb-1.5 flex shrink-0 items-center gap-2",children:[(0,Le.jsxs)("div",{ref:d,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-lg bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:oi,onPointerDown:l,onPointerMove:c,onPointerUp:m,onPointerLeave:u,onPointerCancel:i,onClickCapture:p,children:[(0,Le.jsxs)("button",{type:"button","data-testid":"contact-map-tab-list",onClick:()=>f("list"),className:`rounded px-2 py-0.5 text-xs transition-colors ${o==="list"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4C4} ",t.listViewTab]}),(0,Le.jsxs)("button",{type:"button","data-testid":"contact-map-tab-tree",onClick:()=>f("tree"),className:`rounded px-2 py-0.5 text-xs transition-colors ${o==="tree"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F333} ",t.treeViewTab]})]}),(0,Le.jsx)("div",{ref:a,className:"flex items-center gap-1.5"})]}),(0,Le.jsxs)("div",{className:"flex h-full flex-1 flex-col",children:[(0,Le.jsx)("div",{className:`${o==="list"?"flex h-full flex-1 flex-col":"hidden"}`,children:o==="list"?(0,Le.jsx)(_a,{context:e}):null}),(0,Le.jsx)("div",{className:`${o==="tree"?"flex h-full flex-1 flex-col":"hidden"}`,children:o==="tree"?(0,Le.jsx)($a,{context:e,controlsContainer:s}):null})]})]})};var Lo=require("react");ce();var j=require("@aiquants/fuzzy-search"),be=require("react");ce();var b=require("react/jsx-runtime"),ja=1e3,Zn=(0,be.memo)(({searchOptions:e,setSearchOptions:t})=>{let n=J(),r="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",s="text-xs font-semibold",a=e.sortBy==="relevance",o=(0,be.useId)(),d=(0,be.useId)(),l=(0,be.useId)(),c=(0,be.useId)(),m=(0,be.useId)(),u=(0,be.useId)(),i=(0,be.useId)(),p=(0,be.useId)(),f=(0,be.useId)(),T=(0,be.useId)(),S=(0,be.useId)(),w=[];w.push((0,b.jsxs)("div",{className:`${r} border-green-200 border-l-4 dark:border-green-400/60`,children:[(0,b.jsxs)("div",{className:`${s} text-green-700 dark:text-green-300`,children:["\u{1F3D7}\uFE0F ",n.indexBuildHeading]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{htmlFor:o,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexNgramSize}),(0,b.jsx)("input",{id:o,type:"range",min:"1",max:"4",step:"1",value:e.ngramSize||j.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize,onChange:y=>t(g=>({...g,ngramSize:parseInt(y.target.value,10)})),className:"w-full"}),(0,b.jsxs)("span",{className:"text-green-600 text-xs dark:text-green-300",children:[n.currentValueLabel," ",e.ngramSize||j.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize]}),(0,b.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexNgramSizeHint})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{htmlFor:d,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexMinNgramOverlap}),(0,b.jsx)("input",{id:d,type:"range",min:"1",max:"5",step:"1",value:e.minNgramOverlap||j.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap,onChange:y=>t(g=>({...g,minNgramOverlap:parseInt(y.target.value,10)})),className:"w-full"}),(0,b.jsxs)("span",{className:"text-green-600 text-xs dark:text-green-300",children:[n.currentValueLabel," ",e.minNgramOverlap||j.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap]}),(0,b.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexMinNgramOverlapHint})]})]},"index-build")),w.push((0,b.jsxs)("div",{className:`${r} border-blue-200 border-l-4 dark:border-blue-500/60`,children:[(0,b.jsxs)("div",{className:`${s} text-blue-700 dark:text-blue-300`,children:["\u{1F50D} ",n.indexCandidateHeading]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{htmlFor:l,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexThreshold}),(0,b.jsx)("input",{id:l,type:"range",min:"0.0",max:"1.0",step:"0.05",value:e.indexWorkerOptions?.threshold??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,threshold:parseFloat(y.target.value)}})),className:"w-full"}),(0,b.jsxs)("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.threshold??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold]}),(0,b.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexThresholdHint})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{htmlFor:m,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexNgramOverlapThreshold}),(0,b.jsx)("input",{id:m,type:"range",min:"0.1",max:"0.9",step:"0.1",value:e.indexWorkerOptions?.ngramOverlapThreshold??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,ngramOverlapThreshold:parseFloat(y.target.value)}})),className:"w-full"}),(0,b.jsxs)("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.ngramOverlapThreshold??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold]}),(0,b.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexNgramOverlapThresholdHint})]})]},"candidate-control")),w.push((0,b.jsxs)("div",{className:`${r} border-cyan-200 border-l-4 dark:border-cyan-400/60`,children:[(0,b.jsxs)("div",{className:`${s} text-cyan-700 dark:text-cyan-300`,children:["\u{1F9ED} ",n.indexStrategyHeading]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{htmlFor:c,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexStrategy}),(0,b.jsxs)("select",{id:c,value:e.indexWorkerOptions?.strategy??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.strategy??"hybrid",onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,strategy:y.target.value}})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[(0,b.jsx)("option",{value:"fast",children:n.indexStrategyFast}),(0,b.jsx)("option",{value:"accurate",children:n.indexStrategyAccurate}),(0,b.jsx)("option",{value:"hybrid",children:n.indexStrategyHybrid})]}),(0,b.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexStrategyHint})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{htmlFor:u,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexMinCandidatesRatio}),(0,b.jsx)("input",{id:u,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.minCandidatesRatio??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,minCandidatesRatio:parseFloat(y.target.value)}})),className:"w-full"}),(0,b.jsxs)("span",{className:"text-cyan-600 text-xs dark:text-cyan-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.minCandidatesRatio??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio]}),(0,b.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexMinCandidatesRatioHint})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{htmlFor:i,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexMaxCandidatesRatio}),(0,b.jsx)("input",{id:i,type:"range",min:"0.3",max:"0.8",step:"0.1",value:e.indexWorkerOptions?.maxCandidatesRatio??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxCandidatesRatio:parseFloat(y.target.value)}})),className:"w-full"}),(0,b.jsxs)("span",{className:"text-cyan-600 text-xs dark:text-cyan-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxCandidatesRatio??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio]}),(0,b.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexMaxCandidatesRatioHint})]})]},"strategy")),w.push((0,b.jsxs)("div",{className:`${r} border-indigo-200 border-l-4 dark:border-indigo-500/60`,children:[(0,b.jsxs)("div",{className:`${s} text-indigo-700 dark:text-indigo-300`,children:["\u{1F521} ",n.scoreTuningHeading]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{htmlFor:p,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexJaroWinklerPrefix}),(0,b.jsx)("input",{id:p,type:"range",min:"0.05",max:"0.25",step:"0.05",value:e.indexWorkerOptions?.jaroWinklerPrefix??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,jaroWinklerPrefix:parseFloat(y.target.value)}})),className:"w-full"}),(0,b.jsxs)("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.jaroWinklerPrefix??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix]}),(0,b.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexJaroWinklerPrefixHint})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{htmlFor:f,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.maxResults}),(0,b.jsxs)("label",{className:"flex items-center gap-2 text-[11px] text-gray-600 dark:text-slate-300",children:[(0,b.jsx)("input",{type:"checkbox",checked:e.indexWorkerOptions?.maxResults===void 0,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxResults:y.target.checked?void 0:ja}}))}),n.noLimit]}),(0,b.jsx)("input",{id:f,type:"range",min:ja,max:"10000",step:"1000",disabled:e.indexWorkerOptions?.maxResults===void 0,value:e.indexWorkerOptions?.maxResults===void 0?ja:e.indexWorkerOptions.maxResults,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxResults:parseInt(y.target.value,10)}})),className:"w-full disabled:cursor-not-allowed"}),(0,b.jsxs)("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxResults===void 0?n.noLimit:e.indexWorkerOptions.maxResults]}),(0,b.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexMaxResultsHint})]})]},"jaro")),w.push((0,b.jsxs)("div",{className:`${r} border-emerald-200 border-l-4 ${a?"":"opacity-50"} dark:border-emerald-400/60`,children:[(0,b.jsxs)("div",{className:`${s} text-emerald-700 dark:text-emerald-300`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{htmlFor:T,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.fieldWeight}),(0,b.jsx)("input",{id:T,type:"range",min:"0",max:"1",step:"0.05",value:e.indexWorkerOptions?.relevanceFieldWeight??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight??.2,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,relevanceFieldWeight:parseFloat(y.target.value)}})),disabled:!a,className:"w-full disabled:cursor-not-allowed"}),(0,b.jsxs)("span",{className:"text-emerald-600 text-xs dark:text-emerald-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevanceFieldWeight??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight??.2]}),(0,b.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexFieldWeightHint})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{htmlFor:S,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexPerfectMatchBonus}),(0,b.jsx)("input",{id:S,type:"range",min:"0",max:"0.3",step:"0.1",value:e.indexWorkerOptions?.relevancePerfectMatchBonus??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus??.1,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,relevancePerfectMatchBonus:parseFloat(y.target.value)}})),disabled:!a,className:"w-full disabled:cursor-not-allowed"}),(0,b.jsxs)("span",{className:"text-emerald-600 text-xs dark:text-emerald-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevancePerfectMatchBonus??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus??.1]}),(0,b.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexPerfectMatchBonusHint})]}),!a&&(0,b.jsx)("p",{className:"text-[11px] text-emerald-600 dark:text-emerald-300",children:n.relevanceOnlyNotice})]},"relevance"));let V=(0,be.useId)(),H=(0,be.useId)();return w.push((0,b.jsxs)("div",{className:`${r} border-teal-200 border-l-4 dark:border-teal-400/60`,children:[(0,b.jsxs)("div",{className:`${s} text-teal-700 dark:text-teal-300`,children:["\u{1F524} ",n.indexContainmentHeading]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{htmlFor:V,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexContainmentBase}),(0,b.jsx)("input",{id:V,type:"range",min:"0.0",max:"0.7",step:"0.05",value:e.indexWorkerOptions?.containmentScoreBase??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase??.7,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,containmentScoreBase:parseFloat(y.target.value)}})),className:"w-full"}),(0,b.jsxs)("span",{className:"text-teal-600 text-xs dark:text-teal-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentScoreBase??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase??.7]}),(0,b.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexContainmentBaseHint})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{htmlFor:H,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexContainmentCoverage}),(0,b.jsx)("input",{id:H,type:"range",min:"0.0",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.containmentCoverageWeight??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight??.3,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,containmentCoverageWeight:parseFloat(y.target.value)}})),className:"w-full"}),(0,b.jsxs)("span",{className:"text-teal-600 text-xs dark:text-teal-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentCoverageWeight??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight??.3]}),(0,b.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexContainmentCoverageHint})]})]},"containment")),(0,b.jsxs)("section",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-green-700 text-xs transition-colors dark:text-green-300",children:[(0,b.jsx)("span",{children:"\u{1F4CA}"}),(0,b.jsx)("span",{className:"tracking-wide",children:n.indexSettingsHeading})]}),(0,b.jsx)("button",{type:"button",onClick:()=>t(y=>({...y,indexWorkerOptions:{threshold:j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold||.4,ngramOverlapThreshold:j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold||.3,minCandidatesRatio:j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio||.1,maxCandidatesRatio:j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio||.5,jaroWinklerPrefix:j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix||.1,maxResults:void 0,relevanceFieldWeight:j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight||.2,relevancePerfectMatchBonus:j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus||.1,containmentScoreBase:j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase||.7,containmentCoverageWeight:j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight||.3,strategy:j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.strategy},ngramSize:j.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize,minNgramOverlap:j.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap})),className:"rounded border border-green-300 bg-green-100 px-2 py-1 font-medium text-green-700 text-xs transition-colors hover:bg-green-200 dark:border-green-400/60 dark:bg-green-900/20 dark:text-green-200 dark:hover:bg-green-800/30",title:n.resetToDefaultsTitle,children:n.reset})]}),(0,b.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:w})]})});Zn.displayName="IndexWorkerSettings";var xe=require("@aiquants/fuzzy-search"),nt=require("react");ce();var D=require("react/jsx-runtime"),qa=1e3,ea=(0,nt.memo)(({searchOptions:e,setSearchOptions:t})=>{let n=J(),r="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",s="text-xs font-semibold",a=e.sortBy==="relevance",o=(0,nt.useId)(),d=(0,nt.useId)(),l=(0,nt.useId)(),c=(0,nt.useId)(),m=(0,nt.useId)(),u=(0,nt.useId)(),i=[];return i.push((0,D.jsxs)("div",{className:`${r} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[(0,D.jsxs)("div",{className:`${s} text-purple-700 dark:text-purple-300`,children:["\u{1F9EE} ",n.levenshteinCandidateHeading]}),(0,D.jsxs)("div",{className:"space-y-2",children:[(0,D.jsx)("label",{htmlFor:o,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.levenshteinThreshold}),(0,D.jsx)("input",{id:o,type:"range",min:"0.0",max:a?"1.5":"1.0",step:"0.05",value:e.levenshteinWorkerOptions?.threshold??xe.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold,onChange:p=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,threshold:parseFloat(p.target.value)}})),className:"w-full"}),(0,D.jsxs)("span",{className:"text-purple-600 text-xs dark:text-purple-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.threshold??xe.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold]}),(0,D.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:a?n.levenshteinThresholdHintRelevance:n.levenshteinThresholdHint})]}),(0,D.jsxs)("div",{className:"space-y-2",children:[(0,D.jsx)("label",{htmlFor:d,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.levenshteinLengthSimilarity}),(0,D.jsx)("input",{id:d,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.lengthSimilarityThreshold??xe.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold,onChange:p=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,lengthSimilarityThreshold:parseFloat(p.target.value)}})),className:"w-full"}),(0,D.jsxs)("span",{className:"text-purple-600 text-xs dark:text-purple-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthSimilarityThreshold??xe.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold]}),(0,D.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinLengthSimilarityHint})]})]},"threshold")),i.push((0,D.jsxs)("div",{className:`${r} border-pink-200 border-l-4 dark:border-pink-400/60`,children:[(0,D.jsxs)("div",{className:`${s} text-pink-700 dark:text-pink-300`,children:["\u{1FA84} ",n.scoreTuningHeading]}),(0,D.jsxs)("div",{className:"space-y-2",children:[(0,D.jsx)("label",{htmlFor:l,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.levenshteinLengthPenalty}),(0,D.jsx)("input",{id:l,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.levenshteinWorkerOptions?.lengthDiffPenalty??xe.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty,onChange:p=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,lengthDiffPenalty:parseFloat(p.target.value)}})),className:"w-full"}),(0,D.jsxs)("span",{className:"text-pink-600 text-xs dark:text-pink-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthDiffPenalty??xe.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty]}),(0,D.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinLengthPenaltyHint})]})]},"penalty")),i.push((0,D.jsxs)("div",{className:`${r} border-violet-200 border-l-4 dark:border-violet-400/60`,children:[(0,D.jsxs)("div",{className:`${s} text-violet-700 dark:text-violet-300`,children:["\u{1F4E6} ",n.levenshteinResultsHeading]}),(0,D.jsx)("label",{htmlFor:c,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.maxResults}),(0,D.jsxs)("label",{className:"flex items-center gap-2 text-[11px] text-gray-600 dark:text-slate-300",children:[(0,D.jsx)("input",{type:"checkbox",checked:e.levenshteinWorkerOptions?.maxResults===void 0,onChange:p=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,maxResults:p.target.checked?void 0:qa}}))}),n.noLimit]}),(0,D.jsx)("input",{id:c,type:"range",min:qa,max:"10000",step:"1000",disabled:e.levenshteinWorkerOptions?.maxResults===void 0,value:e.levenshteinWorkerOptions?.maxResults===void 0?qa:e.levenshteinWorkerOptions.maxResults,onChange:p=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,maxResults:parseInt(p.target.value,10)}})),className:"w-full disabled:cursor-not-allowed"}),(0,D.jsxs)("span",{className:"text-violet-600 text-xs dark:text-violet-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.maxResults===void 0?n.noLimit:e.levenshteinWorkerOptions.maxResults]}),(0,D.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinMaxResultsHint})]},"max-results")),i.push((0,D.jsxs)("div",{className:`${r} border-rose-200 border-l-4 ${a?"":"opacity-50"} dark:border-rose-400/60`,children:[(0,D.jsxs)("div",{className:`${s} text-rose-700 dark:text-rose-300`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),(0,D.jsxs)("div",{className:"space-y-2",children:[(0,D.jsx)("label",{htmlFor:m,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.fieldWeight}),(0,D.jsx)("input",{id:m,type:"range",min:"0",max:"1",step:"0.05",value:e.levenshteinWorkerOptions?.relevanceFieldWeight??xe.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight??.15,onChange:p=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,relevanceFieldWeight:parseFloat(p.target.value)}})),disabled:!a,className:"w-full disabled:cursor-not-allowed"}),(0,D.jsxs)("span",{className:"text-rose-600 text-xs dark:text-rose-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.relevanceFieldWeight??xe.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight??.15]}),(0,D.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinFieldWeightHint})]}),(0,D.jsxs)("div",{className:"space-y-2",children:[(0,D.jsx)("label",{htmlFor:u,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.levenshteinPartialBonus}),(0,D.jsx)("input",{id:u,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.partialMatchBonus??xe.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus,onChange:p=>t(f=>({...f,levenshteinWorkerOptions:{...f.levenshteinWorkerOptions,partialMatchBonus:parseFloat(p.target.value)}})),disabled:!a,className:"w-full disabled:cursor-not-allowed"}),(0,D.jsxs)("span",{className:"text-rose-600 text-xs dark:text-rose-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.partialMatchBonus??xe.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus]}),(0,D.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinPartialBonusHint})]}),!a&&(0,D.jsx)("p",{className:"text-[11px] text-rose-600 dark:text-rose-300",children:n.relevanceOnlyNotice})]},"relevance")),(0,D.jsxs)("section",{className:"space-y-3",children:[(0,D.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,D.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-purple-700 text-xs transition-colors dark:text-purple-300",children:[(0,D.jsx)("span",{children:"\u{1F4CF}"}),(0,D.jsx)("span",{className:"tracking-wide",children:n.levenshteinSettingsHeading})]}),(0,D.jsx)("button",{type:"button",onClick:()=>t(p=>({...p,levenshteinWorkerOptions:{threshold:xe.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold||.3,lengthSimilarityThreshold:xe.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold||.1,partialMatchBonus:xe.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus||.1,lengthDiffPenalty:xe.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty||1,maxResults:void 0,relevanceFieldWeight:xe.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight||.15}})),className:"rounded border border-purple-300 bg-purple-100 px-2 py-1 font-medium text-purple-700 text-xs transition-colors hover:bg-purple-200 dark:border-purple-400/60 dark:bg-purple-900/20 dark:text-purple-200 dark:hover:bg-purple-800/30",title:n.resetToDefaultsTitle,children:n.reset})]}),(0,D.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:i})]})});ea.displayName="LevenshteinWorkerSettings";var ie=require("react/jsx-runtime"),ii={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},ta=(0,Lo.memo)(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:r,openEmailsWithGmail:s,setOpenEmailsWithGmail:a,activeTab:o,onTabChange:d})=>{let l=J(),{setScrollableRef:c,onPointerDown:m,onPointerMove:u,onPointerUp:i,onPointerLeave:p,onPointerCancel:f,onClickCapture:T}=Ze();return(0,ie.jsxs)("div",{className:"wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border border-blue-300 bg-white p-1.5 shadow-md transition-colors dark:border-blue-500/40 dark:bg-slate-900/80 dark:shadow-blue-900/30",children:[(0,ie.jsxs)("div",{className:"mb-0.5 flex shrink-0 flex-col gap-1 rounded bg-blue-50 px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between dark:bg-blue-900/30",children:[(0,ie.jsxs)("h3",{className:"font-semibold text-gray-700 text-xs transition-colors dark:text-slate-100",children:["\u2699\uFE0F ",l.searchSettings]}),(0,ie.jsx)("div",{className:"flex flex-wrap gap-1.5",children:(0,ie.jsxs)("button",{type:"button",onClick:()=>t(S=>Kn(S.workerUrls)),className:"rounded bg-red-500 px-1.5 py-0.5 text-[10px] text-white transition-colors hover:bg-red-600 dark:hover:bg-red-700",title:l.settingsResetAllTitle,children:["\u{1F504} ",l.settingsResetAll]})})]}),(0,ie.jsx)("div",{className:"mb-0 shrink-0",children:(0,ie.jsxs)("div",{ref:c,role:"tablist","aria-label":l.settingsTabsLabel,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-md bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:ii,onPointerDown:m,onPointerMove:u,onPointerUp:i,onPointerLeave:p,onPointerCancel:f,onClickCapture:T,children:[(0,ie.jsxs)("button",{type:"button",role:"tab","aria-selected":o==="basic",onClick:()=>d("basic"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${o==="basic"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F527} ",l.settingsBasicTab]}),(0,ie.jsxs)("button",{type:"button",role:"tab","aria-selected":o==="advanced",onClick:()=>d("advanced"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${o==="advanced"?"bg-orange-500 text-white dark:bg-orange-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u26A1 ",l.settingsAdvancedTab]}),(0,ie.jsxs)("button",{type:"button",role:"tab","aria-selected":o==="index",onClick:()=>d("index"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${o==="index"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CA} ",l.indexWorkerName]}),(0,ie.jsxs)("button",{type:"button",role:"tab","aria-selected":o==="levenshtein",onClick:()=>d("levenshtein"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${o==="levenshtein"?"bg-purple-500 text-white dark:bg-purple-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CF} ",l.levenshteinWorkerName]})]})}),(0,ie.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,ie.jsx)("div",{className:`${o==="basic"?"block":"hidden"}`,children:(0,ie.jsx)(Wn,{searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:r,openEmailsWithGmail:s,setOpenEmailsWithGmail:a})}),(0,ie.jsx)("div",{className:`${o==="advanced"?"block":"hidden"}`,children:(0,ie.jsx)(Dn,{searchOptions:e,setSearchOptions:t})}),(0,ie.jsx)("div",{className:`${o==="index"?"block":"hidden"}`,children:(0,ie.jsx)(Zn,{searchOptions:e,setSearchOptions:t})}),(0,ie.jsx)("div",{className:`${o==="levenshtein"?"block":"hidden"}`,children:(0,ie.jsx)(ea,{searchOptions:e,setSearchOptions:t})})]})]})});ta.displayName="SearchOptionsPanel";var aa=require("react");xt();ce();var Eo=require("react"),na=require("react/jsx-runtime"),O=(0,Eo.memo)(({label:e,value:t,unit:n,color:r="text-gray-600 dark:text-slate-300"})=>(0,na.jsxs)("div",{className:"wrap-break-word flex min-w-0 flex-col overflow-hidden text-gray-700 transition-colors sm:flex-row sm:justify-between dark:text-slate-200",children:[(0,na.jsxs)("span",{className:"wrap-break-word overflow-hidden text-left",children:[e,":"]}),(0,na.jsxs)("span",{className:`font-medium ${r} min-w-0 overflow-hidden break-all transition-colors sm:ml-2`,children:[t,n]})]}));O.displayName="StatItem";var Oo=require("react");xt();ce();var x=require("react/jsx-runtime"),Nt=(0,Oo.memo)(({kind:e,icon:t,stats:n,color:r})=>{let{locale:s,labels:a}=Se(),o=E=>X(s,E);if(!n)return(0,x.jsx)("section",{className:"rounded-lg border border-gray-200 border-dashed bg-white/40 p-3 text-gray-400 text-xs transition-colors dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-400",children:a.statsNoData});let d=n.basic||{},l=n.workerSpecific||{},c=n.analysis||{},m=d.totalSearches??0,u=d.totalProcessingTime??0,i=d.averageSearchTime??0,p=d.lastSearchTime??0,f=d.errorCount??0,T=d.timestamp,S=c.fieldPerformance||{},w=c.performanceInsights||{},V=c.recentHistory||[],H=l.specificMetrics||{},y=l.operationCount??0,g=l.operationDistribution||{},$=e==="index",q=e==="levenshtein",k=$?a.indexWorkerName:a.levenshteinWorkerName,h=H,v=H,F="flex flex-col gap-1 rounded-lg border border-gray-200 bg-white/80 p-3 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",P="text-xs font-semibold transition-colors",ae=E=>{if(!E)return;let I=new Date(E);return Number.isNaN(I.getTime())?void 0:a.statsTimestamp(I)},L=[];if(L.push((0,x.jsxs)("div",{className:`${F} border-blue-200 border-l-4 dark:border-blue-500/60`,children:[(0,x.jsxs)("div",{className:`${P} ${r}`,children:["\u{1F4CA} ",a.statsBasicHeading]}),(0,x.jsx)(O,{label:a.statTotalSearches,value:o(m),color:r}),(0,x.jsx)(O,{label:a.statAverageSearchTime,value:i.toFixed(2),unit:"ms",color:r}),(0,x.jsx)(O,{label:a.statTotalProcessingTime,value:u.toFixed(2),unit:"ms",color:r}),(0,x.jsx)(O,{label:a.statLastSearchTime,value:p.toFixed(2),unit:"ms",color:r}),(0,x.jsx)(O,{label:a.statErrorCount,value:f,color:f>0?"text-red-600 dark:text-red-400":r}),ae(T)&&(0,x.jsx)(O,{label:a.statUpdatedAt,value:ae(T),color:"text-gray-500 dark:text-slate-400"})]},"basic")),y>0||Object.keys(g).length>0){let E=Object.entries(g).sort(([,I],[,G])=>(Number(G)||0)-(Number(I)||0)).slice(0,6);L.push((0,x.jsxs)("div",{className:`${F} border-amber-200 border-l-4 dark:border-amber-400/60`,children:[(0,x.jsxs)("div",{className:`${P} text-amber-600 dark:text-amber-300`,children:["\u{1F527} ",a.statsOperationsHeading]}),(0,x.jsx)(O,{label:a.statTotalOperations,value:o(y),color:"text-amber-700 dark:text-amber-300"}),E.length>0&&(0,x.jsx)("div",{className:"mt-1 space-y-1",children:E.map(([I,G])=>(0,x.jsx)(O,{label:I,value:o(Number(G)),unit:a.timesUnit(o(Number(G))),color:"text-amber-700 dark:text-amber-300"},I))})]},"operations"))}if($&&(L.push((0,x.jsxs)("div",{className:`${F} border-green-200 border-l-4 dark:border-green-400/60`,children:[(0,x.jsxs)("div",{className:`${P} text-green-700 dark:text-green-300`,children:["\u{1F3D7}\uFE0F ",a.statsIndexHeading]}),(0,x.jsx)(O,{label:a.statIndexBuilds,value:o(h.totalIndexBuilds??0),color:"text-green-700 dark:text-green-300"}),(0,x.jsx)(O,{label:a.statDataSize,value:o(h.currentDataSize??0),unit:a.itemsUnit(o(h.currentDataSize??0)),color:"text-green-700 dark:text-green-300"}),(0,x.jsx)(O,{label:a.statLastBuildTime,value:(h.lastIndexTime??0).toFixed(2),unit:"ms",color:"text-green-700 dark:text-green-300"})]},"index-core")),h.cacheSize&&L.push((0,x.jsxs)("div",{className:`${F} border-emerald-200 border-l-4 dark:border-emerald-400/60`,children:[(0,x.jsxs)("div",{className:`${P} text-emerald-700 dark:text-emerald-300`,children:["\u{1F4BE} ",a.statsCacheHeading]}),(0,x.jsx)(O,{label:a.statCacheNgram,value:o(h.cacheSize.ngram??0),color:"text-emerald-700 dark:text-emerald-300"}),(0,x.jsx)(O,{label:a.statCacheWord,value:o(h.cacheSize.word??0),color:"text-emerald-700 dark:text-emerald-300"}),(0,x.jsx)(O,{label:a.statCachePhonetic,value:o(h.cacheSize.phonetic??0),color:"text-emerald-700 dark:text-emerald-300"})]},"index-cache")),h.indexMetadata)){let E=Object.entries(h.indexMetadata).slice(0,6);E.length>0&&L.push((0,x.jsxs)("div",{className:`${F} border-teal-200 border-l-4 dark:border-teal-400/60`,children:[(0,x.jsxs)("div",{className:`${P} text-teal-700 dark:text-teal-300`,children:["\u{1F4CB} ",a.statsIndexMetadataHeading]}),E.map(([I,G])=>{let oe;if(typeof G=="number"){let ye=I.toLowerCase();ye.includes("time")&&!ye.includes("timestamp")?oe=`${G.toFixed(2)}ms`:ye.includes("timestamp")||ye.includes("at")?oe=ae(G)??G.toString():oe=o(G)}else oe=String(G);return(0,x.jsx)(O,{label:I,value:oe,color:"text-teal-700 dark:text-teal-300"},I)})]},"index-meta"))}if(q){if(L.push((0,x.jsxs)("div",{className:`${F} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[(0,x.jsxs)("div",{className:`${P} text-purple-700 dark:text-purple-300`,children:["\u{1F522} ",a.statsCalculationsHeading]}),(0,x.jsx)(O,{label:a.statTotalCalculations,value:o(v.totalCalculations??0),color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(O,{label:a.statDistanceCalculations,value:o(v.totalDistanceCalculations??0),color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(O,{label:a.statAverageDistance,value:typeof v.averageDistance=="number"?v.averageDistance.toFixed(2):"0.00",color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(O,{label:a.statMinDistance,value:v.minDistance??a.notAvailable,color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(O,{label:a.statMaxDistance,value:v.maxDistance??0,color:"text-purple-700 dark:text-purple-300"})]},"lev-basic")),L.push((0,x.jsxs)("div",{className:`${F} border-fuchsia-200 border-l-4 dark:border-fuchsia-400/60`,children:[(0,x.jsxs)("div",{className:`${P} text-fuchsia-700 dark:text-fuchsia-300`,children:["\u{1F3AF} ",a.statsMatchesHeading]}),(0,x.jsx)(O,{label:a.statPartialMatches,value:o(v.partialMatches??0),color:"text-fuchsia-700 dark:text-fuchsia-300"}),(0,x.jsx)(O,{label:a.statPerfectMatches,value:o(v.perfectMatches??0),color:"text-fuchsia-700 dark:text-fuchsia-300"}),(0,x.jsx)(O,{label:a.statEarlyTerminations,value:o(v.earlyTerminations??0),color:"text-fuchsia-700 dark:text-fuchsia-300"})]},"lev-match")),v.similarityThresholds&&L.push((0,x.jsxs)("div",{className:`${F} border-rose-200 border-l-4 dark:border-rose-400/60`,children:[(0,x.jsxs)("div",{className:`${P} text-rose-700 dark:text-rose-300`,children:["\u{1F4C8} ",a.statsSimilarityHeading]}),(0,x.jsx)(O,{label:a.statAbove80,value:o(v.similarityThresholds.above80??0),color:"text-emerald-700 dark:text-emerald-300"}),(0,x.jsx)(O,{label:a.statAbove60,value:o(v.similarityThresholds.above60??0),color:"text-lime-700 dark:text-lime-300"}),(0,x.jsx)(O,{label:a.statAbove40,value:o(v.similarityThresholds.above40??0),color:"text-orange-600 dark:text-orange-300"}),(0,x.jsx)(O,{label:a.statBelow40,value:o(v.similarityThresholds.below40??0),color:"text-red-600 dark:text-red-400"})]},"lev-similarity")),v.distanceDistribution){let E=Object.entries(v.distanceDistribution).sort(([,I],[,G])=>Number(G)-Number(I)).slice(0,6);E.length>0&&L.push((0,x.jsxs)("div",{className:`${F} border-indigo-200 border-l-4 dark:border-indigo-500/60`,children:[(0,x.jsxs)("div",{className:`${P} text-indigo-700 dark:text-indigo-300`,children:["\u{1F4CA} ",a.statsDistanceHeading]}),E.map(([I,G])=>(0,x.jsx)(O,{label:a.statDistance(I),value:o(Number(G)),unit:a.timesUnit(o(Number(G))),color:"text-indigo-700 dark:text-indigo-300"},I))]},"lev-distance"))}if(v.queryLengthStats){let E=Object.entries(v.queryLengthStats).sort(([,I],[,G])=>(G.count??0)-(I.count??0)).slice(0,6);E.length>0&&L.push((0,x.jsxs)("div",{className:`${F} border-violet-200 border-l-4 dark:border-violet-400/60`,children:[(0,x.jsxs)("div",{className:`${P} text-violet-700 dark:text-violet-300`,children:["\u{1F4CF} ",a.statsQueryLengthHeading]}),E.map(([I,G])=>{let oe=Number(G.count??0),ye=Number(G.averageScore??0);return(0,x.jsx)(O,{label:a.statQueryLength(I),value:a.statQueryLengthValue({count:oe,averagePercent:(ye*100).toFixed(1)}),color:"text-violet-700 dark:text-violet-300"},I)})]},"lev-query-length"))}}if(Object.keys(S).length>0){let E=Object.entries(S).sort(([,I],[,G])=>(G.averageScore??0)-(I.averageScore??0)).slice(0,6);L.push((0,x.jsxs)("div",{className:`${F} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[(0,x.jsxs)("div",{className:`${P} text-purple-700 dark:text-purple-300`,children:["\u{1F4CB} ",a.statsFieldPerformanceHeading]}),E.map(([I,G])=>{let oe=G;return(0,x.jsxs)("div",{className:"space-y-1 rounded bg-purple-50/60 p-2 transition-colors dark:bg-slate-900/50",children:[(0,x.jsx)("div",{className:"font-semibold text-purple-700 text-xs transition-colors dark:text-purple-300",children:I}),(0,x.jsx)(O,{label:a.statAverageScore,value:`${((oe.averageScore??0)*100).toFixed(1)}%`,color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(O,{label:a.statMatchCount,value:o(oe.matchCount??0),unit:a.itemsUnit(o(oe.matchCount??0)),color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(O,{label:a.statBestWorstScore,value:`${((oe.bestScore??0)*100).toFixed(1)}% / ${((oe.worstScore??0)*100).toFixed(1)}%`,color:"text-purple-700 dark:text-purple-300"})]},I)})]},"field-performance"))}if(w.bestPerformingField||w.totalHistoryEntries||w.similarityDistribution){let E=(w.recentAverageResultCount??0).toFixed(1);L.push((0,x.jsxs)("div",{className:`${F} border-blue-200 border-l-4 dark:border-blue-400/60`,children:[(0,x.jsxs)("div",{className:`${P} text-blue-700 dark:text-blue-300`,children:["\u{1F50D} ",a.statsInsightsHeading]}),w.bestPerformingField&&(0,x.jsx)(O,{label:a.statBestField,value:w.bestPerformingField,color:"text-blue-700 dark:text-blue-300"}),(0,x.jsx)(O,{label:a.statRecentAverageTime,value:(w.recentAverageProcessingTime??0).toFixed(2),unit:"ms",color:"text-blue-700 dark:text-blue-300"}),(0,x.jsx)(O,{label:a.statRecentAverageResults,value:E,unit:a.itemsUnit(E),color:"text-blue-700 dark:text-blue-300"}),(0,x.jsx)(O,{label:a.statThroughput,value:(w.throughputPerSecond??0).toFixed(2),unit:a.throughputUnit,color:"text-blue-700 dark:text-blue-300"}),(0,x.jsx)(O,{label:a.statCommonQueryLength,value:o(w.mostCommonQueryLength??0),unit:a.charactersUnit(o(w.mostCommonQueryLength??0)),color:"text-blue-700 dark:text-blue-300"}),(0,x.jsx)(O,{label:a.statHistoryEntries,value:o(w.totalHistoryEntries??0),color:"text-blue-700 dark:text-blue-300"}),w.similarityDistribution&&(0,x.jsxs)("div",{className:"mt-1 grid grid-cols-2 gap-1",children:[(0,x.jsx)(O,{label:a.statHighSimilarity,value:o(w.similarityDistribution.highSimilarity??0),color:"text-emerald-700 dark:text-emerald-300"}),(0,x.jsx)(O,{label:a.statMediumSimilarity,value:o(w.similarityDistribution.mediumSimilarity??0),color:"text-lime-700 dark:text-lime-300"}),(0,x.jsx)(O,{label:a.statLowSimilarity,value:o(w.similarityDistribution.lowSimilarity??0),color:"text-orange-600 dark:text-orange-300"}),(0,x.jsx)(O,{label:a.statVeryLowSimilarity,value:o(w.similarityDistribution.veryLowSimilarity??0),color:"text-red-600 dark:text-red-400"})]})]},"performance-insights"))}return V.length>0&&L.push((0,x.jsxs)("div",{className:`${F} border-sky-200 border-l-4 dark:border-sky-400/60`,children:[(0,x.jsxs)("div",{className:`${P} text-sky-700 dark:text-sky-300`,children:["\u{1F4C8} ",a.statsRecentHistoryHeading]}),V.slice(-3).reverse().map((E,I)=>(0,x.jsxs)("div",{className:"rounded bg-sky-50/70 p-2 transition-colors dark:bg-slate-900/50",children:[(0,x.jsx)("div",{className:"font-medium text-sky-700 transition-colors dark:text-sky-300",children:E.operationType}),(0,x.jsx)("div",{className:"text-sky-600 text-xs transition-colors dark:text-sky-200",children:a.statsHistoryEntry({processingTimeMs:E.processingTime.toFixed(2),resultCount:E.resultCount??0})}),ae(E.timestamp)&&(0,x.jsx)("div",{className:"text-[10px] text-sky-500 transition-colors dark:text-sky-200",children:ae(E.timestamp)})]},`${E.operationType}-${E.timestamp??I}`))]},"recent-history")),(0,x.jsxs)("section",{className:"space-y-2",children:[(0,x.jsxs)("div",{className:`flex items-center gap-2 font-semibold text-xs ${r}`,children:[(0,x.jsx)("span",{children:t}),(0,x.jsx)("span",{className:"tracking-wide",children:k})]}),(0,x.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:L})]})});Nt.displayName="WorkerStatsSection";var ne=require("react/jsx-runtime"),li={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},ra=(0,aa.memo)(({performanceMetrics:e,searchTerm:t,totalDataCount:n,resultsCount:r,resetStats:s,rebuildIndex:a,isIndexBuilding:o,activeTab:d,onTabChange:l})=>{let{locale:c,labels:m}=Se(),u=t.trim(),i=u?r:n,{setScrollableRef:p,onPointerDown:f,onPointerMove:T,onPointerUp:S,onPointerLeave:w,onPointerCancel:V,onClickCapture:H}=Ze(),y=d!=="index"||o,g=o?m.statsRebuildingTitle:d!=="index"?m.statsRebuildIndexTabOnlyTitle:m.statsRebuildTitle,$=y?"cursor-not-allowed bg-gray-300 text-gray-500 dark:bg-slate-700 dark:text-slate-400":"bg-blue-500 text-white hover:bg-blue-600 dark:bg-blue-500 dark:hover:bg-blue-600",q=o?`\u23F3 ${m.statsRebuilding}`:`\u{1F3D7}\uFE0F ${m.statsRebuild}`,k=(0,aa.useCallback)(()=>{a().catch(()=>{})},[a]);return(0,ne.jsxs)("div",{className:"wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border border-blue-300 bg-white p-1.5 shadow-md transition-colors dark:border-blue-500/40 dark:bg-slate-900/80 dark:shadow-blue-900/30",children:[(0,ne.jsxs)("div",{className:"mb-0.5 flex shrink-0 flex-col gap-1 rounded bg-blue-50 px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between dark:bg-blue-900/30",children:[(0,ne.jsxs)("h3",{className:"font-semibold text-gray-700 text-xs transition-colors dark:text-slate-100",children:["\u{1F4CA} ",m.searchStatistics]}),(0,ne.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,ne.jsx)("button",{type:"button",onClick:k,disabled:y,className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${$}`,title:g,children:q}),(0,ne.jsxs)("button",{type:"button",onClick:s,className:"rounded bg-red-500 px-1.5 py-0.5 text-[10px] text-white transition-colors hover:bg-red-600 dark:hover:bg-red-700",title:m.statsResetTitle,children:["\u{1F504} ",m.reset]})]})]}),(0,ne.jsx)("div",{className:"mb-0 shrink-0",children:(0,ne.jsxs)("div",{ref:p,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-md bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:li,onPointerDown:f,onPointerMove:T,onPointerUp:S,onPointerLeave:w,onPointerCancel:V,onClickCapture:H,children:[(0,ne.jsxs)("button",{type:"button",onClick:()=>l("overview"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${d==="overview"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CB} ",m.statsOverviewTab]}),(0,ne.jsxs)("button",{type:"button",onClick:()=>l("index"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${d==="index"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CA} ",m.statsIndexTab]}),(0,ne.jsxs)("button",{type:"button",onClick:()=>l("levenshtein"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${d==="levenshtein"?"bg-purple-500 text-white dark:bg-purple-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CF} ",m.statsLevenshteinTab]})]})}),(0,ne.jsxs)("div",{className:"flex flex-col gap-1 pb-0.5",children:[(0,ne.jsxs)("div",{className:`${d==="overview"?"grid":"hidden"} grid-cols-1 gap-2 pr-1 text-gray-600 text-xs transition-colors sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 dark:text-slate-300`,children:[(0,ne.jsx)(O,{label:m.statTotalSearches,value:X(c,e.totalSearches)}),(0,ne.jsx)(O,{label:m.statAverageSearchTime,value:e.averageSearchTime.toFixed(1),unit:"ms"}),(0,ne.jsx)(O,{label:m.statDataCount,value:X(c,e.itemCount)}),(0,ne.jsx)(O,{label:u?m.statResultCount:m.statDisplayedCount,value:X(c,i)})]}),(0,ne.jsx)("div",{className:`${d==="index"?"space-y-3":"hidden"} pr-1 text-gray-600 text-xs transition-colors dark:text-slate-300`,children:(0,ne.jsx)(Nt,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:"text-green-600 dark:text-green-300"})}),(0,ne.jsx)("div",{className:`${d==="levenshtein"?"space-y-3":"hidden"} pr-1 text-gray-600 text-xs transition-colors dark:text-slate-300`,children:(0,ne.jsx)(Nt,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:"text-purple-600 dark:text-purple-300"})}),(0,ne.jsxs)("div",{className:"hidden",children:[(0,ne.jsx)(Nt,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:"text-green-600 dark:text-green-300"}),(0,ne.jsx)(Nt,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:"text-purple-600 dark:text-purple-300"})]})]})]})});ra.displayName="StatisticsPanel";var A=require("react/jsx-runtime"),di=/[\u200B\uFEFF]/g,Ga=typeof window<"u",Fo=Ga&&typeof document<"u",oa=(e,t=[],n=!1)=>{let r=(0,z.useRef)(e);r.current=e,(0,z.useEffect)(()=>{if(!(!Ga||n&&!Fo))return r.current()},[n,...t])},Do=(e,t,n)=>{let[r,s]=(0,z.useState)(()=>{let a=Wo(o=>o.getItem(e));return a&&t.includes(a)?a:n});return oa(()=>{Wo(a=>{a.setItem(e,r)})},[e,r]),[r,s]},Wo=e=>{if(!Ga)return null;try{return e(window.sessionStorage)}catch{return null}},Ho=(e,t)=>{let[n,r]=(0,z.useState)(e);return(0,z.useEffect)(()=>{let s=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(s)}},[e,t]),n},ci="contact-map.settings-tab",ui="contact-map.statistics-tab",pi=["basic","advanced","index","levenshtein"],mi=["overview","index","levenshtein"],_o=["full_name","company_name","department","title","email","company_phone_number","mobile_phone_number"],gi={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Qa=({streamState:e,...t}={})=>e===void 0?(0,A.jsx)(hi,{...t}):(0,A.jsx)(zo,{...t,streamState:e}),hi=e=>{let{context:t}=rn();return(0,A.jsx)(zo,{...e,streamState:t})},fi={setting:"ContactMapSearchPage workerUrls",keys:["indexWorker","levenshteinWorker"],hints:{treeWorker:"set treeWorker on ContactMapConfigProvider or ContactMapAppView"}},zo=e=>{let{streamState:t,onFooterVisibilityChange:n,children:r}=e,s=ke(e,"workerUrls"),a=Ke(),{locale:o,labels:d}=Se(),{contactMapRecords:l,contactMapRecordMap:c,isStreamingComplete:m,isStreamingFailed:u}=t,i=(0,ia.useNavigation)(),[p]=(0,ia.useSearchParams)(),f=(0,z.useRef)(null),[T,S]=(0,z.useState)(!0),[w,V]=(0,z.useState)(a.openEmailsWithGmail??!1),{indexWorker:H,levenshteinWorker:y}=kt(a.workerUrls,s,fi),[g,$]=(0,z.useState)(()=>Kn({indexWorker:H,levenshteinWorker:y})),[q,k]=(0,z.useState)(p.get("q")||""),h=Ho(q,g.debounceMs??sa.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs);(0,z.useEffect)(()=>{let K=p.get("q")||"";k(Y=>Y!==K?K:Y)},[p]),(0,z.useEffect)(()=>{if(typeof window>"u")return;let K=new URL(window.location.href);(K.searchParams.get("q")||"")!==h&&(h?K.searchParams.set("q",h):K.searchParams.delete("q"),window.history.replaceState(window.history.state,"",K.toString()))},[h]);let[v,F]=(0,z.useTransition)(),[P,ae]=(0,z.useState)("search"),[L,E]=Do(ci,pi,"basic"),[I,G]=Do(ui,mi,"overview"),{setScrollableRef:oe,onPointerDown:ye,onPointerMove:le,onPointerUp:Ee,onPointerLeave:gt,onPointerCancel:Mt,onClickCapture:gn}=Ze(),ge=(0,z.useCallback)(()=>{if(!Fo)return;let K=f.current;!K||document.activeElement===K||window.requestAnimationFrame(()=>{try{K.focus({preventScroll:!0})}catch{}})},[]),$t=(0,z.useCallback)(K=>{let Y=K;ae(Y),Y==="search"&&ge()},[ge]),we=(0,z.useMemo)(()=>({...g,debounceMs:0}),[g]),[at,hn]=(0,z.useState)("union"),qe=at==="intersection",la=qe?d.operatorAndTitle:d.operatorOrTitle,fn=(0,z.useCallback)(K=>(0,sa.parseQuerySets)(K,at),[at]),yn=(0,z.useMemo)(()=>({querySetsOf:fn}),[fn]),Vt=Ho(l,m?0:800),{searchTerm:re,setSearchTerm:bn,filteredItems:rt,resultTerm:Kt,isSearching:ot,isIndexBuilding:Ne,clearSearch:jt,resetStats:qt,performanceMetrics:Ie,rebuildIndex:st,error:Fe}=(0,Ao.useFuzzySearch)(Vt,_o,we,yn),ht=re.trim().length>0,[it,ft]=(0,z.useState)(""),[Pt,da]=(0,z.useState)(()=>re),lt=(0,z.useMemo)(()=>An(q),[q]),Ge=(0,z.useMemo)(()=>An(h),[h]);(0,z.useEffect)(()=>{h===it&&Ge===re||F(()=>{ft(h),bn(Ge)})},[h,it,Ge,re,bn]);let Gt=(0,z.useCallback)(K=>{let fe=K.target.value.replace(di,"");k(fe)},[]),ca=(0,z.useCallback)(()=>{k(""),ft(""),jt(),ge()},[jt,ge]),xn=(0,z.useCallback)(()=>{hn(K=>K==="intersection"?"union":"intersection"),ge()},[ge]);oa(()=>{if(!(P==="search"&&i.state==="idle"&&!v))return;let Y=document.activeElement;if(!!!(Y?.matches('[role="tab"]')||Y?.closest('[role="tablist"]')?.getAttribute("role")==="tablist")&&Y&&Y!==document.body&&Y!==f.current)return;let ze=window.requestAnimationFrame(()=>{ge()});return()=>{window.cancelAnimationFrame(ze)}},[P,i.state,v,ge],!0),oa(()=>{if(P!=="search")return;let K=[[document,"visibilitychange",()=>{document.visibilityState==="visible"&&ge()}],[window,"pageshow",()=>{ge()}]];for(let[Y,fe,ze]of K)Y.addEventListener(fe,ze);return()=>{for(let[Y,fe,ze]of K)Y.removeEventListener(fe,ze)}},[P,ge],!0),(0,z.useEffect)(()=>(n&&n(P==="search"?"mobile-hidden":"visible"),()=>{n&&n("visible")}),[P,n]),oa(()=>{let K=document.body,Y=K.style.overflow;return P==="search"&&(K.style.overflow="hidden"),()=>{K.style.overflow=Y}},[P],!0),(0,z.useEffect)(()=>{Ie&&Ve.info("\u{1F4CA} [STATE] \u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6307\u6A19\u304C\u66F4\u65B0\u3055\u308C\u307E\u3057\u305F:",{totalSearches:Ie.totalSearches,averageSearchTime:Ie.averageSearchTime,itemCount:Ie.itemCount,resultsCount:Ie.resultsCount,workersAvailable:!!Ie.workerStats})},[Ie]);let{isAwaitingDebounce:vn,isAwaitingSearchTermSync:Cn,isSearchInProgress:dt}=(0,z.useMemo)(()=>{let K=lt!==Ge,Y=Ge!==re,fe=re.trim().length>0||lt.trim().length>0;return{isAwaitingDebounce:K,isAwaitingSearchTermSync:Y,isSearchInProgress:v||ot||Kt!==re&&Fe===null||fe&&Ne||K||Y||Pt!==re}},[lt,Ge,re,Kt,Fe,v,ot,Ne,Pt]),[Rt,kn]=(0,z.useState)(re);(0,z.useEffect)(()=>{Rt!==re&&kn(re)},[re,Rt]),(0,z.useEffect)(()=>{vn||Cn||v||ot||Ne||Rt===re&&Pt!==re&&da(re)},[re,Pt,vn,Cn,v,ot,Ne,Rt]);let Sn=(0,z.useMemo)(()=>kr(it,_o),[it]),Tn=(0,z.useMemo)(()=>Sn(rt),[Sn,rt]),wn=(0,z.useMemo)(()=>({contactMapRecords:l,contactMapRecordMap:c,filteredItems:Tn,searchQuery:it,searchTerm:re,isSearching:ot,isIndexBuilding:Ne,isPending:v,hasSearchTerm:ht,enableHighlighting:T,openEmailsWithGmail:w,isSearchInProgress:dt,isSearchTabActive:P==="search",errorMessage:Fe??null,isStreamingComplete:m,isStreamingFailed:u}),[l,c,Tn,it,re,ot,Ne,v,ht,T,w,dt,P,Fe,m,u]),ua=ht?rt.length:l.length,Qt=X(o,l.length),W=X(o,rt.length);return(0,A.jsx)("div",{className:`scrollbar-hidden bg-slate-50 text-slate-900 dark:bg-slate-900 dark:text-slate-100${P==="search"?" h-full min-h-0":""}`,children:(0,A.jsxs)(tn,{value:P,onValueChange:$t,className:`flex flex-col${P==="search"?" h-full min-h-0":""}`,children:[(0,A.jsxs)(Ft,{ref:oe,style:gi,className:"scrollbar-none mt-0 mb-1 flex w-full touch-pan-x flex-nowrap overflow-x-auto overflow-y-hidden rounded-md bg-slate-50 transition-colors dark:bg-slate-900/70 dark:text-slate-200",onPointerDown:ye,onPointerMove:le,onPointerUp:Ee,onPointerLeave:gt,onPointerCancel:Mt,onClickCapture:gn,children:[(0,A.jsxs)(pt,{value:"search",className:"min-w-16 px-2 py-0.5 text-xs transition-colors sm:min-w-24 sm:px-2.5 sm:py-0.5 sm:text-xs dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100",children:["\u{1F50D} ",d.searchTab]}),(0,A.jsxs)(pt,{value:"settings",className:"min-w-16 px-2 py-0.5 text-xs transition-colors sm:min-w-24 sm:px-2.5 sm:py-0.5 sm:text-xs dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100",children:["\u2699\uFE0F ",d.searchSettings]}),(0,A.jsxs)(pt,{value:"statistics",className:"min-w-16 px-2 py-0.5 text-xs transition-colors sm:min-w-24 sm:px-2.5 sm:py-0.5 sm:text-xs dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100",children:["\u{1F4CA} ",d.searchStatistics]})]}),(0,A.jsx)(mt,{value:"search",className:"mt-0 flex h-full min-h-0 flex-col overflow-hidden",children:(0,A.jsxs)("div",{className:"flex h-full flex-col",children:[(0,A.jsx)("div",{className:"rounded-md border border-gray-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/80 dark:shadow-none",children:(0,A.jsxs)("div",{className:"flex flex-col",children:[(0,A.jsx)("div",{className:"relative",children:(0,A.jsxs)("div",{className:"flex items-center gap-1 p-1",children:[(0,A.jsxs)("button",{type:"button",onClick:xn,"aria-pressed":qe,title:la,className:`inline-flex min-w-9 items-center justify-center gap-0.5 rounded border px-1.5 py-0.5 font-semibold text-[10px] transition-colors sm:min-w-12 sm:px-2 sm:py-0.5 sm:text-xs ${qe?"border-blue-500 bg-blue-600 text-white hover:bg-blue-700 dark:border-blue-400 dark:bg-blue-500 dark:hover:bg-blue-600":"border-amber-400 bg-amber-100 text-amber-800 hover:bg-amber-200 dark:border-amber-500/70 dark:bg-amber-300/20 dark:text-amber-200 dark:hover:bg-amber-300/30"}`,children:[(0,A.jsx)("span",{className:"text-[10px] sm:text-xs",children:qe?d.operatorAnd:d.operatorOr}),(0,A.jsx)("span",{className:"hidden text-[10px] sm:inline",children:qe?d.operatorAndHint:d.operatorOrHint})]}),(0,A.jsx)("input",{ref:f,type:"text",value:q,onChange:Gt,placeholder:d.searchPlaceholder,className:"flex-1 rounded border border-gray-300 border-solid px-2 py-0.5 text-xs shadow-sm transition-colors focus:border-blue-500 focus:ring-1 focus:ring-blue-500 sm:px-2 sm:py-0.5 sm:text-xs dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100 dark:shadow-none"}),q&&(0,A.jsx)("button",{type:"button",onClick:ca,className:"flex items-center justify-center gap-1 rounded border border-gray-300 px-1.5 py-0.5 text-[10px] transition-colors hover:text-gray-700 sm:px-2 sm:py-0.5 sm:text-xs dark:border-slate-600 dark:bg-slate-800/70 dark:text-slate-300 dark:hover:text-slate-100",title:dt?d.searchBusyTitle:d.clearSearch,disabled:dt,children:dt?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Io.default,{"aria-hidden":"true",className:"h-3 w-3 animate-spin sm:h-3.5 sm:w-3.5"}),(0,A.jsx)("span",{className:"hidden sm:inline",children:d.searching})]}):"\u2715"})]})}),(0,A.jsxs)("p",{className:"px-1.5 py-0.5 text-[10px] text-slate-700 leading-snug transition-colors sm:text-[11px] dark:text-slate-200",children:[d.registeredCountLabel," ",(0,A.jsx)("span",{className:"font-semibold text-[11px] text-slate-900 sm:text-xs dark:text-white",children:Qt})," ",d.recordUnit(Qt),Ne?(0,A.jsxs)("span",{className:"ml-1.5 inline-flex items-center rounded bg-blue-50 px-1.5 py-0.2 text-[10px] text-blue-700 sm:text-[11px] dark:bg-blue-900/40 dark:text-blue-200",children:["\u23F3 ",d.rebuildingIndex]}):null,Fe?(0,A.jsxs)("span",{className:"ml-1.5 inline-flex items-center rounded bg-rose-50 px-1.5 py-0.2 text-[10px] text-rose-700 sm:text-[11px] dark:bg-rose-900/40 dark:text-rose-200",children:["\u26A0\uFE0F ",d.errorLabel,(0,A.jsx)("span",{className:"ml-1 break-all font-semibold",children:Fe})]}):null,ht&&(0,A.jsxs)("span",{className:"ml-1.5 text-[10px] text-blue-600 sm:text-[11px] dark:text-sky-400",children:["| ",d.resultCountLabel,dt?(0,A.jsx)("span",{className:"ml-1 font-semibold text-[10px] sm:text-[11px]",children:d.searching}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("span",{className:"ml-1 font-semibold text-[11px] text-slate-900 sm:text-xs dark:text-white",children:W}),(0,A.jsx)("span",{className:"ml-0.5 text-[10px] sm:text-[11px]",children:d.resultUnit(W)})]})]})]}),(0,A.jsx)("div",{className:"h-2.5 px-2 pb-1.5",children:Ne?(0,A.jsx)(Da,{className:"h-1 bg-blue-200 dark:bg-blue-800",indicatorClassName:"bg-blue-500 dark:bg-blue-400"}):null})]})}),r?r(wn):(0,A.jsx)(Ka,{context:wn})]})}),(0,A.jsx)(mt,{value:"settings",className:"mt-0",children:(0,A.jsx)(ta,{searchOptions:g,setSearchOptions:$,enableHighlighting:T,setEnableHighlighting:S,openEmailsWithGmail:w,setOpenEmailsWithGmail:V,activeTab:L,onTabChange:E})}),(0,A.jsx)(mt,{value:"statistics",className:"mt-0",children:(0,A.jsx)(ra,{performanceMetrics:Ie,searchTerm:re,totalDataCount:l.length,resultsCount:ua,resetStats:qt,rebuildIndex:st,isIndexBuilding:Ne,activeTab:I,onTabChange:G})})]})})};var je=require("react/jsx-runtime"),yi=({renderHeader:e,title:t,onFooterVisibilityChange:n})=>{let r=J(),s=t===void 0?r.appTitle:t,{context:a,retryNow:o}=rn(),d=(0,je.jsx)($n,{recordCount:a.contactMapRecords.length,companyCount:a.companyCount,phase:a.streamPhase,loadedCount:a.loadedCount,totalCount:a.totalCount,errorMessage:a.errorMessage,onRetry:o});return(0,je.jsxs)("div",{"data-testid":"contact-map-app-view",className:"flex h-full w-full flex-col",children:[e?e({title:s,annotation:d}):(0,je.jsxs)("div",{"data-testid":"contact-map-default-header",className:"mb-2 flex items-center justify-between",children:[(0,je.jsx)("h1",{className:"font-bold text-xl",children:s}),d]}),(0,je.jsx)("div",{className:"min-h-0 flex-1",children:(0,je.jsx)(Qa,{streamState:a,onFooterVisibilityChange:n})})]})},bi=e=>{let t=Ke(),n=ke(e,"streamEndpoint"),r=ke(e,"workerUrls"),s=ke(e,"locale"),a=ke(e,"labels"),o=(0,Ya.useMemo)(()=>({...t,streamEndpoint:n===void 0?t.streamEndpoint:n,workerUrls:kt(t.workerUrls,r,{setting:"ContactMapAppView workerUrls"}),locale:s===void 0?t.locale:s,labels:a===void 0?t.labels:a}),[t,n,r,s,a]),d=s!==void 0,l=a!==void 0,c=(0,Ya.useMemo)(()=>({locale:d?"ContactMapAppView locale":"locale",labels:l?"ContactMapAppView labels":"labels"}),[d,l]);return(0,je.jsx)(Ea,{config:o,chromeSurface:c,children:(0,je.jsx)(yi,{...e})})};xt();ce();function xi(){return!1}0&&(module.exports={AdvancedSearchSettings,BasicSearchSettings,CONTACT_MAP_LABEL_CATALOGS,CONTACT_MAP_LABEL_KEYS,ContactDetailGrid,ContactDetailPanel,ContactDetailPopup,ContactDetailRowLayout,ContactMapAnnotation,ContactMapAppView,ContactMapConfigProvider,ContactMapSearchListView,ContactMapSearchPage,ContactMapSearchTabGroup,ContactMapSearchTreeView,ContactMapStreamClient,HighlightedText,IndexWorkerSettings,LIST_COLLAPSE_THRESHOLD,LIST_DETAIL_PANEL_MIN_WIDTH,LIST_EXPAND_THRESHOLD,LIST_PANEL_MIN_WIDTH,LIST_RESIZE_HANDLE_THICKNESS,LevenshteinWorkerSettings,Progress,SearchOptionsPanel,StatItem,StatisticsPanel,SwipeOverlay,TREE_COLLAPSE_THRESHOLD,TREE_DETAIL_PANEL_MIN_WIDTH,TREE_EXPAND_THRESHOLD,TREE_PANEL_MIN_WIDTH,TREE_RESIZE_HANDLE_THICKNESS,Tabs,TabsContent,TabsList,TabsTrigger,TreeWorkerSession,WorkerStatsSection,assertContactMapStreamEndpoint,assertContactMapTreeWorkerUrl,assertContactMapWorkerUrls,composeTreeVirtualScrollOptions,contactMapShouldRevalidate,countContactMapCompanies,deserializeStreamRecord,getContactMapStreamClient,getTreeWorkerSession,layerContactMapWorkerUrls,resetContactMapStreamClientForTesting,resetTreeWorkerSessionForTesting,resolveContactMapLabels,useAnimatedNumber,useContactMapConfig,useContactMapLabels,useContactMapStream,useContactPanelSizing,useDynamicViewportHeight,useHorizontalDragScroll,useLongPressPopup,useReportPopupVisibility,useResponsiveTwoColumnLayout,useRowPopupRegistry,useStreamedContactMapContext,useTreeWorker});
1
+ "use strict";var ls=Object.create;var In=Object.defineProperty;var ds=Object.getOwnPropertyDescriptor;var cs=Object.getOwnPropertyNames;var ps=Object.getPrototypeOf,us=Object.prototype.hasOwnProperty;var ke=(e,t)=>()=>(e&&(t=e(e=0)),t);var pr=(e,t)=>{for(var n in t)In(e,n,{get:t[n],enumerable:!0})},ur=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of cs(t))!us.call(e,s)&&s!==n&&In(e,s,{get:()=>t[s],enumerable:!(a=ds(t,s))||a.enumerable});return e};var le=(e,t,n)=>(n=e!=null?ls(ps(e)):{},ur(t||!e||!e.__esModule?In(n,"default",{value:e,enumerable:!0}):n,e)),ms=e=>ur(In({},"__esModule",{value:!0}),e);var ze,vt,mr,Vt,Kt,un,et,We,Fn,Ta,wa,Ve,J,Ct=ke(()=>{"use strict";ze=e=>{if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null},vt=e=>!e||typeof e!="object"?null:"item"in e?e.item??null:"person_id"in e?e:null,mr=(e,t)=>{if(!e)return{value:null,fieldKey:null};for(let n of t){let a=ze(e[n]);if(a)return{value:a,fieldKey:n}}return{value:null,fieldKey:null}},Vt=e=>mr(e,["custom_email","email"]),Kt=e=>mr(e,["custom_mobile_phone_number","mobile_phone_number","company_phone_number"]),un=e=>{let t=ze(e);if(!t)return null;let n=t.replace(/[^0-9+#*]/g,"");return n.length===0?null:`tel:${n}`},et=(e,t)=>{let n=ze(e);return n?t?`https://mail.google.com/mail/?view=cm&fs=1&to=${encodeURIComponent(n)}`:`mailto:${encodeURIComponent(n)}`:null},We=(e,t)=>String(e).padStart(t,"0"),Fn=e=>`${We(e.getUTCFullYear(),4)}-${We(e.getUTCMonth()+1,2)}-${We(e.getUTCDate(),2)}`,Ta=e=>`${Fn(e)} ${We(e.getUTCHours(),2)}:${We(e.getUTCMinutes(),2)}:${We(e.getUTCSeconds(),2)}`,wa=e=>`${We(e.getFullYear(),4)}-${We(e.getMonth()+1,2)}-${We(e.getDate(),2)} ${We(e.getHours(),2)}:${We(e.getMinutes(),2)}:${We(e.getSeconds(),2)}`,Ve=(e,t)=>{if(e==null||e==="")return"-";let n=typeof e=="string"?new Date(e):e;return Number.isNaN(n.getTime())?typeof e=="string"?e:"-":t(n)},J=e=>e==null?"-":typeof e=="string"?ze(e)??"-":typeof e=="number"?Number.isFinite(e)?String(e):"-":String(e)});var te,gr,kt=ke(()=>{"use strict";te=e=>{switch(typeof e){case"string":return JSON.stringify(e);case"bigint":return`${e}n`;case"symbol":return e.toString();case"object":return e===null?"null":gr(e);case"function":return gr(e);case"number":return Object.is(e,-0)?"-0":String(e);default:return String(e)}},gr=e=>{try{return Object.prototype.toString.call(e)}catch{return"[object ?]"}}});var jt,Se,Gt=ke(()=>{"use strict";jt=e=>{if(typeof e!="object"||e===null)return!1;try{let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}catch{return!1}},Se=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0});var gs,zn,Na=ke(()=>{"use strict";gs=(e,t)=>{let n=Array.from({length:t.length+1},(a,s)=>s);for(let a=1;a<=e.length;a+=1){let s=[a];for(let o=1;o<=t.length;o+=1){let r=n[o-1]+(e[a-1]===t[o-1]?0:1);s.push(Math.min(n[o]+1,s[o-1]+1,r))}n=s}return n[t.length]},zn=(e,t)=>{let n=e.toLowerCase();if(n.length>=3){let s=t.find(o=>o.toLowerCase().startsWith(n));if(s!==void 0)return s}let a;for(let s of t){let o=gs(n,s.toLowerCase());o<=Math.max(1,Math.floor(s.length/4))&&(a===void 0||o<a.distance)&&(a={key:s,distance:o})}return a?.key}});var tt,Bn,hs,Q,St,Un,fr,qt,Ke,fs,hr,br,bs,Ma,ys,xs,vs,$n,Pa,Ra,Tt=ke(()=>{"use strict";tt=require("@aiquants/directory-tree"),Bn=require("@aiquants/virtualscroll");Ct();kt();Gt();Na();hs=Object.freeze({en:"en-US",ja:"ja-JP"}),Q=(e,t)=>t.toLocaleString(hs[e]),St=(e,t,n)=>e==="1"?t:n,Un=Object.freeze({en:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"Total:",annotationCompaniesLabel:"Companies:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`Streaming (${Q("en",e)} / ${Q("en",t)} \xB7 ${n}%)`,annotationStreamingCount:e=>`Streaming (${Q("en",e)} loaded)`,annotationLoadFailed:e=>`Failed to load (${Q("en",e)} received)`,annotationReconnecting:e=>`Reconnecting (${Q("en",e)} received)`,annotationAuthRequired:"Session expired: sign in again, then retry",annotationRetry:"Retry",recordUnit:e=>St(e,"record","records"),companyUnit:e=>St(e,"company","companies"),searchTab:"Fuzzy search",searchSettings:"Search settings",searchStatistics:"Search statistics",operatorAndTitle:"AND search (all terms match)",operatorOrTitle:"OR search (any term matches)",operatorAnd:"AND",operatorOr:"OR",operatorAndHint:"All terms",operatorOrHint:"Any term",searchPlaceholder:"Fuzzy search...",searchBusyTitle:"Searching",clearSearch:"Clear search",searching:"Searching...",registeredCountLabel:"Registered:",rebuildingIndex:"Rebuilding index...",errorLabel:"Error:",resultCountLabel:"Results:",resultUnit:e=>St(e,"match","matches"),listViewTab:"List",treeViewTab:"Tree",columnNo:"No",columnId:"ID",columnScore:"Score",columnName:"Name",columnTitle:"Title",columnCompany:"Company",columnDepartment:"Department",columnPhone:"Phone",columnEmail:"Email",columnUpdatedAt:"Updated",listRowNumber:e=>`No. ${e}`,listNoSearchResults:"No search results found",listNoData:"No data",listboxLabel:"Contact list",listKeyboardHelp:"Up and down arrows move between contacts, Page Up and Page Down move by a screen, Home and End go to the first and the last; Enter or Space opens the contact's details.",listResizeHandle:"Resize the border between the contact list and the detail pane",detailHeading:"Contact details",close:"Close",noName:"(No Name)",treeNodeCountTitle:"Number of nodes built in the tree view",treeNodeCountLabel:"Nodes:",treeNodeCount:e=>Q("en",e),uncategorizedCompany:"Uncategorized",treeDirectoryName:(e,t)=>`${e} (${Q("en",t)})`,treeStreamInterruptedTitle:"Streaming was interrupted. Only the data received so far is shown",treeStreamInterrupted:"Interrupted",treeStreamLoadingTitle:"Receiving data streamed from the network",treeStreamLoading:"Loading...",treeBuildingTitle:"Building and expanding the directory tree from the received data",treeBuilding:"Treeing...",treeCompleteTitle:"Every tree node has been built",treeComplete:"Complete",treeShowEntireCompanyTitle:"Show the whole company of every search hit",treeShowEntireCompany:"Whole company",treeExpandAll:"Expand all directories",treeExpandAllTitle:"Expand all",treeCollapseAll:"Collapse all directories",treeCollapseAllTitle:"Collapse all",treeNoMatches:"No contacts match the criteria",treeEmpty:"No contacts to display",treeResizeHandle:"Resize the border between the directory tree and the detail pane",copyField:e=>`Copy ${e}`,detailEmptyTitle:"Select a contact to see its details",detailEmptyHint:"Choose a person from the list",detailTabSummary:"Summary",detailTabBasic:"Basic info",detailBasicProfile:"Profile",detailTabContact:"Contact",detailTabMeta:"Metadata",preferred:"Preferred",summaryEmail:"Email",summaryPhone:"Phone",summaryLastContact:"Last contact",sectionEmail:"Email",sectionEmailEmpty:"No email addresses registered",sectionPhone:"Phone / Fax",sectionPhoneEmpty:"No phone numbers registered",fieldFullName:"Name",fieldFullNameReading:"Name (reading)",fieldTitle:"Title",fieldDepartment:"Department",fieldCompanyName:"Company",fieldCompanyNameReading:"Company (reading)",fieldAddress:"Address",fieldPostalCode:"Postal code",fieldUrl:"URL",fieldCustomEmail:"Custom email",fieldEmail:"Email",fieldCustomMobilePhone:"Custom mobile",fieldMobilePhone:"Mobile",fieldCompanyPhone:"Company phone",fieldCompanyFax:"Company fax",fieldCreatedBy:"Created by",fieldCreatedAt:"Created at",fieldUpdatedBy:"Updated by",fieldUpdatedAt:"Updated at",recordDateTime:Ta,recordDate:Fn,popupCustomMobilePhone:"Mobile (custom)",popupMobilePhone:"Mobile",popupCustomCompanyPhone:"Company phone (custom)",popupCompanyPhone:"Company phone",popupCustomEmail:"Email (custom)",popupEmail:"Email",popupGmailHint:"Double-click or double-tap to open Gmail",popupLastContactDate:"Last contact:",popupNoContactMethods:"No contact information to display",overlayTitle:"Details",settingsResetAllTitle:"Reset all settings",settingsResetAll:"Reset all",settingsTabsLabel:"Search option tabs",settingsBasicTab:"Basic settings",settingsAdvancedTab:"Advanced settings",indexWorkerName:"Index Worker",levenshteinWorkerName:"Levenshtein Worker",currentValueLabel:"Current:",resetToDefaultsTitle:"Reset to defaults",reset:"Reset",relevanceOnlyNotice:"Editable only when sorting by relevance",relevanceWeightsHeading:"Relevance score weights",fieldWeight:"Field weight",scoreTuningHeading:"Score tuning",maxResults:"Maximum results",noLimit:"No limit",basicThresholdHeading:"Final similarity threshold",basicThresholdLabel:"Adjust the minimum score",basicThresholdRangeRelevance:"In relevance mode a score can exceed 1.0 (range: 0.0-1.5)",basicThresholdRange:"Range: 0.0-1.0",basicDisplayHeading:"Display options",basicCaseSensitive:"Case-sensitive",basicHighlight:"Highlight matches",basicOpenEmailsWithGmail:"Open email addresses in Gmail compose",basicMultiTermOperator:"Operator for words inside quotes",basicOperatorOr:"OR (any word matches)",basicOperatorAnd:"AND (all words match)",basicMultiTermHint:'How words between quotation marks ("tanaka taro") are combined (default: AND). Words outside quotation marks are separate keywords combined by the AND / OR button',basicSortHeading:"Sorting",basicSortBy:"Sort by",basicSortByScore:"Score",basicSortByRelevance:"Relevance",basicSortByOriginal:"Original order",basicSortOrder:"Sort order",basicSortDescending:"Descending",basicSortAscending:"Ascending",basicEngineHeading:"Search engine",basicStrategy:"Parallel search strategy",basicStrategyBalanced:"Balanced",basicStrategyIndexFirst:"Index first",basicStrategyLevenshteinFirst:"Levenshtein first",basicIndexFiltering:"Index filtering",basicLevenshtein:"Levenshtein distance",advancedLearningHeading:"Learning weight",advancedLearningLabel:"Weight factor",advancedLearningHint:"Weight applied when re-learning (higher favors past search results)",advancedDebounceHeading:"Debounce time",advancedDebounceLabel:"Input delay (ms)",advancedDebounceHint:"How long input is awaited. Shorter is more real-time, longer reduces load",indexSettingsHeading:"Index Worker settings",indexBuildHeading:"Index build",indexNgramSize:"N-gram size",indexNgramSizeHint:"How many characters each chunk holds. Smaller is faster but less accurate",indexMinNgramOverlap:"Minimum N-gram matches",indexMinNgramOverlapHint:"Candidates with fewer matches are excluded",indexCandidateHeading:"Candidate filtering",indexThreshold:"Index threshold",indexThresholdHint:"Lower bound of the Jaro-Winkler similarity (range: 0.0-1.0)",indexNgramOverlapThreshold:"N-gram overlap threshold",indexNgramOverlapThresholdHint:"How much N-grams must overlap. Higher narrows candidates more strictly",indexStrategyHeading:"Search strategy and candidates",indexStrategy:"Search strategy",indexStrategyFast:"Fast",indexStrategyAccurate:"Accurate",indexStrategyHybrid:"Hybrid (adaptive)",indexStrategyHint:"Balance processing load against accuracy",indexMinCandidatesRatio:"Minimum candidate ratio",indexMinCandidatesRatioHint:"Share of candidates always kept",indexMaxCandidatesRatio:"Maximum candidate ratio",indexMaxCandidatesRatioHint:"Upper bound on candidates; narrowed dynamically when exceeded",indexJaroWinklerPrefix:"Jaro-Winkler prefix weight",indexJaroWinklerPrefixHint:"Bonus given to a matching prefix",indexMaxResultsHint:"Maximum number of results to fetch. Larger is more thorough but slower",indexFieldWeightHint:"How much the number of matched fields counts",indexPerfectMatchBonus:"Exact match bonus",indexPerfectMatchBonusHint:"Bonus added on an exact match",indexContainmentHeading:"Containment score (Japanese / substrings)",indexContainmentBase:"Containment base score (containmentScoreBase)",indexContainmentBaseHint:"Minimum base score when the query is fully contained in the string (rescues short Japanese queries such as 2 characters)",indexContainmentCoverage:"Containment coverage weight (containmentCoverageWeight)",indexContainmentCoverageHint:"Extra score by the query length / field length ratio (total capped at 1.0)",levenshteinSettingsHeading:"Levenshtein Worker settings",levenshteinCandidateHeading:"Candidate filter",levenshteinThreshold:"Levenshtein threshold",levenshteinThresholdHintRelevance:"Keep only results at or above this threshold (range: 0.0-1.5)",levenshteinThresholdHint:"Keep only results at or above this threshold (range: 0.0-1.0)",levenshteinLengthSimilarity:"Length similarity threshold",levenshteinLengthSimilarityHint:"Exclude candidates whose length differs greatly, for speed",levenshteinLengthPenalty:"Length difference penalty",levenshteinLengthPenaltyHint:"How much a length difference is penalized. Larger favors equal lengths",levenshteinResultsHeading:"Result count",levenshteinMaxResultsHint:"Maximum number of results to return. Larger is more thorough but slower",levenshteinFieldWeightHint:"Weight of the number of matched fields",levenshteinPartialBonus:"Partial match bonus",levenshteinPartialBonusHint:"Extra score for a partial match",statsRebuildingTitle:"Rebuilding the index",statsRebuildIndexTabOnlyTitle:"Available on the Index tab only",statsRebuildTitle:"Rebuild the index",statsRebuilding:"Rebuilding...",statsRebuild:"Rebuild Index",statsResetTitle:"Reset statistics",statsOverviewTab:"Overview",statsIndexTab:"Index",statsLevenshteinTab:"Levenshtein",statTotalSearches:"Total searches",statAverageSearchTime:"Average search time",statDataCount:"Data items",statResultCount:"Search results",statDisplayedCount:"Displayed items",statsNoData:"No statistics yet",statsBasicHeading:"Basic statistics",statTotalProcessingTime:"Total processing time",statLastSearchTime:"Last search time",statErrorCount:"Errors",statUpdatedAt:"Statistics updated at",statsTimestamp:wa,statsOperationsHeading:"Operations",statTotalOperations:"Total operations",statsIndexHeading:"Index statistics",statIndexBuilds:"Index builds",statDataSize:"Data size",statLastBuildTime:"Last build time",statsCacheHeading:"Cache statistics",statCacheNgram:"N-gram",statCacheWord:"Words",statCachePhonetic:"Phonetic",statsIndexMetadataHeading:"Index metadata",statsCalculationsHeading:"Calculations",statTotalCalculations:"Total calculations",statDistanceCalculations:"Distance calculations",statAverageDistance:"Average distance",statMinDistance:"Minimum distance",statMaxDistance:"Maximum distance",notAvailable:"N/A",statsMatchesHeading:"Matches",statPartialMatches:"Partial matches",statPerfectMatches:"Exact matches",statEarlyTerminations:"Early terminations",statsSimilarityHeading:"Similarity distribution",statAbove80:"80% or more",statAbove60:"60% or more",statAbove40:"40% or more",statBelow40:"Below 40%",statsDistanceHeading:"Distance distribution (top 6)",statDistance:e=>`Distance ${e}`,statsQueryLengthHeading:"Query lengths (top 6)",statQueryLength:e=>`Length ${e}`,statQueryLengthValue:({count:e,averagePercent:t})=>{let n=Q("en",e);return`${n} ${St(n,"time","times")} / average ${t}%`},statsFieldPerformanceHeading:"Field performance (top 6)",statAverageScore:"Average score",statMatchCount:"Matches",statBestWorstScore:"Best / worst score",statsInsightsHeading:"Performance insights",statBestField:"Best-performing field",statRecentAverageTime:"Recent average processing time",statRecentAverageResults:"Recent average results",statThroughput:"Throughput",statCommonQueryLength:"Most common query length",statHistoryEntries:"History entries",statHighSimilarity:"High similarity",statMediumSimilarity:"Medium similarity",statLowSimilarity:"Low similarity",statVeryLowSimilarity:"Very low similarity",statsRecentHistoryHeading:"Recent history (latest 3)",statsHistoryEntry:({processingTimeMs:e,resultCount:t})=>`Processing time: ${e} ms / results: ${Q("en",t)}`,timesUnit:e=>St(e," time"," times"),itemsUnit:e=>St(e," item"," items"),charactersUnit:e=>St(e," character"," characters"),throughputUnit:" ops/s"}),ja:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"\u7DCF\u4EF6\u6570:",annotationCompaniesLabel:"\u4F01\u696D\u6570:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${Q("ja",e)} / ${Q("ja",t)} \u4EF6\u30FB${n}%)`,annotationStreamingCount:e=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${Q("ja",e)} \u4EF6)`,annotationLoadFailed:e=>`\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F (${Q("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,annotationReconnecting:e=>`\u518D\u63A5\u7D9A\u4E2D (${Q("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,annotationAuthRequired:"\u30BB\u30C3\u30B7\u30E7\u30F3\u304C\u5207\u308C\u307E\u3057\u305F\u3002\u30B5\u30A4\u30F3\u30A4\u30F3\u3057\u76F4\u3057\u3066\u304B\u3089\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044",annotationRetry:"\u518D\u8A66\u884C",recordUnit:()=>"\u4EF6",companyUnit:()=>"\u793E",searchTab:"\u3042\u3044\u307E\u3044\u691C\u7D22",searchSettings:"\u691C\u7D22\u8A2D\u5B9A",searchStatistics:"\u691C\u7D22\u7D71\u8A08",operatorAndTitle:"AND \u691C\u7D22 (\u3059\u3079\u3066\u4E00\u81F4)",operatorOrTitle:"OR \u691C\u7D22 (\u3044\u305A\u308C\u304B\u4E00\u81F4)",operatorAnd:"AND",operatorOr:"OR",operatorAndHint:"\u5168\u8A9E\u4E00\u81F4",operatorOrHint:"\u3044\u305A\u308C\u304B\u4E00\u81F4",searchPlaceholder:"\u3042\u3044\u307E\u3044\u691C\u7D22...",searchBusyTitle:"\u691C\u7D22\u51E6\u7406\u4E2D",clearSearch:"\u691C\u7D22\u3092\u30AF\u30EA\u30A2",searching:"\u691C\u7D22\u4E2D...",registeredCountLabel:"\u767B\u9332\u4EF6\u6570:",rebuildingIndex:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9\u4E2D...",errorLabel:"\u30A8\u30E9\u30FC:",resultCountLabel:"\u691C\u7D22\u7D50\u679C:",resultUnit:()=>"\u4EF6",listViewTab:"\u4E00\u89A7",treeViewTab:"\u30C4\u30EA\u30FC",columnNo:"No",columnId:"ID",columnScore:"\u30B9\u30B3\u30A2",columnName:"\u6C0F\u540D",columnTitle:"\u5F79\u8077",columnCompany:"\u4F1A\u793E\u540D",columnDepartment:"\u90E8\u7F72",columnPhone:"\u96FB\u8A71\u756A\u53F7",columnEmail:"\u30E1\u30FC\u30EB",columnUpdatedAt:"\u66F4\u65B0\u65E5\u6642",listRowNumber:e=>`No. ${e}`,listNoSearchResults:"\u691C\u7D22\u7D50\u679C\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",listNoData:"\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093",listboxLabel:"\u9023\u7D61\u5148\u4E00\u89A7",listKeyboardHelp:"\u4E0A\u4E0B\u306E\u77E2\u5370\u30AD\u30FC\u3067\u9023\u7D61\u5148\u3092\u79FB\u308A\u3001Page Up \u3068 Page Down \u3067 1 \u753B\u9762\u305A\u3064\u3001Home \u3068 End \u3067\u5148\u982D\u3068\u672B\u5C3E\u3078\u79FB\u308A\u307E\u3059\u3002Enter \u304B Space \u3067\u9023\u7D61\u5148\u306E\u8A73\u7D30\u3092\u958B\u304D\u307E\u3059\u3002",listResizeHandle:"\u9023\u7D61\u5148\u4E00\u89A7\u3068\u8A73\u7D30\u30DA\u30A4\u30F3\u306E\u5883\u754C\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u30CF\u30F3\u30C9\u30EB",detailHeading:"\u9023\u7D61\u5148\u8A73\u7D30",close:"\u9589\u3058\u308B",noName:"\u540D\u524D\u672A\u8A2D\u5B9A",treeNodeCountTitle:"\u30C4\u30EA\u30FC\u30D3\u30E5\u30FC\u3067\u69CB\u7BC9\u3055\u308C\u305F\u5168\u30CE\u30FC\u30C9\u6570",treeNodeCountLabel:"\u30CE\u30FC\u30C9:",treeNodeCount:e=>`${Q("ja",e)} \u500B`,uncategorizedCompany:"\u672A\u5206\u985E",treeDirectoryName:(e,t)=>`${e} (${Q("ja",t)})`,treeStreamInterruptedTitle:"\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u304C\u4E2D\u65AD\u3055\u308C\u307E\u3057\u305F\u3002\u53D7\u4FE1\u6E08\u307F\u30C7\u30FC\u30BF\u306E\u307F\u8868\u793A\u3057\u3066\u3044\u307E\u3059",treeStreamInterrupted:"\u4E2D\u65AD",treeStreamLoadingTitle:"\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u304B\u3089\u306E\u30C7\u30FC\u30BF\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u3092\u53D7\u4FE1\u4E2D",treeStreamLoading:"\u8AAD\u307F\u8FBC\u307F\u4E2D...",treeBuildingTitle:"\u53D7\u53D6\u30C7\u30FC\u30BF\u3092\u57FA\u306B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30C4\u30EA\u30FC\u69CB\u9020\u3092\u6700\u7D42\u69CB\u7BC9\u30FB\u5C55\u958B\u4E2D",treeBuilding:"\u30C4\u30EA\u30FC\u69CB\u7BC9\u4E2D...",treeCompleteTitle:"\u30C4\u30EA\u30FC\u30CE\u30FC\u30C9\u306E\u5168\u4EF6\u69CB\u7BC9\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F",treeComplete:"\u5B8C\u4E86",treeShowEntireCompanyTitle:"\u691C\u7D22\u30D2\u30C3\u30C8\u3057\u305F\u4F1A\u793E\u5168\u4F53\u3092\u8868\u793A",treeShowEntireCompany:"\u5168\u4F53\u8868\u793A",treeExpandAll:"\u5168\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u5C55\u958B",treeExpandAllTitle:"\u3059\u3079\u3066\u5C55\u958B",treeCollapseAll:"\u5168\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6298\u308A\u305F\u305F\u307F",treeCollapseAllTitle:"\u3059\u3079\u3066\u6298\u308A\u305F\u305F\u307F",treeNoMatches:"\u6761\u4EF6\u306B\u4E00\u81F4\u3059\u308B\u9023\u7D61\u5148\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",treeEmpty:"\u8868\u793A\u3059\u308B\u9023\u7D61\u5148\u304C\u3042\u308A\u307E\u305B\u3093",treeResizeHandle:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30C4\u30EA\u30FC\u3068\u8A73\u7D30\u30DA\u30A4\u30F3\u306E\u5883\u754C\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u30CF\u30F3\u30C9\u30EB",copyField:e=>`\u300C${e}\u300D\u3092\u30B3\u30D4\u30FC`,detailEmptyTitle:"\u9023\u7D61\u5148\u3092\u9078\u629E\u3059\u308B\u3068\u8A73\u7D30\u304C\u8868\u793A\u3055\u308C\u307E\u3059",detailEmptyHint:"\u4E00\u89A7\u304B\u3089\u5BFE\u8C61\u306E\u4EBA\u7269\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",detailTabSummary:"\u30B5\u30DE\u30EA\u30FC",detailTabBasic:"\u57FA\u672C\u60C5\u5831",detailBasicProfile:"\u57FA\u672C\u30D7\u30ED\u30D5\u30A3\u30FC\u30EB",detailTabContact:"\u9023\u7D61\u5148",detailTabMeta:"\u30E1\u30BF\u60C5\u5831",preferred:"\u512A\u5148",summaryEmail:"\u30E1\u30FC\u30EB",summaryPhone:"\u96FB\u8A71",summaryLastContact:"\u6700\u7D42\u63A5\u89E6",sectionEmail:"\u30E1\u30FC\u30EB",sectionEmailEmpty:"\u767B\u9332\u3055\u308C\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306F\u3042\u308A\u307E\u305B\u3093",sectionPhone:"\u96FB\u8A71\u30FBFAX",sectionPhoneEmpty:"\u767B\u9332\u3055\u308C\u305F\u96FB\u8A71\u756A\u53F7\u306F\u3042\u308A\u307E\u305B\u3093",fieldFullName:"\u6C0F\u540D",fieldFullNameReading:"\u6C0F\u540D (\u304B\u306A)",fieldTitle:"\u5F79\u8077",fieldDepartment:"\u90E8\u7F72",fieldCompanyName:"\u4F1A\u793E\u540D",fieldCompanyNameReading:"\u4F1A\u793E\u540D (\u304B\u306A)",fieldAddress:"\u4F4F\u6240",fieldPostalCode:"\u90F5\u4FBF\u756A\u53F7",fieldUrl:"URL",fieldCustomEmail:"\u30AB\u30B9\u30BF\u30E0\u30E1\u30FC\u30EB",fieldEmail:"\u30E1\u30FC\u30EB",fieldCustomMobilePhone:"\u30AB\u30B9\u30BF\u30E0\u643A\u5E2F\u756A\u53F7",fieldMobilePhone:"\u643A\u5E2F\u756A\u53F7",fieldCompanyPhone:"\u4F1A\u793E\u96FB\u8A71\u756A\u53F7",fieldCompanyFax:"\u4F1A\u793E FAX \u756A\u53F7",fieldCreatedBy:"\u4F5C\u6210\u8005",fieldCreatedAt:"\u4F5C\u6210\u65E5\u6642",fieldUpdatedBy:"\u66F4\u65B0\u8005",fieldUpdatedAt:"\u66F4\u65B0\u65E5\u6642",recordDateTime:Ta,recordDate:Fn,popupCustomMobilePhone:"\u643A\u5E2F\u96FB\u8A71 (\u30AB\u30B9\u30BF\u30E0)",popupMobilePhone:"\u643A\u5E2F\u96FB\u8A71",popupCustomCompanyPhone:"\u4F1A\u793E\u96FB\u8A71 (\u30AB\u30B9\u30BF\u30E0)",popupCompanyPhone:"\u4F1A\u793E\u96FB\u8A71",popupCustomEmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9 (\u30AB\u30B9\u30BF\u30E0)",popupEmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",popupGmailHint:"\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u307E\u305F\u306F\u4E8C\u5EA6\u30BF\u30C3\u30D7\u3067 Gmail \u3092\u958B\u304D\u307E\u3059",popupLastContactDate:"\u6700\u7D42\u30B3\u30F3\u30BF\u30AF\u30C8\u65E5:",popupNoContactMethods:"\u8868\u793A\u3067\u304D\u308B\u9023\u7D61\u5148\u60C5\u5831\u304C\u3042\u308A\u307E\u305B\u3093",overlayTitle:"\u8A73\u7D30",settingsResetAllTitle:"\u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u30EA\u30BB\u30C3\u30C8",settingsResetAll:"\u3059\u3079\u3066\u30EA\u30BB\u30C3\u30C8",settingsTabsLabel:"\u691C\u7D22\u30AA\u30D7\u30B7\u30E7\u30F3\u8A2D\u5B9A\u30BF\u30D6",settingsBasicTab:"\u57FA\u672C\u8A2D\u5B9A",settingsAdvancedTab:"\u8A73\u7D30\u8A2D\u5B9A",indexWorkerName:"Index Worker",levenshteinWorkerName:"Levenshtein Worker",currentValueLabel:"\u73FE\u5728\u5024:",resetToDefaultsTitle:"\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u306B\u30EA\u30BB\u30C3\u30C8",reset:"\u30EA\u30BB\u30C3\u30C8",relevanceOnlyNotice:"Relevance \u30BD\u30FC\u30C8\u6642\u306E\u307F\u5909\u66F4\u53EF\u80FD",relevanceWeightsHeading:"Relevance \u30B9\u30B3\u30A2\u91CD\u307F",fieldWeight:"\u30D5\u30A3\u30FC\u30EB\u30C9\u91CD\u307F",scoreTuningHeading:"\u30B9\u30B3\u30A2\u8ABF\u6574",maxResults:"\u6700\u5927\u7D50\u679C\u6570",noLimit:"\u4E0A\u9650\u306A\u3057",basicThresholdHeading:"\u6700\u7D42\u985E\u4F3C\u5EA6\u95BE\u5024",basicThresholdLabel:"\u30B9\u30B3\u30A2\u306E\u4E0B\u9650\u3092\u8ABF\u6574",basicThresholdRangeRelevance:"Relevance \u30E2\u30FC\u30C9\u3067\u306F\u30B9\u30B3\u30A2\u304C 1.0 \u3092\u8D85\u3048\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059 (\u7BC4\u56F2: 0.0-1.5)",basicThresholdRange:"\u7BC4\u56F2: 0.0-1.0",basicDisplayHeading:"\u8868\u793A\u30AA\u30D7\u30B7\u30E7\u30F3",basicCaseSensitive:"\u5927\u6587\u5B57\u5C0F\u6587\u5B57\u3092\u533A\u5225",basicHighlight:"\u30CF\u30A4\u30E9\u30A4\u30C8\u8868\u793A",basicOpenEmailsWithGmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092 Gmail \u306E\u4F5C\u6210\u753B\u9762\u3067\u958B\u304F",basicMultiTermOperator:"\u5F15\u7528\u7B26\u306E\u4E2D\u306E\u8A9E\u306E\u6F14\u7B97\u5B50",basicOperatorOr:"OR (\u3044\u305A\u308C\u304B\u4E00\u81F4)",basicOperatorAnd:"AND (\u3059\u3079\u3066\u4E00\u81F4)",basicMultiTermHint:'\u5F15\u7528\u7B26\u3067\u56F2\u3093\u3060\u8A9E ("\u7530\u4E2D \u592A\u90CE") \u306E\u7D50\u5408\u65B9\u6CD5 (\u65E2\u5B9A\u306F AND)\u3002\u5F15\u7528\u7B26\u306E\u5916\u306E\u8A9E\u306F\u305D\u308C\u305E\u308C\u5225\u306E\u30AD\u30FC\u30EF\u30FC\u30C9\u3067\u3001AND / OR \u30DC\u30BF\u30F3\u3067\u7D50\u5408\u3059\u308B',basicSortHeading:"\u30BD\u30FC\u30C8\u8A2D\u5B9A",basicSortBy:"\u30BD\u30FC\u30C8\u57FA\u6E96",basicSortByScore:"\u30B9\u30B3\u30A2",basicSortByRelevance:"\u95A2\u9023\u6027",basicSortByOriginal:"\u5143\u306E\u9806\u5E8F",basicSortOrder:"\u30BD\u30FC\u30C8\u9806\u5E8F",basicSortDescending:"\u964D\u9806",basicSortAscending:"\u6607\u9806",basicEngineHeading:"\u691C\u7D22\u30A8\u30F3\u30B8\u30F3\u8A2D\u5B9A",basicStrategy:"\u4E26\u5217\u691C\u7D22\u6226\u7565",basicStrategyBalanced:"\u30D0\u30E9\u30F3\u30B9",basicStrategyIndexFirst:"Index \u512A\u5148",basicStrategyLevenshteinFirst:"Levenshtein \u512A\u5148",basicIndexFiltering:"Index \u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0",basicLevenshtein:"Levenshtein \u8DDD\u96E2\u8A08\u7B97",advancedLearningHeading:"\u5B66\u7FD2\u91CD\u307F",advancedLearningLabel:"\u91CD\u307F\u4FC2\u6570",advancedLearningHint:"\u518D\u5B66\u7FD2\u6642\u306E\u91CD\u307F\u4ED8\u3051 (\u5927\u304D\u3044\u307B\u3069\u904E\u53BB\u306E\u691C\u7D22\u7D50\u679C\u3092\u512A\u5148)",advancedDebounceHeading:"\u30C7\u30D0\u30A6\u30F3\u30B9\u6642\u9593",advancedDebounceLabel:"\u5165\u529B\u9045\u5EF6 (ms)",advancedDebounceHint:"\u5165\u529B\u306E\u5F85\u3061\u6642\u9593\u3002\u77ED\u3044\u307B\u3069\u30EA\u30A2\u30EB\u30BF\u30A4\u30E0\u3001\u9577\u3044\u307B\u3069\u8CA0\u8377\u8EFD\u6E1B",indexSettingsHeading:"Index Worker \u8A2D\u5B9A",indexBuildHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u69CB\u7BC9",indexNgramSize:"N-gram \u30B5\u30A4\u30BA",indexNgramSizeHint:"\u6587\u5B57\u5217\u3092\u4F55\u6587\u5B57\u5358\u4F4D\u3067\u5206\u5272\u3059\u308B\u304B\u3002\u5C0F\u3055\u3044\u307B\u3069\u9AD8\u901F\u3060\u304C\u7CBE\u5EA6\u4F4E\u4E0B",indexMinNgramOverlap:"\u6700\u5C0F N-gram \u4E00\u81F4\u6570",indexMinNgramOverlapHint:"\u4E00\u81F4\u6570\u304C\u3053\u306E\u5024\u3092\u4E0B\u56DE\u308B\u5019\u88DC\u306F\u9664\u5916",indexCandidateHeading:"\u5019\u88DC\u7D5E\u308A\u8FBC\u307F",indexThreshold:"Index \u95BE\u5024",indexThresholdHint:"Jaro-Winkler \u985E\u4F3C\u5EA6\u306E\u4E0B\u9650 (\u7BC4\u56F2: 0.0-1.0)",indexNgramOverlapThreshold:"N-gram \u91CD\u8907\u5EA6\u95BE\u5024",indexNgramOverlapThresholdHint:"N-gram \u306E\u91CD\u306A\u308A\u5177\u5408\u3002\u9AD8\u3044\u307B\u3069\u53B3\u5BC6\u306B\u5019\u88DC\u3092\u7D5E\u308B",indexStrategyHeading:"\u691C\u7D22\u6226\u7565\u3068\u5019\u88DC\u6570",indexStrategy:"\u691C\u7D22\u6226\u7565",indexStrategyFast:"Fast (\u9AD8\u901F)",indexStrategyAccurate:"Accurate (\u6B63\u78BA)",indexStrategyHybrid:"Hybrid (\u52D5\u7684)",indexStrategyHint:"\u51E6\u7406\u8CA0\u8377\u3068\u7CBE\u5EA6\u306E\u30D0\u30E9\u30F3\u30B9\u3092\u9078\u629E",indexMinCandidatesRatio:"\u6700\u5C0F\u5019\u88DC\u6BD4\u7387",indexMinCandidatesRatioHint:"\u6700\u4F4E\u9650\u78BA\u4FDD\u3059\u308B\u5019\u88DC\u5272\u5408",indexMaxCandidatesRatio:"\u6700\u5927\u5019\u88DC\u6BD4\u7387",indexMaxCandidatesRatioHint:"\u5019\u88DC\u6570\u306E\u4E0A\u9650\u3002\u8D85\u3048\u308B\u3068\u52D5\u7684\u306B\u7D5E\u308A\u8FBC\u307F",indexJaroWinklerPrefix:"Jaro-Winkler \u63A5\u982D\u8F9E\u91CD\u307F",indexJaroWinklerPrefixHint:"\u5148\u982D\u4E00\u81F4\u306B\u4ED8\u4E0E\u3059\u308B\u30DC\u30FC\u30CA\u30B9\u5024",indexMaxResultsHint:"\u53D6\u5F97\u3059\u308B\u6700\u5927\u4EF6\u6570\u3002\u5927\u304D\u3044\u307B\u3069\u5305\u62EC\u7684\u3060\u304C\u9045\u5EF6\u304C\u5897\u52A0",indexFieldWeightHint:"\u30DE\u30C3\u30C1\u30D5\u30A3\u30FC\u30EB\u30C9\u6570\u306B\u3069\u308C\u3060\u3051\u91CD\u307F\u4ED8\u3051\u3059\u308B\u304B",indexPerfectMatchBonus:"\u5B8C\u5168\u4E00\u81F4\u30DC\u30FC\u30CA\u30B9",indexPerfectMatchBonusHint:"\u5B8C\u5168\u4E00\u81F4\u6642\u306B\u8FFD\u52A0\u3059\u308B\u30DC\u30FC\u30CA\u30B9\u5024",indexContainmentHeading:"\u548C\u6587\u30FB\u90E8\u5206\u6587\u5B57\u5217\u5305\u542B\u30B9\u30B3\u30A2",indexContainmentBase:"\u5305\u542B \u57FA\u790E\u30B9\u30B3\u30A2 (containmentScoreBase)",indexContainmentBaseHint:"\u30AF\u30A8\u30EA\u304C\u6587\u5B57\u5217\u4E2D\u306B\u5B8C\u5168\u306B\u542B\u307E\u308C\u308B\u5834\u5408\u306E\u6700\u4F4E\u57FA\u790E\u30B9\u30B3\u30A2 (\u548C\u6587 2 \u6587\u5B57\u7B49\u306E\u6551\u6E08)",indexContainmentCoverage:"\u5305\u542B \u88AB\u8986\u7387\u91CD\u307F (containmentCoverageWeight)",indexContainmentCoverageHint:"\u30AF\u30A8\u30EA\u9577 / \u30D5\u30A3\u30FC\u30EB\u30C9\u9577\u306E\u6BD4\u7387\u306B\u5FDC\u3058\u305F\u52A0\u7B97\u30B9\u30B3\u30A2 (\u5408\u8A08 1.0 \u4EE5\u4E0B\u306B\u5236\u9650)",levenshteinSettingsHeading:"Levenshtein Worker \u8A73\u7D30\u8A2D\u5B9A",levenshteinCandidateHeading:"\u5019\u88DC\u30D5\u30A3\u30EB\u30BF",levenshteinThreshold:"Levenshtein \u95BE\u5024",levenshteinThresholdHintRelevance:"\u3053\u306E\u95BE\u5024\u4EE5\u4E0A\u306E\u7D50\u679C\u306E\u307F\u4FDD\u6301 (\u7BC4\u56F2: 0.0-1.5)",levenshteinThresholdHint:"\u3053\u306E\u95BE\u5024\u4EE5\u4E0A\u306E\u7D50\u679C\u306E\u307F\u4FDD\u6301 (\u7BC4\u56F2: 0.0-1.0)",levenshteinLengthSimilarity:"\u9577\u3055\u985E\u4F3C\u5EA6\u95BE\u5024",levenshteinLengthSimilarityHint:"\u9577\u3055\u304C\u5927\u304D\u304F\u7570\u306A\u308B\u5019\u88DC\u3092\u4E8B\u524D\u306B\u9664\u5916\u3057\u3066\u901F\u5EA6\u5411\u4E0A",levenshteinLengthPenalty:"\u9577\u3055\u5DEE\u30DA\u30CA\u30EB\u30C6\u30A3",levenshteinLengthPenaltyHint:"\u9577\u3055\u5DEE\u3092\u3069\u308C\u3060\u3051\u6E1B\u70B9\u3059\u308B\u304B\u3002\u5927\u304D\u3044\u307B\u3069\u9577\u3055\u4E00\u81F4\u3092\u91CD\u8996",levenshteinResultsHeading:"\u7D50\u679C\u6570\u5236\u5FA1",levenshteinMaxResultsHint:"\u8FD4\u5374\u3059\u308B\u6700\u5927\u4EF6\u6570\u3002\u5927\u304D\u3044\u307B\u3069\u7DB2\u7F85\u7684\u3060\u304C\u51E6\u7406\u6642\u9593\u304C\u5897\u52A0",levenshteinFieldWeightHint:"\u4E00\u81F4\u30D5\u30A3\u30FC\u30EB\u30C9\u6570\u306E\u8A55\u4FA1\u91CD\u307F",levenshteinPartialBonus:"\u90E8\u5206\u4E00\u81F4\u30DC\u30FC\u30CA\u30B9",levenshteinPartialBonusHint:"\u90E8\u5206\u4E00\u81F4\u306B\u4ED8\u4E0E\u3059\u308B\u8FFD\u52A0\u30B9\u30B3\u30A2",statsRebuildingTitle:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9\u4E2D",statsRebuildIndexTabOnlyTitle:"Index \u30BF\u30D6\u3067\u306E\u307F\u4F7F\u7528\u53EF\u80FD",statsRebuildTitle:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u3092\u518D\u69CB\u7BC9",statsRebuilding:"\u518D\u69CB\u7BC9\u4E2D...",statsRebuild:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9",statsResetTitle:"\u7D71\u8A08\u3092\u30EA\u30BB\u30C3\u30C8",statsOverviewTab:"\u6982\u8981",statsIndexTab:"Index",statsLevenshteinTab:"Levenshtein",statTotalSearches:"\u7DCF\u691C\u7D22\u56DE\u6570",statAverageSearchTime:"\u5E73\u5747\u691C\u7D22\u6642\u9593",statDataCount:"\u30C7\u30FC\u30BF\u4EF6\u6570",statResultCount:"\u691C\u7D22\u7D50\u679C\u4EF6\u6570",statDisplayedCount:"\u8868\u793A\u4EF6\u6570",statsNoData:"\u7D71\u8A08\u30C7\u30FC\u30BF\u306A\u3057",statsBasicHeading:"\u57FA\u672C\u7D71\u8A08",statTotalProcessingTime:"\u7DCF\u51E6\u7406\u6642\u9593",statLastSearchTime:"\u6700\u5F8C\u306E\u691C\u7D22\u6642\u9593",statErrorCount:"\u30A8\u30E9\u30FC\u6570",statUpdatedAt:"\u7D71\u8A08\u66F4\u65B0\u6642\u523B",statsTimestamp:wa,statsOperationsHeading:"\u64CD\u4F5C\u7D71\u8A08",statTotalOperations:"\u7DCF\u64CD\u4F5C\u6570",statsIndexHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u7D71\u8A08",statIndexBuilds:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u69CB\u7BC9\u56DE\u6570",statDataSize:"\u30C7\u30FC\u30BF\u30B5\u30A4\u30BA",statLastBuildTime:"\u6700\u5F8C\u306E\u69CB\u7BC9\u6642\u9593",statsCacheHeading:"\u30AD\u30E3\u30C3\u30B7\u30E5\u7D71\u8A08",statCacheNgram:"N-gram",statCacheWord:"\u5358\u8A9E",statCachePhonetic:"\u97F3\u97FB",statsIndexMetadataHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u30E1\u30BF\u30C7\u30FC\u30BF",statsCalculationsHeading:"\u8A08\u7B97\u7D71\u8A08",statTotalCalculations:"\u7DCF\u8A08\u7B97\u6570",statDistanceCalculations:"\u8DDD\u96E2\u8A08\u7B97\u6570",statAverageDistance:"\u5E73\u5747\u8DDD\u96E2",statMinDistance:"\u6700\u5C0F\u8DDD\u96E2",statMaxDistance:"\u6700\u5927\u8DDD\u96E2",notAvailable:"N/A",statsMatchesHeading:"\u30DE\u30C3\u30C1\u7D71\u8A08",statPartialMatches:"\u90E8\u5206\u30DE\u30C3\u30C1\u6570",statPerfectMatches:"\u5B8C\u5168\u30DE\u30C3\u30C1\u6570",statEarlyTerminations:"\u65E9\u671F\u7D42\u4E86\u6570",statsSimilarityHeading:"\u985E\u4F3C\u5EA6\u5206\u5E03",statAbove80:"80% \u4EE5\u4E0A",statAbove60:"60% \u4EE5\u4E0A",statAbove40:"40% \u4EE5\u4E0A",statBelow40:"40% \u672A\u6E80",statsDistanceHeading:"\u8DDD\u96E2\u5206\u5E03 (\u4E0A\u4F4D 6)",statDistance:e=>`\u8DDD\u96E2 ${e}`,statsQueryLengthHeading:"\u30AF\u30A8\u30EA\u9577\u7D71\u8A08 (\u4E0A\u4F4D 6)",statQueryLength:e=>`\u9577\u3055 ${e}`,statQueryLengthValue:({count:e,averagePercent:t})=>`${Q("ja",e)} \u56DE / \u5E73\u5747 ${t}%`,statsFieldPerformanceHeading:"\u30D5\u30A3\u30FC\u30EB\u30C9\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9 (\u4E0A\u4F4D 6)",statAverageScore:"\u5E73\u5747\u30B9\u30B3\u30A2",statMatchCount:"\u30DE\u30C3\u30C1\u6570",statBestWorstScore:"\u6700\u9AD8 / \u6700\u4F4E\u30B9\u30B3\u30A2",statsInsightsHeading:"\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6D1E\u5BDF",statBestField:"\u6700\u9AD8\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u30D5\u30A3\u30FC\u30EB\u30C9",statRecentAverageTime:"\u6700\u8FD1\u306E\u5E73\u5747\u51E6\u7406\u6642\u9593",statRecentAverageResults:"\u6700\u8FD1\u306E\u5E73\u5747\u7D50\u679C\u6570",statThroughput:"\u30B9\u30EB\u30FC\u30D7\u30C3\u30C8",statCommonQueryLength:"\u6700\u983B\u51FA\u30AF\u30A8\u30EA\u9577",statHistoryEntries:"\u5C65\u6B74\u30A8\u30F3\u30C8\u30EA\u6570",statHighSimilarity:"\u9AD8\u985E\u4F3C",statMediumSimilarity:"\u4E2D\u985E\u4F3C",statLowSimilarity:"\u4F4E\u985E\u4F3C",statVeryLowSimilarity:"\u6975\u4F4E\u985E\u4F3C",statsRecentHistoryHeading:"\u6700\u8FD1\u306E\u5C65\u6B74 (\u6700\u65B0 3 \u4EF6)",statsHistoryEntry:({processingTimeMs:e,resultCount:t})=>`\u51E6\u7406\u6642\u9593: ${e} ms / \u7D50\u679C: ${Q("ja",t)} \u4EF6`,timesUnit:()=>" \u56DE",itemsUnit:()=>" \u4EF6",charactersUnit:()=>" \u6587\u5B57",throughputUnit:" ops/\u79D2"})}),fr=Object.freeze(Object.keys(Un.en)),qt=Object.freeze([...tt.DIRECTORY_TREE_LABEL_KEYS,...fr]),Ke=Object.freeze({en:Object.freeze({...tt.DIRECTORY_TREE_LABEL_CATALOGS.en,...Un.en}),ja:Object.freeze({...tt.DIRECTORY_TREE_LABEL_CATALOGS.ja,...Un.ja})}),fs=new Set(qt),hr=Object.keys(Ke).map(e=>JSON.stringify(e)).join(" or "),br=Object.freeze({locale:"locale",labels:"labels"}),bs=(e,t,n)=>{e[t]=n},Ma=(e,t=br.locale)=>{if(e!==void 0&&typeof e!="string")throw new TypeError(`[contact-map] ${t} must be ${hr} or left out; got ${te(e)}`);if(e!==void 0&&!Object.hasOwn(Ke,e))throw new RangeError(`[contact-map] ${t} must be ${hr} or left out; got ${te(e)}`);return(0,Bn.resolveVirtualScrollLocale)(e)},ys=(e,t,n,a)=>{if(typeof a=="function"){if(typeof n!="function")throw new TypeError(`[contact-map] ${e}.${t} must be a function; got ${te(n)}`);return}if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string; got ${te(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${te(n)}`)},xs=(e,t,n)=>{let a=Object.create(null);for(let s of Object.getOwnPropertyNames(e)){if(!fs.has(s)){let r=zn(s,qt);throw new RangeError(`[contact-map] ${n} has a key that is not a label key (${r===void 0?"":`did you mean ${JSON.stringify(r)}? `}CONTACT_MAP_LABEL_KEYS lists every key); got ${te(s)}`)}let o=e[s];o!==void 0&&(ys(n,s,o,t[s]),a[s]=o)}return a},vs=e=>{let t={},n=!1;for(let a of tt.DIRECTORY_TREE_LABEL_KEYS){let s=e[a];s!==void 0&&(t[a]=s,n=!0)}return n?t:void 0},$n=(e,t,n=br)=>{let a=Ma(e,n.locale);if(t===void 0)return Ke[a];if(!jt(t))throw new TypeError(`[contact-map] ${n.labels} must be a plain object or left out; got ${te(t)}`);let s=xs(t,Ke[a],n.labels),r={...(0,tt.resolveDirectoryTreeLabels)(a,vs(s)),...Un[a]};for(let c of fr){let d=s[c];d!==void 0&&bs(r,c,d)}return Object.freeze(r)},Pa=e=>{let t={};for(let n of tt.DIRECTORY_TREE_LABEL_KEYS)t[n]=e[n];return Object.freeze(t)},Ra=e=>{let t={};for(let n of Bn.VIRTUAL_SCROLL_LABEL_KEYS)t[n]=e[n];return Object.freeze(t)}});var yr,xr,je,Cr,Cs,Ea,La,vr,Te,X,de=ke(()=>{"use strict";yr=require("@aiquants/directory-tree"),xr=require("@aiquants/virtualscroll"),je=require("react");Tt();Cr=require("react/jsx-runtime"),Cs=Object.freeze({locale:"en",labels:Ke.en,treeLabels:Pa(Ke.en),engineLabels:Ra(Ke.en)}),Ea=(0,je.createContext)(Cs),La=(e,t)=>{let n=(0,je.useRef)(null),a=n.current;return a!==null&&t.every(s=>a[s]===e[s])?a:(n.current=e,e)},vr=({locale:e,labels:t,surface:n,children:a})=>{let s=Ma(e,n.locale),o=(0,je.useMemo)(()=>$n(s,t,n),[s,t,n]),r=La(o,qt),c=La(Pa(r),yr.DIRECTORY_TREE_LABEL_KEYS),d=La(Ra(r),xr.VIRTUAL_SCROLL_LABEL_KEYS),l=(0,je.useMemo)(()=>({locale:s,labels:r,treeLabels:c,engineLabels:d}),[s,r,c,d]);return(0,Cr.jsx)(Ea.Provider,{value:l,children:a})},Te=()=>(0,je.useContext)(Ea),X=()=>(0,je.useContext)(Ea).labels});var jn,Gn,qn,Yn,Oa=ke(()=>{"use strict";jn="fixed inset-y-0 left-0 m-0 h-auto max-h-none w-auto max-w-none border-0 bg-transparent p-0 text-inherit outline-none backdrop:bg-transparent motion-safe:transition-[right] motion-safe:duration-500 motion-safe:ease-[ease]",Gn=Object.freeze({right:"var(--aqcm-overlay-right, 0px)"}),qn="absolute inset-0 bg-slate-900/50",Yn=()=>!1});var ks,mt,kr,Yt,gn=ke(()=>{"use strict";ks="pointer-coarse:min-w-11 pointer-coarse:py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",mt="focus-visible:outline-2 focus-visible:outline-blue-700 focus-visible:outline-offset-2 dark:focus-visible:outline-sky-300",kr="in-focus-visible:data-[contact-map-row-active]:outline-2 in-focus-visible:data-[contact-map-row-active]:-outline-offset-2 in-focus-visible:data-[contact-map-row-active]:outline-blue-700 dark:in-focus-visible:data-[contact-map-row-active]:outline-sky-300",Yt=`underline-offset-2 hover:underline focus-visible:underline ${mt} ${ks}`});function xe(...e){return(0,Tr.twMerge)((0,Sr.clsx)(e))}var Sr,Tr,hn=ke(()=>{"use strict";Sr=require("clsx"),Tr=require("tailwind-merge")});var wr,Nr,Mr,Pr,oe,Rr,$,Ss,Re,Ts,ws,Ns,fn,Xt,Ms,Ps,Qt,Da,_a,bn,Wa=ke(()=>{"use strict";wr=require("@aiquants/swipe-overlay"),Nr=le(require("lucide-react/dist/esm/icons/check.js")),Mr=le(require("lucide-react/dist/esm/icons/copy.js")),Pr=le(require("lucide-react/dist/esm/icons/x.js")),oe=require("react"),Rr=require("react-dom");Ct();de();Oa();gn();hn();$=require("react/jsx-runtime"),Ss=350,Re=e=>e.stopPropagation(),Ts=Object.freeze({onClick:Re,onDoubleClick:Re,onContextMenu:Re,onPointerDown:Re,onPointerUp:Re,onMouseDown:Re,onMouseUp:Re,onTouchStart:Re,onTouchEnd:Re,onKeyDown:Re,onKeyUp:Re,onFocus:Re,onBlur:Re}),ws=xe(jn,"flex items-center justify-center px-4 py-6"),Ns="relative max-h-full w-full max-w-md overflow-y-auto overscroll-contain rounded-lg border border-slate-200 bg-white p-4 shadow-lg transition-colors dark:border-transparent dark:bg-slate-900 dark:shadow-slate-950/40 dark:ring-1 dark:ring-white/70",fn=0,Xt=null,Ms=()=>{let e=document.body.style;fn+=1,fn===1&&(Xt={userSelect:e.userSelect,webkitUserSelect:e.webkitUserSelect}),e.userSelect="none",typeof e.webkitUserSelect<"u"&&(e.webkitUserSelect="none")},Ps=()=>{if(fn=Math.max(0,fn-1),fn>0||!Xt)return;let e=document.body.style;e.userSelect=Xt.userSelect,typeof Xt.webkitUserSelect<"u"&&(e.webkitUserSelect=Xt.webkitUserSelect),Xt=null},Qt=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},Da=(e,t)=>{let n=new Set;return e.reduce((a,s)=>{let o=typeof s.value=="string"?s.value.trim():"";if(!o)return a;let{normalized:r,key:c,entry:d}=t(o,s);return r&&!n.has(c)&&(n.add(c),a.push(d(r))),a},[])},_a=({value:e,ariaLabel:t})=>{let[n,a]=(0,oe.useState)(!1),s=(0,oe.useRef)(null),o=(0,oe.useCallback)(async d=>{if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(d),!0}catch{}if(typeof document>"u")return!1;let l=document.createElement("textarea");l.value=d,l.setAttribute("readonly",""),l.style.position="absolute",l.style.left="-9999px",document.body.appendChild(l),l.select(),l.setSelectionRange(0,l.value.length);let u=document.execCommand("copy");return document.body.removeChild(l),u},[]),r=(0,oe.useCallback)(async d=>{d.preventDefault(),d.stopPropagation(),s.current!==null&&typeof window<"u"&&(window.clearTimeout(s.current),s.current=null);let l=await o(e);a(l),l&&typeof window<"u"&&(s.current=window.setTimeout(()=>{a(!1),s.current=null},1500))},[o,e]);(0,oe.useEffect)(()=>()=>{s.current!==null&&typeof window<"u"&&(window.clearTimeout(s.current),s.current=null)},[]);let c=n?Nr.default:Mr.default;return(0,$.jsx)("button",{type:"button",className:`inline-flex h-6 pointer-coarse:h-11 pointer-coarse:w-11 w-6 shrink-0 items-center justify-center rounded-md border border-gray-200 text-slate-600 transition-colors hover:bg-gray-100 dark:text-slate-300 ${mt}`,onClick:r,"aria-label":t,title:t,children:(0,$.jsx)(c,{className:"h-3.5 w-3.5","aria-hidden":"true"})})},bn=({contactData:e,openEmailsWithGmail:t,openGmailCompose:n,onRequestClose:a})=>{let s=X(),o=(0,oe.useRef)(null),r=(0,oe.useMemo)(()=>e.contacted_at?Ve(e.contacted_at,s.recordDate):null,[e.contacted_at,s.recordDate]),c=Qt(e.full_name)??s.noName,d=Qt(e.company_name),l=Qt(e.department),u=Qt(e.title),p=(0,oe.useMemo)(()=>Da([{fieldKey:"company_name",label:s.fieldCompanyName,value:d},{fieldKey:"department",label:s.fieldDepartment,value:l},{fieldKey:"title",label:s.fieldTitle,value:u}],(v,{fieldKey:M,label:z})=>({normalized:v,key:`${M}-${v.toLowerCase()}`,entry:b=>({fieldKey:M,label:z,value:b})})),[d,l,u,s]),i=(0,oe.useMemo)(()=>Da([{fieldKey:"custom_mobile_phone_number",label:s.popupCustomMobilePhone,value:e.custom_mobile_phone_number},{fieldKey:"mobile_phone_number",label:s.popupMobilePhone,value:e.mobile_phone_number},{fieldKey:"custom_company_phone_number",label:s.popupCustomCompanyPhone,value:e.custom_company_phone_number},{fieldKey:"company_phone_number",label:s.popupCompanyPhone,value:e.company_phone_number}],(v,{fieldKey:M,label:z})=>{let b=un(v);return{normalized:Qt(v),key:(b??v).toLowerCase(),entry:Z=>({fieldKey:M,label:z,value:Z,href:b})}}),[e.custom_mobile_phone_number,e.mobile_phone_number,e.custom_company_phone_number,e.company_phone_number,s]),m=(0,oe.useMemo)(()=>Da([{fieldKey:"custom_email",label:s.popupCustomEmail,value:e.custom_email},{fieldKey:"email",label:s.popupEmail,value:e.email}],(v,{fieldKey:M,label:z})=>{let b=Qt(v),N=et(v,t),Z=!!N?.startsWith("https://mail.google.com");return{normalized:b,key:v.toLowerCase(),entry:U=>({fieldKey:M,label:z,value:U,href:N,isGmailLink:Z})}}),[e.custom_email,e.email,t,s]),h=i.length>0||m.length>0,C=(0,oe.useId)(),T=(0,oe.useCallback)(()=>{a(),o.current=null},[a]),S=(0,oe.useCallback)(v=>v.ownerDocument.getElementById(C),[C]),{dialogProps:K,backdropProps:V}=(0,wr.useOverlayDialog)({isOpen:!0,onClose:T,isCloseBlocked:Yn,initialFocus:S}),f=(0,oe.useCallback)((v,M)=>{M.isGmailLink&&(v.preventDefault(),n(M.value))},[n]),g=(0,oe.useCallback)((v,M)=>{if(!M.isGmailLink){o.current=null;return}let z=Date.now(),b=o.current;if(b&&b.email===M.value&&z-b.timestamp<=Ss){o.current=null,v.preventDefault(),n(M.value);return}o.current={email:M.value,timestamp:z}},[n]);return(0,oe.useEffect)(()=>(Ms(),Ps),[]),(0,Rr.createPortal)((0,$.jsxs)("dialog",{...K,...Ts,"data-contact-popup-root":"true","aria-labelledby":C,className:ws,style:Gn,children:[(0,$.jsx)("div",{...V,"data-contact-popup-backdrop":"",className:qn}),(0,$.jsxs)("div",{"data-contact-popup-card":"",className:Ns,children:[(0,$.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,$.jsx)("h2",{id:C,tabIndex:-1,className:"wrap-break-word min-w-0 font-semibold text-gray-900 text-lg outline-none dark:text-slate-100",children:c}),(0,$.jsx)("button",{type:"button",className:`inline-flex shrink-0 items-center justify-center rounded-md p-1 pointer-coarse:p-3.5 text-slate-600 transition-colors hover:bg-gray-100 dark:text-slate-300 dark:hover:bg-slate-800/70 ${mt}`,onClick:T,"aria-label":s.close,children:(0,$.jsx)(Pr.default,{className:"h-4 w-4","aria-hidden":"true"})})]}),p.length>0?(0,$.jsx)("div",{className:"mt-2 space-y-2 text-slate-700 text-sm dark:text-slate-200",children:p.map(v=>(0,$.jsxs)("div",{className:"flex items-center gap-3",children:[(0,$.jsx)("p",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:v.value}),(0,$.jsx)(_a,{value:v.value,ariaLabel:s.copyField(v.label)})]},v.fieldKey))}):null,(0,$.jsxs)("div",{className:"mt-4 space-y-4 text-slate-700 dark:text-slate-200",children:[i.length>0?(0,$.jsx)("div",{children:(0,$.jsx)("ul",{className:"space-y-3 text-sm",children:i.map(v=>(0,$.jsx)("li",{className:"flex items-start gap-3",children:(0,$.jsxs)("div",{className:"flex-1",children:[(0,$.jsx)("span",{className:"text-slate-600 text-xs dark:text-slate-300",children:v.label}),(0,$.jsxs)("div",{className:"mt-1 flex items-center gap-3",children:[(0,$.jsx)("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:v.href?(0,$.jsx)("a",{href:v.href,className:`wrap-break-word pointer-coarse:inline-block text-blue-800 dark:text-blue-300 ${Yt}`,children:v.value}):(0,$.jsx)("span",{className:"wrap-break-word text-slate-800 dark:text-slate-100",children:v.value})}),(0,$.jsx)(_a,{value:v.value,ariaLabel:s.copyField(v.label)})]})]})},`${v.fieldKey}-${v.value}`))})}):null,m.length>0?(0,$.jsx)("div",{children:(0,$.jsx)("ul",{className:"space-y-3 text-sm",children:m.map(v=>(0,$.jsx)("li",{className:"flex items-start gap-3",children:(0,$.jsxs)("div",{className:"flex-1",children:[(0,$.jsx)("span",{className:"text-slate-600 text-xs dark:text-slate-300",children:v.label}),(0,$.jsxs)("div",{className:"mt-1 flex items-start gap-3",children:[(0,$.jsxs)("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:[v.href?(0,$.jsx)("a",{href:v.href,className:`wrap-break-word pointer-coarse:inline-block text-blue-800 dark:text-blue-300 ${Yt}`,target:v.isGmailLink?"_blank":void 0,rel:v.isGmailLink?"noopener noreferrer":void 0,onDoubleClick:M=>f(M,v),onTouchEnd:M=>g(M,v),children:v.value}):(0,$.jsx)("span",{className:"wrap-break-word text-slate-800 dark:text-slate-100",children:v.value}),v.isGmailLink?(0,$.jsx)("span",{className:"mt-1 block text-[11px] text-slate-600 dark:text-slate-300",children:s.popupGmailHint}):null]}),(0,$.jsx)(_a,{value:v.value,ariaLabel:s.copyField(v.label)})]})]})},`${v.fieldKey}-${v.value}`))})}):null,r?(0,$.jsxs)("div",{className:"mt-2 flex items-center gap-2 text-slate-600 text-sm dark:text-slate-300",children:[(0,$.jsx)("span",{className:"text-xs",children:s.popupLastContactDate}),(0,$.jsx)("span",{children:r})]}):null,h?null:(0,$.jsx)("p",{className:"text-slate-600 text-sm dark:text-slate-300",children:s.popupNoContactMethods})]})]})]}),document.body)}});var pe,yn,Aa=ke(()=>{"use strict";pe=require("react/jsx-runtime"),yn=({fullName:e,title:t="-",companyName:n="-",department:a="-",phoneNumber:s="-",email:o="-",updatedAtText:r="-"})=>(0,pe.jsxs)("div",{className:"flex h-full w-full flex-col justify-center gap-0.5 text-slate-800 text-xs leading-tight transition-colors sm:grid sm:grid-cols-3 sm:gap-2 sm:text-sm xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto] dark:text-slate-200",children:[(0,pe.jsxs)("div",{className:"flex items-center gap-1 sm:hidden",children:[(0,pe.jsx)("div",{className:"flex-1 truncate font-medium text-gray-900 text-sm leading-tight dark:text-slate-100",children:e}),(0,pe.jsx)("div",{className:"shrink-0 whitespace-nowrap text-[11px] text-slate-600 dark:text-slate-300",children:s})]}),(0,pe.jsx)("div",{className:"flex items-center gap-1 sm:hidden",children:(0,pe.jsx)("div",{className:"flex-1 truncate text-slate-700 text-xs leading-tight dark:text-slate-200",children:n})}),(0,pe.jsx)("div",{className:"block sm:hidden",children:(0,pe.jsx)("span",{className:"w-full truncate text-left text-[11px] text-slate-700 leading-tight dark:text-slate-200",children:a})}),(0,pe.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,pe.jsx)("span",{className:"truncate font-medium text-gray-900 dark:text-slate-100",children:e}),(0,pe.jsx)("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:t})]}),(0,pe.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,pe.jsx)("span",{className:"truncate text-slate-800 dark:text-slate-100",children:n}),(0,pe.jsx)("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:a})]}),(0,pe.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,pe.jsx)("span",{className:"truncate text-slate-700 dark:text-slate-200",children:s}),(0,pe.jsx)("span",{className:"truncate text-slate-600 text-xs dark:text-slate-300",children:o})]}),(0,pe.jsx)("div",{className:"hidden items-end justify-end text-[11px] text-slate-600 xl:flex dark:text-slate-300",children:(0,pe.jsx)("span",{className:"truncate",children:r})})]})});var Qn,Jt,Or,Rs,Ls,Es,Os,Dr,_r,Ds,_s,Ws,As,Hs,Is,Fs,zs,Wr,Ar,Lr,Er,Xn,Us,Bs,Ha,Hr,Ia=ke(()=>{"use strict";Qn=require("@aiquants/fuzzy-search"),Jt=require("@aiquants/select-box"),Or=/[​]/g,Rs=/^[\s  ]+|[\s  ]+$/g,Ls=/\s+/,Es=/^[\p{Script=Latin}\s]+$/u,Os=/\p{Script=Latin}/u,Dr=Object.freeze({convertWidth:!0,convertKana:!0,convertCase:!0,convertRomaji:!1,normalizeVariants:!1,ignoreSpaces:!1,ignoreSymbols:!1,ignoreLongVowels:!1}),_r="union",Ds=65377,_s=65439,Ws=["\uFF9E","\uFF9F"],As=(()=>{let e=new Map;for(let t=Ds;t<=_s;t+=1){let n=String.fromCharCode(t);e.set(n.normalize("NFKC"),n);for(let a of Ws){let s=(n+a).normalize("NFKC");s.length===1&&e.set(s,n+a)}}return e})(),Hs=/[぀-ヿ]/u,Is=e=>{let t=Array.from(e,n=>As.get(n)??n).join("");return Hs.test(t)?null:t},Fs=e=>(0,Jt.normalizeText)(e.replace(Or,"").replace(Rs,""),Dr),zs=e=>{if(!Es.test(e))return null;let t=(0,Jt.romajiToKatakana)(e);return Os.test(t)?null:t},Wr=e=>e.split(Ls).filter(Boolean),Ar=e=>(0,Qn.parseQuerySets)(e,_r).sets.map(({query:t})=>t),Lr=e=>Ar(e).flatMap(t=>Wr(t)),Er=e=>(0,Qn.formatQuerySets)({combine:_r,sets:Array.from(new Set(e),t=>({query:t}))}),Xn=e=>{let t=Ar(e.replace(Or,"")).map(a=>Wr(Fs(a)).join(" ")).filter(a=>a!==""),n=[];for(let a of t){let s=zs(a);if(s===null)return Er(t);n.push(s)}return Er(n)},Us=e=>{let t=new Set([...Lr(e),...Lr(Xn(e))]),n=new Set;for(let a of t)for(let s of(0,Jt.getNormalizedVariants)(a,Dr)){let o=s.trim();if(!o)continue;n.add(o);let r=Is(o);r!==null&&n.add(r)}return Array.from(n)},Bs=/[.*+?^${}()|[\]\\]/g,Ha=e=>{let t=Us(e);if(t.length===0)return null;let n=t.map(a=>a.replace(Bs,"\\$&")).sort((a,s)=>s.length-a.length);return new RegExp(n.join("|"),"gi")},Hr=(e,t)=>{let n=Ha(e);if(n===null)return s=>s;let a=s=>t.some(o=>{let r=s[o];return typeof r=="string"&&r.search(n)!==-1});return s=>{let o=[],r=[];for(let c of s)a(c.item)?o.push(c):r.push(c);return[...o,...r]}}});var Ir,nt,$s,fe,Jn=ke(()=>{"use strict";Ir=require("react");Ia();nt=require("react/jsx-runtime"),$s="rounded bg-yellow-200 px-1 text-gray-900 dark:bg-yellow-900 dark:text-yellow-100",fe=(0,Ir.memo)(({text:e,query:t,enabled:n=!0})=>{if(!(n&&t?.trim()&&e))return(0,nt.jsx)(nt.Fragment,{children:e});let a=Ha(t);if(a===null)return(0,nt.jsx)(nt.Fragment,{children:e});let s=[],o=0,r=a.exec(e),c=0;for(;r;){let d=r[0],l=r.index;if(l>o&&s.push(e.substring(o,l)),d.length===0){a.lastIndex++,r=a.exec(e);continue}s.push((0,nt.jsx)("mark",{className:$s,children:d},`highlight-${l}-${c}`)),o=l+d.length,c+=1,r=a.exec(e)}return o<e.length&&s.push(e.substring(o)),(0,nt.jsx)(nt.Fragment,{children:s})});fe.displayName="HighlightedText"});var Fr={};pr(Fr,{ContactDetailGrid:()=>Fa,default:()=>Vs});var ea,gt,Zn,Fa,Vs,zr=ke(()=>{"use strict";ea=require("react");Ct();de();Wa();Aa();Jn();gt=require("react/jsx-runtime"),Zn=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},Fa=({contactData:e,searchTerm:t,enableHighlighting:n,openEmailsWithGmail:a,openGmailCompose:s,isPopupVisible:o,onRequestClose:r})=>{let c=X(),d=(0,ea.useMemo)(()=>Vt(e),[e]),l=(0,ea.useMemo)(()=>Kt(e),[e]),u=d.value??"-",p=l.value??"-",i=(0,ea.useMemo)(()=>Ve(e.updated_at,c.recordDateTime),[e.updated_at,c.recordDateTime]),m=Zn(e.full_name)??c.noName,h=Zn(e.company_name),C=Zn(e.department),T=(S,K="-")=>(0,gt.jsx)(fe,{text:S??K,query:t,enabled:n});return(0,gt.jsxs)(gt.Fragment,{children:[(0,gt.jsx)(yn,{fullName:T(m),title:T(Zn(e.title)),companyName:T(h),department:T(C),phoneNumber:p,email:T(u),updatedAtText:i}),o?(0,gt.jsx)(bn,{contactData:e,openEmailsWithGmail:a,openGmailCompose:s,onRequestClose:r}):null]})},Vs=Fa});var al={};pr(al,{AdvancedSearchSettings:()=>Vn,BasicSearchSettings:()=>Kn,CONTACT_MAP_LABEL_CATALOGS:()=>Ke,CONTACT_MAP_LABEL_KEYS:()=>qt,ContactDetailGrid:()=>Fa,ContactDetailPanel:()=>Nt,ContactDetailPopup:()=>bn,ContactDetailRowLayout:()=>yn,ContactMapAnnotation:()=>aa,ContactMapAppView:()=>tl,ContactMapConfigProvider:()=>io,ContactMapSearchListView:()=>qa,ContactMapSearchPage:()=>sr,ContactMapSearchTabGroup:()=>nr,ContactMapSearchTreeView:()=>tr,ContactMapStreamClient:()=>vn,HighlightedText:()=>fe,IndexWorkerSettings:()=>ua,LIST_COLLAPSE_THRESHOLD:()=>vi,LIST_DETAIL_PANEL_MIN_WIDTH:()=>So,LIST_EXPAND_THRESHOLD:()=>Ci,LIST_PANEL_MIN_WIDTH:()=>ko,LIST_RESIZE_HANDLE_THICKNESS:()=>To,LevenshteinWorkerSettings:()=>ma,Progress:()=>Va,SearchOptionsPanel:()=>ga,StatItem:()=>E,StatisticsPanel:()=>ba,SwipeOverlay:()=>Mn,TREE_COLLAPSE_THRESHOLD:()=>_i,TREE_DETAIL_PANEL_MIN_WIDTH:()=>Vo,TREE_EXPAND_THRESHOLD:()=>Wi,TREE_PANEL_MIN_WIDTH:()=>$o,TREE_RESIZE_HANDLE_THICKNESS:()=>Ko,Tabs:()=>xn,TabsContent:()=>ft,TabsList:()=>Zt,TabsTrigger:()=>ht,TreeWorkerSession:()=>Pn,WorkerStatsSection:()=>Et,assertContactMapStreamEndpoint:()=>Cn,assertContactMapTreeWorkerUrl:()=>Ua,assertContactMapWorkerUrls:()=>Ys,composeTreeVirtualScrollOptions:()=>jo,contactMapShouldRevalidate:()=>nl,countContactMapCompanies:()=>uo,deserializeStreamRecord:()=>lo,getContactMapStreamClient:()=>co,getTreeWorkerSession:()=>Oo,layerContactMapWorkerUrls:()=>Mt,resetContactMapStreamClientForTesting:()=>ni,resetTreeWorkerSessionForTesting:()=>Oi,resolveContactMapLabels:()=>$n,useAnimatedNumber:()=>Qa,useContactMapConfig:()=>qe,useContactMapLabels:()=>X,useContactMapStream:()=>po,useContactPanelSizing:()=>la,useDynamicViewportHeight:()=>Ka,useHorizontalDragScroll:()=>at,useLongPressPopup:()=>wn,useReportPopupVisibility:()=>No,useResponsiveTwoColumnLayout:()=>Nn,useRowPopupRegistry:()=>wo,useStreamedContactMapContext:()=>kn,useTreeWorker:()=>Xa});module.exports=ms(al);var wt=require("@aiquants/fuzzy-search"),mn=require("react");de();var ce=require("react/jsx-runtime"),Vn=(0,mn.memo)(({searchOptions:e,setSearchOptions:t})=>{let n=X(),a="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",s="text-xs font-semibold",o=(0,mn.useId)(),r=(0,mn.useId)(),c=[];return c.push((0,ce.jsxs)("div",{className:`${a} border-sky-200 border-l-4 dark:border-sky-400/60`,children:[(0,ce.jsxs)("div",{className:`${s} text-sky-700 dark:text-sky-300`,children:["\u{1F4D8} ",n.advancedLearningHeading]}),(0,ce.jsx)("label",{htmlFor:o,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.advancedLearningLabel}),(0,ce.jsx)("input",{id:o,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.learningWeight||wt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight,onChange:d=>t(l=>({...l,learningWeight:parseFloat(d.target.value)})),className:"w-full"}),(0,ce.jsxs)("span",{className:"text-sky-600 text-xs dark:text-sky-300",children:[n.currentValueLabel," ",e.learningWeight||wt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight]}),(0,ce.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.advancedLearningHint})]},"learning")),c.push((0,ce.jsxs)("div",{className:`${a} border-indigo-200 border-l-4 dark:border-indigo-400/60`,children:[(0,ce.jsxs)("div",{className:`${s} text-indigo-700 dark:text-indigo-300`,children:["\u23F1\uFE0F ",n.advancedDebounceHeading]}),(0,ce.jsx)("label",{htmlFor:r,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.advancedDebounceLabel}),(0,ce.jsx)("input",{id:r,type:"range",min:"100",max:"1000",step:"50",value:e.debounceMs??wt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs,onChange:d=>t(l=>({...l,debounceMs:parseInt(d.target.value,10)})),className:"w-full"}),(0,ce.jsxs)("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[n.currentValueLabel," ",e.debounceMs??wt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs]}),(0,ce.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.advancedDebounceHint})]},"debounce")),(0,ce.jsxs)("section",{className:"space-y-3",children:[(0,ce.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,ce.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,ce.jsx)("span",{children:"\u26A1"}),(0,ce.jsx)("span",{className:"tracking-wide",children:n.settingsAdvancedTab})]}),(0,ce.jsx)("button",{type:"button",onClick:()=>t(d=>({...d,learningWeight:wt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight,debounceMs:wt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs})),className:"rounded border border-gray-300 bg-gray-100 px-2 py-1 font-medium text-gray-700 text-xs transition-colors hover:bg-gray-200 dark:border-slate-600 dark:bg-slate-800/70 dark:text-slate-200 dark:hover:bg-slate-700/70",title:n.resetToDefaultsTitle,children:n.reset})]}),(0,ce.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:c})]})});Vn.displayName="AdvancedSearchSettings";var ut=require("@aiquants/fuzzy-search"),Pe=require("react");de();var R=require("react/jsx-runtime"),Kn=(0,Pe.memo)(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:s,setOpenEmailsWithGmail:o})=>{let r=X(),c="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",d="text-xs font-semibold",l=(0,Pe.useId)(),u=(0,Pe.useId)(),p=(0,Pe.useId)(),i=(0,Pe.useId)(),m=(0,Pe.useId)(),h=(0,Pe.useId)(),C=(0,Pe.useId)(),T=(0,Pe.useId)(),S=(0,Pe.useId)(),K=(0,Pe.useId)(),V=[];return V.push((0,R.jsxs)("div",{className:`${c} border-blue-200 border-l-4 dark:border-blue-500/50`,children:[(0,R.jsxs)("div",{className:`${d} text-blue-700 dark:text-blue-300`,children:["\u{1F3AF} ",r.basicThresholdHeading]}),(0,R.jsx)("label",{htmlFor:l,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:r.basicThresholdLabel}),(0,R.jsx)("input",{id:l,type:"range",min:"0.0",max:e.sortBy==="relevance"?"1.5":"1.0",step:"0.05",value:e.threshold??ut.DEFAULT_FUZZY_SEARCH_OPTIONS.threshold,onChange:f=>t(g=>({...g,threshold:parseFloat(f.target.value)})),className:"w-full"}),(0,R.jsxs)("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[r.currentValueLabel," ",e.threshold??ut.DEFAULT_FUZZY_SEARCH_OPTIONS.threshold]}),(0,R.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:e.sortBy==="relevance"?r.basicThresholdRangeRelevance:r.basicThresholdRange})]},"threshold")),V.push((0,R.jsxs)("div",{className:`${c} border-amber-200 border-l-4 dark:border-amber-400/60`,children:[(0,R.jsxs)("div",{className:`${d} text-amber-700 dark:text-amber-300`,children:["\u{1FA84} ",r.basicDisplayHeading]}),(0,R.jsxs)("label",{htmlFor:u,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,R.jsx)("input",{id:u,type:"checkbox",checked:e.caseSensitive??ut.DEFAULT_FUZZY_SEARCH_OPTIONS.caseSensitive,onChange:f=>t(g=>({...g,caseSensitive:f.target.checked})),className:"h-3 w-3"}),r.basicCaseSensitive]}),(0,R.jsxs)("label",{htmlFor:p,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,R.jsx)("input",{id:p,type:"checkbox",checked:n,onChange:f=>a(f.target.checked),className:"h-3 w-3"}),r.basicHighlight]}),(0,R.jsxs)("label",{htmlFor:i,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,R.jsx)("input",{id:i,type:"checkbox",checked:s,onChange:f=>o(f.target.checked),className:"h-3 w-3"}),r.basicOpenEmailsWithGmail]}),(0,R.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,R.jsx)("label",{htmlFor:m,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:r.basicMultiTermOperator}),(0,R.jsxs)("select",{id:m,value:e.multiTermOperator??ut.DEFAULT_FUZZY_SEARCH_OPTIONS.multiTermOperator,onChange:f=>t(g=>({...g,multiTermOperator:f.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[(0,R.jsx)("option",{value:"or",children:r.basicOperatorOr}),(0,R.jsx)("option",{value:"and",children:r.basicOperatorAnd})]}),(0,R.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:r.basicMultiTermHint})]})]},"display")),V.push((0,R.jsxs)("div",{className:`${c} border-emerald-200 border-l-4 dark:border-emerald-400/60`,children:[(0,R.jsxs)("div",{className:`${d} text-emerald-700 dark:text-emerald-300`,children:["\u{1F4DA} ",r.basicSortHeading]}),(0,R.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,R.jsx)("label",{htmlFor:h,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:r.basicSortBy}),(0,R.jsxs)("select",{id:h,value:e.sortBy||ut.DEFAULT_FUZZY_SEARCH_OPTIONS.sortBy,onChange:f=>t(g=>({...g,sortBy:f.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[(0,R.jsx)("option",{value:"score",children:r.basicSortByScore}),(0,R.jsx)("option",{value:"relevance",children:r.basicSortByRelevance}),(0,R.jsx)("option",{value:"original",children:r.basicSortByOriginal})]})]}),(0,R.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,R.jsx)("label",{htmlFor:C,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:r.basicSortOrder}),(0,R.jsxs)("select",{id:C,value:e.sortOrder||ut.DEFAULT_FUZZY_SEARCH_OPTIONS.sortOrder,onChange:f=>t(g=>({...g,sortOrder:f.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[(0,R.jsx)("option",{value:"desc",children:r.basicSortDescending}),(0,R.jsx)("option",{value:"asc",children:r.basicSortAscending})]})]})]},"sorting")),V.push((0,R.jsxs)("div",{className:`${c} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[(0,R.jsxs)("div",{className:`${d} text-purple-700 dark:text-purple-300`,children:["\u2699\uFE0F ",r.basicEngineHeading]}),(0,R.jsx)("label",{htmlFor:T,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:r.basicStrategy}),(0,R.jsxs)("select",{id:T,value:e.parallelSearchStrategy||ut.DEFAULT_FUZZY_SEARCH_OPTIONS.parallelSearchStrategy,onChange:f=>t(g=>({...g,parallelSearchStrategy:f.target.value})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[(0,R.jsx)("option",{value:"balanced",children:r.basicStrategyBalanced}),(0,R.jsx)("option",{value:"index-first",children:r.basicStrategyIndexFirst}),(0,R.jsx)("option",{value:"levenshtein-first",children:r.basicStrategyLevenshteinFirst})]}),(0,R.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,R.jsxs)("label",{htmlFor:S,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,R.jsx)("input",{id:S,type:"checkbox",checked:e.enableIndexFiltering!==!1,onChange:f=>t(g=>({...g,enableIndexFiltering:f.target.checked})),className:"h-3 w-3"}),r.basicIndexFiltering]}),(0,R.jsxs)("label",{htmlFor:K,className:"flex items-center gap-2 text-gray-700 text-xs transition-colors dark:text-slate-200",children:[(0,R.jsx)("input",{id:K,type:"checkbox",checked:e.enableLevenshtein!==!1,onChange:f=>t(g=>({...g,enableLevenshtein:f.target.checked})),className:"h-3 w-3"}),r.basicLevenshtein]})]})]},"engine")),(0,R.jsxs)("section",{className:"space-y-3",children:[(0,R.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-blue-700 text-xs transition-colors dark:text-sky-400",children:[(0,R.jsx)("span",{children:"\u{1F527}"}),(0,R.jsx)("span",{className:"tracking-wide",children:r.settingsBasicTab})]}),(0,R.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:V})]})});Kn.displayName="BasicSearchSettings";var Vr=require("@aiquants/swipe-overlay"),Kr=le(require("lucide-react/dist/esm/icons/badge-check.js")),jr=le(require("lucide-react/dist/esm/icons/building-2.js")),Gr=le(require("lucide-react/dist/esm/icons/calendar-clock.js")),qr=le(require("lucide-react/dist/esm/icons/check.js")),Yr=le(require("lucide-react/dist/esm/icons/copy.js")),Qr=le(require("lucide-react/dist/esm/icons/id-card.js")),Xr=le(require("lucide-react/dist/esm/icons/mail.js")),Jr=le(require("lucide-react/dist/esm/icons/phone.js")),Zr=le(require("lucide-react/dist/esm/icons/user-round.js")),Le=require("react");Ct();var Ge={info:(e,...t)=>console.info(`[contact-map] ${e}`,...t),warn:(e,...t)=>console.warn(`[contact-map] ${e}`,...t),error:(e,...t)=>console.error(`[contact-map] ${e}`,...t)};de();var Ue=le(require("@radix-ui/react-tabs")),ta=le(require("react"));hn();var na=require("react/jsx-runtime"),xn=Ue.Root,Zt=ta.forwardRef(({className:e,...t},n)=>(0,na.jsx)(Ue.List,{ref:n,className:xe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Zt.displayName=Ue.List.displayName;var ht=ta.forwardRef(({className:e,...t},n)=>(0,na.jsx)(Ue.Trigger,{ref:n,className:xe("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm ring-offset-background transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-2xs",e),...t}));ht.displayName=Ue.Trigger.displayName;var ft=ta.forwardRef(({className:e,...t},n)=>(0,na.jsx)(Ue.Content,{ref:n,className:xe("mt-2 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=inactive]:hidden",e),...t}));ft.displayName=Ue.Content.displayName;gn();Jn();var k=require("react/jsx-runtime"),Ur="truncate font-semibold text-slate-900 text-xs dark:text-slate-100",Br={height:"var(--contact-panel-height, 100%)",maxHeight:"100%"},Ks=({icon:e,label:t,value:n,fieldKey:a,copyValue:s,onCopy:o,isCopied:r,linkHref:c,searchTerm:d,enableHighlighting:l})=>{let u=X(),p=!!(o&&a&&s),i=c?.startsWith("https://mail.google.com")?"_blank":void 0;return(0,k.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-slate-200 bg-slate-50 px-2.5 py-1.5 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[(0,k.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,k.jsx)("div",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-white text-slate-500 transition-colors dark:bg-slate-800 dark:text-slate-200",children:(0,k.jsx)(e,{size:14})}),(0,k.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,k.jsx)("div",{className:"font-medium text-[10px] text-slate-600 dark:text-slate-300",children:t}),c?(0,k.jsx)("a",{href:c,className:`inline-block max-w-full align-top ${Ur} ${Yt}`,target:i,rel:i?"noopener noreferrer":void 0,children:(0,k.jsx)(fe,{text:n,query:d??"",enabled:l})}):(0,k.jsx)("div",{className:Ur,children:(0,k.jsx)(fe,{text:n,query:d??"",enabled:l})})]})]}),p?(0,k.jsx)("button",{type:"button",onClick:()=>o&&a&&s&&o(a,s,t),className:`inline-flex h-6 pointer-coarse:h-11 pointer-coarse:w-11 w-6 shrink-0 touch-manipulation items-center justify-center rounded-full border border-slate-200 bg-white text-slate-500 transition-colors hover:border-blue-400 hover:text-blue-500 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:border-blue-400 dark:hover:text-blue-300 ${mt}`,"aria-label":u.copyField(t),children:r?(0,k.jsx)(qr.default,{size:14}):(0,k.jsx)(Yr.default,{size:14})}):null]})},$r=({items:e,searchTerm:t,enableHighlighting:n})=>(0,k.jsx)("dl",{className:"grid grid-cols-1 gap-x-3 gap-y-1.5 sm:grid-cols-2",children:e.map(a=>(0,k.jsxs)("div",{className:"flex flex-col gap-0.5 rounded-md border border-slate-200 bg-white/60 px-2 py-1 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[(0,k.jsx)("dt",{className:"font-semibold text-[10px] text-slate-600 uppercase tracking-wide dark:text-slate-300",children:a.label}),(0,k.jsx)("dd",{className:"wrap-break-word text-slate-900 text-xs dark:text-slate-100",children:(0,k.jsx)(fe,{text:a.value,query:t??"",enabled:n})})]},a.fieldKey))}),za=({title:e})=>(0,k.jsx)("h3",{className:"font-semibold text-slate-700 text-xs dark:text-slate-200",children:e}),js=()=>{let e=X();return(0,k.jsxs)("div",{className:"flex h-full min-h-40 w-full flex-1 flex-col items-center justify-center gap-2 rounded-xl border border-slate-300 border-dashed bg-white/60 p-4 text-center transition-colors dark:border-slate-700 dark:bg-slate-900/40",children:[(0,k.jsx)("p",{className:"font-medium text-slate-600 text-xs dark:text-slate-200",children:e.detailEmptyTitle}),(0,k.jsx)("p",{className:"text-[11px] text-slate-600 dark:text-slate-300",children:e.detailEmptyHint})]})},Gs=Object.freeze({overlay:Vr.SWIPE_OVERLAY_SCROLL_AREA_STYLE,pane:void 0}),Nt=({contact:e,placement:t,searchTerm:n,enableHighlighting:a,style:s,className:o=""})=>{let r=X(),[c,d]=(0,Le.useState)(null),l=(0,Le.useRef)(null),u=(0,Le.useMemo)(()=>({...Br,...s}),[s]);(0,Le.useEffect)(()=>()=>{l.current!==null&&window.clearTimeout(l.current)},[]);let p=(0,Le.useMemo)(()=>Vt(e),[e]),i=(0,Le.useMemo)(()=>Kt(e),[e]),m=(0,Le.useMemo)(()=>Ve(e?.contacted_at,r.recordDateTime),[e?.contacted_at,r.recordDateTime]),h=(0,Le.useCallback)(async(b,N,Z)=>{try{await navigator.clipboard.writeText(N),d(b),l.current!==null&&window.clearTimeout(l.current),l.current=window.setTimeout(()=>{d(null)},2e3)}catch(U){Ge.error("Failed to copy contact detail",U)}},[]);if(!e)return(0,k.jsx)("div",{className:"flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950",style:Br,children:(0,k.jsx)(js,{})});let C=[J(e.title),J(e.department)].filter(b=>b!=="-"),T=[C.join(" / "),J(e.company_name)].filter(b=>b&&b!=="-").join(" \u30FB ")||"-",S=ze(e.full_name)??r.noName,K=[{fieldKey:"full_name",label:r.fieldFullName,value:S},{fieldKey:"full_name_reading",label:r.fieldFullNameReading,value:J(e.full_name_reading)},{fieldKey:"title",label:r.fieldTitle,value:J(e.title)},{fieldKey:"department",label:r.fieldDepartment,value:J(e.department)},{fieldKey:"company_name",label:r.fieldCompanyName,value:J(e.company_name)},{fieldKey:"company_name_reading",label:r.fieldCompanyNameReading,value:J(e.company_name_reading)},{fieldKey:"address",label:r.fieldAddress,value:J(e.address)},{fieldKey:"postal_code",label:r.fieldPostalCode,value:J(e.postal_code)},{fieldKey:"url",label:r.fieldUrl,value:J(e.url)}],V=[{label:r.fieldCustomEmail,value:J(e.custom_email),fieldKey:"custom_email",rawValue:e.custom_email},{label:r.fieldEmail,value:J(e.email),fieldKey:"email",rawValue:e.email}].filter(b=>b.value!=="-"),f=[{label:r.fieldCustomMobilePhone,value:J(e.custom_mobile_phone_number),fieldKey:"custom_mobile_phone_number",rawValue:e.custom_mobile_phone_number},{label:r.fieldMobilePhone,value:J(e.mobile_phone_number),fieldKey:"mobile_phone_number",rawValue:e.mobile_phone_number},{label:r.fieldCompanyPhone,value:J(e.company_phone_number),fieldKey:"company_phone_number",rawValue:e.company_phone_number},{label:r.fieldCompanyFax,value:J(e.company_fax_number),fieldKey:"company_fax_number",rawValue:e.company_fax_number}].filter(b=>b.value!=="-"),g=[{fieldKey:"person_id",label:"person_id",value:J(e.person_id)},{fieldKey:"person_id_redirect_to",label:"person_id_redirect_to",value:J(e.person_id_redirect_to)},{fieldKey:"is_active",label:"is_active",value:J(e.is_active)},{fieldKey:"is_contact_synced",label:"is_contact_synced",value:J(e.is_contact_synced)},{fieldKey:"is_incomplete",label:"is_incomplete",value:J(e.is_incomplete)},{fieldKey:"is_in_eight",label:"is_in_eight",value:J(e.is_in_eight)},{fieldKey:"created_by",label:r.fieldCreatedBy,value:J(e.created_by)},{fieldKey:"created_at",label:r.fieldCreatedAt,value:Ve(e.created_at,r.recordDateTime)},{fieldKey:"updated_by",label:r.fieldUpdatedBy,value:J(e.updated_by)},{fieldKey:"updated_at",label:r.fieldUpdatedAt,value:Ve(e.updated_at,r.recordDateTime)}],v=[{rowKey:"person_id",icon:Qr.default,label:"person_id",value:J(e.person_id),fieldKey:"person_id",copyValue:String(e.person_id)},{rowKey:"primary_email",icon:Xr.default,label:r.summaryEmail,value:p.value??"-",fieldKey:"primary_email",copyValue:p.value,linkHref:et(p.value,!1)},{rowKey:"primary_phone",icon:Jr.default,label:r.summaryPhone,value:i.value??"-",fieldKey:"primary_phone",copyValue:i.value,linkHref:un(i.value)},{rowKey:"contacted_at",icon:Gr.default,label:r.summaryLastContact,value:m}],M=[{sectionKey:"email",title:r.sectionEmail,emptyText:r.sectionEmailEmpty,entries:V,recommendedKey:p.fieldKey??null,resolveHref:b=>et(b!=null?String(b):null,!1)},{sectionKey:"phone",title:r.sectionPhone,emptyText:r.sectionPhoneEmpty,entries:f,recommendedKey:i.fieldKey??null,resolveHref:b=>un(b!=null?String(b):null)}],z=[{value:"summary",label:r.detailTabSummary,content:(0,k.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,k.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,k.jsxs)("div",{className:"flex items-center gap-2 text-slate-600 text-sm dark:text-slate-300",children:[(0,k.jsx)(jr.default,{size:16}),(0,k.jsx)("span",{children:(0,k.jsx)(fe,{text:J(e.company_name),query:n??"",enabled:a})})]}),C.length>0?(0,k.jsx)("div",{className:"text-slate-600 text-sm dark:text-slate-300",children:C.map((b,N)=>(0,k.jsxs)("span",{children:[N>0&&" / ",(0,k.jsx)(fe,{text:b,query:n??"",enabled:a})]},`header-line-${N}`))}):null]}),(0,k.jsx)("div",{className:"flex flex-col gap-3",children:v.map(b=>(0,k.jsx)(Ks,{icon:b.icon,label:b.label,value:b.value,fieldKey:b.fieldKey,copyValue:b.copyValue,onCopy:h,isCopied:b.fieldKey?c===b.fieldKey:!1,linkHref:b.linkHref,searchTerm:n,enableHighlighting:a},b.rowKey))})]})},{value:"basic",label:r.detailTabBasic,content:(0,k.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,k.jsx)(za,{title:r.detailBasicProfile}),(0,k.jsx)($r,{items:K,searchTerm:n,enableHighlighting:a})]})},{value:"contact",label:r.detailTabContact,content:(0,k.jsx)("div",{className:"flex flex-col gap-4",children:M.map(({sectionKey:b,title:N,emptyText:Z,entries:U,recommendedKey:me,resolveHref:ee})=>(0,k.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,k.jsx)(za,{title:N}),U.length===0?(0,k.jsx)("p",{className:"text-slate-600 text-xs dark:text-slate-300",children:Z}):(0,k.jsx)("div",{className:"flex flex-col gap-2",children:U.map(I=>{let H=ee(I.rawValue),G=I.fieldKey===me;return(0,k.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-slate-200 bg-white px-3 py-2 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:[(0,k.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,k.jsx)("div",{className:"font-medium text-slate-600 text-xs dark:text-slate-300",children:I.label}),(0,k.jsx)("div",{className:"wrap-break-word text-slate-900 text-sm dark:text-slate-100",children:H?(0,k.jsx)("a",{href:H,className:`pointer-coarse:inline-block text-inherit ${Yt}`,children:(0,k.jsx)(fe,{text:I.value,query:n??"",enabled:a})}):(0,k.jsx)(fe,{text:I.value,query:n??"",enabled:a})})]}),G?(0,k.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-emerald-100 px-2 py-0.5 font-semibold text-[11px] text-emerald-900 transition-colors dark:bg-emerald-300/20 dark:text-emerald-200",children:[(0,k.jsx)(Kr.default,{size:14}),r.preferred]}):null]},I.fieldKey)})})]},b))})},{value:"meta",label:r.detailTabMeta,content:(0,k.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,k.jsx)(za,{title:r.detailTabMeta}),(0,k.jsx)($r,{items:g,searchTerm:n,enableHighlighting:a})]})}];return(0,k.jsxs)("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950 ${o}`.trim(),style:u,children:[(0,k.jsx)("div",{className:"border-slate-200 border-b px-3 py-1.5 transition-colors dark:border-slate-700 dark:bg-slate-900/50",children:(0,k.jsxs)("div",{className:"flex items-center gap-2",children:[(0,k.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-blue-50 text-blue-600 transition-colors dark:bg-sky-900/40 dark:text-sky-300",children:(0,k.jsx)(Zr.default,{size:16})}),(0,k.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,k.jsx)("div",{className:"truncate font-semibold text-slate-900 text-sm dark:text-slate-100",children:(0,k.jsx)(fe,{text:S,query:n??"",enabled:a})}),(0,k.jsx)("div",{className:"truncate text-[11px] text-slate-600 dark:text-slate-300",children:(0,k.jsx)(fe,{text:T,query:n??"",enabled:a})})]})]})}),(0,k.jsxs)(xn,{defaultValue:"summary",className:"flex flex-1 flex-col overflow-hidden",children:[(0,k.jsx)(Zt,{className:"grid h-auto grid-cols-4 gap-1 rounded-none border-slate-200 border-b bg-slate-50 px-2 py-1 transition-colors dark:border-slate-700 dark:bg-slate-900/60",children:z.map(b=>(0,k.jsx)(ht,{value:b.value,className:"flex min-h-6 pointer-coarse:min-h-11 min-w-0 touch-manipulation rounded-md px-1 py-1 font-semibold text-slate-700 text-xs transition-colors data-[state=active]:bg-white data-[state=active]:text-blue-800 dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-sky-300",children:(0,k.jsx)("span",{className:"min-w-0 truncate",children:b.label})},b.value))}),z.map(b=>(0,k.jsx)(ft,{value:b.value,className:"scrollbar-thin flex-1 overflow-y-auto px-2.5 py-2 transition-colors dark:text-slate-200",style:Gs[t],children:b.content},b.value))]})]})};var eo=require("react");Tt();de();var ve=require("react/jsx-runtime"),aa=(0,eo.memo)(({recordCount:e,companyCount:t,phase:n,loadedCount:a,totalCount:s,errorMessage:o,onRetry:r})=>{let{locale:c,labels:d}=Te(),l=Q(c,e),u=Q(c,t);return(0,ve.jsxs)("div",{"data-testid":"contact-map-annotation",className:"flex flex-wrap items-center gap-2 leading-1 transition-colors",role:"status",children:[(0,ve.jsxs)("span",{className:"flex items-baseline gap-1",children:[(0,ve.jsx)("span",{className:"text-slate-600 dark:text-slate-300",children:d.annotationTotalLabel}),(0,ve.jsx)("span",{className:"text-slate-800 dark:text-slate-200","data-testid":"contact-map-record-count",children:l}),(0,ve.jsx)("span",{className:"text-slate-600 dark:text-slate-300",children:d.recordUnit(l)})]}),(0,ve.jsxs)("span",{className:"flex items-baseline gap-1",children:[(0,ve.jsx)("span",{className:"text-slate-600 dark:text-slate-300",children:d.annotationCompaniesLabel}),(0,ve.jsx)("span",{className:"text-slate-800 dark:text-slate-200","data-testid":"contact-map-company-count",children:u}),(0,ve.jsx)("span",{className:"text-slate-600 dark:text-slate-300",children:d.companyUnit(u)})]}),n==="streaming"||n==="idle"?(0,ve.jsx)("span",{"data-testid":"contact-map-stream-badge",className:"ml-2 inline-flex items-center gap-1.5 rounded-full bg-blue-50 px-2 py-0.5 font-medium text-blue-700 text-xs dark:bg-blue-900/30 dark:text-blue-300",children:s!==null&&s>0?d.annotationStreamingProgress({loaded:a,total:s,percent:Math.min(100,Math.round(a/s*100))}):d.annotationStreamingCount(a)}):null,n==="retrying"?(0,ve.jsx)("span",{"data-testid":"contact-map-reconnecting-badge",className:"ml-2 inline-flex items-center gap-1.5 rounded-full bg-amber-50 px-2 py-0.5 font-medium text-amber-900 text-xs dark:bg-amber-900/30 dark:text-amber-200",children:d.annotationReconnecting(a)}):null,n==="failed"||n==="auth-required"?(0,ve.jsxs)("span",{"data-testid":"contact-map-error-badge",className:"ml-2 inline-flex items-center gap-1.5 rounded-full bg-rose-50 px-2 py-0.5 font-medium text-rose-700 text-xs dark:bg-rose-900/30 dark:text-rose-300",title:n==="failed"?o??void 0:void 0,children:["\u26D4 ",n==="auth-required"?d.annotationAuthRequired:d.annotationLoadFailed(a),r?(0,ve.jsx)("button",{type:"button","data-testid":"contact-map-retry-button",onClick:r,className:"rounded border border-rose-300 bg-white px-1.5 py-0.5 font-semibold text-rose-700 transition-colors hover:bg-rose-100 dark:border-rose-700 dark:bg-rose-950 dark:text-rose-200 dark:hover:bg-rose-900",children:d.annotationRetry}):null]}):null]})});aa.displayName="ContactMapAnnotation";var ir=require("react");Gt();var en=require("react");kt();Gt();de();kt();Gt();Na();var qs=["indexWorker","levenshteinWorker","treeWorker"];function to(e,t,n){if(n!==void 0){if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string or left out (pass url.href for a URL object); got ${te(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${te(n)}`)}}var no={setting:"workerUrls"},ao=(e,t)=>{if(e===void 0)return;let{setting:n,keys:a=qs,hints:s={}}=t;if(!jt(e))throw new TypeError(`[contact-map] ${n} must be a plain object or left out; got ${te(e)}`);let o=Object.getOwnPropertyNames(e).map(d=>({key:d,url:e[d]})),r=o.find(({key:d,url:l})=>l!==void 0&&!a.includes(d));if(r!==void 0){let d=Object.hasOwn(s,r.key)?s[r.key]:void 0,l=d===void 0?zn(r.key,a):void 0;throw new RangeError(`[contact-map] ${n} has a key it does not take (it takes ${a.join(", ")}${d===void 0?"":`; ${d}`}${l===void 0?"":`; did you mean ${JSON.stringify(l)}?`}); got ${te(r.key)}`)}let c=Object.create(null);for(let{key:d,url:l}of o){let u=d;to(n,u,l),l!==void 0&&(c[u]=l)}return c};function Ys(e,t=no){ao(e,t)}function Ua(e){to("workerUrls","treeWorker",e)}var Mt=(e,t,n=no)=>{let a=ao(t,n);return{indexWorker:a?.indexWorker===void 0?e?.indexWorker:a.indexWorker,levenshteinWorker:a?.levenshteinWorker===void 0?e?.levenshteinWorker:a.levenshteinWorker,treeWorker:a?.treeWorker===void 0?e?.treeWorker:a.treeWorker}};var ra=require("react/jsx-runtime"),ro=e=>{if(!jt(e))throw new TypeError(`[contact-map] config must be a plain object; got ${te(e)}`);let t=e;return{streamEndpoint:Se(t,"streamEndpoint"),openEmailsWithGmail:Se(t,"openEmailsWithGmail"),treeWorkerFactory:Se(t,"treeWorkerFactory"),workerUrls:Mt(void 0,Se(t,"workerUrls")),locale:Se(t,"locale"),labels:Se(t,"labels")}},oo=({workerUrls:e,...t})=>{let{indexWorker:n,levenshteinWorker:a,treeWorker:s}=e;return Object.freeze(Object.assign(Object.create(null),t,{workerUrls:Object.freeze({indexWorker:n,levenshteinWorker:a,treeWorker:s})}))},Qs=oo(ro({})),so=(0,en.createContext)(Qs),Xs=Object.freeze({locale:"locale",labels:"labels"});function Ba({config:e,chromeSurface:t,children:n}){let{streamEndpoint:a,openEmailsWithGmail:s,treeWorkerFactory:o,workerUrls:r,locale:c,labels:d}=ro(e),{indexWorker:l,levenshteinWorker:u,treeWorker:p}=r,i=(0,en.useMemo)(()=>oo({streamEndpoint:a,openEmailsWithGmail:s,treeWorkerFactory:o,workerUrls:{indexWorker:l,levenshteinWorker:u,treeWorker:p},locale:c,labels:d}),[a,s,o,l,u,p,c,d]);return(0,ra.jsx)(so.Provider,{value:i,children:(0,ra.jsx)(vr,{locale:c,labels:d,surface:t,children:n})})}function io({config:e,children:t}){return(0,ra.jsx)(Ba,{config:e,chromeSurface:Xs,children:t})}function qe(){return(0,en.useContext)(so)}var we=require("react");kt();var Js=1e3,Zs=3e4,ei=6;function Cn(e){if(typeof e!="string")throw new TypeError(`[contact-map] streamEndpoint must be a same-origin absolute path such as "/api/contact_map/stream", set on ContactMapConfigProvider or ContactMapAppView; got ${te(e)}`);if(/[\s\p{Cc}#]/u.test(e))throw new RangeError(`[contact-map] streamEndpoint must not contain whitespace, control characters or "#"; got ${te(e)}`);if(!e.startsWith("/")||e.startsWith("//")||e.startsWith("/\\"))throw new RangeError(`[contact-map] streamEndpoint must be a same-origin absolute path such as "/api/contact_map/stream"; got ${te(e)}`)}var lo=e=>({...e,contacted_at:e.contacted_at?new Date(e.contacted_at):null,created_at:e.created_at?new Date(e.created_at):void 0,updated_at:e.updated_at?new Date(e.updated_at):void 0}),ti=e=>Array.isArray(e.records),vn=class{constructor(t){this.recordMap=new Map;this.listeners=new Set;this.lastCursor=null;this.consecutiveFailures=0;this.started=!1;this.disposed=!1;this.activeController=null;this.wakeRetryWait=null;this.state={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null};this.handleOnline=()=>{this.wakeRetryWait?.()};Cn(t.endpoint),this.fetchFn=t.fetchFn??((...n)=>fetch(...n)),this.endpoint=t.endpoint,this.initialRetryDelayMs=t.initialRetryDelayMs??Js,this.maxRetryDelayMs=t.maxRetryDelayMs??Zs,this.maxConsecutiveFailures=t.maxConsecutiveFailures??ei,this.logger=t.logger??Ge}getState(){return this.state}getRecordMap(){return this.recordMap}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}start(){this.started||this.disposed||(this.started=!0,typeof window<"u"&&window.addEventListener("online",this.handleOnline),this.runStreamLoop())}retryNow(){if(!this.disposed)switch(this.state.phase){case"retrying":this.wakeRetryWait?.();return;case"failed":case"auth-required":this.consecutiveFailures=0,this.setState({error:null,isLoading:this.recordMap.size===0}),this.runStreamLoop();return;case"idle":case"streaming":case"complete":return}}dispose(){this.disposed=!0,this.activeController?.abort(),this.wakeRetryWait?.(),typeof window<"u"&&window.removeEventListener("online",this.handleOnline)}setState(t){this.state={...this.state,...t};for(let n of this.listeners)n(this.state)}publishRecords(t={}){let n=Array.from(this.recordMap.values());this.setState({records:n,loadedCount:n.length,isLoading:!1,...t})}async runStreamLoop(){this.setState({phase:"streaming"});let t=!1;for(;!this.disposed;){let n=this.lastCursor!==null,a=await this.streamOnce();if(a==="aborted")return;if(a==="complete"){this.publishRecords({isComplete:!0,phase:"complete",error:null});return}if(a==="auth-required"){this.setState({phase:"auth-required",isLoading:!1,error:new Error("Authentication required")});return}if(a==="rejected"){if(n&&!t){t=!0,this.lastCursor=null,this.logger.warn("[ContactMapStream] the server rejected the resume cursor (400); restarting from the beginning");continue}this.setState({phase:"failed",isLoading:!1,error:new Error("[contact-map] the server rejected the stream request (400); reload the page")});return}if(this.consecutiveFailures+=1,this.consecutiveFailures>=this.maxConsecutiveFailures){this.setState({phase:"failed",isLoading:!1});return}let s=Math.min(this.initialRetryDelayMs*2**(this.consecutiveFailures-1),this.maxRetryDelayMs);if(this.setState({phase:"retrying",isLoading:this.recordMap.size===0}),this.logger.warn(`[ContactMapStream] retrying in ${s}ms (attempt ${this.consecutiveFailures})`),await this.waitBeforeRetry(s),this.disposed)return;this.setState({phase:"streaming"})}}waitBeforeRetry(t){return new Promise(n=>{let a=setTimeout(()=>{this.wakeRetryWait=null,n()},t);this.wakeRetryWait=()=>{clearTimeout(a),this.wakeRetryWait=null,n()}})}buildStreamUrl(){if(!this.lastCursor)return this.endpoint;let t=this.endpoint.includes("?")?"&":"?",n=new URLSearchParams;return this.lastCursor.contacted_at!==null&&n.set("cursor_contacted_at",this.lastCursor.contacted_at),n.set("cursor_person_id",String(this.lastCursor.person_id)),`${this.endpoint}${t}${n.toString()}`}async streamOnce(){this.activeController=new AbortController;try{let t=await this.fetchFn(this.buildStreamUrl(),{signal:this.activeController.signal,credentials:"same-origin"});if(t.status===401||t.status===403)return"auth-required";if(t.status===400)return"rejected";if(!(t.ok&&t.body))return this.logger.warn(`[ContactMapStream] unexpected response: ${t.status}`),this.setState({error:new Error(`[contact-map] the stream request failed (status ${t.status})`)}),"retryable";let n=t.body.getReader(),a=new TextDecoder,s="",o=!1,r=!1;for(;;){let{done:c,value:d}=await n.read();if(c)break;let l=a.decode(d,{stream:!0}),u=(s+l).split(`
2
+ `);s=u.pop()??"";let p=!1;for(let i of u){let m=i.trim();if(!m)continue;let h;try{h=JSON.parse(m)}catch(C){this.logger.warn("[ContactMapStream] failed to parse NDJSON line:",C);continue}if("type"in h&&h.type==="METADATA"){Number.isSafeInteger(h.total)&&h.total>=0&&this.setState({totalCount:h.total});continue}if(!ti(h)){this.logger.warn("[ContactMapStream] server reported error:","error"in h?h.error:""),r=!0;continue}for(let C of h.records)C&&typeof C.person_id=="number"&&(this.recordMap.set(C.person_id,lo(C)),p=!0);h.nextCursor&&(this.lastCursor=h.nextCursor),h.isLast&&(o=!0)}p&&(this.consecutiveFailures=0,this.publishRecords({error:null}))}return r?(this.setState({error:new Error("Stream interrupted by server error")}),"retryable"):o?"complete":(this.setState({error:new Error("Stream ended before completion")}),"retryable")}catch(t){if(t instanceof Error&&t.name==="AbortError")return"aborted";let n=t instanceof Error?t:new Error(String(t));return this.setState({error:n}),"retryable"}finally{this.activeController=null}}};var Be=null,co=e=>{if(Be!==null&&Be.endpoint===e)return Be;if(Cn(e),Be===null)return Be=new vn({endpoint:e}),Be;if(Be.endpoint!==e)throw new Error(`[contact-map] the stream client already streams from ${JSON.stringify(Be.endpoint)} and cannot also stream from ${JSON.stringify(e)}; give every contact-map view in the browser tab the same streamEndpoint, on every route (after changing it, reload the page)`);return Be},ni=()=>{Be?.dispose(),Be=null},ai=new Map,ri={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null},oi=()=>{let{streamEndpoint:e}=qe();return(0,we.useMemo)(()=>(Cn(e),e),[e])};function po(){let e=oi(),t=(0,we.useCallback)(()=>co(e),[e]);(0,we.useEffect)(()=>{let r=t();r.start(),r.retryNow()},[t]);let n=(0,we.useCallback)(r=>t().subscribe(r),[t]),a=(0,we.useSyncExternalStore)(n,()=>t().getState(),()=>ri),s=(0,we.useSyncExternalStore)(n,()=>t().getRecordMap(),()=>ai),o=(0,we.useCallback)(()=>t().retryNow(),[t]);return(0,we.useMemo)(()=>({...a,recordMap:s,retryNow:o}),[a,s,o])}var uo=e=>{let t=new Set;for(let{company_name:n}of e)typeof n=="string"&&n.trim().length>0&&t.add(n);return t.size};function kn(){let{records:e,recordMap:t,isComplete:n,phase:a,loadedCount:s,totalCount:o,error:r,retryNow:c}=po(),d=(0,we.useMemo)(()=>uo(e),[e]);return{context:(0,we.useMemo)(()=>({contactMapRecords:e,contactMapRecordMap:t,isStreamingComplete:n,isStreamingFailed:a==="failed",streamPhase:a,loadedCount:s,companyCount:d,totalCount:o,errorMessage:r?.message??null}),[e,t,n,a,s,d,o,r]),retryNow:c}}de();var xa=require("@aiquants/fuzzy-search"),as=require("@aiquants/fuzzy-search/react"),rs=le(require("lucide-react/dist/esm/icons/search.js")),B=require("react"),va=require("react-router");Ia();Gt();var Ee=require("react"),at=e=>{let t=(0,Ee.useRef)(null),n=(0,Ee.useRef)({isPointerDown:!1,isDragging:!1,startX:0,scrollLeft:0,pointerId:0,hasCapture:!1,didDrag:!1,pointerType:""}),a=e?.dragThreshold??4,s=(0,Ee.useCallback)(p=>{let i=p.currentTarget,m=p.deltaY;!i||m===0||(p.preventDefault(),i.scrollBy({left:m,behavior:"smooth"}))},[]),o=(0,Ee.useCallback)(p=>{t.current?.removeEventListener("wheel",s),t.current=p,p?.addEventListener("wheel",s,{passive:!1})},[s]);(0,Ee.useEffect)(()=>()=>{t.current&&t.current.removeEventListener("wheel",s)},[s]);let r=(0,Ee.useCallback)(p=>{if(p.pointerType==="touch")return;let i=n.current;i.isPointerDown=!0,i.isDragging=!1,i.startX=p.clientX,i.scrollLeft=p.currentTarget.scrollLeft,i.pointerId=p.pointerId,i.hasCapture=!1,i.pointerType=p.pointerType},[]),c=(0,Ee.useCallback)(p=>{let i=n.current;if(!i.isPointerDown||i.pointerType==="touch")return;let m=p.currentTarget,h=p.clientX-i.startX;!i.isDragging&&Math.abs(h)>a&&(i.isDragging=!0,i.hasCapture||(m.setPointerCapture?.(p.pointerId),i.hasCapture=!0)),i.isDragging&&(p.preventDefault(),m.scrollLeft=i.scrollLeft-h)},[a]),d=(0,Ee.useCallback)(p=>{let i=n.current;if(i.pointerType==="touch")return;let m=p.currentTarget;i.isPointerDown&&i.hasCapture&&m.hasPointerCapture?.(p.pointerId)&&m.releasePointerCapture(p.pointerId),i.isDragging&&(i.didDrag=!0,window.setTimeout(()=>{i.didDrag=!1},0)),i.isPointerDown=!1,i.isDragging=!1,i.pointerId=0,i.hasCapture=!1},[]),l=(0,Ee.useCallback)(p=>{d(p)},[d]),u=(0,Ee.useCallback)(p=>{n.current.didDrag&&(p.preventDefault(),p.stopPropagation(),n.current.didDrag=!1)},[]);return{setScrollableRef:o,onPointerDown:r,onPointerMove:c,onPointerUp:l,onPointerLeave:l,onPointerCancel:l,onClickCapture:u}};Tt();de();var mo=require("@aiquants/fuzzy-search"),oa=e=>{let{indexWorkerOptions:t,levenshteinWorkerOptions:n,...a}=mo.DEFAULT_FUZZY_SEARCH_OPTIONS;return{...a,autoSearchOnIndexRebuild:!1,multiTermOperator:"and",workerUrls:e,indexWorkerOptions:{...t},levenshteinWorkerOptions:{...n}}};hn();var $a=require("react/jsx-runtime");function Va({value:e,max:t=100,className:n,indicatorClassName:a,...s}){let o=e===void 0,r=o?0:Math.min(100,Math.max(0,e/t*100));return(0,$a.jsx)("div",{role:"progressbar","aria-valuenow":o?void 0:r,"aria-valuemin":0,"aria-valuemax":100,"data-slot":"progress",className:xe("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",n),...s,children:(0,$a.jsx)("div",{"data-slot":"progress-indicator",className:xe("h-full rounded-full bg-primary transition-[width] duration-300 ease-in-out will-change-transform",o&&"w-1/3 animate-progress-indeterminate",a),style:o?void 0:{width:`${r}%`}})})}var tn="view";var pa=require("react"),Yo=require("react-router");de();var Pt=require("@aiquants/resize-panels"),rn=require("@aiquants/virtualscroll"),D=require("react");Ct();var Sn={listPanelMinWidth:320,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35},Tn={listPanelMinWidth:280,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35};function sa(e){let t=e.listPanelMinWidth+e.detailPanelMinWidth+e.handleThickness+e.listPaddingAndBorder+e.detailPaddingAndBorder,n=t+e.scrollbarSafetyBuffer,a=n+e.hysteresisSafetyMargin,s=a-n;return{physicalMinWidth:t,collapseThreshold:n,expandThreshold:a,hysteresisWidth:s}}var nn=require("react"),Ka=(e,t)=>{let{enableMutationObserver:n=!1,bottomGap:a=4,minFallbackHeight:s=240}=t??{},[o,r]=(0,nn.useState)(600),c=(0,nn.useCallback)(()=>{if(typeof window>"u")return;let d=e.current;if(!d||d.offsetParent===null&&window.getComputedStyle(d).position!=="fixed")return;let l=N=>Number.parseFloat(N)||0,{top:u}=d.getBoundingClientRect(),p=d.parentElement?.getBoundingClientRect(),i=window.getComputedStyle(document.documentElement),m=l(i.getPropertyValue("--footer-height")),h=l(i.getPropertyValue("--header-height")),C=l(i.getPropertyValue("--scrollbar-height")),T=window.getComputedStyle(d),S=l(T.marginBottom),K=l(T.paddingBottom),V=window.innerHeight-m-C-a,f=p?Math.min(p.bottom,V):V,g=p?Math.max(p.top,h):h,v=Math.max(u,g),M=f-v-S-K,z=Number.isFinite(M)?Math.floor(M):0,b=z>0?z:s;b>0&&Number.isFinite(b)&&r(N=>Math.abs(N-b)>1?b:N)},[a,e,s]);return(0,nn.useEffect)(()=>{if(typeof window>"u")return;let d=null,l=null,u=null,p=null,i=()=>{d!==null&&window.cancelAnimationFrame(d),d=window.requestAnimationFrame(()=>{c()})};i(),l=window.setTimeout(()=>{i()},150);let m=e.current;return typeof ResizeObserver<"u"&&m&&(u=new ResizeObserver(()=>{i()}),u.observe(m),m.parentElement&&u.observe(m.parentElement)),n&&typeof MutationObserver<"u"&&(p=new MutationObserver(()=>{i()}),p.observe(document.body,{attributes:!0,childList:!0,subtree:!0})),window.addEventListener("resize",i),()=>{d!==null&&window.cancelAnimationFrame(d),l!==null&&window.clearTimeout(l),u&&u.disconnect(),p&&p.disconnect(),window.removeEventListener("resize",i)}},[e,n,c]),{viewportHeight:o,updateViewportHeight:c}};var ue=require("react"),si=600,go=8,wn=({ref:e,onSelect:t,resolveItem:n,item:a})=>{let[s,o]=(0,ue.useState)(!1),[r,c]=(0,ue.useState)(null),d=(0,ue.useRef)(null),l=(0,ue.useRef)(!1),u=(0,ue.useRef)(null),p=(0,ue.useRef)({onSelect:t,resolveItem:n,item:a});(0,ue.useEffect)(()=>{p.current={onSelect:t,resolveItem:n,item:a}},[t,n,a]);let i=(0,ue.useCallback)(()=>{typeof window>"u"||d.current!==null&&(window.clearTimeout(d.current),d.current=null)},[]),m=(0,ue.useCallback)(()=>{u.current&&(i(),u.current=null)},[i]),h=(0,ue.useCallback)(g=>{typeof window>"u"||g.button!==0&&g.pointerType==="mouse"||(i(),l.current=!1,u.current={x:g.clientX,y:g.clientY,pointerId:g.pointerId},d.current=window.setTimeout(()=>{let v=p.current,M=null;v.item!==void 0?M=v.item:v.resolveItem&&g.target&&(M=v.resolveItem(g.target)),M!==null&&(l.current=!0,v.onSelect?.(M),c(M),o(!0)),m()},si))},[i,m]),C=(0,ue.useCallback)(g=>{u.current&&g.pointerId===u.current.pointerId&&(i(),u.current=null)},[i]),T=(0,ue.useCallback)(g=>{l.current&&(g.preventDefault(),g.stopPropagation(),g.type==="click"&&(l.current=!1))},[]),S=(0,ue.useCallback)(()=>{l.current=!1},[]),K=(0,ue.useCallback)(g=>{if(!u.current||g.pointerId!==u.current.pointerId)return;let v=Math.abs(g.clientX-u.current.x),M=Math.abs(g.clientY-u.current.y);(v>go||M>go)&&(i(),u.current=null)},[i]),V=(0,ue.useCallback)(g=>{(s||d.current!==null)&&(g.preventDefault(),g.stopPropagation())},[s]),f=(0,ue.useCallback)(()=>{o(!1),c(null),l.current=!1,u.current=null},[]);return(0,ue.useEffect)(()=>{let g=e.current;if(!(g&&typeof window<"u"))return;let v=[["pointerdown",h,void 0],["pointerup",C,void 0],["pointercancel",C,void 0],["pointermove",K,void 0],["pointerleave",C,void 0],["contextmenu",V,void 0]],M=[["mousedown",T,!0],["mouseup",T,!0],["click",T,!0],["pointerdown",S,!0],["keydown",S,!0],["contextmenu",V,!0],["pointerup",C,!0],["pointercancel",C,!0]];for(let[z,b,N]of v)g.addEventListener(z,b,N);for(let[z,b,N]of M)window.addEventListener(z,b,N);return()=>{for(let[z,b,N]of v)g.removeEventListener(z,b,N);for(let[z,b,N]of M)window.removeEventListener(z,b,N);i()}},[e,h,C,K,T,S,V,i]),{isPopupVisible:s,popupItem:r,handleClosePopup:f}};var rt=require("react");function Nn(e,t,n){let a=n?.mediaQuery??"(min-width: 1024px)",s=(0,rt.useSyncExternalStore)((0,rt.useCallback)(u=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let p=window.matchMedia(a);return p.addEventListener("change",u),()=>p.removeEventListener("change",u)},[a]),()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(a).matches:!0,()=>!1),[o,r]=(0,rt.useState)(!1),[c,d]=(0,rt.useState)(0);return(0,rt.useEffect)(()=>{if(typeof window>"u"||typeof ResizeObserver>"u")return;let u=e.current;if(!u)return;let p=new ResizeObserver(i=>{for(let m of i){if(m.target!==u)continue;let h=0;m.borderBoxSize&&m.borderBoxSize.length>0?h=m.borderBoxSize[0].inlineSize:h=m.contentRect.width,!(!Number.isFinite(h)||h<=0)&&(d(h),r(C=>C&&h>=t.expandThreshold?!1:!C&&h<t.collapseThreshold?!0:C))}});return p.observe(u),()=>p.disconnect()},[e,t.collapseThreshold,t.expandThreshold]),{isTwoColumn:s&&!o,isContainerNarrow:o,isMediaMatches:s,containerWidth:c}}de();kt();var ho=e=>e.isComposing||e.keyCode===229;var fo=(e,t)=>{if(di(t),e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||ho(e)||t.itemCount===0)return null;if(e.key==="Enter"||e.key===" ")return{kind:"activate"};let n=t.itemCount-1;if(t.activeIndex===null)return li(e.key)?{kind:"move",index:t.startIndex,direction:1}:null;let a=t.activeIndex;switch(e.key){case"ArrowDown":return{kind:"move",index:Math.min(a+1,n),direction:1};case"ArrowUp":return{kind:"move",index:Math.max(a-1,0),direction:-1};case"PageDown":return{kind:"move",index:Math.min(a+t.pageSize,n),direction:1};case"PageUp":return{kind:"move",index:Math.max(a-t.pageSize,0),direction:-1};case"Home":return{kind:"move",index:0,direction:1};case"End":return{kind:"move",index:n,direction:-1};default:return null}},ii=new Set(["ArrowDown","ArrowUp","PageDown","PageUp","Home","End"]),li=e=>ii.has(e),di=e=>{let{activeIndex:t,startIndex:n,itemCount:a,pageSize:s}=e;if(!Number.isInteger(a)||a<0)throw new RangeError(`[contact-map] listbox itemCount must be a non-negative integer; got ${te(a)}`);if(!Number.isInteger(s)||s<1)throw new RangeError(`[contact-map] listbox pageSize must be an integer of at least 1; got ${te(s)}`);let o=r=>Number.isInteger(r)&&r>=0&&r<a;if(a>0&&!o(n))throw new RangeError(`[contact-map] listbox startIndex must be an index below ${a}; got ${te(n)}`);if(t!==null&&!o(t))throw new RangeError(`[contact-map] listbox activeIndex must be null or an index below ${a}; got ${te(t)}`)};var an=require("@aiquants/swipe-overlay"),ia=require("react");de();Oa();gn();hn();var ot=require("react/jsx-runtime"),ci=xe(jn,"flex overflow-hidden"),pi=xe(qn,"motion-safe:transition-opacity motion-safe:duration-200"),ui="relative ml-auto flex h-full w-full max-w-lg flex-col bg-white shadow-xl motion-safe:transition-[transform] motion-safe:duration-200 motion-safe:ease-out dark:bg-slate-900",mi="flex shrink-0 items-center justify-between gap-3 border-slate-200 border-b px-3 py-2 dark:border-slate-700",gi="min-w-0 truncate font-semibold text-base text-slate-900 outline-none dark:text-slate-100",hi=`inline-flex min-h-11 min-w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border border-slate-300 px-4 font-medium text-slate-700 text-sm hover:bg-slate-100 dark:border-slate-600 dark:text-slate-200 dark:hover:bg-slate-800 ${mt}`,fi="flex min-h-0 flex-1 flex-col overflow-y-auto p-3",Mn=({isOpen:e,onClose:t,children:n,className:a,title:s})=>{let o=X(),r=(0,ia.useId)(),c=(0,an.useOverlayPresence)(e),d=(0,ia.useCallback)(h=>h.ownerDocument.getElementById(r),[r]),{dialogProps:l,backdropProps:u,panelProps:p,attemptClose:i,isSwiping:m}=(0,an.useSwipeOverlayDialog)({isOpen:e,onClose:t,isCloseBlocked:Yn,skipWhenTextSelected:!0,initialFocus:d});return c?(0,ot.jsxs)("dialog",{...l,"data-testid":"contact-map-mobile-overlay","aria-labelledby":r,className:xe(ci,e&&!m?"pointer-events-auto":"pointer-events-none"),style:Gn,children:[(0,ot.jsx)("div",{...u,"data-contact-map-overlay-backdrop":"",className:xe(pi,e?"opacity-100":"opacity-0")}),(0,ot.jsxs)("div",{...p,"data-contact-map-overlay-panel":"",className:xe(ui,e?"pointer-events-auto":"pointer-events-none",a),children:[(0,ot.jsxs)("div",{className:mi,children:[(0,ot.jsx)("h2",{id:r,tabIndex:-1,className:gi,children:s===void 0?o.overlayTitle:s}),(0,ot.jsx)("button",{type:"button",className:hi,onClick:()=>i(),children:o.close})]}),(0,ot.jsx)("div",{"data-contact-map-overlay-body":"",className:fi,style:an.SWIPE_OVERLAY_SCROLL_AREA_STYLE,children:n})]})]}):null};gn();Aa();var L=require("react/jsx-runtime"),yi=(0,D.lazy)(async()=>({default:(await Promise.resolve().then(()=>(zr(),Fr))).default})),ja=64,bo="h-[64px]",yo=240,xi=4,Ga=sa(Sn),ko=Sn.listPanelMinWidth,So=Sn.detailPanelMinWidth,To=Sn.handleThickness,vi=Ga.collapseThreshold,Ci=Ga.expandThreshold,ki=({contactData:e})=>{let t=X(),n=ze(e?.full_name)??t.noName,a=ze(e?.title)??"-",s=ze(e?.company_name)??"-",o=ze(e?.department)??"-",r=Vt(e).value??"-",c=Kt(e).value??"-",d=Ve(e?.updated_at,t.recordDateTime);return(0,L.jsx)(yn,{fullName:n,title:a,companyName:s,department:o,phoneNumber:c,email:r,updatedAtText:d})},Si=e=>({"--contact-panel-height":`${e}px`}),Ti=e=>typeof e=="object"&&e!==null&&"item"in e,wi=(e,t)=>t!==void 0?`${e}:${t.toFixed(3)}`:void 0,Ni=(e,t)=>{for(let n of e){let a=vt(n);if(a?.person_id===t)return a}return null},xo=(e,t)=>t!==null&&vt(e)?.person_id===t,vo=(e,t,n)=>{for(let a=t;a>=0&&a<e.length;a+=n){let s=vt(e[a]);if(s!==null)return{index:a,personId:s.person_id}}return null},Co=(e,t,n)=>{let a=vo(e,t,n);return a!==null?a:vo(e,t-n,n===1?-1:1)},la=(e,t,n)=>{let{viewportHeight:a}=Ka(t,{enableMutationObserver:!0,bottomGap:xi,minFallbackHeight:yo}),[s,o]=(0,D.useState)(0),r=(0,D.useCallback)(()=>{let p=n.current,i=t.current;if(!(p&&i))return;let m=p.getBoundingClientRect(),h=i.getBoundingClientRect(),C=Math.ceil(h.top-m.top);Number.isFinite(C)&&C>0&&o(T=>Math.abs(T-C)>1?C:T)},[t,n]);(0,D.useLayoutEffect)(()=>{if(!e)return;r();let p=requestAnimationFrame(r);return window.addEventListener("resize",r),()=>{cancelAnimationFrame(p),window.removeEventListener("resize",r)}},[e,r]);let c=a>0?a:yo,d=s>0?s:0,l=c+d,u=(0,D.useMemo)(()=>Si(l),[l]);return{normalizedViewportHeight:c,normalizedDetailHeight:l,panelSizingStyle:u}},Mi=new Set,wo=()=>{let[e,t]=(0,D.useState)(Mi),n=(0,D.useCallback)((a,s)=>{t(o=>{if(o.has(a)===s)return o;let r=new Set(o);return s?r.add(a):r.delete(a),r})},[]);return{isAnyPopupVisible:e.size>0,handlePopupVisibilityChange:n}},No=(e,t,n)=>{let a=(0,D.useRef)(n);(0,D.useLayoutEffect)(()=>{a.current=n},[n]),(0,D.useEffect)(()=>{if(e!==null)return a.current(e,t),()=>{a.current(e,!1)}},[e,t])},Mo=(0,D.memo)(({entry:e,index:t,itemCount:n,listboxId:a,isSelected:s,isActive:o,onSelect:r,onLongPressSelect:c,searchQuery:d,enableHighlighting:l,openEmailsWithGmail:u,openGmailCompose:p,onPopupVisibilityChange:i})=>{let m=X(),h=(0,D.useRef)(null),C=(0,L.jsx)("div",{className:bo}),T=Ti(e)?e:null,S=vt(e),{isPopupVisible:K,handleClosePopup:V}=wn({ref:h,onSelect:c,item:S?.person_id});if(No(S?.person_id??null,K,i),!e||!S)return C;let{person_id:f}=S,g=t%2===0?"bg-white dark:bg-slate-900":"bg-gray-50 dark:bg-slate-900/70",M=s?"border-blue-300 bg-blue-50 ring-1 ring-blue-200 dark:border-blue-500 dark:bg-blue-500/20 dark:ring-blue-500/40":g,z=["B","F"].map(b=>wi(b,b==="B"?T?.baseScore:T?.score)).filter(Boolean);return(0,L.jsxs)("div",{ref:h,id:(0,rn.virtualScrollItemElementId)(a,f),className:`flex ${bo} w-full items-center overflow-hidden border-gray-200 border-b px-4 py-2 text-left transition-colors hover:bg-blue-50 dark:border-slate-700 dark:hover:bg-blue-500/10 ${M} ${kr}`,style:{height:ja},role:"option","aria-selected":s,"aria-posinset":t+1,"aria-setsize":n,"data-selected":s?"true":"false","data-contact-map-row-active":o?"":void 0,onClick:()=>r(f),children:[(0,L.jsxs)("div",{className:"hidden w-28 shrink-0 flex-col items-center gap-0.5 text-center sm:flex",children:[(0,L.jsx)("div",{className:"whitespace-nowrap font-medium text-slate-700 text-xs leading-tight dark:text-slate-200",children:m.listRowNumber(t+1)}),(0,L.jsx)("div",{className:"truncate text-[11px] text-slate-700 leading-tight dark:text-slate-200",children:f}),(0,L.jsx)("div",{className:"flex items-center gap-1 whitespace-nowrap font-mono text-[11px] text-slate-600 leading-tight dark:text-slate-300",children:z.length?z.map(b=>(0,L.jsx)("span",{children:b},b)):(0,L.jsx)("span",{children:"-"})})]}),(0,L.jsx)(D.Suspense,{fallback:(0,L.jsx)(ki,{contactData:S}),children:(0,L.jsx)(yi,{contactData:S,searchTerm:d,enableHighlighting:l,openEmailsWithGmail:u,openGmailCompose:p,isPopupVisible:K,onRequestClose:V})})]})});Mo.displayName="ContactListRow";var qa=({context:e})=>{let{contactMapRecords:t,filteredItems:n,searchQuery:a,hasSearchTerm:s,enableHighlighting:o,openEmailsWithGmail:r,isSearchTabActive:c}=e,{locale:d,labels:l,engineLabels:u}=Te(),p=(0,D.useRef)(null),i=(0,D.useRef)(null),[m,h]=(0,D.useState)(null),{normalizedViewportHeight:C,panelSizingStyle:T}=la(c,i,p),{isAnyPopupVisible:S,handlePopupVisibilityChange:K}=wo(),V=(0,D.useMemo)(()=>({enablePointerDrag:!S,enableKeyboardNavigation:!1}),[S]),f=(0,D.useMemo)(()=>s?n:t,[s,n,t]),[g,v]=(0,D.useState)(null),M=(0,D.useCallback)(Y=>{h(Y),v(Y)},[]),z=(0,D.useCallback)(Y=>{if(!r)return;let re=Y.trim();if(!re||re==="-"||typeof window>"u")return;let q=et(re,!0);q&&window.open(q,"_blank","noopener,noreferrer")},[r]),[b,N]=(0,D.useState)(!1),Z=(0,D.useCallback)(()=>N(!1),[]),U=(0,D.useCallback)(Y=>{M(Y),N(!0)},[M]),me=(0,D.useId)(),ee=(0,D.useId)(),I=(0,D.useRef)(null),H=f.length,G=(0,D.useCallback)((Y,re)=>(0,L.jsx)(Mo,{entry:Y,index:re,itemCount:H,listboxId:me,isSelected:xo(Y,m),isActive:xo(Y,g),onSelect:U,onLongPressSelect:M,searchQuery:a,enableHighlighting:o,openEmailsWithGmail:r,openGmailCompose:z,onPopupVisibilityChange:K}),[H,me,m,g,U,M,a,o,r,z,K]),ae=(0,D.useMemo)(()=>{let Y=new Map;return f.forEach((re,q)=>{let dt=vt(re);dt!==null&&Y.set(dt.person_id,q)}),Y},[f]),ge=g===null?null:ae.get(g)??null,Ne=m===null?null:ae.get(m)??null,bt=Math.max(1,Math.floor(C/ja)),Ot=(0,D.useCallback)(Y=>{if(Y.target.id!==me)return;let re=fo(Y.nativeEvent,{activeIndex:ge,startIndex:Ne===null?0:Ne,itemCount:H,pageSize:bt});if(re===null)return;if(Y.preventDefault(),re.kind==="activate"){ge!==null&&g!==null&&U(g);return}let q=Co(f,re.index,re.direction);q!==null&&(v(q.personId),I.current?.scrollToIndex(q.index,{align:"nearest"}))},[me,ge,Ne,H,bt,g,U,f]),lt=(0,D.useCallback)(Y=>{if(Y.target.id!==me||ge!==null||!Y.target.matches(":focus-visible"))return;let re=Co(f,Ne===null?0:Ne,1);re!==null&&v(re.personId)},[me,ge,Ne,f]),Dt=(0,D.useMemo)(()=>({id:me,role:"listbox",tabIndex:0,"aria-label":l.listboxLabel,"aria-describedby":ee}),[me,l.listboxLabel,ee]),he=(0,D.useCallback)(Y=>f[Y],[f]),_t=(0,D.useCallback)(Y=>vt(f[Y])?.person_id??`row-${Y}`,[f]),Ae=(0,D.useCallback)(()=>ja,[]),Qe=(0,D.useMemo)(()=>({enabled:!0,renderVisual:rn.tapScrollCircleSampleVisual}),[]),He=(0,D.useMemo)(()=>m===null?null:Ni(f,m),[m,f]);(0,D.useEffect)(()=>{m!==null&&!He&&h(null)},[m,He]);let De=(0,D.useRef)(null),{isTwoColumn:Wt}=Nn(De,Ga);b&&(Wt||He===null)&&N(!1);let yt=(0,L.jsxs)("div",{ref:p,className:"flex min-h-0 flex-1 flex-col gap-1",children:[(0,L.jsx)("div",{className:"hidden rounded-t-lg border border-gray-200 bg-gray-50 px-4 py-2 transition-colors sm:block dark:border-slate-700 dark:bg-slate-900/70",children:(0,L.jsxs)("div",{className:"flex items-center",children:[(0,L.jsxs)("div",{className:"flex w-28 shrink-0 flex-col items-center gap-0.5 text-center text-[11px] text-slate-700 uppercase tracking-wider dark:text-slate-200",children:[(0,L.jsx)("span",{className:"font-semibold text-slate-900 text-xs dark:text-slate-100",children:l.columnNo}),(0,L.jsx)("span",{className:"leading-tight",children:l.columnId}),(0,L.jsx)("span",{className:"whitespace-nowrap leading-tight",children:l.columnScore})]}),(0,L.jsxs)("div",{className:"hidden w-full grid-cols-3 gap-2 font-medium text-slate-700 text-xs uppercase tracking-wider transition-colors sm:grid xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto] dark:text-slate-200",children:[(0,L.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,L.jsx)("span",{children:l.columnName}),(0,L.jsx)("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:l.columnTitle})]}),(0,L.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,L.jsx)("span",{children:l.columnCompany}),(0,L.jsx)("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:l.columnDepartment})]}),(0,L.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,L.jsx)("span",{children:l.columnPhone}),(0,L.jsx)("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:l.columnEmail})]}),(0,L.jsx)("div",{className:"hidden items-end justify-end xl:flex",children:(0,L.jsx)("span",{className:"font-normal text-[10px] text-slate-600 uppercase tracking-wider dark:text-slate-300",children:l.columnUpdatedAt})})]})]})}),(0,L.jsx)("p",{id:ee,hidden:!0,children:l.listKeyboardHelp}),(0,L.jsx)("div",{ref:i,className:"flex-1",onKeyDown:Ot,onFocus:lt,children:(0,L.jsx)(rn.VirtualScroll,{ref:I,contentProps:Dt,activeItemIndex:H===0?void 0:ge,activeItemVisibleInset:2,itemCount:H,getItemKey:_t,behaviorOptions:V,getItem:he,getItemHeight:Ae,viewportSize:C,overscanCount:10,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:Qe},locale:d,labels:u,className:"w-full rounded-b-lg border border-gray-200 border-t-0 bg-white pr-0.75 transition-colors dark:border-slate-700 dark:bg-slate-950",children:(Y,re)=>G(Y,re)})}),n.length===0&&s?(0,L.jsx)("div",{className:"py-8 text-center",children:(0,L.jsx)("p",{className:"text-slate-600 dark:text-slate-300",children:l.listNoSearchResults})}):null,H===0&&!s?(0,L.jsx)("div",{className:"py-8 text-center",children:(0,L.jsx)("p",{className:"text-slate-600 dark:text-slate-300",children:l.listNoData})}):null]});return(0,L.jsx)("div",{ref:De,"data-testid":"contact-map-list-root",className:"flex min-h-0 flex-1 flex-col",style:T,children:Wt?(0,L.jsxs)(Pt.PanelGroup,{id:"contact-map-list-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-list-panel-group",children:[(0,L.jsx)(Pt.Panel,{id:"contact-map-list-pane",defaultSize:{value:68,unit:"percentage"},minSize:{value:ko,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:yt}),(0,L.jsx)(Pt.PanelResizeHandle,{id:"contact-map-list-handle",thickness:To,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:"cursor-col-resize rounded transition-colors hover:bg-slate-200/60 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 dark:hover:bg-slate-700/60","aria-label":l.listResizeHandle}),(0,L.jsx)(Pt.Panel,{id:"contact-map-list-detail-pane",defaultSize:{value:32,unit:"percentage"},minSize:{value:So,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:(0,L.jsx)(Nt,{placement:"pane",contact:He,searchTerm:a,enableHighlighting:o})})]}):(0,L.jsxs)(L.Fragment,{children:[yt,He?(0,L.jsx)(Mn,{isOpen:b,onClose:Z,title:l.detailHeading,children:(0,L.jsx)(Nt,{placement:"overlay",contact:He,searchTerm:a,enableHighlighting:o})}):null]})})};var Io=require("@aiquants/directory-tree"),Lt=require("@aiquants/resize-panels"),Fo=require("@aiquants/virtualscroll"),zo=le(require("@heroicons/react/24/solid/FolderMinusIcon.js")),Uo=le(require("@heroicons/react/24/solid/FolderPlusIcon.js")),A=require("react"),Bo=require("react-dom");Ct();var Ya=(e,t)=>e&&e.trim()||t;var st=require("react"),Qa=(e,t=250)=>{let[n,a]=(0,st.useState)(e),s=(0,st.useRef)(null),o=(0,st.useRef)(e),r=(0,st.useRef)(null),c=(0,st.useRef)(!1);return(0,st.useEffect)(()=>{if(!c.current){c.current=!0,a(e),o.current=e;return}o.current=n,s.current=null;let d=l=>{s.current??(s.current=l);let u=l-s.current,p=Math.min(1,Math.max(0,u/t)),i=1-(1-p)**3,m=Math.max(0,Math.round(o.current+(e-o.current)*i));a(m),p<1&&(r.current=requestAnimationFrame(d))};return r.current=requestAnimationFrame(d),()=>{r.current!==null&&cancelAnimationFrame(r.current)}},[e,t]),Math.max(0,n)};var Ce=require("react");kt();de();var Eo={},Pi=250,Ri=4e3,da=3,Po={treeWorkerFactory:"the view remounts","workerUrls.treeWorker":"the page reloads"},Ro=(e,t)=>e.uncategorizedCompany===t.uncategorizedCompany&&e.unnamedPerson===t.unnamedPerson,Pn=class{constructor(t,{workerSource:n,logger:a=Ge}){this.worker=null;this.generation=0;this.postedCount=0;this.latestSnapshot=null;this.workerNeedsReset=!1;this.lastSyncedRecords=[];this.postedNaming=null;this.lastSyncedNaming=null;this.consecutiveFailures=0;this.finalizeRequest=null;this.finalizedPostedCount=null;this.retryTimer=null;this.listeners=new Set;this.state={snapshot:null,isBuilding:!1};this.getState=()=>this.state;this.subscribe=t=>(this.listeners.add(t),()=>this.listeners.delete(t));this.handleMessage=t=>{let n=t.data;n.type!=="TREE_CHUNK"||n.generation!==this.generation||n.uniquePersonCount===0&&this.postedCount>0&&(this.latestSnapshot?.uniquePersonCount??0)>0||this.latestSnapshot!==null&&n.uniquePersonCount<this.latestSnapshot.uniquePersonCount&&!(n.isIdle&&n.consumedRecords>=this.postedCount)||(n.isIdle&&n.consumedRecords>=this.postedCount&&(this.consecutiveFailures=0),this.latestSnapshot={tree:n.tree,directoryPaths:n.directoryPaths,consumedRecords:n.consumedRecords,uniquePersonCount:n.uniquePersonCount,isIdle:n.isIdle,rebuildEpoch:n.rebuildEpoch},this.updateState())};this.handleFailure=t=>{if(this.worker?.terminate(),this.worker=null,this.postedCount=0,this.consecutiveFailures+=1,this.updateState(),this.consecutiveFailures>=da){this.logger.error(`[TreeWorker] the tree Worker failed ${da} times in a row; the tree stops updating until ${Po[this.workerSource]} (check ${this.workerSource})`,t);return}let n=Math.min(Pi*2**(this.consecutiveFailures-1),Ri);this.logger.warn(`[TreeWorker] the tree Worker failed; retrying in ${n}ms (failure ${this.consecutiveFailures} of ${da})`,t),this.retryTimer!==null&&clearTimeout(this.retryTimer),this.retryTimer=setTimeout(()=>{this.retryTimer=null;let a=this.lastSyncedNaming;a!==null&&this.syncRecords(this.lastSyncedRecords,a)},n)};if(typeof n!="string")throw new TypeError(`[contact-map] TreeWorkerSession workerSource must be a string; got ${te(n)}`);if(!Object.hasOwn(Po,n))throw new RangeError(`[contact-map] TreeWorkerSession workerSource must be "treeWorkerFactory" or "workerUrls.treeWorker"; got ${te(n)}`);this.workerFactory=t,this.workerSource=n,this.logger=a}updateState(){let t=this.postedCount>(this.latestSnapshot?.consumedRecords??0);this.state.snapshot===this.latestSnapshot&&this.state.isBuilding===t||(this.state={snapshot:this.latestSnapshot,isBuilding:t},this.notify())}notify(){for(let t of this.listeners)t()}ensureWorker(){if(this.consecutiveFailures>=da||this.retryTimer!==null)return null;if(!this.worker)try{this.worker=this.workerFactory(),this.workerNeedsReset=!0,this.worker.onerror=this.handleFailure,this.worker.onmessageerror=this.handleFailure,this.worker.onmessage=this.handleMessage}catch(t){return this.handleFailure(t),null}return this.worker}syncRecords(t,n){this.finalizeRequest!==null&&(t.length<this.finalizeRequest.recordCount||this.finalizeRequest.naming===null||!Ro(this.finalizeRequest.naming,n))&&(this.finalizeRequest=null),this.lastSyncedRecords=t,this.lastSyncedNaming=n;let a=this.ensureWorker();if(!a)return;let s=this.workerNeedsReset,o=this.postedNaming===null||!Ro(this.postedNaming,n);if((this.workerNeedsReset||o||t.length<this.postedCount)&&(this.generation+=1,this.postedCount=0,this.finalizedPostedCount=null,this.workerNeedsReset=!1,this.postedNaming=n,a.postMessage({type:"RESET_TREE",generation:this.generation,epochBase:this.latestSnapshot?.rebuildEpoch??0,naming:n}),this.updateState()),t.length>this.postedCount){let r=t.slice(this.postedCount);this.postedCount=t.length,a.postMessage({type:"APPEND_RECORDS",generation:this.generation,records:r}),this.updateState()}s&&this.finalizeRequest!==null&&this.finalize()}finalize(){this.finalizeRequest={recordCount:this.lastSyncedRecords.length,naming:this.lastSyncedNaming},!(this.worker===null||this.finalizedPostedCount===this.postedCount)&&(this.finalizedPostedCount=this.postedCount,this.worker.postMessage({type:"FINALIZE_TREE",generation:this.generation}))}cancelWorker(){this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.worker?.terminate(),this.worker=null,this.postedCount=0,this.postedNaming=null,this.finalizedPostedCount=null}stop(){this.cancelWorker(),this.consecutiveFailures=0,this.updateState()}reset(){this.cancelWorker(),this.listeners.clear(),this.latestSnapshot=null,this.lastSyncedRecords=[],this.lastSyncedNaming=null,this.consecutiveFailures=0,this.finalizeRequest=null,this.state={snapshot:null,isBuilding:!1}}},Li=e=>{if(e!==void 0)return new Worker(e,{type:"module"});let t=typeof Eo<"u"?Eo.url:void 0;if(t){let a=t.includes(".ts")?"../workers/treeWorker.ts":"./worker/treeWorker.mjs";return new Worker(new URL(a,t),{type:"module"})}throw new Error("[contact-map] the tree Worker needs workerUrls.treeWorker in a build without import.meta.url (CommonJS)")},Rt=null,Lo=e=>e===void 0?"the bundled Worker file (workerUrls.treeWorker unset)":JSON.stringify(e),Ei=e=>{if(e===void 0)throw new Error("[contact-map] treeWorkerFactory was removed from the config while its tree session was still in use");return e},Oo=e=>{if(Ua(e),Rt===null){let t=new Pn(()=>Li(e),{workerSource:"workerUrls.treeWorker"});return Rt={session:t,workerUrl:e},t}if(Rt.workerUrl!==e)throw new Error(`[contact-map] the tree session already loads its Worker from ${Lo(Rt.workerUrl)} and cannot also load it from ${Lo(e)}; give every contact-map view in the browser tab the same workerUrls.treeWorker, on every route (after changing it, reload the page)`);return Rt.session},Oi=()=>{Rt?.session.reset(),Rt=null},Di={snapshot:null,isBuilding:!1};function Xa(e,t=!1){let n=qe(),a=n.treeWorkerFactory,s=n.workerUrls?.treeWorker,{labels:o}=Te(),r=o.uncategorizedCompany,c=o.noName,d=(0,Ce.useMemo)(()=>({uncategorizedCompany:r,unnamedPerson:c}),[r,c]),l=(0,Ce.useRef)(a);(0,Ce.useEffect)(()=>{l.current=a},[a]);let u=a!==void 0,p=u?void 0:s,i=(0,Ce.useMemo)(()=>u?new Pn(()=>Ei(l.current)(),{workerSource:"treeWorkerFactory"}):null,[u]),m=(0,Ce.useCallback)(()=>i===null?Oo(p):i,[i,p]),h=(0,Ce.useCallback)(T=>m().subscribe(T),[m]),C=(0,Ce.useCallback)(()=>m().getState(),[m]);return(0,Ce.useEffect)(()=>{let T=m();T.syncRecords(e,d),t&&T.finalize()},[m,e,t,d]),(0,Ce.useEffect)(()=>{if(i!==null)return()=>i.stop()},[i]),(0,Ce.useSyncExternalStore)(h,C,()=>Di)}de();Wa();Jn();var P=require("react/jsx-runtime"),er=sa(Tn),$o=Tn.listPanelMinWidth,Vo=Tn.detailPanelMinWidth,Ko=Tn.handleThickness,_i=er.collapseThreshold,Wi=er.expandThreshold,Ai=(e,t)=>{let{searchQuery:n,enableHighlighting:a}=t,s=Ya(e.full_name,t.noName),o=Ya(e.title,""),r=(0,P.jsx)(fe,{text:s,query:n,enabled:a});return o?(0,P.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,P.jsx)("span",{children:r}),(0,P.jsx)("span",{className:"text-slate-400 text-xs dark:text-slate-500",children:(0,P.jsx)(fe,{text:o,query:n,enabled:a})})]}):r},Hi="contact-map-tree h-full w-full",Ii={hoverClassName:"bg-slate-100/70 dark:bg-slate-800/60",directorySelectedClassName:"bg-sky-100/55 dark:bg-sky-900/40 [&_.directory-tree-name]:text-sky-700 dark:[&_.directory-tree-name]:text-sky-300",itemSelectedClassName:"bg-sky-100/70 dark:bg-sky-900/55 [&_.directory-tree-name]:text-sky-700 dark:[&_.directory-tree-name]:text-sky-300"},Ja="h-4 w-4 shrink-0 transition-colors duration-150",jo=(e,t,n)=>({...e,viewportHeightOverride:t,behaviorOptions:{...e.behaviorOptions,enablePointerDrag:!n}}),ca=null,Do=null,Rn=new Map,_o="",Wo=null,Ao=null,Fi=(e,t,n,a,s)=>{let o=`${n?"icons":"plain"}#${a}#${s.noName}`;(o!==_o||s.formatDirectoryName!==Wo||t!==Ao)&&(Rn.clear(),_o=o,Wo=s.formatDirectoryName,Ao=t);let r={entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},c=new Set;for(let d of e){c.add(d.absolutePath);let l=`${d.name}\0${d.memberCount}`,u=Rn.get(d.absolutePath);(!u||u.signature!==l)&&(u={signature:l,result:qo([d],t,n,{searchQuery:"",enableHighlighting:!1,noName:s.noName,formatDirectoryName:s.formatDirectoryName})},Rn.set(d.absolutePath,u));let p=u.result;p.entries.length>0&&r.entries.push(p.entries[0]);for(let[i,m]of p.personPathMap){let h=r.personPathMap.get(i);if(h)for(let C of m)h.add(C);else r.personPathMap.set(i,new Set(m))}for(let[i,m]of p.contactByPath)r.contactByPath.set(i,m);for(let[i,m]of p.ancestorsByPath)r.ancestorsByPath.set(i,m);r.totalCount+=p.totalCount,!r.firstPerson&&p.firstPerson&&(r.firstPerson=p.firstPerson)}for(let d of Rn.keys())c.has(d)||Rn.delete(d);return r},Za=e=>e.isSelected||e.isItemSelected?"text-sky-600 dark:text-sky-300":e.isExpanded&&e.isDirectory?"text-slate-600 dark:text-slate-200":"text-slate-500 dark:text-slate-400",Go=e=>{let t=[];for(let n of e)n.type==="directory"&&(t.push(n.absolutePath),n.children&&t.push(...Go(n.children)));return t},zi=e=>{if(e.memberCount===void 0)throw new Error(`[contact-map] directory entry ${e.absolutePath} has no memberCount`);return e.memberCount},qo=(e,t,n,a,s)=>{let o=new Map,r=new Map,c=new Map,d=0,l=null,u=(i,m)=>{let h=[...m,i.absolutePath];c.set(i.absolutePath,h);let C,T,S=i.type==="directory"?a.formatDirectoryName(i.name,zi(i)):i.name,K=(0,P.jsx)(fe,{text:S,query:a.searchQuery,enabled:a.enableHighlighting});if(i.type==="file"&&i.personId){if(s&&!s.has(i.personId))return null;let V=t.get(i.personId);if(V){r.set(i.absolutePath,V),o.has(i.personId)||o.set(i.personId,new Set);let f=o.get(i.personId);f&&f.add(i.absolutePath),d++,l||(l={personId:i.personId,path:i.absolutePath}),n&&(T=g=>{let v=Za(g);return g.isSelected||g.isItemSelected||i.isPrimary&&(v=i.title?"text-indigo-600 dark:text-indigo-400":"text-orange-500 dark:text-orange-400"),(0,P.jsx)(n.person,{"aria-hidden":"true",className:`${Ja} ${v}`})},i.title&&(K=Ai(V,a))),K=(0,P.jsx)("span",{"data-contact-path":i.absolutePath,className:"block w-full",children:K})}}else if(i.children){let V=i.children.map(f=>u(f,h)).filter(f=>f!==null);if(s&&V.length===0)return null;if(C=V,n){let f=i.relativePath.startsWith("company:")?n.company:n.department;T=g=>(0,P.jsx)(f,{"aria-hidden":"true",className:`${Ja} ${Za(g)}`})}}return{name:S,label:K,type:i.type,absolutePath:i.absolutePath,relativePath:i.relativePath,icon:T,children:C}};return{entries:e.map(i=>u(i,[])).filter(i=>i!==null),personPathMap:o,contactByPath:r,ancestorsByPath:c,firstPerson:l,totalCount:d}},Ui=(e,t,n)=>{let a=new Set,s=new Set,o=new Map;t.forEach((u,p)=>{o.set(u.item.person_id,p)});for(let u of t){let p=u.item.person_id,i=e.personPathMap.get(p);if(i)for(let m of i){a.add(m);let h=e.ancestorsByPath.get(m);if(h){for(let C of h)a.add(C);n&&h.length>0&&s.add(h[0])}}}let r=new Map,c=u=>{let p=r.get(u.absolutePath);if(p!==void 0)return p;let i=1/0;if(u.type==="file"){let m=e.contactByPath.get(u.absolutePath);m&&(i=o.get(m.person_id)??1/0)}else if(u.children)for(let m of u.children)i=Math.min(i,c(m));return r.set(u.absolutePath,i),i},d=(u,p=0)=>u.filter(i=>n&&p===0&&s.has(i.absolutePath)?!0:a.has(i.absolutePath)).map(i=>n&&p===0&&s.has(i.absolutePath)?i:i.type==="directory"&&i.children?{...i,children:d(i.children,p+1)}:i).sort((i,m)=>p===0?c(i)-c(m):0),l=d(e.entries);return{...e,entries:l}},Ho=(e,t,n)=>{if(e===null)return null;let a=n.get(e);if(a===void 0)return null;if(t!==null&&a.has(t))return t;let s=a.values().next();return s.done?null:s.value},tr=({context:e,controlsContainer:t})=>{let{contactMapRecords:n,contactMapRecordMap:a,filteredItems:s,hasSearchTerm:o,isSearchInProgress:r,isSearchTabActive:c}=e,{locale:d,labels:l,treeLabels:u}=Te(),p=l.noName,i=l.treeDirectoryName,m=(0,A.useMemo)(()=>({noName:p,formatDirectoryName:i}),[p,i]),[h,C]=(0,A.useState)(null),[T,S]=(0,A.useState)(!1),{snapshot:K,isBuilding:V}=Xa(n,e.isStreamingComplete),f=K?.tree??null,g=K?.rebuildEpoch??0,v=(0,A.useMemo)(()=>f?Fi(f,a,h,g,m):null,[f,a,h,g,m]),M=(0,A.useMemo)(()=>{if(!f)return null;if(!o)return v;let W;T||(W=new Set(s.map(O=>O.item.person_id)));let w=qo(f,a,h,{...m,searchQuery:e.searchQuery,enableHighlighting:e.enableHighlighting},W);return Ui(w,s,T)},[f,v,a,h,e.searchQuery,e.enableHighlighting,o,s,T,m]),z=(0,A.useMemo)(()=>M||{entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},[M]),b=o&&e.errorMessage!==null,[N,Z]=(0,A.useState)(z),U=(0,A.useRef)(!1);(0,A.useEffect)(()=>{if(!(r||b)){U.current=!!f,Z(z);return}!U.current&&f&&z.entries.length>0&&(U.current=!0,Z(z))},[z,f,r,b]);let me=o&&(r||b)?N:z,{entries:ee,personPathMap:I,contactByPath:H,totalCount:G}=me,ae=(0,A.useMemo)(()=>Go(ee),[ee]),[ge,Ne]=(0,A.useState)(()=>Do??new Set),bt=(0,A.useCallback)(W=>!ge.has(W),[ge]),Ot=(0,A.useCallback)(W=>{Ne(w=>{let O=new Set(w);return O.has(W)?O.delete(W):O.add(W),O})},[]),lt=(0,A.useCallback)(W=>{W.length!==0&&Ne(w=>{let O=new Set(w);for(let ie of W)O.add(ie);return O})},[]),Dt=(0,A.useCallback)(W=>{Ne(w=>{if(w.size===0)return w;let O=!1,ie=new Set(w);for(let Me of W)ie.delete(Me)&&(O=!0);return O?ie:w})},[]);(0,A.useEffect)(()=>{Do=ge},[ge]),(0,A.useEffect)(()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem("contact-map.tree-expanded")}catch{}},[]);let[he,_t]=(0,A.useState)(null),[Ae,Qe]=(0,A.useState)(null),[He,De]=(0,A.useState)(!1),Wt=(0,A.useCallback)(()=>De(!1),[]),[yt,Y]=(0,A.useState)(!1),re=(0,A.useRef)(null),q=(0,A.useRef)(null),{normalizedViewportHeight:dt,panelSizingStyle:At}=la(c,q,re),Ht=(0,A.useCallback)(W=>{let w=H.get(W);return w?(he!==w.person_id&&_t(w.person_id),W!==Ae&&Qe(W),!0):!1},[H,Ae,he]),Xe=(0,A.useCallback)(W=>{Ht(W)&&De(!0)},[Ht]),_e=(0,A.useCallback)(W=>{Xe(W.entry.absolutePath)},[Xe]),Ln=(0,A.useCallback)(W=>W instanceof Element?W.closest("[data-contact-path]")?.getAttribute("data-contact-path")??null:null,[]),{isPopupVisible:sn,popupItem:Ie,handleClosePopup:ln}=wn({ref:q,resolveItem:Ln,onSelect:Ht}),ct=(0,A.useCallback)(W=>{if(!e.openEmailsWithGmail)return;let w=W.trim();if(!w||w==="-"||typeof window>"u")return;let O=et(w,!0);O&&window.open(O,"_blank","noopener,noreferrer")},[e.openEmailsWithGmail]),Fe=Ie?H.get(Ie):null,$e=sn&&Fe!==null&&Fe!==void 0;(0,A.useEffect)(()=>{sn&&!Fe&&ln()},[sn,Fe,ln]);let dn=(0,A.useMemo)(()=>({overscanCount:16,callbackThrottleMs:16,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:{enabled:!0,renderVisual:Fo.tapScrollCircleSampleVisual}},behaviorOptions:{resetOnGetItemHeightChange:!1},preserveScrollAnchor:!0}),[]),It=(0,A.useMemo)(()=>jo(dn,dt,$e),[dn,dt,$e]);(0,A.useEffect)(()=>{let W=!1;return typeof window>"u"?()=>{W=!0}:ca?(C(ca),()=>{W=!0}):((async()=>{try{let[O,ie,Me,Ze]=await Promise.all([import("lucide-react/dist/esm/icons/building-2.js"),import("lucide-react/dist/esm/icons/users-round.js"),import("lucide-react/dist/esm/icons/id-card.js"),import("lucide-react/dist/esm/icons/user-round.js")]);if(W)return;let xt=O.default,Sa=ie.default,dr=Me.default,cr=Ze.default;xt&&Sa&&dr&&cr&&(ca={company:xt,department:Sa,title:dr,person:cr},C(ca))}catch(O){Ge.warn("Failed to load lucide icons",O)}})(),()=>{W=!0})},[]);let Ft=(0,A.useMemo)(()=>{if(!h)return;let W=Ze=>xt=>(0,P.jsx)(Ze,{"aria-hidden":"true",className:`${Ja} ${Za(xt)}`}),w={company:W(h.company),department:W(h.department),title:W(h.title)},O=W(h.person),ie=Ze=>Ze in w,Me=Ze=>{let[xt]=Ze.entry.relativePath.split(":",1);return(ie(xt)?w[xt]:w.company)(Ze)};return{directory:Me,directoryExpanded:Me,file:O}},[h]),cn=(0,A.useCallback)(()=>{Ne(W=>W.size===0?W:new Set)},[]),pt=(0,A.useCallback)(()=>{ae.length>0&&lt(ae)},[ae,lt]);(0,A.useEffect)(()=>{if(typeof window>"u")return;let W=document.documentElement,w=window.matchMedia("(prefers-color-scheme: dark)"),O=()=>Y(W.classList.contains("dark")||w.matches);O(),w.addEventListener("change",O);let ie=new MutationObserver(O);return ie.observe(W,{attributes:!0,attributeFilter:["class"]}),()=>{w.removeEventListener("change",O),ie.disconnect()}},[]);let zt=Ho(he,Ae,I);(0,A.useEffect)(()=>{let W=Ho(he,Ae,I);if(W===null){he!==null&&_t(null),Ae!==null&&Qe(null);return}W!==Ae&&Qe(W)},[he,Ae,I]);let Ut=zt===null?null:H.get(zt)??null,En=yt?"#475569":"#94A3B8",Bt=e.isStreamingComplete,On=e.isStreamingFailed,Je=Bt&&n.length===0,$t=(V||!f)&&!Je,Ca=Qa(G,250),Dn=f!==null||Je,_n=(0,P.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,P.jsxs)("span",{className:"inline-flex h-5 items-center gap-1 rounded bg-slate-100 px-1.5 font-medium font-mono text-[10px] text-slate-700 dark:bg-slate-800 dark:text-slate-200",title:l.treeNodeCountTitle,children:[(0,P.jsx)("span",{className:"text-[10px]",children:"\u{1F333}"})," ",l.treeNodeCountLabel," ",Dn?l.treeNodeCount(Ca):"\u2026"]}),On&&!Bt?(0,P.jsxs)("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-rose-200 bg-rose-50 px-1.5 font-medium text-[10px] text-rose-700 dark:border-rose-800 dark:bg-rose-950/60 dark:text-rose-300",title:l.treeStreamInterruptedTitle,children:[(0,P.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-rose-500"}),(0,P.jsx)("span",{className:"text-[10px]",children:"\u26D4"})," ",l.treeStreamInterrupted]}):Bt?$t?(0,P.jsxs)("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-amber-200 bg-amber-50 px-1.5 font-medium text-[10px] text-amber-700 dark:border-amber-800 dark:bg-amber-950/60 dark:text-amber-300",title:l.treeBuildingTitle,children:[(0,P.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,P.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-amber-400 opacity-75"}),(0,P.jsx)("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-amber-500"})]}),(0,P.jsx)("span",{className:"text-[10px]",children:"\u{1F33F}"})," ",l.treeBuilding]}):(0,P.jsxs)("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-emerald-200 bg-emerald-50 px-1.5 font-medium text-[10px] text-emerald-700 dark:border-emerald-800 dark:bg-emerald-950/60 dark:text-emerald-300",title:l.treeCompleteTitle,children:[(0,P.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500"}),(0,P.jsx)("span",{className:"text-[10px]",children:"\u2705"})," ",l.treeComplete]}):(0,P.jsxs)("span",{className:"inline-flex h-5 items-center gap-1 rounded border border-sky-200 bg-sky-50 px-1.5 font-medium text-[10px] text-sky-700 dark:border-sky-800 dark:bg-sky-950/60 dark:text-sky-300",title:l.treeStreamLoadingTitle,children:[(0,P.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,P.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-sky-400 opacity-75"}),(0,P.jsx)("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-sky-500"})]}),(0,P.jsx)("span",{className:"text-[10px]",children:"\u23F3"})," ",l.treeStreamLoading]}),o&&(0,P.jsxs)("button",{type:"button",onClick:()=>S(!T),className:`inline-flex h-5 items-center rounded px-1.5 text-[10px] transition-colors ${T?"bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300":"text-slate-500 hover:bg-slate-100 dark:text-slate-400 dark:hover:bg-slate-800"}`,title:l.treeShowEntireCompanyTitle,children:[(0,P.jsx)("span",{className:"text-[10px]",children:"\u{1F3E2}"})," ",l.treeShowEntireCompany]}),ae.length>0?(0,P.jsxs)("div",{className:"flex items-center gap-1",children:[(0,P.jsx)("button",{type:"button",onClick:cn,className:"inline-flex h-5 w-5 items-center justify-center rounded border border-slate-300 bg-white text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 dark:hover:text-slate-100","aria-label":l.treeExpandAll,title:l.treeExpandAllTitle,children:(0,P.jsx)(Uo.default,{className:"h-3 w-3"})}),(0,P.jsx)("button",{type:"button",onClick:pt,className:"inline-flex h-5 w-5 items-center justify-center rounded border border-slate-300 bg-white text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700 dark:hover:text-slate-100","aria-label":l.treeCollapseAll,title:l.treeCollapseAllTitle,children:(0,P.jsx)(zo.default,{className:"h-3 w-3"})})]}):null]}),pn=(0,A.useRef)(null),{isTwoColumn:Wn}=Nn(pn,er,{mediaQuery:"(min-width: 768px)"});He&&(Wn||Ut===null)&&De(!1);let An=(0,A.useMemo)(()=>({toggle:Ot,isExpanded:bt,expandMultiple:Dt,collapseMultiple:lt,isPending:r}),[lt,Dt,bt,Ot,r]),Hn=(0,A.useMemo)(()=>({onEntryClick:_e,selectedPath:zt}),[_e,zt]),lr=(0,A.useMemo)(()=>({className:Hi,lineColor:En,iconOverrides:Ft,showDirectoryIcons:!!Ft,showFileIcons:!!Ft,highlightStyles:Ii,entryClassName:"rounded-md px-1 py-0.5",nameClassName:"text-xs tracking-tight",directoryNameClassName:"font-normal text-slate-800 dark:text-slate-100",fileNameClassName:"text-slate-700 dark:text-slate-200"}),[En,Ft]),ka=(0,P.jsx)("div",{ref:re,className:"flex min-h-0 flex-1 flex-col rounded-xl border border-slate-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-950",children:(0,P.jsx)("div",{ref:q,className:"flex min-h-0 flex-1 flex-col overflow-hidden p-2",children:ee.length>0?(0,P.jsx)(Io.DirectoryTree,{entries:ee,expansion:An,selection:Hn,visual:lr,virtualScroll:It,locale:d,labels:u}):(0,P.jsx)("div",{className:"flex h-full w-full items-center justify-center rounded-lg border border-slate-300 border-dashed bg-white/70 px-6 text-center text-slate-500 text-sm transition-colors dark:border-slate-700 dark:bg-slate-900/50 dark:text-slate-300",children:o?l.treeNoMatches:l.treeEmpty})})});return(0,P.jsxs)("div",{ref:pn,"data-testid":"contact-map-tree-root",className:"flex min-h-0 flex-1 flex-col",style:At,children:[t&&(0,Bo.createPortal)(_n,t),Wn?(0,P.jsxs)(Lt.PanelGroup,{id:"contact-map-tree-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-tree-panel-group",children:[(0,P.jsx)(Lt.Panel,{id:"contact-map-tree-pane",defaultSize:{value:60,unit:"percentage"},minSize:{value:$o,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:ka}),(0,P.jsx)(Lt.PanelResizeHandle,{id:"contact-map-tree-handle",thickness:Ko,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:"cursor-col-resize rounded transition-colors hover:bg-slate-200/60 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-1 dark:hover:bg-slate-700/60","aria-label":l.treeResizeHandle}),(0,P.jsx)(Lt.Panel,{id:"contact-map-tree-detail-pane",defaultSize:{value:40,unit:"percentage"},minSize:{value:Vo,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:(0,P.jsx)(Nt,{placement:"pane",contact:Ut,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})})]}):(0,P.jsxs)(P.Fragment,{children:[ka,Ut?(0,P.jsx)(Mn,{isOpen:He,onClose:Wt,title:l.detailHeading,children:(0,P.jsx)(Nt,{placement:"overlay",contact:Ut,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})}):null]}),$e&&Fe&&(0,P.jsx)(bn,{contactData:Fe,openEmailsWithGmail:e.openEmailsWithGmail,openGmailCompose:ct,onRequestClose:ln})]})};var Oe=require("react/jsx-runtime"),Bi={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},$i=e=>e==="tree"?"tree":"list",nr=({context:e})=>{let t=X(),[n,a]=(0,Yo.useSearchParams)(),[s,o]=(0,pa.useState)(null),r=$i(n.get(tn)),{setScrollableRef:c,onPointerDown:d,onPointerMove:l,onPointerUp:u,onPointerLeave:p,onPointerCancel:i,onClickCapture:m}=at(),h=(0,pa.useCallback)(C=>{let T=C==="tree"?"tree":"list";if(T===r)return;let S=new URLSearchParams(typeof window<"u"?window.location.search:"");T==="list"?S.delete(tn):S.set(tn,T),a(S,{replace:!0})},[r,a]);return(0,Oe.jsxs)("div",{"data-testid":"contact-map-search-tab-group",className:"flex h-full flex-1 flex-col",children:[(0,Oe.jsxs)("div",{className:"mt-1 mb-1.5 flex shrink-0 items-center gap-2",children:[(0,Oe.jsxs)("div",{ref:c,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-lg bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:Bi,onPointerDown:d,onPointerMove:l,onPointerUp:u,onPointerLeave:p,onPointerCancel:i,onClickCapture:m,children:[(0,Oe.jsxs)("button",{type:"button","data-testid":"contact-map-tab-list",onClick:()=>h("list"),className:`rounded px-2 py-0.5 text-xs transition-colors ${r==="list"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4C4} ",t.listViewTab]}),(0,Oe.jsxs)("button",{type:"button","data-testid":"contact-map-tab-tree",onClick:()=>h("tree"),className:`rounded px-2 py-0.5 text-xs transition-colors ${r==="tree"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F333} ",t.treeViewTab]})]}),(0,Oe.jsx)("div",{ref:o,className:"flex items-center gap-1.5"})]}),(0,Oe.jsxs)("div",{className:"flex h-full flex-1 flex-col",children:[(0,Oe.jsx)("div",{className:`${r==="list"?"flex h-full flex-1 flex-col":"hidden"}`,children:r==="list"?(0,Oe.jsx)(qa,{context:e}):null}),(0,Oe.jsx)("div",{className:`${r==="tree"?"flex h-full flex-1 flex-col":"hidden"}`,children:r==="tree"?(0,Oe.jsx)(tr,{context:e,controlsContainer:s}):null})]})]})};var Qo=require("react");de();var j=require("@aiquants/fuzzy-search"),be=require("react");de();var y=require("react/jsx-runtime"),ar=1e3,ua=(0,be.memo)(({searchOptions:e,setSearchOptions:t})=>{let n=X(),a="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",s="text-xs font-semibold",o=e.sortBy==="relevance",r=(0,be.useId)(),c=(0,be.useId)(),d=(0,be.useId)(),l=(0,be.useId)(),u=(0,be.useId)(),p=(0,be.useId)(),i=(0,be.useId)(),m=(0,be.useId)(),h=(0,be.useId)(),C=(0,be.useId)(),T=(0,be.useId)(),S=[];S.push((0,y.jsxs)("div",{className:`${a} border-green-200 border-l-4 dark:border-green-400/60`,children:[(0,y.jsxs)("div",{className:`${s} text-green-700 dark:text-green-300`,children:["\u{1F3D7}\uFE0F ",n.indexBuildHeading]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:r,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexNgramSize}),(0,y.jsx)("input",{id:r,type:"range",min:"1",max:"4",step:"1",value:e.ngramSize||j.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize,onChange:f=>t(g=>({...g,ngramSize:parseInt(f.target.value,10)})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-green-600 text-xs dark:text-green-300",children:[n.currentValueLabel," ",e.ngramSize||j.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexNgramSizeHint})]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:c,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexMinNgramOverlap}),(0,y.jsx)("input",{id:c,type:"range",min:"1",max:"5",step:"1",value:e.minNgramOverlap||j.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap,onChange:f=>t(g=>({...g,minNgramOverlap:parseInt(f.target.value,10)})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-green-600 text-xs dark:text-green-300",children:[n.currentValueLabel," ",e.minNgramOverlap||j.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexMinNgramOverlapHint})]})]},"index-build")),S.push((0,y.jsxs)("div",{className:`${a} border-blue-200 border-l-4 dark:border-blue-500/60`,children:[(0,y.jsxs)("div",{className:`${s} text-blue-700 dark:text-blue-300`,children:["\u{1F50D} ",n.indexCandidateHeading]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:d,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexThreshold}),(0,y.jsx)("input",{id:d,type:"range",min:"0.0",max:"1.0",step:"0.05",value:e.indexWorkerOptions?.threshold??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,threshold:parseFloat(f.target.value)}})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.threshold??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexThresholdHint})]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:u,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexNgramOverlapThreshold}),(0,y.jsx)("input",{id:u,type:"range",min:"0.1",max:"0.9",step:"0.1",value:e.indexWorkerOptions?.ngramOverlapThreshold??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,ngramOverlapThreshold:parseFloat(f.target.value)}})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-blue-600 text-xs dark:text-blue-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.ngramOverlapThreshold??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexNgramOverlapThresholdHint})]})]},"candidate-control")),S.push((0,y.jsxs)("div",{className:`${a} border-cyan-200 border-l-4 dark:border-cyan-400/60`,children:[(0,y.jsxs)("div",{className:`${s} text-cyan-700 dark:text-cyan-300`,children:["\u{1F9ED} ",n.indexStrategyHeading]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:l,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexStrategy}),(0,y.jsxs)("select",{id:l,value:e.indexWorkerOptions?.strategy??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.strategy??"hybrid",onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,strategy:f.target.value}})),className:"rounded border border-gray-300 px-2 py-1 text-xs transition-colors dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100",children:[(0,y.jsx)("option",{value:"fast",children:n.indexStrategyFast}),(0,y.jsx)("option",{value:"accurate",children:n.indexStrategyAccurate}),(0,y.jsx)("option",{value:"hybrid",children:n.indexStrategyHybrid})]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexStrategyHint})]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:p,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexMinCandidatesRatio}),(0,y.jsx)("input",{id:p,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.minCandidatesRatio??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,minCandidatesRatio:parseFloat(f.target.value)}})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-cyan-600 text-xs dark:text-cyan-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.minCandidatesRatio??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexMinCandidatesRatioHint})]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:i,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexMaxCandidatesRatio}),(0,y.jsx)("input",{id:i,type:"range",min:"0.3",max:"0.8",step:"0.1",value:e.indexWorkerOptions?.maxCandidatesRatio??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxCandidatesRatio:parseFloat(f.target.value)}})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-cyan-600 text-xs dark:text-cyan-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxCandidatesRatio??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexMaxCandidatesRatioHint})]})]},"strategy")),S.push((0,y.jsxs)("div",{className:`${a} border-indigo-200 border-l-4 dark:border-indigo-500/60`,children:[(0,y.jsxs)("div",{className:`${s} text-indigo-700 dark:text-indigo-300`,children:["\u{1F521} ",n.scoreTuningHeading]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:m,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexJaroWinklerPrefix}),(0,y.jsx)("input",{id:m,type:"range",min:"0.05",max:"0.25",step:"0.05",value:e.indexWorkerOptions?.jaroWinklerPrefix??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,jaroWinklerPrefix:parseFloat(f.target.value)}})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.jaroWinklerPrefix??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexJaroWinklerPrefixHint})]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:h,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.maxResults}),(0,y.jsxs)("label",{className:"flex items-center gap-2 text-[11px] text-gray-600 dark:text-slate-300",children:[(0,y.jsx)("input",{type:"checkbox",checked:e.indexWorkerOptions?.maxResults===void 0,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxResults:f.target.checked?void 0:ar}}))}),n.noLimit]}),(0,y.jsx)("input",{id:h,type:"range",min:ar,max:"10000",step:"1000",disabled:e.indexWorkerOptions?.maxResults===void 0,value:e.indexWorkerOptions?.maxResults===void 0?ar:e.indexWorkerOptions.maxResults,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxResults:parseInt(f.target.value,10)}})),className:"w-full disabled:cursor-not-allowed"}),(0,y.jsxs)("span",{className:"text-indigo-600 text-xs dark:text-indigo-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxResults===void 0?n.noLimit:e.indexWorkerOptions.maxResults]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexMaxResultsHint})]})]},"jaro")),S.push((0,y.jsxs)("div",{className:`${a} border-emerald-200 border-l-4 ${o?"":"opacity-50"} dark:border-emerald-400/60`,children:[(0,y.jsxs)("div",{className:`${s} text-emerald-700 dark:text-emerald-300`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:C,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.fieldWeight}),(0,y.jsx)("input",{id:C,type:"range",min:"0",max:"1",step:"0.05",value:e.indexWorkerOptions?.relevanceFieldWeight??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight??.2,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,relevanceFieldWeight:parseFloat(f.target.value)}})),disabled:!o,className:"w-full disabled:cursor-not-allowed"}),(0,y.jsxs)("span",{className:"text-emerald-600 text-xs dark:text-emerald-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevanceFieldWeight??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight??.2]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexFieldWeightHint})]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:T,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexPerfectMatchBonus}),(0,y.jsx)("input",{id:T,type:"range",min:"0",max:"0.3",step:"0.1",value:e.indexWorkerOptions?.relevancePerfectMatchBonus??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus??.1,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,relevancePerfectMatchBonus:parseFloat(f.target.value)}})),disabled:!o,className:"w-full disabled:cursor-not-allowed"}),(0,y.jsxs)("span",{className:"text-emerald-600 text-xs dark:text-emerald-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevancePerfectMatchBonus??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus??.1]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexPerfectMatchBonusHint})]}),!o&&(0,y.jsx)("p",{className:"text-[11px] text-emerald-600 dark:text-emerald-300",children:n.relevanceOnlyNotice})]},"relevance"));let K=(0,be.useId)(),V=(0,be.useId)();return S.push((0,y.jsxs)("div",{className:`${a} border-teal-200 border-l-4 dark:border-teal-400/60`,children:[(0,y.jsxs)("div",{className:`${s} text-teal-700 dark:text-teal-300`,children:["\u{1F524} ",n.indexContainmentHeading]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:K,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexContainmentBase}),(0,y.jsx)("input",{id:K,type:"range",min:"0.0",max:"0.7",step:"0.05",value:e.indexWorkerOptions?.containmentScoreBase??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase??.7,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,containmentScoreBase:parseFloat(f.target.value)}})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-teal-600 text-xs dark:text-teal-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentScoreBase??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase??.7]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexContainmentBaseHint})]}),(0,y.jsxs)("div",{className:"space-y-2",children:[(0,y.jsx)("label",{htmlFor:V,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.indexContainmentCoverage}),(0,y.jsx)("input",{id:V,type:"range",min:"0.0",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.containmentCoverageWeight??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight??.3,onChange:f=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,containmentCoverageWeight:parseFloat(f.target.value)}})),className:"w-full"}),(0,y.jsxs)("span",{className:"text-teal-600 text-xs dark:text-teal-300",children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentCoverageWeight??j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight??.3]}),(0,y.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.indexContainmentCoverageHint})]})]},"containment")),(0,y.jsxs)("section",{className:"space-y-3",children:[(0,y.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,y.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-green-700 text-xs transition-colors dark:text-green-300",children:[(0,y.jsx)("span",{children:"\u{1F4CA}"}),(0,y.jsx)("span",{className:"tracking-wide",children:n.indexSettingsHeading})]}),(0,y.jsx)("button",{type:"button",onClick:()=>t(f=>({...f,indexWorkerOptions:{threshold:j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold||.4,ngramOverlapThreshold:j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold||.3,minCandidatesRatio:j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio||.1,maxCandidatesRatio:j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio||.5,jaroWinklerPrefix:j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix||.1,maxResults:void 0,relevanceFieldWeight:j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight||.2,relevancePerfectMatchBonus:j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus||.1,containmentScoreBase:j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase||.7,containmentCoverageWeight:j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight||.3,strategy:j.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.strategy},ngramSize:j.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize,minNgramOverlap:j.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap})),className:"rounded border border-green-300 bg-green-100 px-2 py-1 font-medium text-green-700 text-xs transition-colors hover:bg-green-200 dark:border-green-400/60 dark:bg-green-900/20 dark:text-green-200 dark:hover:bg-green-800/30",title:n.resetToDefaultsTitle,children:n.reset})]}),(0,y.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:S})]})});ua.displayName="IndexWorkerSettings";var ye=require("@aiquants/fuzzy-search"),it=require("react");de();var _=require("react/jsx-runtime"),rr=1e3,ma=(0,it.memo)(({searchOptions:e,setSearchOptions:t})=>{let n=X(),a="flex flex-col gap-1 rounded-md border border-gray-200 bg-white/80 px-2 py-1 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",s="text-xs font-semibold",o=e.sortBy==="relevance",r=(0,it.useId)(),c=(0,it.useId)(),d=(0,it.useId)(),l=(0,it.useId)(),u=(0,it.useId)(),p=(0,it.useId)(),i=[];return i.push((0,_.jsxs)("div",{className:`${a} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[(0,_.jsxs)("div",{className:`${s} text-purple-700 dark:text-purple-300`,children:["\u{1F9EE} ",n.levenshteinCandidateHeading]}),(0,_.jsxs)("div",{className:"space-y-2",children:[(0,_.jsx)("label",{htmlFor:r,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.levenshteinThreshold}),(0,_.jsx)("input",{id:r,type:"range",min:"0.0",max:o?"1.5":"1.0",step:"0.05",value:e.levenshteinWorkerOptions?.threshold??ye.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold,onChange:m=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,threshold:parseFloat(m.target.value)}})),className:"w-full"}),(0,_.jsxs)("span",{className:"text-purple-600 text-xs dark:text-purple-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.threshold??ye.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold]}),(0,_.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:o?n.levenshteinThresholdHintRelevance:n.levenshteinThresholdHint})]}),(0,_.jsxs)("div",{className:"space-y-2",children:[(0,_.jsx)("label",{htmlFor:c,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.levenshteinLengthSimilarity}),(0,_.jsx)("input",{id:c,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.lengthSimilarityThreshold??ye.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold,onChange:m=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,lengthSimilarityThreshold:parseFloat(m.target.value)}})),className:"w-full"}),(0,_.jsxs)("span",{className:"text-purple-600 text-xs dark:text-purple-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthSimilarityThreshold??ye.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold]}),(0,_.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinLengthSimilarityHint})]})]},"threshold")),i.push((0,_.jsxs)("div",{className:`${a} border-pink-200 border-l-4 dark:border-pink-400/60`,children:[(0,_.jsxs)("div",{className:`${s} text-pink-700 dark:text-pink-300`,children:["\u{1FA84} ",n.scoreTuningHeading]}),(0,_.jsxs)("div",{className:"space-y-2",children:[(0,_.jsx)("label",{htmlFor:d,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.levenshteinLengthPenalty}),(0,_.jsx)("input",{id:d,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.levenshteinWorkerOptions?.lengthDiffPenalty??ye.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty,onChange:m=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,lengthDiffPenalty:parseFloat(m.target.value)}})),className:"w-full"}),(0,_.jsxs)("span",{className:"text-pink-600 text-xs dark:text-pink-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthDiffPenalty??ye.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty]}),(0,_.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinLengthPenaltyHint})]})]},"penalty")),i.push((0,_.jsxs)("div",{className:`${a} border-violet-200 border-l-4 dark:border-violet-400/60`,children:[(0,_.jsxs)("div",{className:`${s} text-violet-700 dark:text-violet-300`,children:["\u{1F4E6} ",n.levenshteinResultsHeading]}),(0,_.jsx)("label",{htmlFor:l,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.maxResults}),(0,_.jsxs)("label",{className:"flex items-center gap-2 text-[11px] text-gray-600 dark:text-slate-300",children:[(0,_.jsx)("input",{type:"checkbox",checked:e.levenshteinWorkerOptions?.maxResults===void 0,onChange:m=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,maxResults:m.target.checked?void 0:rr}}))}),n.noLimit]}),(0,_.jsx)("input",{id:l,type:"range",min:rr,max:"10000",step:"1000",disabled:e.levenshteinWorkerOptions?.maxResults===void 0,value:e.levenshteinWorkerOptions?.maxResults===void 0?rr:e.levenshteinWorkerOptions.maxResults,onChange:m=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,maxResults:parseInt(m.target.value,10)}})),className:"w-full disabled:cursor-not-allowed"}),(0,_.jsxs)("span",{className:"text-violet-600 text-xs dark:text-violet-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.maxResults===void 0?n.noLimit:e.levenshteinWorkerOptions.maxResults]}),(0,_.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinMaxResultsHint})]},"max-results")),i.push((0,_.jsxs)("div",{className:`${a} border-rose-200 border-l-4 ${o?"":"opacity-50"} dark:border-rose-400/60`,children:[(0,_.jsxs)("div",{className:`${s} text-rose-700 dark:text-rose-300`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),(0,_.jsxs)("div",{className:"space-y-2",children:[(0,_.jsx)("label",{htmlFor:u,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.fieldWeight}),(0,_.jsx)("input",{id:u,type:"range",min:"0",max:"1",step:"0.05",value:e.levenshteinWorkerOptions?.relevanceFieldWeight??ye.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight??.15,onChange:m=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,relevanceFieldWeight:parseFloat(m.target.value)}})),disabled:!o,className:"w-full disabled:cursor-not-allowed"}),(0,_.jsxs)("span",{className:"text-rose-600 text-xs dark:text-rose-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.relevanceFieldWeight??ye.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight??.15]}),(0,_.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinFieldWeightHint})]}),(0,_.jsxs)("div",{className:"space-y-2",children:[(0,_.jsx)("label",{htmlFor:p,className:"font-medium text-[11px] text-gray-600 transition-colors dark:text-slate-300",children:n.levenshteinPartialBonus}),(0,_.jsx)("input",{id:p,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.partialMatchBonus??ye.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus,onChange:m=>t(h=>({...h,levenshteinWorkerOptions:{...h.levenshteinWorkerOptions,partialMatchBonus:parseFloat(m.target.value)}})),disabled:!o,className:"w-full disabled:cursor-not-allowed"}),(0,_.jsxs)("span",{className:"text-rose-600 text-xs dark:text-rose-300",children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.partialMatchBonus??ye.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus]}),(0,_.jsx)("p",{className:"text-[11px] text-gray-500 transition-colors dark:text-slate-400",children:n.levenshteinPartialBonusHint})]}),!o&&(0,_.jsx)("p",{className:"text-[11px] text-rose-600 dark:text-rose-300",children:n.relevanceOnlyNotice})]},"relevance")),(0,_.jsxs)("section",{className:"space-y-3",children:[(0,_.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,_.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-purple-700 text-xs transition-colors dark:text-purple-300",children:[(0,_.jsx)("span",{children:"\u{1F4CF}"}),(0,_.jsx)("span",{className:"tracking-wide",children:n.levenshteinSettingsHeading})]}),(0,_.jsx)("button",{type:"button",onClick:()=>t(m=>({...m,levenshteinWorkerOptions:{threshold:ye.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold||.3,lengthSimilarityThreshold:ye.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold||.1,partialMatchBonus:ye.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus||.1,lengthDiffPenalty:ye.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty||1,maxResults:void 0,relevanceFieldWeight:ye.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight||.15}})),className:"rounded border border-purple-300 bg-purple-100 px-2 py-1 font-medium text-purple-700 text-xs transition-colors hover:bg-purple-200 dark:border-purple-400/60 dark:bg-purple-900/20 dark:text-purple-200 dark:hover:bg-purple-800/30",title:n.resetToDefaultsTitle,children:n.reset})]}),(0,_.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:i})]})});ma.displayName="LevenshteinWorkerSettings";var se=require("react/jsx-runtime"),Vi={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},ga=(0,Qo.memo)(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:s,setOpenEmailsWithGmail:o,activeTab:r,onTabChange:c})=>{let d=X(),{setScrollableRef:l,onPointerDown:u,onPointerMove:p,onPointerUp:i,onPointerLeave:m,onPointerCancel:h,onClickCapture:C}=at();return(0,se.jsxs)("div",{className:"wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border border-blue-300 bg-white p-1.5 shadow-md transition-colors dark:border-blue-500/40 dark:bg-slate-900/80 dark:shadow-blue-900/30",children:[(0,se.jsxs)("div",{className:"mb-0.5 flex shrink-0 flex-col gap-1 rounded bg-blue-50 px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between dark:bg-blue-900/30",children:[(0,se.jsxs)("h3",{className:"font-semibold text-gray-700 text-xs transition-colors dark:text-slate-100",children:["\u2699\uFE0F ",d.searchSettings]}),(0,se.jsx)("div",{className:"flex flex-wrap gap-1.5",children:(0,se.jsxs)("button",{type:"button",onClick:()=>t(T=>oa(T.workerUrls)),className:"rounded bg-red-500 px-1.5 py-0.5 text-[10px] text-white transition-colors hover:bg-red-600 dark:hover:bg-red-700",title:d.settingsResetAllTitle,children:["\u{1F504} ",d.settingsResetAll]})})]}),(0,se.jsx)("div",{className:"mb-0 shrink-0",children:(0,se.jsxs)("div",{ref:l,role:"tablist","aria-label":d.settingsTabsLabel,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-md bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:Vi,onPointerDown:u,onPointerMove:p,onPointerUp:i,onPointerLeave:m,onPointerCancel:h,onClickCapture:C,children:[(0,se.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="basic",onClick:()=>c("basic"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${r==="basic"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F527} ",d.settingsBasicTab]}),(0,se.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="advanced",onClick:()=>c("advanced"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${r==="advanced"?"bg-orange-500 text-white dark:bg-orange-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u26A1 ",d.settingsAdvancedTab]}),(0,se.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="index",onClick:()=>c("index"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${r==="index"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CA} ",d.indexWorkerName]}),(0,se.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="levenshtein",onClick:()=>c("levenshtein"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${r==="levenshtein"?"bg-purple-500 text-white dark:bg-purple-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CF} ",d.levenshteinWorkerName]})]})}),(0,se.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,se.jsx)("div",{className:`${r==="basic"?"block":"hidden"}`,children:(0,se.jsx)(Kn,{searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:s,setOpenEmailsWithGmail:o})}),(0,se.jsx)("div",{className:`${r==="advanced"?"block":"hidden"}`,children:(0,se.jsx)(Vn,{searchOptions:e,setSearchOptions:t})}),(0,se.jsx)("div",{className:`${r==="index"?"block":"hidden"}`,children:(0,se.jsx)(ua,{searchOptions:e,setSearchOptions:t})}),(0,se.jsx)("div",{className:`${r==="levenshtein"?"block":"hidden"}`,children:(0,se.jsx)(ma,{searchOptions:e,setSearchOptions:t})})]})]})});ga.displayName="SearchOptionsPanel";var fa=require("react");Tt();de();var Xo=require("react"),ha=require("react/jsx-runtime"),E=(0,Xo.memo)(({label:e,value:t,unit:n,color:a="text-gray-600 dark:text-slate-300"})=>(0,ha.jsxs)("div",{className:"wrap-break-word flex min-w-0 flex-col overflow-hidden text-gray-700 transition-colors sm:flex-row sm:justify-between dark:text-slate-200",children:[(0,ha.jsxs)("span",{className:"wrap-break-word overflow-hidden text-left",children:[e,":"]}),(0,ha.jsxs)("span",{className:`font-medium ${a} min-w-0 overflow-hidden break-all transition-colors sm:ml-2`,children:[t,n]})]}));E.displayName="StatItem";var Jo=require("react");Tt();de();var x=require("react/jsx-runtime"),Et=(0,Jo.memo)(({kind:e,icon:t,stats:n,color:a})=>{let{locale:s,labels:o}=Te(),r=I=>Q(s,I);if(!n)return(0,x.jsx)("section",{className:"rounded-lg border border-gray-200 border-dashed bg-white/40 p-3 text-gray-400 text-xs transition-colors dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-400",children:o.statsNoData});let c=n.basic||{},d=n.workerSpecific||{},l=n.analysis||{},u=c.totalSearches??0,p=c.totalProcessingTime??0,i=c.averageSearchTime??0,m=c.lastSearchTime??0,h=c.errorCount??0,C=c.timestamp,T=l.fieldPerformance||{},S=l.performanceInsights||{},K=l.recentHistory||[],V=d.specificMetrics||{},f=d.operationCount??0,g=d.operationDistribution||{},v=e==="index",M=e==="levenshtein",z=v?o.indexWorkerName:o.levenshteinWorkerName,b=V,N=V,Z="flex flex-col gap-1 rounded-lg border border-gray-200 bg-white/80 p-3 shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/70 dark:shadow-none",U="text-xs font-semibold transition-colors",me=I=>{if(!I)return;let H=new Date(I);return Number.isNaN(H.getTime())?void 0:o.statsTimestamp(H)},ee=[];if(ee.push((0,x.jsxs)("div",{className:`${Z} border-blue-200 border-l-4 dark:border-blue-500/60`,children:[(0,x.jsxs)("div",{className:`${U} ${a}`,children:["\u{1F4CA} ",o.statsBasicHeading]}),(0,x.jsx)(E,{label:o.statTotalSearches,value:r(u),color:a}),(0,x.jsx)(E,{label:o.statAverageSearchTime,value:i.toFixed(2),unit:"ms",color:a}),(0,x.jsx)(E,{label:o.statTotalProcessingTime,value:p.toFixed(2),unit:"ms",color:a}),(0,x.jsx)(E,{label:o.statLastSearchTime,value:m.toFixed(2),unit:"ms",color:a}),(0,x.jsx)(E,{label:o.statErrorCount,value:h,color:h>0?"text-red-600 dark:text-red-400":a}),me(C)&&(0,x.jsx)(E,{label:o.statUpdatedAt,value:me(C),color:"text-gray-500 dark:text-slate-400"})]},"basic")),f>0||Object.keys(g).length>0){let I=Object.entries(g).sort(([,H],[,G])=>(Number(G)||0)-(Number(H)||0)).slice(0,6);ee.push((0,x.jsxs)("div",{className:`${Z} border-amber-200 border-l-4 dark:border-amber-400/60`,children:[(0,x.jsxs)("div",{className:`${U} text-amber-600 dark:text-amber-300`,children:["\u{1F527} ",o.statsOperationsHeading]}),(0,x.jsx)(E,{label:o.statTotalOperations,value:r(f),color:"text-amber-700 dark:text-amber-300"}),I.length>0&&(0,x.jsx)("div",{className:"mt-1 space-y-1",children:I.map(([H,G])=>(0,x.jsx)(E,{label:H,value:r(Number(G)),unit:o.timesUnit(r(Number(G))),color:"text-amber-700 dark:text-amber-300"},H))})]},"operations"))}if(v&&(ee.push((0,x.jsxs)("div",{className:`${Z} border-green-200 border-l-4 dark:border-green-400/60`,children:[(0,x.jsxs)("div",{className:`${U} text-green-700 dark:text-green-300`,children:["\u{1F3D7}\uFE0F ",o.statsIndexHeading]}),(0,x.jsx)(E,{label:o.statIndexBuilds,value:r(b.totalIndexBuilds??0),color:"text-green-700 dark:text-green-300"}),(0,x.jsx)(E,{label:o.statDataSize,value:r(b.currentDataSize??0),unit:o.itemsUnit(r(b.currentDataSize??0)),color:"text-green-700 dark:text-green-300"}),(0,x.jsx)(E,{label:o.statLastBuildTime,value:(b.lastIndexTime??0).toFixed(2),unit:"ms",color:"text-green-700 dark:text-green-300"})]},"index-core")),b.cacheSize&&ee.push((0,x.jsxs)("div",{className:`${Z} border-emerald-200 border-l-4 dark:border-emerald-400/60`,children:[(0,x.jsxs)("div",{className:`${U} text-emerald-700 dark:text-emerald-300`,children:["\u{1F4BE} ",o.statsCacheHeading]}),(0,x.jsx)(E,{label:o.statCacheNgram,value:r(b.cacheSize.ngram??0),color:"text-emerald-700 dark:text-emerald-300"}),(0,x.jsx)(E,{label:o.statCacheWord,value:r(b.cacheSize.word??0),color:"text-emerald-700 dark:text-emerald-300"}),(0,x.jsx)(E,{label:o.statCachePhonetic,value:r(b.cacheSize.phonetic??0),color:"text-emerald-700 dark:text-emerald-300"})]},"index-cache")),b.indexMetadata)){let I=Object.entries(b.indexMetadata).slice(0,6);I.length>0&&ee.push((0,x.jsxs)("div",{className:`${Z} border-teal-200 border-l-4 dark:border-teal-400/60`,children:[(0,x.jsxs)("div",{className:`${U} text-teal-700 dark:text-teal-300`,children:["\u{1F4CB} ",o.statsIndexMetadataHeading]}),I.map(([H,G])=>{let ae;if(typeof G=="number"){let ge=H.toLowerCase();ge.includes("time")&&!ge.includes("timestamp")?ae=`${G.toFixed(2)}ms`:ge.includes("timestamp")||ge.includes("at")?ae=me(G)??G.toString():ae=r(G)}else ae=String(G);return(0,x.jsx)(E,{label:H,value:ae,color:"text-teal-700 dark:text-teal-300"},H)})]},"index-meta"))}if(M){if(ee.push((0,x.jsxs)("div",{className:`${Z} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[(0,x.jsxs)("div",{className:`${U} text-purple-700 dark:text-purple-300`,children:["\u{1F522} ",o.statsCalculationsHeading]}),(0,x.jsx)(E,{label:o.statTotalCalculations,value:r(N.totalCalculations??0),color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(E,{label:o.statDistanceCalculations,value:r(N.totalDistanceCalculations??0),color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(E,{label:o.statAverageDistance,value:typeof N.averageDistance=="number"?N.averageDistance.toFixed(2):"0.00",color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(E,{label:o.statMinDistance,value:N.minDistance??o.notAvailable,color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(E,{label:o.statMaxDistance,value:N.maxDistance??0,color:"text-purple-700 dark:text-purple-300"})]},"lev-basic")),ee.push((0,x.jsxs)("div",{className:`${Z} border-fuchsia-200 border-l-4 dark:border-fuchsia-400/60`,children:[(0,x.jsxs)("div",{className:`${U} text-fuchsia-700 dark:text-fuchsia-300`,children:["\u{1F3AF} ",o.statsMatchesHeading]}),(0,x.jsx)(E,{label:o.statPartialMatches,value:r(N.partialMatches??0),color:"text-fuchsia-700 dark:text-fuchsia-300"}),(0,x.jsx)(E,{label:o.statPerfectMatches,value:r(N.perfectMatches??0),color:"text-fuchsia-700 dark:text-fuchsia-300"}),(0,x.jsx)(E,{label:o.statEarlyTerminations,value:r(N.earlyTerminations??0),color:"text-fuchsia-700 dark:text-fuchsia-300"})]},"lev-match")),N.similarityThresholds&&ee.push((0,x.jsxs)("div",{className:`${Z} border-rose-200 border-l-4 dark:border-rose-400/60`,children:[(0,x.jsxs)("div",{className:`${U} text-rose-700 dark:text-rose-300`,children:["\u{1F4C8} ",o.statsSimilarityHeading]}),(0,x.jsx)(E,{label:o.statAbove80,value:r(N.similarityThresholds.above80??0),color:"text-emerald-700 dark:text-emerald-300"}),(0,x.jsx)(E,{label:o.statAbove60,value:r(N.similarityThresholds.above60??0),color:"text-lime-700 dark:text-lime-300"}),(0,x.jsx)(E,{label:o.statAbove40,value:r(N.similarityThresholds.above40??0),color:"text-orange-600 dark:text-orange-300"}),(0,x.jsx)(E,{label:o.statBelow40,value:r(N.similarityThresholds.below40??0),color:"text-red-600 dark:text-red-400"})]},"lev-similarity")),N.distanceDistribution){let I=Object.entries(N.distanceDistribution).sort(([,H],[,G])=>Number(G)-Number(H)).slice(0,6);I.length>0&&ee.push((0,x.jsxs)("div",{className:`${Z} border-indigo-200 border-l-4 dark:border-indigo-500/60`,children:[(0,x.jsxs)("div",{className:`${U} text-indigo-700 dark:text-indigo-300`,children:["\u{1F4CA} ",o.statsDistanceHeading]}),I.map(([H,G])=>(0,x.jsx)(E,{label:o.statDistance(H),value:r(Number(G)),unit:o.timesUnit(r(Number(G))),color:"text-indigo-700 dark:text-indigo-300"},H))]},"lev-distance"))}if(N.queryLengthStats){let I=Object.entries(N.queryLengthStats).sort(([,H],[,G])=>(G.count??0)-(H.count??0)).slice(0,6);I.length>0&&ee.push((0,x.jsxs)("div",{className:`${Z} border-violet-200 border-l-4 dark:border-violet-400/60`,children:[(0,x.jsxs)("div",{className:`${U} text-violet-700 dark:text-violet-300`,children:["\u{1F4CF} ",o.statsQueryLengthHeading]}),I.map(([H,G])=>{let ae=Number(G.count??0),ge=Number(G.averageScore??0);return(0,x.jsx)(E,{label:o.statQueryLength(H),value:o.statQueryLengthValue({count:ae,averagePercent:(ge*100).toFixed(1)}),color:"text-violet-700 dark:text-violet-300"},H)})]},"lev-query-length"))}}if(Object.keys(T).length>0){let I=Object.entries(T).sort(([,H],[,G])=>(G.averageScore??0)-(H.averageScore??0)).slice(0,6);ee.push((0,x.jsxs)("div",{className:`${Z} border-purple-200 border-l-4 dark:border-purple-400/60`,children:[(0,x.jsxs)("div",{className:`${U} text-purple-700 dark:text-purple-300`,children:["\u{1F4CB} ",o.statsFieldPerformanceHeading]}),I.map(([H,G])=>{let ae=G;return(0,x.jsxs)("div",{className:"space-y-1 rounded bg-purple-50/60 p-2 transition-colors dark:bg-slate-900/50",children:[(0,x.jsx)("div",{className:"font-semibold text-purple-700 text-xs transition-colors dark:text-purple-300",children:H}),(0,x.jsx)(E,{label:o.statAverageScore,value:`${((ae.averageScore??0)*100).toFixed(1)}%`,color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(E,{label:o.statMatchCount,value:r(ae.matchCount??0),unit:o.itemsUnit(r(ae.matchCount??0)),color:"text-purple-700 dark:text-purple-300"}),(0,x.jsx)(E,{label:o.statBestWorstScore,value:`${((ae.bestScore??0)*100).toFixed(1)}% / ${((ae.worstScore??0)*100).toFixed(1)}%`,color:"text-purple-700 dark:text-purple-300"})]},H)})]},"field-performance"))}if(S.bestPerformingField||S.totalHistoryEntries||S.similarityDistribution){let I=(S.recentAverageResultCount??0).toFixed(1);ee.push((0,x.jsxs)("div",{className:`${Z} border-blue-200 border-l-4 dark:border-blue-400/60`,children:[(0,x.jsxs)("div",{className:`${U} text-blue-700 dark:text-blue-300`,children:["\u{1F50D} ",o.statsInsightsHeading]}),S.bestPerformingField&&(0,x.jsx)(E,{label:o.statBestField,value:S.bestPerformingField,color:"text-blue-700 dark:text-blue-300"}),(0,x.jsx)(E,{label:o.statRecentAverageTime,value:(S.recentAverageProcessingTime??0).toFixed(2),unit:"ms",color:"text-blue-700 dark:text-blue-300"}),(0,x.jsx)(E,{label:o.statRecentAverageResults,value:I,unit:o.itemsUnit(I),color:"text-blue-700 dark:text-blue-300"}),(0,x.jsx)(E,{label:o.statThroughput,value:(S.throughputPerSecond??0).toFixed(2),unit:o.throughputUnit,color:"text-blue-700 dark:text-blue-300"}),(0,x.jsx)(E,{label:o.statCommonQueryLength,value:r(S.mostCommonQueryLength??0),unit:o.charactersUnit(r(S.mostCommonQueryLength??0)),color:"text-blue-700 dark:text-blue-300"}),(0,x.jsx)(E,{label:o.statHistoryEntries,value:r(S.totalHistoryEntries??0),color:"text-blue-700 dark:text-blue-300"}),S.similarityDistribution&&(0,x.jsxs)("div",{className:"mt-1 grid grid-cols-2 gap-1",children:[(0,x.jsx)(E,{label:o.statHighSimilarity,value:r(S.similarityDistribution.highSimilarity??0),color:"text-emerald-700 dark:text-emerald-300"}),(0,x.jsx)(E,{label:o.statMediumSimilarity,value:r(S.similarityDistribution.mediumSimilarity??0),color:"text-lime-700 dark:text-lime-300"}),(0,x.jsx)(E,{label:o.statLowSimilarity,value:r(S.similarityDistribution.lowSimilarity??0),color:"text-orange-600 dark:text-orange-300"}),(0,x.jsx)(E,{label:o.statVeryLowSimilarity,value:r(S.similarityDistribution.veryLowSimilarity??0),color:"text-red-600 dark:text-red-400"})]})]},"performance-insights"))}return K.length>0&&ee.push((0,x.jsxs)("div",{className:`${Z} border-sky-200 border-l-4 dark:border-sky-400/60`,children:[(0,x.jsxs)("div",{className:`${U} text-sky-700 dark:text-sky-300`,children:["\u{1F4C8} ",o.statsRecentHistoryHeading]}),K.slice(-3).reverse().map((I,H)=>(0,x.jsxs)("div",{className:"rounded bg-sky-50/70 p-2 transition-colors dark:bg-slate-900/50",children:[(0,x.jsx)("div",{className:"font-medium text-sky-700 transition-colors dark:text-sky-300",children:I.operationType}),(0,x.jsx)("div",{className:"text-sky-600 text-xs transition-colors dark:text-sky-200",children:o.statsHistoryEntry({processingTimeMs:I.processingTime.toFixed(2),resultCount:I.resultCount??0})}),me(I.timestamp)&&(0,x.jsx)("div",{className:"text-[10px] text-sky-500 transition-colors dark:text-sky-200",children:me(I.timestamp)})]},`${I.operationType}-${I.timestamp??H}`))]},"recent-history")),(0,x.jsxs)("section",{className:"space-y-2",children:[(0,x.jsxs)("div",{className:`flex items-center gap-2 font-semibold text-xs ${a}`,children:[(0,x.jsx)("span",{children:t}),(0,x.jsx)("span",{className:"tracking-wide",children:z})]}),(0,x.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:ee})]})});Et.displayName="WorkerStatsSection";var ne=require("react/jsx-runtime"),Ki={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},ba=(0,fa.memo)(({performanceMetrics:e,searchTerm:t,totalDataCount:n,resultsCount:a,resetStats:s,rebuildIndex:o,isIndexBuilding:r,activeTab:c,onTabChange:d})=>{let{locale:l,labels:u}=Te(),p=t.trim(),i=p?a:n,{setScrollableRef:m,onPointerDown:h,onPointerMove:C,onPointerUp:T,onPointerLeave:S,onPointerCancel:K,onClickCapture:V}=at(),f=c!=="index"||r,g=r?u.statsRebuildingTitle:c!=="index"?u.statsRebuildIndexTabOnlyTitle:u.statsRebuildTitle,v=f?"cursor-not-allowed bg-gray-300 text-gray-500 dark:bg-slate-700 dark:text-slate-400":"bg-blue-500 text-white hover:bg-blue-600 dark:bg-blue-500 dark:hover:bg-blue-600",M=r?`\u23F3 ${u.statsRebuilding}`:`\u{1F3D7}\uFE0F ${u.statsRebuild}`,z=(0,fa.useCallback)(()=>{o().catch(()=>{})},[o]);return(0,ne.jsxs)("div",{className:"wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border border-blue-300 bg-white p-1.5 shadow-md transition-colors dark:border-blue-500/40 dark:bg-slate-900/80 dark:shadow-blue-900/30",children:[(0,ne.jsxs)("div",{className:"mb-0.5 flex shrink-0 flex-col gap-1 rounded bg-blue-50 px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between dark:bg-blue-900/30",children:[(0,ne.jsxs)("h3",{className:"font-semibold text-gray-700 text-xs transition-colors dark:text-slate-100",children:["\u{1F4CA} ",u.searchStatistics]}),(0,ne.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,ne.jsx)("button",{type:"button",onClick:z,disabled:f,className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${v}`,title:g,children:M}),(0,ne.jsxs)("button",{type:"button",onClick:s,className:"rounded bg-red-500 px-1.5 py-0.5 text-[10px] text-white transition-colors hover:bg-red-600 dark:hover:bg-red-700",title:u.statsResetTitle,children:["\u{1F504} ",u.reset]})]})]}),(0,ne.jsx)("div",{className:"mb-0 shrink-0",children:(0,ne.jsxs)("div",{ref:m,className:"flex space-x-1 overflow-x-auto text-nowrap rounded-md bg-gray-100 p-0.5 transition-colors dark:bg-slate-800/80",style:Ki,onPointerDown:h,onPointerMove:C,onPointerUp:T,onPointerLeave:S,onPointerCancel:K,onClickCapture:V,children:[(0,ne.jsxs)("button",{type:"button",onClick:()=>d("overview"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${c==="overview"?"bg-blue-500 text-white dark:bg-blue-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CB} ",u.statsOverviewTab]}),(0,ne.jsxs)("button",{type:"button",onClick:()=>d("index"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${c==="index"?"bg-green-500 text-white dark:bg-green-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CA} ",u.statsIndexTab]}),(0,ne.jsxs)("button",{type:"button",onClick:()=>d("levenshtein"),className:`rounded px-1.5 py-0.5 text-[10px] transition-colors ${c==="levenshtein"?"bg-purple-500 text-white dark:bg-purple-500":"text-gray-600 hover:bg-gray-200 dark:text-slate-300 dark:hover:bg-slate-700/70"}`,children:["\u{1F4CF} ",u.statsLevenshteinTab]})]})}),(0,ne.jsxs)("div",{className:"flex flex-col gap-1 pb-0.5",children:[(0,ne.jsxs)("div",{className:`${c==="overview"?"grid":"hidden"} grid-cols-1 gap-2 pr-1 text-gray-600 text-xs transition-colors sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 dark:text-slate-300`,children:[(0,ne.jsx)(E,{label:u.statTotalSearches,value:Q(l,e.totalSearches)}),(0,ne.jsx)(E,{label:u.statAverageSearchTime,value:e.averageSearchTime.toFixed(1),unit:"ms"}),(0,ne.jsx)(E,{label:u.statDataCount,value:Q(l,e.itemCount)}),(0,ne.jsx)(E,{label:p?u.statResultCount:u.statDisplayedCount,value:Q(l,i)})]}),(0,ne.jsx)("div",{className:`${c==="index"?"space-y-3":"hidden"} pr-1 text-gray-600 text-xs transition-colors dark:text-slate-300`,children:(0,ne.jsx)(Et,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:"text-green-600 dark:text-green-300"})}),(0,ne.jsx)("div",{className:`${c==="levenshtein"?"space-y-3":"hidden"} pr-1 text-gray-600 text-xs transition-colors dark:text-slate-300`,children:(0,ne.jsx)(Et,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:"text-purple-600 dark:text-purple-300"})}),(0,ne.jsxs)("div",{className:"hidden",children:[(0,ne.jsx)(Et,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:"text-green-600 dark:text-green-300"}),(0,ne.jsx)(Et,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:"text-purple-600 dark:text-purple-300"})]})]})]})});ba.displayName="StatisticsPanel";var F=require("react/jsx-runtime"),ji=/[\u200B\uFEFF]/g,or=typeof window<"u",os=or&&typeof document<"u",ya=(e,t=[],n=!1)=>{let a=(0,B.useRef)(e);a.current=e,(0,B.useEffect)(()=>{if(!(!or||n&&!os))return a.current()},[n,...t])},Zo=(e,t,n)=>{let[a,s]=(0,B.useState)(()=>{let o=es(r=>r.getItem(e));return o&&t.includes(o)?o:n});return ya(()=>{es(o=>{o.setItem(e,a)})},[e,a]),[a,s]},es=e=>{if(!or)return null;try{return e(window.sessionStorage)}catch{return null}},ts=(e,t)=>{let[n,a]=(0,B.useState)(e);return(0,B.useEffect)(()=>{let s=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(s)}},[e,t]),n},Gi="contact-map.settings-tab",qi="contact-map.statistics-tab",Yi=["basic","advanced","index","levenshtein"],Qi=["overview","index","levenshtein"],ns=["full_name","company_name","department","title","email","company_phone_number","mobile_phone_number"],Xi={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},sr=({streamState:e,...t}={})=>e===void 0?(0,F.jsx)(Ji,{...t}):(0,F.jsx)(ss,{...t,streamState:e}),Ji=e=>{let{context:t}=kn();return(0,F.jsx)(ss,{...e,streamState:t})},Zi={setting:"ContactMapSearchPage workerUrls",keys:["indexWorker","levenshteinWorker"],hints:{treeWorker:"set treeWorker on ContactMapConfigProvider or ContactMapAppView"}},ss=e=>{let{streamState:t,onFooterVisibilityChange:n,children:a}=e,s=Se(e,"workerUrls"),o=qe(),{locale:r,labels:c}=Te(),{contactMapRecords:d,contactMapRecordMap:l,isStreamingComplete:u,isStreamingFailed:p}=t,i=(0,va.useNavigation)(),[m]=(0,va.useSearchParams)(),h=(0,B.useRef)(null),[C,T]=(0,B.useState)(!0),[S,K]=(0,B.useState)(o.openEmailsWithGmail??!1),{indexWorker:V,levenshteinWorker:f}=Mt(o.workerUrls,s,Zi),[g,v]=(0,B.useState)(()=>oa({indexWorker:V,levenshteinWorker:f})),[M,z]=(0,B.useState)(m.get("q")||""),b=ts(M,g.debounceMs??xa.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs);(0,B.useEffect)(()=>{let w=m.get("q")||"";z(O=>O!==w?w:O)},[m]),(0,B.useEffect)(()=>{if(typeof window>"u")return;let w=new URL(window.location.href);(w.searchParams.get("q")||"")!==b&&(b?w.searchParams.set("q",b):w.searchParams.delete("q"),window.history.replaceState(window.history.state,"",w.toString()))},[b]);let[N,Z]=(0,B.useTransition)(),[U,me]=(0,B.useState)("search"),[ee,I]=Zo(Gi,Yi,"basic"),[H,G]=Zo(qi,Qi,"overview"),{setScrollableRef:ae,onPointerDown:ge,onPointerMove:Ne,onPointerUp:bt,onPointerLeave:Ot,onPointerCancel:lt,onClickCapture:Dt}=at(),he=(0,B.useCallback)(()=>{if(!os)return;let w=h.current;!w||document.activeElement===w||window.requestAnimationFrame(()=>{try{w.focus({preventScroll:!0})}catch{}})},[]),_t=(0,B.useCallback)(w=>{let O=w;me(O),O==="search"&&he()},[he]),Ae=(0,B.useMemo)(()=>({...g,debounceMs:0}),[g]),[Qe,He]=(0,B.useState)("union"),De=Qe==="intersection",Wt=De?c.operatorAndTitle:c.operatorOrTitle,yt=(0,B.useCallback)(w=>(0,xa.parseQuerySets)(w,Qe),[Qe]),Y=(0,B.useMemo)(()=>({querySetsOf:yt}),[yt]),re=ts(d,u?0:800),{searchTerm:q,setSearchTerm:dt,filteredItems:At,resultTerm:Ht,isSearching:Xe,isIndexBuilding:_e,clearSearch:Ln,resetStats:sn,performanceMetrics:Ie,rebuildIndex:ln,error:ct}=(0,as.useFuzzySearch)(re,ns,Ae,Y),Fe=q.trim().length>0,[$e,dn]=(0,B.useState)(""),[It,Ft]=(0,B.useState)(()=>q),cn=(0,B.useMemo)(()=>Xn(M),[M]),pt=(0,B.useMemo)(()=>Xn(b),[b]);(0,B.useEffect)(()=>{b===$e&&pt===q||Z(()=>{dn(b),dt(pt)})},[b,$e,pt,q,dt]);let zt=(0,B.useCallback)(w=>{let ie=w.target.value.replace(ji,"");z(ie)},[]),Ut=(0,B.useCallback)(()=>{z(""),dn(""),Ln(),he()},[Ln,he]),En=(0,B.useCallback)(()=>{He(w=>w==="intersection"?"union":"intersection"),he()},[he]);ya(()=>{if(!(U==="search"&&i.state==="idle"&&!N))return;let O=document.activeElement;if(!!!(O?.matches('[role="tab"]')||O?.closest('[role="tablist"]')?.getAttribute("role")==="tablist")&&O&&O!==document.body&&O!==h.current)return;let Me=window.requestAnimationFrame(()=>{he()});return()=>{window.cancelAnimationFrame(Me)}},[U,i.state,N,he],!0),ya(()=>{if(U!=="search")return;let w=[[document,"visibilitychange",()=>{document.visibilityState==="visible"&&he()}],[window,"pageshow",()=>{he()}]];for(let[O,ie,Me]of w)O.addEventListener(ie,Me);return()=>{for(let[O,ie,Me]of w)O.removeEventListener(ie,Me)}},[U,he],!0),(0,B.useEffect)(()=>(n&&n(U==="search"?"mobile-hidden":"visible"),()=>{n&&n("visible")}),[U,n]),ya(()=>{let w=document.body,O=w.style.overflow;return U==="search"&&(w.style.overflow="hidden"),()=>{w.style.overflow=O}},[U],!0),(0,B.useEffect)(()=>{Ie&&Ge.info("\u{1F4CA} [STATE] \u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6307\u6A19\u304C\u66F4\u65B0\u3055\u308C\u307E\u3057\u305F:",{totalSearches:Ie.totalSearches,averageSearchTime:Ie.averageSearchTime,itemCount:Ie.itemCount,resultsCount:Ie.resultsCount,workersAvailable:!!Ie.workerStats})},[Ie]);let{isAwaitingDebounce:Bt,isAwaitingSearchTermSync:On,isSearchInProgress:Je}=(0,B.useMemo)(()=>{let w=cn!==pt,O=pt!==q,ie=q.trim().length>0||cn.trim().length>0;return{isAwaitingDebounce:w,isAwaitingSearchTermSync:O,isSearchInProgress:N||Xe||Ht!==q&&ct===null||ie&&_e||w||O||It!==q}},[cn,pt,q,Ht,ct,N,Xe,_e,It]),[$t,Ca]=(0,B.useState)(q);(0,B.useEffect)(()=>{$t!==q&&Ca(q)},[q,$t]),(0,B.useEffect)(()=>{Bt||On||N||Xe||_e||$t===q&&It!==q&&Ft(q)},[q,It,Bt,On,N,Xe,_e,$t]);let Dn=(0,B.useMemo)(()=>Hr($e,ns),[$e]),_n=(0,B.useMemo)(()=>Dn(At),[Dn,At]),pn=(0,B.useMemo)(()=>({contactMapRecords:d,contactMapRecordMap:l,filteredItems:_n,searchQuery:$e,searchTerm:q,isSearching:Xe,isIndexBuilding:_e,isPending:N,hasSearchTerm:Fe,enableHighlighting:C,openEmailsWithGmail:S,isSearchInProgress:Je,isSearchTabActive:U==="search",errorMessage:ct??null,isStreamingComplete:u,isStreamingFailed:p}),[d,l,_n,$e,q,Xe,_e,N,Fe,C,S,Je,U,ct,u,p]),Wn=Fe?At.length:d.length,An=Q(r,d.length),Hn=Q(r,At.length);return(0,F.jsx)("div",{className:`scrollbar-hidden bg-slate-50 text-slate-900 dark:bg-slate-900 dark:text-slate-100${U==="search"?" h-full min-h-0":""}`,children:(0,F.jsxs)(xn,{value:U,onValueChange:_t,className:`flex flex-col${U==="search"?" h-full min-h-0":""}`,children:[(0,F.jsxs)(Zt,{ref:ae,style:Xi,className:"scrollbar-none mt-0 mb-1 flex w-full touch-pan-x flex-nowrap overflow-x-auto overflow-y-hidden rounded-md bg-slate-50 transition-colors dark:bg-slate-900/70 dark:text-slate-200",onPointerDown:ge,onPointerMove:Ne,onPointerUp:bt,onPointerLeave:Ot,onPointerCancel:lt,onClickCapture:Dt,children:[(0,F.jsxs)(ht,{value:"search",className:"min-w-16 px-2 py-0.5 text-xs transition-colors sm:min-w-24 sm:px-2.5 sm:py-0.5 sm:text-xs dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100",children:["\u{1F50D} ",c.searchTab]}),(0,F.jsxs)(ht,{value:"settings",className:"min-w-16 px-2 py-0.5 text-xs transition-colors sm:min-w-24 sm:px-2.5 sm:py-0.5 sm:text-xs dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100",children:["\u2699\uFE0F ",c.searchSettings]}),(0,F.jsxs)(ht,{value:"statistics",className:"min-w-16 px-2 py-0.5 text-xs transition-colors sm:min-w-24 sm:px-2.5 sm:py-0.5 sm:text-xs dark:text-slate-300 dark:data-[state=active]:bg-slate-800 dark:data-[state=active]:text-slate-100",children:["\u{1F4CA} ",c.searchStatistics]})]}),(0,F.jsx)(ft,{value:"search",className:"mt-0 flex h-full min-h-0 flex-col overflow-hidden",children:(0,F.jsxs)("div",{className:"flex h-full flex-col",children:[(0,F.jsx)("div",{className:"rounded-md border border-gray-200 bg-white shadow-sm transition-colors dark:border-slate-700 dark:bg-slate-900/80 dark:shadow-none",children:(0,F.jsxs)("div",{className:"flex flex-col",children:[(0,F.jsx)("div",{className:"relative",children:(0,F.jsxs)("div",{className:"flex items-center gap-1 p-1",children:[(0,F.jsxs)("button",{type:"button",onClick:En,"aria-pressed":De,title:Wt,className:`inline-flex min-w-9 items-center justify-center gap-0.5 rounded border px-1.5 py-0.5 font-semibold text-[10px] transition-colors sm:min-w-12 sm:px-2 sm:py-0.5 sm:text-xs ${De?"border-blue-500 bg-blue-600 text-white hover:bg-blue-700 dark:border-blue-400 dark:bg-blue-500 dark:hover:bg-blue-600":"border-amber-400 bg-amber-100 text-amber-800 hover:bg-amber-200 dark:border-amber-500/70 dark:bg-amber-300/20 dark:text-amber-200 dark:hover:bg-amber-300/30"}`,children:[(0,F.jsx)("span",{className:"text-[10px] sm:text-xs",children:De?c.operatorAnd:c.operatorOr}),(0,F.jsx)("span",{className:"hidden text-[10px] sm:inline",children:De?c.operatorAndHint:c.operatorOrHint})]}),(0,F.jsx)("input",{ref:h,type:"text",value:M,onChange:zt,placeholder:c.searchPlaceholder,className:"flex-1 rounded border border-gray-300 border-solid px-2 py-0.5 text-xs shadow-sm transition-colors focus:border-blue-500 focus:ring-1 focus:ring-blue-500 sm:px-2 sm:py-0.5 sm:text-xs dark:border-slate-600 dark:bg-slate-950 dark:text-slate-100 dark:shadow-none"}),M&&(0,F.jsx)("button",{type:"button",onClick:Ut,className:"flex items-center justify-center gap-1 rounded border border-gray-300 px-1.5 py-0.5 text-[10px] transition-colors hover:text-gray-700 sm:px-2 sm:py-0.5 sm:text-xs dark:border-slate-600 dark:bg-slate-800/70 dark:text-slate-300 dark:hover:text-slate-100",title:Je?c.searchBusyTitle:c.clearSearch,disabled:Je,children:Je?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(rs.default,{"aria-hidden":"true",className:"h-3 w-3 animate-spin sm:h-3.5 sm:w-3.5"}),(0,F.jsx)("span",{className:"hidden sm:inline",children:c.searching})]}):"\u2715"})]})}),(0,F.jsxs)("p",{className:"px-1.5 py-0.5 text-[10px] text-slate-700 leading-snug transition-colors sm:text-[11px] dark:text-slate-200",children:[c.registeredCountLabel," ",(0,F.jsx)("span",{className:"font-semibold text-[11px] text-slate-900 sm:text-xs dark:text-white",children:An})," ",c.recordUnit(An),_e?(0,F.jsxs)("span",{className:"ml-1.5 inline-flex items-center rounded bg-blue-50 px-1.5 py-0.2 text-[10px] text-blue-700 sm:text-[11px] dark:bg-blue-900/40 dark:text-blue-200",children:["\u23F3 ",c.rebuildingIndex]}):null,ct?(0,F.jsxs)("span",{className:"ml-1.5 inline-flex items-center rounded bg-rose-50 px-1.5 py-0.2 text-[10px] text-rose-700 sm:text-[11px] dark:bg-rose-900/40 dark:text-rose-200",children:["\u26A0\uFE0F ",c.errorLabel,(0,F.jsx)("span",{className:"ml-1 break-all font-semibold",children:ct})]}):null,Fe&&(0,F.jsxs)("span",{className:"ml-1.5 text-[10px] text-blue-600 sm:text-[11px] dark:text-sky-400",children:["| ",c.resultCountLabel,Je?(0,F.jsx)("span",{className:"ml-1 font-semibold text-[10px] sm:text-[11px]",children:c.searching}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("span",{className:"ml-1 font-semibold text-[11px] text-slate-900 sm:text-xs dark:text-white",children:Hn}),(0,F.jsx)("span",{className:"ml-0.5 text-[10px] sm:text-[11px]",children:c.resultUnit(Hn)})]})]})]}),(0,F.jsx)("div",{className:"h-2.5 px-2 pb-1.5",children:_e?(0,F.jsx)(Va,{className:"h-1 bg-blue-200 dark:bg-blue-800",indicatorClassName:"bg-blue-500 dark:bg-blue-400"}):null})]})}),a?a(pn):(0,F.jsx)(nr,{context:pn})]})}),(0,F.jsx)(ft,{value:"settings",className:"mt-0",children:(0,F.jsx)(ga,{searchOptions:g,setSearchOptions:v,enableHighlighting:C,setEnableHighlighting:T,openEmailsWithGmail:S,setOpenEmailsWithGmail:K,activeTab:ee,onTabChange:I})}),(0,F.jsx)(ft,{value:"statistics",className:"mt-0",children:(0,F.jsx)(ba,{performanceMetrics:Ie,searchTerm:q,totalDataCount:d.length,resultsCount:Wn,resetStats:sn,rebuildIndex:ln,isIndexBuilding:_e,activeTab:H,onTabChange:G})})]})})};var Ye=require("react/jsx-runtime"),el=({renderHeader:e,title:t,onFooterVisibilityChange:n})=>{let a=X(),s=t===void 0?a.appTitle:t,{context:o,retryNow:r}=kn(),c=(0,Ye.jsx)(aa,{recordCount:o.contactMapRecords.length,companyCount:o.companyCount,phase:o.streamPhase,loadedCount:o.loadedCount,totalCount:o.totalCount,errorMessage:o.errorMessage,onRetry:r});return(0,Ye.jsxs)("div",{"data-testid":"contact-map-app-view",className:"flex h-full w-full flex-col",children:[e?e({title:s,annotation:c}):(0,Ye.jsxs)("div",{"data-testid":"contact-map-default-header",className:"mb-2 flex items-center justify-between",children:[(0,Ye.jsx)("h1",{className:"font-bold text-xl",children:s}),c]}),(0,Ye.jsx)("div",{className:"min-h-0 flex-1",children:(0,Ye.jsx)(sr,{streamState:o,onFooterVisibilityChange:n})})]})},tl=e=>{let t=qe(),n=Se(e,"streamEndpoint"),a=Se(e,"workerUrls"),s=Se(e,"locale"),o=Se(e,"labels"),r=(0,ir.useMemo)(()=>({...t,streamEndpoint:n===void 0?t.streamEndpoint:n,workerUrls:Mt(t.workerUrls,a,{setting:"ContactMapAppView workerUrls"}),locale:s===void 0?t.locale:s,labels:o===void 0?t.labels:o}),[t,n,a,s,o]),c=s!==void 0,d=o!==void 0,l=(0,ir.useMemo)(()=>({locale:c?"ContactMapAppView locale":"locale",labels:d?"ContactMapAppView labels":"labels"}),[c,d]);return(0,Ye.jsx)(Ba,{config:r,chromeSurface:l,children:(0,Ye.jsx)(el,{...e})})};Tt();de();var is=require("@aiquants/route-revalidation");var nl=(0,is.createShouldRevalidate)({submissions:"url",query:{ignore:[tn,"q"]}});0&&(module.exports={AdvancedSearchSettings,BasicSearchSettings,CONTACT_MAP_LABEL_CATALOGS,CONTACT_MAP_LABEL_KEYS,ContactDetailGrid,ContactDetailPanel,ContactDetailPopup,ContactDetailRowLayout,ContactMapAnnotation,ContactMapAppView,ContactMapConfigProvider,ContactMapSearchListView,ContactMapSearchPage,ContactMapSearchTabGroup,ContactMapSearchTreeView,ContactMapStreamClient,HighlightedText,IndexWorkerSettings,LIST_COLLAPSE_THRESHOLD,LIST_DETAIL_PANEL_MIN_WIDTH,LIST_EXPAND_THRESHOLD,LIST_PANEL_MIN_WIDTH,LIST_RESIZE_HANDLE_THICKNESS,LevenshteinWorkerSettings,Progress,SearchOptionsPanel,StatItem,StatisticsPanel,SwipeOverlay,TREE_COLLAPSE_THRESHOLD,TREE_DETAIL_PANEL_MIN_WIDTH,TREE_EXPAND_THRESHOLD,TREE_PANEL_MIN_WIDTH,TREE_RESIZE_HANDLE_THICKNESS,Tabs,TabsContent,TabsList,TabsTrigger,TreeWorkerSession,WorkerStatsSection,assertContactMapStreamEndpoint,assertContactMapTreeWorkerUrl,assertContactMapWorkerUrls,composeTreeVirtualScrollOptions,contactMapShouldRevalidate,countContactMapCompanies,deserializeStreamRecord,getContactMapStreamClient,getTreeWorkerSession,layerContactMapWorkerUrls,resetContactMapStreamClientForTesting,resetTreeWorkerSessionForTesting,resolveContactMapLabels,useAnimatedNumber,useContactMapConfig,useContactMapLabels,useContactMapStream,useContactPanelSizing,useDynamicViewportHeight,useHorizontalDragScroll,useLongPressPopup,useReportPopupVisibility,useResponsiveTwoColumnLayout,useRowPopupRegistry,useStreamedContactMapContext,useTreeWorker});