@aiquants/contact-map 0.22.0 → 0.23.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/README.md +59 -20
- package/dist/client.d.mts +6 -2
- package/dist/client.d.ts +6 -2
- package/dist/client.js +2 -2
- package/dist/client.mjs +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +4 -4
- package/dist/server.mjs +3 -3
- package/dist/{wire-CVZNwmQx.d.mts → wire-DxJO8OXK.d.mts} +3 -12
- package/dist/{wire-CVZNwmQx.d.ts → wire-DxJO8OXK.d.ts} +3 -12
- package/package.json +2 -1
package/dist/client.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var _i=Object.create;var tr=Object.defineProperty;var $i=Object.getOwnPropertyDescriptor;var Oi=Object.getOwnPropertyNames;var Ai=Object.getPrototypeOf,Di=Object.prototype.hasOwnProperty;var Re=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ra=(e,t)=>{for(var n in t)tr(e,n,{get:t[n],enumerable:!0})},Pa=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Oi(t))!Di.call(e,i)&&i!==n&&tr(e,i,{get:()=>t[i],enumerable:!(r=$i(t,i))||r.enumerable});return e};var Ce=(e,t,n)=>(n=e!=null?_i(Ai(e)):{},Pa(t||!e||!e.__esModule?tr(n,"default",{value:e,enumerable:!0}):n,e)),Wi=e=>Pa(tr({},"__esModule",{value:!0}),e);var Ze,zt,_a,ln,cn,Pn,yt,qe,nr,Kr,jr,it,se,Ut=Re(()=>{"use strict";Ze=e=>{if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null},zt=e=>!e||typeof e!="object"?null:"item"in e?e.item??null:"person_id"in e?e:null,_a=(e,t)=>{if(!e)return{value:null,fieldKey:null};for(let n of t){let r=Ze(e[n]);if(r)return{value:r,fieldKey:n}}return{value:null,fieldKey:null}},ln=e=>_a(e,["custom_email","email"]),cn=e=>_a(e,["custom_mobile_phone_number","mobile_phone_number","company_phone_number"]),Pn=e=>{let t=Ze(e);if(!t)return null;let n=t.replace(/[^0-9+#*]/g,"");return n.length===0?null:`tel:${n}`},yt=(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},qe=(e,t)=>String(e).padStart(t,"0"),nr=e=>`${qe(e.getUTCFullYear(),4)}-${qe(e.getUTCMonth()+1,2)}-${qe(e.getUTCDate(),2)}`,Kr=e=>`${nr(e)} ${qe(e.getUTCHours(),2)}:${qe(e.getUTCMinutes(),2)}:${qe(e.getUTCSeconds(),2)}`,jr=e=>`${qe(e.getFullYear(),4)}-${qe(e.getMonth()+1,2)}-${qe(e.getDate(),2)} ${qe(e.getHours(),2)}:${qe(e.getMinutes(),2)}:${qe(e.getSeconds(),2)}`,it=(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)},se=e=>e==null?"-":typeof e=="string"?Ze(e)??"-":typeof e=="number"?Number.isFinite(e)?String(e):"-":String(e)});var de,$a,Vt=Re(()=>{"use strict";de=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":$a(e);case"function":return $a(e);case"number":return Object.is(e,-0)?"-0":String(e);default:return String(e)}},$a=e=>{try{return Object.prototype.toString.call(e)}catch{return"[object ?]"}}});var dn,De,un=Re(()=>{"use strict";dn=e=>{if(typeof e!="object"||e===null)return!1;try{let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}catch{return!1}},De=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0});var Hi,rr,Gr=Re(()=>{"use strict";Hi=(e,t)=>{let n=Array.from({length:t.length+1},(r,i)=>i);for(let r=1;r<=e.length;r+=1){let i=[r];for(let o=1;o<=t.length;o+=1){let a=n[o-1]+(e[r-1]===t[o-1]?0:1);i.push(Math.min(n[o]+1,i[o-1]+1,a))}n=i}return n[t.length]},rr=(e,t)=>{let n=e.toLowerCase();if(n.length>=3){let i=t.find(o=>o.toLowerCase().startsWith(n));if(i!==void 0)return i}let r;for(let i of t){let o=Hi(n,i.toLowerCase());o<=Math.max(1,Math.floor(i.length/4))&&(r===void 0||o<r.distance)&&(r={key:i,distance:o})}return r?.key}});var bt,or,Ii,ie,Kt,ar,Aa,mn,st,Fi,Oa,Da,Bi,qr,zi,Ui,Vi,ir,Yr,Xr,jt=Re(()=>{"use strict";bt=require("@aiquants/directory-tree"),or=require("@aiquants/virtualscroll");Ut();Vt();un();Gr();Ii=Object.freeze({en:"en-US",ja:"ja-JP"}),ie=(e,t)=>t.toLocaleString(Ii[e]),Kt=(e,t,n)=>e==="1"?t:n,ar=Object.freeze({en:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"Total:",annotationCompaniesLabel:"Companies:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`Streaming (${ie("en",e)} / ${ie("en",t)} \xB7 ${n}%)`,annotationStreamingCount:e=>`Streaming (${ie("en",e)} loaded)`,streamLoadFailed:e=>`Failed to load (${ie("en",e)} received)`,annotationReconnecting:e=>`Reconnecting (${ie("en",e)} received)`,streamAuthRequired:"Session expired: sign in again, then retry",streamRetry:"Retry",recordUnit:e=>Kt(e,"record","records"),companyUnit:e=>Kt(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=>Kt(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=>ie("en",e),uncategorizedCompany:"Uncategorized",treeDirectoryName:(e,t)=>`${e} (${ie("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:Kr,recordDate:nr,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",statsTabsLabel:"Statistics tabs",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:jr,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=ie("en",e);return`${n} ${Kt(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: ${ie("en",t)}`,timesUnit:e=>Kt(e," time"," times"),itemsUnit:e=>Kt(e," item"," items"),charactersUnit:e=>Kt(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 (${ie("ja",e)} / ${ie("ja",t)} \u4EF6\u30FB${n}%)`,annotationStreamingCount:e=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${ie("ja",e)} \u4EF6)`,streamLoadFailed:e=>`\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F (${ie("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,annotationReconnecting:e=>`\u518D\u63A5\u7D9A\u4E2D (${ie("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,streamAuthRequired:"\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",streamRetry:"\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=>`${ie("ja",e)} \u500B`,uncategorizedCompany:"\u672A\u5206\u985E",treeDirectoryName:(e,t)=>`${e} (${ie("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:Kr,recordDate:nr,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",statsTabsLabel:"\u691C\u7D22\u7D71\u8A08\u30BF\u30D6",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:jr,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})=>`${ie("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: ${ie("ja",t)} \u4EF6`,timesUnit:()=>" \u56DE",itemsUnit:()=>" \u4EF6",charactersUnit:()=>" \u6587\u5B57",throughputUnit:" ops/\u79D2"})}),Aa=Object.freeze(Object.keys(ar.en)),mn=Object.freeze([...bt.DIRECTORY_TREE_LABEL_KEYS,...Aa]),st=Object.freeze({en:Object.freeze({...bt.DIRECTORY_TREE_LABEL_CATALOGS.en,...ar.en}),ja:Object.freeze({...bt.DIRECTORY_TREE_LABEL_CATALOGS.ja,...ar.ja})}),Fi=new Set(mn),Oa=Object.keys(st).map(e=>JSON.stringify(e)).join(" or "),Da=Object.freeze({locale:"locale",labels:"labels"}),Bi=(e,t,n)=>{e[t]=n},qr=(e,t=Da.locale)=>{if(e!==void 0&&typeof e!="string")throw new TypeError(`[contact-map] ${t} must be ${Oa} or left out; got ${de(e)}`);if(e!==void 0&&!Object.hasOwn(st,e))throw new RangeError(`[contact-map] ${t} must be ${Oa} or left out; got ${de(e)}`);return(0,or.resolveVirtualScrollLocale)(e)},zi=(e,t,n,r)=>{if(typeof r=="function"){if(typeof n!="function")throw new TypeError(`[contact-map] ${e}.${t} must be a function; got ${de(n)}`);return}if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string; got ${de(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${de(n)}`)},Ui=(e,t,n)=>{let r=Object.create(null);for(let i of Object.getOwnPropertyNames(e)){if(!Fi.has(i)){let a=rr(i,mn);throw new RangeError(`[contact-map] ${n} has a key that is not a label key (${a===void 0?"":`did you mean ${JSON.stringify(a)}? `}CONTACT_MAP_LABEL_KEYS lists every key); got ${de(i)}`)}let o=e[i];o!==void 0&&(zi(n,i,o,t[i]),r[i]=o)}return r},Vi=e=>{let t={},n=!1;for(let r of bt.DIRECTORY_TREE_LABEL_KEYS){let i=e[r];i!==void 0&&(t[r]=i,n=!0)}return n?t:void 0},ir=(e,t,n=Da)=>{let r=qr(e,n.locale);if(t===void 0)return st[r];if(!dn(t))throw new TypeError(`[contact-map] ${n.labels} must be a plain object or left out; got ${de(t)}`);let i=Ui(t,st[r],n.labels),a={...(0,bt.resolveDirectoryTreeLabels)(r,Vi(i)),...ar[r]};for(let u of Aa){let d=i[u];d!==void 0&&Bi(a,u,d)}return Object.freeze(a)},Yr=e=>{let t={};for(let n of bt.DIRECTORY_TREE_LABEL_KEYS)t[n]=e[n];return Object.freeze(t)},Xr=e=>{let t={};for(let n of or.VIRTUAL_SCROLL_LABEL_KEYS)t[n]=e[n];return Object.freeze(t)}});var Wa,Ha,lt,Fa,Ki,Jr,Qr,Ia,We,ne,he=Re(()=>{"use strict";Wa=require("@aiquants/directory-tree"),Ha=require("@aiquants/virtualscroll"),lt=require("react");jt();Fa=require("react/jsx-runtime"),Ki=Object.freeze({locale:"en",labels:st.en,treeLabels:Yr(st.en),engineLabels:Xr(st.en)}),Jr=(0,lt.createContext)(Ki),Qr=(e,t)=>{let n=(0,lt.useRef)(null),r=n.current;return r!==null&&t.every(i=>r[i]===e[i])?r:(n.current=e,e)},Ia=({locale:e,labels:t,surface:n,children:r})=>{let i=qr(e,n.locale),o=(0,lt.useMemo)(()=>ir(i,t,n),[i,t,n]),a=Qr(o,mn),u=Qr(Yr(a),Wa.DIRECTORY_TREE_LABEL_KEYS),d=Qr(Xr(a),Ha.VIRTUAL_SCROLL_LABEL_KEYS),c=(0,lt.useMemo)(()=>({locale:i,labels:a,treeLabels:u,engineLabels:d}),[i,a,u,d]);return(0,Fa.jsx)(Jr.Provider,{value:c,children:r})},We=()=>(0,lt.useContext)(Jr),ne=()=>(0,lt.useContext)(Jr).labels});var s,L,q,m,re,I,et,Ba,we,Gt,k,Pt,za,pe=Re(()=>{"use strict";s={fg:"text-[color:light-dark(#0f172b,#f8fafc)]",fgSecondary:"text-[color:light-dark(#314158,#e2e8f0)]",fgMuted:"text-[color:light-dark(#44536a,#cad5e2)]",onPrimary:"text-[color:light-dark(#ffffff,#0f172b)]"},L={surface:"bg-[color:light-dark(#ffffff,#0f172b)]",subtle:"bg-[color:light-dark(#f8fafc,#1d293d)]",muted:"bg-[color:light-dark(#f1f5f9,#1d293d)]"},q={borderSubtle:"border-[color:light-dark(#e2e8f0,#314158)]",borderControl:"border-[color:light-dark(#62748e,#90a1b9)]"},m={amber:"text-[color:light-dark(#7b3306,#fee685)]",blue:"text-[color:light-dark(#193cb8,#bedbff)]",cyan:"text-[color:light-dark(#104e64,#a2f4fd)]",emerald:"text-[color:light-dark(#004f3b,#a4f4cf)]",fuchsia:"text-[color:light-dark(#8a0194,#f6cfff)]",green:"text-[color:light-dark(#0d542b,#b9f8cf)]",indigo:"text-[color:light-dark(#372aac,#c6d2ff)]",lime:"text-[color:light-dark(#35530e,#d8f999)]",orange:"text-[color:light-dark(#7e2a0c,#ffd6a7)]",pink:"text-[color:light-dark(#a3004c,#fccee8)]",purple:"text-[color:light-dark(#6e11b0,#e9d4ff)]",red:"text-[color:light-dark(#9f0712,#ffc9c9)]",rose:"text-[color:light-dark(#a50036,#ffccd3)]",sky:"text-[color:light-dark(#024a70,#b8e6fe)]",teal:"text-[color:light-dark(#0b4f4a,#96f7e4)]",violet:"text-[color:light-dark(#5d0ec0,#ddd6ff)]"},re={amber:"bg-[color:light-dark(#fffbeb,#461901)]",blue:"bg-[color:light-dark(#eff6ff,#162456)]",emerald:"bg-[color:light-dark(#ecfdf5,#002c22)]",green:"bg-[color:light-dark(#f0fdf4,#032e15)]",purple:"bg-[color:light-dark(#faf5ff,#3c0366)]",rose:"bg-[color:light-dark(#fff1f2,#4d0218)]",sky:"bg-[color:light-dark(#f0f9ff,#052f4a)]"},I={amber:"border-[color:light-dark(#fee685,#7b3306)]",blue:"border-[color:light-dark(#bedbff,#193cb8)]",cyan:"border-[color:light-dark(#a2f4fd,#104e64)]",emerald:"border-[color:light-dark(#a4f4cf,#004f3b)]",fuchsia:"border-[color:light-dark(#f6cfff,#8a0194)]",green:"border-[color:light-dark(#b9f8cf,#0d542b)]",indigo:"border-[color:light-dark(#c6d2ff,#372aac)]",pink:"border-[color:light-dark(#fccee8,#a3004c)]",purple:"border-[color:light-dark(#e9d4ff,#6e11b0)]",rose:"border-[color:light-dark(#ffccd3,#a50036)]",sky:"border-[color:light-dark(#b8e6fe,#024a70)]",teal:"border-[color:light-dark(#96f7e4,#0b4f4a)]",violet:"border-[color:light-dark(#ddd6ff,#5d0ec0)]"},et={amber:"bg-[color:light-dark(#bb4d00,#fcbb00)]",blue:"bg-[color:light-dark(#155dfc,#51a2ff)]",emerald:"bg-[color:light-dark(#009966,#00d492)]",rose:"bg-[color:light-dark(#ec003f,#ff637e)]",sky:"bg-[color:light-dark(#0084d1,#00bcff)]"},Ba={amber:"border-[color:light-dark(#bb4d00,#fcbb00)]"},we={blue:"bg-[color:light-dark(#193cb8,#bedbff)]",green:"bg-[color:light-dark(#0d542b,#b9f8cf)]",orange:"bg-[color:light-dark(#7e2a0c,#ffd6a7)]",purple:"bg-[color:light-dark(#6e11b0,#e9d4ff)]",red:"bg-[color:light-dark(#9f0712,#ffc9c9)]"},Gt={blue:"hover:bg-[color:light-dark(#162456,#eff6ff)]",red:"hover:bg-[color:light-dark(#460809,#fef2f2)]"},k={hoverSurface:"hover:bg-[color:light-dark(#ffffff,#0f172b)]",hoverMuted:"hover:bg-[color:light-dark(#f1f5f9,#1d293d)]",hoverBlueTint:"hover:bg-[color:light-dark(#eff6ff,#162456)]",hoverRoseTint:"hover:bg-[color:light-dark(#fff1f2,#4d0218)]",hoverFg:"hover:text-[color:light-dark(#0f172b,#f8fafc)]",hoverFgSecondary:"hover:text-[color:light-dark(#314158,#e2e8f0)]",hoverBlueFg:"hover:text-[color:light-dark(#193cb8,#bedbff)]",hoverBlueAccentBorder:"hover:border-[color:light-dark(#155dfc,#51a2ff)]",focusRing:"focus:ring-[color:light-dark(#1447e6,#74d4ff)]",focusBorder:"focus:border-[color:light-dark(#1447e6,#74d4ff)]",focusVisibleRing:"focus-visible:ring-[color:light-dark(#1447e6,#74d4ff)]",focusVisibleOutline:"focus-visible:outline-[color:light-dark(#1447e6,#74d4ff)]",activeRowOutline:"in-focus-visible:data-[contact-map-row-active]:outline-[color:light-dark(#1447e6,#74d4ff)]",ringOffsetSurface:"ring-offset-[color:light-dark(#ffffff,#0f172b)]",selectedRing:"ring-[color:light-dark(#155dfc,#51a2ff)]",activeTabSurface:"data-[state=active]:bg-[color:light-dark(#ffffff,#0f172b)]",activeTabFg:"data-[state=active]:text-[color:light-dark(#0f172b,#f8fafc)]",activeTabBlueFg:"data-[state=active]:text-[color:light-dark(#193cb8,#bedbff)]",treeNameSky:"[&_.directory-tree-name]:text-[color:light-dark(#024a70,#b8e6fe)]"},Pt={mark:"bg-[color:light-dark(#fff085,#733e0a)]",progressTrack:"bg-[color:light-dark(#bedbff,#193cb8)]",scrim:"bg-[color:rgb(15_23_43/0.5)]"},za="#71829b"});var T,_t,_,Pe=Re(()=>{"use strict";T="text-[length:var(--aqcm-font-size-body,0.8125rem)] leading-[var(--aqcm-line-height-body,1.25rem)]",_t="text-[length:var(--aqcm-font-size-caption,0.6875rem)]",_=`${_t} leading-[var(--aqcm-line-height-caption,1.25rem)]`});var cr,dr,ur,mr,Zr=Re(()=>{"use strict";pe();cr="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]",dr=Object.freeze({right:"var(--aqcm-overlay-right, 0px)"}),ur=`absolute inset-0 ${Pt.scrim}`,mr=()=>!1});var ji,Gi,ct,Ua,Va,pn,fn=Re(()=>{"use strict";pe();ji="min-w-11 py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",Gi=2,ct=`focus-visible:outline-2 ${k.focusVisibleOutline} focus-visible:outline-offset-2`,Ua=`in-focus-visible:data-[contact-map-row-active]:outline-2 in-focus-visible:data-[contact-map-row-active]:-outline-offset-2 ${k.activeRowOutline}`,Va=Gi,pn=`inline-block max-w-full underline-offset-2 hover:underline focus-visible:underline ${ct} ${ji}`});function Oe(...e){return(0,ja.twMerge)((0,Ka.clsx)(e))}var Ka,ja,$n=Re(()=>{"use strict";Ka=require("clsx"),ja=require("tailwind-merge")});var Ga,qa,Ya,Xa,be,Qa,Y,qi,ze,Yi,Xi,Qi,On,hn,Ji,Zi,gn,ea,ta,An,na=Re(()=>{"use strict";Ga=require("@aiquants/swipe-overlay"),qa=Ce(require("lucide-react/dist/esm/icons/check.js")),Ya=Ce(require("lucide-react/dist/esm/icons/copy.js")),Xa=Ce(require("lucide-react/dist/esm/icons/x.js")),be=require("react"),Qa=require("react-dom");Ut();he();Zr();pe();fn();Pe();$n();Y=require("react/jsx-runtime"),qi=350,ze=e=>e.stopPropagation(),Yi=Object.freeze({onClick:ze,onDoubleClick:ze,onContextMenu:ze,onPointerDown:ze,onPointerUp:ze,onMouseDown:ze,onMouseUp:ze,onTouchStart:ze,onTouchEnd:ze,onKeyDown:ze,onKeyUp:ze,onFocus:ze,onBlur:ze}),Xi=Oe(cr,"flex items-center justify-center px-4 py-6"),Qi=`relative max-h-full w-full max-w-md overflow-y-auto overscroll-contain rounded-lg border ${q.borderControl} ${L.surface} p-4 shadow-lg transition-colors`,On=0,hn=null,Ji=()=>{let e=document.body.style;On+=1,On===1&&(hn={userSelect:e.userSelect,webkitUserSelect:e.webkitUserSelect}),e.userSelect="none",typeof e.webkitUserSelect<"u"&&(e.webkitUserSelect="none")},Zi=()=>{if(On=Math.max(0,On-1),On>0||!hn)return;let e=document.body.style;e.userSelect=hn.userSelect,typeof hn.webkitUserSelect<"u"&&(e.webkitUserSelect=hn.webkitUserSelect),hn=null},gn=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},ea=(e,t)=>{let n=new Set;return e.reduce((r,i)=>{let o=typeof i.value=="string"?i.value.trim():"";if(!o)return r;let{normalized:a,key:u,entry:d}=t(o,i);return a&&!n.has(u)&&(n.add(u),r.push(d(a))),r},[])},ta=({value:e,ariaLabel:t})=>{let[n,r]=(0,be.useState)(!1),i=(0,be.useRef)(null),o=(0,be.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 c=document.createElement("textarea");c.value=d,c.setAttribute("readonly",""),c.style.position="absolute",c.style.left="-9999px",document.body.appendChild(c),c.select(),c.setSelectionRange(0,c.value.length);let f=document.execCommand("copy");return document.body.removeChild(c),f},[]),a=(0,be.useCallback)(async d=>{d.preventDefault(),d.stopPropagation(),i.current!==null&&typeof window<"u"&&(window.clearTimeout(i.current),i.current=null);let c=await o(e);r(c),c&&typeof window<"u"&&(i.current=window.setTimeout(()=>{r(!1),i.current=null},1500))},[o,e]);(0,be.useEffect)(()=>()=>{i.current!==null&&typeof window<"u"&&(window.clearTimeout(i.current),i.current=null)},[]);let u=n?qa.default:Ya.default;return(0,Y.jsx)("button",{type:"button",className:`inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md border ${q.borderControl} ${s.fgMuted} transition-colors ${k.hoverMuted} ${ct}`,onClick:a,"aria-label":t,title:t,children:(0,Y.jsx)(u,{className:"h-3.5 w-3.5","aria-hidden":"true"})})},An=({contactData:e,openEmailsWithGmail:t,openGmailCompose:n,onRequestClose:r})=>{let i=ne(),o=(0,be.useRef)(null),a=(0,be.useMemo)(()=>e.contacted_at?it(e.contacted_at,i.recordDate):null,[e.contacted_at,i.recordDate]),u=gn(e.full_name)??i.noName,d=gn(e.company_name),c=gn(e.department),f=gn(e.title),p=(0,be.useMemo)(()=>ea([{fieldKey:"company_name",label:i.fieldCompanyName,value:d},{fieldKey:"department",label:i.fieldDepartment,value:c},{fieldKey:"title",label:i.fieldTitle,value:f}],(x,{fieldKey:P,label:K})=>({normalized:x,key:`${P}-${x.toLowerCase()}`,entry:S=>({fieldKey:P,label:K,value:S})})),[d,c,f,i]),l=(0,be.useMemo)(()=>ea([{fieldKey:"custom_mobile_phone_number",label:i.popupCustomMobilePhone,value:e.custom_mobile_phone_number},{fieldKey:"mobile_phone_number",label:i.popupMobilePhone,value:e.mobile_phone_number},{fieldKey:"custom_company_phone_number",label:i.popupCustomCompanyPhone,value:e.custom_company_phone_number},{fieldKey:"company_phone_number",label:i.popupCompanyPhone,value:e.company_phone_number}],(x,{fieldKey:P,label:K})=>{let S=Pn(x);return{normalized:gn(x),key:(S??x).toLowerCase(),entry:le=>({fieldKey:P,label:K,value:le,href:S})}}),[e.custom_mobile_phone_number,e.mobile_phone_number,e.custom_company_phone_number,e.company_phone_number,i]),g=(0,be.useMemo)(()=>ea([{fieldKey:"custom_email",label:i.popupCustomEmail,value:e.custom_email},{fieldKey:"email",label:i.popupEmail,value:e.email}],(x,{fieldKey:P,label:K})=>{let S=gn(x),R=yt(x,t),le=!!R?.startsWith("https://mail.google.com");return{normalized:S,key:x.toLowerCase(),entry:j=>({fieldKey:P,label:K,value:j,href:R,isGmailLink:le})}}),[e.custom_email,e.email,t,i]),y=l.length>0||g.length>0,N=(0,be.useId)(),w=(0,be.useCallback)(()=>{r(),o.current=null},[r]),M=(0,be.useCallback)(x=>x.ownerDocument.getElementById(N),[N]),{dialogProps:Q,backdropProps:X}=(0,Ga.useOverlayDialog)({isOpen:!0,onClose:w,isCloseBlocked:mr,initialFocus:M}),b=(0,be.useCallback)((x,P)=>{P.isGmailLink&&(x.preventDefault(),n(P.value))},[n]),h=(0,be.useCallback)((x,P)=>{if(!P.isGmailLink){o.current=null;return}let K=Date.now(),S=o.current;if(S&&S.email===P.value&&K-S.timestamp<=qi){o.current=null,x.preventDefault(),n(P.value);return}o.current={email:P.value,timestamp:K}},[n]);return(0,be.useEffect)(()=>(Ji(),Zi),[]),(0,Qa.createPortal)((0,Y.jsxs)("dialog",{...Q,...Yi,"data-contact-popup-root":"true","aria-labelledby":N,className:Xi,style:dr,children:[(0,Y.jsx)("div",{...X,"data-contact-popup-backdrop":"",className:ur}),(0,Y.jsxs)("div",{"data-contact-popup-card":"",className:Qi,children:[(0,Y.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,Y.jsx)("h2",{id:N,tabIndex:-1,className:`wrap-break-word min-w-0 font-semibold ${s.fg} text-lg outline-none`,children:u}),(0,Y.jsx)("button",{type:"button",className:`inline-flex shrink-0 items-center justify-center rounded-md p-3.5 ${s.fgMuted} transition-colors ${k.hoverMuted} ${ct}`,onClick:w,"aria-label":i.close,children:(0,Y.jsx)(Xa.default,{className:"h-4 w-4","aria-hidden":"true"})})]}),p.length>0?(0,Y.jsx)("div",{className:`mt-2 space-y-2 ${s.fgSecondary} text-sm`,children:p.map(x=>(0,Y.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Y.jsx)("p",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:x.value}),(0,Y.jsx)(ta,{value:x.value,ariaLabel:i.copyField(x.label)})]},x.fieldKey))}):null,(0,Y.jsxs)("div",{className:`mt-4 space-y-4 ${s.fgSecondary}`,children:[l.length>0?(0,Y.jsx)("div",{children:(0,Y.jsx)("ul",{className:"space-y-3 text-sm",children:l.map(x=>(0,Y.jsx)("li",{className:"flex items-start gap-3",children:(0,Y.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,Y.jsx)("span",{className:`${s.fgMuted} text-xs`,children:x.label}),(0,Y.jsxs)("div",{className:"mt-1 flex items-center gap-3",children:[(0,Y.jsx)("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:x.href?(0,Y.jsx)("a",{href:x.href,className:`wrap-break-word ${m.blue} ${pn}`,children:x.value}):(0,Y.jsx)("span",{className:`wrap-break-word ${s.fg}`,children:x.value})}),(0,Y.jsx)(ta,{value:x.value,ariaLabel:i.copyField(x.label)})]})]})},`${x.fieldKey}-${x.value}`))})}):null,g.length>0?(0,Y.jsx)("div",{children:(0,Y.jsx)("ul",{className:"space-y-3 text-sm",children:g.map(x=>(0,Y.jsx)("li",{className:"flex items-start gap-3",children:(0,Y.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,Y.jsx)("span",{className:`${s.fgMuted} text-xs`,children:x.label}),(0,Y.jsxs)("div",{className:"mt-1 flex items-start gap-3",children:[(0,Y.jsxs)("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:[x.href?(0,Y.jsx)("a",{href:x.href,className:`wrap-break-word ${m.blue} ${pn}`,target:x.isGmailLink?"_blank":void 0,rel:x.isGmailLink?"noopener noreferrer":void 0,onDoubleClick:P=>b(P,x),onTouchEnd:P=>h(P,x),children:x.value}):(0,Y.jsx)("span",{className:`wrap-break-word ${s.fg}`,children:x.value}),x.isGmailLink?(0,Y.jsx)("span",{className:`mt-1 block ${_} ${s.fgMuted}`,children:i.popupGmailHint}):null]}),(0,Y.jsx)(ta,{value:x.value,ariaLabel:i.copyField(x.label)})]})]})},`${x.fieldKey}-${x.value}`))})}):null,a?(0,Y.jsxs)("div",{className:`mt-2 flex items-center gap-2 ${s.fgMuted} text-sm`,children:[(0,Y.jsx)("span",{className:"text-xs",children:i.popupLastContactDate}),(0,Y.jsx)("span",{children:a})]}):null,y?null:(0,Y.jsx)("p",{className:`${s.fgMuted} text-sm`,children:i.popupNoContactMethods})]})]})]}),document.body)}});var xe,Dn,ra=Re(()=>{"use strict";pe();Pe();xe=require("react/jsx-runtime"),Dn=({fullName:e,title:t="-",companyName:n="-",department:r="-",phoneNumber:i="-",email:o="-",updatedAtText:a="-"})=>(0,xe.jsxs)("div",{className:`flex h-full w-full flex-col justify-center gap-0.5 ${s.fg} 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]`,children:[(0,xe.jsxs)("div",{className:"flex items-center gap-1 sm:hidden",children:[(0,xe.jsx)("div",{className:`flex-1 truncate font-medium ${s.fg} text-sm leading-tight`,children:e}),(0,xe.jsx)("div",{className:`shrink-0 whitespace-nowrap ${_t} ${s.fgMuted}`,children:i})]}),(0,xe.jsx)("div",{className:"flex items-center gap-1 sm:hidden",children:(0,xe.jsx)("div",{className:`flex-1 truncate ${s.fgSecondary} text-xs leading-tight`,children:n})}),(0,xe.jsx)("div",{className:"block sm:hidden",children:(0,xe.jsx)("span",{className:`w-full truncate text-left ${_t} ${s.fgSecondary} leading-tight`,children:r})}),(0,xe.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,xe.jsx)("span",{className:`truncate font-medium ${s.fg}`,children:e}),(0,xe.jsx)("span",{className:`truncate ${s.fgMuted} text-xs`,children:t})]}),(0,xe.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,xe.jsx)("span",{className:`truncate ${s.fg}`,children:n}),(0,xe.jsx)("span",{className:`truncate ${s.fgMuted} text-xs`,children:r})]}),(0,xe.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,xe.jsx)("span",{className:`truncate ${s.fgSecondary}`,children:i}),(0,xe.jsx)("span",{className:`truncate ${s.fgMuted} text-xs`,children:o})]}),(0,xe.jsx)("div",{className:`hidden items-end justify-end ${_t} ${s.fgMuted} xl:flex`,children:(0,xe.jsx)("span",{className:"truncate",children:a})})]})});var pr,yn,eo,es,ts,ns,rs,to,no,as,os,is,ss,ls,cs,ds,us,ro,ao,Ja,Za,fr,ms,ps,aa,oo,oa=Re(()=>{"use strict";pr=require("@aiquants/fuzzy-search"),yn=require("@aiquants/select-box"),eo=/[]/g,es=/^[\s ]+|[\s ]+$/g,ts=/\s+/,ns=/^[\p{Script=Latin}\s]+$/u,rs=/\p{Script=Latin}/u,to=Object.freeze({convertWidth:!0,convertKana:!0,convertCase:!0,convertRomaji:!1,normalizeVariants:!1,ignoreSpaces:!1,ignoreSymbols:!1,ignoreLongVowels:!1}),no="union",as=65377,os=65439,is=["\uFF9E","\uFF9F"],ss=(()=>{let e=new Map;for(let t=as;t<=os;t+=1){let n=String.fromCharCode(t);e.set(n.normalize("NFKC"),n);for(let r of is){let i=(n+r).normalize("NFKC");i.length===1&&e.set(i,n+r)}}return e})(),ls=/[-ヿ]/u,cs=e=>{let t=Array.from(e,n=>ss.get(n)??n).join("");return ls.test(t)?null:t},ds=e=>(0,yn.normalizeText)(e.replace(eo,"").replace(es,""),to),us=e=>{if(!ns.test(e))return null;let t=(0,yn.romajiToKatakana)(e);return rs.test(t)?null:t},ro=e=>e.split(ts).filter(Boolean),ao=e=>(0,pr.parseQuerySets)(e,no).sets.map(({query:t})=>t),Ja=e=>ao(e).flatMap(t=>ro(t)),Za=e=>(0,pr.formatQuerySets)({combine:no,sets:Array.from(new Set(e),t=>({query:t}))}),fr=e=>{let t=ao(e.replace(eo,"")).map(r=>ro(ds(r)).join(" ")).filter(r=>r!==""),n=[];for(let r of t){let i=us(r);if(i===null)return Za(t);n.push(i)}return Za(n)},ms=e=>{let t=new Set([...Ja(e),...Ja(fr(e))]),n=new Set;for(let r of t)for(let i of(0,yn.getNormalizedVariants)(r,to)){let o=i.trim();if(!o)continue;n.add(o);let a=cs(o);a!==null&&n.add(a)}return Array.from(n)},ps=/[.*+?^${}()|[\]\\]/g,aa=e=>{let t=ms(e);if(t.length===0)return null;let n=t.map(r=>r.replace(ps,"\\$&")).sort((r,i)=>i.length-r.length);return new RegExp(n.join("|"),"gi")},oo=(e,t)=>{let n=aa(e);if(n===null)return i=>i;let r=i=>t.some(o=>{let a=i[o];return typeof a=="string"&&a.search(n)!==-1});return i=>{let o=[],a=[];for(let u of i)r(u.item)?o.push(u):a.push(u);return[...o,...a]}}});var io,St,fs,Le,gr=Re(()=>{"use strict";io=require("react");oa();pe();St=require("react/jsx-runtime"),fs=`rounded ${Pt.mark} px-1 ${s.fg}`,Le=(0,io.memo)(({text:e,query:t,enabled:n=!0})=>{if(!(n&&t?.trim()&&e))return(0,St.jsx)(St.Fragment,{children:e});let r=aa(t);if(r===null)return(0,St.jsx)(St.Fragment,{children:e});let i=[],o=0,a=r.exec(e),u=0;for(;a;){let d=a[0],c=a.index;if(c>o&&i.push(e.substring(o,c)),d.length===0){r.lastIndex++,a=r.exec(e);continue}i.push((0,St.jsx)("mark",{className:fs,children:d},`highlight-${c}-${u}`)),o=c+d.length,u+=1,a=r.exec(e)}return o<e.length&&i.push(e.substring(o)),(0,St.jsx)(St.Fragment,{children:i})});Le.displayName="HighlightedText"});var so={};Ra(so,{ContactDetailGrid:()=>ia,default:()=>gs});var yr,Ot,hr,ia,gs,lo=Re(()=>{"use strict";yr=require("react");Ut();he();na();ra();gr();Ot=require("react/jsx-runtime"),hr=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},ia=({contactData:e,searchTerm:t,enableHighlighting:n,openEmailsWithGmail:r,openGmailCompose:i,isPopupVisible:o,onRequestClose:a})=>{let u=ne(),d=(0,yr.useMemo)(()=>ln(e),[e]),c=(0,yr.useMemo)(()=>cn(e),[e]),f=d.value??"-",p=c.value??"-",l=(0,yr.useMemo)(()=>it(e.updated_at,u.recordDateTime),[e.updated_at,u.recordDateTime]),g=hr(e.full_name)??u.noName,y=hr(e.company_name),N=hr(e.department),w=(M,Q="-")=>(0,Ot.jsx)(Le,{text:M??Q,query:t,enabled:n});return(0,Ot.jsxs)(Ot.Fragment,{children:[(0,Ot.jsx)(Dn,{fullName:w(g),title:w(hr(e.title)),companyName:w(y),department:w(N),phoneNumber:p,email:w(f),updatedAtText:l}),o?(0,Ot.jsx)(An,{contactData:e,openEmailsWithGmail:r,openGmailCompose:i,onRequestClose:a}):null]})},gs=ia});var Al={};Ra(Al,{AdvancedSearchSettings:()=>sr,BasicSearchSettings:()=>lr,CONTACT_MAP_LABEL_CATALOGS:()=>st,CONTACT_MAP_LABEL_KEYS:()=>mn,ContactDetailGrid:()=>ia,ContactDetailPanel:()=>Yt,ContactDetailPopup:()=>An,ContactDetailRowLayout:()=>Dn,ContactMapAnnotation:()=>Cr,ContactMapAppView:()=>$l,ContactMapConfigProvider:()=>Ro,ContactMapSearchListView:()=>ga,ContactMapSearchPage:()=>La,ContactMapSearchTabGroup:()=>Ta,ContactMapSearchTreeView:()=>xa,ContactMapStreamAnnouncer:()=>Ir,ContactMapStreamClient:()=>Hn,ContactMapStreamFailureNotice:()=>Fr,HighlightedText:()=>Le,IndexWorkerSettings:()=>wr,LIST_COLLAPSE_THRESHOLD:()=>Vs,LIST_DETAIL_PANEL_MIN_WIDTH:()=>Ko,LIST_EXPAND_THRESHOLD:()=>Ks,LIST_PANEL_MIN_WIDTH:()=>Vo,LIST_RESIZE_HANDLE_THICKNESS:()=>jo,LevenshteinWorkerSettings:()=>Rr,Progress:()=>ua,SearchOptionsPanel:()=>Pr,StatItem:()=>D,StatisticsPanel:()=>Or,SwipeOverlay:()=>Kn,TREE_COLLAPSE_THRESHOLD:()=>al,TREE_DETAIL_PANEL_MIN_WIDTH:()=>mi,TREE_EXPAND_THRESHOLD:()=>ol,TREE_PANEL_MIN_WIDTH:()=>ui,TREE_RESIZE_HANDLE_THICKNESS:()=>pi,Tabs:()=>Wn,TabsContent:()=>Dt,TabsList:()=>bn,TabsTrigger:()=>At,TreeWorkerSession:()=>jn,WorkerStatsSection:()=>en,assertContactMapStreamEndpoint:()=>In,assertContactMapTreeWorkerUrl:()=>la,assertContactMapWorkerUrls:()=>Cs,composeTreeVirtualScrollOptions:()=>fi,contactMapShouldRevalidate:()=>Ol,countContactMapCompanies:()=>Oo,deserializeStreamRecord:()=>Po,getContactMapStreamClient:()=>_o,getTreeWorkerSession:()=>ei,layerContactMapWorkerUrls:()=>Xt,resetContactMapStreamClientForTesting:()=>Ls,resetTreeWorkerSessionForTesting:()=>nl,resolveContactMapLabels:()=>ir,useAnimatedNumber:()=>ya,useContactMapConfig:()=>ut,useContactMapLabels:()=>ne,useContactMapStream:()=>$o,useContactPanelSizing:()=>Er,useDynamicViewportHeight:()=>ma,useHorizontalDragScroll:()=>Ct,useLongPressPopup:()=>Un,useReportPopupVisibility:()=>qo,useResponsiveTwoColumnLayout:()=>Vn,useRowPopupRegistry:()=>Go,useStreamedContactMapContext:()=>Fn,useTreeWorker:()=>ba});module.exports=Wi(Al);var qt=require("@aiquants/fuzzy-search"),_n=require("react");he();pe();Pe();var ve=require("react/jsx-runtime"),sr=(0,_n.memo)(({searchOptions:e,setSearchOptions:t})=>{let n=ne(),r=`flex flex-col gap-1 rounded-md border ${L.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=(0,_n.useId)(),a=(0,_n.useId)(),u=[];return u.push((0,ve.jsxs)("div",{className:`${r} ${I.sky} border-l-4`,children:[(0,ve.jsxs)("div",{className:`${i} ${m.sky}`,children:["\u{1F4D8} ",n.advancedLearningHeading]}),(0,ve.jsx)("label",{htmlFor:o,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:n.advancedLearningLabel}),(0,ve.jsx)("input",{id:o,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.learningWeight||qt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight,onChange:d=>t(c=>({...c,learningWeight:parseFloat(d.target.value)})),className:"h-11 w-full"}),(0,ve.jsxs)("span",{className:`${m.sky} text-xs`,children:[n.currentValueLabel," ",e.learningWeight||qt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight]}),(0,ve.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.advancedLearningHint})]},"learning")),u.push((0,ve.jsxs)("div",{className:`${r} ${I.indigo} border-l-4`,children:[(0,ve.jsxs)("div",{className:`${i} ${m.indigo}`,children:["\u23F1\uFE0F ",n.advancedDebounceHeading]}),(0,ve.jsx)("label",{htmlFor:a,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:n.advancedDebounceLabel}),(0,ve.jsx)("input",{id:a,type:"range",min:"100",max:"1000",step:"50",value:e.debounceMs??qt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs,onChange:d=>t(c=>({...c,debounceMs:parseInt(d.target.value,10)})),className:"h-11 w-full"}),(0,ve.jsxs)("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.debounceMs??qt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs]}),(0,ve.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.advancedDebounceHint})]},"debounce")),(0,ve.jsxs)("section",{className:"space-y-3",children:[(0,ve.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,ve.jsxs)("div",{className:`flex items-center gap-2 font-semibold ${s.fgSecondary} text-xs transition-colors`,children:[(0,ve.jsx)("span",{children:"\u26A1"}),(0,ve.jsx)("span",{className:"tracking-wide",children:n.settingsAdvancedTab})]}),(0,ve.jsx)("button",{type:"button",onClick:()=>t(d=>({...d,learningWeight:qt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight,debounceMs:qt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${q.borderControl} ${L.muted} px-2 font-medium ${s.fgSecondary} ${T} transition-colors ${k.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),(0,ve.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:u})]})});sr.displayName="AdvancedSearchSettings";var $t=require("@aiquants/fuzzy-search"),Be=require("react");he();pe();Pe();var O=require("react/jsx-runtime"),lr=(0,Be.memo)(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:r,openEmailsWithGmail:i,setOpenEmailsWithGmail:o})=>{let a=ne(),u=`flex flex-col gap-1 rounded-md border ${L.surface} px-2 py-1 shadow-sm transition-colors`,d="text-xs font-semibold",c=(0,Be.useId)(),f=(0,Be.useId)(),p=(0,Be.useId)(),l=(0,Be.useId)(),g=(0,Be.useId)(),y=(0,Be.useId)(),N=(0,Be.useId)(),w=(0,Be.useId)(),M=(0,Be.useId)(),Q=(0,Be.useId)(),X=[];return X.push((0,O.jsxs)("div",{className:`${u} ${I.blue} border-l-4`,children:[(0,O.jsxs)("div",{className:`${d} ${m.blue}`,children:["\u{1F3AF} ",a.basicThresholdHeading]}),(0,O.jsx)("label",{htmlFor:c,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:a.basicThresholdLabel}),(0,O.jsx)("input",{id:c,type:"range",min:"0.0",max:e.sortBy==="relevance"?"1.5":"1.0",step:"0.05",value:e.threshold??$t.DEFAULT_FUZZY_SEARCH_OPTIONS.threshold,onChange:b=>t(h=>({...h,threshold:parseFloat(b.target.value)})),className:"h-11 w-full"}),(0,O.jsxs)("span",{className:`${m.blue} text-xs`,children:[a.currentValueLabel," ",e.threshold??$t.DEFAULT_FUZZY_SEARCH_OPTIONS.threshold]}),(0,O.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:e.sortBy==="relevance"?a.basicThresholdRangeRelevance:a.basicThresholdRange})]},"threshold")),X.push((0,O.jsxs)("div",{className:`${u} ${I.amber} border-l-4`,children:[(0,O.jsxs)("div",{className:`${d} ${m.amber}`,children:["\u{1FA84} ",a.basicDisplayHeading]}),(0,O.jsxs)("label",{htmlFor:f,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${T} transition-colors`,children:[(0,O.jsx)("input",{id:f,type:"checkbox",checked:e.caseSensitive??$t.DEFAULT_FUZZY_SEARCH_OPTIONS.caseSensitive,onChange:b=>t(h=>({...h,caseSensitive:b.target.checked})),className:"h-3 w-3"}),a.basicCaseSensitive]}),(0,O.jsxs)("label",{htmlFor:p,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${T} transition-colors`,children:[(0,O.jsx)("input",{id:p,type:"checkbox",checked:n,onChange:b=>r(b.target.checked),className:"h-3 w-3"}),a.basicHighlight]}),(0,O.jsxs)("label",{htmlFor:l,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${T} transition-colors`,children:[(0,O.jsx)("input",{id:l,type:"checkbox",checked:i,onChange:b=>o(b.target.checked),className:"h-3 w-3"}),a.basicOpenEmailsWithGmail]}),(0,O.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,O.jsx)("label",{htmlFor:g,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:a.basicMultiTermOperator}),(0,O.jsxs)("select",{id:g,value:e.multiTermOperator??$t.DEFAULT_FUZZY_SEARCH_OPTIONS.multiTermOperator,onChange:b=>t(h=>({...h,multiTermOperator:b.target.value})),className:`min-h-11 rounded border ${q.borderControl} px-2 pointer-coarse:text-base ${T} transition-colors ${L.surface} ${s.fg}`,children:[(0,O.jsx)("option",{value:"or",children:a.basicOperatorOr}),(0,O.jsx)("option",{value:"and",children:a.basicOperatorAnd})]}),(0,O.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:a.basicMultiTermHint})]})]},"display")),X.push((0,O.jsxs)("div",{className:`${u} ${I.emerald} border-l-4`,children:[(0,O.jsxs)("div",{className:`${d} ${m.emerald}`,children:["\u{1F4DA} ",a.basicSortHeading]}),(0,O.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,O.jsx)("label",{htmlFor:y,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:a.basicSortBy}),(0,O.jsxs)("select",{id:y,value:e.sortBy||$t.DEFAULT_FUZZY_SEARCH_OPTIONS.sortBy,onChange:b=>t(h=>({...h,sortBy:b.target.value})),className:`min-h-11 rounded border ${q.borderControl} px-2 pointer-coarse:text-base ${T} transition-colors ${L.surface} ${s.fg}`,children:[(0,O.jsx)("option",{value:"score",children:a.basicSortByScore}),(0,O.jsx)("option",{value:"relevance",children:a.basicSortByRelevance}),(0,O.jsx)("option",{value:"original",children:a.basicSortByOriginal})]})]}),(0,O.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,O.jsx)("label",{htmlFor:N,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:a.basicSortOrder}),(0,O.jsxs)("select",{id:N,value:e.sortOrder||$t.DEFAULT_FUZZY_SEARCH_OPTIONS.sortOrder,onChange:b=>t(h=>({...h,sortOrder:b.target.value})),className:`min-h-11 rounded border ${q.borderControl} px-2 pointer-coarse:text-base ${T} transition-colors ${L.surface} ${s.fg}`,children:[(0,O.jsx)("option",{value:"desc",children:a.basicSortDescending}),(0,O.jsx)("option",{value:"asc",children:a.basicSortAscending})]})]})]},"sorting")),X.push((0,O.jsxs)("div",{className:`${u} ${I.purple} border-l-4`,children:[(0,O.jsxs)("div",{className:`${d} ${m.purple}`,children:["\u2699\uFE0F ",a.basicEngineHeading]}),(0,O.jsx)("label",{htmlFor:w,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:a.basicStrategy}),(0,O.jsxs)("select",{id:w,value:e.parallelSearchStrategy||$t.DEFAULT_FUZZY_SEARCH_OPTIONS.parallelSearchStrategy,onChange:b=>t(h=>({...h,parallelSearchStrategy:b.target.value})),className:`min-h-11 rounded border ${q.borderControl} px-2 pointer-coarse:text-base ${T} transition-colors ${L.surface} ${s.fg}`,children:[(0,O.jsx)("option",{value:"balanced",children:a.basicStrategyBalanced}),(0,O.jsx)("option",{value:"index-first",children:a.basicStrategyIndexFirst}),(0,O.jsx)("option",{value:"levenshtein-first",children:a.basicStrategyLevenshteinFirst})]}),(0,O.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,O.jsxs)("label",{htmlFor:M,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${T} transition-colors`,children:[(0,O.jsx)("input",{id:M,type:"checkbox",checked:e.enableIndexFiltering!==!1,onChange:b=>t(h=>({...h,enableIndexFiltering:b.target.checked})),className:"h-3 w-3"}),a.basicIndexFiltering]}),(0,O.jsxs)("label",{htmlFor:Q,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${T} transition-colors`,children:[(0,O.jsx)("input",{id:Q,type:"checkbox",checked:e.enableLevenshtein!==!1,onChange:b=>t(h=>({...h,enableLevenshtein:b.target.checked})),className:"h-3 w-3"}),a.basicLevenshtein]})]})]},"engine")),(0,O.jsxs)("section",{className:"space-y-3",children:[(0,O.jsxs)("div",{className:`flex items-center gap-2 font-semibold ${m.blue} text-xs transition-colors`,children:[(0,O.jsx)("span",{children:"\u{1F527}"}),(0,O.jsx)("span",{className:"tracking-wide",children:a.settingsBasicTab})]}),(0,O.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:X})]})});lr.displayName="BasicSearchSettings";var po=require("@aiquants/swipe-overlay"),fo=Ce(require("lucide-react/dist/esm/icons/badge-check.js")),go=Ce(require("lucide-react/dist/esm/icons/building-2.js")),ho=Ce(require("lucide-react/dist/esm/icons/calendar-clock.js")),yo=Ce(require("lucide-react/dist/esm/icons/check.js")),bo=Ce(require("lucide-react/dist/esm/icons/copy.js")),So=Ce(require("lucide-react/dist/esm/icons/id-card.js")),Co=Ce(require("lucide-react/dist/esm/icons/mail.js")),vo=Ce(require("lucide-react/dist/esm/icons/phone.js")),xo=Ce(require("lucide-react/dist/esm/icons/user-round.js")),Ue=require("react");Ut();var dt={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)};he();pe();var tt=Ce(require("@radix-ui/react-tabs")),br=Ce(require("react"));pe();$n();var Sr=require("react/jsx-runtime"),Wn=tt.Root,bn=br.forwardRef(({className:e,...t},n)=>(0,Sr.jsx)(tt.List,{ref:n,className:Oe(`inline-flex h-10 items-center justify-center rounded-md ${L.muted} p-1 ${s.fgMuted}`,e),...t}));bn.displayName=tt.List.displayName;var At=br.forwardRef(({className:e,...t},n)=>(0,Sr.jsx)(tt.Trigger,{ref:n,className:Oe(`inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm ${k.ringOffsetSurface} transition-all focus-visible:outline-hidden focus-visible:ring-2 ${k.focusVisibleRing} focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 ${k.activeTabSurface} ${k.activeTabFg} data-[state=active]:shadow-2xs`,e),...t}));At.displayName=tt.Trigger.displayName;var Dt=br.forwardRef(({className:e,...t},n)=>(0,Sr.jsx)(tt.Content,{ref:n,className:Oe(`mt-2 ${k.ringOffsetSurface} focus-visible:outline-hidden focus-visible:ring-2 ${k.focusVisibleRing} focus-visible:ring-offset-2 data-[state=inactive]:hidden`,e),...t}));Dt.displayName=tt.Content.displayName;fn();Pe();gr();var E=require("react/jsx-runtime"),co=`truncate font-semibold ${s.fg} ${T}`,uo={height:"var(--contact-panel-height, 100%)",maxHeight:"100%"},hs=({icon:e,label:t,value:n,fieldKey:r,copyValue:i,onCopy:o,isCopied:a,linkHref:u,searchTerm:d,enableHighlighting:c})=>{let f=ne(),p=!!(o&&r&&i),l=u?.startsWith("https://mail.google.com")?"_blank":void 0;return(0,E.jsxs)("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${q.borderSubtle} ${L.subtle} px-2.5 py-1.5 transition-colors`,children:[(0,E.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,E.jsx)("div",{className:`flex h-7 w-7 items-center justify-center rounded-full ${L.surface} ${s.fgMuted} transition-colors`,children:(0,E.jsx)(e,{size:14})}),(0,E.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,E.jsx)("div",{className:`font-medium ${_} ${s.fgMuted}`,children:t}),u?(0,E.jsx)("a",{href:u,className:`align-top ${co} ${pn}`,target:l,rel:l?"noopener noreferrer":void 0,children:(0,E.jsx)(Le,{text:n,query:d??"",enabled:c})}):(0,E.jsx)("div",{className:co,children:(0,E.jsx)(Le,{text:n,query:d??"",enabled:c})})]})]}),p?(0,E.jsx)("button",{type:"button",onClick:()=>o&&r&&i&&o(r,i,t),className:`inline-flex h-11 w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border ${q.borderControl} ${L.surface} ${s.fgMuted} transition-colors ${k.hoverBlueAccentBorder} ${k.hoverBlueFg} ${ct}`,"aria-label":f.copyField(t),children:a?(0,E.jsx)(yo.default,{size:14}):(0,E.jsx)(bo.default,{size:14})}):null]})},mo=({items:e,searchTerm:t,enableHighlighting:n})=>(0,E.jsx)("dl",{className:"grid grid-cols-1 gap-x-3 gap-y-1.5 sm:grid-cols-2",children:e.map(r=>(0,E.jsxs)("div",{className:`flex flex-col gap-0.5 rounded-md border ${q.borderSubtle} ${L.surface} px-2 py-1 transition-colors`,children:[(0,E.jsx)("dt",{className:`font-semibold ${_} ${s.fgMuted} uppercase tracking-wide`,children:r.label}),(0,E.jsx)("dd",{className:`wrap-break-word ${s.fg} text-xs`,children:(0,E.jsx)(Le,{text:r.value,query:t??"",enabled:n})})]},r.fieldKey))}),sa=({title:e})=>(0,E.jsx)("h3",{className:`font-semibold ${s.fgSecondary} text-xs`,children:e}),ys=()=>{let e=ne();return(0,E.jsxs)("div",{className:`flex h-full min-h-40 w-full flex-1 flex-col items-center justify-center gap-2 rounded-xl border ${q.borderSubtle} border-dashed ${L.surface} p-4 text-center transition-colors`,children:[(0,E.jsx)("p",{className:`font-medium ${s.fgMuted} text-xs`,children:e.detailEmptyTitle}),(0,E.jsx)("p",{className:`${_} ${s.fgMuted}`,children:e.detailEmptyHint})]})},bs=Object.freeze({overlay:po.SWIPE_OVERLAY_SCROLL_AREA_STYLE,pane:void 0}),Yt=({contact:e,placement:t,searchTerm:n,enableHighlighting:r,style:i,className:o=""})=>{let a=ne(),[u,d]=(0,Ue.useState)(null),c=(0,Ue.useRef)(null),f=(0,Ue.useMemo)(()=>({...uo,...i}),[i]);(0,Ue.useEffect)(()=>()=>{c.current!==null&&window.clearTimeout(c.current)},[]);let p=(0,Ue.useMemo)(()=>ln(e),[e]),l=(0,Ue.useMemo)(()=>cn(e),[e]),g=(0,Ue.useMemo)(()=>it(e?.contacted_at,a.recordDateTime),[e?.contacted_at,a.recordDateTime]),y=(0,Ue.useCallback)(async(S,R,le)=>{try{await navigator.clipboard.writeText(R),d(S),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{d(null)},2e3)}catch(j){dt.error("Failed to copy contact detail",j)}},[]);if(!e)return(0,E.jsx)("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border ${q.borderSubtle} ${L.surface} shadow-sm transition-colors`,style:uo,children:(0,E.jsx)(ys,{})});let N=[se(e.title),se(e.department)].filter(S=>S!=="-"),w=[N.join(" / "),se(e.company_name)].filter(S=>S&&S!=="-").join(" \u30FB ")||"-",M=Ze(e.full_name)??a.noName,Q=[{fieldKey:"full_name",label:a.fieldFullName,value:M},{fieldKey:"full_name_reading",label:a.fieldFullNameReading,value:se(e.full_name_reading)},{fieldKey:"title",label:a.fieldTitle,value:se(e.title)},{fieldKey:"department",label:a.fieldDepartment,value:se(e.department)},{fieldKey:"company_name",label:a.fieldCompanyName,value:se(e.company_name)},{fieldKey:"company_name_reading",label:a.fieldCompanyNameReading,value:se(e.company_name_reading)},{fieldKey:"address",label:a.fieldAddress,value:se(e.address)},{fieldKey:"postal_code",label:a.fieldPostalCode,value:se(e.postal_code)},{fieldKey:"url",label:a.fieldUrl,value:se(e.url)}],X=[{label:a.fieldCustomEmail,value:se(e.custom_email),fieldKey:"custom_email",rawValue:e.custom_email},{label:a.fieldEmail,value:se(e.email),fieldKey:"email",rawValue:e.email}].filter(S=>S.value!=="-"),b=[{label:a.fieldCustomMobilePhone,value:se(e.custom_mobile_phone_number),fieldKey:"custom_mobile_phone_number",rawValue:e.custom_mobile_phone_number},{label:a.fieldMobilePhone,value:se(e.mobile_phone_number),fieldKey:"mobile_phone_number",rawValue:e.mobile_phone_number},{label:a.fieldCompanyPhone,value:se(e.company_phone_number),fieldKey:"company_phone_number",rawValue:e.company_phone_number},{label:a.fieldCompanyFax,value:se(e.company_fax_number),fieldKey:"company_fax_number",rawValue:e.company_fax_number}].filter(S=>S.value!=="-"),h=[{fieldKey:"person_id",label:"person_id",value:se(e.person_id)},{fieldKey:"person_id_redirect_to",label:"person_id_redirect_to",value:se(e.person_id_redirect_to)},{fieldKey:"is_active",label:"is_active",value:se(e.is_active)},{fieldKey:"is_contact_synced",label:"is_contact_synced",value:se(e.is_contact_synced)},{fieldKey:"is_incomplete",label:"is_incomplete",value:se(e.is_incomplete)},{fieldKey:"is_in_eight",label:"is_in_eight",value:se(e.is_in_eight)},{fieldKey:"created_by",label:a.fieldCreatedBy,value:se(e.created_by)},{fieldKey:"created_at",label:a.fieldCreatedAt,value:it(e.created_at,a.recordDateTime)},{fieldKey:"updated_by",label:a.fieldUpdatedBy,value:se(e.updated_by)},{fieldKey:"updated_at",label:a.fieldUpdatedAt,value:it(e.updated_at,a.recordDateTime)}],x=[{rowKey:"person_id",icon:So.default,label:"person_id",value:se(e.person_id),fieldKey:"person_id",copyValue:String(e.person_id)},{rowKey:"primary_email",icon:Co.default,label:a.summaryEmail,value:p.value??"-",fieldKey:"primary_email",copyValue:p.value,linkHref:yt(p.value,!1)},{rowKey:"primary_phone",icon:vo.default,label:a.summaryPhone,value:l.value??"-",fieldKey:"primary_phone",copyValue:l.value,linkHref:Pn(l.value)},{rowKey:"contacted_at",icon:ho.default,label:a.summaryLastContact,value:g}],P=[{sectionKey:"email",title:a.sectionEmail,emptyText:a.sectionEmailEmpty,entries:X,recommendedKey:p.fieldKey??null,resolveHref:S=>yt(S!=null?String(S):null,!1)},{sectionKey:"phone",title:a.sectionPhone,emptyText:a.sectionPhoneEmpty,entries:b,recommendedKey:l.fieldKey??null,resolveHref:S=>Pn(S!=null?String(S):null)}],K=[{value:"summary",label:a.detailTabSummary,content:(0,E.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,E.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,E.jsxs)("div",{className:`flex items-center gap-2 ${s.fgMuted} text-sm`,children:[(0,E.jsx)(go.default,{size:16}),(0,E.jsx)("span",{children:(0,E.jsx)(Le,{text:se(e.company_name),query:n??"",enabled:r})})]}),N.length>0?(0,E.jsx)("div",{className:`${s.fgMuted} text-sm`,children:N.map((S,R)=>(0,E.jsxs)("span",{children:[R>0&&" / ",(0,E.jsx)(Le,{text:S,query:n??"",enabled:r})]},`header-line-${R}`))}):null]}),(0,E.jsx)("div",{className:"flex flex-col gap-3",children:x.map(S=>(0,E.jsx)(hs,{icon:S.icon,label:S.label,value:S.value,fieldKey:S.fieldKey,copyValue:S.copyValue,onCopy:y,isCopied:S.fieldKey?u===S.fieldKey:!1,linkHref:S.linkHref,searchTerm:n,enableHighlighting:r},S.rowKey))})]})},{value:"basic",label:a.detailTabBasic,content:(0,E.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,E.jsx)(sa,{title:a.detailBasicProfile}),(0,E.jsx)(mo,{items:Q,searchTerm:n,enableHighlighting:r})]})},{value:"contact",label:a.detailTabContact,content:(0,E.jsx)("div",{className:"flex flex-col gap-4",children:P.map(({sectionKey:S,title:R,emptyText:le,entries:j,recommendedKey:Ne,resolveHref:ce})=>(0,E.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,E.jsx)(sa,{title:R}),j.length===0?(0,E.jsx)("p",{className:`${s.fgMuted} text-xs`,children:le}):(0,E.jsx)("div",{className:"flex flex-col gap-2",children:j.map(z=>{let F=ce(z.rawValue),ee=z.fieldKey===Ne;return(0,E.jsxs)("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${q.borderSubtle} ${L.surface} px-3 py-2 transition-colors`,children:[(0,E.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,E.jsx)("div",{className:`font-medium ${s.fgMuted} text-xs`,children:z.label}),(0,E.jsx)("div",{className:`wrap-break-word ${s.fg} text-sm`,children:F?(0,E.jsx)("a",{href:F,className:`text-inherit ${pn}`,children:(0,E.jsx)(Le,{text:z.value,query:n??"",enabled:r})}):(0,E.jsx)(Le,{text:z.value,query:n??"",enabled:r})})]}),ee?(0,E.jsxs)("span",{className:`inline-flex shrink-0 items-center gap-1 rounded-full ${re.emerald} px-2 py-0.5 font-semibold ${_} ${m.emerald} transition-colors`,children:[(0,E.jsx)(fo.default,{size:14}),a.preferred]}):null]},z.fieldKey)})})]},S))})},{value:"meta",label:a.detailTabMeta,content:(0,E.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,E.jsx)(sa,{title:a.detailTabMeta}),(0,E.jsx)(mo,{items:h,searchTerm:n,enableHighlighting:r})]})}];return(0,E.jsxs)("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border ${q.borderSubtle} ${L.surface} shadow-sm transition-colors ${o}`.trim(),style:f,children:[(0,E.jsx)("div",{className:`${q.borderSubtle} border-b px-3 py-1.5 transition-colors ${L.subtle}`,children:(0,E.jsxs)("div",{className:"flex items-center gap-2",children:[(0,E.jsx)("div",{className:`flex h-8 w-8 items-center justify-center rounded-full ${re.blue} ${m.blue} transition-colors`,children:(0,E.jsx)(xo.default,{size:16})}),(0,E.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,E.jsx)("div",{className:`truncate font-semibold ${s.fg} text-sm`,children:(0,E.jsx)(Le,{text:M,query:n??"",enabled:r})}),(0,E.jsx)("div",{className:`truncate ${_} ${s.fgMuted}`,children:(0,E.jsx)(Le,{text:w,query:n??"",enabled:r})})]})]})}),(0,E.jsxs)(Wn,{defaultValue:"summary",className:"flex flex-1 flex-col overflow-hidden",children:[(0,E.jsx)(bn,{className:`grid h-auto grid-cols-4 gap-1 rounded-none ${q.borderSubtle} border-b ${L.subtle} px-2 py-1 transition-colors`,children:K.map(S=>(0,E.jsx)(At,{value:S.value,className:`flex min-h-11 min-w-0 touch-manipulation rounded-md px-1 py-1 font-semibold ${s.fgSecondary} ${T} transition-colors ${k.activeTabSurface} ${k.activeTabBlueFg}`,children:(0,E.jsx)("span",{className:"min-w-0 truncate",children:S.label})},S.value))}),K.map(S=>(0,E.jsx)(Dt,{value:S.value,className:`scrollbar-thin flex-1 overflow-y-auto px-2.5 py-2 transition-colors ${s.fgSecondary}`,style:bs[t],children:S.content},S.value))]})]})};var To=require("react");jt();he();pe();var Ve=require("react/jsx-runtime"),Cr=(0,To.memo)(({recordCount:e,companyCount:t,phase:n,loadedCount:r,totalCount:i})=>{let{locale:o,labels:a}=We(),u=ie(o,e),d=ie(o,t);return(0,Ve.jsxs)("div",{"data-testid":"contact-map-annotation",className:"flex flex-wrap items-center gap-2 leading-1 transition-colors",children:[(0,Ve.jsxs)("span",{className:"flex items-baseline gap-1",children:[(0,Ve.jsx)("span",{className:s.fgMuted,children:a.annotationTotalLabel}),(0,Ve.jsx)("span",{className:s.fg,"data-testid":"contact-map-record-count",children:u}),(0,Ve.jsx)("span",{className:s.fgMuted,children:a.recordUnit(u)})]}),(0,Ve.jsxs)("span",{className:"flex items-baseline gap-1",children:[(0,Ve.jsx)("span",{className:s.fgMuted,children:a.annotationCompaniesLabel}),(0,Ve.jsx)("span",{className:s.fg,"data-testid":"contact-map-company-count",children:d}),(0,Ve.jsx)("span",{className:s.fgMuted,children:a.companyUnit(d)})]}),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 ${re.blue} px-2 py-0.5 font-medium ${m.blue} text-xs`,children:i!==null&&i>0?a.annotationStreamingProgress({loaded:r,total:i,percent:Math.min(100,Math.round(r/i*100))}):a.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 ${re.amber} px-2 py-0.5 font-medium ${m.amber} text-xs`,children:a.annotationReconnecting(r)}):null]})});Cr.displayName="ContactMapAnnotation";var ka=require("react");un();var Sn=require("react");Vt();un();he();Vt();un();Gr();var Ss=["indexWorker","levenshteinWorker","treeWorker"];function No(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 ${de(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${de(n)}`)}}var Eo={setting:"workerUrls"},Mo=(e,t)=>{if(e===void 0)return;let{setting:n,keys:r=Ss,hints:i={}}=t;if(!dn(e))throw new TypeError(`[contact-map] ${n} must be a plain object or left out; got ${de(e)}`);let o=Object.getOwnPropertyNames(e).map(d=>({key:d,url:e[d]})),a=o.find(({key:d,url:c})=>c!==void 0&&!r.includes(d));if(a!==void 0){let d=Object.hasOwn(i,a.key)?i[a.key]:void 0,c=d===void 0?rr(a.key,r):void 0;throw new RangeError(`[contact-map] ${n} has a key it does not take (it takes ${r.join(", ")}${d===void 0?"":`; ${d}`}${c===void 0?"":`; did you mean ${JSON.stringify(c)}?`}); got ${de(a.key)}`)}let u=Object.create(null);for(let{key:d,url:c}of o){let f=d;No(n,f,c),c!==void 0&&(u[f]=c)}return u};function Cs(e,t=Eo){Mo(e,t)}function la(e){No("workerUrls","treeWorker",e)}var Xt=(e,t,n=Eo)=>{let r=Mo(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 vr=require("react/jsx-runtime"),Lo=e=>{if(!dn(e))throw new TypeError(`[contact-map] config must be a plain object; got ${de(e)}`);let t=e;return{streamEndpoint:De(t,"streamEndpoint"),openEmailsWithGmail:De(t,"openEmailsWithGmail"),treeWorkerFactory:De(t,"treeWorkerFactory"),workerUrls:Xt(void 0,De(t,"workerUrls")),locale:De(t,"locale"),labels:De(t,"labels")}},ko=({workerUrls:e,...t})=>{let{indexWorker:n,levenshteinWorker:r,treeWorker:i}=e;return Object.freeze(Object.assign(Object.create(null),t,{workerUrls:Object.freeze({indexWorker:n,levenshteinWorker:r,treeWorker:i})}))},vs=ko(Lo({})),wo=(0,Sn.createContext)(vs),xs=Object.freeze({locale:"locale",labels:"labels"});function ca({config:e,chromeSurface:t,children:n}){let{streamEndpoint:r,openEmailsWithGmail:i,treeWorkerFactory:o,workerUrls:a,locale:u,labels:d}=Lo(e),{indexWorker:c,levenshteinWorker:f,treeWorker:p}=a,l=(0,Sn.useMemo)(()=>ko({streamEndpoint:r,openEmailsWithGmail:i,treeWorkerFactory:o,workerUrls:{indexWorker:c,levenshteinWorker:f,treeWorker:p},locale:u,labels:d}),[r,i,o,c,f,p,u,d]);return(0,vr.jsx)(wo.Provider,{value:l,children:(0,vr.jsx)(Ia,{locale:u,labels:d,surface:t,children:n})})}function Ro({config:e,children:t}){return(0,vr.jsx)(ca,{config:e,chromeSurface:xs,children:t})}function ut(){return(0,Sn.useContext)(wo)}var He=require("react");Vt();var Ts=1e3,Ns=3e4,Es=6;function In(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 ${de(e)}`);if(/[\s\p{Cc}#]/u.test(e))throw new RangeError(`[contact-map] streamEndpoint must not contain whitespace, control characters or "#"; got ${de(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 ${de(e)}`)}var Po=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}),Ms=e=>Array.isArray(e.records),Hn=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?.()};In(t.endpoint),this.fetchFn=t.fetchFn??((...n)=>fetch(...n)),this.endpoint=t.endpoint,this.initialRetryDelayMs=t.initialRetryDelayMs??Ts,this.maxRetryDelayMs=t.maxRetryDelayMs??Ns,this.maxConsecutiveFailures=t.maxConsecutiveFailures??Es,this.logger=t.logger??dt}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 i=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 ${i}ms (attempt ${this.consecutiveFailures})`),await this.waitBeforeRetry(i),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,i="",o=!1,a=!1;for(;;){let{done:u,value:d}=await n.read();if(u)break;let c=r.decode(d,{stream:!0}),f=(i+c).split(`
|
|
2
|
-
`);i=f.pop()??"";let p=!1;for(let l of f){let g=l.trim();if(!g)continue;let y;try{y=JSON.parse(g)}catch(N){this.logger.warn("[ContactMapStream] failed to parse NDJSON line:",N);continue}if("type"in y&&y.type==="METADATA"){Number.isSafeInteger(y.total)&&y.total>=0&&this.setState({totalCount:y.total});continue}if(!Ms(y)){this.logger.warn("[ContactMapStream] server reported error:","error"in y?y.error:""),a=!0;continue}for(let N of y.records)N&&typeof N.person_id=="number"&&(this.recordMap.set(N.person_id,Po(N)),p=!0);y.nextCursor&&(this.lastCursor=y.nextCursor),y.isLast&&(o=!0)}p&&(this.consecutiveFailures=0,this.publishRecords({error:null}))}return a?(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 nt=null,_o=e=>{if(nt!==null&&nt.endpoint===e)return nt;if(In(e),nt===null)return nt=new Hn({endpoint:e}),nt;if(nt.endpoint!==e)throw new Error(`[contact-map] the stream client already streams from ${JSON.stringify(nt.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 nt},Ls=()=>{nt?.dispose(),nt=null},ks=new Map,ws={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null},Rs=()=>{let{streamEndpoint:e}=ut();return(0,He.useMemo)(()=>(In(e),e),[e])};function $o(){let e=Rs(),t=(0,He.useCallback)(()=>_o(e),[e]);(0,He.useEffect)(()=>{let a=t();a.start(),a.retryNow()},[t]);let n=(0,He.useCallback)(a=>t().subscribe(a),[t]),r=(0,He.useSyncExternalStore)(n,()=>t().getState(),()=>ws),i=(0,He.useSyncExternalStore)(n,()=>t().getRecordMap(),()=>ks),o=(0,He.useCallback)(()=>t().retryNow(),[t]);return(0,He.useMemo)(()=>({...r,recordMap:i,retryNow:o}),[r,i,o])}var Oo=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 Fn(){let{records:e,recordMap:t,isComplete:n,phase:r,loadedCount:i,totalCount:o,error:a,retryNow:u}=$o(),d=(0,He.useMemo)(()=>Oo(e),[e]);return{context:(0,He.useMemo)(()=>({contactMapRecords:e,contactMapRecordMap:t,isStreamingComplete:n,isStreamingFailed:r==="failed",streamPhase:r,loadedCount:i,companyCount:d,totalCount:o,errorMessage:a?.message??null}),[e,t,n,r,i,d,o,a]),retryNow:u}}he();var Dr=require("@aiquants/fuzzy-search"),Ei=require("@aiquants/fuzzy-search/react"),Mi=Ce(require("lucide-react/dist/esm/icons/search.js")),G=require("react"),Wr=require("react-router");oa();un();var Ke=require("react"),Ct=e=>{let t=(0,Ke.useRef)(null),n=(0,Ke.useRef)({isPointerDown:!1,isDragging:!1,startX:0,scrollLeft:0,pointerId:0,hasCapture:!1,didDrag:!1,pointerType:""}),r=e?.dragThreshold??4,i=(0,Ke.useCallback)(p=>{let l=p.currentTarget,g=p.deltaY;!l||g===0||(p.preventDefault(),l.scrollBy({left:g,behavior:"smooth"}))},[]),o=(0,Ke.useCallback)(p=>{t.current?.removeEventListener("wheel",i),t.current=p,p?.addEventListener("wheel",i,{passive:!1})},[i]);(0,Ke.useEffect)(()=>()=>{t.current&&t.current.removeEventListener("wheel",i)},[i]);let a=(0,Ke.useCallback)(p=>{if(p.pointerType==="touch")return;let l=n.current;l.isPointerDown=!0,l.isDragging=!1,l.startX=p.clientX,l.scrollLeft=p.currentTarget.scrollLeft,l.pointerId=p.pointerId,l.hasCapture=!1,l.pointerType=p.pointerType},[]),u=(0,Ke.useCallback)(p=>{let l=n.current;if(!l.isPointerDown||l.pointerType==="touch")return;let g=p.currentTarget,y=p.clientX-l.startX;!l.isDragging&&Math.abs(y)>r&&(l.isDragging=!0,l.hasCapture||(g.setPointerCapture?.(p.pointerId),l.hasCapture=!0)),l.isDragging&&(p.preventDefault(),g.scrollLeft=l.scrollLeft-y)},[r]),d=(0,Ke.useCallback)(p=>{let l=n.current;if(l.pointerType==="touch")return;let g=p.currentTarget;l.isPointerDown&&l.hasCapture&&g.hasPointerCapture?.(p.pointerId)&&g.releasePointerCapture(p.pointerId),l.isDragging&&(l.didDrag=!0,window.setTimeout(()=>{l.didDrag=!1},0)),l.isPointerDown=!1,l.isDragging=!1,l.pointerId=0,l.hasCapture=!1},[]),c=(0,Ke.useCallback)(p=>{d(p)},[d]),f=(0,Ke.useCallback)(p=>{n.current.didDrag&&(p.preventDefault(),p.stopPropagation(),n.current.didDrag=!1)},[]);return{setScrollableRef:o,onPointerDown:a,onPointerMove:u,onPointerUp:c,onPointerLeave:c,onPointerCancel:c,onClickCapture:f}};jt();he();var Ao=require("@aiquants/fuzzy-search"),xr=e=>{let{indexWorkerOptions:t,levenshteinWorkerOptions:n,...r}=Ao.DEFAULT_FUZZY_SEARCH_OPTIONS;return{...r,autoSearchOnIndexRebuild:!1,multiTermOperator:"and",workerUrls:e,indexWorkerOptions:{...t},levenshteinWorkerOptions:{...n}}};pe();pe();$n();var da=require("react/jsx-runtime");function ua({value:e,max:t=100,className:n,indicatorClassName:r,...i}){let o=e===void 0,a=o?0:Math.min(100,Math.max(0,e/t*100));return(0,da.jsx)("div",{role:"progressbar","aria-valuenow":o?void 0:a,"aria-valuemin":0,"aria-valuemax":100,"data-slot":"progress",className:Oe(`relative h-2 w-full overflow-hidden rounded-full ${Pt.progressTrack}`,n),...i,children:(0,da.jsx)("div",{"data-slot":"progress-indicator",className:Oe(`h-full rounded-full ${et.blue} transition-[width] duration-300 ease-in-out will-change-transform`,o&&"w-1/3 animate-progress-indeterminate",r),style:o?void 0:{width:`${a}%`}})})}Pe();var Cn="view";var kr=require("react"),yi=require("react-router");he();pe();Pe();var Qt=require("@aiquants/resize-panels"),Tn=require("@aiquants/virtualscroll"),W=require("react");Ut();var Bn={listPanelMinWidth:320,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35},zn={listPanelMinWidth:280,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35};function Tr(e){let t=e.listPanelMinWidth+e.detailPanelMinWidth+e.handleThickness+e.listPaddingAndBorder+e.detailPaddingAndBorder,n=t+e.scrollbarSafetyBuffer,r=n+e.hysteresisSafetyMargin,i=r-n;return{physicalMinWidth:t,collapseThreshold:n,expandThreshold:r,hysteresisWidth:i}}var vn=require("react"),ma=(e,t)=>{let{enableMutationObserver:n=!1,bottomGap:r=4,minFallbackHeight:i=240}=t??{},[o,a]=(0,vn.useState)(600),u=(0,vn.useCallback)(()=>{if(typeof window>"u")return;let d=e.current;if(!d||d.offsetParent===null&&window.getComputedStyle(d).position!=="fixed")return;let c=R=>Number.parseFloat(R)||0,{top:f}=d.getBoundingClientRect(),p=d.parentElement?.getBoundingClientRect(),l=window.getComputedStyle(document.documentElement),g=c(l.getPropertyValue("--footer-height")),y=c(l.getPropertyValue("--header-height")),N=c(l.getPropertyValue("--scrollbar-height")),w=window.getComputedStyle(d),M=c(w.marginBottom),Q=c(w.paddingBottom),X=window.innerHeight-g-N-r,b=p?Math.min(p.bottom,X):X,h=p?Math.max(p.top,y):y,x=Math.max(f,h),P=b-x-M-Q,K=Number.isFinite(P)?Math.floor(P):0,S=K>0?K:i;S>0&&Number.isFinite(S)&&a(R=>Math.abs(R-S)>1?S:R)},[r,e,i]);return(0,vn.useEffect)(()=>{if(typeof window>"u")return;let d=null,c=null,f=null,p=null,l=()=>{d!==null&&window.cancelAnimationFrame(d),d=window.requestAnimationFrame(()=>{u()})};l(),c=window.setTimeout(()=>{l()},150);let g=e.current;return typeof ResizeObserver<"u"&&g&&(f=new ResizeObserver(()=>{l()}),f.observe(g),g.parentElement&&f.observe(g.parentElement)),n&&typeof MutationObserver<"u"&&(p=new MutationObserver(()=>{l()}),p.observe(document.body,{attributes:!0,childList:!0,subtree:!0})),window.addEventListener("resize",l),()=>{d!==null&&window.cancelAnimationFrame(d),c!==null&&window.clearTimeout(c),f&&f.disconnect(),p&&p.disconnect(),window.removeEventListener("resize",l)}},[e,n,u]),{viewportHeight:o,updateViewportHeight:u}};var Te=require("react"),Ps=600,Do=8,Un=({ref:e,onSelect:t,resolveItem:n,item:r})=>{let[i,o]=(0,Te.useState)(!1),[a,u]=(0,Te.useState)(null),d=(0,Te.useRef)(null),c=(0,Te.useRef)(!1),f=(0,Te.useRef)(null),p=(0,Te.useRef)({onSelect:t,resolveItem:n,item:r});(0,Te.useEffect)(()=>{p.current={onSelect:t,resolveItem:n,item:r}},[t,n,r]);let l=(0,Te.useCallback)(()=>{typeof window>"u"||d.current!==null&&(window.clearTimeout(d.current),d.current=null)},[]),g=(0,Te.useCallback)(()=>{f.current&&(l(),f.current=null)},[l]),y=(0,Te.useCallback)(h=>{typeof window>"u"||h.button!==0&&h.pointerType==="mouse"||(l(),c.current=!1,f.current={x:h.clientX,y:h.clientY,pointerId:h.pointerId},d.current=window.setTimeout(()=>{let x=p.current,P=null;x.item!==void 0?P=x.item:x.resolveItem&&h.target&&(P=x.resolveItem(h.target)),P!==null&&(c.current=!0,x.onSelect?.(P),u(P),o(!0)),g()},Ps))},[l,g]),N=(0,Te.useCallback)(h=>{f.current&&h.pointerId===f.current.pointerId&&(l(),f.current=null)},[l]),w=(0,Te.useCallback)(h=>{c.current&&(h.preventDefault(),h.stopPropagation(),h.type==="click"&&(c.current=!1))},[]),M=(0,Te.useCallback)(()=>{c.current=!1},[]),Q=(0,Te.useCallback)(h=>{if(!f.current||h.pointerId!==f.current.pointerId)return;let x=Math.abs(h.clientX-f.current.x),P=Math.abs(h.clientY-f.current.y);(x>Do||P>Do)&&(l(),f.current=null)},[l]),X=(0,Te.useCallback)(h=>{(i||d.current!==null)&&(h.preventDefault(),h.stopPropagation())},[i]),b=(0,Te.useCallback)(()=>{o(!1),u(null),c.current=!1,f.current=null},[]);return(0,Te.useEffect)(()=>{let h=e.current;if(!(h&&typeof window<"u"))return;let x=[["pointerdown",y,void 0],["pointerup",N,void 0],["pointercancel",N,void 0],["pointermove",Q,void 0],["pointerleave",N,void 0],["contextmenu",X,void 0]],P=[["mousedown",w,!0],["mouseup",w,!0],["click",w,!0],["pointerdown",M,!0],["keydown",M,!0],["contextmenu",X,!0],["pointerup",N,!0],["pointercancel",N,!0]];for(let[K,S,R]of x)h.addEventListener(K,S,R);for(let[K,S,R]of P)window.addEventListener(K,S,R);return()=>{for(let[K,S,R]of x)h.removeEventListener(K,S,R);for(let[K,S,R]of P)window.removeEventListener(K,S,R);l()}},[e,y,N,Q,w,M,X,l]),{isPopupVisible:i,popupItem:a,handleClosePopup:b}};var vt=require("react");function Vn(e,t,n){let r=n?.mediaQuery??"(min-width: 1024px)",i=(0,vt.useSyncExternalStore)((0,vt.useCallback)(f=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let p=window.matchMedia(r);return p.addEventListener("change",f),()=>p.removeEventListener("change",f)},[r]),()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(r).matches:!0,()=>!1),[o,a]=(0,vt.useState)(!1),[u,d]=(0,vt.useState)(0);return(0,vt.useEffect)(()=>{if(typeof window>"u"||typeof ResizeObserver>"u")return;let f=e.current;if(!f)return;let p=new ResizeObserver(l=>{for(let g of l){if(g.target!==f)continue;let y=0;g.borderBoxSize&&g.borderBoxSize.length>0?y=g.borderBoxSize[0].inlineSize:y=g.contentRect.width,!(!Number.isFinite(y)||y<=0)&&(d(y),a(N=>N&&y>=t.expandThreshold?!1:!N&&y<t.collapseThreshold?!0:N))}});return p.observe(f),()=>p.disconnect()},[e,t.collapseThreshold,t.expandThreshold]),{isTwoColumn:i&&!o,isContainerNarrow:o,isMediaMatches:i,containerWidth:u}}he();Vt();var Wo=e=>e.isComposing||e.keyCode===229;var Ho=(e,t)=>{if(Os(t),e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||Wo(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 $s(e.key)?{kind:"move",index:t.startIndex,direction:1}:null;let r=t.activeIndex;switch(e.key){case"ArrowDown":return{kind:"move",index:Math.min(r+1,n),direction:1};case"ArrowUp":return{kind:"move",index:Math.max(r-1,0),direction:-1};case"PageDown":return{kind:"move",index:Math.min(r+t.pageSize,n),direction:1};case"PageUp":return{kind:"move",index:Math.max(r-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}},_s=new Set(["ArrowDown","ArrowUp","PageDown","PageUp","Home","End"]),$s=e=>_s.has(e),Os=e=>{let{activeIndex:t,startIndex:n,itemCount:r,pageSize:i}=e;if(!Number.isInteger(r)||r<0)throw new RangeError(`[contact-map] listbox itemCount must be a non-negative integer; got ${de(r)}`);if(!Number.isInteger(i)||i<1)throw new RangeError(`[contact-map] listbox pageSize must be an integer of at least 1; got ${de(i)}`);let o=a=>Number.isInteger(a)&&a>=0&&a<r;if(r>0&&!o(n))throw new RangeError(`[contact-map] listbox startIndex must be an index below ${r}; got ${de(n)}`);if(t!==null&&!o(t))throw new RangeError(`[contact-map] listbox activeIndex must be null or an index below ${r}; got ${de(t)}`)};pe();var xn=require("@aiquants/swipe-overlay"),Nr=require("react");he();Zr();pe();fn();$n();var xt=require("react/jsx-runtime"),As=Oe(cr,"flex overflow-hidden"),Ds=Oe(ur,"motion-safe:transition-opacity motion-safe:duration-200"),Ws=`relative ml-auto flex h-full w-full max-w-lg flex-col ${L.surface} shadow-xl motion-safe:transition-[transform] motion-safe:duration-200 motion-safe:ease-out`,Hs=`flex shrink-0 items-center justify-between gap-3 ${q.borderSubtle} border-b px-3 py-2`,Is=`min-w-0 truncate font-semibold text-base ${s.fg} outline-none`,Fs=`inline-flex min-h-11 min-w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border ${q.borderControl} px-4 font-medium ${s.fgSecondary} text-sm ${k.hoverMuted} ${ct}`,Bs="flex min-h-0 flex-1 flex-col overflow-y-auto p-3",Kn=({isOpen:e,onClose:t,children:n,className:r,title:i})=>{let o=ne(),a=(0,Nr.useId)(),u=(0,xn.useOverlayPresence)(e),d=(0,Nr.useCallback)(y=>y.ownerDocument.getElementById(a),[a]),{dialogProps:c,backdropProps:f,panelProps:p,attemptClose:l,isSwiping:g}=(0,xn.useSwipeOverlayDialog)({isOpen:e,onClose:t,isCloseBlocked:mr,skipWhenTextSelected:!0,initialFocus:d});return u?(0,xt.jsxs)("dialog",{...c,"data-testid":"contact-map-mobile-overlay","aria-labelledby":a,className:Oe(As,e&&!g?"pointer-events-auto":"pointer-events-none"),style:dr,children:[(0,xt.jsx)("div",{...f,"data-contact-map-overlay-backdrop":"",className:Oe(Ds,e?"opacity-100":"opacity-0")}),(0,xt.jsxs)("div",{...p,"data-contact-map-overlay-panel":"",className:Oe(Ws,e?"pointer-events-auto":"pointer-events-none",r),children:[(0,xt.jsxs)("div",{className:Hs,children:[(0,xt.jsx)("h2",{id:a,tabIndex:-1,className:Is,children:i===void 0?o.overlayTitle:i}),(0,xt.jsx)("button",{type:"button",className:Fs,onClick:()=>l(),children:o.close})]}),(0,xt.jsx)("div",{"data-contact-map-overlay-body":"",className:Bs,style:xn.SWIPE_OVERLAY_SCROLL_AREA_STYLE,children:n})]})]}):null};fn();Pe();ra();var A=require("react/jsx-runtime"),zs=(0,W.lazy)(async()=>({default:(await Promise.resolve().then(()=>(lo(),so))).default})),pa=64,Io="h-[64px]",Fo=240,Us=4,fa=Tr(Bn),Vo=Bn.listPanelMinWidth,Ko=Bn.detailPanelMinWidth,jo=Bn.handleThickness,Vs=fa.collapseThreshold,Ks=fa.expandThreshold,js=({contactData:e})=>{let t=ne(),n=Ze(e?.full_name)??t.noName,r=Ze(e?.title)??"-",i=Ze(e?.company_name)??"-",o=Ze(e?.department)??"-",a=ln(e).value??"-",u=cn(e).value??"-",d=it(e?.updated_at,t.recordDateTime);return(0,A.jsx)(Dn,{fullName:n,title:r,companyName:i,department:o,phoneNumber:u,email:a,updatedAtText:d})},Gs=e=>({"--contact-panel-height":`${e}px`}),qs=e=>typeof e=="object"&&e!==null&&"item"in e,Ys=(e,t)=>t!==void 0?`${e}:${t.toFixed(3)}`:void 0,Xs=(e,t)=>{for(let n of e){let r=zt(n);if(r?.person_id===t)return r}return null},Bo=(e,t)=>t!==null&&zt(e)?.person_id===t,zo=(e,t,n)=>{for(let r=t;r>=0&&r<e.length;r+=n){let i=zt(e[r]);if(i!==null)return{index:r,personId:i.person_id}}return null},Uo=(e,t,n)=>{let r=zo(e,t,n);return r!==null?r:zo(e,t-n,n===1?-1:1)},Er=(e,t,n)=>{let{viewportHeight:r}=ma(t,{enableMutationObserver:!0,bottomGap:Us,minFallbackHeight:Fo}),[i,o]=(0,W.useState)(0),a=(0,W.useCallback)(()=>{let p=n.current,l=t.current;if(!(p&&l))return;let g=p.getBoundingClientRect(),y=l.getBoundingClientRect(),N=Math.ceil(y.top-g.top);Number.isFinite(N)&&N>0&&o(w=>Math.abs(w-N)>1?N:w)},[t,n]);(0,W.useLayoutEffect)(()=>{if(!e)return;a();let p=requestAnimationFrame(a);return window.addEventListener("resize",a),()=>{cancelAnimationFrame(p),window.removeEventListener("resize",a)}},[e,a]);let u=r>0?r:Fo,d=i>0?i:0,c=u+d,f=(0,W.useMemo)(()=>Gs(c),[c]);return{normalizedViewportHeight:u,normalizedDetailHeight:c,panelSizingStyle:f}},Qs=new Set,Go=()=>{let[e,t]=(0,W.useState)(Qs),n=(0,W.useCallback)((r,i)=>{t(o=>{if(o.has(r)===i)return o;let a=new Set(o);return i?a.add(r):a.delete(r),a})},[]);return{isAnyPopupVisible:e.size>0,handlePopupVisibilityChange:n}},qo=(e,t,n)=>{let r=(0,W.useRef)(n);(0,W.useLayoutEffect)(()=>{r.current=n},[n]),(0,W.useEffect)(()=>{if(e!==null)return r.current(e,t),()=>{r.current(e,!1)}},[e,t])},Yo=(0,W.memo)(({entry:e,index:t,itemCount:n,listboxId:r,isSelected:i,isActive:o,onSelect:a,onLongPressSelect:u,searchQuery:d,enableHighlighting:c,openEmailsWithGmail:f,openGmailCompose:p,onPopupVisibilityChange:l})=>{let g=ne(),y=(0,W.useRef)(null),N=(0,A.jsx)("div",{className:Io}),w=qs(e)?e:null,M=zt(e),{isPopupVisible:Q,handleClosePopup:X}=Un({ref:y,onSelect:u,item:M?.person_id});if(qo(M?.person_id??null,Q,l),!e||!M)return N;let{person_id:b}=M,h=t%2===0?L.surface:L.subtle,x=`${re.blue} ring-1 ${k.selectedRing}`,P=i?x:h,K=["B","F"].map(S=>Ys(S,S==="B"?w?.baseScore:w?.score)).filter(Boolean);return(0,A.jsxs)("div",{ref:y,id:(0,Tn.virtualScrollItemElementId)(r,b),className:`flex ${Io} w-full items-center overflow-hidden ${q.borderSubtle} border-b px-4 py-2 text-left transition-colors ${k.hoverBlueTint} ${P} ${Ua}`,style:{height:pa},role:"option","aria-selected":i,"aria-posinset":t+1,"aria-setsize":n,"data-selected":i?"true":"false","data-contact-map-row-active":o?"":void 0,onClick:()=>a(b),children:[(0,A.jsxs)("div",{className:"hidden w-28 shrink-0 flex-col items-center gap-0.5 text-center sm:flex",children:[(0,A.jsx)("div",{className:`whitespace-nowrap font-medium ${s.fgSecondary} text-xs leading-tight`,children:g.listRowNumber(t+1)}),(0,A.jsx)("div",{className:`truncate ${_t} ${s.fgSecondary} leading-tight`,children:b}),(0,A.jsx)("div",{className:`flex items-center gap-1 whitespace-nowrap font-mono ${_t} ${s.fgMuted} leading-tight`,children:K.length?K.map(S=>(0,A.jsx)("span",{children:S},S)):(0,A.jsx)("span",{children:"-"})})]}),(0,A.jsx)(W.Suspense,{fallback:(0,A.jsx)(js,{contactData:M}),children:(0,A.jsx)(zs,{contactData:M,searchTerm:d,enableHighlighting:c,openEmailsWithGmail:f,openGmailCompose:p,isPopupVisible:Q,onRequestClose:X})})]})});Yo.displayName="ContactListRow";var ga=({context:e})=>{let{contactMapRecords:t,filteredItems:n,searchQuery:r,hasSearchTerm:i,enableHighlighting:o,openEmailsWithGmail:a,isSearchTabActive:u}=e,{locale:d,labels:c,engineLabels:f}=We(),p=(0,W.useRef)(null),l=(0,W.useRef)(null),[g,y]=(0,W.useState)(null),{normalizedViewportHeight:N,panelSizingStyle:w}=Er(u,l,p),{isAnyPopupVisible:M,handlePopupVisibilityChange:Q}=Go(),X=(0,W.useMemo)(()=>({enablePointerDrag:!M,enableKeyboardNavigation:!1}),[M]),b=(0,W.useMemo)(()=>i?n:t,[i,n,t]),[h,x]=(0,W.useState)(null),P=(0,W.useCallback)(te=>{y(te),x(te)},[]),K=(0,W.useCallback)(te=>{if(!a)return;let ye=te.trim();if(!ye||ye==="-"||typeof window>"u")return;let ae=yt(ye,!0);ae&&window.open(ae,"_blank","noopener,noreferrer")},[a]),[S,R]=(0,W.useState)(!1),le=(0,W.useCallback)(()=>R(!1),[]),j=(0,W.useCallback)(te=>{P(te),R(!0)},[P]),Ne=(0,W.useId)(),ce=(0,W.useId)(),z=(0,W.useRef)(null),F=b.length,ee=(0,W.useCallback)((te,ye)=>(0,A.jsx)(Yo,{entry:te,index:ye,itemCount:F,listboxId:Ne,isSelected:Bo(te,g),isActive:Bo(te,h),onSelect:j,onLongPressSelect:P,searchQuery:r,enableHighlighting:o,openEmailsWithGmail:a,openGmailCompose:K,onPopupVisibilityChange:Q}),[F,Ne,g,h,j,P,r,o,a,K,Q]),fe=(0,W.useMemo)(()=>{let te=new Map;return b.forEach((ye,ae)=>{let ft=zt(ye);ft!==null&&te.set(ft.person_id,ae)}),te},[b]),Ee=h===null?null:fe.get(h)??null,Ie=g===null?null:fe.get(g)??null,Ht=Math.max(1,Math.floor(N/pa)),tn=(0,W.useCallback)(te=>{if(te.target.id!==Ne)return;let ye=Ho(te.nativeEvent,{activeIndex:Ee,startIndex:Ie===null?0:Ie,itemCount:F,pageSize:Ht});if(ye===null)return;if(te.preventDefault(),ye.kind==="activate"){Ee!==null&&h!==null&&j(h);return}let ae=Uo(b,ye.index,ye.direction);ae!==null&&(x(ae.personId),z.current?.scrollToIndex(ae.index,{align:"nearest"}))},[Ne,Ee,Ie,F,Ht,h,j,b]),Et=(0,W.useCallback)(te=>{if(te.target.id!==Ne||Ee!==null||!te.target.matches(":focus-visible"))return;let ye=Uo(b,Ie===null?0:Ie,1);ye!==null&&x(ye.personId)},[Ne,Ee,Ie,b]),nn=(0,W.useMemo)(()=>({id:Ne,role:"listbox",tabIndex:0,"aria-label":c.listboxLabel,"aria-describedby":ce}),[Ne,c.listboxLabel,ce]),Me=(0,W.useCallback)(te=>b[te],[b]),rn=(0,W.useCallback)(te=>zt(b[te])?.person_id??`row-${te}`,[b]),Xe=(0,W.useCallback)(()=>pa,[]),pt=(0,W.useMemo)(()=>({enabled:!0,renderVisual:Tn.tapScrollCircleSampleVisual}),[]),Qe=(0,W.useMemo)(()=>g===null?null:Xs(b,g),[g,b]);(0,W.useEffect)(()=>{g!==null&&!Qe&&y(null)},[g,Qe]);let Ge=(0,W.useRef)(null),{isTwoColumn:an}=Vn(Ge,fa);S&&(an||Qe===null)&&R(!1);let Mt=(0,A.jsxs)("div",{ref:p,className:"flex min-h-0 flex-1 flex-col gap-1",children:[(0,A.jsx)("div",{className:`hidden rounded-t-lg border ${q.borderSubtle} ${L.subtle} px-4 py-2 transition-colors sm:block`,children:(0,A.jsxs)("div",{className:"flex items-center",children:[(0,A.jsxs)("div",{className:`flex w-28 shrink-0 flex-col items-center gap-0.5 text-center ${_} ${s.fgSecondary} uppercase tracking-wider`,children:[(0,A.jsx)("span",{className:`font-semibold ${s.fg} text-xs`,children:c.columnNo}),(0,A.jsx)("span",{className:"leading-tight",children:c.columnId}),(0,A.jsx)("span",{className:"whitespace-nowrap leading-tight",children:c.columnScore})]}),(0,A.jsxs)("div",{className:`hidden w-full grid-cols-3 gap-2 font-medium ${s.fgSecondary} text-xs uppercase tracking-wider transition-colors sm:grid xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto]`,children:[(0,A.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,A.jsx)("span",{children:c.columnName}),(0,A.jsx)("span",{className:`font-normal ${_} ${s.fgMuted} uppercase tracking-wider`,children:c.columnTitle})]}),(0,A.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,A.jsx)("span",{children:c.columnCompany}),(0,A.jsx)("span",{className:`font-normal ${_} ${s.fgMuted} uppercase tracking-wider`,children:c.columnDepartment})]}),(0,A.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,A.jsx)("span",{children:c.columnPhone}),(0,A.jsx)("span",{className:`font-normal ${_} ${s.fgMuted} uppercase tracking-wider`,children:c.columnEmail})]}),(0,A.jsx)("div",{className:"hidden items-end justify-end xl:flex",children:(0,A.jsx)("span",{className:`font-normal ${_} ${s.fgMuted} uppercase tracking-wider`,children:c.columnUpdatedAt})})]})]})}),(0,A.jsx)("p",{id:ce,hidden:!0,children:c.listKeyboardHelp}),(0,A.jsx)("div",{ref:l,className:"flex-1",onKeyDown:tn,onFocus:Et,children:(0,A.jsx)(Tn.VirtualScroll,{ref:z,contentProps:nn,activeItemIndex:F===0?void 0:Ee,activeItemVisibleInset:Va,itemCount:F,getItemKey:rn,behaviorOptions:X,getItem:Me,getItemHeight:Xe,viewportSize:N,overscanCount:10,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:pt},locale:d,labels:f,className:`w-full rounded-b-lg border ${q.borderSubtle} border-t-0 ${L.surface} pr-0.75 transition-colors`,children:(te,ye)=>ee(te,ye)})}),n.length===0&&i?(0,A.jsx)("div",{className:"py-8 text-center",children:(0,A.jsx)("p",{className:s.fgMuted,children:c.listNoSearchResults})}):null,F===0&&!i?(0,A.jsx)("div",{className:"py-8 text-center",children:(0,A.jsx)("p",{className:s.fgMuted,children:c.listNoData})}):null]});return(0,A.jsx)("div",{ref:Ge,"data-testid":"contact-map-list-root",className:"flex min-h-0 flex-1 flex-col",style:w,children:an?(0,A.jsxs)(Qt.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,A.jsx)(Qt.Panel,{id:"contact-map-list-pane",defaultSize:{value:68,unit:"percentage"},minSize:{value:Vo,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:Mt}),(0,A.jsx)(Qt.PanelResizeHandle,{id:"contact-map-list-handle",thickness:jo,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:`cursor-col-resize rounded transition-colors ${k.hoverMuted} focus:outline-none focus-visible:ring-2 ${k.focusVisibleRing} ${k.ringOffsetSurface} focus-visible:ring-offset-1`,"aria-label":c.listResizeHandle}),(0,A.jsx)(Qt.Panel,{id:"contact-map-list-detail-pane",defaultSize:{value:32,unit:"percentage"},minSize:{value:Ko,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:(0,A.jsx)(Yt,{placement:"pane",contact:Qe,searchTerm:r,enableHighlighting:o})})]}):(0,A.jsxs)(A.Fragment,{children:[Mt,Qe?(0,A.jsx)(Kn,{isOpen:S,onClose:le,title:c.detailHeading,children:(0,A.jsx)(Yt,{placement:"overlay",contact:Qe,searchTerm:r,enableHighlighting:o})}):null]})})};var ii=require("@aiquants/directory-tree"),Zt=require("@aiquants/resize-panels"),si=require("@aiquants/virtualscroll"),li=Ce(require("@heroicons/react/24/solid/FolderMinusIcon.js")),ci=Ce(require("@heroicons/react/24/solid/FolderPlusIcon.js")),U=require("react"),di=require("react-dom");Ut();var ha=(e,t)=>e&&e.trim()||t;var Tt=require("react"),ya=(e,t=250)=>{let[n,r]=(0,Tt.useState)(e),i=(0,Tt.useRef)(null),o=(0,Tt.useRef)(e),a=(0,Tt.useRef)(null),u=(0,Tt.useRef)(!1);return(0,Tt.useEffect)(()=>{if(!u.current){u.current=!0,r(e),o.current=e;return}o.current=n,i.current=null;let d=c=>{i.current??(i.current=c);let f=c-i.current,p=Math.min(1,Math.max(0,f/t)),l=1-(1-p)**3,g=Math.max(0,Math.round(o.current+(e-o.current)*l));r(g),p<1&&(a.current=requestAnimationFrame(d))};return a.current=requestAnimationFrame(d),()=>{a.current!==null&&cancelAnimationFrame(a.current)}},[e,t]),Math.max(0,n)};var Ae=require("react");Vt();he();var Zo={},Js=250,Zs=4e3,Mr=3,Xo={treeWorkerFactory:"the view remounts","workerUrls.treeWorker":"the page reloads"},Qo=(e,t)=>e.uncategorizedCompany===t.uncategorizedCompany&&e.unnamedPerson===t.unnamedPerson,jn=class{constructor(t,{workerSource:n,logger:r=dt}){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>=Mr){this.logger.error(`[TreeWorker] the tree Worker failed ${Mr} times in a row; the tree stops updating until ${Xo[this.workerSource]} (check ${this.workerSource})`,t);return}let n=Math.min(Js*2**(this.consecutiveFailures-1),Zs);this.logger.warn(`[TreeWorker] the tree Worker failed; retrying in ${n}ms (failure ${this.consecutiveFailures} of ${Mr})`,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 ${de(n)}`);if(!Object.hasOwn(Xo,n))throw new RangeError(`[contact-map] TreeWorkerSession workerSource must be "treeWorkerFactory" or "workerUrls.treeWorker"; got ${de(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>=Mr||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||!Qo(this.finalizeRequest.naming,n))&&(this.finalizeRequest=null),this.lastSyncedRecords=t,this.lastSyncedNaming=n;let r=this.ensureWorker();if(!r)return;let i=this.workerNeedsReset,o=this.postedNaming===null||!Qo(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,r.postMessage({type:"RESET_TREE",generation:this.generation,epochBase:this.latestSnapshot?.rebuildEpoch??0,naming:n}),this.updateState()),t.length>this.postedCount){let a=t.slice(this.postedCount);this.postedCount=t.length,r.postMessage({type:"APPEND_RECORDS",generation:this.generation,records:a}),this.updateState()}i&&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}}},el=e=>{if(e!==void 0)return new Worker(e,{type:"module"});let t=typeof Zo<"u"?Zo.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)")},Jt=null,Jo=e=>e===void 0?"the bundled Worker file (workerUrls.treeWorker unset)":JSON.stringify(e),tl=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},ei=e=>{if(la(e),Jt===null){let t=new jn(()=>el(e),{workerSource:"workerUrls.treeWorker"});return Jt={session:t,workerUrl:e},t}if(Jt.workerUrl!==e)throw new Error(`[contact-map] the tree session already loads its Worker from ${Jo(Jt.workerUrl)} and cannot also load it from ${Jo(e)}; give every contact-map view in the browser tab the same workerUrls.treeWorker, on every route (after changing it, reload the page)`);return Jt.session},nl=()=>{Jt?.session.reset(),Jt=null},rl={snapshot:null,isBuilding:!1};function ba(e,t=!1){let n=ut(),r=n.treeWorkerFactory,i=n.workerUrls?.treeWorker,{labels:o}=We(),a=o.uncategorizedCompany,u=o.noName,d=(0,Ae.useMemo)(()=>({uncategorizedCompany:a,unnamedPerson:u}),[a,u]),c=(0,Ae.useRef)(r);(0,Ae.useEffect)(()=>{c.current=r},[r]);let f=r!==void 0,p=f?void 0:i,l=(0,Ae.useMemo)(()=>f?new jn(()=>tl(c.current)(),{workerSource:"treeWorkerFactory"}):null,[f]),g=(0,Ae.useCallback)(()=>l===null?ei(p):l,[l,p]),y=(0,Ae.useCallback)(w=>g().subscribe(w),[g]),N=(0,Ae.useCallback)(()=>g().getState(),[g]);return(0,Ae.useEffect)(()=>{let w=g();w.syncRecords(e,d),t&&w.finalize()},[g,e,t,d]),(0,Ae.useEffect)(()=>{if(l!==null)return()=>l.stop()},[l]),(0,Ae.useSyncExternalStore)(y,N,()=>rl)}he();pe();Pe();na();gr();var $=require("react/jsx-runtime"),va=Tr(zn),ui=zn.listPanelMinWidth,mi=zn.detailPanelMinWidth,pi=zn.handleThickness,al=va.collapseThreshold,ol=va.expandThreshold,il=(e,t)=>{let{searchQuery:n,enableHighlighting:r}=t,i=ha(e.full_name,t.noName),o=ha(e.title,""),a=(0,$.jsx)(Le,{text:i,query:n,enabled:r});return o?(0,$.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,$.jsx)("span",{children:a}),(0,$.jsx)("span",{className:`${s.fgMuted} text-xs`,children:(0,$.jsx)(Le,{text:o,query:n,enabled:r})})]}):a},sl="contact-map-tree h-full w-full",ll={hoverClassName:L.muted,directorySelectedClassName:`${re.sky} ${k.treeNameSky}`,itemSelectedClassName:`${re.sky} ${k.treeNameSky}`},Sa="h-4 w-4 shrink-0 transition-colors duration-150",fi=(e,t,n)=>({...e,viewportHeightOverride:t,behaviorOptions:{...e.behaviorOptions,enablePointerDrag:!n}}),Lr=null,ti=null,Gn=new Map,ni="",ri=null,ai=null,cl=(e,t,n,r,i)=>{let o=`${n?"icons":"plain"}#${r}#${i.noName}`;(o!==ni||i.formatDirectoryName!==ri||t!==ai)&&(Gn.clear(),ni=o,ri=i.formatDirectoryName,ai=t);let a={entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},u=new Set;for(let d of e){u.add(d.absolutePath);let c=`${d.name}\0${d.memberCount}`,f=Gn.get(d.absolutePath);(!f||f.signature!==c)&&(f={signature:c,result:hi([d],t,n,{searchQuery:"",enableHighlighting:!1,noName:i.noName,formatDirectoryName:i.formatDirectoryName})},Gn.set(d.absolutePath,f));let p=f.result;p.entries.length>0&&a.entries.push(p.entries[0]);for(let[l,g]of p.personPathMap){let y=a.personPathMap.get(l);if(y)for(let N of g)y.add(N);else a.personPathMap.set(l,new Set(g))}for(let[l,g]of p.contactByPath)a.contactByPath.set(l,g);for(let[l,g]of p.ancestorsByPath)a.ancestorsByPath.set(l,g);a.totalCount+=p.totalCount,!a.firstPerson&&p.firstPerson&&(a.firstPerson=p.firstPerson)}for(let d of Gn.keys())u.has(d)||Gn.delete(d);return a},Ca=e=>e.isSelected||e.isItemSelected?m.sky:e.isExpanded&&e.isDirectory?s.fgSecondary:s.fgMuted,gi=e=>{let t=[];for(let n of e)n.type==="directory"&&(t.push(n.absolutePath),n.children&&t.push(...gi(n.children)));return t},dl=e=>{if(e.memberCount===void 0)throw new Error(`[contact-map] directory entry ${e.absolutePath} has no memberCount`);return e.memberCount},hi=(e,t,n,r,i)=>{let o=new Map,a=new Map,u=new Map,d=0,c=null,f=(l,g)=>{let y=[...g,l.absolutePath];u.set(l.absolutePath,y);let N,w,M=l.type==="directory"?r.formatDirectoryName(l.name,dl(l)):l.name,Q=(0,$.jsx)(Le,{text:M,query:r.searchQuery,enabled:r.enableHighlighting});if(l.type==="file"&&l.personId){if(i&&!i.has(l.personId))return null;let X=t.get(l.personId);if(X){a.set(l.absolutePath,X),o.has(l.personId)||o.set(l.personId,new Set);let b=o.get(l.personId);b&&b.add(l.absolutePath),d++,c||(c={personId:l.personId,path:l.absolutePath}),n&&(w=h=>{let x=Ca(h);return h.isSelected||h.isItemSelected||l.isPrimary&&(x=l.title?m.indigo:m.orange),(0,$.jsx)(n.person,{"aria-hidden":"true",className:`${Sa} ${x}`})},l.title&&(Q=il(X,r))),Q=(0,$.jsx)("span",{"data-contact-path":l.absolutePath,className:"block w-full",children:Q})}}else if(l.children){let X=l.children.map(b=>f(b,y)).filter(b=>b!==null);if(i&&X.length===0)return null;if(N=X,n){let b=l.relativePath.startsWith("company:")?n.company:n.department;w=h=>(0,$.jsx)(b,{"aria-hidden":"true",className:`${Sa} ${Ca(h)}`})}}return{name:M,label:Q,type:l.type,absolutePath:l.absolutePath,relativePath:l.relativePath,icon:w,children:N}};return{entries:e.map(l=>f(l,[])).filter(l=>l!==null),personPathMap:o,contactByPath:a,ancestorsByPath:u,firstPerson:c,totalCount:d}},ul=(e,t,n)=>{let r=new Set,i=new Set,o=new Map;t.forEach((f,p)=>{o.set(f.item.person_id,p)});for(let f of t){let p=f.item.person_id,l=e.personPathMap.get(p);if(l)for(let g of l){r.add(g);let y=e.ancestorsByPath.get(g);if(y){for(let N of y)r.add(N);n&&y.length>0&&i.add(y[0])}}}let a=new Map,u=f=>{let p=a.get(f.absolutePath);if(p!==void 0)return p;let l=1/0;if(f.type==="file"){let g=e.contactByPath.get(f.absolutePath);g&&(l=o.get(g.person_id)??1/0)}else if(f.children)for(let g of f.children)l=Math.min(l,u(g));return a.set(f.absolutePath,l),l},d=(f,p=0)=>f.filter(l=>n&&p===0&&i.has(l.absolutePath)?!0:r.has(l.absolutePath)).map(l=>n&&p===0&&i.has(l.absolutePath)?l:l.type==="directory"&&l.children?{...l,children:d(l.children,p+1)}:l).sort((l,g)=>p===0?u(l)-u(g):0),c=d(e.entries);return{...e,entries:c}},oi=(e,t,n)=>{if(e===null)return null;let r=n.get(e);if(r===void 0)return null;if(t!==null&&r.has(t))return t;let i=r.values().next();return i.done?null:i.value},xa=({context:e,controlsContainer:t})=>{let{contactMapRecords:n,contactMapRecordMap:r,filteredItems:i,hasSearchTerm:o,isSearchInProgress:a,isSearchTabActive:u}=e,{locale:d,labels:c,treeLabels:f}=We(),p=c.noName,l=c.treeDirectoryName,g=(0,U.useMemo)(()=>({noName:p,formatDirectoryName:l}),[p,l]),[y,N]=(0,U.useState)(null),[w,M]=(0,U.useState)(!1),{snapshot:Q,isBuilding:X}=ba(n,e.isStreamingComplete),b=Q?.tree??null,h=Q?.rebuildEpoch??0,x=(0,U.useMemo)(()=>b?cl(b,r,y,h,g):null,[b,r,y,h,g]),P=(0,U.useMemo)(()=>{if(!b)return null;if(!o)return x;let B;w||(B=new Set(i.map(ge=>ge.item.person_id)));let me=hi(b,r,y,{...g,searchQuery:e.searchQuery,enableHighlighting:e.enableHighlighting},B);return ul(me,i,w)},[b,x,r,y,e.searchQuery,e.enableHighlighting,o,i,w,g]),K=(0,U.useMemo)(()=>P||{entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},[P]),S=o&&e.errorMessage!==null,[R,le]=(0,U.useState)(K),j=(0,U.useRef)(!1);(0,U.useEffect)(()=>{if(!(a||S)){j.current=!!b,le(K);return}!j.current&&b&&K.entries.length>0&&(j.current=!0,le(K))},[K,b,a,S]);let Ne=o&&(a||S)?R:K,{entries:ce,personPathMap:z,contactByPath:F,totalCount:ee}=Ne,fe=(0,U.useMemo)(()=>gi(ce),[ce]),[Ee,Ie]=(0,U.useState)(()=>ti??new Set),Ht=(0,U.useCallback)(B=>!Ee.has(B),[Ee]),tn=(0,U.useCallback)(B=>{Ie(me=>{let ge=new Set(me);return ge.has(B)?ge.delete(B):ge.add(B),ge})},[]),Et=(0,U.useCallback)(B=>{B.length!==0&&Ie(me=>{let ge=new Set(me);for(let ht of B)ge.add(ht);return ge})},[]),nn=(0,U.useCallback)(B=>{Ie(me=>{if(me.size===0)return me;let ge=!1,ht=new Set(me);for(let J of B)ht.delete(J)&&(ge=!0);return ge?ht:me})},[]);(0,U.useEffect)(()=>{ti=Ee},[Ee]),(0,U.useEffect)(()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem("contact-map.tree-expanded")}catch{}},[]);let[Me,rn]=(0,U.useState)(null),[Xe,pt]=(0,U.useState)(null),[Qe,Ge]=(0,U.useState)(!1),an=(0,U.useCallback)(()=>Ge(!1),[]),Mt=(0,U.useRef)(null),te=(0,U.useRef)(null),{normalizedViewportHeight:ye,panelSizingStyle:ae}=Er(u,te,Mt),ft=(0,U.useCallback)(B=>{let me=F.get(B);return me?(Me!==me.person_id&&rn(me.person_id),B!==Xe&&pt(B),!0):!1},[F,Xe,Me]),It=(0,U.useCallback)(B=>{ft(B)&&Ge(!0)},[ft]),En=(0,U.useCallback)(B=>{It(B.entry.absolutePath)},[It]),Lt=(0,U.useCallback)(B=>B instanceof Element?B.closest("[data-contact-path]")?.getAttribute("data-contact-path")??null:null,[]),{isPopupVisible:Fe,popupItem:Mn,handleClosePopup:Ln}=Un({ref:te,resolveItem:Lt,onSelect:ft}),rt=(0,U.useCallback)(B=>{if(!e.openEmailsWithGmail)return;let me=B.trim();if(!me||me==="-"||typeof window>"u")return;let ge=yt(me,!0);ge&&window.open(ge,"_blank","noopener,noreferrer")},[e.openEmailsWithGmail]),kt=Mn?F.get(Mn):null,at=Fe&&kt!==null&&kt!==void 0;(0,U.useEffect)(()=>{Fe&&!kt&&Ln()},[Fe,kt,Ln]);let Ft=(0,U.useMemo)(()=>({overscanCount:16,callbackThrottleMs:16,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:{enabled:!0,renderVisual:si.tapScrollCircleSampleVisual}},behaviorOptions:{resetOnGetItemHeightChange:!1},preserveScrollAnchor:!0}),[]),wt=(0,U.useMemo)(()=>fi(Ft,ye,at),[Ft,ye,at]);(0,U.useEffect)(()=>{let B=!1;return typeof window>"u"?()=>{B=!0}:Lr?(N(Lr),()=>{B=!0}):((async()=>{try{let[ge,ht,J,oe]=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(B)return;let ke=ge.default,ot=ht.default,Vr=J.default,wa=oe.default;ke&&ot&&Vr&&wa&&(Lr={company:ke,department:ot,title:Vr,person:wa},N(Lr))}catch(ge){dt.warn("Failed to load lucide icons",ge)}})(),()=>{B=!0})},[]);let Bt=(0,U.useMemo)(()=>{if(!y)return;let B=oe=>ke=>(0,$.jsx)(oe,{"aria-hidden":"true",className:`${Sa} ${Ca(ke)}`}),me={company:B(y.company),department:B(y.department),title:B(y.title)},ge=B(y.person),ht=oe=>oe in me,J=oe=>{let[ke]=oe.entry.relativePath.split(":",1);return(ht(ke)?me[ke]:me.company)(oe)};return{directory:J,directoryExpanded:J,file:ge}},[y]),on=(0,U.useCallback)(()=>{Ie(B=>B.size===0?B:new Set)},[]),Br=(0,U.useCallback)(()=>{fe.length>0&&Et(fe)},[fe,Et]),Rt=oi(Me,Xe,z);(0,U.useEffect)(()=>{let B=oi(Me,Xe,z);if(B===null){Me!==null&&rn(null),Xe!==null&&pt(null);return}B!==Xe&&pt(B)},[Me,Xe,z]);let Je=Rt===null?null:F.get(Rt)??null,kn=e.isStreamingComplete,zr=e.isStreamingFailed,Yn=kn&&n.length===0,Xn=(X||!b)&&!Yn,Qn=ya(ee,250),gt=b!==null||Yn,sn=(0,$.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,$.jsxs)("span",{className:`inline-flex h-5 items-center gap-1 rounded ${L.muted} px-1.5 font-medium font-mono ${_} ${s.fgSecondary}`,title:c.treeNodeCountTitle,children:[(0,$.jsx)("span",{children:"\u{1F333}"})," ",c.treeNodeCountLabel," ",gt?c.treeNodeCount(Qn):"\u2026"]}),zr&&!kn?(0,$.jsxs)("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${I.rose} ${re.rose} px-1.5 font-medium ${_} ${m.rose}`,title:c.treeStreamInterruptedTitle,children:[(0,$.jsx)("span",{className:`h-1.5 w-1.5 rounded-full ${et.rose}`}),(0,$.jsx)("span",{children:"\u26D4"})," ",c.treeStreamInterrupted]}):kn?Xn?(0,$.jsxs)("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${I.amber} ${re.amber} px-1.5 font-medium ${_} ${m.amber}`,title:c.treeBuildingTitle,children:[(0,$.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,$.jsx)("span",{className:`absolute inline-flex h-full w-full animate-ping rounded-full ${et.amber}`}),(0,$.jsx)("span",{className:`relative inline-flex h-1.5 w-1.5 rounded-full ${et.amber}`})]}),(0,$.jsx)("span",{children:"\u{1F33F}"})," ",c.treeBuilding]}):(0,$.jsxs)("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${I.emerald} ${re.emerald} px-1.5 font-medium ${_} ${m.emerald}`,title:c.treeCompleteTitle,children:[(0,$.jsx)("span",{className:`h-1.5 w-1.5 rounded-full ${et.emerald}`}),(0,$.jsx)("span",{children:"\u2705"})," ",c.treeComplete]}):(0,$.jsxs)("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${I.sky} ${re.sky} px-1.5 font-medium ${_} ${m.sky}`,title:c.treeStreamLoadingTitle,children:[(0,$.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,$.jsx)("span",{className:`absolute inline-flex h-full w-full animate-ping rounded-full ${et.sky}`}),(0,$.jsx)("span",{className:`relative inline-flex h-1.5 w-1.5 rounded-full ${et.sky}`})]}),(0,$.jsx)("span",{children:"\u23F3"})," ",c.treeStreamLoading]}),o&&(0,$.jsxs)("button",{type:"button",onClick:()=>M(!w),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${T} transition-colors ${w?`${re.blue} ${m.blue}`:`${s.fgMuted} ${k.hoverMuted}`}`,title:c.treeShowEntireCompanyTitle,children:[(0,$.jsx)("span",{children:"\u{1F3E2}"})," ",c.treeShowEntireCompany]}),fe.length>0?(0,$.jsxs)("div",{className:"flex items-center gap-1",children:[(0,$.jsx)("button",{type:"button",onClick:on,className:`inline-flex h-11 w-11 items-center justify-center rounded border ${q.borderControl} ${L.surface} ${s.fgMuted} transition-colors ${k.hoverMuted} ${k.hoverFgSecondary}`,"aria-label":c.treeExpandAll,title:c.treeExpandAllTitle,children:(0,$.jsx)(ci.default,{className:"h-4 w-4"})}),(0,$.jsx)("button",{type:"button",onClick:Br,className:`inline-flex h-11 w-11 items-center justify-center rounded border ${q.borderControl} ${L.surface} ${s.fgMuted} transition-colors ${k.hoverMuted} ${k.hoverFgSecondary}`,"aria-label":c.treeCollapseAll,title:c.treeCollapseAllTitle,children:(0,$.jsx)(li.default,{className:"h-4 w-4"})})]}):null]}),Jn=(0,U.useRef)(null),{isTwoColumn:wn}=Vn(Jn,va,{mediaQuery:"(min-width: 768px)"});Qe&&(wn||Je===null)&&Ge(!1);let Zn=(0,U.useMemo)(()=>({toggle:tn,isExpanded:Ht,expandMultiple:nn,collapseMultiple:Et,isPending:a}),[Et,nn,Ht,tn,a]),er=(0,U.useMemo)(()=>({onEntryClick:En,selectedPath:Rt}),[En,Rt]),Ur=(0,U.useMemo)(()=>({className:sl,lineColor:za,iconOverrides:Bt,showDirectoryIcons:!!Bt,showFileIcons:!!Bt,highlightStyles:ll,entryClassName:"rounded-md",nameClassName:"tracking-tight",directoryNameClassName:`font-normal ${s.fg}`,fileNameClassName:s.fgSecondary}),[Bt]),Rn=(0,$.jsx)("div",{ref:Mt,className:`flex min-h-0 flex-1 flex-col rounded-xl border ${q.borderSubtle} ${L.surface} shadow-sm transition-colors`,children:(0,$.jsx)("div",{ref:te,className:"flex min-h-0 flex-1 flex-col overflow-hidden p-2",children:ce.length>0?(0,$.jsx)(ii.DirectoryTree,{entries:ce,expansion:Zn,selection:er,visual:Ur,virtualScroll:wt,locale:d,labels:f}):(0,$.jsx)("div",{className:`flex h-full w-full items-center justify-center rounded-lg border ${q.borderSubtle} border-dashed ${L.surface} px-6 text-center ${s.fgMuted} text-sm transition-colors`,children:o?c.treeNoMatches:c.treeEmpty})})});return(0,$.jsxs)("div",{ref:Jn,"data-testid":"contact-map-tree-root",className:"flex min-h-0 flex-1 flex-col",style:ae,children:[t&&(0,di.createPortal)(sn,t),wn?(0,$.jsxs)(Zt.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,$.jsx)(Zt.Panel,{id:"contact-map-tree-pane",defaultSize:{value:60,unit:"percentage"},minSize:{value:ui,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:Rn}),(0,$.jsx)(Zt.PanelResizeHandle,{id:"contact-map-tree-handle",thickness:pi,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:`cursor-col-resize rounded transition-colors ${k.hoverMuted} focus:outline-none focus-visible:ring-2 ${k.focusVisibleRing} ${k.ringOffsetSurface} focus-visible:ring-offset-1`,"aria-label":c.treeResizeHandle}),(0,$.jsx)(Zt.Panel,{id:"contact-map-tree-detail-pane",defaultSize:{value:40,unit:"percentage"},minSize:{value:mi,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:(0,$.jsx)(Yt,{placement:"pane",contact:Je,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})})]}):(0,$.jsxs)($.Fragment,{children:[Rn,Je?(0,$.jsx)(Kn,{isOpen:Qe,onClose:an,title:c.detailHeading,children:(0,$.jsx)(Yt,{placement:"overlay",contact:Je,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})}):null]}),at&&kt&&(0,$.jsx)(An,{contactData:kt,openEmailsWithGmail:e.openEmailsWithGmail,openGmailCompose:rt,onRequestClose:Ln})]})};var je=require("react/jsx-runtime"),ml={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},pl=e=>e==="tree"?"tree":"list",Ta=({context:e})=>{let t=ne(),[n,r]=(0,yi.useSearchParams)(),[i,o]=(0,kr.useState)(null),a=pl(n.get(Cn)),{setScrollableRef:u,onPointerDown:d,onPointerMove:c,onPointerUp:f,onPointerLeave:p,onPointerCancel:l,onClickCapture:g}=Ct(),y=(0,kr.useCallback)(N=>{let w=N==="tree"?"tree":"list";if(w===a)return;let M=new URLSearchParams(typeof window<"u"?window.location.search:"");w==="list"?M.delete(Cn):M.set(Cn,w),r(M,{replace:!0})},[a,r]);return(0,je.jsxs)("div",{"data-testid":"contact-map-search-tab-group",className:"flex h-full flex-1 flex-col",children:[(0,je.jsxs)("div",{className:"mt-1 mb-1.5 flex shrink-0 flex-wrap items-center gap-2",children:[(0,je.jsxs)("div",{ref:u,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-lg ${L.muted} p-0.5 transition-colors`,style:ml,onPointerDown:d,onPointerMove:c,onPointerUp:f,onPointerLeave:p,onPointerCancel:l,onClickCapture:g,children:[(0,je.jsxs)("button",{type:"button","data-testid":"contact-map-tab-list","aria-pressed":a==="list",onClick:()=>y("list"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-2 ${T} transition-colors ${a==="list"?`${we.blue} ${s.onPrimary}`:`${s.fgMuted} ${k.hoverSurface}`}`,children:["\u{1F4C4} ",t.listViewTab]}),(0,je.jsxs)("button",{type:"button","data-testid":"contact-map-tab-tree","aria-pressed":a==="tree",onClick:()=>y("tree"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-2 ${T} transition-colors ${a==="tree"?`${we.green} ${s.onPrimary}`:`${s.fgMuted} ${k.hoverSurface}`}`,children:["\u{1F333} ",t.treeViewTab]})]}),(0,je.jsx)("div",{ref:o,className:"flex flex-wrap items-center gap-1.5"})]}),(0,je.jsxs)("div",{className:"flex h-full flex-1 flex-col",children:[(0,je.jsx)("div",{className:`${a==="list"?"flex h-full flex-1 flex-col":"hidden"}`,children:a==="list"?(0,je.jsx)(ga,{context:e}):null}),(0,je.jsx)("div",{className:`${a==="tree"?"flex h-full flex-1 flex-col":"hidden"}`,children:a==="tree"?(0,je.jsx)(xa,{context:e,controlsContainer:i}):null})]})]})};var bi=require("react");he();pe();Pe();var Z=require("@aiquants/fuzzy-search"),_e=require("react");he();pe();Pe();var C=require("react/jsx-runtime"),Na=1e3,wr=(0,_e.memo)(({searchOptions:e,setSearchOptions:t})=>{let n=ne(),r=`flex flex-col gap-1 rounded-md border ${L.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=e.sortBy==="relevance",a=(0,_e.useId)(),u=(0,_e.useId)(),d=(0,_e.useId)(),c=(0,_e.useId)(),f=(0,_e.useId)(),p=(0,_e.useId)(),l=(0,_e.useId)(),g=(0,_e.useId)(),y=(0,_e.useId)(),N=(0,_e.useId)(),w=(0,_e.useId)(),M=[];M.push((0,C.jsxs)("div",{className:`${r} ${I.green} border-l-4`,children:[(0,C.jsxs)("div",{className:`${i} ${m.green}`,children:["\u{1F3D7}\uFE0F ",n.indexBuildHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:a,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:n.indexNgramSize}),(0,C.jsx)("input",{id:a,type:"range",min:"1",max:"4",step:"1",value:e.ngramSize||Z.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize,onChange:b=>t(h=>({...h,ngramSize:parseInt(b.target.value,10)})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.green} text-xs`,children:[n.currentValueLabel," ",e.ngramSize||Z.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexNgramSizeHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:u,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:n.indexMinNgramOverlap}),(0,C.jsx)("input",{id:u,type:"range",min:"1",max:"5",step:"1",value:e.minNgramOverlap||Z.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap,onChange:b=>t(h=>({...h,minNgramOverlap:parseInt(b.target.value,10)})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.green} text-xs`,children:[n.currentValueLabel," ",e.minNgramOverlap||Z.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexMinNgramOverlapHint})]})]},"index-build")),M.push((0,C.jsxs)("div",{className:`${r} ${I.blue} border-l-4`,children:[(0,C.jsxs)("div",{className:`${i} ${m.blue}`,children:["\u{1F50D} ",n.indexCandidateHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:d,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:n.indexThreshold}),(0,C.jsx)("input",{id:d,type:"range",min:"0.0",max:"1.0",step:"0.05",value:e.indexWorkerOptions?.threshold??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,threshold:parseFloat(b.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.blue} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.threshold??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexThresholdHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:f,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:n.indexNgramOverlapThreshold}),(0,C.jsx)("input",{id:f,type:"range",min:"0.1",max:"0.9",step:"0.1",value:e.indexWorkerOptions?.ngramOverlapThreshold??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,ngramOverlapThreshold:parseFloat(b.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.blue} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.ngramOverlapThreshold??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexNgramOverlapThresholdHint})]})]},"candidate-control")),M.push((0,C.jsxs)("div",{className:`${r} ${I.cyan} border-l-4`,children:[(0,C.jsxs)("div",{className:`${i} ${m.cyan}`,children:["\u{1F9ED} ",n.indexStrategyHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:c,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:n.indexStrategy}),(0,C.jsxs)("select",{id:c,value:e.indexWorkerOptions?.strategy??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.strategy??"hybrid",onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,strategy:b.target.value}})),className:`min-h-11 rounded border ${q.borderControl} px-2 pointer-coarse:text-base ${T} transition-colors ${L.surface} ${s.fg}`,children:[(0,C.jsx)("option",{value:"fast",children:n.indexStrategyFast}),(0,C.jsx)("option",{value:"accurate",children:n.indexStrategyAccurate}),(0,C.jsx)("option",{value:"hybrid",children:n.indexStrategyHybrid})]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexStrategyHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:p,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:n.indexMinCandidatesRatio}),(0,C.jsx)("input",{id:p,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.minCandidatesRatio??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,minCandidatesRatio:parseFloat(b.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.cyan} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.minCandidatesRatio??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexMinCandidatesRatioHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:l,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:n.indexMaxCandidatesRatio}),(0,C.jsx)("input",{id:l,type:"range",min:"0.3",max:"0.8",step:"0.1",value:e.indexWorkerOptions?.maxCandidatesRatio??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxCandidatesRatio:parseFloat(b.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.cyan} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxCandidatesRatio??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexMaxCandidatesRatioHint})]})]},"strategy")),M.push((0,C.jsxs)("div",{className:`${r} ${I.indigo} border-l-4`,children:[(0,C.jsxs)("div",{className:`${i} ${m.indigo}`,children:["\u{1F521} ",n.scoreTuningHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:g,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:n.indexJaroWinklerPrefix}),(0,C.jsx)("input",{id:g,type:"range",min:"0.05",max:"0.25",step:"0.05",value:e.indexWorkerOptions?.jaroWinklerPrefix??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,jaroWinklerPrefix:parseFloat(b.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.jaroWinklerPrefix??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexJaroWinklerPrefixHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:y,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:n.maxResults}),(0,C.jsxs)("label",{className:`flex min-h-11 items-center gap-2 ${T} ${s.fgMuted}`,children:[(0,C.jsx)("input",{type:"checkbox",checked:e.indexWorkerOptions?.maxResults===void 0,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxResults:b.target.checked?void 0:Na}}))}),n.noLimit]}),(0,C.jsx)("input",{id:y,type:"range",min:Na,max:"10000",step:"1000",disabled:e.indexWorkerOptions?.maxResults===void 0,value:e.indexWorkerOptions?.maxResults===void 0?Na:e.indexWorkerOptions.maxResults,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxResults:parseInt(b.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),(0,C.jsxs)("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxResults===void 0?n.noLimit:e.indexWorkerOptions.maxResults]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexMaxResultsHint})]})]},"jaro")),M.push((0,C.jsxs)("div",{className:`${r} ${I.emerald} border-l-4`,children:[(0,C.jsxs)("div",{className:`${i} ${m.emerald}`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:N,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:n.fieldWeight}),(0,C.jsx)("input",{id:N,type:"range",min:"0",max:"1",step:"0.05",value:e.indexWorkerOptions?.relevanceFieldWeight??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight??.2,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,relevanceFieldWeight:parseFloat(b.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),(0,C.jsxs)("span",{className:`${m.emerald} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevanceFieldWeight??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight??.2]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexFieldWeightHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:w,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:n.indexPerfectMatchBonus}),(0,C.jsx)("input",{id:w,type:"range",min:"0",max:"0.3",step:"0.1",value:e.indexWorkerOptions?.relevancePerfectMatchBonus??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus??.1,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,relevancePerfectMatchBonus:parseFloat(b.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),(0,C.jsxs)("span",{className:`${m.emerald} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevancePerfectMatchBonus??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus??.1]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexPerfectMatchBonusHint})]}),!o&&(0,C.jsx)("p",{className:`${_} ${m.emerald}`,children:n.relevanceOnlyNotice})]},"relevance"));let Q=(0,_e.useId)(),X=(0,_e.useId)();return M.push((0,C.jsxs)("div",{className:`${r} ${I.teal} border-l-4`,children:[(0,C.jsxs)("div",{className:`${i} ${m.teal}`,children:["\u{1F524} ",n.indexContainmentHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:Q,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:n.indexContainmentBase}),(0,C.jsx)("input",{id:Q,type:"range",min:"0.0",max:"0.7",step:"0.05",value:e.indexWorkerOptions?.containmentScoreBase??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase??.7,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,containmentScoreBase:parseFloat(b.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.teal} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentScoreBase??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase??.7]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexContainmentBaseHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:X,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:n.indexContainmentCoverage}),(0,C.jsx)("input",{id:X,type:"range",min:"0.0",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.containmentCoverageWeight??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight??.3,onChange:b=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,containmentCoverageWeight:parseFloat(b.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.teal} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentCoverageWeight??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight??.3]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexContainmentCoverageHint})]})]},"containment")),(0,C.jsxs)("section",{className:"space-y-3",children:[(0,C.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,C.jsxs)("div",{className:`flex items-center gap-2 font-semibold ${m.green} text-xs transition-colors`,children:[(0,C.jsx)("span",{children:"\u{1F4CA}"}),(0,C.jsx)("span",{className:"tracking-wide",children:n.indexSettingsHeading})]}),(0,C.jsx)("button",{type:"button",onClick:()=>t(b=>({...b,indexWorkerOptions:{threshold:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold||.4,ngramOverlapThreshold:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold||.3,minCandidatesRatio:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio||.1,maxCandidatesRatio:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio||.5,jaroWinklerPrefix:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix||.1,maxResults:void 0,relevanceFieldWeight:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight||.2,relevancePerfectMatchBonus:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus||.1,containmentScoreBase:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase||.7,containmentCoverageWeight:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight||.3,strategy:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.strategy},ngramSize:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize,minNgramOverlap:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${I.green} ${re.green} px-2 font-medium ${m.green} ${T} transition-colors ${k.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),(0,C.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:M})]})});wr.displayName="IndexWorkerSettings";var $e=require("@aiquants/fuzzy-search"),Nt=require("react");he();pe();Pe();var H=require("react/jsx-runtime"),Ea=1e3,Rr=(0,Nt.memo)(({searchOptions:e,setSearchOptions:t})=>{let n=ne(),r=`flex flex-col gap-1 rounded-md border ${L.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=e.sortBy==="relevance",a=(0,Nt.useId)(),u=(0,Nt.useId)(),d=(0,Nt.useId)(),c=(0,Nt.useId)(),f=(0,Nt.useId)(),p=(0,Nt.useId)(),l=[];return l.push((0,H.jsxs)("div",{className:`${r} ${I.purple} border-l-4`,children:[(0,H.jsxs)("div",{className:`${i} ${m.purple}`,children:["\u{1F9EE} ",n.levenshteinCandidateHeading]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:a,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:n.levenshteinThreshold}),(0,H.jsx)("input",{id:a,type:"range",min:"0.0",max:o?"1.5":"1.0",step:"0.05",value:e.levenshteinWorkerOptions?.threshold??$e.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,threshold:parseFloat(g.target.value)}})),className:"h-11 w-full"}),(0,H.jsxs)("span",{className:`${m.purple} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.threshold??$e.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:o?n.levenshteinThresholdHintRelevance:n.levenshteinThresholdHint})]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:u,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthSimilarity}),(0,H.jsx)("input",{id:u,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.lengthSimilarityThreshold??$e.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,lengthSimilarityThreshold:parseFloat(g.target.value)}})),className:"h-11 w-full"}),(0,H.jsxs)("span",{className:`${m.purple} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthSimilarityThreshold??$e.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthSimilarityHint})]})]},"threshold")),l.push((0,H.jsxs)("div",{className:`${r} ${I.pink} border-l-4`,children:[(0,H.jsxs)("div",{className:`${i} ${m.pink}`,children:["\u{1FA84} ",n.scoreTuningHeading]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:d,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthPenalty}),(0,H.jsx)("input",{id:d,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.levenshteinWorkerOptions?.lengthDiffPenalty??$e.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,lengthDiffPenalty:parseFloat(g.target.value)}})),className:"h-11 w-full"}),(0,H.jsxs)("span",{className:`${m.pink} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthDiffPenalty??$e.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthPenaltyHint})]})]},"penalty")),l.push((0,H.jsxs)("div",{className:`${r} ${I.violet} border-l-4`,children:[(0,H.jsxs)("div",{className:`${i} ${m.violet}`,children:["\u{1F4E6} ",n.levenshteinResultsHeading]}),(0,H.jsx)("label",{htmlFor:c,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:n.maxResults}),(0,H.jsxs)("label",{className:`flex min-h-11 items-center gap-2 ${T} ${s.fgMuted}`,children:[(0,H.jsx)("input",{type:"checkbox",checked:e.levenshteinWorkerOptions?.maxResults===void 0,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,maxResults:g.target.checked?void 0:Ea}}))}),n.noLimit]}),(0,H.jsx)("input",{id:c,type:"range",min:Ea,max:"10000",step:"1000",disabled:e.levenshteinWorkerOptions?.maxResults===void 0,value:e.levenshteinWorkerOptions?.maxResults===void 0?Ea:e.levenshteinWorkerOptions.maxResults,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,maxResults:parseInt(g.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),(0,H.jsxs)("span",{className:`${m.violet} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.maxResults===void 0?n.noLimit:e.levenshteinWorkerOptions.maxResults]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.levenshteinMaxResultsHint})]},"max-results")),l.push((0,H.jsxs)("div",{className:`${r} ${I.rose} border-l-4`,children:[(0,H.jsxs)("div",{className:`${i} ${m.rose}`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:f,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:n.fieldWeight}),(0,H.jsx)("input",{id:f,type:"range",min:"0",max:"1",step:"0.05",value:e.levenshteinWorkerOptions?.relevanceFieldWeight??$e.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight??.15,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,relevanceFieldWeight:parseFloat(g.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),(0,H.jsxs)("span",{className:`${m.rose} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.relevanceFieldWeight??$e.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight??.15]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.levenshteinFieldWeightHint})]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:p,className:`font-medium ${T} ${s.fgMuted} transition-colors`,children:n.levenshteinPartialBonus}),(0,H.jsx)("input",{id:p,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.partialMatchBonus??$e.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus,onChange:g=>t(y=>({...y,levenshteinWorkerOptions:{...y.levenshteinWorkerOptions,partialMatchBonus:parseFloat(g.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),(0,H.jsxs)("span",{className:`${m.rose} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.partialMatchBonus??$e.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.levenshteinPartialBonusHint})]}),!o&&(0,H.jsx)("p",{className:`${_} ${m.rose}`,children:n.relevanceOnlyNotice})]},"relevance")),(0,H.jsxs)("section",{className:"space-y-3",children:[(0,H.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,H.jsxs)("div",{className:`flex items-center gap-2 font-semibold ${m.purple} text-xs transition-colors`,children:[(0,H.jsx)("span",{children:"\u{1F4CF}"}),(0,H.jsx)("span",{className:"tracking-wide",children:n.levenshteinSettingsHeading})]}),(0,H.jsx)("button",{type:"button",onClick:()=>t(g=>({...g,levenshteinWorkerOptions:{threshold:$e.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold||.3,lengthSimilarityThreshold:$e.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold||.1,partialMatchBonus:$e.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus||.1,lengthDiffPenalty:$e.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty||1,maxResults:void 0,relevanceFieldWeight:$e.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight||.15}})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${I.purple} ${re.purple} px-2 font-medium ${m.purple} ${T} transition-colors ${k.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),(0,H.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:l})]})});Rr.displayName="LevenshteinWorkerSettings";var Se=require("react/jsx-runtime"),fl={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Pr=(0,bi.memo)(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:r,openEmailsWithGmail:i,setOpenEmailsWithGmail:o,activeTab:a,onTabChange:u})=>{let d=ne(),{setScrollableRef:c,onPointerDown:f,onPointerMove:p,onPointerUp:l,onPointerLeave:g,onPointerCancel:y,onClickCapture:N}=Ct();return(0,Se.jsxs)("div",{className:`wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border ${I.blue} ${L.surface} p-1.5 shadow-md transition-colors`,children:[(0,Se.jsxs)("div",{className:`mb-0.5 flex shrink-0 flex-col gap-1 rounded ${re.blue} px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between`,children:[(0,Se.jsxs)("h3",{className:`font-semibold ${s.fgSecondary} text-xs transition-colors`,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(w=>xr(w.workerUrls)),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded ${we.red} px-1.5 ${T} ${s.onPrimary} transition-colors ${Gt.red}`,title:d.settingsResetAllTitle,children:["\u{1F504} ",d.settingsResetAll]})})]}),(0,Se.jsx)("div",{className:"mb-0 shrink-0",children:(0,Se.jsxs)("div",{ref:c,role:"tablist","aria-label":d.settingsTabsLabel,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-md ${L.muted} p-0.5 transition-colors`,style:fl,onPointerDown:f,onPointerMove:p,onPointerUp:l,onPointerLeave:g,onPointerCancel:y,onClickCapture:N,children:[(0,Se.jsxs)("button",{type:"button",role:"tab","aria-selected":a==="basic",onClick:()=>u("basic"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${T} transition-colors ${a==="basic"?`${we.blue} ${s.onPrimary}`:`${s.fgMuted} ${k.hoverSurface}`}`,children:["\u{1F527} ",d.settingsBasicTab]}),(0,Se.jsxs)("button",{type:"button",role:"tab","aria-selected":a==="advanced",onClick:()=>u("advanced"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${T} transition-colors ${a==="advanced"?`${we.orange} ${s.onPrimary}`:`${s.fgMuted} ${k.hoverSurface}`}`,children:["\u26A1 ",d.settingsAdvancedTab]}),(0,Se.jsxs)("button",{type:"button",role:"tab","aria-selected":a==="index",onClick:()=>u("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${T} transition-colors ${a==="index"?`${we.green} ${s.onPrimary}`:`${s.fgMuted} ${k.hoverSurface}`}`,children:["\u{1F4CA} ",d.indexWorkerName]}),(0,Se.jsxs)("button",{type:"button",role:"tab","aria-selected":a==="levenshtein",onClick:()=>u("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${T} transition-colors ${a==="levenshtein"?`${we.purple} ${s.onPrimary}`:`${s.fgMuted} ${k.hoverSurface}`}`,children:["\u{1F4CF} ",d.levenshteinWorkerName]})]})}),(0,Se.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,Se.jsx)("div",{className:`${a==="basic"?"block":"hidden"}`,children:(0,Se.jsx)(lr,{searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:r,openEmailsWithGmail:i,setOpenEmailsWithGmail:o})}),(0,Se.jsx)("div",{className:`${a==="advanced"?"block":"hidden"}`,children:(0,Se.jsx)(sr,{searchOptions:e,setSearchOptions:t})}),(0,Se.jsx)("div",{className:`${a==="index"?"block":"hidden"}`,children:(0,Se.jsx)(wr,{searchOptions:e,setSearchOptions:t})}),(0,Se.jsx)("div",{className:`${a==="levenshtein"?"block":"hidden"}`,children:(0,Se.jsx)(Rr,{searchOptions:e,setSearchOptions:t})})]})]})});Pr.displayName="SearchOptionsPanel";var $r=require("react");jt();he();pe();Pe();var Si=require("react");pe();var _r=require("react/jsx-runtime"),D=(0,Si.memo)(({label:e,value:t,unit:n,color:r=s.fgMuted})=>(0,_r.jsxs)("div",{className:`wrap-break-word flex min-w-0 flex-col overflow-hidden ${s.fgSecondary} transition-colors sm:flex-row sm:justify-between`,children:[(0,_r.jsxs)("span",{className:"wrap-break-word overflow-hidden text-left",children:[e,":"]}),(0,_r.jsxs)("span",{className:`font-medium ${r} min-w-0 overflow-hidden break-all transition-colors sm:ml-2`,children:[t,n]})]}));D.displayName="StatItem";var Ci=require("react");jt();he();pe();Pe();var v=require("react/jsx-runtime"),en=(0,Ci.memo)(({kind:e,icon:t,stats:n,color:r})=>{let{locale:i,labels:o}=We(),a=z=>ie(i,z);if(!n)return(0,v.jsx)("section",{className:`rounded-lg border ${q.borderSubtle} border-dashed ${L.surface} p-3 ${s.fgMuted} text-xs transition-colors`,children:o.statsNoData});let u=n.basic||{},d=n.workerSpecific||{},c=n.analysis||{},f=u.totalSearches??0,p=u.totalProcessingTime??0,l=u.averageSearchTime??0,g=u.lastSearchTime??0,y=u.errorCount??0,N=u.timestamp,w=c.fieldPerformance||{},M=c.performanceInsights||{},Q=c.recentHistory||[],X=d.specificMetrics||{},b=d.operationCount??0,h=d.operationDistribution||{},x=e==="index",P=e==="levenshtein",K=x?o.indexWorkerName:o.levenshteinWorkerName,S=X,R=X,le=`flex flex-col gap-1 rounded-lg border ${L.surface} p-3 shadow-sm transition-colors`,j="text-xs font-semibold transition-colors",Ne=z=>{if(!z)return;let F=new Date(z);return Number.isNaN(F.getTime())?void 0:o.statsTimestamp(F)},ce=[];if(ce.push((0,v.jsxs)("div",{className:`${le} ${I.blue} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${r}`,children:["\u{1F4CA} ",o.statsBasicHeading]}),(0,v.jsx)(D,{label:o.statTotalSearches,value:a(f),color:r}),(0,v.jsx)(D,{label:o.statAverageSearchTime,value:l.toFixed(2),unit:"ms",color:r}),(0,v.jsx)(D,{label:o.statTotalProcessingTime,value:p.toFixed(2),unit:"ms",color:r}),(0,v.jsx)(D,{label:o.statLastSearchTime,value:g.toFixed(2),unit:"ms",color:r}),(0,v.jsx)(D,{label:o.statErrorCount,value:y,color:y>0?m.red:r}),Ne(N)&&(0,v.jsx)(D,{label:o.statUpdatedAt,value:Ne(N),color:s.fgMuted})]},"basic")),b>0||Object.keys(h).length>0){let z=Object.entries(h).sort(([,F],[,ee])=>(Number(ee)||0)-(Number(F)||0)).slice(0,6);ce.push((0,v.jsxs)("div",{className:`${le} ${I.amber} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.amber}`,children:["\u{1F527} ",o.statsOperationsHeading]}),(0,v.jsx)(D,{label:o.statTotalOperations,value:a(b),color:m.amber}),z.length>0&&(0,v.jsx)("div",{className:"mt-1 space-y-1",children:z.map(([F,ee])=>(0,v.jsx)(D,{label:F,value:a(Number(ee)),unit:o.timesUnit(a(Number(ee))),color:m.amber},F))})]},"operations"))}if(x&&(ce.push((0,v.jsxs)("div",{className:`${le} ${I.green} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.green}`,children:["\u{1F3D7}\uFE0F ",o.statsIndexHeading]}),(0,v.jsx)(D,{label:o.statIndexBuilds,value:a(S.totalIndexBuilds??0),color:m.green}),(0,v.jsx)(D,{label:o.statDataSize,value:a(S.currentDataSize??0),unit:o.itemsUnit(a(S.currentDataSize??0)),color:m.green}),(0,v.jsx)(D,{label:o.statLastBuildTime,value:(S.lastIndexTime??0).toFixed(2),unit:"ms",color:m.green})]},"index-core")),S.cacheSize&&ce.push((0,v.jsxs)("div",{className:`${le} ${I.emerald} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.emerald}`,children:["\u{1F4BE} ",o.statsCacheHeading]}),(0,v.jsx)(D,{label:o.statCacheNgram,value:a(S.cacheSize.ngram??0),color:m.emerald}),(0,v.jsx)(D,{label:o.statCacheWord,value:a(S.cacheSize.word??0),color:m.emerald}),(0,v.jsx)(D,{label:o.statCachePhonetic,value:a(S.cacheSize.phonetic??0),color:m.emerald})]},"index-cache")),S.indexMetadata)){let z=Object.entries(S.indexMetadata).slice(0,6);z.length>0&&ce.push((0,v.jsxs)("div",{className:`${le} ${I.teal} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.teal}`,children:["\u{1F4CB} ",o.statsIndexMetadataHeading]}),z.map(([F,ee])=>{let fe;if(typeof ee=="number"){let Ee=F.toLowerCase();Ee.includes("time")&&!Ee.includes("timestamp")?fe=`${ee.toFixed(2)}ms`:Ee.includes("timestamp")||Ee.includes("at")?fe=Ne(ee)??ee.toString():fe=a(ee)}else fe=String(ee);return(0,v.jsx)(D,{label:F,value:fe,color:m.teal},F)})]},"index-meta"))}if(P){if(ce.push((0,v.jsxs)("div",{className:`${le} ${I.purple} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.purple}`,children:["\u{1F522} ",o.statsCalculationsHeading]}),(0,v.jsx)(D,{label:o.statTotalCalculations,value:a(R.totalCalculations??0),color:m.purple}),(0,v.jsx)(D,{label:o.statDistanceCalculations,value:a(R.totalDistanceCalculations??0),color:m.purple}),(0,v.jsx)(D,{label:o.statAverageDistance,value:typeof R.averageDistance=="number"?R.averageDistance.toFixed(2):"0.00",color:m.purple}),(0,v.jsx)(D,{label:o.statMinDistance,value:R.minDistance??o.notAvailable,color:m.purple}),(0,v.jsx)(D,{label:o.statMaxDistance,value:R.maxDistance??0,color:m.purple})]},"lev-basic")),ce.push((0,v.jsxs)("div",{className:`${le} ${I.fuchsia} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.fuchsia}`,children:["\u{1F3AF} ",o.statsMatchesHeading]}),(0,v.jsx)(D,{label:o.statPartialMatches,value:a(R.partialMatches??0),color:m.fuchsia}),(0,v.jsx)(D,{label:o.statPerfectMatches,value:a(R.perfectMatches??0),color:m.fuchsia}),(0,v.jsx)(D,{label:o.statEarlyTerminations,value:a(R.earlyTerminations??0),color:m.fuchsia})]},"lev-match")),R.similarityThresholds&&ce.push((0,v.jsxs)("div",{className:`${le} ${I.rose} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.rose}`,children:["\u{1F4C8} ",o.statsSimilarityHeading]}),(0,v.jsx)(D,{label:o.statAbove80,value:a(R.similarityThresholds.above80??0),color:m.emerald}),(0,v.jsx)(D,{label:o.statAbove60,value:a(R.similarityThresholds.above60??0),color:m.lime}),(0,v.jsx)(D,{label:o.statAbove40,value:a(R.similarityThresholds.above40??0),color:m.orange}),(0,v.jsx)(D,{label:o.statBelow40,value:a(R.similarityThresholds.below40??0),color:m.red})]},"lev-similarity")),R.distanceDistribution){let z=Object.entries(R.distanceDistribution).sort(([,F],[,ee])=>Number(ee)-Number(F)).slice(0,6);z.length>0&&ce.push((0,v.jsxs)("div",{className:`${le} ${I.indigo} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.indigo}`,children:["\u{1F4CA} ",o.statsDistanceHeading]}),z.map(([F,ee])=>(0,v.jsx)(D,{label:o.statDistance(F),value:a(Number(ee)),unit:o.timesUnit(a(Number(ee))),color:m.indigo},F))]},"lev-distance"))}if(R.queryLengthStats){let z=Object.entries(R.queryLengthStats).sort(([,F],[,ee])=>(ee.count??0)-(F.count??0)).slice(0,6);z.length>0&&ce.push((0,v.jsxs)("div",{className:`${le} ${I.violet} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.violet}`,children:["\u{1F4CF} ",o.statsQueryLengthHeading]}),z.map(([F,ee])=>{let fe=Number(ee.count??0),Ee=Number(ee.averageScore??0);return(0,v.jsx)(D,{label:o.statQueryLength(F),value:o.statQueryLengthValue({count:fe,averagePercent:(Ee*100).toFixed(1)}),color:m.violet},F)})]},"lev-query-length"))}}if(Object.keys(w).length>0){let z=Object.entries(w).sort(([,F],[,ee])=>(ee.averageScore??0)-(F.averageScore??0)).slice(0,6);ce.push((0,v.jsxs)("div",{className:`${le} ${I.purple} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.purple}`,children:["\u{1F4CB} ",o.statsFieldPerformanceHeading]}),z.map(([F,ee])=>{let fe=ee;return(0,v.jsxs)("div",{className:`space-y-1 rounded ${re.purple} p-2 transition-colors`,children:[(0,v.jsx)("div",{className:`font-semibold ${m.purple} text-xs transition-colors`,children:F}),(0,v.jsx)(D,{label:o.statAverageScore,value:`${((fe.averageScore??0)*100).toFixed(1)}%`,color:m.purple}),(0,v.jsx)(D,{label:o.statMatchCount,value:a(fe.matchCount??0),unit:o.itemsUnit(a(fe.matchCount??0)),color:m.purple}),(0,v.jsx)(D,{label:o.statBestWorstScore,value:`${((fe.bestScore??0)*100).toFixed(1)}% / ${((fe.worstScore??0)*100).toFixed(1)}%`,color:m.purple})]},F)})]},"field-performance"))}if(M.bestPerformingField||M.totalHistoryEntries||M.similarityDistribution){let z=(M.recentAverageResultCount??0).toFixed(1);ce.push((0,v.jsxs)("div",{className:`${le} ${I.blue} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.blue}`,children:["\u{1F50D} ",o.statsInsightsHeading]}),M.bestPerformingField&&(0,v.jsx)(D,{label:o.statBestField,value:M.bestPerformingField,color:m.blue}),(0,v.jsx)(D,{label:o.statRecentAverageTime,value:(M.recentAverageProcessingTime??0).toFixed(2),unit:"ms",color:m.blue}),(0,v.jsx)(D,{label:o.statRecentAverageResults,value:z,unit:o.itemsUnit(z),color:m.blue}),(0,v.jsx)(D,{label:o.statThroughput,value:(M.throughputPerSecond??0).toFixed(2),unit:o.throughputUnit,color:m.blue}),(0,v.jsx)(D,{label:o.statCommonQueryLength,value:a(M.mostCommonQueryLength??0),unit:o.charactersUnit(a(M.mostCommonQueryLength??0)),color:m.blue}),(0,v.jsx)(D,{label:o.statHistoryEntries,value:a(M.totalHistoryEntries??0),color:m.blue}),M.similarityDistribution&&(0,v.jsxs)("div",{className:"mt-1 grid grid-cols-2 gap-1",children:[(0,v.jsx)(D,{label:o.statHighSimilarity,value:a(M.similarityDistribution.highSimilarity??0),color:m.emerald}),(0,v.jsx)(D,{label:o.statMediumSimilarity,value:a(M.similarityDistribution.mediumSimilarity??0),color:m.lime}),(0,v.jsx)(D,{label:o.statLowSimilarity,value:a(M.similarityDistribution.lowSimilarity??0),color:m.orange}),(0,v.jsx)(D,{label:o.statVeryLowSimilarity,value:a(M.similarityDistribution.veryLowSimilarity??0),color:m.red})]})]},"performance-insights"))}return Q.length>0&&ce.push((0,v.jsxs)("div",{className:`${le} ${I.sky} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.sky}`,children:["\u{1F4C8} ",o.statsRecentHistoryHeading]}),Q.slice(-3).reverse().map((z,F)=>(0,v.jsxs)("div",{className:`rounded ${re.sky} p-2 transition-colors`,children:[(0,v.jsx)("div",{className:`font-medium ${m.sky} transition-colors`,children:z.operationType}),(0,v.jsx)("div",{className:`${m.sky} text-xs transition-colors`,children:o.statsHistoryEntry({processingTimeMs:z.processingTime.toFixed(2),resultCount:z.resultCount??0})}),Ne(z.timestamp)&&(0,v.jsx)("div",{className:`${_} ${m.sky} transition-colors`,children:Ne(z.timestamp)})]},`${z.operationType}-${z.timestamp??F}`))]},"recent-history")),(0,v.jsxs)("section",{className:"space-y-2",children:[(0,v.jsxs)("div",{className:`flex items-center gap-2 font-semibold text-xs ${r}`,children:[(0,v.jsx)("span",{children:t}),(0,v.jsx)("span",{className:"tracking-wide",children:K})]}),(0,v.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:ce})]})});en.displayName="WorkerStatsSection";var ue=require("react/jsx-runtime"),gl={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Or=(0,$r.memo)(({performanceMetrics:e,searchTerm:t,totalDataCount:n,resultsCount:r,resetStats:i,rebuildIndex:o,isIndexBuilding:a,activeTab:u,onTabChange:d})=>{let{locale:c,labels:f}=We(),p=t.trim(),l=p?r:n,{setScrollableRef:g,onPointerDown:y,onPointerMove:N,onPointerUp:w,onPointerLeave:M,onPointerCancel:Q,onClickCapture:X}=Ct(),b=u!=="index"||a,h=a?f.statsRebuildingTitle:u!=="index"?f.statsRebuildIndexTabOnlyTitle:f.statsRebuildTitle,x=b?`cursor-not-allowed ${L.muted} ${s.fgMuted}`:`${we.blue} ${s.onPrimary} ${Gt.blue}`,P=a?`\u23F3 ${f.statsRebuilding}`:`\u{1F3D7}\uFE0F ${f.statsRebuild}`,K=(0,$r.useCallback)(()=>{o().catch(()=>{})},[o]);return(0,ue.jsxs)("div",{className:`wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border ${I.blue} ${L.surface} p-1.5 shadow-md transition-colors`,children:[(0,ue.jsxs)("div",{className:`mb-0.5 flex shrink-0 flex-col gap-1 rounded ${re.blue} px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between`,children:[(0,ue.jsxs)("h3",{className:`font-semibold ${s.fgSecondary} text-xs transition-colors`,children:["\u{1F4CA} ",f.searchStatistics]}),(0,ue.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,ue.jsx)("button",{type:"button",onClick:K,disabled:b,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${T} transition-colors ${x}`,title:h,children:P}),(0,ue.jsxs)("button",{type:"button",onClick:i,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded ${we.red} px-1.5 ${T} ${s.onPrimary} transition-colors ${Gt.red}`,title:f.statsResetTitle,children:["\u{1F504} ",f.reset]})]})]}),(0,ue.jsx)("div",{className:"mb-0 shrink-0",children:(0,ue.jsxs)("div",{ref:g,role:"tablist","aria-label":f.statsTabsLabel,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-md ${L.muted} p-0.5 transition-colors`,style:gl,onPointerDown:y,onPointerMove:N,onPointerUp:w,onPointerLeave:M,onPointerCancel:Q,onClickCapture:X,children:[(0,ue.jsxs)("button",{type:"button",role:"tab","aria-selected":u==="overview",onClick:()=>d("overview"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${T} transition-colors ${u==="overview"?`${we.blue} ${s.onPrimary}`:`${s.fgMuted} ${k.hoverSurface}`}`,children:["\u{1F4CB} ",f.statsOverviewTab]}),(0,ue.jsxs)("button",{type:"button",role:"tab","aria-selected":u==="index",onClick:()=>d("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${T} transition-colors ${u==="index"?`${we.green} ${s.onPrimary}`:`${s.fgMuted} ${k.hoverSurface}`}`,children:["\u{1F4CA} ",f.statsIndexTab]}),(0,ue.jsxs)("button",{type:"button",role:"tab","aria-selected":u==="levenshtein",onClick:()=>d("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${T} transition-colors ${u==="levenshtein"?`${we.purple} ${s.onPrimary}`:`${s.fgMuted} ${k.hoverSurface}`}`,children:["\u{1F4CF} ",f.statsLevenshteinTab]})]})}),(0,ue.jsxs)("div",{className:"flex flex-col gap-1 pb-0.5",children:[(0,ue.jsxs)("div",{className:`${u==="overview"?"grid":"hidden"} grid-cols-1 gap-2 pr-1 ${s.fgMuted} text-xs transition-colors sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4`,children:[(0,ue.jsx)(D,{label:f.statTotalSearches,value:ie(c,e.totalSearches)}),(0,ue.jsx)(D,{label:f.statAverageSearchTime,value:e.averageSearchTime.toFixed(1),unit:"ms"}),(0,ue.jsx)(D,{label:f.statDataCount,value:ie(c,e.itemCount)}),(0,ue.jsx)(D,{label:p?f.statResultCount:f.statDisplayedCount,value:ie(c,l)})]}),(0,ue.jsx)("div",{className:`${u==="index"?"space-y-3":"hidden"} pr-1 ${s.fgMuted} text-xs transition-colors`,children:(0,ue.jsx)(en,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:m.green})}),(0,ue.jsx)("div",{className:`${u==="levenshtein"?"space-y-3":"hidden"} pr-1 ${s.fgMuted} text-xs transition-colors`,children:(0,ue.jsx)(en,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:m.purple})}),(0,ue.jsxs)("div",{className:"hidden",children:[(0,ue.jsx)(en,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:m.green}),(0,ue.jsx)(en,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:m.purple})]})]})]})});Or.displayName="StatisticsPanel";var V=require("react/jsx-runtime"),hl=/[\u200B\uFEFF]/g,Ma=typeof window<"u",Li=Ma&&typeof document<"u",Ar=(e,t=[],n=!1)=>{let r=(0,G.useRef)(e);r.current=e,(0,G.useEffect)(()=>{if(!(!Ma||n&&!Li))return r.current()},[n,...t])},vi=(e,t,n)=>{let[r,i]=(0,G.useState)(()=>{let o=xi(a=>a.getItem(e));return o&&t.includes(o)?o:n});return Ar(()=>{xi(o=>{o.setItem(e,r)})},[e,r]),[r,i]},xi=e=>{if(!Ma)return null;try{return e(window.sessionStorage)}catch{return null}},Ti=(e,t)=>{let[n,r]=(0,G.useState)(e);return(0,G.useEffect)(()=>{let i=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(i)}},[e,t]),n},yl="contact-map.settings-tab",bl="contact-map.statistics-tab",Sl=["basic","advanced","index","levenshtein"],Cl=["overview","index","levenshtein"],Ni=["full_name","company_name","department","title","email","company_phone_number","mobile_phone_number"],vl={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},La=({streamState:e,...t}={})=>e===void 0?(0,V.jsx)(xl,{...t}):(0,V.jsx)(ki,{...t,streamState:e}),xl=e=>{let{context:t}=Fn();return(0,V.jsx)(ki,{...e,streamState:t})},Tl={setting:"ContactMapSearchPage workerUrls",keys:["indexWorker","levenshteinWorker"],hints:{treeWorker:"set treeWorker on ContactMapConfigProvider or ContactMapAppView"}},ki=e=>{let{streamState:t,onFooterVisibilityChange:n,children:r}=e,i=De(e,"workerUrls"),o=ut(),{locale:a,labels:u}=We(),{contactMapRecords:d,contactMapRecordMap:c,isStreamingComplete:f,isStreamingFailed:p}=t,l=(0,Wr.useNavigation)(),[g]=(0,Wr.useSearchParams)(),y=(0,G.useRef)(null),[N,w]=(0,G.useState)(!0),[M,Q]=(0,G.useState)(o.openEmailsWithGmail??!1),{indexWorker:X,levenshteinWorker:b}=Xt(o.workerUrls,i,Tl),[h,x]=(0,G.useState)(()=>xr({indexWorker:X,levenshteinWorker:b})),[P,K]=(0,G.useState)(g.get("q")||""),S=Ti(P,h.debounceMs??Dr.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs);(0,G.useEffect)(()=>{let J=g.get("q")||"";K(oe=>oe!==J?J:oe)},[g]),(0,G.useEffect)(()=>{if(typeof window>"u")return;let J=new URL(window.location.href);(J.searchParams.get("q")||"")!==S&&(S?J.searchParams.set("q",S):J.searchParams.delete("q"),window.history.replaceState(window.history.state,"",J.toString()))},[S]);let[R,le]=(0,G.useTransition)(),[j,Ne]=(0,G.useState)("search"),[ce,z]=vi(yl,Sl,"basic"),[F,ee]=vi(bl,Cl,"overview"),{setScrollableRef:fe,onPointerDown:Ee,onPointerMove:Ie,onPointerUp:Ht,onPointerLeave:tn,onPointerCancel:Et,onClickCapture:nn}=Ct(),Me=(0,G.useCallback)(()=>{if(!Li)return;let J=y.current;!J||document.activeElement===J||window.requestAnimationFrame(()=>{try{J.focus({preventScroll:!0})}catch{}})},[]),rn=(0,G.useCallback)(J=>{let oe=J;Ne(oe),oe==="search"&&Me()},[Me]),Xe=(0,G.useMemo)(()=>({...h,debounceMs:0}),[h]),[pt,Qe]=(0,G.useState)("union"),Ge=pt==="intersection",an=Ge?u.operatorAndTitle:u.operatorOrTitle,Mt=(0,G.useCallback)(J=>(0,Dr.parseQuerySets)(J,pt),[pt]),te=(0,G.useMemo)(()=>({querySetsOf:Mt}),[Mt]),ye=Ti(d,f?0:800),{searchTerm:ae,setSearchTerm:ft,filteredItems:It,resultTerm:En,isSearching:Lt,isIndexBuilding:Fe,clearSearch:Mn,resetStats:Ln,performanceMetrics:rt,rebuildIndex:kt,error:at}=(0,Ei.useFuzzySearch)(ye,Ni,Xe,te),Ft=ae.trim().length>0,[wt,Bt]=(0,G.useState)(""),[on,Br]=(0,G.useState)(()=>ae),Rt=(0,G.useMemo)(()=>fr(P),[P]),Je=(0,G.useMemo)(()=>fr(S),[S]);(0,G.useEffect)(()=>{S===wt&&Je===ae||le(()=>{Bt(S),ft(Je)})},[S,wt,Je,ae,ft]);let kn=(0,G.useCallback)(J=>{let ke=J.target.value.replace(hl,"");K(ke)},[]),zr=(0,G.useCallback)(()=>{K(""),Bt(""),Mn(),Me()},[Mn,Me]),Yn=(0,G.useCallback)(()=>{Qe(J=>J==="intersection"?"union":"intersection"),Me()},[Me]);Ar(()=>{if(!(j==="search"&&l.state==="idle"&&!R))return;let oe=document.activeElement;if(!!!(oe?.matches('[role="tab"]')||oe?.closest('[role="tablist"]')?.getAttribute("role")==="tablist")&&oe&&oe!==document.body&&oe!==y.current)return;let ot=window.requestAnimationFrame(()=>{Me()});return()=>{window.cancelAnimationFrame(ot)}},[j,l.state,R,Me],!0),Ar(()=>{if(j!=="search")return;let J=[[document,"visibilitychange",()=>{document.visibilityState==="visible"&&Me()}],[window,"pageshow",()=>{Me()}]];for(let[oe,ke,ot]of J)oe.addEventListener(ke,ot);return()=>{for(let[oe,ke,ot]of J)oe.removeEventListener(ke,ot)}},[j,Me],!0),(0,G.useEffect)(()=>(n&&n(j==="search"?"mobile-hidden":"visible"),()=>{n&&n("visible")}),[j,n]),Ar(()=>{let J=document.body,oe=J.style.overflow;return j==="search"&&(J.style.overflow="hidden"),()=>{J.style.overflow=oe}},[j],!0),(0,G.useEffect)(()=>{rt&&dt.info("\u{1F4CA} [STATE] \u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6307\u6A19\u304C\u66F4\u65B0\u3055\u308C\u307E\u3057\u305F:",{totalSearches:rt.totalSearches,averageSearchTime:rt.averageSearchTime,itemCount:rt.itemCount,resultsCount:rt.resultsCount,workersAvailable:!!rt.workerStats})},[rt]);let{isAwaitingDebounce:Xn,isAwaitingSearchTermSync:Qn,isSearchInProgress:gt}=(0,G.useMemo)(()=>{let J=Rt!==Je,oe=Je!==ae,ke=ae.trim().length>0||Rt.trim().length>0;return{isAwaitingDebounce:J,isAwaitingSearchTermSync:oe,isSearchInProgress:R||Lt||En!==ae&&at===null||ke&&Fe||J||oe||on!==ae}},[Rt,Je,ae,En,at,R,Lt,Fe,on]),[sn,Jn]=(0,G.useState)(ae);(0,G.useEffect)(()=>{sn!==ae&&Jn(ae)},[ae,sn]),(0,G.useEffect)(()=>{Xn||Qn||R||Lt||Fe||sn===ae&&on!==ae&&Br(ae)},[ae,on,Xn,Qn,R,Lt,Fe,sn]);let wn=(0,G.useMemo)(()=>oo(wt,Ni),[wt]),Zn=(0,G.useMemo)(()=>wn(It),[wn,It]),er=(0,G.useMemo)(()=>({contactMapRecords:d,contactMapRecordMap:c,filteredItems:Zn,searchQuery:wt,searchTerm:ae,isSearching:Lt,isIndexBuilding:Fe,isPending:R,hasSearchTerm:Ft,enableHighlighting:N,openEmailsWithGmail:M,isSearchInProgress:gt,isSearchTabActive:j==="search",errorMessage:at??null,isStreamingComplete:f,isStreamingFailed:p}),[d,c,Zn,wt,ae,Lt,Fe,R,Ft,N,M,gt,j,at,f,p]),Ur=Ft?It.length:d.length,Rn=ie(a,d.length),B=ie(a,It.length),ge=`${`scrollbar-hidden ${L.subtle} ${s.fg}`}${j==="search"?" h-full min-h-0":""}`;return(0,V.jsx)("div",{"data-contact-map-search-page":"",className:ge,children:(0,V.jsxs)(Wn,{value:j,onValueChange:rn,className:`flex flex-col${j==="search"?" h-full min-h-0":""}`,children:[(0,V.jsxs)(bn,{ref:fe,"data-contact-map-page-tabs":"",style:vl,className:`scrollbar-none mt-0 mb-1 flex h-auto w-full touch-pan-x flex-nowrap overflow-x-auto overflow-y-hidden rounded-md ${L.subtle} transition-colors ${s.fgSecondary}`,onPointerDown:Ee,onPointerMove:Ie,onPointerUp:Ht,onPointerLeave:tn,onPointerCancel:Et,onClickCapture:nn,children:[(0,V.jsxs)(At,{value:"search",className:`min-h-11 min-w-16 px-2 py-0 ${T} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u{1F50D} ",u.searchTab]}),(0,V.jsxs)(At,{value:"settings",className:`min-h-11 min-w-16 px-2 py-0 ${T} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u2699\uFE0F ",u.searchSettings]}),(0,V.jsxs)(At,{value:"statistics",className:`min-h-11 min-w-16 px-2 py-0 ${T} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u{1F4CA} ",u.searchStatistics]})]}),(0,V.jsx)(Dt,{value:"search",className:"mt-0 flex h-full min-h-0 flex-col overflow-hidden",children:(0,V.jsxs)("div",{className:"flex h-full flex-col",children:[(0,V.jsx)("div",{className:`rounded-md border ${q.borderSubtle} ${L.surface} shadow-sm transition-colors`,children:(0,V.jsxs)("div",{className:"flex flex-col",children:[(0,V.jsx)("div",{className:"relative",children:(0,V.jsxs)("div",{className:"flex items-center gap-1 p-1",children:[(0,V.jsxs)("button",{type:"button",onClick:Yn,"aria-pressed":Ge,title:an,className:`inline-flex min-h-11 min-w-11 items-center justify-center gap-0.5 rounded border px-1.5 font-semibold ${T} transition-colors sm:min-w-12 sm:px-2 ${Ge?`border-transparent ${we.blue} ${s.onPrimary} ${Gt.blue}`:`${Ba.amber} ${re.amber} ${m.amber} ${k.hoverSurface}`}`,children:[(0,V.jsx)("span",{children:Ge?u.operatorAnd:u.operatorOr}),(0,V.jsx)("span",{className:`hidden ${_} sm:inline`,children:Ge?u.operatorAndHint:u.operatorOrHint})]}),(0,V.jsx)("input",{ref:y,"data-contact-map-search-field":"",type:"text",value:P,onChange:kn,placeholder:u.searchPlaceholder,className:`min-h-11 flex-1 rounded border ${q.borderControl} border-solid px-2 pointer-coarse:text-base ${T} shadow-sm transition-colors ${k.focusBorder} focus:ring-1 ${k.focusRing} ${L.surface} ${s.fg}`}),P&&(0,V.jsx)("button",{type:"button",onClick:zr,className:`flex min-h-11 min-w-11 items-center justify-center gap-1 rounded border ${q.borderControl} px-1.5 ${T} transition-colors ${k.hoverFg} sm:px-2 ${s.fgMuted}`,title:gt?u.searchBusyTitle:u.clearSearch,"aria-label":gt?void 0:u.clearSearch,disabled:gt,children:gt?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Mi.default,{"aria-hidden":"true",className:"h-3 w-3 animate-spin sm:h-3.5 sm:w-3.5"}),(0,V.jsx)("span",{className:"hidden sm:inline",children:u.searching})]}):"\u2715"})]})}),(0,V.jsxs)("p",{className:`px-1.5 py-0.5 ${_} ${s.fgSecondary} transition-colors`,children:[u.registeredCountLabel," ",(0,V.jsx)("span",{className:`font-semibold ${T} ${s.fg}`,children:Rn})," ",u.recordUnit(Rn),Fe?(0,V.jsxs)("span",{className:`ml-1.5 inline-flex items-center rounded ${re.blue} px-1.5 py-0.2 ${m.blue}`,children:["\u23F3 ",u.rebuildingIndex]}):null,at?(0,V.jsxs)("span",{className:`ml-1.5 inline-flex items-center rounded ${re.rose} px-1.5 py-0.2 ${m.rose}`,children:["\u26A0\uFE0F ",u.errorLabel,(0,V.jsx)("span",{className:"ml-1 break-all font-semibold",children:at})]}):null,Ft&&(0,V.jsxs)("span",{className:`ml-1.5 ${m.blue}`,children:["| ",u.resultCountLabel,gt?(0,V.jsx)("span",{className:"ml-1 font-semibold",children:u.searching}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)("span",{className:`ml-1 font-semibold ${T} ${s.fg}`,children:B}),(0,V.jsx)("span",{className:"ml-0.5",children:u.resultUnit(B)})]})]})]}),(0,V.jsx)("div",{className:"h-2.5 px-2 pb-1.5",children:Fe?(0,V.jsx)(ua,{className:`h-1 ${Pt.progressTrack}`,indicatorClassName:et.blue}):null})]})}),r?r(er):(0,V.jsx)(Ta,{context:er})]})}),(0,V.jsx)(Dt,{value:"settings",className:"mt-0",children:(0,V.jsx)(Pr,{searchOptions:h,setSearchOptions:x,enableHighlighting:N,setEnableHighlighting:w,openEmailsWithGmail:M,setOpenEmailsWithGmail:Q,activeTab:ce,onTabChange:z})}),(0,V.jsx)(Dt,{value:"statistics",className:"mt-0",children:(0,V.jsx)(Or,{performanceMetrics:rt,searchTerm:ae,totalDataCount:d.length,resultsCount:Ur,resetStats:Ln,rebuildIndex:kt,isIndexBuilding:Fe,activeTab:F,onTabChange:ee})})]})})};var Hr=require("react");he();var qn=require("react/jsx-runtime"),Nl=(e,t,n)=>{switch(e){case"retrying":return{phase:e,status:n.annotationReconnecting(t),alert:""};case"failed":return{phase:e,status:"",alert:n.streamLoadFailed(t)};case"auth-required":return{phase:e,status:"",alert:n.streamAuthRequired};case"idle":case"streaming":case"complete":return{phase:e,status:"",alert:""}}},Ir=(0,Hr.memo)(({phase:e,loadedCount:t})=>{let n=ne(),[r,i]=(0,Hr.useState)(()=>({phase:e,status:"",alert:""})),o=r.phase===e?r:Nl(e,t,n);return o!==r&&i(o),(0,qn.jsxs)("span",{"data-testid":"contact-map-stream-announcer",className:"sr-only",children:[(0,qn.jsx)("span",{role:"status",children:o.status}),(0,qn.jsx)("span",{role:"alert",children:o.alert})]})});Ir.displayName="ContactMapStreamAnnouncer";var mt=require("react");he();var El="[data-contact-map-search-page]",Ml=["[data-contact-map-search-field]",'[data-contact-map-page-tabs] [role="tab"][aria-selected="true"]'],wi=e=>{for(let t=e;t!==null;t=t.parentElement){let n=t.querySelector(El);if(n!==null)return n}return null},Ri=e=>{let{ownerDocument:t}=e,{activeElement:n}=t;if(n!==null&&n!==t.body)return null;for(let r of Ml){let i=e.querySelector(r);if(i!==null&&(i.focus(),t.activeElement===i))return i}return null};pe();fn();Pe();var Wt=require("react/jsx-runtime"),Ll="shrink-0 pb-2",kl=`flex items-center gap-2 rounded-md border ${I.rose} ${re.rose} px-[11px] py-[3px] ${m.rose} ${T}`,wl=`inline-flex min-h-11 min-w-11 shrink-0 items-center justify-center rounded border ${q.borderControl} ${L.surface} px-[11px] font-semibold ${m.rose} ${T} transition-colors ${k.hoverRoseTint} ${ct}`,Rl=e=>e==="failed"||e==="auth-required",Pl=({phase:e,loadedCount:t,errorMessage:n,onRetry:r,leftWithFocusRef:i})=>{let o=ne(),a=(0,mt.useId)(),u=(0,mt.useRef)(null);return(0,mt.useLayoutEffect)(()=>{let d=u.current;return()=>{d?.contains(d.ownerDocument.activeElement)&&(i.current=wi(d))}},[i]),(0,Wt.jsx)("div",{className:Ll,children:(0,Wt.jsxs)("div",{ref:u,role:"group","aria-labelledby":a,"data-testid":"contact-map-stream-failure-notice","data-phase":e,className:kl,children:[(0,Wt.jsx)("span",{"aria-hidden":"true",children:"\u26D4"}),(0,Wt.jsx)("span",{id:a,className:"min-w-0 flex-1 font-medium",title:e==="failed"?n??void 0:void 0,children:e==="auth-required"?o.streamAuthRequired:o.streamLoadFailed(t)}),(0,Wt.jsx)("button",{type:"button","data-testid":"contact-map-retry-button","aria-describedby":a,onClick:r,className:wl,children:o.streamRetry})]})})},Fr=(0,mt.memo)(({phase:e,loadedCount:t,errorMessage:n,onRetry:r})=>{let i=(0,mt.useRef)(null),o=Rl(e);return(0,mt.useLayoutEffect)(()=>{let a=i.current;o||a===null||(i.current=null,Ri(a))},[o]),o?(0,Wt.jsx)(Pl,{phase:e,loadedCount:t,errorMessage:n,onRetry:r,leftWithFocusRef:i}):null});Fr.displayName="ContactMapStreamFailureNotice";var Ye=require("react/jsx-runtime"),_l=({renderHeader:e,title:t,onFooterVisibilityChange:n})=>{let r=ne(),i=t===void 0?r.appTitle:t,{context:o,retryNow:a}=Fn(),u=(0,Ye.jsx)(Cr,{recordCount:o.contactMapRecords.length,companyCount:o.companyCount,phase:o.streamPhase,loadedCount:o.loadedCount,totalCount:o.totalCount});return(0,Ye.jsxs)("div",{"data-testid":"contact-map-app-view",className:"flex h-full w-full flex-col",children:[(0,Ye.jsx)(Ir,{phase:o.streamPhase,loadedCount:o.loadedCount}),e?e({title:i,annotation:u}):(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:i}),u]}),(0,Ye.jsx)(Fr,{phase:o.streamPhase,loadedCount:o.loadedCount,errorMessage:o.errorMessage,onRetry:a}),(0,Ye.jsx)("div",{className:"min-h-0 flex-1",children:(0,Ye.jsx)(La,{streamState:o,onFooterVisibilityChange:n})})]})},$l=e=>{let t=ut(),n=De(e,"streamEndpoint"),r=De(e,"workerUrls"),i=De(e,"locale"),o=De(e,"labels"),a=(0,ka.useMemo)(()=>({...t,streamEndpoint:n===void 0?t.streamEndpoint:n,workerUrls:Xt(t.workerUrls,r,{setting:"ContactMapAppView workerUrls"}),locale:i===void 0?t.locale:i,labels:o===void 0?t.labels:o}),[t,n,r,i,o]),u=i!==void 0,d=o!==void 0,c=(0,ka.useMemo)(()=>({locale:u?"ContactMapAppView locale":"locale",labels:d?"ContactMapAppView labels":"labels"}),[u,d]);return(0,Ye.jsx)(ca,{config:a,chromeSurface:c,children:(0,Ye.jsx)(_l,{...e})})};jt();he();var Pi=require("@aiquants/route-revalidation");var Ol=(0,Pi.createShouldRevalidate)({submissions:"url",query:{ignore:[Cn,"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,ContactMapStreamAnnouncer,ContactMapStreamClient,ContactMapStreamFailureNotice,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 Hi=Object.create;var tr=Object.defineProperty;var Fi=Object.getOwnPropertyDescriptor;var Ii=Object.getOwnPropertyNames;var Bi=Object.getPrototypeOf,zi=Object.prototype.hasOwnProperty;var Re=(e,t)=>()=>(e&&(t=e(e=0)),t);var _a=(e,t)=>{for(var n in t)tr(e,n,{get:t[n],enumerable:!0})},Aa=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ii(t))!zi.call(e,o)&&o!==n&&tr(e,o,{get:()=>t[o],enumerable:!(a=Fi(t,o))||a.enumerable});return e};var Ce=(e,t,n)=>(n=e!=null?Hi(Bi(e)):{},Aa(t||!e||!e.__esModule?tr(n,"default",{value:e,enumerable:!0}):n,e)),Ui=e=>Aa(tr({},"__esModule",{value:!0}),e);var et,Ut,$a,ln,cn,Pn,bt,Ye,nr,Gr,qr,st,le,Vt=Re(()=>{"use strict";et=e=>{if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null},Ut=e=>!e||typeof e!="object"?null:"item"in e?e.item??null:"person_id"in e?e:null,$a=(e,t)=>{if(!e)return{value:null,fieldKey:null};for(let n of t){let a=et(e[n]);if(a)return{value:a,fieldKey:n}}return{value:null,fieldKey:null}},ln=e=>$a(e,["custom_email","email"]),cn=e=>$a(e,["custom_mobile_phone_number","mobile_phone_number","company_phone_number"]),Pn=e=>{let t=et(e);if(!t)return null;let n=t.replace(/[^0-9+#*]/g,"");return n.length===0?null:`tel:${n}`},bt=(e,t)=>{let n=et(e);return n?t?`https://mail.google.com/mail/?view=cm&fs=1&to=${encodeURIComponent(n)}`:`mailto:${encodeURIComponent(n)}`:null},Ye=(e,t)=>String(e).padStart(t,"0"),nr=e=>`${Ye(e.getUTCFullYear(),4)}-${Ye(e.getUTCMonth()+1,2)}-${Ye(e.getUTCDate(),2)}`,Gr=e=>`${nr(e)} ${Ye(e.getUTCHours(),2)}:${Ye(e.getUTCMinutes(),2)}:${Ye(e.getUTCSeconds(),2)}`,qr=e=>`${Ye(e.getFullYear(),4)}-${Ye(e.getMonth()+1,2)}-${Ye(e.getDate(),2)} ${Ye(e.getHours(),2)}:${Ye(e.getMinutes(),2)}:${Ye(e.getSeconds(),2)}`,st=(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)},le=e=>e==null?"-":typeof e=="string"?et(e)??"-":typeof e=="number"?Number.isFinite(e)?String(e):"-":String(e)});var ie,Oa,_t=Re(()=>{"use strict";ie=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":Oa(e);case"function":return Oa(e);case"number":return Object.is(e,-0)?"-0":String(e);default:return String(e)}},Oa=e=>{try{return Object.prototype.toString.call(e)}catch{return"[object ?]"}}});var dn,$e,un=Re(()=>{"use strict";dn=e=>{if(typeof e!="object"||e===null)return!1;try{let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}catch{return!1}},$e=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0});var Vi,rr,Yr=Re(()=>{"use strict";Vi=(e,t)=>{let n=Array.from({length:t.length+1},(a,o)=>o);for(let a=1;a<=e.length;a+=1){let o=[a];for(let i=1;i<=t.length;i+=1){let r=n[i-1]+(e[a-1]===t[i-1]?0:1);o.push(Math.min(n[i]+1,o[i-1]+1,r))}n=o}return n[t.length]},rr=(e,t)=>{let n=e.toLowerCase();if(n.length>=3){let o=t.find(i=>i.toLowerCase().startsWith(n));if(o!==void 0)return o}let a;for(let o of t){let i=Vi(n,o.toLowerCase());i<=Math.max(1,Math.floor(o.length/4))&&(a===void 0||i<a.distance)&&(a={key:o,distance:i})}return a?.key}});var St,or,Ki,se,Kt,ar,Wa,mn,lt,ji,Da,Ha,Gi,Xr,qi,Yi,Xi,ir,Qr,Jr,jt=Re(()=>{"use strict";St=require("@aiquants/directory-tree"),or=require("@aiquants/virtualscroll");Vt();_t();un();Yr();Ki=Object.freeze({en:"en-US",ja:"ja-JP"}),se=(e,t)=>t.toLocaleString(Ki[e]),Kt=(e,t,n)=>e==="1"?t:n,ar=Object.freeze({en:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"Total:",annotationCompaniesLabel:"Companies:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`Streaming (${se("en",e)} / ${se("en",t)} \xB7 ${n}%)`,annotationStreamingCount:e=>`Streaming (${se("en",e)} loaded)`,streamLoadFailed:e=>`Failed to load (${se("en",e)} received)`,annotationReconnecting:e=>`Reconnecting (${se("en",e)} received)`,streamRetry:"Retry",recordUnit:e=>Kt(e,"record","records"),companyUnit:e=>Kt(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=>Kt(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=>se("en",e),uncategorizedCompany:"Uncategorized",treeDirectoryName:(e,t)=>`${e} (${se("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:Gr,recordDate:nr,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",statsTabsLabel:"Statistics tabs",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:qr,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=se("en",e);return`${n} ${Kt(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: ${se("en",t)}`,timesUnit:e=>Kt(e," time"," times"),itemsUnit:e=>Kt(e," item"," items"),charactersUnit:e=>Kt(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 (${se("ja",e)} / ${se("ja",t)} \u4EF6\u30FB${n}%)`,annotationStreamingCount:e=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${se("ja",e)} \u4EF6)`,streamLoadFailed:e=>`\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F (${se("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,annotationReconnecting:e=>`\u518D\u63A5\u7D9A\u4E2D (${se("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,streamRetry:"\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=>`${se("ja",e)} \u500B`,uncategorizedCompany:"\u672A\u5206\u985E",treeDirectoryName:(e,t)=>`${e} (${se("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:Gr,recordDate:nr,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",statsTabsLabel:"\u691C\u7D22\u7D71\u8A08\u30BF\u30D6",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:qr,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})=>`${se("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: ${se("ja",t)} \u4EF6`,timesUnit:()=>" \u56DE",itemsUnit:()=>" \u4EF6",charactersUnit:()=>" \u6587\u5B57",throughputUnit:" ops/\u79D2"})}),Wa=Object.freeze(Object.keys(ar.en)),mn=Object.freeze([...St.DIRECTORY_TREE_LABEL_KEYS,...Wa]),lt=Object.freeze({en:Object.freeze({...St.DIRECTORY_TREE_LABEL_CATALOGS.en,...ar.en}),ja:Object.freeze({...St.DIRECTORY_TREE_LABEL_CATALOGS.ja,...ar.ja})}),ji=new Set(mn),Da=Object.keys(lt).map(e=>JSON.stringify(e)).join(" or "),Ha=Object.freeze({locale:"locale",labels:"labels"}),Gi=(e,t,n)=>{e[t]=n},Xr=(e,t=Ha.locale)=>{if(e!==void 0&&typeof e!="string")throw new TypeError(`[contact-map] ${t} must be ${Da} or left out; got ${ie(e)}`);if(e!==void 0&&!Object.hasOwn(lt,e))throw new RangeError(`[contact-map] ${t} must be ${Da} or left out; got ${ie(e)}`);return(0,or.resolveVirtualScrollLocale)(e)},qi=(e,t,n,a)=>{if(typeof a=="function"){if(typeof n!="function")throw new TypeError(`[contact-map] ${e}.${t} must be a function; got ${ie(n)}`);return}if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string; got ${ie(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${ie(n)}`)},Yi=(e,t,n)=>{let a=Object.create(null);for(let o of Object.getOwnPropertyNames(e)){if(!ji.has(o)){let r=rr(o,mn);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 ${ie(o)}`)}let i=e[o];i!==void 0&&(qi(n,o,i,t[o]),a[o]=i)}return a},Xi=e=>{let t={},n=!1;for(let a of St.DIRECTORY_TREE_LABEL_KEYS){let o=e[a];o!==void 0&&(t[a]=o,n=!0)}return n?t:void 0},ir=(e,t,n=Ha)=>{let a=Xr(e,n.locale);if(t===void 0)return lt[a];if(!dn(t))throw new TypeError(`[contact-map] ${n.labels} must be a plain object or left out; got ${ie(t)}`);let o=Yi(t,lt[a],n.labels),r={...(0,St.resolveDirectoryTreeLabels)(a,Xi(o)),...ar[a]};for(let u of Wa){let d=o[u];d!==void 0&&Gi(r,u,d)}return Object.freeze(r)},Qr=e=>{let t={};for(let n of St.DIRECTORY_TREE_LABEL_KEYS)t[n]=e[n];return Object.freeze(t)},Jr=e=>{let t={};for(let n of or.VIRTUAL_SCROLL_LABEL_KEYS)t[n]=e[n];return Object.freeze(t)}});var Fa,Ia,ct,za,Qi,ea,Zr,Ba,He,ne,he=Re(()=>{"use strict";Fa=require("@aiquants/directory-tree"),Ia=require("@aiquants/virtualscroll"),ct=require("react");jt();za=require("react/jsx-runtime"),Qi=Object.freeze({locale:"en",labels:lt.en,treeLabels:Qr(lt.en),engineLabels:Jr(lt.en)}),ea=(0,ct.createContext)(Qi),Zr=(e,t)=>{let n=(0,ct.useRef)(null),a=n.current;return a!==null&&t.every(o=>a[o]===e[o])?a:(n.current=e,e)},Ba=({locale:e,labels:t,surface:n,children:a})=>{let o=Xr(e,n.locale),i=(0,ct.useMemo)(()=>ir(o,t,n),[o,t,n]),r=Zr(i,mn),u=Zr(Qr(r),Fa.DIRECTORY_TREE_LABEL_KEYS),d=Zr(Jr(r),Ia.VIRTUAL_SCROLL_LABEL_KEYS),c=(0,ct.useMemo)(()=>({locale:o,labels:r,treeLabels:u,engineLabels:d}),[o,r,u,d]);return(0,za.jsx)(ea.Provider,{value:c,children:a})},He=()=>(0,ct.useContext)(ea),ne=()=>(0,ct.useContext)(ea).labels});var s,k,q,m,re,F,tt,Ua,we,Gt,w,At,Va,pe=Re(()=>{"use strict";s={fg:"text-[color:light-dark(#0f172b,#f8fafc)]",fgSecondary:"text-[color:light-dark(#314158,#e2e8f0)]",fgMuted:"text-[color:light-dark(#44536a,#cad5e2)]",onPrimary:"text-[color:light-dark(#ffffff,#0f172b)]"},k={surface:"bg-[color:light-dark(#ffffff,#0f172b)]",subtle:"bg-[color:light-dark(#f8fafc,#1d293d)]",muted:"bg-[color:light-dark(#f1f5f9,#1d293d)]"},q={borderSubtle:"border-[color:light-dark(#e2e8f0,#314158)]",borderControl:"border-[color:light-dark(#62748e,#90a1b9)]"},m={amber:"text-[color:light-dark(#7b3306,#fee685)]",blue:"text-[color:light-dark(#193cb8,#bedbff)]",cyan:"text-[color:light-dark(#104e64,#a2f4fd)]",emerald:"text-[color:light-dark(#004f3b,#a4f4cf)]",fuchsia:"text-[color:light-dark(#8a0194,#f6cfff)]",green:"text-[color:light-dark(#0d542b,#b9f8cf)]",indigo:"text-[color:light-dark(#372aac,#c6d2ff)]",lime:"text-[color:light-dark(#35530e,#d8f999)]",orange:"text-[color:light-dark(#7e2a0c,#ffd6a7)]",pink:"text-[color:light-dark(#a3004c,#fccee8)]",purple:"text-[color:light-dark(#6e11b0,#e9d4ff)]",red:"text-[color:light-dark(#9f0712,#ffc9c9)]",rose:"text-[color:light-dark(#a50036,#ffccd3)]",sky:"text-[color:light-dark(#024a70,#b8e6fe)]",teal:"text-[color:light-dark(#0b4f4a,#96f7e4)]",violet:"text-[color:light-dark(#5d0ec0,#ddd6ff)]"},re={amber:"bg-[color:light-dark(#fffbeb,#461901)]",blue:"bg-[color:light-dark(#eff6ff,#162456)]",emerald:"bg-[color:light-dark(#ecfdf5,#002c22)]",green:"bg-[color:light-dark(#f0fdf4,#032e15)]",purple:"bg-[color:light-dark(#faf5ff,#3c0366)]",rose:"bg-[color:light-dark(#fff1f2,#4d0218)]",sky:"bg-[color:light-dark(#f0f9ff,#052f4a)]"},F={amber:"border-[color:light-dark(#fee685,#7b3306)]",blue:"border-[color:light-dark(#bedbff,#193cb8)]",cyan:"border-[color:light-dark(#a2f4fd,#104e64)]",emerald:"border-[color:light-dark(#a4f4cf,#004f3b)]",fuchsia:"border-[color:light-dark(#f6cfff,#8a0194)]",green:"border-[color:light-dark(#b9f8cf,#0d542b)]",indigo:"border-[color:light-dark(#c6d2ff,#372aac)]",pink:"border-[color:light-dark(#fccee8,#a3004c)]",purple:"border-[color:light-dark(#e9d4ff,#6e11b0)]",rose:"border-[color:light-dark(#ffccd3,#a50036)]",sky:"border-[color:light-dark(#b8e6fe,#024a70)]",teal:"border-[color:light-dark(#96f7e4,#0b4f4a)]",violet:"border-[color:light-dark(#ddd6ff,#5d0ec0)]"},tt={amber:"bg-[color:light-dark(#bb4d00,#fcbb00)]",blue:"bg-[color:light-dark(#155dfc,#51a2ff)]",emerald:"bg-[color:light-dark(#009966,#00d492)]",rose:"bg-[color:light-dark(#ec003f,#ff637e)]",sky:"bg-[color:light-dark(#0084d1,#00bcff)]"},Ua={amber:"border-[color:light-dark(#bb4d00,#fcbb00)]"},we={blue:"bg-[color:light-dark(#193cb8,#bedbff)]",green:"bg-[color:light-dark(#0d542b,#b9f8cf)]",orange:"bg-[color:light-dark(#7e2a0c,#ffd6a7)]",purple:"bg-[color:light-dark(#6e11b0,#e9d4ff)]",red:"bg-[color:light-dark(#9f0712,#ffc9c9)]"},Gt={blue:"hover:bg-[color:light-dark(#162456,#eff6ff)]",red:"hover:bg-[color:light-dark(#460809,#fef2f2)]"},w={hoverSurface:"hover:bg-[color:light-dark(#ffffff,#0f172b)]",hoverMuted:"hover:bg-[color:light-dark(#f1f5f9,#1d293d)]",hoverBlueTint:"hover:bg-[color:light-dark(#eff6ff,#162456)]",hoverRoseTint:"hover:bg-[color:light-dark(#fff1f2,#4d0218)]",hoverFg:"hover:text-[color:light-dark(#0f172b,#f8fafc)]",hoverFgSecondary:"hover:text-[color:light-dark(#314158,#e2e8f0)]",hoverBlueFg:"hover:text-[color:light-dark(#193cb8,#bedbff)]",hoverBlueAccentBorder:"hover:border-[color:light-dark(#155dfc,#51a2ff)]",focusRing:"focus:ring-[color:light-dark(#1447e6,#74d4ff)]",focusBorder:"focus:border-[color:light-dark(#1447e6,#74d4ff)]",focusVisibleRing:"focus-visible:ring-[color:light-dark(#1447e6,#74d4ff)]",focusVisibleOutline:"focus-visible:outline-[color:light-dark(#1447e6,#74d4ff)]",activeRowOutline:"in-focus-visible:data-[contact-map-row-active]:outline-[color:light-dark(#1447e6,#74d4ff)]",ringOffsetSurface:"ring-offset-[color:light-dark(#ffffff,#0f172b)]",selectedRing:"ring-[color:light-dark(#155dfc,#51a2ff)]",activeTabSurface:"data-[state=active]:bg-[color:light-dark(#ffffff,#0f172b)]",activeTabFg:"data-[state=active]:text-[color:light-dark(#0f172b,#f8fafc)]",activeTabBlueFg:"data-[state=active]:text-[color:light-dark(#193cb8,#bedbff)]",treeNameSky:"[&_.directory-tree-name]:text-[color:light-dark(#024a70,#b8e6fe)]"},At={mark:"bg-[color:light-dark(#fff085,#733e0a)]",progressTrack:"bg-[color:light-dark(#bedbff,#193cb8)]",scrim:"bg-[color:rgb(15_23_43/0.5)]"},Va="#71829b"});var N,$t,_,Pe=Re(()=>{"use strict";N="text-[length:var(--aqcm-font-size-body,0.8125rem)] leading-[var(--aqcm-line-height-body,1.25rem)]",$t="text-[length:var(--aqcm-font-size-caption,0.6875rem)]",_=`${$t} leading-[var(--aqcm-line-height-caption,1.25rem)]`});var cr,dr,ur,mr,ta=Re(()=>{"use strict";pe();cr="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]",dr=Object.freeze({right:"var(--aqcm-overlay-right, 0px)"}),ur=`absolute inset-0 ${At.scrim}`,mr=()=>!1});var Ji,Zi,dt,Ka,ja,pn,fn=Re(()=>{"use strict";pe();Ji="min-w-11 py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",Zi=2,dt=`focus-visible:outline-2 ${w.focusVisibleOutline} focus-visible:outline-offset-2`,Ka=`in-focus-visible:data-[contact-map-row-active]:outline-2 in-focus-visible:data-[contact-map-row-active]:-outline-offset-2 ${w.activeRowOutline}`,ja=Zi,pn=`inline-block max-w-full underline-offset-2 hover:underline focus-visible:underline ${dt} ${Ji}`});function Oe(...e){return(0,qa.twMerge)((0,Ga.clsx)(e))}var Ga,qa,An=Re(()=>{"use strict";Ga=require("clsx"),qa=require("tailwind-merge")});var Ya,Xa,Qa,Ja,be,Za,Y,es,Ue,ts,ns,rs,$n,hn,as,os,gn,na,ra,On,aa=Re(()=>{"use strict";Ya=require("@aiquants/swipe-overlay"),Xa=Ce(require("lucide-react/dist/esm/icons/check.js")),Qa=Ce(require("lucide-react/dist/esm/icons/copy.js")),Ja=Ce(require("lucide-react/dist/esm/icons/x.js")),be=require("react"),Za=require("react-dom");Vt();he();ta();pe();fn();Pe();An();Y=require("react/jsx-runtime"),es=350,Ue=e=>e.stopPropagation(),ts=Object.freeze({onClick:Ue,onDoubleClick:Ue,onContextMenu:Ue,onPointerDown:Ue,onPointerUp:Ue,onMouseDown:Ue,onMouseUp:Ue,onTouchStart:Ue,onTouchEnd:Ue,onKeyDown:Ue,onKeyUp:Ue,onFocus:Ue,onBlur:Ue}),ns=Oe(cr,"flex items-center justify-center px-4 py-6"),rs=`relative max-h-full w-full max-w-md overflow-y-auto overscroll-contain rounded-lg border ${q.borderControl} ${k.surface} p-4 shadow-lg transition-colors`,$n=0,hn=null,as=()=>{let e=document.body.style;$n+=1,$n===1&&(hn={userSelect:e.userSelect,webkitUserSelect:e.webkitUserSelect}),e.userSelect="none",typeof e.webkitUserSelect<"u"&&(e.webkitUserSelect="none")},os=()=>{if($n=Math.max(0,$n-1),$n>0||!hn)return;let e=document.body.style;e.userSelect=hn.userSelect,typeof hn.webkitUserSelect<"u"&&(e.webkitUserSelect=hn.webkitUserSelect),hn=null},gn=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},na=(e,t)=>{let n=new Set;return e.reduce((a,o)=>{let i=typeof o.value=="string"?o.value.trim():"";if(!i)return a;let{normalized:r,key:u,entry:d}=t(i,o);return r&&!n.has(u)&&(n.add(u),a.push(d(r))),a},[])},ra=({value:e,ariaLabel:t})=>{let[n,a]=(0,be.useState)(!1),o=(0,be.useRef)(null),i=(0,be.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 c=document.createElement("textarea");c.value=d,c.setAttribute("readonly",""),c.style.position="absolute",c.style.left="-9999px",document.body.appendChild(c),c.select(),c.setSelectionRange(0,c.value.length);let f=document.execCommand("copy");return document.body.removeChild(c),f},[]),r=(0,be.useCallback)(async d=>{d.preventDefault(),d.stopPropagation(),o.current!==null&&typeof window<"u"&&(window.clearTimeout(o.current),o.current=null);let c=await i(e);a(c),c&&typeof window<"u"&&(o.current=window.setTimeout(()=>{a(!1),o.current=null},1500))},[i,e]);(0,be.useEffect)(()=>()=>{o.current!==null&&typeof window<"u"&&(window.clearTimeout(o.current),o.current=null)},[]);let u=n?Xa.default:Qa.default;return(0,Y.jsx)("button",{type:"button",className:`inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md border ${q.borderControl} ${s.fgMuted} transition-colors ${w.hoverMuted} ${dt}`,onClick:r,"aria-label":t,title:t,children:(0,Y.jsx)(u,{className:"h-3.5 w-3.5","aria-hidden":"true"})})},On=({contactData:e,openEmailsWithGmail:t,openGmailCompose:n,onRequestClose:a})=>{let o=ne(),i=(0,be.useRef)(null),r=(0,be.useMemo)(()=>e.contacted_at?st(e.contacted_at,o.recordDate):null,[e.contacted_at,o.recordDate]),u=gn(e.full_name)??o.noName,d=gn(e.company_name),c=gn(e.department),f=gn(e.title),p=(0,be.useMemo)(()=>na([{fieldKey:"company_name",label:o.fieldCompanyName,value:d},{fieldKey:"department",label:o.fieldDepartment,value:c},{fieldKey:"title",label:o.fieldTitle,value:f}],(x,{fieldKey:P,label:K})=>({normalized:x,key:`${P}-${x.toLowerCase()}`,entry:S=>({fieldKey:P,label:K,value:S})})),[d,c,f,o]),l=(0,be.useMemo)(()=>na([{fieldKey:"custom_mobile_phone_number",label:o.popupCustomMobilePhone,value:e.custom_mobile_phone_number},{fieldKey:"mobile_phone_number",label:o.popupMobilePhone,value:e.mobile_phone_number},{fieldKey:"custom_company_phone_number",label:o.popupCustomCompanyPhone,value:e.custom_company_phone_number},{fieldKey:"company_phone_number",label:o.popupCompanyPhone,value:e.company_phone_number}],(x,{fieldKey:P,label:K})=>{let S=Pn(x);return{normalized:gn(x),key:(S??x).toLowerCase(),entry:ce=>({fieldKey:P,label:K,value:ce,href:S})}}),[e.custom_mobile_phone_number,e.mobile_phone_number,e.custom_company_phone_number,e.company_phone_number,o]),g=(0,be.useMemo)(()=>na([{fieldKey:"custom_email",label:o.popupCustomEmail,value:e.custom_email},{fieldKey:"email",label:o.popupEmail,value:e.email}],(x,{fieldKey:P,label:K})=>{let S=gn(x),R=bt(x,t),ce=!!R?.startsWith("https://mail.google.com");return{normalized:S,key:x.toLowerCase(),entry:j=>({fieldKey:P,label:K,value:j,href:R,isGmailLink:ce})}}),[e.custom_email,e.email,t,o]),b=l.length>0||g.length>0,T=(0,be.useId)(),E=(0,be.useCallback)(()=>{a(),i.current=null},[a]),L=(0,be.useCallback)(x=>x.ownerDocument.getElementById(T),[T]),{dialogProps:Q,backdropProps:X}=(0,Ya.useOverlayDialog)({isOpen:!0,onClose:E,isCloseBlocked:mr,initialFocus:L}),y=(0,be.useCallback)((x,P)=>{P.isGmailLink&&(x.preventDefault(),n(P.value))},[n]),h=(0,be.useCallback)((x,P)=>{if(!P.isGmailLink){i.current=null;return}let K=Date.now(),S=i.current;if(S&&S.email===P.value&&K-S.timestamp<=es){i.current=null,x.preventDefault(),n(P.value);return}i.current={email:P.value,timestamp:K}},[n]);return(0,be.useEffect)(()=>(as(),os),[]),(0,Za.createPortal)((0,Y.jsxs)("dialog",{...Q,...ts,"data-contact-popup-root":"true","aria-labelledby":T,className:ns,style:dr,children:[(0,Y.jsx)("div",{...X,"data-contact-popup-backdrop":"",className:ur}),(0,Y.jsxs)("div",{"data-contact-popup-card":"",className:rs,children:[(0,Y.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,Y.jsx)("h2",{id:T,tabIndex:-1,className:`wrap-break-word min-w-0 font-semibold ${s.fg} text-lg outline-none`,children:u}),(0,Y.jsx)("button",{type:"button",className:`inline-flex shrink-0 items-center justify-center rounded-md p-3.5 ${s.fgMuted} transition-colors ${w.hoverMuted} ${dt}`,onClick:E,"aria-label":o.close,children:(0,Y.jsx)(Ja.default,{className:"h-4 w-4","aria-hidden":"true"})})]}),p.length>0?(0,Y.jsx)("div",{className:`mt-2 space-y-2 ${s.fgSecondary} text-sm`,children:p.map(x=>(0,Y.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Y.jsx)("p",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:x.value}),(0,Y.jsx)(ra,{value:x.value,ariaLabel:o.copyField(x.label)})]},x.fieldKey))}):null,(0,Y.jsxs)("div",{className:`mt-4 space-y-4 ${s.fgSecondary}`,children:[l.length>0?(0,Y.jsx)("div",{children:(0,Y.jsx)("ul",{className:"space-y-3 text-sm",children:l.map(x=>(0,Y.jsx)("li",{className:"flex items-start gap-3",children:(0,Y.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,Y.jsx)("span",{className:`${s.fgMuted} text-xs`,children:x.label}),(0,Y.jsxs)("div",{className:"mt-1 flex items-center gap-3",children:[(0,Y.jsx)("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:x.href?(0,Y.jsx)("a",{href:x.href,className:`wrap-break-word ${m.blue} ${pn}`,children:x.value}):(0,Y.jsx)("span",{className:`wrap-break-word ${s.fg}`,children:x.value})}),(0,Y.jsx)(ra,{value:x.value,ariaLabel:o.copyField(x.label)})]})]})},`${x.fieldKey}-${x.value}`))})}):null,g.length>0?(0,Y.jsx)("div",{children:(0,Y.jsx)("ul",{className:"space-y-3 text-sm",children:g.map(x=>(0,Y.jsx)("li",{className:"flex items-start gap-3",children:(0,Y.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,Y.jsx)("span",{className:`${s.fgMuted} text-xs`,children:x.label}),(0,Y.jsxs)("div",{className:"mt-1 flex items-start gap-3",children:[(0,Y.jsxs)("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:[x.href?(0,Y.jsx)("a",{href:x.href,className:`wrap-break-word ${m.blue} ${pn}`,target:x.isGmailLink?"_blank":void 0,rel:x.isGmailLink?"noopener noreferrer":void 0,onDoubleClick:P=>y(P,x),onTouchEnd:P=>h(P,x),children:x.value}):(0,Y.jsx)("span",{className:`wrap-break-word ${s.fg}`,children:x.value}),x.isGmailLink?(0,Y.jsx)("span",{className:`mt-1 block ${_} ${s.fgMuted}`,children:o.popupGmailHint}):null]}),(0,Y.jsx)(ra,{value:x.value,ariaLabel:o.copyField(x.label)})]})]})},`${x.fieldKey}-${x.value}`))})}):null,r?(0,Y.jsxs)("div",{className:`mt-2 flex items-center gap-2 ${s.fgMuted} text-sm`,children:[(0,Y.jsx)("span",{className:"text-xs",children:o.popupLastContactDate}),(0,Y.jsx)("span",{children:r})]}):null,b?null:(0,Y.jsx)("p",{className:`${s.fgMuted} text-sm`,children:o.popupNoContactMethods})]})]})]}),document.body)}});var xe,Dn,oa=Re(()=>{"use strict";pe();Pe();xe=require("react/jsx-runtime"),Dn=({fullName:e,title:t="-",companyName:n="-",department:a="-",phoneNumber:o="-",email:i="-",updatedAtText:r="-"})=>(0,xe.jsxs)("div",{className:`flex h-full w-full flex-col justify-center gap-0.5 ${s.fg} 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]`,children:[(0,xe.jsxs)("div",{className:"flex items-center gap-1 sm:hidden",children:[(0,xe.jsx)("div",{className:`flex-1 truncate font-medium ${s.fg} text-sm leading-tight`,children:e}),(0,xe.jsx)("div",{className:`shrink-0 whitespace-nowrap ${$t} ${s.fgMuted}`,children:o})]}),(0,xe.jsx)("div",{className:"flex items-center gap-1 sm:hidden",children:(0,xe.jsx)("div",{className:`flex-1 truncate ${s.fgSecondary} text-xs leading-tight`,children:n})}),(0,xe.jsx)("div",{className:"block sm:hidden",children:(0,xe.jsx)("span",{className:`w-full truncate text-left ${$t} ${s.fgSecondary} leading-tight`,children:a})}),(0,xe.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,xe.jsx)("span",{className:`truncate font-medium ${s.fg}`,children:e}),(0,xe.jsx)("span",{className:`truncate ${s.fgMuted} text-xs`,children:t})]}),(0,xe.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,xe.jsx)("span",{className:`truncate ${s.fg}`,children:n}),(0,xe.jsx)("span",{className:`truncate ${s.fgMuted} text-xs`,children:a})]}),(0,xe.jsxs)("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[(0,xe.jsx)("span",{className:`truncate ${s.fgSecondary}`,children:o}),(0,xe.jsx)("span",{className:`truncate ${s.fgMuted} text-xs`,children:i})]}),(0,xe.jsx)("div",{className:`hidden items-end justify-end ${$t} ${s.fgMuted} xl:flex`,children:(0,xe.jsx)("span",{className:"truncate",children:r})})]})});var pr,yn,no,is,ss,ls,cs,ro,ao,ds,us,ms,ps,fs,gs,hs,ys,oo,io,eo,to,fr,bs,Ss,ia,so,sa=Re(()=>{"use strict";pr=require("@aiquants/fuzzy-search"),yn=require("@aiquants/select-box"),no=/[]/g,is=/^[\s ]+|[\s ]+$/g,ss=/\s+/,ls=/^[\p{Script=Latin}\s]+$/u,cs=/\p{Script=Latin}/u,ro=Object.freeze({convertWidth:!0,convertKana:!0,convertCase:!0,convertRomaji:!1,normalizeVariants:!1,ignoreSpaces:!1,ignoreSymbols:!1,ignoreLongVowels:!1}),ao="union",ds=65377,us=65439,ms=["\uFF9E","\uFF9F"],ps=(()=>{let e=new Map;for(let t=ds;t<=us;t+=1){let n=String.fromCharCode(t);e.set(n.normalize("NFKC"),n);for(let a of ms){let o=(n+a).normalize("NFKC");o.length===1&&e.set(o,n+a)}}return e})(),fs=/[-ヿ]/u,gs=e=>{let t=Array.from(e,n=>ps.get(n)??n).join("");return fs.test(t)?null:t},hs=e=>(0,yn.normalizeText)(e.replace(no,"").replace(is,""),ro),ys=e=>{if(!ls.test(e))return null;let t=(0,yn.romajiToKatakana)(e);return cs.test(t)?null:t},oo=e=>e.split(ss).filter(Boolean),io=e=>(0,pr.parseQuerySets)(e,ao).sets.map(({query:t})=>t),eo=e=>io(e).flatMap(t=>oo(t)),to=e=>(0,pr.formatQuerySets)({combine:ao,sets:Array.from(new Set(e),t=>({query:t}))}),fr=e=>{let t=io(e.replace(no,"")).map(a=>oo(hs(a)).join(" ")).filter(a=>a!==""),n=[];for(let a of t){let o=ys(a);if(o===null)return to(t);n.push(o)}return to(n)},bs=e=>{let t=new Set([...eo(e),...eo(fr(e))]),n=new Set;for(let a of t)for(let o of(0,yn.getNormalizedVariants)(a,ro)){let i=o.trim();if(!i)continue;n.add(i);let r=gs(i);r!==null&&n.add(r)}return Array.from(n)},Ss=/[.*+?^${}()|[\]\\]/g,ia=e=>{let t=bs(e);if(t.length===0)return null;let n=t.map(a=>a.replace(Ss,"\\$&")).sort((a,o)=>o.length-a.length);return new RegExp(n.join("|"),"gi")},so=(e,t)=>{let n=ia(e);if(n===null)return o=>o;let a=o=>t.some(i=>{let r=o[i];return typeof r=="string"&&r.search(n)!==-1});return o=>{let i=[],r=[];for(let u of o)a(u.item)?i.push(u):r.push(u);return[...i,...r]}}});var lo,Ct,Cs,Le,gr=Re(()=>{"use strict";lo=require("react");sa();pe();Ct=require("react/jsx-runtime"),Cs=`rounded ${At.mark} px-1 ${s.fg}`,Le=(0,lo.memo)(({text:e,query:t,enabled:n=!0})=>{if(!(n&&t?.trim()&&e))return(0,Ct.jsx)(Ct.Fragment,{children:e});let a=ia(t);if(a===null)return(0,Ct.jsx)(Ct.Fragment,{children:e});let o=[],i=0,r=a.exec(e),u=0;for(;r;){let d=r[0],c=r.index;if(c>i&&o.push(e.substring(i,c)),d.length===0){a.lastIndex++,r=a.exec(e);continue}o.push((0,Ct.jsx)("mark",{className:Cs,children:d},`highlight-${c}-${u}`)),i=c+d.length,u+=1,r=a.exec(e)}return i<e.length&&o.push(e.substring(i)),(0,Ct.jsx)(Ct.Fragment,{children:o})});Le.displayName="HighlightedText"});var co={};_a(co,{ContactDetailGrid:()=>la,default:()=>vs});var yr,Dt,hr,la,vs,uo=Re(()=>{"use strict";yr=require("react");Vt();he();aa();oa();gr();Dt=require("react/jsx-runtime"),hr=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},la=({contactData:e,searchTerm:t,enableHighlighting:n,openEmailsWithGmail:a,openGmailCompose:o,isPopupVisible:i,onRequestClose:r})=>{let u=ne(),d=(0,yr.useMemo)(()=>ln(e),[e]),c=(0,yr.useMemo)(()=>cn(e),[e]),f=d.value??"-",p=c.value??"-",l=(0,yr.useMemo)(()=>st(e.updated_at,u.recordDateTime),[e.updated_at,u.recordDateTime]),g=hr(e.full_name)??u.noName,b=hr(e.company_name),T=hr(e.department),E=(L,Q="-")=>(0,Dt.jsx)(Le,{text:L??Q,query:t,enabled:n});return(0,Dt.jsxs)(Dt.Fragment,{children:[(0,Dt.jsx)(Dn,{fullName:E(g),title:E(hr(e.title)),companyName:E(b),department:E(T),phoneNumber:p,email:E(f),updatedAtText:l}),i?(0,Dt.jsx)(On,{contactData:e,openEmailsWithGmail:a,openGmailCompose:o,onRequestClose:r}):null]})},vs=la});var zl={};_a(zl,{AdvancedSearchSettings:()=>sr,BasicSearchSettings:()=>lr,CONTACT_MAP_LABEL_CATALOGS:()=>lt,CONTACT_MAP_LABEL_KEYS:()=>mn,ContactDetailGrid:()=>la,ContactDetailPanel:()=>Yt,ContactDetailPopup:()=>On,ContactDetailRowLayout:()=>Dn,ContactMapAnnotation:()=>Cr,ContactMapAppView:()=>Il,ContactMapConfigProvider:()=>Ao,ContactMapSearchListView:()=>ya,ContactMapSearchPage:()=>wa,ContactMapSearchTabGroup:()=>Ma,ContactMapSearchTreeView:()=>Na,ContactMapStreamAnnouncer:()=>Br,ContactMapStreamClient:()=>Hn,ContactMapStreamFailureNotice:()=>zr,HighlightedText:()=>Le,IndexWorkerSettings:()=>Pr,LIST_COLLAPSE_THRESHOLD:()=>Xs,LIST_DETAIL_PANEL_MIN_WIDTH:()=>Yo,LIST_EXPAND_THRESHOLD:()=>Qs,LIST_PANEL_MIN_WIDTH:()=>qo,LIST_RESIZE_HANDLE_THICKNESS:()=>Xo,LevenshteinWorkerSettings:()=>_r,Progress:()=>pa,SearchOptionsPanel:()=>Ar,StatItem:()=>D,StatisticsPanel:()=>Dr,SwipeOverlay:()=>Kn,TREE_COLLAPSE_THRESHOLD:()=>dl,TREE_DETAIL_PANEL_MIN_WIDTH:()=>hi,TREE_EXPAND_THRESHOLD:()=>ul,TREE_PANEL_MIN_WIDTH:()=>gi,TREE_RESIZE_HANDLE_THICKNESS:()=>yi,Tabs:()=>Wn,TabsContent:()=>Ht,TabsList:()=>bn,TabsTrigger:()=>Wt,TreeWorkerSession:()=>jn,WorkerStatsSection:()=>en,assertContactMapStreamEndpoint:()=>Fn,assertContactMapTreeWorkerUrl:()=>da,assertContactMapWorkerUrls:()=>Es,composeTreeVirtualScrollOptions:()=>bi,contactMapShouldRevalidate:()=>Bl,countContactMapCompanies:()=>Ho,deserializeStreamRecord:()=>Oo,getContactMapStreamClient:()=>Do,getTreeWorkerSession:()=>ai,layerContactMapWorkerUrls:()=>Xt,resetContactMapStreamClientForTesting:()=>As,resetTreeWorkerSessionForTesting:()=>ll,resolveContactMapLabels:()=>ir,useAnimatedNumber:()=>Sa,useContactMapConfig:()=>mt,useContactMapLabels:()=>ne,useContactMapStream:()=>Wo,useContactPanelSizing:()=>Lr,useDynamicViewportHeight:()=>fa,useHorizontalDragScroll:()=>vt,useLongPressPopup:()=>Un,useReportPopupVisibility:()=>Jo,useResponsiveTwoColumnLayout:()=>Vn,useRowPopupRegistry:()=>Qo,useStreamedContactMapContext:()=>In,useTreeWorker:()=>Ca});module.exports=Ui(zl);var qt=require("@aiquants/fuzzy-search"),_n=require("react");he();pe();Pe();var ve=require("react/jsx-runtime"),sr=(0,_n.memo)(({searchOptions:e,setSearchOptions:t})=>{let n=ne(),a=`flex flex-col gap-1 rounded-md border ${k.surface} px-2 py-1 shadow-sm transition-colors`,o="text-xs font-semibold",i=(0,_n.useId)(),r=(0,_n.useId)(),u=[];return u.push((0,ve.jsxs)("div",{className:`${a} ${F.sky} border-l-4`,children:[(0,ve.jsxs)("div",{className:`${o} ${m.sky}`,children:["\u{1F4D8} ",n.advancedLearningHeading]}),(0,ve.jsx)("label",{htmlFor:i,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.advancedLearningLabel}),(0,ve.jsx)("input",{id:i,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.learningWeight||qt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight,onChange:d=>t(c=>({...c,learningWeight:parseFloat(d.target.value)})),className:"h-11 w-full"}),(0,ve.jsxs)("span",{className:`${m.sky} text-xs`,children:[n.currentValueLabel," ",e.learningWeight||qt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight]}),(0,ve.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.advancedLearningHint})]},"learning")),u.push((0,ve.jsxs)("div",{className:`${a} ${F.indigo} border-l-4`,children:[(0,ve.jsxs)("div",{className:`${o} ${m.indigo}`,children:["\u23F1\uFE0F ",n.advancedDebounceHeading]}),(0,ve.jsx)("label",{htmlFor:r,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.advancedDebounceLabel}),(0,ve.jsx)("input",{id:r,type:"range",min:"100",max:"1000",step:"50",value:e.debounceMs??qt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs,onChange:d=>t(c=>({...c,debounceMs:parseInt(d.target.value,10)})),className:"h-11 w-full"}),(0,ve.jsxs)("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.debounceMs??qt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs]}),(0,ve.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.advancedDebounceHint})]},"debounce")),(0,ve.jsxs)("section",{className:"space-y-3",children:[(0,ve.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,ve.jsxs)("div",{className:`flex items-center gap-2 font-semibold ${s.fgSecondary} text-xs transition-colors`,children:[(0,ve.jsx)("span",{children:"\u26A1"}),(0,ve.jsx)("span",{className:"tracking-wide",children:n.settingsAdvancedTab})]}),(0,ve.jsx)("button",{type:"button",onClick:()=>t(d=>({...d,learningWeight:qt.DEFAULT_FUZZY_SEARCH_OPTIONS.learningWeight,debounceMs:qt.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${q.borderControl} ${k.muted} px-2 font-medium ${s.fgSecondary} ${N} transition-colors ${w.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),(0,ve.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:u})]})});sr.displayName="AdvancedSearchSettings";var Ot=require("@aiquants/fuzzy-search"),ze=require("react");he();pe();Pe();var $=require("react/jsx-runtime"),lr=(0,ze.memo)(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:o,setOpenEmailsWithGmail:i})=>{let r=ne(),u=`flex flex-col gap-1 rounded-md border ${k.surface} px-2 py-1 shadow-sm transition-colors`,d="text-xs font-semibold",c=(0,ze.useId)(),f=(0,ze.useId)(),p=(0,ze.useId)(),l=(0,ze.useId)(),g=(0,ze.useId)(),b=(0,ze.useId)(),T=(0,ze.useId)(),E=(0,ze.useId)(),L=(0,ze.useId)(),Q=(0,ze.useId)(),X=[];return X.push((0,$.jsxs)("div",{className:`${u} ${F.blue} border-l-4`,children:[(0,$.jsxs)("div",{className:`${d} ${m.blue}`,children:["\u{1F3AF} ",r.basicThresholdHeading]}),(0,$.jsx)("label",{htmlFor:c,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:r.basicThresholdLabel}),(0,$.jsx)("input",{id:c,type:"range",min:"0.0",max:e.sortBy==="relevance"?"1.5":"1.0",step:"0.05",value:e.threshold??Ot.DEFAULT_FUZZY_SEARCH_OPTIONS.threshold,onChange:y=>t(h=>({...h,threshold:parseFloat(y.target.value)})),className:"h-11 w-full"}),(0,$.jsxs)("span",{className:`${m.blue} text-xs`,children:[r.currentValueLabel," ",e.threshold??Ot.DEFAULT_FUZZY_SEARCH_OPTIONS.threshold]}),(0,$.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:e.sortBy==="relevance"?r.basicThresholdRangeRelevance:r.basicThresholdRange})]},"threshold")),X.push((0,$.jsxs)("div",{className:`${u} ${F.amber} border-l-4`,children:[(0,$.jsxs)("div",{className:`${d} ${m.amber}`,children:["\u{1FA84} ",r.basicDisplayHeading]}),(0,$.jsxs)("label",{htmlFor:f,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${N} transition-colors`,children:[(0,$.jsx)("input",{id:f,type:"checkbox",checked:e.caseSensitive??Ot.DEFAULT_FUZZY_SEARCH_OPTIONS.caseSensitive,onChange:y=>t(h=>({...h,caseSensitive:y.target.checked})),className:"h-3 w-3"}),r.basicCaseSensitive]}),(0,$.jsxs)("label",{htmlFor:p,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${N} transition-colors`,children:[(0,$.jsx)("input",{id:p,type:"checkbox",checked:n,onChange:y=>a(y.target.checked),className:"h-3 w-3"}),r.basicHighlight]}),(0,$.jsxs)("label",{htmlFor:l,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${N} transition-colors`,children:[(0,$.jsx)("input",{id:l,type:"checkbox",checked:o,onChange:y=>i(y.target.checked),className:"h-3 w-3"}),r.basicOpenEmailsWithGmail]}),(0,$.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,$.jsx)("label",{htmlFor:g,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:r.basicMultiTermOperator}),(0,$.jsxs)("select",{id:g,value:e.multiTermOperator??Ot.DEFAULT_FUZZY_SEARCH_OPTIONS.multiTermOperator,onChange:y=>t(h=>({...h,multiTermOperator:y.target.value})),className:`min-h-11 rounded border ${q.borderControl} px-2 pointer-coarse:text-base ${N} transition-colors ${k.surface} ${s.fg}`,children:[(0,$.jsx)("option",{value:"or",children:r.basicOperatorOr}),(0,$.jsx)("option",{value:"and",children:r.basicOperatorAnd})]}),(0,$.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:r.basicMultiTermHint})]})]},"display")),X.push((0,$.jsxs)("div",{className:`${u} ${F.emerald} border-l-4`,children:[(0,$.jsxs)("div",{className:`${d} ${m.emerald}`,children:["\u{1F4DA} ",r.basicSortHeading]}),(0,$.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,$.jsx)("label",{htmlFor:b,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:r.basicSortBy}),(0,$.jsxs)("select",{id:b,value:e.sortBy||Ot.DEFAULT_FUZZY_SEARCH_OPTIONS.sortBy,onChange:y=>t(h=>({...h,sortBy:y.target.value})),className:`min-h-11 rounded border ${q.borderControl} px-2 pointer-coarse:text-base ${N} transition-colors ${k.surface} ${s.fg}`,children:[(0,$.jsx)("option",{value:"score",children:r.basicSortByScore}),(0,$.jsx)("option",{value:"relevance",children:r.basicSortByRelevance}),(0,$.jsx)("option",{value:"original",children:r.basicSortByOriginal})]})]}),(0,$.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,$.jsx)("label",{htmlFor:T,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:r.basicSortOrder}),(0,$.jsxs)("select",{id:T,value:e.sortOrder||Ot.DEFAULT_FUZZY_SEARCH_OPTIONS.sortOrder,onChange:y=>t(h=>({...h,sortOrder:y.target.value})),className:`min-h-11 rounded border ${q.borderControl} px-2 pointer-coarse:text-base ${N} transition-colors ${k.surface} ${s.fg}`,children:[(0,$.jsx)("option",{value:"desc",children:r.basicSortDescending}),(0,$.jsx)("option",{value:"asc",children:r.basicSortAscending})]})]})]},"sorting")),X.push((0,$.jsxs)("div",{className:`${u} ${F.purple} border-l-4`,children:[(0,$.jsxs)("div",{className:`${d} ${m.purple}`,children:["\u2699\uFE0F ",r.basicEngineHeading]}),(0,$.jsx)("label",{htmlFor:E,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:r.basicStrategy}),(0,$.jsxs)("select",{id:E,value:e.parallelSearchStrategy||Ot.DEFAULT_FUZZY_SEARCH_OPTIONS.parallelSearchStrategy,onChange:y=>t(h=>({...h,parallelSearchStrategy:y.target.value})),className:`min-h-11 rounded border ${q.borderControl} px-2 pointer-coarse:text-base ${N} transition-colors ${k.surface} ${s.fg}`,children:[(0,$.jsx)("option",{value:"balanced",children:r.basicStrategyBalanced}),(0,$.jsx)("option",{value:"index-first",children:r.basicStrategyIndexFirst}),(0,$.jsx)("option",{value:"levenshtein-first",children:r.basicStrategyLevenshteinFirst})]}),(0,$.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,$.jsxs)("label",{htmlFor:L,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${N} transition-colors`,children:[(0,$.jsx)("input",{id:L,type:"checkbox",checked:e.enableIndexFiltering!==!1,onChange:y=>t(h=>({...h,enableIndexFiltering:y.target.checked})),className:"h-3 w-3"}),r.basicIndexFiltering]}),(0,$.jsxs)("label",{htmlFor:Q,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${N} transition-colors`,children:[(0,$.jsx)("input",{id:Q,type:"checkbox",checked:e.enableLevenshtein!==!1,onChange:y=>t(h=>({...h,enableLevenshtein:y.target.checked})),className:"h-3 w-3"}),r.basicLevenshtein]})]})]},"engine")),(0,$.jsxs)("section",{className:"space-y-3",children:[(0,$.jsxs)("div",{className:`flex items-center gap-2 font-semibold ${m.blue} text-xs transition-colors`,children:[(0,$.jsx)("span",{children:"\u{1F527}"}),(0,$.jsx)("span",{className:"tracking-wide",children:r.settingsBasicTab})]}),(0,$.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:X})]})});lr.displayName="BasicSearchSettings";var go=require("@aiquants/swipe-overlay"),ho=Ce(require("lucide-react/dist/esm/icons/badge-check.js")),yo=Ce(require("lucide-react/dist/esm/icons/building-2.js")),bo=Ce(require("lucide-react/dist/esm/icons/calendar-clock.js")),So=Ce(require("lucide-react/dist/esm/icons/check.js")),Co=Ce(require("lucide-react/dist/esm/icons/copy.js")),vo=Ce(require("lucide-react/dist/esm/icons/id-card.js")),xo=Ce(require("lucide-react/dist/esm/icons/mail.js")),To=Ce(require("lucide-react/dist/esm/icons/phone.js")),No=Ce(require("lucide-react/dist/esm/icons/user-round.js")),Ve=require("react");Vt();var ut={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)};he();pe();var nt=Ce(require("@radix-ui/react-tabs")),br=Ce(require("react"));pe();An();var Sr=require("react/jsx-runtime"),Wn=nt.Root,bn=br.forwardRef(({className:e,...t},n)=>(0,Sr.jsx)(nt.List,{ref:n,className:Oe(`inline-flex h-10 items-center justify-center rounded-md ${k.muted} p-1 ${s.fgMuted}`,e),...t}));bn.displayName=nt.List.displayName;var Wt=br.forwardRef(({className:e,...t},n)=>(0,Sr.jsx)(nt.Trigger,{ref:n,className:Oe(`inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm ${w.ringOffsetSurface} transition-all focus-visible:outline-hidden focus-visible:ring-2 ${w.focusVisibleRing} focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 ${w.activeTabSurface} ${w.activeTabFg} data-[state=active]:shadow-2xs`,e),...t}));Wt.displayName=nt.Trigger.displayName;var Ht=br.forwardRef(({className:e,...t},n)=>(0,Sr.jsx)(nt.Content,{ref:n,className:Oe(`mt-2 ${w.ringOffsetSurface} focus-visible:outline-hidden focus-visible:ring-2 ${w.focusVisibleRing} focus-visible:ring-offset-2 data-[state=inactive]:hidden`,e),...t}));Ht.displayName=nt.Content.displayName;fn();Pe();gr();var M=require("react/jsx-runtime"),mo=`truncate font-semibold ${s.fg} ${N}`,po={height:"var(--contact-panel-height, 100%)",maxHeight:"100%"},xs=({icon:e,label:t,value:n,fieldKey:a,copyValue:o,onCopy:i,isCopied:r,linkHref:u,searchTerm:d,enableHighlighting:c})=>{let f=ne(),p=!!(i&&a&&o),l=u?.startsWith("https://mail.google.com")?"_blank":void 0;return(0,M.jsxs)("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${q.borderSubtle} ${k.subtle} px-2.5 py-1.5 transition-colors`,children:[(0,M.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,M.jsx)("div",{className:`flex h-7 w-7 items-center justify-center rounded-full ${k.surface} ${s.fgMuted} transition-colors`,children:(0,M.jsx)(e,{size:14})}),(0,M.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,M.jsx)("div",{className:`font-medium ${_} ${s.fgMuted}`,children:t}),u?(0,M.jsx)("a",{href:u,className:`align-top ${mo} ${pn}`,target:l,rel:l?"noopener noreferrer":void 0,children:(0,M.jsx)(Le,{text:n,query:d??"",enabled:c})}):(0,M.jsx)("div",{className:mo,children:(0,M.jsx)(Le,{text:n,query:d??"",enabled:c})})]})]}),p?(0,M.jsx)("button",{type:"button",onClick:()=>i&&a&&o&&i(a,o,t),className:`inline-flex h-11 w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border ${q.borderControl} ${k.surface} ${s.fgMuted} transition-colors ${w.hoverBlueAccentBorder} ${w.hoverBlueFg} ${dt}`,"aria-label":f.copyField(t),children:r?(0,M.jsx)(So.default,{size:14}):(0,M.jsx)(Co.default,{size:14})}):null]})},fo=({items:e,searchTerm:t,enableHighlighting:n})=>(0,M.jsx)("dl",{className:"grid grid-cols-1 gap-x-3 gap-y-1.5 sm:grid-cols-2",children:e.map(a=>(0,M.jsxs)("div",{className:`flex flex-col gap-0.5 rounded-md border ${q.borderSubtle} ${k.surface} px-2 py-1 transition-colors`,children:[(0,M.jsx)("dt",{className:`font-semibold ${_} ${s.fgMuted} uppercase tracking-wide`,children:a.label}),(0,M.jsx)("dd",{className:`wrap-break-word ${s.fg} text-xs`,children:(0,M.jsx)(Le,{text:a.value,query:t??"",enabled:n})})]},a.fieldKey))}),ca=({title:e})=>(0,M.jsx)("h3",{className:`font-semibold ${s.fgSecondary} text-xs`,children:e}),Ts=()=>{let e=ne();return(0,M.jsxs)("div",{className:`flex h-full min-h-40 w-full flex-1 flex-col items-center justify-center gap-2 rounded-xl border ${q.borderSubtle} border-dashed ${k.surface} p-4 text-center transition-colors`,children:[(0,M.jsx)("p",{className:`font-medium ${s.fgMuted} text-xs`,children:e.detailEmptyTitle}),(0,M.jsx)("p",{className:`${_} ${s.fgMuted}`,children:e.detailEmptyHint})]})},Ns=Object.freeze({overlay:go.SWIPE_OVERLAY_SCROLL_AREA_STYLE,pane:void 0}),Yt=({contact:e,placement:t,searchTerm:n,enableHighlighting:a,style:o,className:i=""})=>{let r=ne(),[u,d]=(0,Ve.useState)(null),c=(0,Ve.useRef)(null),f=(0,Ve.useMemo)(()=>({...po,...o}),[o]);(0,Ve.useEffect)(()=>()=>{c.current!==null&&window.clearTimeout(c.current)},[]);let p=(0,Ve.useMemo)(()=>ln(e),[e]),l=(0,Ve.useMemo)(()=>cn(e),[e]),g=(0,Ve.useMemo)(()=>st(e?.contacted_at,r.recordDateTime),[e?.contacted_at,r.recordDateTime]),b=(0,Ve.useCallback)(async(S,R,ce)=>{try{await navigator.clipboard.writeText(R),d(S),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{d(null)},2e3)}catch(j){ut.error("Failed to copy contact detail",j)}},[]);if(!e)return(0,M.jsx)("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border ${q.borderSubtle} ${k.surface} shadow-sm transition-colors`,style:po,children:(0,M.jsx)(Ts,{})});let T=[le(e.title),le(e.department)].filter(S=>S!=="-"),E=[T.join(" / "),le(e.company_name)].filter(S=>S&&S!=="-").join(" \u30FB ")||"-",L=et(e.full_name)??r.noName,Q=[{fieldKey:"full_name",label:r.fieldFullName,value:L},{fieldKey:"full_name_reading",label:r.fieldFullNameReading,value:le(e.full_name_reading)},{fieldKey:"title",label:r.fieldTitle,value:le(e.title)},{fieldKey:"department",label:r.fieldDepartment,value:le(e.department)},{fieldKey:"company_name",label:r.fieldCompanyName,value:le(e.company_name)},{fieldKey:"company_name_reading",label:r.fieldCompanyNameReading,value:le(e.company_name_reading)},{fieldKey:"address",label:r.fieldAddress,value:le(e.address)},{fieldKey:"postal_code",label:r.fieldPostalCode,value:le(e.postal_code)},{fieldKey:"url",label:r.fieldUrl,value:le(e.url)}],X=[{label:r.fieldCustomEmail,value:le(e.custom_email),fieldKey:"custom_email",rawValue:e.custom_email},{label:r.fieldEmail,value:le(e.email),fieldKey:"email",rawValue:e.email}].filter(S=>S.value!=="-"),y=[{label:r.fieldCustomMobilePhone,value:le(e.custom_mobile_phone_number),fieldKey:"custom_mobile_phone_number",rawValue:e.custom_mobile_phone_number},{label:r.fieldMobilePhone,value:le(e.mobile_phone_number),fieldKey:"mobile_phone_number",rawValue:e.mobile_phone_number},{label:r.fieldCompanyPhone,value:le(e.company_phone_number),fieldKey:"company_phone_number",rawValue:e.company_phone_number},{label:r.fieldCompanyFax,value:le(e.company_fax_number),fieldKey:"company_fax_number",rawValue:e.company_fax_number}].filter(S=>S.value!=="-"),h=[{fieldKey:"person_id",label:"person_id",value:le(e.person_id)},{fieldKey:"person_id_redirect_to",label:"person_id_redirect_to",value:le(e.person_id_redirect_to)},{fieldKey:"is_active",label:"is_active",value:le(e.is_active)},{fieldKey:"is_contact_synced",label:"is_contact_synced",value:le(e.is_contact_synced)},{fieldKey:"is_incomplete",label:"is_incomplete",value:le(e.is_incomplete)},{fieldKey:"is_in_eight",label:"is_in_eight",value:le(e.is_in_eight)},{fieldKey:"created_by",label:r.fieldCreatedBy,value:le(e.created_by)},{fieldKey:"created_at",label:r.fieldCreatedAt,value:st(e.created_at,r.recordDateTime)},{fieldKey:"updated_by",label:r.fieldUpdatedBy,value:le(e.updated_by)},{fieldKey:"updated_at",label:r.fieldUpdatedAt,value:st(e.updated_at,r.recordDateTime)}],x=[{rowKey:"person_id",icon:vo.default,label:"person_id",value:le(e.person_id),fieldKey:"person_id",copyValue:String(e.person_id)},{rowKey:"primary_email",icon:xo.default,label:r.summaryEmail,value:p.value??"-",fieldKey:"primary_email",copyValue:p.value,linkHref:bt(p.value,!1)},{rowKey:"primary_phone",icon:To.default,label:r.summaryPhone,value:l.value??"-",fieldKey:"primary_phone",copyValue:l.value,linkHref:Pn(l.value)},{rowKey:"contacted_at",icon:bo.default,label:r.summaryLastContact,value:g}],P=[{sectionKey:"email",title:r.sectionEmail,emptyText:r.sectionEmailEmpty,entries:X,recommendedKey:p.fieldKey??null,resolveHref:S=>bt(S!=null?String(S):null,!1)},{sectionKey:"phone",title:r.sectionPhone,emptyText:r.sectionPhoneEmpty,entries:y,recommendedKey:l.fieldKey??null,resolveHref:S=>Pn(S!=null?String(S):null)}],K=[{value:"summary",label:r.detailTabSummary,content:(0,M.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,M.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,M.jsxs)("div",{className:`flex items-center gap-2 ${s.fgMuted} text-sm`,children:[(0,M.jsx)(yo.default,{size:16}),(0,M.jsx)("span",{children:(0,M.jsx)(Le,{text:le(e.company_name),query:n??"",enabled:a})})]}),T.length>0?(0,M.jsx)("div",{className:`${s.fgMuted} text-sm`,children:T.map((S,R)=>(0,M.jsxs)("span",{children:[R>0&&" / ",(0,M.jsx)(Le,{text:S,query:n??"",enabled:a})]},`header-line-${R}`))}):null]}),(0,M.jsx)("div",{className:"flex flex-col gap-3",children:x.map(S=>(0,M.jsx)(xs,{icon:S.icon,label:S.label,value:S.value,fieldKey:S.fieldKey,copyValue:S.copyValue,onCopy:b,isCopied:S.fieldKey?u===S.fieldKey:!1,linkHref:S.linkHref,searchTerm:n,enableHighlighting:a},S.rowKey))})]})},{value:"basic",label:r.detailTabBasic,content:(0,M.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,M.jsx)(ca,{title:r.detailBasicProfile}),(0,M.jsx)(fo,{items:Q,searchTerm:n,enableHighlighting:a})]})},{value:"contact",label:r.detailTabContact,content:(0,M.jsx)("div",{className:"flex flex-col gap-4",children:P.map(({sectionKey:S,title:R,emptyText:ce,entries:j,recommendedKey:Ne,resolveHref:de})=>(0,M.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,M.jsx)(ca,{title:R}),j.length===0?(0,M.jsx)("p",{className:`${s.fgMuted} text-xs`,children:ce}):(0,M.jsx)("div",{className:"flex flex-col gap-2",children:j.map(z=>{let I=de(z.rawValue),ee=z.fieldKey===Ne;return(0,M.jsxs)("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${q.borderSubtle} ${k.surface} px-3 py-2 transition-colors`,children:[(0,M.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,M.jsx)("div",{className:`font-medium ${s.fgMuted} text-xs`,children:z.label}),(0,M.jsx)("div",{className:`wrap-break-word ${s.fg} text-sm`,children:I?(0,M.jsx)("a",{href:I,className:`text-inherit ${pn}`,children:(0,M.jsx)(Le,{text:z.value,query:n??"",enabled:a})}):(0,M.jsx)(Le,{text:z.value,query:n??"",enabled:a})})]}),ee?(0,M.jsxs)("span",{className:`inline-flex shrink-0 items-center gap-1 rounded-full ${re.emerald} px-2 py-0.5 font-semibold ${_} ${m.emerald} transition-colors`,children:[(0,M.jsx)(ho.default,{size:14}),r.preferred]}):null]},z.fieldKey)})})]},S))})},{value:"meta",label:r.detailTabMeta,content:(0,M.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,M.jsx)(ca,{title:r.detailTabMeta}),(0,M.jsx)(fo,{items:h,searchTerm:n,enableHighlighting:a})]})}];return(0,M.jsxs)("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border ${q.borderSubtle} ${k.surface} shadow-sm transition-colors ${i}`.trim(),style:f,children:[(0,M.jsx)("div",{className:`${q.borderSubtle} border-b px-3 py-1.5 transition-colors ${k.subtle}`,children:(0,M.jsxs)("div",{className:"flex items-center gap-2",children:[(0,M.jsx)("div",{className:`flex h-8 w-8 items-center justify-center rounded-full ${re.blue} ${m.blue} transition-colors`,children:(0,M.jsx)(No.default,{size:16})}),(0,M.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,M.jsx)("div",{className:`truncate font-semibold ${s.fg} text-sm`,children:(0,M.jsx)(Le,{text:L,query:n??"",enabled:a})}),(0,M.jsx)("div",{className:`truncate ${_} ${s.fgMuted}`,children:(0,M.jsx)(Le,{text:E,query:n??"",enabled:a})})]})]})}),(0,M.jsxs)(Wn,{defaultValue:"summary",className:"flex flex-1 flex-col overflow-hidden",children:[(0,M.jsx)(bn,{className:`grid h-auto grid-cols-4 gap-1 rounded-none ${q.borderSubtle} border-b ${k.subtle} px-2 py-1 transition-colors`,children:K.map(S=>(0,M.jsx)(Wt,{value:S.value,className:`flex min-h-11 min-w-0 touch-manipulation rounded-md px-1 py-1 font-semibold ${s.fgSecondary} ${N} transition-colors ${w.activeTabSurface} ${w.activeTabBlueFg}`,children:(0,M.jsx)("span",{className:"min-w-0 truncate",children:S.label})},S.value))}),K.map(S=>(0,M.jsx)(Ht,{value:S.value,className:`scrollbar-thin flex-1 overflow-y-auto px-2.5 py-2 transition-colors ${s.fgSecondary}`,style:Ns[t],children:S.content},S.value))]})]})};var Mo=require("react");jt();he();pe();var Ke=require("react/jsx-runtime"),Cr=(0,Mo.memo)(({recordCount:e,companyCount:t,phase:n,loadedCount:a,totalCount:o})=>{let{locale:i,labels:r}=He(),u=se(i,e),d=se(i,t);return(0,Ke.jsxs)("div",{"data-testid":"contact-map-annotation",className:"flex flex-wrap items-center gap-2 leading-1 transition-colors",children:[(0,Ke.jsxs)("span",{className:"flex items-baseline gap-1",children:[(0,Ke.jsx)("span",{className:s.fgMuted,children:r.annotationTotalLabel}),(0,Ke.jsx)("span",{className:s.fg,"data-testid":"contact-map-record-count",children:u}),(0,Ke.jsx)("span",{className:s.fgMuted,children:r.recordUnit(u)})]}),(0,Ke.jsxs)("span",{className:"flex items-baseline gap-1",children:[(0,Ke.jsx)("span",{className:s.fgMuted,children:r.annotationCompaniesLabel}),(0,Ke.jsx)("span",{className:s.fg,"data-testid":"contact-map-company-count",children:d}),(0,Ke.jsx)("span",{className:s.fgMuted,children:r.companyUnit(d)})]}),n==="streaming"||n==="idle"?(0,Ke.jsx)("span",{"data-testid":"contact-map-stream-badge",className:`ml-2 inline-flex items-center gap-1.5 rounded-full ${re.blue} px-2 py-0.5 font-medium ${m.blue} text-xs`,children:o!==null&&o>0?r.annotationStreamingProgress({loaded:a,total:o,percent:Math.min(100,Math.round(a/o*100))}):r.annotationStreamingCount(a)}):null,n==="retrying"?(0,Ke.jsx)("span",{"data-testid":"contact-map-reconnecting-badge",className:`ml-2 inline-flex items-center gap-1.5 rounded-full ${re.amber} px-2 py-0.5 font-medium ${m.amber} text-xs`,children:r.annotationReconnecting(a)}):null]})});Cr.displayName="ContactMapAnnotation";var Ra=require("react");un();_t();var vr=e=>e==="unauthenticated"||e==="forbidden";function xr(e,t){if(typeof e!="function")throw new TypeError(`[contact-map] ${t} must be the host's access failure presenter (a function, AccessFailurePresenter of @aiquants/auth-core); got ${ie(e)}`)}function Eo(e,t){if(typeof e!="number")throw new TypeError(`[contact-map] ${t} must be the stream's accessFailureNumber (a number); got ${ie(e)}`);if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`[contact-map] ${t} must be a non-negative safe integer (the stream's accessFailureNumber); got ${ie(e)}`)}var Sn=require("react");_t();un();he();_t();un();Yr();var Ms=["indexWorker","levenshteinWorker","treeWorker"];function Lo(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 ${ie(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${ie(n)}`)}}var ko={setting:"workerUrls"},wo=(e,t)=>{if(e===void 0)return;let{setting:n,keys:a=Ms,hints:o={}}=t;if(!dn(e))throw new TypeError(`[contact-map] ${n} must be a plain object or left out; got ${ie(e)}`);let i=Object.getOwnPropertyNames(e).map(d=>({key:d,url:e[d]})),r=i.find(({key:d,url:c})=>c!==void 0&&!a.includes(d));if(r!==void 0){let d=Object.hasOwn(o,r.key)?o[r.key]:void 0,c=d===void 0?rr(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}`}${c===void 0?"":`; did you mean ${JSON.stringify(c)}?`}); got ${ie(r.key)}`)}let u=Object.create(null);for(let{key:d,url:c}of i){let f=d;Lo(n,f,c),c!==void 0&&(u[f]=c)}return u};function Es(e,t=ko){wo(e,t)}function da(e){Lo("workerUrls","treeWorker",e)}var Xt=(e,t,n=ko)=>{let a=wo(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 Tr=require("react/jsx-runtime"),Ro=e=>{if(!dn(e))throw new TypeError(`[contact-map] config must be a plain object; got ${ie(e)}`);let t=e;return{streamEndpoint:$e(t,"streamEndpoint"),openEmailsWithGmail:$e(t,"openEmailsWithGmail"),treeWorkerFactory:$e(t,"treeWorkerFactory"),workerUrls:Xt(void 0,$e(t,"workerUrls")),locale:$e(t,"locale"),labels:$e(t,"labels")}},Po=({workerUrls:e,...t})=>{let{indexWorker:n,levenshteinWorker:a,treeWorker:o}=e;return Object.freeze(Object.assign(Object.create(null),t,{workerUrls:Object.freeze({indexWorker:n,levenshteinWorker:a,treeWorker:o})}))},Ls=Po(Ro({})),_o=(0,Sn.createContext)(Ls),ks=Object.freeze({locale:"locale",labels:"labels"});function ua({config:e,chromeSurface:t,children:n}){let{streamEndpoint:a,openEmailsWithGmail:o,treeWorkerFactory:i,workerUrls:r,locale:u,labels:d}=Ro(e),{indexWorker:c,levenshteinWorker:f,treeWorker:p}=r,l=(0,Sn.useMemo)(()=>Po({streamEndpoint:a,openEmailsWithGmail:o,treeWorkerFactory:i,workerUrls:{indexWorker:c,levenshteinWorker:f,treeWorker:p},locale:u,labels:d}),[a,o,i,c,f,p,u,d]);return(0,Tr.jsx)(_o.Provider,{value:l,children:(0,Tr.jsx)(Ba,{locale:u,labels:d,surface:t,children:n})})}function Ao({config:e,children:t}){return(0,Tr.jsx)(ua,{config:e,chromeSurface:ks,children:t})}function mt(){return(0,Sn.useContext)(_o)}var Fe=require("react");var $o=require("@aiquants/auth-core");_t();var ws=1e3,Rs=3e4,Ps=6;function Fn(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 ${ie(e)}`);if(/[\s\p{Cc}#]/u.test(e))throw new RangeError(`[contact-map] streamEndpoint must not contain whitespace, control characters or "#"; got ${ie(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 ${ie(e)}`)}var Oo=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}),_s=e=>Array.isArray(e.records),Hn=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,accessFailureNumber:0};this.handleOnline=()=>{this.wakeRetryWait?.()};Fn(t.endpoint),this.fetchFn=t.fetchFn??((...n)=>fetch(...n)),this.endpoint=t.endpoint,this.initialRetryDelayMs=t.initialRetryDelayMs??ws,this.maxRetryDelayMs=t.maxRetryDelayMs??Rs,this.maxConsecutiveFailures=t.maxConsecutiveFailures??Ps,this.logger=t.logger??ut}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"unauthenticated":case"forbidden":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(typeof a=="object"){this.setState({phase:a.accessFailure,isLoading:!1,error:null,accessFailureNumber:this.state.accessFailureNumber+1});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 o=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 ${o}ms (attempt ${this.consecutiveFailures})`),await this.waitBeforeRetry(o),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"}),n=(0,$o.accessFailureKindOfStatus)(t.status);if(n!==null)return{accessFailure:n};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 a=t.body.getReader(),o=new TextDecoder,i="",r=!1,u=!1;for(;;){let{done:d,value:c}=await a.read();if(d)break;let f=o.decode(c,{stream:!0}),p=(i+f).split(`
|
|
2
|
+
`);i=p.pop()??"";let l=!1;for(let g of p){let b=g.trim();if(!b)continue;let T;try{T=JSON.parse(b)}catch(E){this.logger.warn("[ContactMapStream] failed to parse NDJSON line:",E);continue}if("type"in T&&T.type==="METADATA"){Number.isSafeInteger(T.total)&&T.total>=0&&this.setState({totalCount:T.total});continue}if(!_s(T)){this.logger.warn("[ContactMapStream] server reported error:","error"in T?T.error:""),u=!0;continue}for(let E of T.records)E&&typeof E.person_id=="number"&&(this.recordMap.set(E.person_id,Oo(E)),l=!0);T.nextCursor&&(this.lastCursor=T.nextCursor),T.isLast&&(r=!0)}l&&(this.consecutiveFailures=0,this.publishRecords({error:null}))}return u?(this.setState({error:new Error("Stream interrupted by server error")}),"retryable"):r?"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 rt=null,Do=e=>{if(rt!==null&&rt.endpoint===e)return rt;if(Fn(e),rt===null)return rt=new Hn({endpoint:e}),rt;if(rt.endpoint!==e)throw new Error(`[contact-map] the stream client already streams from ${JSON.stringify(rt.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 rt},As=()=>{rt?.dispose(),rt=null},$s=new Map,Os={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null,accessFailureNumber:0},Ds=()=>{let{streamEndpoint:e}=mt();return(0,Fe.useMemo)(()=>(Fn(e),e),[e])};function Wo(){let e=Ds(),t=(0,Fe.useCallback)(()=>Do(e),[e]);(0,Fe.useEffect)(()=>{let r=t();r.start(),r.retryNow()},[t]);let n=(0,Fe.useCallback)(r=>t().subscribe(r),[t]),a=(0,Fe.useSyncExternalStore)(n,()=>t().getState(),()=>Os),o=(0,Fe.useSyncExternalStore)(n,()=>t().getRecordMap(),()=>$s),i=(0,Fe.useCallback)(()=>t().retryNow(),[t]);return(0,Fe.useMemo)(()=>({...a,recordMap:o,retryNow:i}),[a,o,i])}var Ho=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 In(){let{records:e,recordMap:t,isComplete:n,phase:a,loadedCount:o,totalCount:i,error:r,accessFailureNumber:u,retryNow:d}=Wo(),c=(0,Fe.useMemo)(()=>Ho(e),[e]);return{context:(0,Fe.useMemo)(()=>({contactMapRecords:e,contactMapRecordMap:t,isStreamingComplete:n,isStreamingFailed:a==="failed"||vr(a),streamPhase:a,streamAccessFailureNumber:u,loadedCount:o,companyCount:c,totalCount:i,errorMessage:r?.message??null}),[e,t,n,a,u,o,c,i,r]),retryNow:d}}he();var Hr=require("@aiquants/fuzzy-search"),wi=require("@aiquants/fuzzy-search/react"),Ri=Ce(require("lucide-react/dist/esm/icons/search.js")),G=require("react"),Fr=require("react-router");sa();un();var je=require("react"),vt=e=>{let t=(0,je.useRef)(null),n=(0,je.useRef)({isPointerDown:!1,isDragging:!1,startX:0,scrollLeft:0,pointerId:0,hasCapture:!1,didDrag:!1,pointerType:""}),a=e?.dragThreshold??4,o=(0,je.useCallback)(p=>{let l=p.currentTarget,g=p.deltaY;!l||g===0||(p.preventDefault(),l.scrollBy({left:g,behavior:"smooth"}))},[]),i=(0,je.useCallback)(p=>{t.current?.removeEventListener("wheel",o),t.current=p,p?.addEventListener("wheel",o,{passive:!1})},[o]);(0,je.useEffect)(()=>()=>{t.current&&t.current.removeEventListener("wheel",o)},[o]);let r=(0,je.useCallback)(p=>{if(p.pointerType==="touch")return;let l=n.current;l.isPointerDown=!0,l.isDragging=!1,l.startX=p.clientX,l.scrollLeft=p.currentTarget.scrollLeft,l.pointerId=p.pointerId,l.hasCapture=!1,l.pointerType=p.pointerType},[]),u=(0,je.useCallback)(p=>{let l=n.current;if(!l.isPointerDown||l.pointerType==="touch")return;let g=p.currentTarget,b=p.clientX-l.startX;!l.isDragging&&Math.abs(b)>a&&(l.isDragging=!0,l.hasCapture||(g.setPointerCapture?.(p.pointerId),l.hasCapture=!0)),l.isDragging&&(p.preventDefault(),g.scrollLeft=l.scrollLeft-b)},[a]),d=(0,je.useCallback)(p=>{let l=n.current;if(l.pointerType==="touch")return;let g=p.currentTarget;l.isPointerDown&&l.hasCapture&&g.hasPointerCapture?.(p.pointerId)&&g.releasePointerCapture(p.pointerId),l.isDragging&&(l.didDrag=!0,window.setTimeout(()=>{l.didDrag=!1},0)),l.isPointerDown=!1,l.isDragging=!1,l.pointerId=0,l.hasCapture=!1},[]),c=(0,je.useCallback)(p=>{d(p)},[d]),f=(0,je.useCallback)(p=>{n.current.didDrag&&(p.preventDefault(),p.stopPropagation(),n.current.didDrag=!1)},[]);return{setScrollableRef:i,onPointerDown:r,onPointerMove:u,onPointerUp:c,onPointerLeave:c,onPointerCancel:c,onClickCapture:f}};jt();he();var Fo=require("@aiquants/fuzzy-search"),Nr=e=>{let{indexWorkerOptions:t,levenshteinWorkerOptions:n,...a}=Fo.DEFAULT_FUZZY_SEARCH_OPTIONS;return{...a,autoSearchOnIndexRebuild:!1,multiTermOperator:"and",workerUrls:e,indexWorkerOptions:{...t},levenshteinWorkerOptions:{...n}}};pe();pe();An();var ma=require("react/jsx-runtime");function pa({value:e,max:t=100,className:n,indicatorClassName:a,...o}){let i=e===void 0,r=i?0:Math.min(100,Math.max(0,e/t*100));return(0,ma.jsx)("div",{role:"progressbar","aria-valuenow":i?void 0:r,"aria-valuemin":0,"aria-valuemax":100,"data-slot":"progress",className:Oe(`relative h-2 w-full overflow-hidden rounded-full ${At.progressTrack}`,n),...o,children:(0,ma.jsx)("div",{"data-slot":"progress-indicator",className:Oe(`h-full rounded-full ${tt.blue} transition-[width] duration-300 ease-in-out will-change-transform`,i&&"w-1/3 animate-progress-indeterminate",a),style:i?void 0:{width:`${r}%`}})})}Pe();var Cn="view";var Rr=require("react"),vi=require("react-router");he();pe();Pe();var Qt=require("@aiquants/resize-panels"),Tn=require("@aiquants/virtualscroll"),W=require("react");Vt();var Bn={listPanelMinWidth:320,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35},zn={listPanelMinWidth:280,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35};function Mr(e){let t=e.listPanelMinWidth+e.detailPanelMinWidth+e.handleThickness+e.listPaddingAndBorder+e.detailPaddingAndBorder,n=t+e.scrollbarSafetyBuffer,a=n+e.hysteresisSafetyMargin,o=a-n;return{physicalMinWidth:t,collapseThreshold:n,expandThreshold:a,hysteresisWidth:o}}var vn=require("react"),fa=(e,t)=>{let{enableMutationObserver:n=!1,bottomGap:a=4,minFallbackHeight:o=240}=t??{},[i,r]=(0,vn.useState)(600),u=(0,vn.useCallback)(()=>{if(typeof window>"u")return;let d=e.current;if(!d||d.offsetParent===null&&window.getComputedStyle(d).position!=="fixed")return;let c=R=>Number.parseFloat(R)||0,{top:f}=d.getBoundingClientRect(),p=d.parentElement?.getBoundingClientRect(),l=window.getComputedStyle(document.documentElement),g=c(l.getPropertyValue("--footer-height")),b=c(l.getPropertyValue("--header-height")),T=c(l.getPropertyValue("--scrollbar-height")),E=window.getComputedStyle(d),L=c(E.marginBottom),Q=c(E.paddingBottom),X=window.innerHeight-g-T-a,y=p?Math.min(p.bottom,X):X,h=p?Math.max(p.top,b):b,x=Math.max(f,h),P=y-x-L-Q,K=Number.isFinite(P)?Math.floor(P):0,S=K>0?K:o;S>0&&Number.isFinite(S)&&r(R=>Math.abs(R-S)>1?S:R)},[a,e,o]);return(0,vn.useEffect)(()=>{if(typeof window>"u")return;let d=null,c=null,f=null,p=null,l=()=>{d!==null&&window.cancelAnimationFrame(d),d=window.requestAnimationFrame(()=>{u()})};l(),c=window.setTimeout(()=>{l()},150);let g=e.current;return typeof ResizeObserver<"u"&&g&&(f=new ResizeObserver(()=>{l()}),f.observe(g),g.parentElement&&f.observe(g.parentElement)),n&&typeof MutationObserver<"u"&&(p=new MutationObserver(()=>{l()}),p.observe(document.body,{attributes:!0,childList:!0,subtree:!0})),window.addEventListener("resize",l),()=>{d!==null&&window.cancelAnimationFrame(d),c!==null&&window.clearTimeout(c),f&&f.disconnect(),p&&p.disconnect(),window.removeEventListener("resize",l)}},[e,n,u]),{viewportHeight:i,updateViewportHeight:u}};var Te=require("react"),Ws=600,Io=8,Un=({ref:e,onSelect:t,resolveItem:n,item:a})=>{let[o,i]=(0,Te.useState)(!1),[r,u]=(0,Te.useState)(null),d=(0,Te.useRef)(null),c=(0,Te.useRef)(!1),f=(0,Te.useRef)(null),p=(0,Te.useRef)({onSelect:t,resolveItem:n,item:a});(0,Te.useEffect)(()=>{p.current={onSelect:t,resolveItem:n,item:a}},[t,n,a]);let l=(0,Te.useCallback)(()=>{typeof window>"u"||d.current!==null&&(window.clearTimeout(d.current),d.current=null)},[]),g=(0,Te.useCallback)(()=>{f.current&&(l(),f.current=null)},[l]),b=(0,Te.useCallback)(h=>{typeof window>"u"||h.button!==0&&h.pointerType==="mouse"||(l(),c.current=!1,f.current={x:h.clientX,y:h.clientY,pointerId:h.pointerId},d.current=window.setTimeout(()=>{let x=p.current,P=null;x.item!==void 0?P=x.item:x.resolveItem&&h.target&&(P=x.resolveItem(h.target)),P!==null&&(c.current=!0,x.onSelect?.(P),u(P),i(!0)),g()},Ws))},[l,g]),T=(0,Te.useCallback)(h=>{f.current&&h.pointerId===f.current.pointerId&&(l(),f.current=null)},[l]),E=(0,Te.useCallback)(h=>{c.current&&(h.preventDefault(),h.stopPropagation(),h.type==="click"&&(c.current=!1))},[]),L=(0,Te.useCallback)(()=>{c.current=!1},[]),Q=(0,Te.useCallback)(h=>{if(!f.current||h.pointerId!==f.current.pointerId)return;let x=Math.abs(h.clientX-f.current.x),P=Math.abs(h.clientY-f.current.y);(x>Io||P>Io)&&(l(),f.current=null)},[l]),X=(0,Te.useCallback)(h=>{(o||d.current!==null)&&(h.preventDefault(),h.stopPropagation())},[o]),y=(0,Te.useCallback)(()=>{i(!1),u(null),c.current=!1,f.current=null},[]);return(0,Te.useEffect)(()=>{let h=e.current;if(!(h&&typeof window<"u"))return;let x=[["pointerdown",b,void 0],["pointerup",T,void 0],["pointercancel",T,void 0],["pointermove",Q,void 0],["pointerleave",T,void 0],["contextmenu",X,void 0]],P=[["mousedown",E,!0],["mouseup",E,!0],["click",E,!0],["pointerdown",L,!0],["keydown",L,!0],["contextmenu",X,!0],["pointerup",T,!0],["pointercancel",T,!0]];for(let[K,S,R]of x)h.addEventListener(K,S,R);for(let[K,S,R]of P)window.addEventListener(K,S,R);return()=>{for(let[K,S,R]of x)h.removeEventListener(K,S,R);for(let[K,S,R]of P)window.removeEventListener(K,S,R);l()}},[e,b,T,Q,E,L,X,l]),{isPopupVisible:o,popupItem:r,handleClosePopup:y}};var xt=require("react");function Vn(e,t,n){let a=n?.mediaQuery??"(min-width: 1024px)",o=(0,xt.useSyncExternalStore)((0,xt.useCallback)(f=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let p=window.matchMedia(a);return p.addEventListener("change",f),()=>p.removeEventListener("change",f)},[a]),()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(a).matches:!0,()=>!1),[i,r]=(0,xt.useState)(!1),[u,d]=(0,xt.useState)(0);return(0,xt.useEffect)(()=>{if(typeof window>"u"||typeof ResizeObserver>"u")return;let f=e.current;if(!f)return;let p=new ResizeObserver(l=>{for(let g of l){if(g.target!==f)continue;let b=0;g.borderBoxSize&&g.borderBoxSize.length>0?b=g.borderBoxSize[0].inlineSize:b=g.contentRect.width,!(!Number.isFinite(b)||b<=0)&&(d(b),r(T=>T&&b>=t.expandThreshold?!1:!T&&b<t.collapseThreshold?!0:T))}});return p.observe(f),()=>p.disconnect()},[e,t.collapseThreshold,t.expandThreshold]),{isTwoColumn:o&&!i,isContainerNarrow:i,isMediaMatches:o,containerWidth:u}}he();_t();var Bo=e=>e.isComposing||e.keyCode===229;var zo=(e,t)=>{if(Is(t),e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||Bo(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 Fs(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}},Hs=new Set(["ArrowDown","ArrowUp","PageDown","PageUp","Home","End"]),Fs=e=>Hs.has(e),Is=e=>{let{activeIndex:t,startIndex:n,itemCount:a,pageSize:o}=e;if(!Number.isInteger(a)||a<0)throw new RangeError(`[contact-map] listbox itemCount must be a non-negative integer; got ${ie(a)}`);if(!Number.isInteger(o)||o<1)throw new RangeError(`[contact-map] listbox pageSize must be an integer of at least 1; got ${ie(o)}`);let i=r=>Number.isInteger(r)&&r>=0&&r<a;if(a>0&&!i(n))throw new RangeError(`[contact-map] listbox startIndex must be an index below ${a}; got ${ie(n)}`);if(t!==null&&!i(t))throw new RangeError(`[contact-map] listbox activeIndex must be null or an index below ${a}; got ${ie(t)}`)};pe();var xn=require("@aiquants/swipe-overlay"),Er=require("react");he();ta();pe();fn();An();var Tt=require("react/jsx-runtime"),Bs=Oe(cr,"flex overflow-hidden"),zs=Oe(ur,"motion-safe:transition-opacity motion-safe:duration-200"),Us=`relative ml-auto flex h-full w-full max-w-lg flex-col ${k.surface} shadow-xl motion-safe:transition-[transform] motion-safe:duration-200 motion-safe:ease-out`,Vs=`flex shrink-0 items-center justify-between gap-3 ${q.borderSubtle} border-b px-3 py-2`,Ks=`min-w-0 truncate font-semibold text-base ${s.fg} outline-none`,js=`inline-flex min-h-11 min-w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border ${q.borderControl} px-4 font-medium ${s.fgSecondary} text-sm ${w.hoverMuted} ${dt}`,Gs="flex min-h-0 flex-1 flex-col overflow-y-auto p-3",Kn=({isOpen:e,onClose:t,children:n,className:a,title:o})=>{let i=ne(),r=(0,Er.useId)(),u=(0,xn.useOverlayPresence)(e),d=(0,Er.useCallback)(b=>b.ownerDocument.getElementById(r),[r]),{dialogProps:c,backdropProps:f,panelProps:p,attemptClose:l,isSwiping:g}=(0,xn.useSwipeOverlayDialog)({isOpen:e,onClose:t,isCloseBlocked:mr,skipWhenTextSelected:!0,initialFocus:d});return u?(0,Tt.jsxs)("dialog",{...c,"data-testid":"contact-map-mobile-overlay","aria-labelledby":r,className:Oe(Bs,e&&!g?"pointer-events-auto":"pointer-events-none"),style:dr,children:[(0,Tt.jsx)("div",{...f,"data-contact-map-overlay-backdrop":"",className:Oe(zs,e?"opacity-100":"opacity-0")}),(0,Tt.jsxs)("div",{...p,"data-contact-map-overlay-panel":"",className:Oe(Us,e?"pointer-events-auto":"pointer-events-none",a),children:[(0,Tt.jsxs)("div",{className:Vs,children:[(0,Tt.jsx)("h2",{id:r,tabIndex:-1,className:Ks,children:o===void 0?i.overlayTitle:o}),(0,Tt.jsx)("button",{type:"button",className:js,onClick:()=>l(),children:i.close})]}),(0,Tt.jsx)("div",{"data-contact-map-overlay-body":"",className:Gs,style:xn.SWIPE_OVERLAY_SCROLL_AREA_STYLE,children:n})]})]}):null};fn();Pe();oa();var O=require("react/jsx-runtime"),qs=(0,W.lazy)(async()=>({default:(await Promise.resolve().then(()=>(uo(),co))).default})),ga=64,Uo="h-[64px]",Vo=240,Ys=4,ha=Mr(Bn),qo=Bn.listPanelMinWidth,Yo=Bn.detailPanelMinWidth,Xo=Bn.handleThickness,Xs=ha.collapseThreshold,Qs=ha.expandThreshold,Js=({contactData:e})=>{let t=ne(),n=et(e?.full_name)??t.noName,a=et(e?.title)??"-",o=et(e?.company_name)??"-",i=et(e?.department)??"-",r=ln(e).value??"-",u=cn(e).value??"-",d=st(e?.updated_at,t.recordDateTime);return(0,O.jsx)(Dn,{fullName:n,title:a,companyName:o,department:i,phoneNumber:u,email:r,updatedAtText:d})},Zs=e=>({"--contact-panel-height":`${e}px`}),el=e=>typeof e=="object"&&e!==null&&"item"in e,tl=(e,t)=>t!==void 0?`${e}:${t.toFixed(3)}`:void 0,nl=(e,t)=>{for(let n of e){let a=Ut(n);if(a?.person_id===t)return a}return null},Ko=(e,t)=>t!==null&&Ut(e)?.person_id===t,jo=(e,t,n)=>{for(let a=t;a>=0&&a<e.length;a+=n){let o=Ut(e[a]);if(o!==null)return{index:a,personId:o.person_id}}return null},Go=(e,t,n)=>{let a=jo(e,t,n);return a!==null?a:jo(e,t-n,n===1?-1:1)},Lr=(e,t,n)=>{let{viewportHeight:a}=fa(t,{enableMutationObserver:!0,bottomGap:Ys,minFallbackHeight:Vo}),[o,i]=(0,W.useState)(0),r=(0,W.useCallback)(()=>{let p=n.current,l=t.current;if(!(p&&l))return;let g=p.getBoundingClientRect(),b=l.getBoundingClientRect(),T=Math.ceil(b.top-g.top);Number.isFinite(T)&&T>0&&i(E=>Math.abs(E-T)>1?T:E)},[t,n]);(0,W.useLayoutEffect)(()=>{if(!e)return;r();let p=requestAnimationFrame(r);return window.addEventListener("resize",r),()=>{cancelAnimationFrame(p),window.removeEventListener("resize",r)}},[e,r]);let u=a>0?a:Vo,d=o>0?o:0,c=u+d,f=(0,W.useMemo)(()=>Zs(c),[c]);return{normalizedViewportHeight:u,normalizedDetailHeight:c,panelSizingStyle:f}},rl=new Set,Qo=()=>{let[e,t]=(0,W.useState)(rl),n=(0,W.useCallback)((a,o)=>{t(i=>{if(i.has(a)===o)return i;let r=new Set(i);return o?r.add(a):r.delete(a),r})},[]);return{isAnyPopupVisible:e.size>0,handlePopupVisibilityChange:n}},Jo=(e,t,n)=>{let a=(0,W.useRef)(n);(0,W.useLayoutEffect)(()=>{a.current=n},[n]),(0,W.useEffect)(()=>{if(e!==null)return a.current(e,t),()=>{a.current(e,!1)}},[e,t])},Zo=(0,W.memo)(({entry:e,index:t,itemCount:n,listboxId:a,isSelected:o,isActive:i,onSelect:r,onLongPressSelect:u,searchQuery:d,enableHighlighting:c,openEmailsWithGmail:f,openGmailCompose:p,onPopupVisibilityChange:l})=>{let g=ne(),b=(0,W.useRef)(null),T=(0,O.jsx)("div",{className:Uo}),E=el(e)?e:null,L=Ut(e),{isPopupVisible:Q,handleClosePopup:X}=Un({ref:b,onSelect:u,item:L?.person_id});if(Jo(L?.person_id??null,Q,l),!e||!L)return T;let{person_id:y}=L,h=t%2===0?k.surface:k.subtle,x=`${re.blue} ring-1 ${w.selectedRing}`,P=o?x:h,K=["B","F"].map(S=>tl(S,S==="B"?E?.baseScore:E?.score)).filter(Boolean);return(0,O.jsxs)("div",{ref:b,id:(0,Tn.virtualScrollItemElementId)(a,y),className:`flex ${Uo} w-full items-center overflow-hidden ${q.borderSubtle} border-b px-4 py-2 text-left transition-colors ${w.hoverBlueTint} ${P} ${Ka}`,style:{height:ga},role:"option","aria-selected":o,"aria-posinset":t+1,"aria-setsize":n,"data-selected":o?"true":"false","data-contact-map-row-active":i?"":void 0,onClick:()=>r(y),children:[(0,O.jsxs)("div",{className:"hidden w-28 shrink-0 flex-col items-center gap-0.5 text-center sm:flex",children:[(0,O.jsx)("div",{className:`whitespace-nowrap font-medium ${s.fgSecondary} text-xs leading-tight`,children:g.listRowNumber(t+1)}),(0,O.jsx)("div",{className:`truncate ${$t} ${s.fgSecondary} leading-tight`,children:y}),(0,O.jsx)("div",{className:`flex items-center gap-1 whitespace-nowrap font-mono ${$t} ${s.fgMuted} leading-tight`,children:K.length?K.map(S=>(0,O.jsx)("span",{children:S},S)):(0,O.jsx)("span",{children:"-"})})]}),(0,O.jsx)(W.Suspense,{fallback:(0,O.jsx)(Js,{contactData:L}),children:(0,O.jsx)(qs,{contactData:L,searchTerm:d,enableHighlighting:c,openEmailsWithGmail:f,openGmailCompose:p,isPopupVisible:Q,onRequestClose:X})})]})});Zo.displayName="ContactListRow";var ya=({context:e})=>{let{contactMapRecords:t,filteredItems:n,searchQuery:a,hasSearchTerm:o,enableHighlighting:i,openEmailsWithGmail:r,isSearchTabActive:u}=e,{locale:d,labels:c,engineLabels:f}=He(),p=(0,W.useRef)(null),l=(0,W.useRef)(null),[g,b]=(0,W.useState)(null),{normalizedViewportHeight:T,panelSizingStyle:E}=Lr(u,l,p),{isAnyPopupVisible:L,handlePopupVisibilityChange:Q}=Qo(),X=(0,W.useMemo)(()=>({enablePointerDrag:!L,enableKeyboardNavigation:!1}),[L]),y=(0,W.useMemo)(()=>o?n:t,[o,n,t]),[h,x]=(0,W.useState)(null),P=(0,W.useCallback)(te=>{b(te),x(te)},[]),K=(0,W.useCallback)(te=>{if(!r)return;let ye=te.trim();if(!ye||ye==="-"||typeof window>"u")return;let ae=bt(ye,!0);ae&&window.open(ae,"_blank","noopener,noreferrer")},[r]),[S,R]=(0,W.useState)(!1),ce=(0,W.useCallback)(()=>R(!1),[]),j=(0,W.useCallback)(te=>{P(te),R(!0)},[P]),Ne=(0,W.useId)(),de=(0,W.useId)(),z=(0,W.useRef)(null),I=y.length,ee=(0,W.useCallback)((te,ye)=>(0,O.jsx)(Zo,{entry:te,index:ye,itemCount:I,listboxId:Ne,isSelected:Ko(te,g),isActive:Ko(te,h),onSelect:j,onLongPressSelect:P,searchQuery:a,enableHighlighting:i,openEmailsWithGmail:r,openGmailCompose:K,onPopupVisibilityChange:Q}),[I,Ne,g,h,j,P,a,i,r,K,Q]),fe=(0,W.useMemo)(()=>{let te=new Map;return y.forEach((ye,ae)=>{let gt=Ut(ye);gt!==null&&te.set(gt.person_id,ae)}),te},[y]),Me=h===null?null:fe.get(h)??null,Ie=g===null?null:fe.get(g)??null,Ft=Math.max(1,Math.floor(T/ga)),tn=(0,W.useCallback)(te=>{if(te.target.id!==Ne)return;let ye=zo(te.nativeEvent,{activeIndex:Me,startIndex:Ie===null?0:Ie,itemCount:I,pageSize:Ft});if(ye===null)return;if(te.preventDefault(),ye.kind==="activate"){Me!==null&&h!==null&&j(h);return}let ae=Go(y,ye.index,ye.direction);ae!==null&&(x(ae.personId),z.current?.scrollToIndex(ae.index,{align:"nearest"}))},[Ne,Me,Ie,I,Ft,h,j,y]),Et=(0,W.useCallback)(te=>{if(te.target.id!==Ne||Me!==null||!te.target.matches(":focus-visible"))return;let ye=Go(y,Ie===null?0:Ie,1);ye!==null&&x(ye.personId)},[Ne,Me,Ie,y]),nn=(0,W.useMemo)(()=>({id:Ne,role:"listbox",tabIndex:0,"aria-label":c.listboxLabel,"aria-describedby":de}),[Ne,c.listboxLabel,de]),Ee=(0,W.useCallback)(te=>y[te],[y]),rn=(0,W.useCallback)(te=>Ut(y[te])?.person_id??`row-${te}`,[y]),Qe=(0,W.useCallback)(()=>ga,[]),ft=(0,W.useMemo)(()=>({enabled:!0,renderVisual:Tn.tapScrollCircleSampleVisual}),[]),Je=(0,W.useMemo)(()=>g===null?null:nl(y,g),[g,y]);(0,W.useEffect)(()=>{g!==null&&!Je&&b(null)},[g,Je]);let qe=(0,W.useRef)(null),{isTwoColumn:an}=Vn(qe,ha);S&&(an||Je===null)&&R(!1);let Lt=(0,O.jsxs)("div",{ref:p,className:"flex min-h-0 flex-1 flex-col gap-1",children:[(0,O.jsx)("div",{className:`hidden rounded-t-lg border ${q.borderSubtle} ${k.subtle} px-4 py-2 transition-colors sm:block`,children:(0,O.jsxs)("div",{className:"flex items-center",children:[(0,O.jsxs)("div",{className:`flex w-28 shrink-0 flex-col items-center gap-0.5 text-center ${_} ${s.fgSecondary} uppercase tracking-wider`,children:[(0,O.jsx)("span",{className:`font-semibold ${s.fg} text-xs`,children:c.columnNo}),(0,O.jsx)("span",{className:"leading-tight",children:c.columnId}),(0,O.jsx)("span",{className:"whitespace-nowrap leading-tight",children:c.columnScore})]}),(0,O.jsxs)("div",{className:`hidden w-full grid-cols-3 gap-2 font-medium ${s.fgSecondary} text-xs uppercase tracking-wider transition-colors sm:grid xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto]`,children:[(0,O.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,O.jsx)("span",{children:c.columnName}),(0,O.jsx)("span",{className:`font-normal ${_} ${s.fgMuted} uppercase tracking-wider`,children:c.columnTitle})]}),(0,O.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,O.jsx)("span",{children:c.columnCompany}),(0,O.jsx)("span",{className:`font-normal ${_} ${s.fgMuted} uppercase tracking-wider`,children:c.columnDepartment})]}),(0,O.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,O.jsx)("span",{children:c.columnPhone}),(0,O.jsx)("span",{className:`font-normal ${_} ${s.fgMuted} uppercase tracking-wider`,children:c.columnEmail})]}),(0,O.jsx)("div",{className:"hidden items-end justify-end xl:flex",children:(0,O.jsx)("span",{className:`font-normal ${_} ${s.fgMuted} uppercase tracking-wider`,children:c.columnUpdatedAt})})]})]})}),(0,O.jsx)("p",{id:de,hidden:!0,children:c.listKeyboardHelp}),(0,O.jsx)("div",{ref:l,className:"flex-1",onKeyDown:tn,onFocus:Et,children:(0,O.jsx)(Tn.VirtualScroll,{ref:z,contentProps:nn,activeItemIndex:I===0?void 0:Me,activeItemVisibleInset:ja,itemCount:I,getItemKey:rn,behaviorOptions:X,getItem:Ee,getItemHeight:Qe,viewportSize:T,overscanCount:10,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:ft},locale:d,labels:f,className:`w-full rounded-b-lg border ${q.borderSubtle} border-t-0 ${k.surface} pr-0.75 transition-colors`,children:(te,ye)=>ee(te,ye)})}),n.length===0&&o?(0,O.jsx)("div",{className:"py-8 text-center",children:(0,O.jsx)("p",{className:s.fgMuted,children:c.listNoSearchResults})}):null,I===0&&!o?(0,O.jsx)("div",{className:"py-8 text-center",children:(0,O.jsx)("p",{className:s.fgMuted,children:c.listNoData})}):null]});return(0,O.jsx)("div",{ref:qe,"data-testid":"contact-map-list-root",className:"flex min-h-0 flex-1 flex-col",style:E,children:an?(0,O.jsxs)(Qt.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,O.jsx)(Qt.Panel,{id:"contact-map-list-pane",defaultSize:{value:68,unit:"percentage"},minSize:{value:qo,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:Lt}),(0,O.jsx)(Qt.PanelResizeHandle,{id:"contact-map-list-handle",thickness:Xo,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:`cursor-col-resize rounded transition-colors ${w.hoverMuted} focus:outline-none focus-visible:ring-2 ${w.focusVisibleRing} ${w.ringOffsetSurface} focus-visible:ring-offset-1`,"aria-label":c.listResizeHandle}),(0,O.jsx)(Qt.Panel,{id:"contact-map-list-detail-pane",defaultSize:{value:32,unit:"percentage"},minSize:{value:Yo,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:(0,O.jsx)(Yt,{placement:"pane",contact:Je,searchTerm:a,enableHighlighting:i})})]}):(0,O.jsxs)(O.Fragment,{children:[Lt,Je?(0,O.jsx)(Kn,{isOpen:S,onClose:ce,title:c.detailHeading,children:(0,O.jsx)(Yt,{placement:"overlay",contact:Je,searchTerm:a,enableHighlighting:i})}):null]})})};var di=require("@aiquants/directory-tree"),Zt=require("@aiquants/resize-panels"),ui=require("@aiquants/virtualscroll"),mi=Ce(require("@heroicons/react/24/solid/FolderMinusIcon.js")),pi=Ce(require("@heroicons/react/24/solid/FolderPlusIcon.js")),U=require("react"),fi=require("react-dom");Vt();var ba=(e,t)=>e&&e.trim()||t;var Nt=require("react"),Sa=(e,t=250)=>{let[n,a]=(0,Nt.useState)(e),o=(0,Nt.useRef)(null),i=(0,Nt.useRef)(e),r=(0,Nt.useRef)(null),u=(0,Nt.useRef)(!1);return(0,Nt.useEffect)(()=>{if(!u.current){u.current=!0,a(e),i.current=e;return}i.current=n,o.current=null;let d=c=>{o.current??(o.current=c);let f=c-o.current,p=Math.min(1,Math.max(0,f/t)),l=1-(1-p)**3,g=Math.max(0,Math.round(i.current+(e-i.current)*l));a(g),p<1&&(r.current=requestAnimationFrame(d))};return r.current=requestAnimationFrame(d),()=>{r.current!==null&&cancelAnimationFrame(r.current)}},[e,t]),Math.max(0,n)};var De=require("react");_t();he();var ri={},al=250,ol=4e3,kr=3,ei={treeWorkerFactory:"the view remounts","workerUrls.treeWorker":"the page reloads"},ti=(e,t)=>e.uncategorizedCompany===t.uncategorizedCompany&&e.unnamedPerson===t.unnamedPerson,jn=class{constructor(t,{workerSource:n,logger:a=ut}){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>=kr){this.logger.error(`[TreeWorker] the tree Worker failed ${kr} times in a row; the tree stops updating until ${ei[this.workerSource]} (check ${this.workerSource})`,t);return}let n=Math.min(al*2**(this.consecutiveFailures-1),ol);this.logger.warn(`[TreeWorker] the tree Worker failed; retrying in ${n}ms (failure ${this.consecutiveFailures} of ${kr})`,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 ${ie(n)}`);if(!Object.hasOwn(ei,n))throw new RangeError(`[contact-map] TreeWorkerSession workerSource must be "treeWorkerFactory" or "workerUrls.treeWorker"; got ${ie(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>=kr||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||!ti(this.finalizeRequest.naming,n))&&(this.finalizeRequest=null),this.lastSyncedRecords=t,this.lastSyncedNaming=n;let a=this.ensureWorker();if(!a)return;let o=this.workerNeedsReset,i=this.postedNaming===null||!ti(this.postedNaming,n);if((this.workerNeedsReset||i||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()}o&&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}}},il=e=>{if(e!==void 0)return new Worker(e,{type:"module"});let t=typeof ri<"u"?ri.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)")},Jt=null,ni=e=>e===void 0?"the bundled Worker file (workerUrls.treeWorker unset)":JSON.stringify(e),sl=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},ai=e=>{if(da(e),Jt===null){let t=new jn(()=>il(e),{workerSource:"workerUrls.treeWorker"});return Jt={session:t,workerUrl:e},t}if(Jt.workerUrl!==e)throw new Error(`[contact-map] the tree session already loads its Worker from ${ni(Jt.workerUrl)} and cannot also load it from ${ni(e)}; give every contact-map view in the browser tab the same workerUrls.treeWorker, on every route (after changing it, reload the page)`);return Jt.session},ll=()=>{Jt?.session.reset(),Jt=null},cl={snapshot:null,isBuilding:!1};function Ca(e,t=!1){let n=mt(),a=n.treeWorkerFactory,o=n.workerUrls?.treeWorker,{labels:i}=He(),r=i.uncategorizedCompany,u=i.noName,d=(0,De.useMemo)(()=>({uncategorizedCompany:r,unnamedPerson:u}),[r,u]),c=(0,De.useRef)(a);(0,De.useEffect)(()=>{c.current=a},[a]);let f=a!==void 0,p=f?void 0:o,l=(0,De.useMemo)(()=>f?new jn(()=>sl(c.current)(),{workerSource:"treeWorkerFactory"}):null,[f]),g=(0,De.useCallback)(()=>l===null?ai(p):l,[l,p]),b=(0,De.useCallback)(E=>g().subscribe(E),[g]),T=(0,De.useCallback)(()=>g().getState(),[g]);return(0,De.useEffect)(()=>{let E=g();E.syncRecords(e,d),t&&E.finalize()},[g,e,t,d]),(0,De.useEffect)(()=>{if(l!==null)return()=>l.stop()},[l]),(0,De.useSyncExternalStore)(b,T,()=>cl)}he();pe();Pe();aa();gr();var A=require("react/jsx-runtime"),Ta=Mr(zn),gi=zn.listPanelMinWidth,hi=zn.detailPanelMinWidth,yi=zn.handleThickness,dl=Ta.collapseThreshold,ul=Ta.expandThreshold,ml=(e,t)=>{let{searchQuery:n,enableHighlighting:a}=t,o=ba(e.full_name,t.noName),i=ba(e.title,""),r=(0,A.jsx)(Le,{text:o,query:n,enabled:a});return i?(0,A.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,A.jsx)("span",{children:r}),(0,A.jsx)("span",{className:`${s.fgMuted} text-xs`,children:(0,A.jsx)(Le,{text:i,query:n,enabled:a})})]}):r},pl="contact-map-tree h-full w-full",fl={hoverClassName:k.muted,directorySelectedClassName:`${re.sky} ${w.treeNameSky}`,itemSelectedClassName:`${re.sky} ${w.treeNameSky}`},va="h-4 w-4 shrink-0 transition-colors duration-150",bi=(e,t,n)=>({...e,viewportHeightOverride:t,behaviorOptions:{...e.behaviorOptions,enablePointerDrag:!n}}),wr=null,oi=null,Gn=new Map,ii="",si=null,li=null,gl=(e,t,n,a,o)=>{let i=`${n?"icons":"plain"}#${a}#${o.noName}`;(i!==ii||o.formatDirectoryName!==si||t!==li)&&(Gn.clear(),ii=i,si=o.formatDirectoryName,li=t);let r={entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},u=new Set;for(let d of e){u.add(d.absolutePath);let c=`${d.name}\0${d.memberCount}`,f=Gn.get(d.absolutePath);(!f||f.signature!==c)&&(f={signature:c,result:Ci([d],t,n,{searchQuery:"",enableHighlighting:!1,noName:o.noName,formatDirectoryName:o.formatDirectoryName})},Gn.set(d.absolutePath,f));let p=f.result;p.entries.length>0&&r.entries.push(p.entries[0]);for(let[l,g]of p.personPathMap){let b=r.personPathMap.get(l);if(b)for(let T of g)b.add(T);else r.personPathMap.set(l,new Set(g))}for(let[l,g]of p.contactByPath)r.contactByPath.set(l,g);for(let[l,g]of p.ancestorsByPath)r.ancestorsByPath.set(l,g);r.totalCount+=p.totalCount,!r.firstPerson&&p.firstPerson&&(r.firstPerson=p.firstPerson)}for(let d of Gn.keys())u.has(d)||Gn.delete(d);return r},xa=e=>e.isSelected||e.isItemSelected?m.sky:e.isExpanded&&e.isDirectory?s.fgSecondary:s.fgMuted,Si=e=>{let t=[];for(let n of e)n.type==="directory"&&(t.push(n.absolutePath),n.children&&t.push(...Si(n.children)));return t},hl=e=>{if(e.memberCount===void 0)throw new Error(`[contact-map] directory entry ${e.absolutePath} has no memberCount`);return e.memberCount},Ci=(e,t,n,a,o)=>{let i=new Map,r=new Map,u=new Map,d=0,c=null,f=(l,g)=>{let b=[...g,l.absolutePath];u.set(l.absolutePath,b);let T,E,L=l.type==="directory"?a.formatDirectoryName(l.name,hl(l)):l.name,Q=(0,A.jsx)(Le,{text:L,query:a.searchQuery,enabled:a.enableHighlighting});if(l.type==="file"&&l.personId){if(o&&!o.has(l.personId))return null;let X=t.get(l.personId);if(X){r.set(l.absolutePath,X),i.has(l.personId)||i.set(l.personId,new Set);let y=i.get(l.personId);y&&y.add(l.absolutePath),d++,c||(c={personId:l.personId,path:l.absolutePath}),n&&(E=h=>{let x=xa(h);return h.isSelected||h.isItemSelected||l.isPrimary&&(x=l.title?m.indigo:m.orange),(0,A.jsx)(n.person,{"aria-hidden":"true",className:`${va} ${x}`})},l.title&&(Q=ml(X,a))),Q=(0,A.jsx)("span",{"data-contact-path":l.absolutePath,className:"block w-full",children:Q})}}else if(l.children){let X=l.children.map(y=>f(y,b)).filter(y=>y!==null);if(o&&X.length===0)return null;if(T=X,n){let y=l.relativePath.startsWith("company:")?n.company:n.department;E=h=>(0,A.jsx)(y,{"aria-hidden":"true",className:`${va} ${xa(h)}`})}}return{name:L,label:Q,type:l.type,absolutePath:l.absolutePath,relativePath:l.relativePath,icon:E,children:T}};return{entries:e.map(l=>f(l,[])).filter(l=>l!==null),personPathMap:i,contactByPath:r,ancestorsByPath:u,firstPerson:c,totalCount:d}},yl=(e,t,n)=>{let a=new Set,o=new Set,i=new Map;t.forEach((f,p)=>{i.set(f.item.person_id,p)});for(let f of t){let p=f.item.person_id,l=e.personPathMap.get(p);if(l)for(let g of l){a.add(g);let b=e.ancestorsByPath.get(g);if(b){for(let T of b)a.add(T);n&&b.length>0&&o.add(b[0])}}}let r=new Map,u=f=>{let p=r.get(f.absolutePath);if(p!==void 0)return p;let l=1/0;if(f.type==="file"){let g=e.contactByPath.get(f.absolutePath);g&&(l=i.get(g.person_id)??1/0)}else if(f.children)for(let g of f.children)l=Math.min(l,u(g));return r.set(f.absolutePath,l),l},d=(f,p=0)=>f.filter(l=>n&&p===0&&o.has(l.absolutePath)?!0:a.has(l.absolutePath)).map(l=>n&&p===0&&o.has(l.absolutePath)?l:l.type==="directory"&&l.children?{...l,children:d(l.children,p+1)}:l).sort((l,g)=>p===0?u(l)-u(g):0),c=d(e.entries);return{...e,entries:c}},ci=(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 o=a.values().next();return o.done?null:o.value},Na=({context:e,controlsContainer:t})=>{let{contactMapRecords:n,contactMapRecordMap:a,filteredItems:o,hasSearchTerm:i,isSearchInProgress:r,isSearchTabActive:u}=e,{locale:d,labels:c,treeLabels:f}=He(),p=c.noName,l=c.treeDirectoryName,g=(0,U.useMemo)(()=>({noName:p,formatDirectoryName:l}),[p,l]),[b,T]=(0,U.useState)(null),[E,L]=(0,U.useState)(!1),{snapshot:Q,isBuilding:X}=Ca(n,e.isStreamingComplete),y=Q?.tree??null,h=Q?.rebuildEpoch??0,x=(0,U.useMemo)(()=>y?gl(y,a,b,h,g):null,[y,a,b,h,g]),P=(0,U.useMemo)(()=>{if(!y)return null;if(!i)return x;let B;E||(B=new Set(o.map(ge=>ge.item.person_id)));let me=Ci(y,a,b,{...g,searchQuery:e.searchQuery,enableHighlighting:e.enableHighlighting},B);return yl(me,o,E)},[y,x,a,b,e.searchQuery,e.enableHighlighting,i,o,E,g]),K=(0,U.useMemo)(()=>P||{entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},[P]),S=i&&e.errorMessage!==null,[R,ce]=(0,U.useState)(K),j=(0,U.useRef)(!1);(0,U.useEffect)(()=>{if(!(r||S)){j.current=!!y,ce(K);return}!j.current&&y&&K.entries.length>0&&(j.current=!0,ce(K))},[K,y,r,S]);let Ne=i&&(r||S)?R:K,{entries:de,personPathMap:z,contactByPath:I,totalCount:ee}=Ne,fe=(0,U.useMemo)(()=>Si(de),[de]),[Me,Ie]=(0,U.useState)(()=>oi??new Set),Ft=(0,U.useCallback)(B=>!Me.has(B),[Me]),tn=(0,U.useCallback)(B=>{Ie(me=>{let ge=new Set(me);return ge.has(B)?ge.delete(B):ge.add(B),ge})},[]),Et=(0,U.useCallback)(B=>{B.length!==0&&Ie(me=>{let ge=new Set(me);for(let yt of B)ge.add(yt);return ge})},[]),nn=(0,U.useCallback)(B=>{Ie(me=>{if(me.size===0)return me;let ge=!1,yt=new Set(me);for(let J of B)yt.delete(J)&&(ge=!0);return ge?yt:me})},[]);(0,U.useEffect)(()=>{oi=Me},[Me]),(0,U.useEffect)(()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem("contact-map.tree-expanded")}catch{}},[]);let[Ee,rn]=(0,U.useState)(null),[Qe,ft]=(0,U.useState)(null),[Je,qe]=(0,U.useState)(!1),an=(0,U.useCallback)(()=>qe(!1),[]),Lt=(0,U.useRef)(null),te=(0,U.useRef)(null),{normalizedViewportHeight:ye,panelSizingStyle:ae}=Lr(u,te,Lt),gt=(0,U.useCallback)(B=>{let me=I.get(B);return me?(Ee!==me.person_id&&rn(me.person_id),B!==Qe&&ft(B),!0):!1},[I,Qe,Ee]),It=(0,U.useCallback)(B=>{gt(B)&&qe(!0)},[gt]),Mn=(0,U.useCallback)(B=>{It(B.entry.absolutePath)},[It]),kt=(0,U.useCallback)(B=>B instanceof Element?B.closest("[data-contact-path]")?.getAttribute("data-contact-path")??null:null,[]),{isPopupVisible:Be,popupItem:En,handleClosePopup:Ln}=Un({ref:te,resolveItem:kt,onSelect:gt}),at=(0,U.useCallback)(B=>{if(!e.openEmailsWithGmail)return;let me=B.trim();if(!me||me==="-"||typeof window>"u")return;let ge=bt(me,!0);ge&&window.open(ge,"_blank","noopener,noreferrer")},[e.openEmailsWithGmail]),wt=En?I.get(En):null,ot=Be&&wt!==null&&wt!==void 0;(0,U.useEffect)(()=>{Be&&!wt&&Ln()},[Be,wt,Ln]);let Bt=(0,U.useMemo)(()=>({overscanCount:16,callbackThrottleMs:16,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:{enabled:!0,renderVisual:ui.tapScrollCircleSampleVisual}},behaviorOptions:{resetOnGetItemHeightChange:!1},preserveScrollAnchor:!0}),[]),Rt=(0,U.useMemo)(()=>bi(Bt,ye,ot),[Bt,ye,ot]);(0,U.useEffect)(()=>{let B=!1;return typeof window>"u"?()=>{B=!0}:wr?(T(wr),()=>{B=!0}):((async()=>{try{let[ge,yt,J,oe]=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(B)return;let ke=ge.default,it=yt.default,jr=J.default,Pa=oe.default;ke&&it&&jr&&Pa&&(wr={company:ke,department:it,title:jr,person:Pa},T(wr))}catch(ge){ut.warn("Failed to load lucide icons",ge)}})(),()=>{B=!0})},[]);let zt=(0,U.useMemo)(()=>{if(!b)return;let B=oe=>ke=>(0,A.jsx)(oe,{"aria-hidden":"true",className:`${va} ${xa(ke)}`}),me={company:B(b.company),department:B(b.department),title:B(b.title)},ge=B(b.person),yt=oe=>oe in me,J=oe=>{let[ke]=oe.entry.relativePath.split(":",1);return(yt(ke)?me[ke]:me.company)(oe)};return{directory:J,directoryExpanded:J,file:ge}},[b]),on=(0,U.useCallback)(()=>{Ie(B=>B.size===0?B:new Set)},[]),Ur=(0,U.useCallback)(()=>{fe.length>0&&Et(fe)},[fe,Et]),Pt=ci(Ee,Qe,z);(0,U.useEffect)(()=>{let B=ci(Ee,Qe,z);if(B===null){Ee!==null&&rn(null),Qe!==null&&ft(null);return}B!==Qe&&ft(B)},[Ee,Qe,z]);let Ze=Pt===null?null:I.get(Pt)??null,kn=e.isStreamingComplete,Vr=e.isStreamingFailed,Yn=kn&&n.length===0,Xn=(X||!y)&&!Yn,Qn=Sa(ee,250),ht=y!==null||Yn,sn=(0,A.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,A.jsxs)("span",{className:`inline-flex h-5 items-center gap-1 rounded ${k.muted} px-1.5 font-medium font-mono ${_} ${s.fgSecondary}`,title:c.treeNodeCountTitle,children:[(0,A.jsx)("span",{children:"\u{1F333}"})," ",c.treeNodeCountLabel," ",ht?c.treeNodeCount(Qn):"\u2026"]}),Vr&&!kn?(0,A.jsxs)("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${F.rose} ${re.rose} px-1.5 font-medium ${_} ${m.rose}`,title:c.treeStreamInterruptedTitle,children:[(0,A.jsx)("span",{className:`h-1.5 w-1.5 rounded-full ${tt.rose}`}),(0,A.jsx)("span",{children:"\u26D4"})," ",c.treeStreamInterrupted]}):kn?Xn?(0,A.jsxs)("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${F.amber} ${re.amber} px-1.5 font-medium ${_} ${m.amber}`,title:c.treeBuildingTitle,children:[(0,A.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,A.jsx)("span",{className:`absolute inline-flex h-full w-full animate-ping rounded-full ${tt.amber}`}),(0,A.jsx)("span",{className:`relative inline-flex h-1.5 w-1.5 rounded-full ${tt.amber}`})]}),(0,A.jsx)("span",{children:"\u{1F33F}"})," ",c.treeBuilding]}):(0,A.jsxs)("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${F.emerald} ${re.emerald} px-1.5 font-medium ${_} ${m.emerald}`,title:c.treeCompleteTitle,children:[(0,A.jsx)("span",{className:`h-1.5 w-1.5 rounded-full ${tt.emerald}`}),(0,A.jsx)("span",{children:"\u2705"})," ",c.treeComplete]}):(0,A.jsxs)("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${F.sky} ${re.sky} px-1.5 font-medium ${_} ${m.sky}`,title:c.treeStreamLoadingTitle,children:[(0,A.jsxs)("span",{className:"relative flex h-1.5 w-1.5",children:[(0,A.jsx)("span",{className:`absolute inline-flex h-full w-full animate-ping rounded-full ${tt.sky}`}),(0,A.jsx)("span",{className:`relative inline-flex h-1.5 w-1.5 rounded-full ${tt.sky}`})]}),(0,A.jsx)("span",{children:"\u23F3"})," ",c.treeStreamLoading]}),i&&(0,A.jsxs)("button",{type:"button",onClick:()=>L(!E),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${E?`${re.blue} ${m.blue}`:`${s.fgMuted} ${w.hoverMuted}`}`,title:c.treeShowEntireCompanyTitle,children:[(0,A.jsx)("span",{children:"\u{1F3E2}"})," ",c.treeShowEntireCompany]}),fe.length>0?(0,A.jsxs)("div",{className:"flex items-center gap-1",children:[(0,A.jsx)("button",{type:"button",onClick:on,className:`inline-flex h-11 w-11 items-center justify-center rounded border ${q.borderControl} ${k.surface} ${s.fgMuted} transition-colors ${w.hoverMuted} ${w.hoverFgSecondary}`,"aria-label":c.treeExpandAll,title:c.treeExpandAllTitle,children:(0,A.jsx)(pi.default,{className:"h-4 w-4"})}),(0,A.jsx)("button",{type:"button",onClick:Ur,className:`inline-flex h-11 w-11 items-center justify-center rounded border ${q.borderControl} ${k.surface} ${s.fgMuted} transition-colors ${w.hoverMuted} ${w.hoverFgSecondary}`,"aria-label":c.treeCollapseAll,title:c.treeCollapseAllTitle,children:(0,A.jsx)(mi.default,{className:"h-4 w-4"})})]}):null]}),Jn=(0,U.useRef)(null),{isTwoColumn:wn}=Vn(Jn,Ta,{mediaQuery:"(min-width: 768px)"});Je&&(wn||Ze===null)&&qe(!1);let Zn=(0,U.useMemo)(()=>({toggle:tn,isExpanded:Ft,expandMultiple:nn,collapseMultiple:Et,isPending:r}),[Et,nn,Ft,tn,r]),er=(0,U.useMemo)(()=>({onEntryClick:Mn,selectedPath:Pt}),[Mn,Pt]),Kr=(0,U.useMemo)(()=>({className:pl,lineColor:Va,iconOverrides:zt,showDirectoryIcons:!!zt,showFileIcons:!!zt,highlightStyles:fl,entryClassName:"rounded-md",nameClassName:"tracking-tight",directoryNameClassName:`font-normal ${s.fg}`,fileNameClassName:s.fgSecondary}),[zt]),Rn=(0,A.jsx)("div",{ref:Lt,className:`flex min-h-0 flex-1 flex-col rounded-xl border ${q.borderSubtle} ${k.surface} shadow-sm transition-colors`,children:(0,A.jsx)("div",{ref:te,className:"flex min-h-0 flex-1 flex-col overflow-hidden p-2",children:de.length>0?(0,A.jsx)(di.DirectoryTree,{entries:de,expansion:Zn,selection:er,visual:Kr,virtualScroll:Rt,locale:d,labels:f}):(0,A.jsx)("div",{className:`flex h-full w-full items-center justify-center rounded-lg border ${q.borderSubtle} border-dashed ${k.surface} px-6 text-center ${s.fgMuted} text-sm transition-colors`,children:i?c.treeNoMatches:c.treeEmpty})})});return(0,A.jsxs)("div",{ref:Jn,"data-testid":"contact-map-tree-root",className:"flex min-h-0 flex-1 flex-col",style:ae,children:[t&&(0,fi.createPortal)(sn,t),wn?(0,A.jsxs)(Zt.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,A.jsx)(Zt.Panel,{id:"contact-map-tree-pane",defaultSize:{value:60,unit:"percentage"},minSize:{value:gi,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:Rn}),(0,A.jsx)(Zt.PanelResizeHandle,{id:"contact-map-tree-handle",thickness:yi,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:`cursor-col-resize rounded transition-colors ${w.hoverMuted} focus:outline-none focus-visible:ring-2 ${w.focusVisibleRing} ${w.ringOffsetSurface} focus-visible:ring-offset-1`,"aria-label":c.treeResizeHandle}),(0,A.jsx)(Zt.Panel,{id:"contact-map-tree-detail-pane",defaultSize:{value:40,unit:"percentage"},minSize:{value:hi,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:(0,A.jsx)(Yt,{placement:"pane",contact:Ze,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})})]}):(0,A.jsxs)(A.Fragment,{children:[Rn,Ze?(0,A.jsx)(Kn,{isOpen:Je,onClose:an,title:c.detailHeading,children:(0,A.jsx)(Yt,{placement:"overlay",contact:Ze,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})}):null]}),ot&&wt&&(0,A.jsx)(On,{contactData:wt,openEmailsWithGmail:e.openEmailsWithGmail,openGmailCompose:at,onRequestClose:Ln})]})};var Ge=require("react/jsx-runtime"),bl={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Sl=e=>e==="tree"?"tree":"list",Ma=({context:e})=>{let t=ne(),[n,a]=(0,vi.useSearchParams)(),[o,i]=(0,Rr.useState)(null),r=Sl(n.get(Cn)),{setScrollableRef:u,onPointerDown:d,onPointerMove:c,onPointerUp:f,onPointerLeave:p,onPointerCancel:l,onClickCapture:g}=vt(),b=(0,Rr.useCallback)(T=>{let E=T==="tree"?"tree":"list";if(E===r)return;let L=new URLSearchParams(typeof window<"u"?window.location.search:"");E==="list"?L.delete(Cn):L.set(Cn,E),a(L,{replace:!0})},[r,a]);return(0,Ge.jsxs)("div",{"data-testid":"contact-map-search-tab-group",className:"flex h-full flex-1 flex-col",children:[(0,Ge.jsxs)("div",{className:"mt-1 mb-1.5 flex shrink-0 flex-wrap items-center gap-2",children:[(0,Ge.jsxs)("div",{ref:u,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-lg ${k.muted} p-0.5 transition-colors`,style:bl,onPointerDown:d,onPointerMove:c,onPointerUp:f,onPointerLeave:p,onPointerCancel:l,onClickCapture:g,children:[(0,Ge.jsxs)("button",{type:"button","data-testid":"contact-map-tab-list","aria-pressed":r==="list",onClick:()=>b("list"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-2 ${N} transition-colors ${r==="list"?`${we.blue} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u{1F4C4} ",t.listViewTab]}),(0,Ge.jsxs)("button",{type:"button","data-testid":"contact-map-tab-tree","aria-pressed":r==="tree",onClick:()=>b("tree"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-2 ${N} transition-colors ${r==="tree"?`${we.green} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u{1F333} ",t.treeViewTab]})]}),(0,Ge.jsx)("div",{ref:i,className:"flex flex-wrap items-center gap-1.5"})]}),(0,Ge.jsxs)("div",{className:"flex h-full flex-1 flex-col",children:[(0,Ge.jsx)("div",{className:`${r==="list"?"flex h-full flex-1 flex-col":"hidden"}`,children:r==="list"?(0,Ge.jsx)(ya,{context:e}):null}),(0,Ge.jsx)("div",{className:`${r==="tree"?"flex h-full flex-1 flex-col":"hidden"}`,children:r==="tree"?(0,Ge.jsx)(Na,{context:e,controlsContainer:o}):null})]})]})};var xi=require("react");he();pe();Pe();var Z=require("@aiquants/fuzzy-search"),_e=require("react");he();pe();Pe();var C=require("react/jsx-runtime"),Ea=1e3,Pr=(0,_e.memo)(({searchOptions:e,setSearchOptions:t})=>{let n=ne(),a=`flex flex-col gap-1 rounded-md border ${k.surface} px-2 py-1 shadow-sm transition-colors`,o="text-xs font-semibold",i=e.sortBy==="relevance",r=(0,_e.useId)(),u=(0,_e.useId)(),d=(0,_e.useId)(),c=(0,_e.useId)(),f=(0,_e.useId)(),p=(0,_e.useId)(),l=(0,_e.useId)(),g=(0,_e.useId)(),b=(0,_e.useId)(),T=(0,_e.useId)(),E=(0,_e.useId)(),L=[];L.push((0,C.jsxs)("div",{className:`${a} ${F.green} border-l-4`,children:[(0,C.jsxs)("div",{className:`${o} ${m.green}`,children:["\u{1F3D7}\uFE0F ",n.indexBuildHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:r,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexNgramSize}),(0,C.jsx)("input",{id:r,type:"range",min:"1",max:"4",step:"1",value:e.ngramSize||Z.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize,onChange:y=>t(h=>({...h,ngramSize:parseInt(y.target.value,10)})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.green} text-xs`,children:[n.currentValueLabel," ",e.ngramSize||Z.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexNgramSizeHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:u,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexMinNgramOverlap}),(0,C.jsx)("input",{id:u,type:"range",min:"1",max:"5",step:"1",value:e.minNgramOverlap||Z.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap,onChange:y=>t(h=>({...h,minNgramOverlap:parseInt(y.target.value,10)})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.green} text-xs`,children:[n.currentValueLabel," ",e.minNgramOverlap||Z.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexMinNgramOverlapHint})]})]},"index-build")),L.push((0,C.jsxs)("div",{className:`${a} ${F.blue} border-l-4`,children:[(0,C.jsxs)("div",{className:`${o} ${m.blue}`,children:["\u{1F50D} ",n.indexCandidateHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:d,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexThreshold}),(0,C.jsx)("input",{id:d,type:"range",min:"0.0",max:"1.0",step:"0.05",value:e.indexWorkerOptions?.threshold??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,threshold:parseFloat(y.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.blue} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.threshold??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexThresholdHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:f,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexNgramOverlapThreshold}),(0,C.jsx)("input",{id:f,type:"range",min:"0.1",max:"0.9",step:"0.1",value:e.indexWorkerOptions?.ngramOverlapThreshold??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,ngramOverlapThreshold:parseFloat(y.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.blue} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.ngramOverlapThreshold??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexNgramOverlapThresholdHint})]})]},"candidate-control")),L.push((0,C.jsxs)("div",{className:`${a} ${F.cyan} border-l-4`,children:[(0,C.jsxs)("div",{className:`${o} ${m.cyan}`,children:["\u{1F9ED} ",n.indexStrategyHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:c,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexStrategy}),(0,C.jsxs)("select",{id:c,value:e.indexWorkerOptions?.strategy??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.strategy??"hybrid",onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,strategy:y.target.value}})),className:`min-h-11 rounded border ${q.borderControl} px-2 pointer-coarse:text-base ${N} transition-colors ${k.surface} ${s.fg}`,children:[(0,C.jsx)("option",{value:"fast",children:n.indexStrategyFast}),(0,C.jsx)("option",{value:"accurate",children:n.indexStrategyAccurate}),(0,C.jsx)("option",{value:"hybrid",children:n.indexStrategyHybrid})]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexStrategyHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:p,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexMinCandidatesRatio}),(0,C.jsx)("input",{id:p,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.minCandidatesRatio??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,minCandidatesRatio:parseFloat(y.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.cyan} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.minCandidatesRatio??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexMinCandidatesRatioHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:l,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexMaxCandidatesRatio}),(0,C.jsx)("input",{id:l,type:"range",min:"0.3",max:"0.8",step:"0.1",value:e.indexWorkerOptions?.maxCandidatesRatio??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxCandidatesRatio:parseFloat(y.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.cyan} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxCandidatesRatio??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexMaxCandidatesRatioHint})]})]},"strategy")),L.push((0,C.jsxs)("div",{className:`${a} ${F.indigo} border-l-4`,children:[(0,C.jsxs)("div",{className:`${o} ${m.indigo}`,children:["\u{1F521} ",n.scoreTuningHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:g,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexJaroWinklerPrefix}),(0,C.jsx)("input",{id:g,type:"range",min:"0.05",max:"0.25",step:"0.05",value:e.indexWorkerOptions?.jaroWinklerPrefix??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,jaroWinklerPrefix:parseFloat(y.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.jaroWinklerPrefix??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexJaroWinklerPrefixHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:b,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.maxResults}),(0,C.jsxs)("label",{className:`flex min-h-11 items-center gap-2 ${N} ${s.fgMuted}`,children:[(0,C.jsx)("input",{type:"checkbox",checked:e.indexWorkerOptions?.maxResults===void 0,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxResults:y.target.checked?void 0:Ea}}))}),n.noLimit]}),(0,C.jsx)("input",{id:b,type:"range",min:Ea,max:"10000",step:"1000",disabled:e.indexWorkerOptions?.maxResults===void 0,value:e.indexWorkerOptions?.maxResults===void 0?Ea:e.indexWorkerOptions.maxResults,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxResults:parseInt(y.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),(0,C.jsxs)("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxResults===void 0?n.noLimit:e.indexWorkerOptions.maxResults]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexMaxResultsHint})]})]},"jaro")),L.push((0,C.jsxs)("div",{className:`${a} ${F.emerald} border-l-4`,children:[(0,C.jsxs)("div",{className:`${o} ${m.emerald}`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:T,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.fieldWeight}),(0,C.jsx)("input",{id:T,type:"range",min:"0",max:"1",step:"0.05",value:e.indexWorkerOptions?.relevanceFieldWeight??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight??.2,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,relevanceFieldWeight:parseFloat(y.target.value)}})),disabled:!i,className:"h-11 w-full disabled:cursor-not-allowed"}),(0,C.jsxs)("span",{className:`${m.emerald} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevanceFieldWeight??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight??.2]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexFieldWeightHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:E,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexPerfectMatchBonus}),(0,C.jsx)("input",{id:E,type:"range",min:"0",max:"0.3",step:"0.1",value:e.indexWorkerOptions?.relevancePerfectMatchBonus??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus??.1,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,relevancePerfectMatchBonus:parseFloat(y.target.value)}})),disabled:!i,className:"h-11 w-full disabled:cursor-not-allowed"}),(0,C.jsxs)("span",{className:`${m.emerald} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevancePerfectMatchBonus??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus??.1]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexPerfectMatchBonusHint})]}),!i&&(0,C.jsx)("p",{className:`${_} ${m.emerald}`,children:n.relevanceOnlyNotice})]},"relevance"));let Q=(0,_e.useId)(),X=(0,_e.useId)();return L.push((0,C.jsxs)("div",{className:`${a} ${F.teal} border-l-4`,children:[(0,C.jsxs)("div",{className:`${o} ${m.teal}`,children:["\u{1F524} ",n.indexContainmentHeading]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:Q,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexContainmentBase}),(0,C.jsx)("input",{id:Q,type:"range",min:"0.0",max:"0.7",step:"0.05",value:e.indexWorkerOptions?.containmentScoreBase??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase??.7,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,containmentScoreBase:parseFloat(y.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.teal} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentScoreBase??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase??.7]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexContainmentBaseHint})]}),(0,C.jsxs)("div",{className:"space-y-2",children:[(0,C.jsx)("label",{htmlFor:X,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.indexContainmentCoverage}),(0,C.jsx)("input",{id:X,type:"range",min:"0.0",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.containmentCoverageWeight??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight??.3,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,containmentCoverageWeight:parseFloat(y.target.value)}})),className:"h-11 w-full"}),(0,C.jsxs)("span",{className:`${m.teal} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentCoverageWeight??Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight??.3]}),(0,C.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.indexContainmentCoverageHint})]})]},"containment")),(0,C.jsxs)("section",{className:"space-y-3",children:[(0,C.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,C.jsxs)("div",{className:`flex items-center gap-2 font-semibold ${m.green} text-xs transition-colors`,children:[(0,C.jsx)("span",{children:"\u{1F4CA}"}),(0,C.jsx)("span",{className:"tracking-wide",children:n.indexSettingsHeading})]}),(0,C.jsx)("button",{type:"button",onClick:()=>t(y=>({...y,indexWorkerOptions:{threshold:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.threshold||.4,ngramOverlapThreshold:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.ngramOverlapThreshold||.3,minCandidatesRatio:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.minCandidatesRatio||.1,maxCandidatesRatio:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.maxCandidatesRatio||.5,jaroWinklerPrefix:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.jaroWinklerPrefix||.1,maxResults:void 0,relevanceFieldWeight:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevanceFieldWeight||.2,relevancePerfectMatchBonus:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.relevancePerfectMatchBonus||.1,containmentScoreBase:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentScoreBase||.7,containmentCoverageWeight:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.containmentCoverageWeight||.3,strategy:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.indexWorkerOptions?.strategy},ngramSize:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.ngramSize,minNgramOverlap:Z.DEFAULT_FUZZY_SEARCH_OPTIONS.minNgramOverlap})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${F.green} ${re.green} px-2 font-medium ${m.green} ${N} transition-colors ${w.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),(0,C.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:L})]})});Pr.displayName="IndexWorkerSettings";var Ae=require("@aiquants/fuzzy-search"),Mt=require("react");he();pe();Pe();var H=require("react/jsx-runtime"),La=1e3,_r=(0,Mt.memo)(({searchOptions:e,setSearchOptions:t})=>{let n=ne(),a=`flex flex-col gap-1 rounded-md border ${k.surface} px-2 py-1 shadow-sm transition-colors`,o="text-xs font-semibold",i=e.sortBy==="relevance",r=(0,Mt.useId)(),u=(0,Mt.useId)(),d=(0,Mt.useId)(),c=(0,Mt.useId)(),f=(0,Mt.useId)(),p=(0,Mt.useId)(),l=[];return l.push((0,H.jsxs)("div",{className:`${a} ${F.purple} border-l-4`,children:[(0,H.jsxs)("div",{className:`${o} ${m.purple}`,children:["\u{1F9EE} ",n.levenshteinCandidateHeading]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:r,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.levenshteinThreshold}),(0,H.jsx)("input",{id:r,type:"range",min:"0.0",max:i?"1.5":"1.0",step:"0.05",value:e.levenshteinWorkerOptions?.threshold??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,threshold:parseFloat(g.target.value)}})),className:"h-11 w-full"}),(0,H.jsxs)("span",{className:`${m.purple} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.threshold??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:i?n.levenshteinThresholdHintRelevance:n.levenshteinThresholdHint})]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:u,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthSimilarity}),(0,H.jsx)("input",{id:u,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.lengthSimilarityThreshold??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,lengthSimilarityThreshold:parseFloat(g.target.value)}})),className:"h-11 w-full"}),(0,H.jsxs)("span",{className:`${m.purple} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthSimilarityThreshold??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthSimilarityHint})]})]},"threshold")),l.push((0,H.jsxs)("div",{className:`${a} ${F.pink} border-l-4`,children:[(0,H.jsxs)("div",{className:`${o} ${m.pink}`,children:["\u{1FA84} ",n.scoreTuningHeading]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:d,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthPenalty}),(0,H.jsx)("input",{id:d,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.levenshteinWorkerOptions?.lengthDiffPenalty??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,lengthDiffPenalty:parseFloat(g.target.value)}})),className:"h-11 w-full"}),(0,H.jsxs)("span",{className:`${m.pink} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthDiffPenalty??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthPenaltyHint})]})]},"penalty")),l.push((0,H.jsxs)("div",{className:`${a} ${F.violet} border-l-4`,children:[(0,H.jsxs)("div",{className:`${o} ${m.violet}`,children:["\u{1F4E6} ",n.levenshteinResultsHeading]}),(0,H.jsx)("label",{htmlFor:c,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.maxResults}),(0,H.jsxs)("label",{className:`flex min-h-11 items-center gap-2 ${N} ${s.fgMuted}`,children:[(0,H.jsx)("input",{type:"checkbox",checked:e.levenshteinWorkerOptions?.maxResults===void 0,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,maxResults:g.target.checked?void 0:La}}))}),n.noLimit]}),(0,H.jsx)("input",{id:c,type:"range",min:La,max:"10000",step:"1000",disabled:e.levenshteinWorkerOptions?.maxResults===void 0,value:e.levenshteinWorkerOptions?.maxResults===void 0?La:e.levenshteinWorkerOptions.maxResults,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,maxResults:parseInt(g.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),(0,H.jsxs)("span",{className:`${m.violet} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.maxResults===void 0?n.noLimit:e.levenshteinWorkerOptions.maxResults]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.levenshteinMaxResultsHint})]},"max-results")),l.push((0,H.jsxs)("div",{className:`${a} ${F.rose} border-l-4`,children:[(0,H.jsxs)("div",{className:`${o} ${m.rose}`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:f,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.fieldWeight}),(0,H.jsx)("input",{id:f,type:"range",min:"0",max:"1",step:"0.05",value:e.levenshteinWorkerOptions?.relevanceFieldWeight??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight??.15,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,relevanceFieldWeight:parseFloat(g.target.value)}})),disabled:!i,className:"h-11 w-full disabled:cursor-not-allowed"}),(0,H.jsxs)("span",{className:`${m.rose} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.relevanceFieldWeight??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight??.15]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.levenshteinFieldWeightHint})]}),(0,H.jsxs)("div",{className:"space-y-2",children:[(0,H.jsx)("label",{htmlFor:p,className:`font-medium ${N} ${s.fgMuted} transition-colors`,children:n.levenshteinPartialBonus}),(0,H.jsx)("input",{id:p,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.partialMatchBonus??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,partialMatchBonus:parseFloat(g.target.value)}})),disabled:!i,className:"h-11 w-full disabled:cursor-not-allowed"}),(0,H.jsxs)("span",{className:`${m.rose} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.partialMatchBonus??Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus]}),(0,H.jsx)("p",{className:`${_} ${s.fgMuted} transition-colors`,children:n.levenshteinPartialBonusHint})]}),!i&&(0,H.jsx)("p",{className:`${_} ${m.rose}`,children:n.relevanceOnlyNotice})]},"relevance")),(0,H.jsxs)("section",{className:"space-y-3",children:[(0,H.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,H.jsxs)("div",{className:`flex items-center gap-2 font-semibold ${m.purple} text-xs transition-colors`,children:[(0,H.jsx)("span",{children:"\u{1F4CF}"}),(0,H.jsx)("span",{className:"tracking-wide",children:n.levenshteinSettingsHeading})]}),(0,H.jsx)("button",{type:"button",onClick:()=>t(g=>({...g,levenshteinWorkerOptions:{threshold:Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.threshold||.3,lengthSimilarityThreshold:Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthSimilarityThreshold||.1,partialMatchBonus:Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.partialMatchBonus||.1,lengthDiffPenalty:Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.lengthDiffPenalty||1,maxResults:void 0,relevanceFieldWeight:Ae.DEFAULT_FUZZY_SEARCH_OPTIONS.levenshteinWorkerOptions?.relevanceFieldWeight||.15}})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${F.purple} ${re.purple} px-2 font-medium ${m.purple} ${N} transition-colors ${w.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),(0,H.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:l})]})});_r.displayName="LevenshteinWorkerSettings";var Se=require("react/jsx-runtime"),Cl={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Ar=(0,xi.memo)(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:o,setOpenEmailsWithGmail:i,activeTab:r,onTabChange:u})=>{let d=ne(),{setScrollableRef:c,onPointerDown:f,onPointerMove:p,onPointerUp:l,onPointerLeave:g,onPointerCancel:b,onClickCapture:T}=vt();return(0,Se.jsxs)("div",{className:`wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border ${F.blue} ${k.surface} p-1.5 shadow-md transition-colors`,children:[(0,Se.jsxs)("div",{className:`mb-0.5 flex shrink-0 flex-col gap-1 rounded ${re.blue} px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between`,children:[(0,Se.jsxs)("h3",{className:`font-semibold ${s.fgSecondary} text-xs transition-colors`,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(E=>Nr(E.workerUrls)),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded ${we.red} px-1.5 ${N} ${s.onPrimary} transition-colors ${Gt.red}`,title:d.settingsResetAllTitle,children:["\u{1F504} ",d.settingsResetAll]})})]}),(0,Se.jsx)("div",{className:"mb-0 shrink-0",children:(0,Se.jsxs)("div",{ref:c,role:"tablist","aria-label":d.settingsTabsLabel,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-md ${k.muted} p-0.5 transition-colors`,style:Cl,onPointerDown:f,onPointerMove:p,onPointerUp:l,onPointerLeave:g,onPointerCancel:b,onClickCapture:T,children:[(0,Se.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="basic",onClick:()=>u("basic"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${r==="basic"?`${we.blue} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u{1F527} ",d.settingsBasicTab]}),(0,Se.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="advanced",onClick:()=>u("advanced"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${r==="advanced"?`${we.orange} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u26A1 ",d.settingsAdvancedTab]}),(0,Se.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="index",onClick:()=>u("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${r==="index"?`${we.green} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u{1F4CA} ",d.indexWorkerName]}),(0,Se.jsxs)("button",{type:"button",role:"tab","aria-selected":r==="levenshtein",onClick:()=>u("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${r==="levenshtein"?`${we.purple} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,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)(lr,{searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:o,setOpenEmailsWithGmail:i})}),(0,Se.jsx)("div",{className:`${r==="advanced"?"block":"hidden"}`,children:(0,Se.jsx)(sr,{searchOptions:e,setSearchOptions:t})}),(0,Se.jsx)("div",{className:`${r==="index"?"block":"hidden"}`,children:(0,Se.jsx)(Pr,{searchOptions:e,setSearchOptions:t})}),(0,Se.jsx)("div",{className:`${r==="levenshtein"?"block":"hidden"}`,children:(0,Se.jsx)(_r,{searchOptions:e,setSearchOptions:t})})]})]})});Ar.displayName="SearchOptionsPanel";var Or=require("react");jt();he();pe();Pe();var Ti=require("react");pe();var $r=require("react/jsx-runtime"),D=(0,Ti.memo)(({label:e,value:t,unit:n,color:a=s.fgMuted})=>(0,$r.jsxs)("div",{className:`wrap-break-word flex min-w-0 flex-col overflow-hidden ${s.fgSecondary} transition-colors sm:flex-row sm:justify-between`,children:[(0,$r.jsxs)("span",{className:"wrap-break-word overflow-hidden text-left",children:[e,":"]}),(0,$r.jsxs)("span",{className:`font-medium ${a} min-w-0 overflow-hidden break-all transition-colors sm:ml-2`,children:[t,n]})]}));D.displayName="StatItem";var Ni=require("react");jt();he();pe();Pe();var v=require("react/jsx-runtime"),en=(0,Ni.memo)(({kind:e,icon:t,stats:n,color:a})=>{let{locale:o,labels:i}=He(),r=z=>se(o,z);if(!n)return(0,v.jsx)("section",{className:`rounded-lg border ${q.borderSubtle} border-dashed ${k.surface} p-3 ${s.fgMuted} text-xs transition-colors`,children:i.statsNoData});let u=n.basic||{},d=n.workerSpecific||{},c=n.analysis||{},f=u.totalSearches??0,p=u.totalProcessingTime??0,l=u.averageSearchTime??0,g=u.lastSearchTime??0,b=u.errorCount??0,T=u.timestamp,E=c.fieldPerformance||{},L=c.performanceInsights||{},Q=c.recentHistory||[],X=d.specificMetrics||{},y=d.operationCount??0,h=d.operationDistribution||{},x=e==="index",P=e==="levenshtein",K=x?i.indexWorkerName:i.levenshteinWorkerName,S=X,R=X,ce=`flex flex-col gap-1 rounded-lg border ${k.surface} p-3 shadow-sm transition-colors`,j="text-xs font-semibold transition-colors",Ne=z=>{if(!z)return;let I=new Date(z);return Number.isNaN(I.getTime())?void 0:i.statsTimestamp(I)},de=[];if(de.push((0,v.jsxs)("div",{className:`${ce} ${F.blue} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${a}`,children:["\u{1F4CA} ",i.statsBasicHeading]}),(0,v.jsx)(D,{label:i.statTotalSearches,value:r(f),color:a}),(0,v.jsx)(D,{label:i.statAverageSearchTime,value:l.toFixed(2),unit:"ms",color:a}),(0,v.jsx)(D,{label:i.statTotalProcessingTime,value:p.toFixed(2),unit:"ms",color:a}),(0,v.jsx)(D,{label:i.statLastSearchTime,value:g.toFixed(2),unit:"ms",color:a}),(0,v.jsx)(D,{label:i.statErrorCount,value:b,color:b>0?m.red:a}),Ne(T)&&(0,v.jsx)(D,{label:i.statUpdatedAt,value:Ne(T),color:s.fgMuted})]},"basic")),y>0||Object.keys(h).length>0){let z=Object.entries(h).sort(([,I],[,ee])=>(Number(ee)||0)-(Number(I)||0)).slice(0,6);de.push((0,v.jsxs)("div",{className:`${ce} ${F.amber} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.amber}`,children:["\u{1F527} ",i.statsOperationsHeading]}),(0,v.jsx)(D,{label:i.statTotalOperations,value:r(y),color:m.amber}),z.length>0&&(0,v.jsx)("div",{className:"mt-1 space-y-1",children:z.map(([I,ee])=>(0,v.jsx)(D,{label:I,value:r(Number(ee)),unit:i.timesUnit(r(Number(ee))),color:m.amber},I))})]},"operations"))}if(x&&(de.push((0,v.jsxs)("div",{className:`${ce} ${F.green} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.green}`,children:["\u{1F3D7}\uFE0F ",i.statsIndexHeading]}),(0,v.jsx)(D,{label:i.statIndexBuilds,value:r(S.totalIndexBuilds??0),color:m.green}),(0,v.jsx)(D,{label:i.statDataSize,value:r(S.currentDataSize??0),unit:i.itemsUnit(r(S.currentDataSize??0)),color:m.green}),(0,v.jsx)(D,{label:i.statLastBuildTime,value:(S.lastIndexTime??0).toFixed(2),unit:"ms",color:m.green})]},"index-core")),S.cacheSize&&de.push((0,v.jsxs)("div",{className:`${ce} ${F.emerald} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.emerald}`,children:["\u{1F4BE} ",i.statsCacheHeading]}),(0,v.jsx)(D,{label:i.statCacheNgram,value:r(S.cacheSize.ngram??0),color:m.emerald}),(0,v.jsx)(D,{label:i.statCacheWord,value:r(S.cacheSize.word??0),color:m.emerald}),(0,v.jsx)(D,{label:i.statCachePhonetic,value:r(S.cacheSize.phonetic??0),color:m.emerald})]},"index-cache")),S.indexMetadata)){let z=Object.entries(S.indexMetadata).slice(0,6);z.length>0&&de.push((0,v.jsxs)("div",{className:`${ce} ${F.teal} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.teal}`,children:["\u{1F4CB} ",i.statsIndexMetadataHeading]}),z.map(([I,ee])=>{let fe;if(typeof ee=="number"){let Me=I.toLowerCase();Me.includes("time")&&!Me.includes("timestamp")?fe=`${ee.toFixed(2)}ms`:Me.includes("timestamp")||Me.includes("at")?fe=Ne(ee)??ee.toString():fe=r(ee)}else fe=String(ee);return(0,v.jsx)(D,{label:I,value:fe,color:m.teal},I)})]},"index-meta"))}if(P){if(de.push((0,v.jsxs)("div",{className:`${ce} ${F.purple} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.purple}`,children:["\u{1F522} ",i.statsCalculationsHeading]}),(0,v.jsx)(D,{label:i.statTotalCalculations,value:r(R.totalCalculations??0),color:m.purple}),(0,v.jsx)(D,{label:i.statDistanceCalculations,value:r(R.totalDistanceCalculations??0),color:m.purple}),(0,v.jsx)(D,{label:i.statAverageDistance,value:typeof R.averageDistance=="number"?R.averageDistance.toFixed(2):"0.00",color:m.purple}),(0,v.jsx)(D,{label:i.statMinDistance,value:R.minDistance??i.notAvailable,color:m.purple}),(0,v.jsx)(D,{label:i.statMaxDistance,value:R.maxDistance??0,color:m.purple})]},"lev-basic")),de.push((0,v.jsxs)("div",{className:`${ce} ${F.fuchsia} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.fuchsia}`,children:["\u{1F3AF} ",i.statsMatchesHeading]}),(0,v.jsx)(D,{label:i.statPartialMatches,value:r(R.partialMatches??0),color:m.fuchsia}),(0,v.jsx)(D,{label:i.statPerfectMatches,value:r(R.perfectMatches??0),color:m.fuchsia}),(0,v.jsx)(D,{label:i.statEarlyTerminations,value:r(R.earlyTerminations??0),color:m.fuchsia})]},"lev-match")),R.similarityThresholds&&de.push((0,v.jsxs)("div",{className:`${ce} ${F.rose} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.rose}`,children:["\u{1F4C8} ",i.statsSimilarityHeading]}),(0,v.jsx)(D,{label:i.statAbove80,value:r(R.similarityThresholds.above80??0),color:m.emerald}),(0,v.jsx)(D,{label:i.statAbove60,value:r(R.similarityThresholds.above60??0),color:m.lime}),(0,v.jsx)(D,{label:i.statAbove40,value:r(R.similarityThresholds.above40??0),color:m.orange}),(0,v.jsx)(D,{label:i.statBelow40,value:r(R.similarityThresholds.below40??0),color:m.red})]},"lev-similarity")),R.distanceDistribution){let z=Object.entries(R.distanceDistribution).sort(([,I],[,ee])=>Number(ee)-Number(I)).slice(0,6);z.length>0&&de.push((0,v.jsxs)("div",{className:`${ce} ${F.indigo} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.indigo}`,children:["\u{1F4CA} ",i.statsDistanceHeading]}),z.map(([I,ee])=>(0,v.jsx)(D,{label:i.statDistance(I),value:r(Number(ee)),unit:i.timesUnit(r(Number(ee))),color:m.indigo},I))]},"lev-distance"))}if(R.queryLengthStats){let z=Object.entries(R.queryLengthStats).sort(([,I],[,ee])=>(ee.count??0)-(I.count??0)).slice(0,6);z.length>0&&de.push((0,v.jsxs)("div",{className:`${ce} ${F.violet} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.violet}`,children:["\u{1F4CF} ",i.statsQueryLengthHeading]}),z.map(([I,ee])=>{let fe=Number(ee.count??0),Me=Number(ee.averageScore??0);return(0,v.jsx)(D,{label:i.statQueryLength(I),value:i.statQueryLengthValue({count:fe,averagePercent:(Me*100).toFixed(1)}),color:m.violet},I)})]},"lev-query-length"))}}if(Object.keys(E).length>0){let z=Object.entries(E).sort(([,I],[,ee])=>(ee.averageScore??0)-(I.averageScore??0)).slice(0,6);de.push((0,v.jsxs)("div",{className:`${ce} ${F.purple} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.purple}`,children:["\u{1F4CB} ",i.statsFieldPerformanceHeading]}),z.map(([I,ee])=>{let fe=ee;return(0,v.jsxs)("div",{className:`space-y-1 rounded ${re.purple} p-2 transition-colors`,children:[(0,v.jsx)("div",{className:`font-semibold ${m.purple} text-xs transition-colors`,children:I}),(0,v.jsx)(D,{label:i.statAverageScore,value:`${((fe.averageScore??0)*100).toFixed(1)}%`,color:m.purple}),(0,v.jsx)(D,{label:i.statMatchCount,value:r(fe.matchCount??0),unit:i.itemsUnit(r(fe.matchCount??0)),color:m.purple}),(0,v.jsx)(D,{label:i.statBestWorstScore,value:`${((fe.bestScore??0)*100).toFixed(1)}% / ${((fe.worstScore??0)*100).toFixed(1)}%`,color:m.purple})]},I)})]},"field-performance"))}if(L.bestPerformingField||L.totalHistoryEntries||L.similarityDistribution){let z=(L.recentAverageResultCount??0).toFixed(1);de.push((0,v.jsxs)("div",{className:`${ce} ${F.blue} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.blue}`,children:["\u{1F50D} ",i.statsInsightsHeading]}),L.bestPerformingField&&(0,v.jsx)(D,{label:i.statBestField,value:L.bestPerformingField,color:m.blue}),(0,v.jsx)(D,{label:i.statRecentAverageTime,value:(L.recentAverageProcessingTime??0).toFixed(2),unit:"ms",color:m.blue}),(0,v.jsx)(D,{label:i.statRecentAverageResults,value:z,unit:i.itemsUnit(z),color:m.blue}),(0,v.jsx)(D,{label:i.statThroughput,value:(L.throughputPerSecond??0).toFixed(2),unit:i.throughputUnit,color:m.blue}),(0,v.jsx)(D,{label:i.statCommonQueryLength,value:r(L.mostCommonQueryLength??0),unit:i.charactersUnit(r(L.mostCommonQueryLength??0)),color:m.blue}),(0,v.jsx)(D,{label:i.statHistoryEntries,value:r(L.totalHistoryEntries??0),color:m.blue}),L.similarityDistribution&&(0,v.jsxs)("div",{className:"mt-1 grid grid-cols-2 gap-1",children:[(0,v.jsx)(D,{label:i.statHighSimilarity,value:r(L.similarityDistribution.highSimilarity??0),color:m.emerald}),(0,v.jsx)(D,{label:i.statMediumSimilarity,value:r(L.similarityDistribution.mediumSimilarity??0),color:m.lime}),(0,v.jsx)(D,{label:i.statLowSimilarity,value:r(L.similarityDistribution.lowSimilarity??0),color:m.orange}),(0,v.jsx)(D,{label:i.statVeryLowSimilarity,value:r(L.similarityDistribution.veryLowSimilarity??0),color:m.red})]})]},"performance-insights"))}return Q.length>0&&de.push((0,v.jsxs)("div",{className:`${ce} ${F.sky} border-l-4`,children:[(0,v.jsxs)("div",{className:`${j} ${m.sky}`,children:["\u{1F4C8} ",i.statsRecentHistoryHeading]}),Q.slice(-3).reverse().map((z,I)=>(0,v.jsxs)("div",{className:`rounded ${re.sky} p-2 transition-colors`,children:[(0,v.jsx)("div",{className:`font-medium ${m.sky} transition-colors`,children:z.operationType}),(0,v.jsx)("div",{className:`${m.sky} text-xs transition-colors`,children:i.statsHistoryEntry({processingTimeMs:z.processingTime.toFixed(2),resultCount:z.resultCount??0})}),Ne(z.timestamp)&&(0,v.jsx)("div",{className:`${_} ${m.sky} transition-colors`,children:Ne(z.timestamp)})]},`${z.operationType}-${z.timestamp??I}`))]},"recent-history")),(0,v.jsxs)("section",{className:"space-y-2",children:[(0,v.jsxs)("div",{className:`flex items-center gap-2 font-semibold text-xs ${a}`,children:[(0,v.jsx)("span",{children:t}),(0,v.jsx)("span",{className:"tracking-wide",children:K})]}),(0,v.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:de})]})});en.displayName="WorkerStatsSection";var ue=require("react/jsx-runtime"),vl={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Dr=(0,Or.memo)(({performanceMetrics:e,searchTerm:t,totalDataCount:n,resultsCount:a,resetStats:o,rebuildIndex:i,isIndexBuilding:r,activeTab:u,onTabChange:d})=>{let{locale:c,labels:f}=He(),p=t.trim(),l=p?a:n,{setScrollableRef:g,onPointerDown:b,onPointerMove:T,onPointerUp:E,onPointerLeave:L,onPointerCancel:Q,onClickCapture:X}=vt(),y=u!=="index"||r,h=r?f.statsRebuildingTitle:u!=="index"?f.statsRebuildIndexTabOnlyTitle:f.statsRebuildTitle,x=y?`cursor-not-allowed ${k.muted} ${s.fgMuted}`:`${we.blue} ${s.onPrimary} ${Gt.blue}`,P=r?`\u23F3 ${f.statsRebuilding}`:`\u{1F3D7}\uFE0F ${f.statsRebuild}`,K=(0,Or.useCallback)(()=>{i().catch(()=>{})},[i]);return(0,ue.jsxs)("div",{className:`wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border ${F.blue} ${k.surface} p-1.5 shadow-md transition-colors`,children:[(0,ue.jsxs)("div",{className:`mb-0.5 flex shrink-0 flex-col gap-1 rounded ${re.blue} px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between`,children:[(0,ue.jsxs)("h3",{className:`font-semibold ${s.fgSecondary} text-xs transition-colors`,children:["\u{1F4CA} ",f.searchStatistics]}),(0,ue.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,ue.jsx)("button",{type:"button",onClick:K,disabled:y,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${x}`,title:h,children:P}),(0,ue.jsxs)("button",{type:"button",onClick:o,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded ${we.red} px-1.5 ${N} ${s.onPrimary} transition-colors ${Gt.red}`,title:f.statsResetTitle,children:["\u{1F504} ",f.reset]})]})]}),(0,ue.jsx)("div",{className:"mb-0 shrink-0",children:(0,ue.jsxs)("div",{ref:g,role:"tablist","aria-label":f.statsTabsLabel,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-md ${k.muted} p-0.5 transition-colors`,style:vl,onPointerDown:b,onPointerMove:T,onPointerUp:E,onPointerLeave:L,onPointerCancel:Q,onClickCapture:X,children:[(0,ue.jsxs)("button",{type:"button",role:"tab","aria-selected":u==="overview",onClick:()=>d("overview"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${u==="overview"?`${we.blue} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u{1F4CB} ",f.statsOverviewTab]}),(0,ue.jsxs)("button",{type:"button",role:"tab","aria-selected":u==="index",onClick:()=>d("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${u==="index"?`${we.green} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u{1F4CA} ",f.statsIndexTab]}),(0,ue.jsxs)("button",{type:"button",role:"tab","aria-selected":u==="levenshtein",onClick:()=>d("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${N} transition-colors ${u==="levenshtein"?`${we.purple} ${s.onPrimary}`:`${s.fgMuted} ${w.hoverSurface}`}`,children:["\u{1F4CF} ",f.statsLevenshteinTab]})]})}),(0,ue.jsxs)("div",{className:"flex flex-col gap-1 pb-0.5",children:[(0,ue.jsxs)("div",{className:`${u==="overview"?"grid":"hidden"} grid-cols-1 gap-2 pr-1 ${s.fgMuted} text-xs transition-colors sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4`,children:[(0,ue.jsx)(D,{label:f.statTotalSearches,value:se(c,e.totalSearches)}),(0,ue.jsx)(D,{label:f.statAverageSearchTime,value:e.averageSearchTime.toFixed(1),unit:"ms"}),(0,ue.jsx)(D,{label:f.statDataCount,value:se(c,e.itemCount)}),(0,ue.jsx)(D,{label:p?f.statResultCount:f.statDisplayedCount,value:se(c,l)})]}),(0,ue.jsx)("div",{className:`${u==="index"?"space-y-3":"hidden"} pr-1 ${s.fgMuted} text-xs transition-colors`,children:(0,ue.jsx)(en,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:m.green})}),(0,ue.jsx)("div",{className:`${u==="levenshtein"?"space-y-3":"hidden"} pr-1 ${s.fgMuted} text-xs transition-colors`,children:(0,ue.jsx)(en,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:m.purple})}),(0,ue.jsxs)("div",{className:"hidden",children:[(0,ue.jsx)(en,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:m.green}),(0,ue.jsx)(en,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:m.purple})]})]})]})});Dr.displayName="StatisticsPanel";var V=require("react/jsx-runtime"),xl=/[\u200B\uFEFF]/g,ka=typeof window<"u",Pi=ka&&typeof document<"u",Wr=(e,t=[],n=!1)=>{let a=(0,G.useRef)(e);a.current=e,(0,G.useEffect)(()=>{if(!(!ka||n&&!Pi))return a.current()},[n,...t])},Mi=(e,t,n)=>{let[a,o]=(0,G.useState)(()=>{let i=Ei(r=>r.getItem(e));return i&&t.includes(i)?i:n});return Wr(()=>{Ei(i=>{i.setItem(e,a)})},[e,a]),[a,o]},Ei=e=>{if(!ka)return null;try{return e(window.sessionStorage)}catch{return null}},Li=(e,t)=>{let[n,a]=(0,G.useState)(e);return(0,G.useEffect)(()=>{let o=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(o)}},[e,t]),n},Tl="contact-map.settings-tab",Nl="contact-map.statistics-tab",Ml=["basic","advanced","index","levenshtein"],El=["overview","index","levenshtein"],ki=["full_name","company_name","department","title","email","company_phone_number","mobile_phone_number"],Ll={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},wa=({streamState:e,...t}={})=>e===void 0?(0,V.jsx)(kl,{...t}):(0,V.jsx)(_i,{...t,streamState:e}),kl=e=>{let{context:t}=In();return(0,V.jsx)(_i,{...e,streamState:t})},wl={setting:"ContactMapSearchPage workerUrls",keys:["indexWorker","levenshteinWorker"],hints:{treeWorker:"set treeWorker on ContactMapConfigProvider or ContactMapAppView"}},_i=e=>{let{streamState:t,onFooterVisibilityChange:n,children:a}=e,o=$e(e,"workerUrls"),i=mt(),{locale:r,labels:u}=He(),{contactMapRecords:d,contactMapRecordMap:c,isStreamingComplete:f,isStreamingFailed:p}=t,l=(0,Fr.useNavigation)(),[g]=(0,Fr.useSearchParams)(),b=(0,G.useRef)(null),[T,E]=(0,G.useState)(!0),[L,Q]=(0,G.useState)(i.openEmailsWithGmail??!1),{indexWorker:X,levenshteinWorker:y}=Xt(i.workerUrls,o,wl),[h,x]=(0,G.useState)(()=>Nr({indexWorker:X,levenshteinWorker:y})),[P,K]=(0,G.useState)(g.get("q")||""),S=Li(P,h.debounceMs??Hr.DEFAULT_FUZZY_SEARCH_OPTIONS.debounceMs);(0,G.useEffect)(()=>{let J=g.get("q")||"";K(oe=>oe!==J?J:oe)},[g]),(0,G.useEffect)(()=>{if(typeof window>"u")return;let J=new URL(window.location.href);(J.searchParams.get("q")||"")!==S&&(S?J.searchParams.set("q",S):J.searchParams.delete("q"),window.history.replaceState(window.history.state,"",J.toString()))},[S]);let[R,ce]=(0,G.useTransition)(),[j,Ne]=(0,G.useState)("search"),[de,z]=Mi(Tl,Ml,"basic"),[I,ee]=Mi(Nl,El,"overview"),{setScrollableRef:fe,onPointerDown:Me,onPointerMove:Ie,onPointerUp:Ft,onPointerLeave:tn,onPointerCancel:Et,onClickCapture:nn}=vt(),Ee=(0,G.useCallback)(()=>{if(!Pi)return;let J=b.current;!J||document.activeElement===J||window.requestAnimationFrame(()=>{try{J.focus({preventScroll:!0})}catch{}})},[]),rn=(0,G.useCallback)(J=>{let oe=J;Ne(oe),oe==="search"&&Ee()},[Ee]),Qe=(0,G.useMemo)(()=>({...h,debounceMs:0}),[h]),[ft,Je]=(0,G.useState)("union"),qe=ft==="intersection",an=qe?u.operatorAndTitle:u.operatorOrTitle,Lt=(0,G.useCallback)(J=>(0,Hr.parseQuerySets)(J,ft),[ft]),te=(0,G.useMemo)(()=>({querySetsOf:Lt}),[Lt]),ye=Li(d,f?0:800),{searchTerm:ae,setSearchTerm:gt,filteredItems:It,resultTerm:Mn,isSearching:kt,isIndexBuilding:Be,clearSearch:En,resetStats:Ln,performanceMetrics:at,rebuildIndex:wt,error:ot}=(0,wi.useFuzzySearch)(ye,ki,Qe,te),Bt=ae.trim().length>0,[Rt,zt]=(0,G.useState)(""),[on,Ur]=(0,G.useState)(()=>ae),Pt=(0,G.useMemo)(()=>fr(P),[P]),Ze=(0,G.useMemo)(()=>fr(S),[S]);(0,G.useEffect)(()=>{S===Rt&&Ze===ae||ce(()=>{zt(S),gt(Ze)})},[S,Rt,Ze,ae,gt]);let kn=(0,G.useCallback)(J=>{let ke=J.target.value.replace(xl,"");K(ke)},[]),Vr=(0,G.useCallback)(()=>{K(""),zt(""),En(),Ee()},[En,Ee]),Yn=(0,G.useCallback)(()=>{Je(J=>J==="intersection"?"union":"intersection"),Ee()},[Ee]);Wr(()=>{if(!(j==="search"&&l.state==="idle"&&!R))return;let oe=document.activeElement;if(!!!(oe?.matches('[role="tab"]')||oe?.closest('[role="tablist"]')?.getAttribute("role")==="tablist")&&oe&&oe!==document.body&&oe!==b.current)return;let it=window.requestAnimationFrame(()=>{Ee()});return()=>{window.cancelAnimationFrame(it)}},[j,l.state,R,Ee],!0),Wr(()=>{if(j!=="search")return;let J=[[document,"visibilitychange",()=>{document.visibilityState==="visible"&&Ee()}],[window,"pageshow",()=>{Ee()}]];for(let[oe,ke,it]of J)oe.addEventListener(ke,it);return()=>{for(let[oe,ke,it]of J)oe.removeEventListener(ke,it)}},[j,Ee],!0),(0,G.useEffect)(()=>(n&&n(j==="search"?"mobile-hidden":"visible"),()=>{n&&n("visible")}),[j,n]),Wr(()=>{let J=document.body,oe=J.style.overflow;return j==="search"&&(J.style.overflow="hidden"),()=>{J.style.overflow=oe}},[j],!0),(0,G.useEffect)(()=>{at&&ut.info("\u{1F4CA} [STATE] \u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6307\u6A19\u304C\u66F4\u65B0\u3055\u308C\u307E\u3057\u305F:",{totalSearches:at.totalSearches,averageSearchTime:at.averageSearchTime,itemCount:at.itemCount,resultsCount:at.resultsCount,workersAvailable:!!at.workerStats})},[at]);let{isAwaitingDebounce:Xn,isAwaitingSearchTermSync:Qn,isSearchInProgress:ht}=(0,G.useMemo)(()=>{let J=Pt!==Ze,oe=Ze!==ae,ke=ae.trim().length>0||Pt.trim().length>0;return{isAwaitingDebounce:J,isAwaitingSearchTermSync:oe,isSearchInProgress:R||kt||Mn!==ae&&ot===null||ke&&Be||J||oe||on!==ae}},[Pt,Ze,ae,Mn,ot,R,kt,Be,on]),[sn,Jn]=(0,G.useState)(ae);(0,G.useEffect)(()=>{sn!==ae&&Jn(ae)},[ae,sn]),(0,G.useEffect)(()=>{Xn||Qn||R||kt||Be||sn===ae&&on!==ae&&Ur(ae)},[ae,on,Xn,Qn,R,kt,Be,sn]);let wn=(0,G.useMemo)(()=>so(Rt,ki),[Rt]),Zn=(0,G.useMemo)(()=>wn(It),[wn,It]),er=(0,G.useMemo)(()=>({contactMapRecords:d,contactMapRecordMap:c,filteredItems:Zn,searchQuery:Rt,searchTerm:ae,isSearching:kt,isIndexBuilding:Be,isPending:R,hasSearchTerm:Bt,enableHighlighting:T,openEmailsWithGmail:L,isSearchInProgress:ht,isSearchTabActive:j==="search",errorMessage:ot??null,isStreamingComplete:f,isStreamingFailed:p}),[d,c,Zn,Rt,ae,kt,Be,R,Bt,T,L,ht,j,ot,f,p]),Kr=Bt?It.length:d.length,Rn=se(r,d.length),B=se(r,It.length),ge=`${`scrollbar-hidden ${k.subtle} ${s.fg}`}${j==="search"?" h-full min-h-0":""}`;return(0,V.jsx)("div",{"data-contact-map-search-page":"",className:ge,children:(0,V.jsxs)(Wn,{value:j,onValueChange:rn,className:`flex flex-col${j==="search"?" h-full min-h-0":""}`,children:[(0,V.jsxs)(bn,{ref:fe,"data-contact-map-page-tabs":"",style:Ll,className:`scrollbar-none mt-0 mb-1 flex h-auto w-full touch-pan-x flex-nowrap overflow-x-auto overflow-y-hidden rounded-md ${k.subtle} transition-colors ${s.fgSecondary}`,onPointerDown:Me,onPointerMove:Ie,onPointerUp:Ft,onPointerLeave:tn,onPointerCancel:Et,onClickCapture:nn,children:[(0,V.jsxs)(Wt,{value:"search",className:`min-h-11 min-w-16 px-2 py-0 ${N} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u{1F50D} ",u.searchTab]}),(0,V.jsxs)(Wt,{value:"settings",className:`min-h-11 min-w-16 px-2 py-0 ${N} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u2699\uFE0F ",u.searchSettings]}),(0,V.jsxs)(Wt,{value:"statistics",className:`min-h-11 min-w-16 px-2 py-0 ${N} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u{1F4CA} ",u.searchStatistics]})]}),(0,V.jsx)(Ht,{value:"search",className:"mt-0 flex h-full min-h-0 flex-col overflow-hidden",children:(0,V.jsxs)("div",{className:"flex h-full flex-col",children:[(0,V.jsx)("div",{className:`rounded-md border ${q.borderSubtle} ${k.surface} shadow-sm transition-colors`,children:(0,V.jsxs)("div",{className:"flex flex-col",children:[(0,V.jsx)("div",{className:"relative",children:(0,V.jsxs)("div",{className:"flex items-center gap-1 p-1",children:[(0,V.jsxs)("button",{type:"button",onClick:Yn,"aria-pressed":qe,title:an,className:`inline-flex min-h-11 min-w-11 items-center justify-center gap-0.5 rounded border px-1.5 font-semibold ${N} transition-colors sm:min-w-12 sm:px-2 ${qe?`border-transparent ${we.blue} ${s.onPrimary} ${Gt.blue}`:`${Ua.amber} ${re.amber} ${m.amber} ${w.hoverSurface}`}`,children:[(0,V.jsx)("span",{children:qe?u.operatorAnd:u.operatorOr}),(0,V.jsx)("span",{className:`hidden ${_} sm:inline`,children:qe?u.operatorAndHint:u.operatorOrHint})]}),(0,V.jsx)("input",{ref:b,"data-contact-map-search-field":"",type:"text",value:P,onChange:kn,placeholder:u.searchPlaceholder,className:`min-h-11 flex-1 rounded border ${q.borderControl} border-solid px-2 pointer-coarse:text-base ${N} shadow-sm transition-colors ${w.focusBorder} focus:ring-1 ${w.focusRing} ${k.surface} ${s.fg}`}),P&&(0,V.jsx)("button",{type:"button",onClick:Vr,className:`flex min-h-11 min-w-11 items-center justify-center gap-1 rounded border ${q.borderControl} px-1.5 ${N} transition-colors ${w.hoverFg} sm:px-2 ${s.fgMuted}`,title:ht?u.searchBusyTitle:u.clearSearch,"aria-label":ht?void 0:u.clearSearch,disabled:ht,children:ht?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Ri.default,{"aria-hidden":"true",className:"h-3 w-3 animate-spin sm:h-3.5 sm:w-3.5"}),(0,V.jsx)("span",{className:"hidden sm:inline",children:u.searching})]}):"\u2715"})]})}),(0,V.jsxs)("p",{className:`px-1.5 py-0.5 ${_} ${s.fgSecondary} transition-colors`,children:[u.registeredCountLabel," ",(0,V.jsx)("span",{className:`font-semibold ${N} ${s.fg}`,children:Rn})," ",u.recordUnit(Rn),Be?(0,V.jsxs)("span",{className:`ml-1.5 inline-flex items-center rounded ${re.blue} px-1.5 py-0.2 ${m.blue}`,children:["\u23F3 ",u.rebuildingIndex]}):null,ot?(0,V.jsxs)("span",{className:`ml-1.5 inline-flex items-center rounded ${re.rose} px-1.5 py-0.2 ${m.rose}`,children:["\u26A0\uFE0F ",u.errorLabel,(0,V.jsx)("span",{className:"ml-1 break-all font-semibold",children:ot})]}):null,Bt&&(0,V.jsxs)("span",{className:`ml-1.5 ${m.blue}`,children:["| ",u.resultCountLabel,ht?(0,V.jsx)("span",{className:"ml-1 font-semibold",children:u.searching}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)("span",{className:`ml-1 font-semibold ${N} ${s.fg}`,children:B}),(0,V.jsx)("span",{className:"ml-0.5",children:u.resultUnit(B)})]})]})]}),(0,V.jsx)("div",{className:"h-2.5 px-2 pb-1.5",children:Be?(0,V.jsx)(pa,{className:`h-1 ${At.progressTrack}`,indicatorClassName:tt.blue}):null})]})}),a?a(er):(0,V.jsx)(Ma,{context:er})]})}),(0,V.jsx)(Ht,{value:"settings",className:"mt-0",children:(0,V.jsx)(Ar,{searchOptions:h,setSearchOptions:x,enableHighlighting:T,setEnableHighlighting:E,openEmailsWithGmail:L,setOpenEmailsWithGmail:Q,activeTab:de,onTabChange:z})}),(0,V.jsx)(Ht,{value:"statistics",className:"mt-0",children:(0,V.jsx)(Dr,{performanceMetrics:at,searchTerm:ae,totalDataCount:d.length,resultsCount:Kr,resetStats:Ln,rebuildIndex:wt,isIndexBuilding:Be,activeTab:I,onTabChange:ee})})]})})};var Ir=require("react");he();var qn=require("react/jsx-runtime"),Rl=(e,t,n)=>{switch(e){case"retrying":return{phase:e,status:n.annotationReconnecting(t),alert:""};case"failed":return{phase:e,status:"",alert:n.streamLoadFailed(t)};case"unauthenticated":case"forbidden":return{phase:e,status:"",alert:""};case"idle":case"streaming":case"complete":return{phase:e,status:"",alert:""}}},Br=(0,Ir.memo)(({phase:e,loadedCount:t})=>{let n=ne(),[a,o]=(0,Ir.useState)(()=>({phase:e,status:"",alert:""})),i=a.phase===e?a:Rl(e,t,n);return i!==a&&o(i),(0,qn.jsxs)("span",{"data-testid":"contact-map-stream-announcer",className:"sr-only",children:[(0,qn.jsx)("span",{role:"status",children:i.status}),(0,qn.jsx)("span",{role:"alert",children:i.alert})]})});Br.displayName="ContactMapStreamAnnouncer";var We=require("react");he();var Pl="[data-contact-map-search-page]",_l=["[data-contact-map-search-field]",'[data-contact-map-page-tabs] [role="tab"][aria-selected="true"]'],Ai=e=>{for(let t=e;t!==null;t=t.parentElement){let n=t.querySelector(Pl);if(n!==null)return n}return null},$i=e=>{let{ownerDocument:t}=e,{activeElement:n}=t;if(n!==null&&n!==t.body)return null;for(let a of _l){let o=e.querySelector(a);if(o!==null&&(o.focus(),t.activeElement===o))return o}return null};pe();fn();Pe();var pt=require("react/jsx-runtime"),Oi="shrink-0 pb-2",Al=`flex items-center gap-2 rounded-md border ${F.rose} ${re.rose} px-[11px] py-[3px] ${m.rose} ${N}`,$l=`inline-flex min-h-11 min-w-11 shrink-0 items-center justify-center rounded border ${q.borderControl} ${k.surface} px-[11px] font-semibold ${m.rose} ${N} transition-colors ${w.hoverRoseTint} ${dt}`,Ol=e=>e==="failed"||vr(e),Di=(e,t)=>{(0,We.useLayoutEffect)(()=>{let n=e.current;return()=>{n?.contains(n.ownerDocument.activeElement)&&(t.current=Ai(n))}},[e,t])},Dl=({loadedCount:e,errorMessage:t,onRetry:n,leftWithFocusRef:a})=>{let o=ne(),i=(0,We.useId)(),r=(0,We.useRef)(null);return Di(r,a),(0,pt.jsx)("div",{className:Oi,children:(0,pt.jsxs)("div",{ref:r,role:"group","aria-labelledby":i,"data-testid":"contact-map-stream-failure-notice","data-phase":"failed",className:Al,children:[(0,pt.jsx)("span",{"aria-hidden":"true",children:"\u26D4"}),(0,pt.jsx)("span",{id:i,className:"min-w-0 flex-1 font-medium",title:t??void 0,children:o.streamLoadFailed(e)}),(0,pt.jsx)("button",{type:"button","data-testid":"contact-map-retry-button","aria-describedby":i,onClick:n,className:$l,children:o.streamRetry})]})})},Wl=(e,t)=>Object.freeze({kind:e,place:"read",deniedSentence:null,retry:t}),Hl=({kind:e,onRetry:t,accessFailure:n,leftWithFocusRef:a})=>{let o=(0,We.useRef)(null),i=(0,We.useRef)(t);(0,We.useLayoutEffect)(()=>{i.current=t});let[r]=(0,We.useState)(()=>Wl(e,()=>i.current()));return Di(o,a),(0,pt.jsx)("div",{ref:o,"data-testid":"contact-map-stream-access-failure","data-phase":e,className:Oi,children:n(r)})},zr=(0,We.memo)(({phase:e,accessFailureNumber:t,loadedCount:n,errorMessage:a,onRetry:o,accessFailure:i})=>{xr(i,"ContactMapStreamFailureNotice accessFailure"),Eo(t,"ContactMapStreamFailureNotice accessFailureNumber");let r=(0,We.useRef)(null);return(0,We.useLayoutEffect)(()=>{let u=r.current;u!==null&&(r.current=null,$i(u))}),Ol(e)?e==="failed"?(0,pt.jsx)(Dl,{loadedCount:n,errorMessage:a,onRetry:o,leftWithFocusRef:r}):(0,pt.jsx)(Hl,{kind:e,onRetry:o,accessFailure:i,leftWithFocusRef:r},t):null});zr.displayName="ContactMapStreamFailureNotice";var Xe=require("react/jsx-runtime"),Fl=({accessFailure:e,renderHeader:t,title:n,onFooterVisibilityChange:a})=>{let o=ne(),i=n===void 0?o.appTitle:n,{context:r,retryNow:u}=In(),d=(0,Xe.jsx)(Cr,{recordCount:r.contactMapRecords.length,companyCount:r.companyCount,phase:r.streamPhase,loadedCount:r.loadedCount,totalCount:r.totalCount});return(0,Xe.jsxs)("div",{"data-testid":"contact-map-app-view",className:"flex h-full w-full flex-col",children:[(0,Xe.jsx)(Br,{phase:r.streamPhase,loadedCount:r.loadedCount}),t?t({title:i,annotation:d}):(0,Xe.jsxs)("div",{"data-testid":"contact-map-default-header",className:"mb-2 flex items-center justify-between",children:[(0,Xe.jsx)("h1",{className:"font-bold text-xl",children:i}),d]}),(0,Xe.jsx)(zr,{phase:r.streamPhase,accessFailureNumber:r.streamAccessFailureNumber,loadedCount:r.loadedCount,errorMessage:r.errorMessage,onRetry:u,accessFailure:e}),(0,Xe.jsx)("div",{className:"min-h-0 flex-1",children:(0,Xe.jsx)(wa,{streamState:r,onFooterVisibilityChange:a})})]})},Il=e=>{let t=$e(e,"accessFailure");xr(t,"ContactMapAppView accessFailure");let n=mt(),a=$e(e,"streamEndpoint"),o=$e(e,"workerUrls"),i=$e(e,"locale"),r=$e(e,"labels"),u=(0,Ra.useMemo)(()=>({...n,streamEndpoint:a===void 0?n.streamEndpoint:a,workerUrls:Xt(n.workerUrls,o,{setting:"ContactMapAppView workerUrls"}),locale:i===void 0?n.locale:i,labels:r===void 0?n.labels:r}),[n,a,o,i,r]),d=i!==void 0,c=r!==void 0,f=(0,Ra.useMemo)(()=>({locale:d?"ContactMapAppView locale":"locale",labels:c?"ContactMapAppView labels":"labels"}),[d,c]);return(0,Xe.jsx)(ua,{config:u,chromeSurface:f,children:(0,Xe.jsx)(Fl,{...e,accessFailure:t})})};jt();he();var Wi=require("@aiquants/route-revalidation");var Bl=(0,Wi.createShouldRevalidate)({submissions:"url",query:{ignore:[Cn,"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,ContactMapStreamAnnouncer,ContactMapStreamClient,ContactMapStreamFailureNotice,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});
|