import{a as h,g,i as C,aH as x,H as A,j as r,_ as H,f as p,bG as b}from"./main-634.js";import{j as T}from"./bf-25-81.js";import{F as s}from"./bf-767-388.js";import{t as S}from"./bf-676-386.js";import{S as $}from"./bf-982-242.js";import"./bf-638-271.js";import"./bf-247-269.js";import"./bf-497-246.js";import"./bf-641-107.js";import"./bf-400-72.js";import"./bf-438-114.js";const j=[{label:"Off",value:"off",type:"general"},{label:"On",value:"on"},{title:"Name",type:"group",childs:[{label:"Name",value:"name"},{label:"honorific-prefix",value:"honorific-prefix"},{label:"Give name",value:"given-name"},{label:"Additional name",value:"additional-name"},{label:"Family name",value:"family-name"},{label:"Honorific suffix",value:"honorific-suffix"},{label:"Nickname",value:"nickname"}]},{label:"Email",value:"email"},{label:"Username",value:"username"},{label:"New password",value:"new-password"},{label:"Current password",value:"current-password"},{label:"One time code",value:"one-time-code"},{label:"Organization title",value:"organization-title"},{label:"Organization",value:"organization"},{label:"Street address",value:"street-address"},{label:"Address line 1",value:"address-line1"},{label:"Country",value:"country"},{label:"Country name",value:"country-name"},{label:"Postal code",value:"postal-code"},{label:"Cc name",value:"cc-name"},{label:"Cc given name",value:"cc-given-name"},{label:"Cc additional name",value:"cc-additional-name"},{label:"Cc family name",value:"cc-family-name"},{label:"Cc number",value:"cc-number"},{label:"Cc exp",value:"cc-exp"},{label:"Cc exp month",value:"cc-exp-month"},{label:"Cc exp yeat",value:"cc-exp-year"},{label:"Cc cse",value:"cc-csc"},{label:"Cca type",value:"cc-type"},{label:"Transaction currency",value:"transaction-currency"},{label:"Transaction account",value:"transaction-amount"},{label:"Language",value:"language"},{title:"Birth Date",type:"group",childs:[{label:"Birth day",value:"bday"},{label:"Bday day",value:"bday-day"},{label:"Bday month",value:"bday-month"},{label:"Bday Year",value:"bday-year"}]},{label:"Sex",value:"sex"},{title:"Telephone",type:"group",childs:[{label:"Telephone",value:"tel"},{label:"Tel national",value:"tel-national"},{label:"Tel Counrty code",value:"tel-country-code"},{label:"Tel Area code",value:"tel-area-code"},{label:"Tel local",value:"tel-local"}]},{label:"Tel extension",value:"tel-extension"},{label:"Impp",value:"impp"},{label:"URL",value:"url"},{label:"Photo",value:"photo"}];var w=j;function G(){const{css:c}=h(),{fieldKey:o}=g(),[u,d]=C(x);if(!o)return null;const e=A(u[o]),m=e.adminLbl||"",v=e!=null&&e.ac?e.ac.trim().split(","):["Off"],f=t=>{const l=t.split(",");let a="";if(l.length===1)a=t;else{const n=l.length-1;l[n]==="on"?a="on":l[n]==="off"?a="off":l.includes("on")?(l.splice(l.indexOf("on"),1),a=l.join(",")):l.includes("off")?(l.splice(l.indexOf("off"),1),a=l.join(",")):a=t}a?e.ac=a:delete e.ac;const i=p(u,n=>{n[o]=e});d(i),b({event:`Auto Complete updated ${a}: ${e.lbl||m||o}`,type:`change_autoComplete_${t}`,state:{fields:i,fldKey:o}})},y=({target:{checked:t}})=>{t?e.acHide=!0:delete e.acHide;const l=t?"on":"off",a=p(u,i=>{i[o]=e});d(a),b({event:`Auto Complete ${l}: ${e.lbl||m||o}`,type:`change_autoComplete_${l}`,state:{fields:a,fldKey:o}})};return r.jsx($,{id:"ato-cmplt",title:H("Auto Complete"),className:c(s.fieldSection,s.hover_tip),switching:!0,tip:S.autoComplete,tipProps:{width:250,icnSize:17},toggleAction:y,toggleChecked:e==null?void 0:e.acHide,open:e==null?void 0:e.acHide,disable:!e.acHide,children:r.jsx("div",{className:c(s.placeholder),children:r.jsx(T,{"data-testid":"ato-cmplt-slct",defaultValue:v,className:`${c(s.multiselectInput)} `,placeholder:"Select one",options:w,onChange:t=>f(t),disableChip:!0})})})}export{G as default};
