@simai-studio/ui 5.20261022.1534 → 5.20261022.1814

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (()=>{"use strict";var t={e138a730fd7c(t,e,n){n.d(e,{U:()=>i,h:()=>s});let a=0;const r=new WeakMap;function s(t,{prefix:e="sf-field",required:n=!1,invalid:s=!1,hint:i="",errorMessage:o=""}={}){const l=function(t,e){if(t&&r.has(t))return r.get(t);const n=(t?.id?String(t.id).trim():"")||`${e}-${++a}`,s={controlId:`${n}-control`,messageId:`${n}-message`};return!t||"object"!=typeof t&&"function"!=typeof t||r.set(t,s),s}(t,e),u=Boolean(s),d=u&&o?o:i;return{...l,required:Boolean(n),invalid:u,message:d,describedBy:d?l.messageId:"",errorMessageId:u&&o?l.messageId:""}}function i(t,e,{prefix:n="sf-field",required:a=!1,invalid:r=!1,messageNode:i=null,labelNode:o=null,errorMessage:l=""}={}){if(!t||!e)return null;const u=s(t,{prefix:n,required:a,invalid:r,hint:i?.textContent?.trim()||"",errorMessage:l});var d,c;return e.id||(e.id=u.controlId),"LABEL"!==t.tagName||t.hasAttribute("for")||t.setAttribute("for",e.id),!o?.textContent?.trim()||e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")||(o.id||(o.id=`${e.id}-label`),e.setAttribute("aria-labelledby",o.id)),e.required=u.required,t.classList.toggle("error",u.invalid),e.classList.toggle("error",u.invalid),u.invalid?e.setAttribute("aria-invalid","true"):e.removeAttribute("aria-invalid"),i&&(i.id||(i.id=u.messageId),e.setAttribute("aria-describedby",(d=e.getAttribute("aria-describedby"),c=[i.id],[...new Set([...String(d||"").split(/\s+/).filter(Boolean),...c.filter(Boolean)])].join(" ")))),u.errorMessageId&&i?e.setAttribute("aria-errormessage",i.id):e.removeAttribute("aria-errormessage"),u}},"98e26702f55a"(t,e,n){function a(){const t=globalThis.SF=globalThis.SF||{};return t.__deprecationNotes instanceof Map||Object.defineProperty(t,"__deprecationNotes",{value:new Map,configurable:!0}),t.__deprecationNotes}function r({component:t="",kind:e="attribute",attribute:n="",from:r,to:s=null}={}){if(!r)return;const i=[t,e,n,r].join("|"),o=a(),l=o.get(i);if(l)l.count+=1;else if(o.set(i,{component:t,kind:e,attribute:n,from:r,to:s,count:1}),function(){const t=globalThis.document?.documentElement;return"warn"===t?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const a=t?`${t}: `:"",i="value"===e?`${n}="${r}"`:`${e} ${r}`;globalThis.console?.warn?.(`[SIMAI Framework] ${a}${i} is a legacy name${s?`; write ${s}`:""}. See contracts/changes/journal.json.`)}}if(n.d(e,{id:()=>l,vl:()=>u}),"undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const t=globalThis.SF.deprecations||{};t.list=function(){return[...a().values()].map(t=>({...t}))},t.clear=function(){a().clear()},t.note=r,globalThis.SF.deprecations=t}const s=Object.freeze(["1/2","1","2"]),i=Object.freeze({"1/3":"1/2",3:"2"}),o=new Set;function l(t,e="field",n="1"){const a=String(t??"").trim().toLowerCase();if(s.includes(a))return a;if(Object.hasOwn(i,a)){const t=i[a];r({component:e,kind:"value",attribute:"size",from:a,to:t});const n=`${e}:${a}`;return o.has(n)||"undefined"==typeof console||(o.add(n),console.warn(`[SIMAI Framework] ${e}: size ${a} is retired for form fields; rendering size ${t}.`)),t}return n}function u(t,e){if(t?.classList)for(const[n,a]of Object.entries(i)){const a=`${e}--size-${n}`;t.classList.contains(a)&&t.classList.replace(a,`${e}--size-${l(n,e)}`)}}},f8ed4bd5aa8a(t,e,n){n.d(e,{m3:()=>k,Lu:()=>L});class a{lifecycleName(){return this.componentName??this.constructor.componentName}constructor(t){this.props=t,this.id=t?.id,this.params=t?.param,this.attrs=t?.attrs||{},this.template=null,window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:beforeRender`,{detail:this}))}getUtilityMap(){return this.constructor.utilityMap||null}extractUtilityClasses(t){if(!Array.isArray(t))return[];const e=new Set;return t.forEach(t=>{if("string"!=typeof t)return;const n=t.match(/\(([^)]+)\)/g);n&&n.forEach(t=>{t.slice(1,-1).split(/\s+/).filter(Boolean).forEach(t=>{t.startsWith(".")&&t.length>1&&e.add(t.slice(1))})})}),Array.from(e)}applyLayoutUtilities(t,e){if(!t||!e)return;const n=this.getUtilityMap();if(!n||!n[e])return;this.extractUtilityClasses(n[e]).forEach(e=>t.classList.add(e))}render(){return this.html=this.template,"function"==typeof this.init&&this.init(),this.html&&window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:render`,{detail:this})),this.html}destroy(){this.destroyInternal?.(),this.props=null,this.id=null,this.params=null,this.template=null,this.html&&(this.html.remove(),this.html=null),window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:destroy`,{detail:this}))}destroyInternal(){}}const r=function(t,e){if(t&&e)if("undefined"==typeof window||"function"!=typeof window.registerSfComponent){if("undefined"!=typeof window&&window.SF?.Loader?.registerComponent)window.SF.Loader.registerComponent(t,e);else if("undefined"!=typeof window){(window.SF_PENDING_COMPONENTS=window.SF_PENDING_COMPONENTS||[]).push([t,e])}}else window.registerSfComponent(t,e)},s=JSON.parse('{".sf-input":["display/flex (.flex)","flex-direction/column (.flex-col)","flex-wrap/nowrap (.flex-nowrap)","gap/var(--sf-space-1\\\\/4)","justify-content/flex-start (.justify-start)"],".sf-input .sf-input-field":["display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"],".sf-input .sf-input-label":["display/flex (.flex)","flex-direction/row (.flex-row)","align-items/flex-start (.items-start)"],".sf-input .sf-input-field input":["flex/1 (.flex-1)"],".sf-input .sf-input-field .sf-icon":["display/flex (.flex)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"],".sf-input .sf-input-text-container":["flex/1 (.flex-1)","display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"],".sf-input .sf-input-group":["display/flex (.flex)","flex-direction/column (.flex-col)","flex-wrap/nowrap (.flex-nowrap)","justify-content/center (.justify-center)","align-items/flex-start (.items-start)"],".sf-input .sf-input-text-container-alt":["display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","justify-content/center (.justify-center)","align-items/center (.items-center)"],".sf-input .sf-icon-alt":["display/flex (.flex)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"],".sf-input .sf-input-hint-text-wrap":["flex/1 (.flex-1)","display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","gap/var(--sf-b0)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"]}');var i=n("e138a730fd7c"),o=n("98e26702f55a");const l=new WeakMap,u=new WeakSet;let d=null;const c="label.sf-input",p="sfInputBound",f=new Set(["text","email","password","search","tel","url"]),h=new Set(["","none","text","tel","url","email","numeric","decimal","search"]),m=new Set(["bordered","filled","hidden"]);function g(t){if(""===t||null==t)return null;const e=Number(t);return Number.isInteger(e)&&e>=0?e:null}function b(t,e=!1){return null==t||""===t?e:"boolean"==typeof t?t:["1","true","yes","on"].includes(String(t).toLowerCase())}function y(t){return t?.querySelector?.(".sf-input-field input, input")||null}function w(t){return t?.querySelector?.(".sf-input-hint-text-wrap")||null}function x(t){const e=w(t);return{messageNode:e,errorMessage:"error"===e?.dataset.fieldMessage&&e.textContent?.trim()||""}}function S(t){if(!t||"string"!=typeof t)return null;const e=t.trim();if(!e)return null;try{const t=JSON.parse(e);return t&&"object"==typeof t?t:null}catch{return null}}function v(t,e,n){const a={...t},r=n.dataset.maskLazy??e.dataset.maskLazy,s=n.dataset.maskPlaceholderChar??e.dataset.maskPlaceholderChar;return void 0!==r&&""!==r&&(a.lazy=b(r,!0)),void 0!==s&&""!==s&&(a.placeholderChar=String(s)),a}async function $(t,e){const n=function(t,e){if(!b(e.dataset.mask??t.dataset.mask,!1))return null;const n=S(e.dataset.maskOptions),a=S(t.dataset.maskOptions);if(n)return v(n,t,e);if(a)return v(a,t,e);const r=e.dataset.maskPattern??t.dataset.maskPattern;return r?v({mask:String(r)},t,e):null}(t,e);if(!n)return;const a={};t.__sfInputMaskRequest=a;try{const r=await function(){const t=()=>window.SF?.Mask?.create?window.SF.Mask:null,e=t();return e?Promise.resolve(e):d||(d=new Promise(e=>{const n=[[window,"sf-mask-ready"],[window,"sf-loader-ready"],[window,"load"],[document,"DOMContentLoaded"]],a=()=>{const r=t();r&&(n.forEach(([t,e])=>t.removeEventListener(e,a)),d=null,e(r))};n.forEach(([t,e])=>t.addEventListener(e,a))}),d)}();if(t.__sfInputMaskRequest!==a)return;const s=await r.create(e,n);if(!s)return;if("1"!==t.dataset[p]||t.__sfInputMaskRequest!==a||y(t)!==e)return void r.destroy(s);t.__sfInputMask=s}catch(t){console.warn("SF.Input mask init failed",t)}}function k(t){if((0,o.vl)(t,"sf-input"),!t||"1"===t.dataset[p])return;const e=y(t);if(!e)return;const n=()=>{},a=()=>t.classList.add("sf-input--pointer-focus"),r=()=>t.classList.remove("sf-input--pointer-focus");e.addEventListener("input",n),e.addEventListener("pointerdown",a),e.addEventListener("blur",r),t.__sfInputNoopHandler=n,t.__sfInputPointerFocusHandler=a,t.__sfInputBlurHandler=r,t.dataset[p]="1";const s=x(t);(0,i.U)(t,e,{prefix:"sf-input",labelNode:t.querySelector(".sf-input-text"),required:e.required||Boolean(t.querySelector(".sf-input-required")),invalid:t.classList.contains("error")||e.classList.contains("error"),...s}),t.__sfInputReleaseReset=function(t,e){const n=t.ownerDocument;u.has(n)||(n.addEventListener("reset",t=>{const e=t.target;if("FORM"!==e?.tagName)return;const n=Array.from(e.elements);setTimeout(()=>{if(!t.defaultPrevented)for(const t of n)if(t.isConnected&&t.form===e)for(const e of l.get(t)||[])e()},0)},!0),u.add(n));let a=l.get(t);return a||l.set(t,a=new Set),a.add(e),()=>a.delete(e)}(e,()=>{t.__sfInputMask&&(t.__sfInputMask.value=e.value)}),$(t,e)}function L(t){if(!t||"1"!==t.dataset[p])return;delete t.__sfInputMaskRequest;const e=y(t);e&&t.__sfInputNoopHandler&&e.removeEventListener("input",t.__sfInputNoopHandler),e&&t.__sfInputPointerFocusHandler&&e.removeEventListener("pointerdown",t.__sfInputPointerFocusHandler),e&&t.__sfInputBlurHandler&&e.removeEventListener("blur",t.__sfInputBlurHandler),t.__sfInputMask&&window.SF?.Mask?.destroy?.(t.__sfInputMask),t.__sfInputReleaseReset?.(),delete t.__sfInputReleaseReset,delete t.__sfInputMask,delete t.__sfInputNoopHandler,delete t.__sfInputPointerFocusHandler,delete t.__sfInputBlurHandler,t.classList.remove("sf-input--pointer-focus"),delete t.dataset[p]}function _(t=document){t.querySelectorAll(c).forEach(k)}class I extends a{static componentName="Inputs";html=null;constructor(t){super(t);const{size:e="1",type:n="bordered",label:a="",required:r=!1,placeholder:s="",inputType:i="text",autocomplete:l="",inputMode:u="",minLength:d="",maxLength:c="",pattern:p="",hint:y="",value:w="",name:x="",leftIcon:S="",rightText:v="",hintIcon:$="",disabled:k=!1,readonly:L=!1,error:_=!1,invalid:I=!1,errorMessage:E="",mask:C=!1,maskPattern:A="",maskLazy:M="",maskPlaceholderChar:P="",maskOptions:q=""}=this.params||{},O=this.attrs.class||this.attrs.className,j=(0,o.id)(e,"sf-input"),F=function(t,e,n){const a=String(t||n);return e.has(a)?a:n}(n,m,"bordered");this.template=document.createElement("label"),this.id&&(this.template.id=this.id),this.template.classList.add("sf-input",`sf-input--size-${j}`,`sf-input--${F}`),this.template.classList.toggle("error",b(I||_,!1)),this.template.dataset.mask=String(b(C,!1)),this.template.dataset.maskPattern=String(A||""),this.template.dataset.maskLazy=String(M??""),this.template.dataset.maskPlaceholderChar=String(P||""),this.template.dataset.maskOptions=String(q||""),O&&this.template.classList.add(...`${O}`.split(" ").filter(Boolean));const T=document.createElement("span");T.classList.add("sf-input-label");const N=document.createElement("span");if(N.classList.add("sf-input-text"),N.textContent=a,T.append(N),b(r,!0)){const t=document.createElement("span");t.classList.add("sf-input-required"),t.textContent="*",T.append(t)}const z=document.createElement("span");if(z.classList.add("sf-input-field"),S){const t=document.createElement("i");t.classList.add("sf-icon"),t.textContent=String(S),z.append(t)}const B=document.createElement("input");B.type=function(t){const e=String(t||"text").toLowerCase();return f.has(e)?e:"text"}(i),B.placeholder=String(s??""),l&&(B.autocomplete=String(l)),B.inputMode=function(t){const e=String(t||"").toLowerCase();return h.has(e)?e:""}(u);const R=g(d),H=g(c);if(null!==R&&(B.minLength=R),null!==H&&(B.maxLength=H),p&&(B.pattern=String(p)),B.value=String(w??""),B.defaultValue=String(w??""),x&&(B.name=String(x)),B.disabled=b(k,!1),B.readOnly=b(L,!1),B.required=b(r,!0),B.dataset.mask=String(b(C,!1)),B.dataset.maskPattern=String(A||""),B.dataset.maskLazy=String(M??""),B.dataset.maskPlaceholderChar=String(P||""),B.dataset.maskOptions=String(q||""),B.classList.toggle("error",b(I||_,!1)),z.append(B),v){const t=document.createElement("span");t.classList.add("sf-input-right"),t.textContent=String(v),z.append(t)}if($){const t=document.createElement("i");t.classList.add("sf-icon","sf-icon-hint"),t.textContent=String($),z.append(t)}this.template.append(T,z);const U=b(I||_,!1)&&E?E:y;if(U){const t=document.createElement("span");t.classList.add("sf-input-hint-text-wrap"),t.textContent=String(U),t.dataset.fieldMessage=b(I||_,!1)&&E?"error":"hint",this.template.append(t)}this.applyLayoutUtilities(this.template,".sf-input"),this.applyLayoutUtilities(T,".sf-input .sf-input-label"),this.applyLayoutUtilities(z,".sf-input .sf-input-field"),this.applyLayoutUtilities(B,".sf-input .sf-input-field input")}init(){k(this.template)}destroyInternal(){L(this.template)}}I.utilityMap=s,r("Inputs",I),"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.Input=window.SF.Input||{},window.SF.Input.setState=function(t,e={}){const n=t instanceof HTMLElement?t.closest(c)||t:null;if(!n)return!1;const a=y(n);if(!a)return!1;if(Object.prototype.hasOwnProperty.call(e,"disabled")&&(a.disabled=b(e.disabled)),Object.prototype.hasOwnProperty.call(e,"error")){const t=b(e.error);n.classList.toggle("error",t),a.classList.toggle("error",t)}if(Object.prototype.hasOwnProperty.call(e,"invalid")){const t=b(e.invalid);n.classList.toggle("error",t),a.classList.toggle("error",t)}if(Object.prototype.hasOwnProperty.call(e,"errorMessage")){const t=String(e.errorMessage??""),r=t?function(t){const e=w(t);if(e)return e;const n=document.createElement("span");return n.classList.add("sf-input-hint-text-wrap"),t.append(n),n}(n):w(n);if(r){r.textContent=t;const e=n.classList.contains("error")||a.classList.contains("error");r.dataset.fieldMessage=t&&e?"error":"hint"}}return Object.prototype.hasOwnProperty.call(e,"value")&&(a.value=String(e.value??""),a.dispatchEvent(new Event("input",{bubbles:!0}))),(0,i.U)(n,a,{prefix:"sf-input",labelNode:n.querySelector(".sf-input-text"),required:a.required||Boolean(n.querySelector(".sf-input-required")),invalid:n.classList.contains("error")||a.classList.contains("error"),...x(n)}),!0}),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>_()):_();new MutationObserver(t=>{t.forEach(t=>{t.addedNodes.forEach(t=>{t instanceof Element&&(t.matches?.(c)&&k(t),_(t))})})}).observe(document.documentElement,{childList:!0,subtree:!0})},"44b791419862"(t,e,n){n.a(t,async(t,e)=>{try{var a=n("f8ed4bd5aa8a"),r=n("fbe0570fcc69"),s=n("98e26702f55a"),i=n("e602dd4d6e16"),o=t([r,i]);[r,i]=o.then?(await o)():o;var l=n.n(r);const u=new Set(["text","email","password","search","tel","url"]),d=new Set(["","none","text","tel","url","email","numeric","decimal","search"]),c=(new Set(["bordered","filled","hidden"]),(t,e,n)=>e.has(t)?t:n);class p extends(l()){static get props(){return{size:{default:"1"},appearance:{default:"bordered",values:["bordered","filled","hidden"],aliases:["type"]},label:{default:""},required:{type:Boolean,default:!1},placeholder:{default:""},inputType:{default:"text"},autocomplete:{default:""},inputmode:{default:""},minlength:{default:""},maxlength:{default:""},pattern:{default:""},hint:{default:""},value:{default:""},defaultValue:{default:""},name:{default:""},iconStart:{type:String,default:null},textEnd:{type:String,default:null},leftIcon:{default:""},rightText:{default:""},hintIcon:{default:""},rootClass:{default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},invalid:{type:Boolean,default:!1},errorMessage:{default:""},mask:{type:Boolean,default:!1},maskPattern:{default:""},maskLazy:{default:""},maskPlaceholderChar:{default:""},maskOptions:{default:""},ariaLabel:{attribute:"aria-label",default:""}}}constructor(){super(),this._boundRoot=null}get size(){return(0,s.id)(this.getAttribute("size")||"1","sf-input")}get appearance(){return this.getProp("appearance")}get type(){return this.appearance}get label(){return this.getAttribute("label")||""}get required(){return this.getBooleanAttr("required",!1)}get placeholder(){return this.getAttribute("placeholder")||""}get inputType(){return c(this.getAttribute("input-type")||"text",u,"text")}get autocomplete(){return this.getAttribute("autocomplete")||""}get inputmode(){return c(this.getAttribute("inputmode")||"",d,"")}get minlength(){return this.getAttribute("minlength")||""}get maxlength(){return this.getAttribute("maxlength")||""}get pattern(){return this.getAttribute("pattern")||""}get hint(){return this.getAttribute("hint")||""}get value(){const t=this.getInputElement();return t?t.value:this.getAttribute("value")||""}set value(t){const e=this.getInputElement(),n=String(t??"");null==t?this.removeAttribute("value"):this.setAttribute("value",n);const a=this.querySelector(".sf-input")?.__sfInputMask;a?a.value=n:e&&e.value!==n&&(e.value=n)}get defaultValue(){return this.getAttribute("default-value")??this.getAttribute("value")??""}set defaultValue(t){null!=t?this.setAttribute("default-value",String(t)):this.removeAttribute("default-value")}get name(){return this.getAttribute("name")||""}get leftIcon(){return this.getAttribute("icon-start")??this.getAttribute("left-icon")??""}get rightText(){return this.getAttribute("text-end")??this.getAttribute("right-text")??""}get iconStart(){return this.leftIcon}get textEnd(){return this.rightText}get hintIcon(){return this.getAttribute("hint-icon")||""}get disabled(){return this.getBooleanAttr("disabled",!1)}get readonly(){return this.getBooleanAttr("readonly",!1)}get error(){return this.getBooleanAttr("error",!1)}get invalid(){return this.getBooleanAttr("invalid",!1)}get errorMessage(){return this.getAttribute("error-message")||""}get mask(){return this.getBooleanAttr("mask",!1)}get maskPattern(){return this.getAttribute("mask-pattern")||""}get maskLazy(){return this.hasAttribute("mask-lazy")?this.getBooleanAttr("mask-lazy",!0):""}get maskPlaceholderChar(){return this.getAttribute("mask-placeholder-char")||""}get maskOptions(){return this.getAttribute("mask-options")||""}get ariaLabel(){return this.getProp("ariaLabel")||""}templateContext(){const t=this.getPropsContext(),e=this.hasAttribute("value"),n=this.getInputElement();return this.createTemplateContext({...t,leftIcon:t.iconStart??t.leftIcon,rightText:t.textEnd??t.rightText,iconStart:this.iconStart,textEnd:this.textEnd,type:this.type,maskLazy:this.maskLazy,value:e?t.value:n?n.value:this.defaultValue,defaultValue:this.defaultValue,hasControlledValue:e,component:this})}onDisconnected(){this._boundRoot&&((0,a.Lu)(this._boundRoot),this._boundRoot=null)}afterRender(){this._boundRoot&&((0,a.Lu)(this._boundRoot),this._boundRoot=null),this._boundRoot=this.querySelector(".sf-input"),this._boundRoot&&(0,a.m3)(this._boundRoot)}getInputElement(){return this.querySelector(".sf-input-field input, input")}template(){return(0,i.P)(this.templateContext())}get state(){const t=this.querySelector(".sf-input"),e=this.getInputElement();return{value:e?.value||"",disabled:!!e?.disabled,invalid:"true"===e?.getAttribute("aria-invalid"),error:t?.classList?.contains("error")||e?.classList?.contains("error")||!1}}onInput(t,e){return"function"==typeof t&&this.addEventListener("input",t,e),this}onChange(t,e){return"function"==typeof t&&this.addEventListener("change",t,e),this}onKeyUp(t,e){return"function"==typeof t&&this.addEventListener("keyup",t,e),this}onKeyDown(t,e){return"function"==typeof t&&this.addEventListener("keydown",t,e),this}onFocus(t,e){return"function"==typeof t&&this.addEventListener("focusin",t,e),this}onBlur(t,e){return"function"==typeof t&&this.addEventListener("focusout",t,e),this}}p.define("sf-input"),e()}catch(t){e(t)}})},e602dd4d6e16(t,e,n){n.a(t,async(t,a)=>{try{n.d(e,{P:()=>l});var r=n("ddf1cdb42ecc"),s=n("e138a730fd7c"),i=t([r]),o=i.then?(await i)():i;r=o[0];function l(t){const{size:e,appearance:n,type:a,label:i,required:o,placeholder:l,inputType:u,autocomplete:d,inputmode:c,minlength:p,maxlength:f,pattern:h,hint:m,value:g,defaultValue:b,hasControlledValue:y,name:w,leftIcon:x,rightText:S,hintIcon:v,disabled:$,error:k,invalid:L,errorMessage:_,mask:I,rootClass:E,rootStyle:C,readonly:A,maskPattern:M,maskLazy:P,maskPlaceholderChar:q,maskOptions:O,ariaLabel:j}=t,F=""===P?"":String(P),T=y?g:b,N=(0,s.h)(t.component,{prefix:"sf-input",required:o,invalid:L||k,hint:m,errorMessage:_}),z=["sf-input",N.invalid?"error":"",`sf-input--size-${e}`,`sf-input--${n??a}`,E,"flex","flex-col"];if("hidden"===a)return r.html`<input
1
+ (()=>{"use strict";var t={e138a730fd7c(t,e,n){n.d(e,{U:()=>i,h:()=>s});let a=0;const r=new WeakMap;function s(t,{prefix:e="sf-field",required:n=!1,invalid:s=!1,hint:i="",errorMessage:o=""}={}){const l=function(t,e){if(t&&r.has(t))return r.get(t);const n=(t?.id?String(t.id).trim():"")||`${e}-${++a}`,s={controlId:`${n}-control`,messageId:`${n}-message`};return!t||"object"!=typeof t&&"function"!=typeof t||r.set(t,s),s}(t,e),u=Boolean(s),d=u&&o?o:i;return{...l,required:Boolean(n),invalid:u,message:d,describedBy:d?l.messageId:"",errorMessageId:u&&o?l.messageId:""}}function i(t,e,{prefix:n="sf-field",required:a=!1,invalid:r=!1,messageNode:i=null,labelNode:o=null,errorMessage:l=""}={}){if(!t||!e)return null;const u=s(t,{prefix:n,required:a,invalid:r,hint:i?.textContent?.trim()||"",errorMessage:l});var d,c;return e.id||(e.id=u.controlId),"LABEL"!==t.tagName||t.hasAttribute("for")||t.setAttribute("for",e.id),!o?.textContent?.trim()||e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")||(o.id||(o.id=`${e.id}-label`),e.setAttribute("aria-labelledby",o.id)),e.required=u.required,t.classList.toggle("error",u.invalid),e.classList.toggle("error",u.invalid),u.invalid?e.setAttribute("aria-invalid","true"):e.removeAttribute("aria-invalid"),i&&(i.id||(i.id=u.messageId),e.setAttribute("aria-describedby",(d=e.getAttribute("aria-describedby"),c=[i.id],[...new Set([...String(d||"").split(/\s+/).filter(Boolean),...c.filter(Boolean)])].join(" ")))),u.errorMessageId&&i?e.setAttribute("aria-errormessage",i.id):e.removeAttribute("aria-errormessage"),u}},"98e26702f55a"(t,e,n){function a(){const t=globalThis.SF=globalThis.SF||{};return t.__deprecationNotes instanceof Map||Object.defineProperty(t,"__deprecationNotes",{value:new Map,configurable:!0}),t.__deprecationNotes}function r({component:t="",kind:e="attribute",attribute:n="",from:r,to:s=null}={}){if(!r)return;const i=[t,e,n,r].join("|"),o=a(),l=o.get(i);if(l)l.count+=1;else if(o.set(i,{component:t,kind:e,attribute:n,from:r,to:s,count:1}),function(){const t=globalThis.document?.documentElement;return"warn"===t?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const a=t?`${t}: `:"",i="value"===e?`${n}="${r}"`:`${e} ${r}`;globalThis.console?.warn?.(`[SIMAI Framework] ${a}${i} is a legacy name${s?`; write ${s}`:""}. See contracts/changes/journal.json.`)}}if(n.d(e,{id:()=>l,vl:()=>u}),"undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const t=globalThis.SF.deprecations||{};t.list=function(){return[...a().values()].map(t=>({...t}))},t.clear=function(){a().clear()},t.note=r,globalThis.SF.deprecations=t}const s=Object.freeze(["1/2","1","2"]),i=Object.freeze({"1/3":"1/2",3:"2"}),o=new Set;function l(t,e="field",n="1"){const a=String(t??"").trim().toLowerCase();if(s.includes(a))return a;if(Object.hasOwn(i,a)){const t=i[a];r({component:e,kind:"value",attribute:"size",from:a,to:t});const n=`${e}:${a}`;return o.has(n)||"undefined"==typeof console||(o.add(n),console.warn(`[SIMAI Framework] ${e}: size ${a} is retired for form fields; rendering size ${t}.`)),t}return n}function u(t,e){if(t?.classList)for(const[n,a]of Object.entries(i)){const a=`${e}--size-${n}`;t.classList.contains(a)&&t.classList.replace(a,`${e}--size-${l(n,e)}`)}}},f8ed4bd5aa8a(t,e,n){n.d(e,{m3:()=>k,Lu:()=>L});class a{lifecycleName(){return this.componentName??this.constructor.componentName}constructor(t){this.props=t,this.id=t?.id,this.params=t?.param,this.attrs=t?.attrs||{},this.template=null,window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:beforeRender`,{detail:this}))}getUtilityMap(){return this.constructor.utilityMap||null}extractUtilityClasses(t){if(!Array.isArray(t))return[];const e=new Set;return t.forEach(t=>{if("string"!=typeof t)return;const n=t.match(/\(([^)]+)\)/g);n&&n.forEach(t=>{t.slice(1,-1).split(/\s+/).filter(Boolean).forEach(t=>{t.startsWith(".")&&t.length>1&&e.add(t.slice(1))})})}),Array.from(e)}applyLayoutUtilities(t,e){if(!t||!e)return;const n=this.getUtilityMap();if(!n||!n[e])return;this.extractUtilityClasses(n[e]).forEach(e=>t.classList.add(e))}render(){return this.html=this.template,"function"==typeof this.init&&this.init(),this.html&&window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:render`,{detail:this})),this.html}destroy(){this.destroyInternal?.(),this.props=null,this.id=null,this.params=null,this.template=null,this.html&&(this.html.remove(),this.html=null),window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:destroy`,{detail:this}))}destroyInternal(){}}const r=function(t,e){if(t&&e)if("undefined"==typeof window||"function"!=typeof window.registerSfComponent){if("undefined"!=typeof window&&window.SF?.Loader?.registerComponent)window.SF.Loader.registerComponent(t,e);else if("undefined"!=typeof window){(window.SF_PENDING_COMPONENTS=window.SF_PENDING_COMPONENTS||[]).push([t,e])}}else window.registerSfComponent(t,e)},s=JSON.parse('{".sf-input":["display/flex (.flex)","flex-direction/column (.flex-col)","flex-wrap/nowrap (.flex-nowrap)","gap/var(--sf-space-1\\\\/4)","justify-content/flex-start (.justify-start)"],".sf-input .sf-input-field":["display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"],".sf-input .sf-input-label":["display/flex (.flex)","flex-direction/row (.flex-row)","align-items/flex-start (.items-start)"],".sf-input .sf-input-field input":["flex/1 (.flex-1)"],".sf-input .sf-input-field .sf-icon":["display/flex (.flex)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"],".sf-input .sf-input-text-container":["flex/1 (.flex-1)","display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"],".sf-input .sf-input-group":["display/flex (.flex)","flex-direction/column (.flex-col)","flex-wrap/nowrap (.flex-nowrap)","justify-content/center (.justify-center)","align-items/flex-start (.items-start)"],".sf-input .sf-input-text-container-alt":["display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","justify-content/center (.justify-center)","align-items/center (.items-center)"],".sf-input .sf-icon-alt":["display/flex (.flex)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"],".sf-input .sf-input-hint-text-wrap":["flex/1 (.flex-1)","display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","gap/var(--sf-b0)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"]}');var i=n("e138a730fd7c"),o=n("98e26702f55a");const l=new WeakMap,u=new WeakSet;let d=null;const c="label.sf-input",p="sfInputBound",f=new Set(["text","email","password","search","tel","url"]),h=new Set(["","none","text","tel","url","email","numeric","decimal","search"]),m=new Set(["bordered","filled","hidden"]);function g(t){if(""===t||null==t)return null;const e=Number(t);return Number.isInteger(e)&&e>=0?e:null}function b(t,e=!1){return null==t||""===t?e:"boolean"==typeof t?t:["1","true","yes","on"].includes(String(t).toLowerCase())}function y(t){return t?.querySelector?.(".sf-input-field input, input")||null}function w(t){return t?.querySelector?.(".sf-input-hint-text-wrap")||null}function x(t){const e=w(t);return{messageNode:e,errorMessage:"error"===e?.dataset.fieldMessage&&e.textContent?.trim()||""}}function v(t){if(!t||"string"!=typeof t)return null;const e=t.trim();if(!e)return null;try{const t=JSON.parse(e);return t&&"object"==typeof t?t:null}catch{return null}}function S(t,e,n){const a={...t},r=n.dataset.maskLazy??e.dataset.maskLazy,s=n.dataset.maskPlaceholderChar??e.dataset.maskPlaceholderChar;return void 0!==r&&""!==r&&(a.lazy=b(r,!0)),void 0!==s&&""!==s&&(a.placeholderChar=String(s)),a}async function $(t,e){const n=function(t,e){if(!b(e.dataset.mask??t.dataset.mask,!1))return null;const n=v(e.dataset.maskOptions),a=v(t.dataset.maskOptions);if(n)return S(n,t,e);if(a)return S(a,t,e);const r=e.dataset.maskPattern??t.dataset.maskPattern;return r?S({mask:String(r)},t,e):null}(t,e);if(!n)return;const a={};t.__sfInputMaskRequest=a;try{const r=await function(){const t=()=>window.SF?.Mask?.create?window.SF.Mask:null,e=t();return e?Promise.resolve(e):d||(d=new Promise(e=>{const n=[[window,"sf-mask-ready"],[window,"sf-loader-ready"],[window,"load"],[document,"DOMContentLoaded"]],a=()=>{const r=t();r&&(n.forEach(([t,e])=>t.removeEventListener(e,a)),d=null,e(r))};n.forEach(([t,e])=>t.addEventListener(e,a))}),d)}();if(t.__sfInputMaskRequest!==a)return;const s=await r.create(e,n);if(!s)return;if("1"!==t.dataset[p]||t.__sfInputMaskRequest!==a||y(t)!==e)return void r.destroy(s);t.__sfInputMask=s}catch(t){console.warn("SF.Input mask init failed",t)}}function k(t){if((0,o.vl)(t,"sf-input"),!t||"1"===t.dataset[p])return;const e=y(t);if(!e)return;const n=()=>{},a=()=>t.classList.add("sf-input--pointer-focus"),r=()=>t.classList.remove("sf-input--pointer-focus");e.addEventListener("input",n),e.addEventListener("pointerdown",a),e.addEventListener("blur",r),t.__sfInputNoopHandler=n,t.__sfInputPointerFocusHandler=a,t.__sfInputBlurHandler=r,t.dataset[p]="1";const s=x(t);(0,i.U)(t,e,{prefix:"sf-input",labelNode:t.querySelector(".sf-input-text"),required:e.required||Boolean(t.querySelector(".sf-input-required")),invalid:t.classList.contains("error")||e.classList.contains("error"),...s}),t.__sfInputReleaseReset=function(t,e){const n=t.ownerDocument;u.has(n)||(n.addEventListener("reset",t=>{const e=t.target;if("FORM"!==e?.tagName)return;const n=Array.from(e.elements);setTimeout(()=>{if(!t.defaultPrevented)for(const t of n)if(t.isConnected&&t.form===e)for(const e of l.get(t)||[])e()},0)},!0),u.add(n));let a=l.get(t);return a||l.set(t,a=new Set),a.add(e),()=>a.delete(e)}(e,()=>{t.__sfInputMask&&(t.__sfInputMask.value=e.value)}),$(t,e)}function L(t){if(!t||"1"!==t.dataset[p])return;delete t.__sfInputMaskRequest;const e=y(t);e&&t.__sfInputNoopHandler&&e.removeEventListener("input",t.__sfInputNoopHandler),e&&t.__sfInputPointerFocusHandler&&e.removeEventListener("pointerdown",t.__sfInputPointerFocusHandler),e&&t.__sfInputBlurHandler&&e.removeEventListener("blur",t.__sfInputBlurHandler),t.__sfInputMask&&window.SF?.Mask?.destroy?.(t.__sfInputMask),t.__sfInputReleaseReset?.(),delete t.__sfInputReleaseReset,delete t.__sfInputMask,delete t.__sfInputNoopHandler,delete t.__sfInputPointerFocusHandler,delete t.__sfInputBlurHandler,t.classList.remove("sf-input--pointer-focus"),delete t.dataset[p]}function _(t=document){t.querySelectorAll(c).forEach(k)}class I extends a{static componentName="Inputs";html=null;constructor(t){super(t);const{size:e="1",type:n="bordered",label:a="",required:r=!1,placeholder:s="",inputType:i="text",autocomplete:l="",inputMode:u="",minLength:d="",maxLength:c="",pattern:p="",hint:y="",value:w="",name:x="",leftIcon:v="",rightText:S="",hintIcon:$="",disabled:k=!1,readonly:L=!1,error:_=!1,invalid:I=!1,errorMessage:E="",mask:C=!1,maskPattern:A="",maskLazy:M="",maskPlaceholderChar:P="",maskOptions:q=""}=this.params||{},O=this.attrs.class||this.attrs.className,j=(0,o.id)(e,"sf-input"),F=function(t,e,n){const a=String(t||n);return e.has(a)?a:n}(n,m,"bordered");this.template=document.createElement("label"),this.id&&(this.template.id=this.id),this.template.classList.add("sf-input",`sf-input--size-${j}`,`sf-input--${F}`),this.template.classList.toggle("error",b(I||_,!1)),this.template.dataset.mask=String(b(C,!1)),this.template.dataset.maskPattern=String(A||""),this.template.dataset.maskLazy=String(M??""),this.template.dataset.maskPlaceholderChar=String(P||""),this.template.dataset.maskOptions=String(q||""),O&&this.template.classList.add(...`${O}`.split(" ").filter(Boolean));const T=document.createElement("span");T.classList.add("sf-input-label");const N=document.createElement("span");if(N.classList.add("sf-input-text"),N.textContent=a,T.append(N),b(r,!0)){const t=document.createElement("span");t.classList.add("sf-input-required"),t.textContent="*",T.append(t)}const z=document.createElement("span");if(z.classList.add("sf-input-field"),v){const t=document.createElement("i");t.classList.add("sf-icon"),t.textContent=String(v),z.append(t)}const B=document.createElement("input");B.type=function(t){const e=String(t||"text").toLowerCase();return f.has(e)?e:"text"}(i),B.placeholder=String(s??""),l&&(B.autocomplete=String(l)),B.inputMode=function(t){const e=String(t||"").toLowerCase();return h.has(e)?e:""}(u);const R=g(d),H=g(c);if(null!==R&&(B.minLength=R),null!==H&&(B.maxLength=H),p&&(B.pattern=String(p)),B.value=String(w??""),B.defaultValue=String(w??""),x&&(B.name=String(x)),B.disabled=b(k,!1),B.readOnly=b(L,!1),B.required=b(r,!0),B.dataset.mask=String(b(C,!1)),B.dataset.maskPattern=String(A||""),B.dataset.maskLazy=String(M??""),B.dataset.maskPlaceholderChar=String(P||""),B.dataset.maskOptions=String(q||""),B.classList.toggle("error",b(I||_,!1)),z.append(B),S){const t=document.createElement("span");t.classList.add("sf-input-right"),t.textContent=String(S),z.append(t)}if($){const t=document.createElement("i");t.classList.add("sf-icon","sf-icon-hint"),t.textContent=String($),z.append(t)}this.template.append(T,z);const U=b(I||_,!1)&&E?E:y;if(U){const t=document.createElement("span");t.classList.add("sf-input-hint-text-wrap"),t.textContent=String(U),t.dataset.fieldMessage=b(I||_,!1)&&E?"error":"hint",this.template.append(t)}this.applyLayoutUtilities(this.template,".sf-input"),this.applyLayoutUtilities(T,".sf-input .sf-input-label"),this.applyLayoutUtilities(z,".sf-input .sf-input-field"),this.applyLayoutUtilities(B,".sf-input .sf-input-field input")}init(){k(this.template)}destroyInternal(){L(this.template)}}I.utilityMap=s,r("Inputs",I),"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.Input=window.SF.Input||{},window.SF.Input.setState=function(t,e={}){const n=t instanceof HTMLElement?t.closest(c)||t:null;if(!n)return!1;const a=y(n);if(!a)return!1;if(Object.prototype.hasOwnProperty.call(e,"disabled")&&(a.disabled=b(e.disabled)),Object.prototype.hasOwnProperty.call(e,"error")){const t=b(e.error);n.classList.toggle("error",t),a.classList.toggle("error",t)}if(Object.prototype.hasOwnProperty.call(e,"invalid")){const t=b(e.invalid);n.classList.toggle("error",t),a.classList.toggle("error",t)}if(Object.prototype.hasOwnProperty.call(e,"errorMessage")){const t=String(e.errorMessage??""),r=t?function(t){const e=w(t);if(e)return e;const n=document.createElement("span");return n.classList.add("sf-input-hint-text-wrap"),t.append(n),n}(n):w(n);if(r){r.textContent=t;const e=n.classList.contains("error")||a.classList.contains("error");r.dataset.fieldMessage=t&&e?"error":"hint"}}return Object.prototype.hasOwnProperty.call(e,"value")&&(a.value=String(e.value??""),a.dispatchEvent(new Event("input",{bubbles:!0}))),(0,i.U)(n,a,{prefix:"sf-input",labelNode:n.querySelector(".sf-input-text"),required:a.required||Boolean(n.querySelector(".sf-input-required")),invalid:n.classList.contains("error")||a.classList.contains("error"),...x(n)}),!0}),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>_()):_();new MutationObserver(t=>{t.forEach(t=>{t.addedNodes.forEach(t=>{t instanceof Element&&(t.matches?.(c)&&k(t),_(t))})})}).observe(document.documentElement,{childList:!0,subtree:!0})},"44b791419862"(t,e,n){n.a(t,async(t,e)=>{try{var a=n("f8ed4bd5aa8a"),r=n("fbe0570fcc69"),s=n("98e26702f55a"),i=n("e602dd4d6e16"),o=t([r,i]);[r,i]=o.then?(await o)():o;var l=n.n(r);const u=new Set(["text","email","password","search","tel","url"]),d=new Set(["","none","text","tel","url","email","numeric","decimal","search"]),c=(new Set(["bordered","filled","hidden"]),(t,e,n)=>e.has(t)?t:n);class p extends(l()){static get props(){return{size:{default:"1"},appearance:{default:"bordered",values:["bordered","filled","hidden"],aliases:["type"]},label:{default:""},required:{type:Boolean,default:!1},placeholder:{default:""},inputType:{default:"text"},autocomplete:{default:""},inputmode:{default:""},minlength:{default:""},maxlength:{default:""},pattern:{default:""},hint:{default:""},value:{default:""},defaultValue:{default:""},name:{default:""},iconStart:{type:String,default:null},textEnd:{type:String,default:null},leftIcon:{default:""},rightText:{default:""},hintIcon:{default:""},rootClass:{default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},invalid:{type:Boolean,default:!1},errorMessage:{default:""},mask:{type:Boolean,default:!1},maskPattern:{default:""},maskLazy:{default:""},maskPlaceholderChar:{default:""},maskOptions:{default:""},ariaLabel:{attribute:"aria-label",default:""}}}constructor(){super(),this._boundRoot=null}get size(){return(0,s.id)(this.getAttribute("size")||"1","sf-input")}get appearance(){return this.getProp("appearance")}get type(){return this.appearance}get label(){return this.getAttribute("label")||""}get required(){return this.getBooleanAttr("required",!1)}get placeholder(){return this.getAttribute("placeholder")||""}get inputType(){return c(this.getAttribute("input-type")||"text",u,"text")}get autocomplete(){return this.getAttribute("autocomplete")||""}get inputmode(){return c(this.getAttribute("inputmode")||"",d,"")}get minlength(){return this.getAttribute("minlength")||""}get maxlength(){return this.getAttribute("maxlength")||""}get pattern(){return this.getAttribute("pattern")||""}get hint(){return this.getAttribute("hint")||""}get value(){const t=this.getInputElement();return t?t.value:this.getAttribute("value")||""}set value(t){const e=this.getInputElement(),n=String(t??"");null==t?this.removeAttribute("value"):this.setAttribute("value",n);const a=this.querySelector(".sf-input")?.__sfInputMask;a?a.value=n:e&&e.value!==n&&(e.value=n)}get defaultValue(){return this.getAttribute("default-value")??this.getAttribute("value")??""}set defaultValue(t){null!=t?this.setAttribute("default-value",String(t)):this.removeAttribute("default-value")}get name(){return this.getAttribute("name")||""}get leftIcon(){return this.getAttribute("icon-start")??this.getAttribute("left-icon")??""}get rightText(){return this.getAttribute("text-end")??this.getAttribute("right-text")??""}get iconStart(){return this.leftIcon}get textEnd(){return this.rightText}get hintIcon(){return this.getAttribute("hint-icon")||""}get disabled(){return this.getBooleanAttr("disabled",!1)}get readonly(){return this.getBooleanAttr("readonly",!1)}get error(){return this.getBooleanAttr("error",!1)}get invalid(){return this.getBooleanAttr("invalid",!1)}get errorMessage(){return this.getAttribute("error-message")||""}get mask(){return this.getBooleanAttr("mask",!1)}get maskPattern(){return this.getAttribute("mask-pattern")||""}get maskLazy(){return this.hasAttribute("mask-lazy")?this.getBooleanAttr("mask-lazy",!0):""}get maskPlaceholderChar(){return this.getAttribute("mask-placeholder-char")||""}get maskOptions(){return this.getAttribute("mask-options")||""}get ariaLabel(){return this.getProp("ariaLabel")||""}templateContext(){const t=this.getPropsContext(),e=this.hasAttribute("value"),n=this.getInputElement();return this.createTemplateContext({...t,leftIcon:t.iconStart??t.leftIcon,rightText:t.textEnd??t.rightText,iconStart:this.iconStart,textEnd:this.textEnd,type:this.type,maskLazy:this.maskLazy,value:e?t.value:n?n.value:this.defaultValue,defaultValue:this.defaultValue,hasControlledValue:e,component:this})}onDisconnected(){this._boundRoot&&((0,a.Lu)(this._boundRoot),this._boundRoot=null)}afterRender(){if(this._boundRoot&&((0,a.Lu)(this._boundRoot),this._boundRoot=null),this._boundRoot=this.querySelector(".sf-input"),this._boundRoot){const t=this.invalid||this.error;this._boundRoot.classList.toggle("error",t),this.getInputElement()?.classList.toggle("error",t),(0,a.m3)(this._boundRoot)}}getInputElement(){return this.querySelector(".sf-input-field input, input")}template(){return(0,i.P)(this.templateContext())}get state(){const t=this.querySelector(".sf-input"),e=this.getInputElement();return{value:e?.value||"",disabled:!!e?.disabled,invalid:"true"===e?.getAttribute("aria-invalid"),error:t?.classList?.contains("error")||e?.classList?.contains("error")||!1}}onInput(t,e){return"function"==typeof t&&this.addEventListener("input",t,e),this}onChange(t,e){return"function"==typeof t&&this.addEventListener("change",t,e),this}onKeyUp(t,e){return"function"==typeof t&&this.addEventListener("keyup",t,e),this}onKeyDown(t,e){return"function"==typeof t&&this.addEventListener("keydown",t,e),this}onFocus(t,e){return"function"==typeof t&&this.addEventListener("focusin",t,e),this}onBlur(t,e){return"function"==typeof t&&this.addEventListener("focusout",t,e),this}}p.define("sf-input"),e()}catch(t){e(t)}})},e602dd4d6e16(t,e,n){n.a(t,async(t,a)=>{try{n.d(e,{P:()=>l});var r=n("ddf1cdb42ecc"),s=n("e138a730fd7c"),i=t([r]),o=i.then?(await i)():i;r=o[0];function l(t){const{size:e,appearance:n,type:a,label:i,required:o,placeholder:l,inputType:u,autocomplete:d,inputmode:c,minlength:p,maxlength:f,pattern:h,hint:m,value:g,defaultValue:b,hasControlledValue:y,name:w,leftIcon:x,rightText:v,hintIcon:S,disabled:$,error:k,invalid:L,errorMessage:_,mask:I,rootClass:E,rootStyle:C,readonly:A,maskPattern:M,maskLazy:P,maskPlaceholderChar:q,maskOptions:O,ariaLabel:j}=t,F=""===P?"":String(P),T=y?g:b,N=(0,s.h)(t.component,{prefix:"sf-input",required:o,invalid:L||k,hint:m,errorMessage:_}),z=["sf-input",N.invalid?"error":"",`sf-input--size-${e}`,`sf-input--${n??a}`,E,"flex","flex-col"];if("hidden"===a)return r.html`<input
2
2
  style=${C||r.nothing}
3
3
  type="hidden"
4
4
  .value=${T}
@@ -14,8 +14,8 @@
14
14
  <span class="sf-input-text">${i}</span>
15
15
  ${o?r.html`<span class="sf-input-required">*</span>`:""}
16
16
  `:"",R=t.component?.hasSlotContent?.("start")?t.component.getSlotContent("start"):t.component?.hasSlotContent?.("left")?t.component.getSlotContent("left"):x?r.html`<span class="sf-input-left flex"><sf-icon icon="${x}"></sf-icon></span>`:"",H=t.component?.hasSlotContent?.("end")?t.component.getSlotContent("end"):t.component?.hasSlotContent?.("right")?t.component.getSlotContent("right"):r.html`
17
- ${S?r.html`<span class="sf-input-right"><span class="sf-input-text">${S}</span></span>`:""}
18
- ${v?r.html`<span class="sf-input-hint flex"><sf-icon icon="${v}"></sf-icon></span>`:""}
17
+ ${v?r.html`<span class="sf-input-right"><span class="sf-input-text">${v}</span></span>`:""}
18
+ ${S?r.html`<span class="sf-input-hint flex"><sf-icon icon="${S}"></sf-icon></span>`:""}
19
19
  `,U=t.component?.hasSlotContent?.("hint")?t.component.getSlotContent("hint"):m,V=t.component?.hasSlotContent?.("error")?t.component.getSlotContent("error"):_,D=N.invalid&&V?V:U,W=!B&&j?j:r.nothing;return r.html`
20
20
  <label
21
21
  class=${z.join(" ")}
@@ -502,7 +502,7 @@
502
502
  "source_artifacts": [
503
503
  {
504
504
  "path": "src/smart/inputs/index.js",
505
- "sha256": "2e5d356b7e2ccc5c4be5abc9893d87b61e3cf12e067cf766e135bfbe46271bfc"
505
+ "sha256": "e0dbd768559370ce100847309bec321cc12eaeeb14012833f90bcf0bf233fbf0"
506
506
  }
507
507
  ],
508
508
  "generated_runtime": [
@@ -1,4 +1,4 @@
1
- (()=>{"use strict";var e={e138a730fd7c(e,t,r){r.d(t,{U:()=>o,h:()=>s});let a=0;const n=new WeakMap;function s(e,{prefix:t="sf-field",required:r=!1,invalid:s=!1,hint:o="",errorMessage:i=""}={}){const l=function(e,t){if(e&&n.has(e))return n.get(e);const r=(e?.id?String(e.id).trim():"")||`${t}-${++a}`,s={controlId:`${r}-control`,messageId:`${r}-message`};return!e||"object"!=typeof e&&"function"!=typeof e||n.set(e,s),s}(e,t),u=Boolean(s),d=u&&i?i:o;return{...l,required:Boolean(r),invalid:u,message:d,describedBy:d?l.messageId:"",errorMessageId:u&&i?l.messageId:""}}function o(e,t,{prefix:r="sf-field",required:a=!1,invalid:n=!1,messageNode:o=null,labelNode:i=null,errorMessage:l=""}={}){if(!e||!t)return null;const u=s(e,{prefix:r,required:a,invalid:n,hint:o?.textContent?.trim()||"",errorMessage:l});var d,c;return t.id||(t.id=u.controlId),"LABEL"!==e.tagName||e.hasAttribute("for")||e.setAttribute("for",t.id),!i?.textContent?.trim()||t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby")||(i.id||(i.id=`${t.id}-label`),t.setAttribute("aria-labelledby",i.id)),t.required=u.required,e.classList.toggle("error",u.invalid),t.classList.toggle("error",u.invalid),u.invalid?t.setAttribute("aria-invalid","true"):t.removeAttribute("aria-invalid"),o&&(o.id||(o.id=u.messageId),t.setAttribute("aria-describedby",(d=t.getAttribute("aria-describedby"),c=[o.id],[...new Set([...String(d||"").split(/\s+/).filter(Boolean),...c.filter(Boolean)])].join(" ")))),u.errorMessageId&&o?t.setAttribute("aria-errormessage",o.id):t.removeAttribute("aria-errormessage"),u}},"98e26702f55a"(e,t,r){function a(){const e=globalThis.SF=globalThis.SF||{};return e.__deprecationNotes instanceof Map||Object.defineProperty(e,"__deprecationNotes",{value:new Map,configurable:!0}),e.__deprecationNotes}function n({component:e="",kind:t="attribute",attribute:r="",from:n,to:s=null}={}){if(!n)return;const o=[e,t,r,n].join("|"),i=a(),l=i.get(o);if(l)l.count+=1;else if(i.set(o,{component:e,kind:t,attribute:r,from:n,to:s,count:1}),function(){const e=globalThis.document?.documentElement;return"warn"===e?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const a=e?`${e}: `:"",o="value"===t?`${r}="${n}"`:`${t} ${n}`;globalThis.console?.warn?.(`[SIMAI Framework] ${a}${o} is a legacy name${s?`; write ${s}`:""}. See contracts/changes/journal.json.`)}}if(r.d(t,{id:()=>l,vl:()=>u}),"undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const e=globalThis.SF.deprecations||{};e.list=function(){return[...a().values()].map(e=>({...e}))},e.clear=function(){a().clear()},e.note=n,globalThis.SF.deprecations=e}const s=Object.freeze(["1/2","1","2"]),o=Object.freeze({"1/3":"1/2",3:"2"}),i=new Set;function l(e,t="field",r="1"){const a=String(e??"").trim().toLowerCase();if(s.includes(a))return a;if(Object.hasOwn(o,a)){const e=o[a];n({component:t,kind:"value",attribute:"size",from:a,to:e});const r=`${t}:${a}`;return i.has(r)||"undefined"==typeof console||(i.add(r),console.warn(`[SIMAI Framework] ${t}: size ${a} is retired for form fields; rendering size ${e}.`)),e}return r}function u(e,t){if(e?.classList)for(const[r,a]of Object.entries(o)){const a=`${t}--size-${r}`;e.classList.contains(a)&&e.classList.replace(a,`${t}--size-${l(r,t)}`)}}},"01398f3e8009"(e,t,r){r.d(t,{sd:()=>$,aJ:()=>A,TO:()=>M});class a{lifecycleName(){return this.componentName??this.constructor.componentName}constructor(e){this.props=e,this.id=e?.id,this.params=e?.param,this.attrs=e?.attrs||{},this.template=null,window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:beforeRender`,{detail:this}))}getUtilityMap(){return this.constructor.utilityMap||null}extractUtilityClasses(e){if(!Array.isArray(e))return[];const t=new Set;return e.forEach(e=>{if("string"!=typeof e)return;const r=e.match(/\(([^)]+)\)/g);r&&r.forEach(e=>{e.slice(1,-1).split(/\s+/).filter(Boolean).forEach(e=>{e.startsWith(".")&&e.length>1&&t.add(e.slice(1))})})}),Array.from(t)}applyLayoutUtilities(e,t){if(!e||!t)return;const r=this.getUtilityMap();if(!r||!r[t])return;this.extractUtilityClasses(r[t]).forEach(t=>e.classList.add(t))}render(){return this.html=this.template,"function"==typeof this.init&&this.init(),this.html&&window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:render`,{detail:this})),this.html}destroy(){this.destroyInternal?.(),this.props=null,this.id=null,this.params=null,this.template=null,this.html&&(this.html.remove(),this.html=null),window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:destroy`,{detail:this}))}destroyInternal(){}}const n=function(e,t){if(e&&t)if("undefined"==typeof window||"function"!=typeof window.registerSfComponent){if("undefined"!=typeof window&&window.SF?.Loader?.registerComponent)window.SF.Loader.registerComponent(e,t);else if("undefined"!=typeof window){(window.SF_PENDING_COMPONENTS=window.SF_PENDING_COMPONENTS||[]).push([e,t])}}else window.registerSfComponent(e,t)},s=JSON.parse('{".sf-textarea":["display/flex (.flex)","flex-direction/column (.flex-col)","flex-wrap/nowrap (.flex-nowrap)","gap/var(--sf-space-1\\\\/4)","justify-content/flex-start (.justify-start)"],".sf-textarea .sf-textarea-label":["display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","gap/var(--sf-space-1\\\\/4)","justify-content/flex-start (.justify-start)","align-items/flex-start (.items-start)"],".sf-textarea textarea":[],".sf-textarea .sf-textarea-hint-text-wrap":["flex/1 (.flex-1)","display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","gap/var(--sf-b0)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"]}');var o=r("e138a730fd7c"),i=r("98e26702f55a");const l=new WeakMap,u=new WeakSet;let d=null;const c="label.sf-textarea",f="sfTextareaBound",m=new Set(["bordered","filled"]),p=new Set(["","none","text","tel","url","email","numeric","decimal","search"]),h=new Set(["soft","hard"]);function g(e){if(""===e||null==e)return null;const t=Number(e);return Number.isInteger(t)&&t>=0?t:null}function x(e,t=!1){return null==e||""===e?t:"boolean"==typeof e?e:["1","true","yes","on"].includes(String(e).toLowerCase())}function b(e){return e?.querySelector?.("textarea")||null}function w(e){return e?.querySelector?.(".sf-textarea-hint-text-wrap")||null}function y(e){const t=w(e);return{messageNode:t,errorMessage:"error"===t?.dataset.fieldMessage&&t.textContent?.trim()||""}}function v(e){if(!e||"string"!=typeof e)return null;const t=e.trim();if(!t)return null;try{const e=JSON.parse(t);return e&&"object"==typeof e?e:null}catch{return null}}const S="sf-textarea--auto-grow";function _(e){if(""===e||null==e)return null;const t=Math.trunc(Number(e));return Number.isFinite(t)&&t>0?t:null}function k(e,t){var r,a;if(!(r=t.dataset.autoGrow??e.dataset.autoGrow,a=e.classList.contains(S),null==r?a:""===r||x(r,a)))return null;const n=_(t.dataset.minRows??e.dataset.minRows)??1,s=_(t.dataset.maxRows??e.dataset.maxRows);return{minRows:n,maxRows:null===s?null:Math.max(s,n)}}function L(e,t){const r=k(e,t);if(!r)return;const a=!e.classList.contains(S);e.classList.add(S),t.rows=r.minRows,t.style.setProperty("--sf-textarea--min-rows",String(r.minRows)),null===r.maxRows?t.style.removeProperty("--sf-textarea--max-rows"):t.style.setProperty("--sf-textarea--max-rows",String(r.maxRows));const n={addedClass:a,fallback:null};if(e.__sfTextareaAutoGrow=n,"undefined"!=typeof CSS&&!0===CSS.supports?.("field-sizing","content"))return;let s=!1,o=-1;const i=()=>{s||function(e,t){if(!t.isConnected||0===t.clientWidth)return;const r=e.style.minBlockSize;e.style.minBlockSize=`${e.getBoundingClientRect().height}px`;const{scrollTop:a}=t;t.style.blockSize="auto";const n=getComputedStyle(t),s=(parseFloat(n.borderTopWidth)||0)+(parseFloat(n.borderBottomWidth)||0);t.style.blockSize=`${t.scrollHeight+s}px`,t.scrollTop!==a&&(t.scrollTop=a),e.style.minBlockSize=r}(e,t)},l=e=>{e.isComposing||i()},u=()=>{s=!0},d=()=>{s=!1,i()};t.addEventListener("input",l),t.addEventListener("compositionstart",u),t.addEventListener("compositionend",d);const c=Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,"value");Object.defineProperty(t,"value",{configurable:!0,enumerable:!0,get(){return c.get.call(this)},set(e){c.set.call(this,e),i()}});const f="undefined"==typeof ResizeObserver?null:new ResizeObserver(e=>{const t=Math.round(e[e.length-1].contentRect.width);t!==o&&(o=t,i())});f?.observe(t),i(),n.fallback={grow:i,onInput:l,onCompositionStart:u,onCompositionEnd:d,observer:f}}async function T(e,t){const r=function(e,t){if(!x(t.dataset.mask??e.dataset.mask,!1))return null;const r=v(t.dataset.maskOptions),a=v(e.dataset.maskOptions);if(r)return r;if(a)return a;const n=t.dataset.maskPattern??e.dataset.maskPattern;return n?{mask:String(n)}:null}(e,t);if(!r)return;const a={};e.__sfTextareaMaskRequest=a;try{const n=await function(){const e=()=>window.SF?.Mask?.create?window.SF.Mask:null,t=e();return t?Promise.resolve(t):d||(d=new Promise(t=>{const r=[[window,"sf-mask-ready"],[window,"sf-loader-ready"],[window,"load"],[document,"DOMContentLoaded"]],a=()=>{const n=e();n&&(r.forEach(([e,t])=>e.removeEventListener(t,a)),d=null,t(n))};r.forEach(([e,t])=>e.addEventListener(t,a))}),d)}();if(e.__sfTextareaMaskRequest!==a)return;const s=await n.create(t,r);if(!s)return;if("1"!==e.dataset[f]||e.__sfTextareaMaskRequest!==a||b(e)!==t)return void n.destroy(s);e.__sfTextareaMask=s}catch(e){console.warn("SF.Textarea mask init failed",e)}}function $(e){if((0,i.vl)(e,"sf-textarea"),!e||"1"===e.dataset[f])return;const t=b(e);if(!t)return;const r=()=>{},a=()=>e.classList.add("sf-textarea--pointer-focus"),n=()=>e.classList.remove("sf-textarea--pointer-focus");t.addEventListener("input",r),t.addEventListener("pointerdown",a),t.addEventListener("blur",n),e.__sfTextareaNoopHandler=r,e.__sfTextareaPointerFocusHandler=a,e.__sfTextareaBlurHandler=n,e.dataset[f]="1";const s=y(e);(0,o.U)(e,t,{prefix:"sf-textarea",labelNode:e.querySelector(".sf-textarea-text"),required:t.required||Boolean(e.querySelector(".sf-textarea-required")),invalid:e.classList.contains("error")||t.classList.contains("error"),...s}),e.__sfTextareaReleaseReset=function(e,t){const r=e.ownerDocument;u.has(r)||(r.addEventListener("reset",e=>{const t=e.target;if("FORM"!==t?.tagName)return;const r=Array.from(t.elements);setTimeout(()=>{if(!e.defaultPrevented)for(const e of r)if(e.isConnected&&e.form===t)for(const t of l.get(e)||[])t()},0)},!0),u.add(r));let a=l.get(e);return a||l.set(e,a=new Set),a.add(t),()=>a.delete(t)}(t,()=>{e.__sfTextareaMask&&(e.__sfTextareaMask.value=t.value),e.__sfTextareaAutoGrow?.fallback?.grow()}),L(e,t),T(e,t)}function M(e){if(!e||"1"!==e.dataset[f])return;delete e.__sfTextareaMaskRequest;const t=b(e);t&&e.__sfTextareaNoopHandler&&t.removeEventListener("input",e.__sfTextareaNoopHandler),t&&e.__sfTextareaPointerFocusHandler&&t.removeEventListener("pointerdown",e.__sfTextareaPointerFocusHandler),t&&e.__sfTextareaBlurHandler&&t.removeEventListener("blur",e.__sfTextareaBlurHandler),function(e,t){const r=e.__sfTextareaAutoGrow;if(!r)return;if(delete e.__sfTextareaAutoGrow,r.addedClass&&e.classList.remove(S),!t)return;t.style.removeProperty("--sf-textarea--min-rows"),t.style.removeProperty("--sf-textarea--max-rows");const{fallback:a}=r;a&&(t.removeEventListener("input",a.onInput),t.removeEventListener("compositionstart",a.onCompositionStart),t.removeEventListener("compositionend",a.onCompositionEnd),a.observer?.disconnect(),delete t.value,t.style.removeProperty("block-size"))}(e,t),e.__sfTextareaMask&&window.SF?.Mask?.destroy?.(e.__sfTextareaMask),e.__sfTextareaReleaseReset?.(),delete e.__sfTextareaReleaseReset,delete e.__sfTextareaMask,delete e.__sfTextareaNoopHandler,delete e.__sfTextareaPointerFocusHandler,delete e.__sfTextareaBlurHandler,e.classList.remove("sf-textarea--pointer-focus"),delete e.dataset[f]}function E(e=document){e.querySelectorAll(c).forEach($)}function A(e,t={}){const r=e instanceof HTMLElement?e.closest(c)||e:null;if(!r)return!1;const a=b(r);if(!a)return!1;if(Object.prototype.hasOwnProperty.call(t,"disabled")&&(a.disabled=x(t.disabled)),Object.prototype.hasOwnProperty.call(t,"error")){const e=x(t.error);r.classList.toggle("error",e),a.classList.toggle("error",e)}if(Object.prototype.hasOwnProperty.call(t,"invalid")){const e=x(t.invalid);r.classList.toggle("error",e),a.classList.toggle("error",e)}if(Object.prototype.hasOwnProperty.call(t,"errorMessage")){const e=String(t.errorMessage??""),n=e?function(e){const t=w(e);if(t)return t;const r=document.createElement("span");return r.classList.add("sf-textarea-hint-text-wrap"),e.append(r),r}(r):w(r);if(n){n.textContent=e;const t=r.classList.contains("error")||a.classList.contains("error");n.dataset.fieldMessage=e&&t?"error":"hint"}}return Object.prototype.hasOwnProperty.call(t,"value")&&(a.value=String(t.value??""),a.dispatchEvent(new Event("input",{bubbles:!0}))),(0,o.U)(r,a,{prefix:"sf-textarea",labelNode:r.querySelector(".sf-textarea-text"),required:a.required||Boolean(r.querySelector(".sf-textarea-required")),invalid:r.classList.contains("error")||a.classList.contains("error"),...y(r)}),!0}class R extends a{static componentName="Textarea";html=null;constructor(e){super(e);const{size:t="1",type:r="bordered",label:a="",required:n=!1,placeholder:s="",autocomplete:o="",inputMode:l="",minLength:u="",maxLength:d="",spellcheck:c=!0,wrap:f="soft",hint:b="",value:w="",name:y="",rows:v=3,disabled:S=!1,readonly:k=!1,error:L=!1,invalid:T=!1,errorMessage:$="",mask:M=!1,maskOptions:E,maskPattern:A,autoGrow:R=!1,minRows:N,maxRows:O}=this.params||{},C=this.attrs.class||this.attrs.className,q=(0,i.id)(t,"sf-textarea"),P=function(e,t,r){const a=String(e||r);return t.has(a)?a:r}(r,m,"bordered");this.template=document.createElement("label"),this.id&&(this.template.id=this.id),this.template.classList.add("sf-textarea",`sf-textarea--size-${q}`,`sf-textarea--${P}`),this.template.classList.toggle("error",x(T||L,!1)),C&&this.template.classList.add(...`${C}`.split(" ").filter(Boolean));const F=document.createElement("span");F.classList.add("sf-textarea-label");const B=document.createElement("span");if(B.classList.add("sf-textarea-text"),B.textContent=String(a),F.append(B),x(n,!0)){const e=document.createElement("span");e.classList.add("sf-textarea-required"),e.textContent="*",F.append(e)}const j=document.createElement("textarea");j.placeholder=String(s??""),o&&(j.autocomplete=String(o)),j.inputMode=function(e){const t=String(e||"").toLowerCase();return p.has(t)?t:""}(l);const I=g(u),z=g(d);if(null!==I&&(j.minLength=I),null!==z&&(j.maxLength=z),j.spellcheck=x(c,!0),j.wrap=function(e){const t=String(e||"soft").toLowerCase();return h.has(t)?t:"soft"}(f),j.value=String(w??""),j.defaultValue=String(w??""),j.rows=Number(v)>0?Number(v):3,y&&(j.name=String(y)),j.disabled=x(S,!1),j.readOnly=x(k,!1),j.required=x(n,!0),j.classList.toggle("error",x(T||L,!1)),j.dataset.mask=String(Boolean(M)),A&&(j.dataset.maskPattern=String(A)),E&&"object"==typeof E&&(j.dataset.maskOptions=JSON.stringify(E)),x(R,!1)){j.dataset.autoGrow="true";const e=_(N),t=_(O);null!==e&&(j.dataset.minRows=String(e)),null!==t&&(j.dataset.maxRows=String(t))}this.template.append(F,j);const G=x(T||L,!1)&&$?$:b;if(G){const e=document.createElement("span");e.classList.add("sf-textarea-hint-text-wrap"),e.textContent=String(G),e.dataset.fieldMessage=x(T||L,!1)&&$?"error":"hint",this.template.append(e)}this.applyLayoutUtilities(this.template,".sf-textarea"),this.applyLayoutUtilities(F,".sf-textarea .sf-textarea-label"),this.applyLayoutUtilities(j,".sf-textarea textarea")}init(){$(this.template)}destroyInternal(){M(this.template)}}R.utilityMap=s,n("Textarea",R),"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.Textarea=window.SF.Textarea||{},window.SF.Textarea.setState=A),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>E()):E();new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{e instanceof Element&&(e.matches?.(c)&&$(e),E(e))})})}).observe(document.documentElement,{childList:!0,subtree:!0})},c6ddd1585553(e,t,r){r.a(e,async(e,t)=>{try{var a=r("01398f3e8009"),n=r("fbe0570fcc69"),s=r("98e26702f55a"),o=r("943b9fa4bc95"),i=e([n,o]);[n,o]=i.then?(await i)():i;var l=r.n(n);new Set(["bordered","filled"]);const u=new Set(["","none","text","tel","url","email","numeric","decimal","search"]),d=new Set(["soft","hard"]);function c(e,t,r){const a=String(e||r);return t.has(a)?a:r}class f extends(l()){static get props(){return{size:{default:"1"},appearance:{default:"bordered",values:["bordered","filled"],aliases:["type"]},label:{default:""},required:{type:Boolean,default:!1},placeholder:{default:""},autocomplete:{default:""},inputmode:{default:""},minlength:{type:Number,default:null},maxlength:{type:Number,default:null},spellcheck:{type:Boolean,default:!0},wrap:{default:"soft"},hint:{default:""},value:{default:""},name:{default:""},rows:{type:Number,default:3},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},invalid:{type:Boolean,default:!1},errorMessage:{default:""},mask:{type:Boolean,default:!1},maskPattern:{default:""},maskOptions:{default:""},autoGrow:{type:Boolean,default:!1},minRows:{type:Number,default:1},maxRows:{type:Number,default:null}}}constructor(){super(),this._boundRoot=null}get size(){return(0,s.id)(this.getAttribute("size")||"1","sf-textarea")}get appearance(){return this.getProp("appearance")}get type(){return this.appearance}get label(){return this.getAttribute("label")||""}get required(){return this.getBooleanAttr("required",!1)}get placeholder(){return this.getAttribute("placeholder")||""}get autocomplete(){return this.getAttribute("autocomplete")||""}get inputmode(){return c(this.getAttribute("inputmode"),u,"")}get minlength(){const e=this.getNumberAttr("minlength",null);return Number.isInteger(e)&&e>=0?e:null}get maxlength(){const e=this.getNumberAttr("maxlength",null);return Number.isInteger(e)&&e>=0?e:null}get spellcheck(){return this.getBooleanAttr("spellcheck",!0)}get wrap(){return c(this.getAttribute("wrap"),d,"soft")}get hint(){return this.getAttribute("hint")||""}get value(){const e=this.querySelector(".sf-textarea textarea");return e?e.value:this.getAttribute("value")||""}set value(e){const t=String(e??"");null==e?this.removeAttribute("value"):this.setAttribute("value",t);const r=this.querySelector(".sf-textarea"),a=r?.querySelector("textarea");r?.__sfTextareaMask?r.__sfTextareaMask.value=t:a&&(a.value=t)}get name(){return this.getAttribute("name")||""}get rows(){const e=Math.trunc(this.getNumberAttr("rows",3));return e>0?e:3}get autoGrow(){return this.getBooleanAttr("auto-grow",!1)}get minRows(){const e=Math.trunc(this.getNumberAttr("minRows",1));return e>0?e:1}get maxRows(){const e=Math.trunc(this.getNumberAttr("maxRows",null));return e>0?Math.max(e,this.minRows):null}get disabled(){return this.getBooleanAttr("disabled",!1)}get readonly(){return this.getBooleanAttr("readonly",!1)}get error(){return this.getBooleanAttr("error",!1)}get invalid(){return this.getBooleanAttr("invalid",!1)}get errorMessage(){return this.getAttribute("error-message")||""}get mask(){return this.getBooleanAttr("mask",!1)}get maskPattern(){return this.getAttribute("mask-pattern")||""}get maskOptions(){return this.getAttribute("mask-options")||""}templateContext(){const e=this.getPropsContext(),t=this.querySelector("textarea");return this.createTemplateContext({...e,value:this.hasAttribute("value")||!t?e.value:t.value,type:this.type,minlength:this.minlength,maxlength:this.maxlength,autoGrow:this.autoGrow,minRows:this.minRows,maxRows:this.maxRows})}onDisconnected(){this._boundRoot&&((0,a.TO)(this._boundRoot),this._boundRoot=null)}afterRender(){this._boundRoot&&((0,a.TO)(this._boundRoot),this._boundRoot=null),this._boundRoot=this.querySelector(".sf-textarea"),this._boundRoot&&(0,a.sd)(this._boundRoot)}template(){return(0,o.F)(this.templateContext())}get state(){const e=this.querySelector(".sf-textarea"),t=e?.querySelector?.("textarea")||null;return{value:t?.value||"",disabled:!!t?.disabled,invalid:"true"===t?.getAttribute("aria-invalid"),error:e?.classList?.contains("error")||t?.classList?.contains("error")||!1}}setState(e={}){const t=this.querySelector(".sf-textarea");return(0,a.aJ)(t,e)}}f.define("sf-textarea"),t()}catch(m){t(m)}})},"943b9fa4bc95"(e,t,r){r.a(e,async(e,a)=>{try{r.d(t,{F:()=>l});var n=r("ddf1cdb42ecc"),s=r("e138a730fd7c"),o=e([n]),i=o.then?(await o)():o;n=i[0];function l(e){const{size:t,appearance:r,type:a,label:o,required:i,placeholder:l,autocomplete:u,inputmode:d,minlength:c,maxlength:f,spellcheck:m,wrap:p,hint:h,value:g,name:x,rows:b,disabled:w,readonly:y,error:v,invalid:S,errorMessage:_,mask:k,maskPattern:L,maskOptions:T,autoGrow:$,minRows:M,maxRows:E}=e,A=(0,s.h)(e.component,{prefix:"sf-textarea",required:i,invalid:S||v,hint:h,errorMessage:_}),R=e.component?.hasSlotContent?.("error")?e.component.getSlotContent("error"):_,N=e.component?.hasSlotContent?.("hint")?e.component.getSlotContent("hint"):h,O=A.invalid&&R?R:N,C=["sf-textarea",`sf-textarea--size-${t}`,`sf-textarea--${r??a}`,A.invalid?"error":"",$?"sf-textarea--auto-grow":"","flex","flex-col",e.rootClass].filter(Boolean),q=o?n.html`
1
+ (()=>{"use strict";var e={e138a730fd7c(e,t,r){r.d(t,{U:()=>o,h:()=>s});let a=0;const n=new WeakMap;function s(e,{prefix:t="sf-field",required:r=!1,invalid:s=!1,hint:o="",errorMessage:i=""}={}){const l=function(e,t){if(e&&n.has(e))return n.get(e);const r=(e?.id?String(e.id).trim():"")||`${t}-${++a}`,s={controlId:`${r}-control`,messageId:`${r}-message`};return!e||"object"!=typeof e&&"function"!=typeof e||n.set(e,s),s}(e,t),u=Boolean(s),d=u&&i?i:o;return{...l,required:Boolean(r),invalid:u,message:d,describedBy:d?l.messageId:"",errorMessageId:u&&i?l.messageId:""}}function o(e,t,{prefix:r="sf-field",required:a=!1,invalid:n=!1,messageNode:o=null,labelNode:i=null,errorMessage:l=""}={}){if(!e||!t)return null;const u=s(e,{prefix:r,required:a,invalid:n,hint:o?.textContent?.trim()||"",errorMessage:l});var d,c;return t.id||(t.id=u.controlId),"LABEL"!==e.tagName||e.hasAttribute("for")||e.setAttribute("for",t.id),!i?.textContent?.trim()||t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby")||(i.id||(i.id=`${t.id}-label`),t.setAttribute("aria-labelledby",i.id)),t.required=u.required,e.classList.toggle("error",u.invalid),t.classList.toggle("error",u.invalid),u.invalid?t.setAttribute("aria-invalid","true"):t.removeAttribute("aria-invalid"),o&&(o.id||(o.id=u.messageId),t.setAttribute("aria-describedby",(d=t.getAttribute("aria-describedby"),c=[o.id],[...new Set([...String(d||"").split(/\s+/).filter(Boolean),...c.filter(Boolean)])].join(" ")))),u.errorMessageId&&o?t.setAttribute("aria-errormessage",o.id):t.removeAttribute("aria-errormessage"),u}},"98e26702f55a"(e,t,r){function a(){const e=globalThis.SF=globalThis.SF||{};return e.__deprecationNotes instanceof Map||Object.defineProperty(e,"__deprecationNotes",{value:new Map,configurable:!0}),e.__deprecationNotes}function n({component:e="",kind:t="attribute",attribute:r="",from:n,to:s=null}={}){if(!n)return;const o=[e,t,r,n].join("|"),i=a(),l=i.get(o);if(l)l.count+=1;else if(i.set(o,{component:e,kind:t,attribute:r,from:n,to:s,count:1}),function(){const e=globalThis.document?.documentElement;return"warn"===e?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const a=e?`${e}: `:"",o="value"===t?`${r}="${n}"`:`${t} ${n}`;globalThis.console?.warn?.(`[SIMAI Framework] ${a}${o} is a legacy name${s?`; write ${s}`:""}. See contracts/changes/journal.json.`)}}if(r.d(t,{id:()=>l,vl:()=>u}),"undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const e=globalThis.SF.deprecations||{};e.list=function(){return[...a().values()].map(e=>({...e}))},e.clear=function(){a().clear()},e.note=n,globalThis.SF.deprecations=e}const s=Object.freeze(["1/2","1","2"]),o=Object.freeze({"1/3":"1/2",3:"2"}),i=new Set;function l(e,t="field",r="1"){const a=String(e??"").trim().toLowerCase();if(s.includes(a))return a;if(Object.hasOwn(o,a)){const e=o[a];n({component:t,kind:"value",attribute:"size",from:a,to:e});const r=`${t}:${a}`;return i.has(r)||"undefined"==typeof console||(i.add(r),console.warn(`[SIMAI Framework] ${t}: size ${a} is retired for form fields; rendering size ${e}.`)),e}return r}function u(e,t){if(e?.classList)for(const[r,a]of Object.entries(o)){const a=`${t}--size-${r}`;e.classList.contains(a)&&e.classList.replace(a,`${t}--size-${l(r,t)}`)}}},"01398f3e8009"(e,t,r){r.d(t,{sd:()=>$,aJ:()=>A,TO:()=>M});class a{lifecycleName(){return this.componentName??this.constructor.componentName}constructor(e){this.props=e,this.id=e?.id,this.params=e?.param,this.attrs=e?.attrs||{},this.template=null,window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:beforeRender`,{detail:this}))}getUtilityMap(){return this.constructor.utilityMap||null}extractUtilityClasses(e){if(!Array.isArray(e))return[];const t=new Set;return e.forEach(e=>{if("string"!=typeof e)return;const r=e.match(/\(([^)]+)\)/g);r&&r.forEach(e=>{e.slice(1,-1).split(/\s+/).filter(Boolean).forEach(e=>{e.startsWith(".")&&e.length>1&&t.add(e.slice(1))})})}),Array.from(t)}applyLayoutUtilities(e,t){if(!e||!t)return;const r=this.getUtilityMap();if(!r||!r[t])return;this.extractUtilityClasses(r[t]).forEach(t=>e.classList.add(t))}render(){return this.html=this.template,"function"==typeof this.init&&this.init(),this.html&&window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:render`,{detail:this})),this.html}destroy(){this.destroyInternal?.(),this.props=null,this.id=null,this.params=null,this.template=null,this.html&&(this.html.remove(),this.html=null),window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:destroy`,{detail:this}))}destroyInternal(){}}const n=function(e,t){if(e&&t)if("undefined"==typeof window||"function"!=typeof window.registerSfComponent){if("undefined"!=typeof window&&window.SF?.Loader?.registerComponent)window.SF.Loader.registerComponent(e,t);else if("undefined"!=typeof window){(window.SF_PENDING_COMPONENTS=window.SF_PENDING_COMPONENTS||[]).push([e,t])}}else window.registerSfComponent(e,t)},s=JSON.parse('{".sf-textarea":["display/flex (.flex)","flex-direction/column (.flex-col)","flex-wrap/nowrap (.flex-nowrap)","gap/var(--sf-space-1\\\\/4)","justify-content/flex-start (.justify-start)"],".sf-textarea .sf-textarea-label":["display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","gap/var(--sf-space-1\\\\/4)","justify-content/flex-start (.justify-start)","align-items/flex-start (.items-start)"],".sf-textarea textarea":[],".sf-textarea .sf-textarea-hint-text-wrap":["flex/1 (.flex-1)","display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","gap/var(--sf-b0)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"]}');var o=r("e138a730fd7c"),i=r("98e26702f55a");const l=new WeakMap,u=new WeakSet;let d=null;const c="label.sf-textarea",f="sfTextareaBound",m=new Set(["bordered","filled","flush"]),p=new Set(["","none","text","tel","url","email","numeric","decimal","search"]),h=new Set(["soft","hard"]);function g(e){if(""===e||null==e)return null;const t=Number(e);return Number.isInteger(t)&&t>=0?t:null}function x(e,t=!1){return null==e||""===e?t:"boolean"==typeof e?e:["1","true","yes","on"].includes(String(e).toLowerCase())}function b(e){return e?.querySelector?.("textarea")||null}function w(e){return e?.querySelector?.(".sf-textarea-hint-text-wrap")||null}function y(e){const t=w(e);return{messageNode:t,errorMessage:"error"===t?.dataset.fieldMessage&&t.textContent?.trim()||""}}function v(e){if(!e||"string"!=typeof e)return null;const t=e.trim();if(!t)return null;try{const e=JSON.parse(t);return e&&"object"==typeof e?e:null}catch{return null}}const S="sf-textarea--auto-grow";function _(e){if(""===e||null==e)return null;const t=Math.trunc(Number(e));return Number.isFinite(t)&&t>0?t:null}function k(e,t){var r,a;if(!(r=t.dataset.autoGrow??e.dataset.autoGrow,a=e.classList.contains(S),null==r?a:""===r||x(r,a)))return null;const n=_(t.dataset.minRows??e.dataset.minRows)??1,s=_(t.dataset.maxRows??e.dataset.maxRows);return{minRows:n,maxRows:null===s?null:Math.max(s,n)}}function L(e,t){const r=k(e,t);if(!r)return;const a=!e.classList.contains(S);e.classList.add(S),t.rows=r.minRows,t.style.setProperty("--sf-textarea--min-rows",String(r.minRows)),null===r.maxRows?t.style.removeProperty("--sf-textarea--max-rows"):t.style.setProperty("--sf-textarea--max-rows",String(r.maxRows));const n={addedClass:a,fallback:null};if(e.__sfTextareaAutoGrow=n,"undefined"!=typeof CSS&&!0===CSS.supports?.("field-sizing","content"))return;let s=!1,o=-1;const i=()=>{s||function(e,t){if(!t.isConnected||0===t.clientWidth)return;const r=e.style.minBlockSize;e.style.minBlockSize=`${e.getBoundingClientRect().height}px`;const{scrollTop:a}=t;t.style.blockSize="auto";const n=getComputedStyle(t),s=(parseFloat(n.borderTopWidth)||0)+(parseFloat(n.borderBottomWidth)||0);t.style.blockSize=`${t.scrollHeight+s}px`,t.scrollTop!==a&&(t.scrollTop=a),e.style.minBlockSize=r}(e,t)},l=e=>{e.isComposing||i()},u=()=>{s=!0},d=()=>{s=!1,i()};t.addEventListener("input",l),t.addEventListener("compositionstart",u),t.addEventListener("compositionend",d);const c=Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,"value");Object.defineProperty(t,"value",{configurable:!0,enumerable:!0,get(){return c.get.call(this)},set(e){c.set.call(this,e),i()}});const f="undefined"==typeof ResizeObserver?null:new ResizeObserver(e=>{const t=Math.round(e[e.length-1].contentRect.width);t!==o&&(o=t,i())});f?.observe(t),i(),n.fallback={grow:i,onInput:l,onCompositionStart:u,onCompositionEnd:d,observer:f}}async function T(e,t){const r=function(e,t){if(!x(t.dataset.mask??e.dataset.mask,!1))return null;const r=v(t.dataset.maskOptions),a=v(e.dataset.maskOptions);if(r)return r;if(a)return a;const n=t.dataset.maskPattern??e.dataset.maskPattern;return n?{mask:String(n)}:null}(e,t);if(!r)return;const a={};e.__sfTextareaMaskRequest=a;try{const n=await function(){const e=()=>window.SF?.Mask?.create?window.SF.Mask:null,t=e();return t?Promise.resolve(t):d||(d=new Promise(t=>{const r=[[window,"sf-mask-ready"],[window,"sf-loader-ready"],[window,"load"],[document,"DOMContentLoaded"]],a=()=>{const n=e();n&&(r.forEach(([e,t])=>e.removeEventListener(t,a)),d=null,t(n))};r.forEach(([e,t])=>e.addEventListener(t,a))}),d)}();if(e.__sfTextareaMaskRequest!==a)return;const s=await n.create(t,r);if(!s)return;if("1"!==e.dataset[f]||e.__sfTextareaMaskRequest!==a||b(e)!==t)return void n.destroy(s);e.__sfTextareaMask=s}catch(e){console.warn("SF.Textarea mask init failed",e)}}function $(e){if((0,i.vl)(e,"sf-textarea"),!e||"1"===e.dataset[f])return;const t=b(e);if(!t)return;const r=()=>{},a=()=>e.classList.add("sf-textarea--pointer-focus"),n=()=>e.classList.remove("sf-textarea--pointer-focus");t.addEventListener("input",r),t.addEventListener("pointerdown",a),t.addEventListener("blur",n),e.__sfTextareaNoopHandler=r,e.__sfTextareaPointerFocusHandler=a,e.__sfTextareaBlurHandler=n,e.dataset[f]="1";const s=y(e);(0,o.U)(e,t,{prefix:"sf-textarea",labelNode:e.querySelector(".sf-textarea-text"),required:t.required||Boolean(e.querySelector(".sf-textarea-required")),invalid:e.classList.contains("error")||t.classList.contains("error"),...s}),e.__sfTextareaReleaseReset=function(e,t){const r=e.ownerDocument;u.has(r)||(r.addEventListener("reset",e=>{const t=e.target;if("FORM"!==t?.tagName)return;const r=Array.from(t.elements);setTimeout(()=>{if(!e.defaultPrevented)for(const e of r)if(e.isConnected&&e.form===t)for(const t of l.get(e)||[])t()},0)},!0),u.add(r));let a=l.get(e);return a||l.set(e,a=new Set),a.add(t),()=>a.delete(t)}(t,()=>{e.__sfTextareaMask&&(e.__sfTextareaMask.value=t.value),e.__sfTextareaAutoGrow?.fallback?.grow()}),L(e,t),T(e,t)}function M(e){if(!e||"1"!==e.dataset[f])return;delete e.__sfTextareaMaskRequest;const t=b(e);t&&e.__sfTextareaNoopHandler&&t.removeEventListener("input",e.__sfTextareaNoopHandler),t&&e.__sfTextareaPointerFocusHandler&&t.removeEventListener("pointerdown",e.__sfTextareaPointerFocusHandler),t&&e.__sfTextareaBlurHandler&&t.removeEventListener("blur",e.__sfTextareaBlurHandler),function(e,t){const r=e.__sfTextareaAutoGrow;if(!r)return;if(delete e.__sfTextareaAutoGrow,r.addedClass&&e.classList.remove(S),!t)return;t.style.removeProperty("--sf-textarea--min-rows"),t.style.removeProperty("--sf-textarea--max-rows");const{fallback:a}=r;a&&(t.removeEventListener("input",a.onInput),t.removeEventListener("compositionstart",a.onCompositionStart),t.removeEventListener("compositionend",a.onCompositionEnd),a.observer?.disconnect(),delete t.value,t.style.removeProperty("block-size"))}(e,t),e.__sfTextareaMask&&window.SF?.Mask?.destroy?.(e.__sfTextareaMask),e.__sfTextareaReleaseReset?.(),delete e.__sfTextareaReleaseReset,delete e.__sfTextareaMask,delete e.__sfTextareaNoopHandler,delete e.__sfTextareaPointerFocusHandler,delete e.__sfTextareaBlurHandler,e.classList.remove("sf-textarea--pointer-focus"),delete e.dataset[f]}function E(e=document){e.querySelectorAll(c).forEach($)}function A(e,t={}){const r=e instanceof HTMLElement?e.closest(c)||e:null;if(!r)return!1;const a=b(r);if(!a)return!1;if(Object.prototype.hasOwnProperty.call(t,"disabled")&&(a.disabled=x(t.disabled)),Object.prototype.hasOwnProperty.call(t,"error")){const e=x(t.error);r.classList.toggle("error",e),a.classList.toggle("error",e)}if(Object.prototype.hasOwnProperty.call(t,"invalid")){const e=x(t.invalid);r.classList.toggle("error",e),a.classList.toggle("error",e)}if(Object.prototype.hasOwnProperty.call(t,"errorMessage")){const e=String(t.errorMessage??""),n=e?function(e){const t=w(e);if(t)return t;const r=document.createElement("span");return r.classList.add("sf-textarea-hint-text-wrap"),e.append(r),r}(r):w(r);if(n){n.textContent=e;const t=r.classList.contains("error")||a.classList.contains("error");n.dataset.fieldMessage=e&&t?"error":"hint"}}return Object.prototype.hasOwnProperty.call(t,"value")&&(a.value=String(t.value??""),a.dispatchEvent(new Event("input",{bubbles:!0}))),(0,o.U)(r,a,{prefix:"sf-textarea",labelNode:r.querySelector(".sf-textarea-text"),required:a.required||Boolean(r.querySelector(".sf-textarea-required")),invalid:r.classList.contains("error")||a.classList.contains("error"),...y(r)}),!0}class R extends a{static componentName="Textarea";html=null;constructor(e){super(e);const{size:t="1",type:r="bordered",label:a="",required:n=!1,placeholder:s="",autocomplete:o="",inputMode:l="",minLength:u="",maxLength:d="",spellcheck:c=!0,wrap:f="soft",hint:b="",value:w="",name:y="",rows:v=3,disabled:S=!1,readonly:k=!1,error:L=!1,invalid:T=!1,errorMessage:$="",mask:M=!1,maskOptions:E,maskPattern:A,autoGrow:R=!1,minRows:N,maxRows:O}=this.params||{},C=this.attrs.class||this.attrs.className,q=(0,i.id)(t,"sf-textarea"),P=function(e,t,r){const a=String(e||r);return t.has(a)?a:r}(r,m,"bordered");this.template=document.createElement("label"),this.id&&(this.template.id=this.id),this.template.classList.add("sf-textarea",`sf-textarea--size-${q}`,`sf-textarea--${P}`),this.template.classList.toggle("error",x(T||L,!1)),C&&this.template.classList.add(...`${C}`.split(" ").filter(Boolean));const F=document.createElement("span");F.classList.add("sf-textarea-label");const B=document.createElement("span");if(B.classList.add("sf-textarea-text"),B.textContent=String(a),F.append(B),x(n,!0)){const e=document.createElement("span");e.classList.add("sf-textarea-required"),e.textContent="*",F.append(e)}const j=document.createElement("textarea");j.placeholder=String(s??""),o&&(j.autocomplete=String(o)),j.inputMode=function(e){const t=String(e||"").toLowerCase();return p.has(t)?t:""}(l);const I=g(u),z=g(d);if(null!==I&&(j.minLength=I),null!==z&&(j.maxLength=z),j.spellcheck=x(c,!0),j.wrap=function(e){const t=String(e||"soft").toLowerCase();return h.has(t)?t:"soft"}(f),j.value=String(w??""),j.defaultValue=String(w??""),j.rows=Number(v)>0?Number(v):3,y&&(j.name=String(y)),j.disabled=x(S,!1),j.readOnly=x(k,!1),j.required=x(n,!0),j.classList.toggle("error",x(T||L,!1)),j.dataset.mask=String(Boolean(M)),A&&(j.dataset.maskPattern=String(A)),E&&"object"==typeof E&&(j.dataset.maskOptions=JSON.stringify(E)),x(R,!1)){j.dataset.autoGrow="true";const e=_(N),t=_(O);null!==e&&(j.dataset.minRows=String(e)),null!==t&&(j.dataset.maxRows=String(t))}this.template.append(F,j);const G=x(T||L,!1)&&$?$:b;if(G){const e=document.createElement("span");e.classList.add("sf-textarea-hint-text-wrap"),e.textContent=String(G),e.dataset.fieldMessage=x(T||L,!1)&&$?"error":"hint",this.template.append(e)}this.applyLayoutUtilities(this.template,".sf-textarea"),this.applyLayoutUtilities(F,".sf-textarea .sf-textarea-label"),this.applyLayoutUtilities(j,".sf-textarea textarea")}init(){$(this.template)}destroyInternal(){M(this.template)}}R.utilityMap=s,n("Textarea",R),"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.Textarea=window.SF.Textarea||{},window.SF.Textarea.setState=A),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>E()):E();new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{e instanceof Element&&(e.matches?.(c)&&$(e),E(e))})})}).observe(document.documentElement,{childList:!0,subtree:!0})},c6ddd1585553(e,t,r){r.a(e,async(e,t)=>{try{var a=r("01398f3e8009"),n=r("fbe0570fcc69"),s=r("98e26702f55a"),o=r("943b9fa4bc95"),i=e([n,o]);[n,o]=i.then?(await i)():i;var l=r.n(n);new Set(["bordered","filled","flush"]);const u=new Set(["","none","text","tel","url","email","numeric","decimal","search"]),d=new Set(["soft","hard"]);function c(e,t,r){const a=String(e||r);return t.has(a)?a:r}class f extends(l()){static get props(){return{size:{default:"1"},appearance:{default:"bordered",values:["bordered","filled","flush"],aliases:["type"]},label:{default:""},required:{type:Boolean,default:!1},placeholder:{default:""},autocomplete:{default:""},inputmode:{default:""},minlength:{type:Number,default:null},maxlength:{type:Number,default:null},spellcheck:{type:Boolean,default:!0},wrap:{default:"soft"},hint:{default:""},value:{default:""},name:{default:""},rows:{type:Number,default:3},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},invalid:{type:Boolean,default:!1},errorMessage:{default:""},mask:{type:Boolean,default:!1},maskPattern:{default:""},maskOptions:{default:""},autoGrow:{type:Boolean,default:!1},minRows:{type:Number,default:1},maxRows:{type:Number,default:null}}}constructor(){super(),this._boundRoot=null}get size(){return(0,s.id)(this.getAttribute("size")||"1","sf-textarea")}get appearance(){return this.getProp("appearance")}get type(){return this.appearance}get label(){return this.getAttribute("label")||""}get required(){return this.getBooleanAttr("required",!1)}get placeholder(){return this.getAttribute("placeholder")||""}get autocomplete(){return this.getAttribute("autocomplete")||""}get inputmode(){return c(this.getAttribute("inputmode"),u,"")}get minlength(){const e=this.getNumberAttr("minlength",null);return Number.isInteger(e)&&e>=0?e:null}get maxlength(){const e=this.getNumberAttr("maxlength",null);return Number.isInteger(e)&&e>=0?e:null}get spellcheck(){return this.getBooleanAttr("spellcheck",!0)}get wrap(){return c(this.getAttribute("wrap"),d,"soft")}get hint(){return this.getAttribute("hint")||""}get value(){const e=this.querySelector(".sf-textarea textarea");return e?e.value:this.getAttribute("value")||""}set value(e){const t=String(e??"");null==e?this.removeAttribute("value"):this.setAttribute("value",t);const r=this.querySelector(".sf-textarea"),a=r?.querySelector("textarea");r?.__sfTextareaMask?r.__sfTextareaMask.value=t:a&&(a.value=t)}get name(){return this.getAttribute("name")||""}get rows(){const e=Math.trunc(this.getNumberAttr("rows",3));return e>0?e:3}get autoGrow(){return this.getBooleanAttr("auto-grow",!1)}get minRows(){const e=Math.trunc(this.getNumberAttr("minRows",1));return e>0?e:1}get maxRows(){const e=Math.trunc(this.getNumberAttr("maxRows",null));return e>0?Math.max(e,this.minRows):null}get disabled(){return this.getBooleanAttr("disabled",!1)}get readonly(){return this.getBooleanAttr("readonly",!1)}get error(){return this.getBooleanAttr("error",!1)}get invalid(){return this.getBooleanAttr("invalid",!1)}get errorMessage(){return this.getAttribute("error-message")||""}get mask(){return this.getBooleanAttr("mask",!1)}get maskPattern(){return this.getAttribute("mask-pattern")||""}get maskOptions(){return this.getAttribute("mask-options")||""}templateContext(){const e=this.getPropsContext(),t=this.querySelector("textarea");return this.createTemplateContext({...e,value:this.hasAttribute("value")||!t?e.value:t.value,type:this.type,minlength:this.minlength,maxlength:this.maxlength,autoGrow:this.autoGrow,minRows:this.minRows,maxRows:this.maxRows})}onDisconnected(){this._boundRoot&&((0,a.TO)(this._boundRoot),this._boundRoot=null)}afterRender(){this._boundRoot&&((0,a.TO)(this._boundRoot),this._boundRoot=null),this._boundRoot=this.querySelector(".sf-textarea"),this._boundRoot&&(0,a.sd)(this._boundRoot)}template(){return(0,o.F)(this.templateContext())}get state(){const e=this.querySelector(".sf-textarea"),t=e?.querySelector?.("textarea")||null;return{value:t?.value||"",disabled:!!t?.disabled,invalid:"true"===t?.getAttribute("aria-invalid"),error:e?.classList?.contains("error")||t?.classList?.contains("error")||!1}}setState(e={}){const t=this.querySelector(".sf-textarea");return(0,a.aJ)(t,e)}}f.define("sf-textarea"),t()}catch(m){t(m)}})},"943b9fa4bc95"(e,t,r){r.a(e,async(e,a)=>{try{r.d(t,{F:()=>l});var n=r("ddf1cdb42ecc"),s=r("e138a730fd7c"),o=e([n]),i=o.then?(await o)():o;n=i[0];function l(e){const{size:t,appearance:r,type:a,label:o,required:i,placeholder:l,autocomplete:u,inputmode:d,minlength:c,maxlength:f,spellcheck:m,wrap:p,hint:h,value:g,name:x,rows:b,disabled:w,readonly:y,error:v,invalid:S,errorMessage:_,mask:k,maskPattern:L,maskOptions:T,autoGrow:$,minRows:M,maxRows:E}=e,A=(0,s.h)(e.component,{prefix:"sf-textarea",required:i,invalid:S||v,hint:h,errorMessage:_}),R=e.component?.hasSlotContent?.("error")?e.component.getSlotContent("error"):_,N=e.component?.hasSlotContent?.("hint")?e.component.getSlotContent("hint"):h,O=A.invalid&&R?R:N,C=["sf-textarea",`sf-textarea--size-${t}`,`sf-textarea--${r??a}`,A.invalid?"error":"",$?"sf-textarea--auto-grow":"","flex","flex-col",e.rootClass].filter(Boolean),q=o?n.html`
2
2
  <span class="sf-textarea-text">${o}</span>
3
3
  ${i?n.html`<span class="sf-textarea-required">*</span>`:""}
4
4
  `:"";return n.html`
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schema_version": 2,
3
3
  "id": "smart.textarea",
4
- "version": "1.2.0",
4
+ "version": "1.3.0",
5
5
  "title": "Textarea",
6
6
  "summary": "A native multiline form control with Framework presentation, validation messaging and safe vertical resizing.",
7
7
  "kind": "smart",
@@ -47,9 +47,10 @@
47
47
  "default": "bordered",
48
48
  "enum": [
49
49
  "bordered",
50
- "filled"
50
+ "filled",
51
+ "flush"
51
52
  ],
52
- "description": "How the field looks: a bordered box or a filled one."
53
+ "description": "How the field looks: a bordered box, a filled one, or flush -- no box of its own, inside a composite control that draws the box and the focus."
53
54
  },
54
55
  "label": {
55
56
  "type": "string",
@@ -171,7 +172,8 @@
171
172
  "description": "Legacy name for appearance, still honoured. See contracts/public-api-axes.json.",
172
173
  "enum": [
173
174
  "bordered",
174
- "filled"
175
+ "filled",
176
+ "flush"
175
177
  ]
176
178
  }
177
179
  },
@@ -344,7 +346,7 @@
344
346
  "source_artifacts": [
345
347
  {
346
348
  "path": "src/smart/textarea/index.js",
347
- "sha256": "55472299d6c3bf2382ae3f1238d2ba15e59a04bc32eec6f4414ae1607199811d"
349
+ "sha256": "aff702ba06b47bef148c3c528b84c632a5a6e248b0b4bebdd746d8300c8bb2cd"
348
350
  }
349
351
  ],
350
352
  "generated_runtime": [
@@ -1,7 +1,7 @@
1
1
  {
2
- "release": "ui-c408b1c544f9",
3
- "commit": "c408b1c544f94b19b20a0bd2ae953e5bb67a6d50",
4
- "version": "5.20261022.1534",
2
+ "release": "ui-f2f3e8f912cf",
3
+ "commit": "f2f3e8f912cf618b95b509040465e618208e7322",
4
+ "version": "5.20261022.1814",
5
5
  "files": {
6
6
  "distr/component/accordion/css/accordion.min.css": "sha256-Sn5M6q2XskfMvRHwMFgraYLTGk0vOUDCRFJGQfCsZ4Y=",
7
7
  "distr/component/accordion/js/accordion.min.js": "sha256-HiHgZKWDDIOVBjMwOgKFlJqGKvZWwN3NeJluAWwE6ck=",
@@ -636,8 +636,8 @@
636
636
  "distr/component/tabs/js/tabs.min.js": "sha256-q+M20eyzwZBLz55JRE342L0RYlBhQZY7sEnGTkaLXpk=",
637
637
  "distr/component/tags/css/tags.min.css": "sha256-t3C1sOXSMspYrhpChmP1rIVHMfmnmgu2Hy+DKYabqGU=",
638
638
  "distr/component/tags/js/tags.min.js": "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=",
639
- "distr/component/textarea/css/textarea.min.css": "sha256-UpOpSrk/i6jwjr30JrNHPLaMaICYLoAwl+FM80ZbbYw=",
640
- "distr/component/textarea/js/textarea.min.js": "sha256-gNOtPSHOxfPaaCju/nmOV2/wHb9J3CD6dxLDARwqCLE=",
639
+ "distr/component/textarea/css/textarea.min.css": "sha256-cIHXWi7V9itrV4bvbMuW7mcsgOVGnb5Oik3THfo8V2U=",
640
+ "distr/component/textarea/js/textarea.min.js": "sha256-Juloos5ROGY1ytdVKHLZMK48NPh7c4JG5MdnR3kqN5A=",
641
641
  "distr/component/textarea/json/textarea.utility.json": "sha256-CetfPPxZGpkvLizo+PqvBC/xoJz9gpgr0Tcv3eKughU=",
642
642
  "distr/component/theme/js/theme.min.js": "sha256-3Q/BFMMHY0KKGcui8ENZDLS52PaVIPVZZy7vOngEPrs=",
643
643
  "distr/component/toast/css/toast.min.css": "sha256-l1HLtWKcGQ95IvzEfG2tQ1M7UQURK2SQ3O51XEz1ln8=",
@@ -703,7 +703,7 @@
703
703
  "distr/core/contracts/dimension-policy.v1.json": "sha256-Ud/7RxYDdlSLYtluZJG1Fue8cwEJlH4/H6JhYk57UCU=",
704
704
  "distr/core/contracts/effect.v1.schema.json": "sha256-caMuAo9wMYDtllF6Ig7qfhj3yZwUAxbstpeNkhQeX1M=",
705
705
  "distr/core/contracts/interface-fragment.v1.schema.json": "sha256-DxlgQZnZ7mDs/OZNl2oUa54gXoGX94xhNON9YmYELk8=",
706
- "distr/core/contracts/packages/larena.package.json": "sha256-nrhBzmr7E9/9wdmIxZRX8TTqQGXF8sozN+rMYB49diA=",
706
+ "distr/core/contracts/packages/larena.package.json": "sha256-zU0fkCV0zbbzM++FC1+HTvtH7NrBpM/muHWIpGJvgJA=",
707
707
  "distr/core/contracts/ports/simai.admin-navigation-port/1.0.0/kit/cases/a-collapsed-menu-is-kept.json": "sha256-M7kT1bb+06Rb8FJAgInPIGqF5UDp9/jwOXp4NkxhbgQ=",
708
708
  "distr/core/contracts/ports/simai.admin-navigation-port/1.0.0/kit/cases/a-language-not-offered-is-refused.json": "sha256-0LpYSZrISAECvX0RJA+tf6ijgyDnoig/ERSQf4KPIAc=",
709
709
  "distr/core/contracts/ports/simai.admin-navigation-port/1.0.0/kit/cases/a-language-says-whether-the-page-reloads.json": "sha256-FbBIlgqQ3C97C2txB7GUqHrw4UXIwm/r7ca7kF6p4Gg=",
@@ -1524,7 +1524,7 @@
1524
1524
  "distr/core/contracts/ports/simai.property-view-port/1.9.0/kit/cases/view-settings-without-the-capability.json": "sha256-wbI1G1KppypWN0LO60cTxdv1VP5mFTPIeBTnbxqguzY=",
1525
1525
  "distr/core/contracts/ports/simai.property-view-port/1.9.0/kit/manifest.json": "sha256-bjDip6spLfaIb+2H/H3WIFkw7XFbR7+DP+1De0obvUM=",
1526
1526
  "distr/core/contracts/ports/simai.property-view-port/1.9.0/port.json": "sha256-NnKDiAOd/sLHGAvkTIaL+9pBsYqwHBFr0DnN+WLC1qc=",
1527
- "distr/core/contracts/public-js-api.json": "sha256-LwjvepLLIoysZRJmrSqYEgToI5Q/9Q3s4cA1trkGFVo=",
1527
+ "distr/core/contracts/public-js-api.json": "sha256-cE7J6Oiyc/NSMovih8uf6+5Vu5AALW2xTewxthWM+Jg=",
1528
1528
  "distr/core/contracts/public-variables.v1.json": "sha256-F8j3fdSHoSSPlk/Rvo+aOA6t223po6PlkWV1N30GkJg=",
1529
1529
  "distr/core/contracts/public-variables.v1.schema.json": "sha256-gZGmNuRXKAfF+r61UpOQH5S3g/KRuw/rIAnX7O1LXfA=",
1530
1530
  "distr/core/contracts/third-party-notices.v1.json": "sha256-dHJ8Yw6xgvw23DAYiLzZjVyWIoBEL5qAmum1rdf5kQ8=",
@@ -1654,11 +1654,11 @@
1654
1654
  "distr/smart/country-code/studio.fixture.json": "sha256-LtXKWPCR8kwTe0RyliHoyf4oZ7naswRla2EPKRIC8tc=",
1655
1655
  "distr/smart/country-code/studio.scenario.json": "sha256-hI3m/cRUlMRRJp/omAgLwK7/QjKKGZBth8HKRdotUB8=",
1656
1656
  "distr/smart/country-code/template/default.js": "sha256-4ggijmr7AOhWHrlKaa39DW5lM1BosAUyI5Pbl5TLrjM=",
1657
- "distr/smart/datepicker/js/datepicker.min.js": "sha256-uLPWxjCjJCnIOUCoepwZFA9fEd/p6HQi4qDk6zUa9Z0=",
1658
- "distr/smart/datepicker/smart.manifest.json": "sha256-V9JzjmiHxQ1kTKaaR+4yQPKg+8prERjnuFIubrhYt9M=",
1657
+ "distr/smart/datepicker/js/datepicker.min.js": "sha256-xUZpEoRk47/BQ1TyN+y/g+b8+nRreB6K5yRElDnE+V0=",
1658
+ "distr/smart/datepicker/smart.manifest.json": "sha256-rlAa1YEeQEPYYagYIynWewSwrOVV0f/SpSut54soMzk=",
1659
1659
  "distr/smart/datepicker/studio.fixture.json": "sha256-1jZUZwa4puNNd9TFv0yRHQ6zNd3fF0dL9fkutfDzypc=",
1660
1660
  "distr/smart/datepicker/studio.scenario.json": "sha256-KouzoXQC719xxOHbt7imlxGmtY0HyFuNJ9ADKrPp9BY=",
1661
- "distr/smart/datepicker/template/default.js": "sha256-J0ieNwkOa7DyHNs23ld396BYCBWQEeABh91UZ454A6I=",
1661
+ "distr/smart/datepicker/template/default.js": "sha256-fJs3ntqJEefjHOftMHYSH8uYtdaI1T7soa+eL4vZhJI=",
1662
1662
  "distr/smart/download-file/js/download-file.min.js": "sha256-dem55XquSxY98NYM/505fwgUJK7XqukuOjaG0PFxXkE=",
1663
1663
  "distr/smart/download-file/smart.manifest.json": "sha256-W6qfEuh74JPEXdCqGoOflJbKA1HYkZzIM+V9Aq7A9kA=",
1664
1664
  "distr/smart/download-file/studio.fixture.json": "sha256-9QSk1/CNQ3uDL9Sx+E34TJHDqOCtM/tXjOdlHz5h0cY=",
@@ -1681,7 +1681,7 @@
1681
1681
  "distr/smart/empty-state/studio.fixture.json": "sha256-kTLJqzVW68pHYwlYbcOKbkAn+jfoR3/c9Txt2VSGwbY=",
1682
1682
  "distr/smart/empty-state/studio.scenario.json": "sha256-xGWMssotHcMfkfYkr+GqVOK9uSoMlILYGkGrl7wmYS0=",
1683
1683
  "distr/smart/empty-state/template/default.js": "sha256-2JbQ3FtiwpMsdL5pxjFtzpvuKqUFEipx/VjW00jmFuc=",
1684
- "distr/smart/field-renderers/js/field-renderers.min.js": "sha256-LB0qaRUbR3ntNoDTJGdW1ZHyTJ/cvQe+Xs8gsh1z8qk=",
1684
+ "distr/smart/field-renderers/js/field-renderers.min.js": "sha256-I9JrGgHmsHCtL246cJY0e6U4OZiZ0fLAUUecOb4UeP4=",
1685
1685
  "distr/smart/file-preview/js/file-preview.min.js": "sha256-hWHM+WmhSr+MhStsQOYL/XqZOWKc77idX2qQEAvTpa0=",
1686
1686
  "distr/smart/file-preview/smart.manifest.json": "sha256-Uxwj2RD8LkP1h627+gHP/+gJ/0ZLlKRjoWVQMM8I3hU=",
1687
1687
  "distr/smart/file-preview/studio.fixture.json": "sha256-5d5ekmgTkaQ1+P+DEOjs2HR3QpD+yYeMevh469larXs=",
@@ -1723,8 +1723,8 @@
1723
1723
  "distr/smart/inline-editor/studio.fixture.json": "sha256-BSs49D+yRY9vujjTHQTza+3oZ/FZC09yt50l4ZInOT8=",
1724
1724
  "distr/smart/inline-editor/studio.scenario.json": "sha256-HomirNpwoWa8CVcWyMrUi3MDzBwPMa6nFJzuFfds5MQ=",
1725
1725
  "distr/smart/inputs/css/inputs.min.css": "sha256-rVByHBlmF128EzPJtlxwGpqkj7mQbULYW3cpNddO8AA=",
1726
- "distr/smart/inputs/js/inputs.min.js": "sha256-yOyEDR9YoZjYAcqdgo1kGXwYUz7ZmkmNunGCp3yawEc=",
1727
- "distr/smart/inputs/smart.manifest.json": "sha256-h0TgCPw4pe6JWZ0S1sfobhiAq0+4fG1El5Vd/DupPYw=",
1726
+ "distr/smart/inputs/js/inputs.min.js": "sha256-YoiRI12WBdwA79Cfcx03YpJ3bYOo02YEXzmFZJ/Iw4I=",
1727
+ "distr/smart/inputs/smart.manifest.json": "sha256-scVV2RO7+ctzlbXdTLlDUPt+znyj6Fj1G653aJUMxvM=",
1728
1728
  "distr/smart/inputs/studio.fixture.json": "sha256-P500X6JyuXbYibmFzSMGeuXAzIEWDiYHY2KLoTf3NeA=",
1729
1729
  "distr/smart/inputs/studio.scenario.json": "sha256-luBRT3MwnpU5fsFy8DpeKC5/FI8L2+zbSLDq55Wum9E=",
1730
1730
  "distr/smart/inputs/template/default.css": "sha256-7+FrD0mDQDNU0sVF9bAx9bX+d2dvjddl9vZtVjRl6/0=",
@@ -1836,8 +1836,8 @@
1836
1836
  "distr/smart/tags/studio.scenario.json": "sha256-g4FCpGyc1Xt8MPcqgR+YIVc/UhDdebkxZkWfzHoKhCg=",
1837
1837
  "distr/smart/tags/template/default.css": "sha256-REYFY3U7KnFoOdxr6rJgtfdd4kXaFJOdVK13enZeshI=",
1838
1838
  "distr/smart/tags/template/default.js": "sha256-6m/EbQovRR3S+pIeOuHYTxGzZQWPWycxls5l3tFpHoM=",
1839
- "distr/smart/textarea/js/textarea.min.js": "sha256-Wxzeithzqh5kq7b2lz0MDKR2pnjVK7jEPP4G63O5f9E=",
1840
- "distr/smart/textarea/smart.manifest.json": "sha256-oW/PPs1jG6+4UuI6jcyEPhjsz/c6YK2eeO7oqkH9A7k=",
1839
+ "distr/smart/textarea/js/textarea.min.js": "sha256-4jep2XvPrfCDs2eeCfjSBbC8P5F8GPtpVAHBWPUiTeM=",
1840
+ "distr/smart/textarea/smart.manifest.json": "sha256-7yYmyu0k20jfz2ppIJof32EzmHLHGZS2XDkjq6nmiLc=",
1841
1841
  "distr/smart/textarea/studio.fixture.json": "sha256-HS/IcpmLZ6Fuqh8mRZIfZGBQK5ADRa+npGHItEW/FgM=",
1842
1842
  "distr/smart/textarea/studio.scenario.json": "sha256-WB43dLFWTGcutZ3owiJ8aWA3EhDn1fOEUJDzQlXJBXY=",
1843
1843
  "distr/smart/textarea/template/default.js": "sha256-gDpQgeUDCLPdXlRfMRERyTa+/XQTesZ5LKjjQ7qB/rM=",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@simai-studio/ui",
3
- "version": "5.20261022.1534",
4
- "description": "SIMAI Framework distribution, release ui-c408b1c544f9: Core, the Loader, components, utilities and Smart Components, ready to serve from distr/.",
3
+ "version": "5.20261022.1814",
4
+ "description": "SIMAI Framework distribution, release ui-f2f3e8f912cf: Core, the Loader, components, utilities and Smart Components, ready to serve from distr/.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://ui.simai.io/",
7
7
  "repository": {
@@ -17,7 +17,7 @@
17
17
  "README.md"
18
18
  ],
19
19
  "simai": {
20
- "release": "ui-c408b1c544f9",
21
- "commit": "c408b1c544f94b19b20a0bd2ae953e5bb67a6d50"
20
+ "release": "ui-f2f3e8f912cf",
21
+ "commit": "f2f3e8f912cf618b95b509040465e618208e7322"
22
22
  }
23
23
  }