@simai-studio/ui 5.20261019.1827 → 5.20261019.1921

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.
Files changed (37) hide show
  1. package/README.md +4 -4
  2. package/distr/component/country-code/js/country-code.min.js +1 -1
  3. package/distr/component/dropdown/js/dropdown.min.js +1 -1
  4. package/distr/component/file-upload/js/file-upload.min.js +1 -1
  5. package/distr/component/inputs/js/inputs.min.js +1 -1
  6. package/distr/component/pagination/css/pagination.min.css +1 -1
  7. package/distr/component/quantity/js/quantity.min.js +1 -1
  8. package/distr/component/textarea/js/textarea.min.js +1 -1
  9. package/distr/core/contracts/adaptive-sizing.schema.json +1 -1
  10. package/distr/core/contracts/composite-host-port.v1.schema.json +1 -1
  11. package/distr/core/contracts/composition-document.v1.schema.json +1 -1
  12. package/distr/core/contracts/composition-editor-field-kind.v1.schema.json +1 -1
  13. package/distr/core/contracts/composition-editor-manifest.v1.schema.json +1 -1
  14. package/distr/core/contracts/composition-port-manifest.v1.schema.json +1 -1
  15. package/distr/core/contracts/composition-type-manifest.v1.schema.json +1 -1
  16. package/distr/core/js/core-loader.js +12 -10
  17. package/distr/core/js/core-loader.min.js +1 -1
  18. package/distr/core/js/core.js +42 -17
  19. package/distr/core/js/core.min.js +1 -1
  20. package/distr/core/js/smart-base.js +2 -2
  21. package/distr/core/js/smart-base.min.js +1 -1
  22. package/distr/smart/avatar/js/avatar.min.js +1 -1
  23. package/distr/smart/badges/js/badges.min.js +1 -1
  24. package/distr/smart/buttons/js/buttons.min.js +1 -1
  25. package/distr/smart/country-code/js/country-code.min.js +1 -1
  26. package/distr/smart/datepicker/js/datepicker.min.js +1 -1
  27. package/distr/smart/dropdown/js/dropdown.min.js +1 -1
  28. package/distr/smart/file-upload/js/file-upload.min.js +1 -1
  29. package/distr/smart/inputs/js/inputs.min.js +1 -1
  30. package/distr/smart/list-item/js/list-item.min.js +16 -16
  31. package/distr/smart/modal/contract.json +1 -1
  32. package/distr/smart/progress-scale/js/progress-scale.min.js +1 -1
  33. package/distr/smart/reference-link/js/reference-link.min.js +1 -1
  34. package/distr/smart/tags/js/tags.min.js +1 -1
  35. package/distr/smart/textarea/js/textarea.min.js +5 -5
  36. package/package-manifest.json +37 -37
  37. package/package.json +4 -4
@@ -1,4 +1,4 @@
1
- (()=>{"use strict";var e={"98e26702f55a"(e,t,s){function n(){const e=globalThis.SF=globalThis.SF||{};return e.__deprecationNotes instanceof Map||Object.defineProperty(e,"__deprecationNotes",{value:new Map,configurable:!0}),e.__deprecationNotes}function i({component:e="",kind:t="attribute",attribute:s="",from:i,to:o=null}={}){if(!i)return;const r=[e,t,s,i].join("|"),a=n(),l=a.get(r);if(l)l.count+=1;else if(a.set(r,{component:e,kind:t,attribute:s,from:i,to:o,count:1}),function(){const e=globalThis.document?.documentElement;return"warn"===e?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const n=e?`${e}: `:"",r="value"===t?`${s}="${i}"`:`${t} ${i}`;globalThis.console?.warn?.(`[Simai Framework] ${n}${r} is a legacy name${o?`; write ${o}`:""}. See contracts/changes/journal.json.`)}}if(s.d(t,{cS:()=>o,id:()=>l,vl:()=>d}),"undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const e=globalThis.SF.deprecations||{};e.list=function(){return[...n().values()].map(e=>({...e}))},e.clear=function(){n().clear()},e.note=i,globalThis.SF.deprecations=e}const o=Object.freeze(["1/2","1","2"]),r=Object.freeze({"1/3":"1/2",3:"2"}),a=new Set;function l(e,t="field",s="1"){const n=String(e??"").trim().toLowerCase();if(o.includes(n))return n;if(Object.hasOwn(r,n)){const e=r[n];i({component:t,kind:"value",attribute:"size",from:n,to:e});const s=`${t}:${n}`;return a.has(s)||"undefined"==typeof console||(a.add(s),console.warn(`[Simai Framework] ${t}: size ${n} is retired for form fields; rendering size ${e}.`)),e}return s}function d(e,t){if(e?.classList)for(const[s,n]of Object.entries(r)){const n=`${t}--size-${s}`;e.classList.contains(n)&&e.classList.replace(n,`${t}--size-${l(s,t)}`)}}},c43efa1014a6(e,t,s){s.a(e,async(e,n)=>{try{s.d(t,{Wj:()=>j,i:()=>K,pA:()=>B});var i=s("d7f974466839"),o=s("58661bec99a6"),r=s("98e26702f55a"),a=s("0d662e4d7d63"),l=e([a]),d=l.then?(await l)():l;a=d[0];const c={en:{remove:"Remove",uploading:"Uploading",retry:"Try again",linkText:"Click to upload",text:"or drag and drop"},ru:{remove:"Удалить",uploading:"Загрузка",retry:"Повторить",linkText:"Выберите файл",text:"или перетащите его сюда"}},u=".sf-file-upload",f="sfFileUploadBound";function p(e,t=!1){return null==e||""===e?t:"boolean"==typeof e?e:["1","true","yes","on","disabled","multiple"].includes(String(e).toLowerCase())}function m(e){return(0,r.id)(e,"sf-file-upload")}function h(e){const t=Number(e);if(!Number.isFinite(t)||t<0)return"";if(t<1024)return`${t} B`;const s=["KB","MB","GB","TB"];let n=t/1024,i=0;for(;n>=1024&&i<s.length-1;)n/=1024,i+=1;return`${n>=10?n.toFixed(0):n.toFixed(1)}${s[i]}`}function b(e){const t=String(e?.state||e?.status||"process").toLowerCase();return["process","done","error"].includes(t)?t:"process"}function g(e,t){return e?.id?String(e.id):e?.file&&e.file.name?`${e.file.name}-${e.file.size}-${e.file.lastModified}`:e?.name||e?.fileName?`${e.name||e.fileName}-${t}`:`item-${t}`}function _(e){return!!e&&(e.classList.contains("disabled")||e.hasAttribute("disabled"))}function v(e){return e?.querySelector?.('input[type="file"].sf-file-upload-input')||null}function y(e){if(!e)return null;const t=e.dataset.target||e.getAttribute("data-target")||"";if(t)try{const e=document.querySelector(t);if(e)return e}catch{}const s=e.nextElementSibling;return s?.classList?.contains("sf-file-upload-files")?s:e.querySelector(".sf-file-upload-files")||null}function x(e){return!!e&&("1"===e.dataset.renderManaged||e.hasAttribute("data-render-managed"))}function F(e){return e.hasAttribute("multiple")||p(e.dataset.multiple??e.getAttribute("multiple"),!1)}function E(e){return e.dataset.accept||e.getAttribute("accept")||""}function w(e){let t=v(e);return t||(t=document.createElement("input"),t.type="file",t.classList.add("sf-file-upload-input"),t.hidden=!0,t.tabIndex=-1,t.setAttribute("aria-hidden","true"),e.append(t),t)}function S(e,t){if(!e||!t)return;t.multiple=F(e);const s=E(e);s?t.setAttribute("accept",s):t.removeAttribute("accept"),t.disabled=_(e)}function A(e){const t=e.__sfFileUploadInteractionState||={tabIndex:e.getAttribute("tabindex")??"0",disabled:!1,buttons:new WeakMap},s=_(e);t.disabled||(t.tabIndex=e.getAttribute("tabindex")??"0");const n=s?"-1":t.tabIndex;e.getAttribute("tabindex")!==n&&e.setAttribute("tabindex",n),e.getAttribute("aria-disabled")!==String(s)&&e.setAttribute("aria-disabled",String(s)),t.disabled=s,S(e,v(e)),s&&e.classList.contains("dragover")&&e.classList.remove("dragover");const i=y(e);i?.querySelectorAll('button[data-action="remove"], button[data-action="retry"]').forEach(n=>{let i=t.buttons.get(n);i||(i={disabled:n.disabled,managedDisabled:!1,label:null},t.buttons.set(n,i)),i.managedDisabled||(i.disabled=n.disabled);const o=s||i.disabled;if(n.disabled!==o&&(n.disabled=o),i.managedDisabled=s,"remove"!==n.dataset.action)return;const r=n.getAttribute("aria-label");if(!(n.hasAttribute("aria-labelledby")||r&&r!==i.label)){const t=n.closest(".sf-upload-progress")?.querySelector(".sf-upload-progress-name")?.textContent?.trim()||"",s=`${(0,a.pageText)(c,"remove",e,"sf-file-upload")} ${t}`.trim();r!==s&&n.setAttribute("aria-label",s),i.label=s}n.querySelectorAll(".sf-icon").forEach(e=>{"true"!==e.getAttribute("aria-hidden")&&e.setAttribute("aria-hidden","true")})}),i?.querySelectorAll(".sf-upload-progress").forEach(t=>{const s=t.querySelector(".sf-upload-progress-name")?.textContent?.trim()||"",n=`${(0,a.pageText)(c,"uploading",e,"sf-file-upload")} ${s}`.trim(),i=t.querySelector("sf-progress-bar");if(i){const e=i.dataset.sfUploadLabel;return void(i.hasAttribute("label")&&i.getAttribute("label")!==e||(i.getAttribute("label")!==n&&i.setAttribute("label",n),i.dataset.sfUploadLabel=n))}const o=t.querySelector(".sf-progress-bar");if(!o||o.hasAttribute("aria-labelledby"))return;const r=o.getAttribute("aria-label");r&&r!==o.dataset.sfUploadLabel||(r!==n&&o.setAttribute("aria-label",n),o.dataset.label=n,o.dataset.sfUploadLabel=n)})}function U(e,t="1",s=null){const n=m(t),i=String(e.state||e.status||"done").toLowerCase(),o=String(e.name||e.fileName||"File"),r=String(e.fileSize||e.sizeText||""),l=Math.max(0,Math.min(100,Number(e.progress??100)||0)),d=String(e.icon||"cloud_upload"),u=String(e.errorMessage||e.retryText||(0,a.pageText)(c,"retry",s,"sf-file-upload")),f=document.createElement("div");f.className=["sf-upload-progress",`sf-upload-progress--size-${n}`,`sf-upload-progress--${i}`,"flex","items-main-start","items-cross-start"].join(" ");const p=document.createElement("i");p.classList.add("sf-icon"),p.textContent=d;const h=document.createElement("div");h.className="sf-upload-progress-content flex flex-col flex-1";const b=document.createElement("div");b.className="sf-upload-progress-top flex content-main-between";const g=document.createElement("div");g.className="sf-upload-progress-left flex flex-col";const _=document.createElement("div");_.className="sf-upload-progress-name",_.textContent=o;const v=document.createElement("div");if(v.className="sf-upload-progress-text",v.textContent=r,g.append(_,v),b.append(g),"done"===i){const e=document.createElement("i");e.className="sf-icon sf-icon-solid",e.textContent="check_circle",b.append(e)}else{if("error"===i){const e=document.createElement("button");e.type="button",e.className=`sf-icon-button sf-icon-button--icon sf-icon-button--on-surface sf-icon-button--link sf-icon-button--size-${n} flex items-cross-center content-main-center self-cross-start`,e.dataset.action="remove";const t=document.createElement("i");t.className="sf-icon",t.textContent="delete",e.append(t),b.append(e);const s=document.createElement("button");return s.type="button",s.className="sf-upload-progress-repeat self-cross-start",s.dataset.action="retry",s.textContent=u,h.append(b,s),f.append(p,h),f}{const e=document.createElement("button");e.type="button",e.className=`sf-icon-button sf-icon-button--icon sf-icon-button--on-surface sf-icon-button--link sf-icon-button--size-${n} flex items-cross-center content-main-center self-cross-start`,e.dataset.action="remove";const t=document.createElement("i");t.className="sf-icon",t.textContent="delete",e.append(t),b.append(e)}}const y=document.createElement("div");y.className=`sf-progress-bar sf-progress-bar--size-${n} flex flex-row items-cross-center`,y.dataset.value=String(l),y.dataset.textPosition="inline-end";const x=document.createElement("div");x.className="sf-progress-bar-main";const F=document.createElement("div");F.className="sf-progress-bar-progress transition",F.style.width=`${l}%`;const E=document.createElement("div");return E.className="sf-progress-bar-text",E.textContent=`${l}%`,x.append(F),y.append(x,E),h.append(b,y),f.append(p,h),f}function T(e,t=[]){e?.classList?.toggle?.("has-files",t.length>0);const s=y(e);if(!s||x(e))return void(e&&A(e));s.innerHTML="";const n=m(Array.from(e.classList).find(e=>e.startsWith("sf-file-upload--size-"))?.replace("sf-file-upload--size-","")||"1");t.forEach((t,i)=>{const o=U(t,n,e);o.dataset.index=String(i),s.append(o)}),A(e)}function L(e,t,s,n,i="input"){e.dispatchEvent(new CustomEvent("sf-file-upload:file-add",{bubbles:!0,detail:{item:t,index:s,items:n,source:i,multiple:F(e)}}))}function $(e,t,s,n){e.dispatchEvent(new CustomEvent("sf-file-upload:file-error",{bubbles:!0,detail:{item:t,index:s,items:n}}))}function C(e,t,s,n){e.dispatchEvent(new CustomEvent("sf-file-upload:file-complete",{bubbles:!0,detail:{item:t,index:s,items:n}}))}function N(e,t){e.dispatchEvent(new CustomEvent("sf-file-upload:complete",{bubbles:!0,detail:{items:t}}))}function k(e,t=[],s=[]){const n=new Map(s.map((e,t)=>[g(e,t),b(e)]));t.forEach((s,i)=>{const o=g(s,i),r=b(s),a=n.get(o);"error"===r&&"error"!==a&&$(e,s,i,t),"done"===r&&"done"!==a&&C(e,s,i,t)});const i=t.length>0&&t.every(e=>"done"===b(e)),o=s.length>0&&s.every(e=>"done"===b(e));i&&!o&&N(e,t)}function O(e=[]){return Array.from(e).map(e=>({id:`${e.name}-${e.size}-${e.lastModified}`,name:e.name,fileSize:h(e.size),progress:0,state:"process",file:e}))}function R(e,t){if(!e)return!1;const s=Array.from(e.__sfFileUploadItems||[]);if(!s.length)return!1;const n=Number(t);if(!Number.isInteger(n)||n<0||n>=s.length)return!1;const[i]=s.splice(n,1);return e.__sfFileUploadItems=s,T(e,s),e.dispatchEvent(new CustomEvent("sf-file-upload:remove",{bubbles:!0,detail:{item:i||null,index:n,items:s}})),!0}function I(e,t){if(!e)return!1;const s=Array.from(e.__sfFileUploadItems||[]);if(!s.length)return!1;const n=Number(t);if(!Number.isInteger(n)||n<0||n>=s.length)return!1;const i=s.map(e=>({...e})),o=i[n];o.state="process",o.progress=0,delete o.errorMessage,delete o.retryText;const r=Array.from(e.__sfFileUploadItems||[]);return e.__sfFileUploadItems=i,T(e,i),k(e,i,r),e.dispatchEvent(new CustomEvent("sf-file-upload:retry",{bubbles:!0,detail:{item:o,index:n,items:i}})),!0}function M(e,t){const s=String(e||"").split(",").map(e=>e.trim().toLowerCase()).filter(Boolean);if(!s.length)return!0;const n=String(t?.name||"").toLowerCase(),i=String(t?.type||"").toLowerCase();return s.some(e=>e.startsWith(".")?n.endsWith(e):e.endsWith("/*")?i.startsWith(e.slice(0,-1)):i===e)}function z(e,t,s="input"){e.dispatchEvent(new CustomEvent("sf-file-upload:select",{bubbles:!0,detail:{files:t,source:s,multiple:F(e)}}))}function D(e,t=[],s="input"){const n=O(t),i=Array.from(e.__sfFileUploadItems||[]);e.__sfFileUploadItems=n,T(e,n),k(e,n,i),n.forEach((t,i)=>{L(e,t,i,n,s)}),z(e,n,s)}function B(e){if((0,r.vl)(e,"sf-file-upload"),!e)return;const t=w(e),s=y(e);if("function"==typeof e.__sfFileUploadOnClick){if(e.__sfFileUploadBoundInput===t&&e.__sfFileUploadBoundFiles===s)return;j(e)}else"1"!==e.dataset[f]||e.__sfFileUploadItems||x(e)||(e.__sfFileUploadItems=[],e.classList.contains("has-files")&&!e.hasAttribute("data-target")&&T(e,[]),e.classList.remove("has-files","dragover"));A(e),e.hasAttribute("role")||e.setAttribute("role","button");const n=()=>{_(e)||(S(e,t),t.click())},i=t=>{if(_(e))return void t.preventDefault();const s=t.target;s instanceof Element&&(s.closest(".sf-upload-progress-repeat")||s.closest('input[type="file"]')||s.closest('[data-action="remove"]')||n())},o=t=>{t.target!==e||t.repeat||e.matches("button, input, a[href]")||_(e)||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),n())},a=t=>{if(_(e))return;const s=Array.from(t.target?.files||[]);s.length&&(D(e,s,"input"),t.target.value="")},l=t=>{Array.from(t.dataTransfer?.types||[]).includes("Files")&&(t.preventDefault(),_(e)?t.dataTransfer.dropEffect="none":(t.dataTransfer.dropEffect="copy",e.classList.add("dragover")))},d=t=>{e.contains(t.relatedTarget)||e.classList.remove("dragover")},c=t=>{e.classList.remove("dragover");const s=Array.from(t.dataTransfer?.files||[]);if(!s.length&&!Array.from(t.dataTransfer?.types||[]).includes("Files"))return;if(t.preventDefault(),_(e)||!s.length)return;const n=s.filter(t=>M(E(e),t)),i=s.filter(e=>!n.includes(e));if(i.length&&e.dispatchEvent(new CustomEvent("sf-file-upload:reject",{bubbles:!0,detail:{files:i,accept:E(e),source:"drop"}})),!n.length)return;const o=F(e)?n:n.slice(0,1);D(e,o,"drop"),e.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{files:o,source:"drop"}}))},u=t=>{const s=t.target;if(!(s instanceof Element))return;const n=s.closest('[data-action="remove"]'),i=s.closest('[data-action="retry"]');if(!n&&!i)return;if(_(e)||(n||i).disabled)return t.preventDefault(),void t.stopPropagation();const o=(n||i).closest(".sf-upload-progress");o&&(t.preventDefault(),t.stopPropagation(),n?R(e,o.dataset.index):I(e,o.dataset.index))};e.addEventListener("click",i),e.addEventListener("keydown",o),e.addEventListener("dragover",l),e.addEventListener("dragleave",d),e.addEventListener("drop",c),t.addEventListener("change",a),s?.addEventListener("click",u),e.__sfFileUploadOnClick=i,e.__sfFileUploadOnKeydown=o,e.__sfFileUploadOnDragOver=l,e.__sfFileUploadOnDragLeave=d,e.__sfFileUploadOnDrop=c,e.__sfFileUploadOnChange=a,e.__sfFileUploadOnFilesClick=u,e.__sfFileUploadBoundInput=t,e.__sfFileUploadBoundFiles=s;const p=new MutationObserver(()=>A(e));p.observe(e,{attributes:!0,attributeFilter:["disabled","class","accept","multiple","data-accept","data-multiple"]}),s&&p.observe(s,{childList:!0,subtree:!0,characterData:!0}),e.__sfFileUploadInteractionObserver=p,e.dataset[f]="1"}function j(e){if(!e)return;const t=e.__sfFileUploadBoundInput||v(e);e.__sfFileUploadInteractionObserver?.disconnect(),delete e.__sfFileUploadInteractionObserver,e.__sfFileUploadOnClick&&e.removeEventListener("click",e.__sfFileUploadOnClick),e.__sfFileUploadOnKeydown&&e.removeEventListener("keydown",e.__sfFileUploadOnKeydown),e.__sfFileUploadOnDragOver&&e.removeEventListener("dragover",e.__sfFileUploadOnDragOver),e.__sfFileUploadOnDragLeave&&e.removeEventListener("dragleave",e.__sfFileUploadOnDragLeave),e.__sfFileUploadOnDrop&&e.removeEventListener("drop",e.__sfFileUploadOnDrop),t&&e.__sfFileUploadOnChange&&t.removeEventListener("change",e.__sfFileUploadOnChange);const s=e.__sfFileUploadBoundFiles||y(e);s&&e.__sfFileUploadOnFilesClick&&s.removeEventListener("click",e.__sfFileUploadOnFilesClick),delete e.__sfFileUploadOnClick,delete e.__sfFileUploadOnKeydown,delete e.__sfFileUploadOnDragOver,delete e.__sfFileUploadOnDragLeave,delete e.__sfFileUploadOnDrop,delete e.__sfFileUploadOnChange,delete e.__sfFileUploadOnFilesClick,delete e.__sfFileUploadBoundInput,delete e.__sfFileUploadBoundFiles,delete e.dataset[f]}function q(e=document){e.querySelectorAll(u).forEach(P)}function P(e){e.isConnected&&!e.closest("sf-file-upload")&&B(e)}function W(e){const t=e instanceof HTMLElement?e.closest(u)||e:null;return t?Array.from(t.__sfFileUploadItems||[]):[]}function K(e,t=[]){const s=e instanceof HTMLElement?e.closest(u)||e:null;if(!s)return!1;const n=Array.from(s.__sfFileUploadItems||[]);return s.__sfFileUploadItems=Array.isArray(t)?t:[],T(s,s.__sfFileUploadItems),k(s,s.__sfFileUploadItems,n),!0}function G(e){return K(e,[])}class H extends i.y{static componentName="FileUpload";constructor(e){super(e);const{size:t="1",accept:s="",multiple:n=!1,disabled:i=!1,icon:o="cloud_upload",linkText:r,text:l,supportingText:d="",label:u=""}=this.params||{},f=m(t),h=document.createElement("div");h.className="sf-file-upload-wrap flex flex-col gap-1";const b=document.createElement("div");this.id&&(b.id=this.id),b.className=`sf-file-upload sf-file-upload--size-${f} flex flex-col items-cross-center cursor-pointer`;const g=this.attrs.class||this.attrs.className;g&&b.classList.add(...String(g).split(" ").filter(Boolean)),s&&(b.dataset.accept=s),b.dataset.multiple=p(n)?"true":"false",p(n)&&b.setAttribute("multiple",""),p(i)&&b.setAttribute("disabled",""),u&&b.setAttribute("aria-label",u),b.tabIndex=0;const _=document.createElement("div");_.className=`sf-featured-icon sf-featured-icon--size-${f} sf-featured-icon--soft sf-featured-icon--circle sf-featured-icon--neutral`;const v=document.createElement("i");v.className="sf-icon",v.textContent=o,_.append(v);const y=document.createElement("div");y.className="sf-file-upload-bottom flex flex-col items-cross-center";const x=document.createElement("div");x.className="sf-file-upload-block flex";const F=document.createElement("div");F.className="sf-file-upload-block-text";const E=document.createElement("span");if(E.className="sf-file-upload-link",E.textContent=r??(0,a.pageText)(c,"linkText",b,"sf-file-upload"),F.append(E,` ${l??(0,a.pageText)(c,"text",b,"sf-file-upload")}`),x.append(F),y.append(x),d){const e=document.createElement("span");e.className="sf-file-upload-text",e.textContent=d,y.append(e)}b.append(_,y);const w=document.createElement("div");w.className="sf-file-upload-files grid grid-col-1 gap-1 w-full",h.append(b,w),this.root=b,this.template=h}init(){B(this.root)}destroyInternal(){j(this.root)}}(0,o.A)("FileUpload",H),"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.FileUpload=window.SF.FileUpload||{},window.SF.FileUpload.getItems=W,window.SF.FileUpload.setItems=K,window.SF.FileUpload.clear=G,window.SF.FileUpload.removeItem=R),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>q(),{once:!0}):q();new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{e instanceof Element&&(e.matches?.(u)&&P(e),q(e))}),e.removedNodes.forEach(e=>{if(!(e instanceof Element)||e.isConnected)return;const t=[...e.querySelectorAll(u)];e.matches(u)&&t.push(e),t.forEach(e=>{e.isConnected||e.closest("sf-file-upload")||j(e)})})})}).observe(document.documentElement,{childList:!0,subtree:!0}),n()}catch(J){n(J)}})},"58661bec99a6"(e,t,s){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.d(t,["A",0,n])},d7f974466839(e,t,s){s.d(t,{y:()=>n});class n{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 s=e.match(/\(([^)]+)\)/g);s&&s.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 s=this.getUtilityMap();if(!s||!s[t])return;this.extractUtilityClasses(s[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(){}}},"4a441273c368"(e,t,s){s.a(e,async(e,t)=>{try{var n=s("c43efa1014a6"),i=s("fbe0570fcc69"),o=s("a0ca4643a85f"),r=s("98e26702f55a"),a=s("0d662e4d7d63"),l=e([n,i,o,a]);[n,i,o,a]=l.then?(await l)():l;var d=s.n(i);const c={en:{linkText:"Click to upload",text:"or drag and drop",retry:"Try again"},ru:{linkText:"Выберите файл",text:"или перетащите его сюда",retry:"Повторить"}};class u extends(d()){static get props(){return{templateName:{attribute:"template",default:"default"},size:{default:"1",values:r.cS},icon:{default:"upload_file"},linkText:{default:""},text:{default:"or drag and drop"},formats:{default:""},supportingText:{default:""},accept:{default:""},multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},ariaLabel:{default:""}}}constructor(){super(),this._items=[],this._boundRoot=null,this._onSelect=null,this._onRemove=null,this._onRetry=null}get componentName(){return"file-upload"}shouldClearLightDomBeforeFirstRender(){return super.shouldClearLightDomBeforeFirstRender()||"default"===this.templateName&&!!this.querySelector(':scope > .sf-file-upload[data-render-managed="1"]')}get templateName(){return this.getAttribute("template")||"default"}get size(){return(0,r.id)(this.getAttribute("size")||"1","sf-file-upload")}get icon(){return this.getAttribute("icon")||"upload_file"}get linkText(){return this.getAttribute("link-text")||(0,a.pageText)(c,"linkText",this)}get text(){return this.getAttribute("text")||(0,a.pageText)(c,"text",this)}get formats(){return this.getAttribute("formats")||(e=this.accept,String(e||"").split(",").map(e=>e.trim()).filter(Boolean).map(e=>e.replace(/^\./,"")).map(e=>e.includes("/")&&e.split("/").pop()||e).map(e=>e.toUpperCase()).join(", "))||"";var e}get supportingText(){return this.getAttribute("supporting-text")||this.formats}get accept(){return this.getAttribute("accept")||""}get multiple(){return this.getBooleanAttr("multiple",!1)}get disabled(){return this.getBooleanAttr("disabled",!1)}get ariaLabel(){return this.getAttribute("aria-label")||""}get items(){return Array.isArray(this._items)?this._items:[]}set items(e){this._items=Array.isArray(e)?e:[],this.syncRuntimeItems(),this.requestComponentUpdate("items")}templateContext(){const e=this.getPropsContext();return this.createTemplateContext({...e,linkText:this.getAttribute("link-text")||(0,a.pageText)(c,"linkText",this),text:this.getAttribute("text")||(0,a.pageText)(c,"text",this),retryText:(0,a.pageText)(c,"retry",this),component:this,formats:this.formats,supportingText:this.supportingText,items:this.items})}template(){return(0,o.y)(this.templateContext())}get state(){return{size:this.size,icon:this.icon,linkText:this.linkText,text:this.text,formats:this.formats,supportingText:this.supportingText,accept:this.accept,multiple:this.multiple,disabled:this.disabled,items:this.items}}getItems(){return this.items}onFileAdd(e,t){return"function"==typeof e&&this.addEventListener("sf-file-upload:file-add",e,t),this}onFileError(e,t){return"function"==typeof e&&this.addEventListener("sf-file-upload:file-error",e,t),this}onFileComplete(e,t){return"function"==typeof e&&this.addEventListener("sf-file-upload:file-complete",e,t),this}onFileRemove(e,t){return"function"==typeof e&&this.addEventListener("sf-file-upload:remove",e,t),this}onFileRetry(e,t){return"function"==typeof e&&this.addEventListener("sf-file-upload:retry",e,t),this}onComplete(e,t){return"function"==typeof e&&this.addEventListener("sf-file-upload:complete",e,t),this}setItems(e=[]){return this.items=e,this}clear(){return this.items=[],this}removeItem(e){const t=Array.from(this.items),s=Number(e);return!Number.isInteger(s)||s<0||s>=t.length||(t.splice(s,1),this.items=t),this}setState(e={}){if(!e||"object"!=typeof e)return this;const t={...e};return"items"in t&&(this._items=Array.isArray(t.items)?t.items:[],delete t.items),super.setState(t),this.syncRuntimeItems(),this.requestComponentUpdate("state"),this}beforeRender(){this.teardownRuntime()}afterRender(e){if("function"==typeof e)return super.afterRender(e);this._boundRoot=this.querySelector(".sf-file-upload"),this._boundRoot&&((0,n.pA)(this._boundRoot),this.syncRuntimeItems(),this._onSelect=()=>{this._items=Array.from(this._boundRoot?.__sfFileUploadItems||[]),this.requestComponentUpdate("items")},this._onRemove=()=>{this._items=Array.from(this._boundRoot?.__sfFileUploadItems||[]),this.requestComponentUpdate("items")},this._onRetry=()=>{this._items=Array.from(this._boundRoot?.__sfFileUploadItems||[]),this.requestComponentUpdate("items")},this._boundRoot.addEventListener("sf-file-upload:select",this._onSelect),this._boundRoot.addEventListener("sf-file-upload:remove",this._onRemove),this._boundRoot.addEventListener("sf-file-upload:retry",this._onRetry))}onDisconnected(){this.teardownRuntime()}syncRuntimeItems(){this._boundRoot&&(0,n.i)(this._boundRoot,this.items)}teardownRuntime(){this._boundRoot&&this._onSelect&&this._boundRoot.removeEventListener("sf-file-upload:select",this._onSelect),this._boundRoot&&this._onRemove&&this._boundRoot.removeEventListener("sf-file-upload:remove",this._onRemove),this._boundRoot&&this._onRetry&&this._boundRoot.removeEventListener("sf-file-upload:retry",this._onRetry),this._boundRoot&&((0,n.Wj)(this._boundRoot),this._boundRoot=null),this._onSelect=null,this._onRemove=null,this._onRetry=null}}u.define("sf-file-upload"),t()}catch(e){t(e)}})},a0ca4643a85f(e,t,s){s.a(e,async(e,n)=>{try{s.d(t,{y:()=>u});var i=s("ddf1cdb42ecc"),o=s("98e26702f55a"),r=e([i]),a=r.then?(await r)():r;i=a[0];function l(e){const t=String(e||"").toLowerCase();return["process","done","error"].includes(t)?t:"process"}function d(e){const t=Number(e);return Number.isFinite(t)?Math.max(0,Math.min(100,t)):0}function c(e,t,s,n){const o=l(e.state||e.status),r=d(e.progress??("done"===o?100:0)),a=e.icon||"cloud_upload",c=e.name||e.fileName||"File",u=e.fileSize||e.sizeText||"",f=e.errorMessage||e.retryText||n;return i.html`
1
+ (()=>{"use strict";var e={"98e26702f55a"(e,t,s){function n(){const e=globalThis.SF=globalThis.SF||{};return e.__deprecationNotes instanceof Map||Object.defineProperty(e,"__deprecationNotes",{value:new Map,configurable:!0}),e.__deprecationNotes}function i({component:e="",kind:t="attribute",attribute:s="",from:i,to:o=null}={}){if(!i)return;const r=[e,t,s,i].join("|"),a=n(),l=a.get(r);if(l)l.count+=1;else if(a.set(r,{component:e,kind:t,attribute:s,from:i,to:o,count:1}),function(){const e=globalThis.document?.documentElement;return"warn"===e?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const n=e?`${e}: `:"",r="value"===t?`${s}="${i}"`:`${t} ${i}`;globalThis.console?.warn?.(`[SIMAI Framework] ${n}${r} is a legacy name${o?`; write ${o}`:""}. See contracts/changes/journal.json.`)}}if(s.d(t,{cS:()=>o,id:()=>l,vl:()=>d}),"undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const e=globalThis.SF.deprecations||{};e.list=function(){return[...n().values()].map(e=>({...e}))},e.clear=function(){n().clear()},e.note=i,globalThis.SF.deprecations=e}const o=Object.freeze(["1/2","1","2"]),r=Object.freeze({"1/3":"1/2",3:"2"}),a=new Set;function l(e,t="field",s="1"){const n=String(e??"").trim().toLowerCase();if(o.includes(n))return n;if(Object.hasOwn(r,n)){const e=r[n];i({component:t,kind:"value",attribute:"size",from:n,to:e});const s=`${t}:${n}`;return a.has(s)||"undefined"==typeof console||(a.add(s),console.warn(`[SIMAI Framework] ${t}: size ${n} is retired for form fields; rendering size ${e}.`)),e}return s}function d(e,t){if(e?.classList)for(const[s,n]of Object.entries(r)){const n=`${t}--size-${s}`;e.classList.contains(n)&&e.classList.replace(n,`${t}--size-${l(s,t)}`)}}},c43efa1014a6(e,t,s){s.a(e,async(e,n)=>{try{s.d(t,{Wj:()=>j,i:()=>K,pA:()=>B});var i=s("d7f974466839"),o=s("58661bec99a6"),r=s("98e26702f55a"),a=s("0d662e4d7d63"),l=e([a]),d=l.then?(await l)():l;a=d[0];const c={en:{remove:"Remove",uploading:"Uploading",retry:"Try again",linkText:"Click to upload",text:"or drag and drop"},ru:{remove:"Удалить",uploading:"Загрузка",retry:"Повторить",linkText:"Выберите файл",text:"или перетащите его сюда"}},u=".sf-file-upload",f="sfFileUploadBound";function p(e,t=!1){return null==e||""===e?t:"boolean"==typeof e?e:["1","true","yes","on","disabled","multiple"].includes(String(e).toLowerCase())}function m(e){return(0,r.id)(e,"sf-file-upload")}function h(e){const t=Number(e);if(!Number.isFinite(t)||t<0)return"";if(t<1024)return`${t} B`;const s=["KB","MB","GB","TB"];let n=t/1024,i=0;for(;n>=1024&&i<s.length-1;)n/=1024,i+=1;return`${n>=10?n.toFixed(0):n.toFixed(1)}${s[i]}`}function b(e){const t=String(e?.state||e?.status||"process").toLowerCase();return["process","done","error"].includes(t)?t:"process"}function g(e,t){return e?.id?String(e.id):e?.file&&e.file.name?`${e.file.name}-${e.file.size}-${e.file.lastModified}`:e?.name||e?.fileName?`${e.name||e.fileName}-${t}`:`item-${t}`}function _(e){return!!e&&(e.classList.contains("disabled")||e.hasAttribute("disabled"))}function v(e){return e?.querySelector?.('input[type="file"].sf-file-upload-input')||null}function y(e){if(!e)return null;const t=e.dataset.target||e.getAttribute("data-target")||"";if(t)try{const e=document.querySelector(t);if(e)return e}catch{}const s=e.nextElementSibling;return s?.classList?.contains("sf-file-upload-files")?s:e.querySelector(".sf-file-upload-files")||null}function x(e){return!!e&&("1"===e.dataset.renderManaged||e.hasAttribute("data-render-managed"))}function F(e){return e.hasAttribute("multiple")||p(e.dataset.multiple??e.getAttribute("multiple"),!1)}function E(e){return e.dataset.accept||e.getAttribute("accept")||""}function w(e){let t=v(e);return t||(t=document.createElement("input"),t.type="file",t.classList.add("sf-file-upload-input"),t.hidden=!0,t.tabIndex=-1,t.setAttribute("aria-hidden","true"),e.append(t),t)}function S(e,t){if(!e||!t)return;t.multiple=F(e);const s=E(e);s?t.setAttribute("accept",s):t.removeAttribute("accept"),t.disabled=_(e)}function A(e){const t=e.__sfFileUploadInteractionState||={tabIndex:e.getAttribute("tabindex")??"0",disabled:!1,buttons:new WeakMap},s=_(e);t.disabled||(t.tabIndex=e.getAttribute("tabindex")??"0");const n=s?"-1":t.tabIndex;e.getAttribute("tabindex")!==n&&e.setAttribute("tabindex",n),e.getAttribute("aria-disabled")!==String(s)&&e.setAttribute("aria-disabled",String(s)),t.disabled=s,S(e,v(e)),s&&e.classList.contains("dragover")&&e.classList.remove("dragover");const i=y(e);i?.querySelectorAll('button[data-action="remove"], button[data-action="retry"]').forEach(n=>{let i=t.buttons.get(n);i||(i={disabled:n.disabled,managedDisabled:!1,label:null},t.buttons.set(n,i)),i.managedDisabled||(i.disabled=n.disabled);const o=s||i.disabled;if(n.disabled!==o&&(n.disabled=o),i.managedDisabled=s,"remove"!==n.dataset.action)return;const r=n.getAttribute("aria-label");if(!(n.hasAttribute("aria-labelledby")||r&&r!==i.label)){const t=n.closest(".sf-upload-progress")?.querySelector(".sf-upload-progress-name")?.textContent?.trim()||"",s=`${(0,a.pageText)(c,"remove",e,"sf-file-upload")} ${t}`.trim();r!==s&&n.setAttribute("aria-label",s),i.label=s}n.querySelectorAll(".sf-icon").forEach(e=>{"true"!==e.getAttribute("aria-hidden")&&e.setAttribute("aria-hidden","true")})}),i?.querySelectorAll(".sf-upload-progress").forEach(t=>{const s=t.querySelector(".sf-upload-progress-name")?.textContent?.trim()||"",n=`${(0,a.pageText)(c,"uploading",e,"sf-file-upload")} ${s}`.trim(),i=t.querySelector("sf-progress-bar");if(i){const e=i.dataset.sfUploadLabel;return void(i.hasAttribute("label")&&i.getAttribute("label")!==e||(i.getAttribute("label")!==n&&i.setAttribute("label",n),i.dataset.sfUploadLabel=n))}const o=t.querySelector(".sf-progress-bar");if(!o||o.hasAttribute("aria-labelledby"))return;const r=o.getAttribute("aria-label");r&&r!==o.dataset.sfUploadLabel||(r!==n&&o.setAttribute("aria-label",n),o.dataset.label=n,o.dataset.sfUploadLabel=n)})}function U(e,t="1",s=null){const n=m(t),i=String(e.state||e.status||"done").toLowerCase(),o=String(e.name||e.fileName||"File"),r=String(e.fileSize||e.sizeText||""),l=Math.max(0,Math.min(100,Number(e.progress??100)||0)),d=String(e.icon||"cloud_upload"),u=String(e.errorMessage||e.retryText||(0,a.pageText)(c,"retry",s,"sf-file-upload")),f=document.createElement("div");f.className=["sf-upload-progress",`sf-upload-progress--size-${n}`,`sf-upload-progress--${i}`,"flex","items-main-start","items-cross-start"].join(" ");const p=document.createElement("i");p.classList.add("sf-icon"),p.textContent=d;const h=document.createElement("div");h.className="sf-upload-progress-content flex flex-col flex-1";const b=document.createElement("div");b.className="sf-upload-progress-top flex content-main-between";const g=document.createElement("div");g.className="sf-upload-progress-left flex flex-col";const _=document.createElement("div");_.className="sf-upload-progress-name",_.textContent=o;const v=document.createElement("div");if(v.className="sf-upload-progress-text",v.textContent=r,g.append(_,v),b.append(g),"done"===i){const e=document.createElement("i");e.className="sf-icon sf-icon-solid",e.textContent="check_circle",b.append(e)}else{if("error"===i){const e=document.createElement("button");e.type="button",e.className=`sf-icon-button sf-icon-button--icon sf-icon-button--on-surface sf-icon-button--link sf-icon-button--size-${n} flex items-cross-center content-main-center self-cross-start`,e.dataset.action="remove";const t=document.createElement("i");t.className="sf-icon",t.textContent="delete",e.append(t),b.append(e);const s=document.createElement("button");return s.type="button",s.className="sf-upload-progress-repeat self-cross-start",s.dataset.action="retry",s.textContent=u,h.append(b,s),f.append(p,h),f}{const e=document.createElement("button");e.type="button",e.className=`sf-icon-button sf-icon-button--icon sf-icon-button--on-surface sf-icon-button--link sf-icon-button--size-${n} flex items-cross-center content-main-center self-cross-start`,e.dataset.action="remove";const t=document.createElement("i");t.className="sf-icon",t.textContent="delete",e.append(t),b.append(e)}}const y=document.createElement("div");y.className=`sf-progress-bar sf-progress-bar--size-${n} flex flex-row items-cross-center`,y.dataset.value=String(l),y.dataset.textPosition="inline-end";const x=document.createElement("div");x.className="sf-progress-bar-main";const F=document.createElement("div");F.className="sf-progress-bar-progress transition",F.style.width=`${l}%`;const E=document.createElement("div");return E.className="sf-progress-bar-text",E.textContent=`${l}%`,x.append(F),y.append(x,E),h.append(b,y),f.append(p,h),f}function T(e,t=[]){e?.classList?.toggle?.("has-files",t.length>0);const s=y(e);if(!s||x(e))return void(e&&A(e));s.innerHTML="";const n=m(Array.from(e.classList).find(e=>e.startsWith("sf-file-upload--size-"))?.replace("sf-file-upload--size-","")||"1");t.forEach((t,i)=>{const o=U(t,n,e);o.dataset.index=String(i),s.append(o)}),A(e)}function L(e,t,s,n,i="input"){e.dispatchEvent(new CustomEvent("sf-file-upload:file-add",{bubbles:!0,detail:{item:t,index:s,items:n,source:i,multiple:F(e)}}))}function $(e,t,s,n){e.dispatchEvent(new CustomEvent("sf-file-upload:file-error",{bubbles:!0,detail:{item:t,index:s,items:n}}))}function C(e,t,s,n){e.dispatchEvent(new CustomEvent("sf-file-upload:file-complete",{bubbles:!0,detail:{item:t,index:s,items:n}}))}function N(e,t){e.dispatchEvent(new CustomEvent("sf-file-upload:complete",{bubbles:!0,detail:{items:t}}))}function k(e,t=[],s=[]){const n=new Map(s.map((e,t)=>[g(e,t),b(e)]));t.forEach((s,i)=>{const o=g(s,i),r=b(s),a=n.get(o);"error"===r&&"error"!==a&&$(e,s,i,t),"done"===r&&"done"!==a&&C(e,s,i,t)});const i=t.length>0&&t.every(e=>"done"===b(e)),o=s.length>0&&s.every(e=>"done"===b(e));i&&!o&&N(e,t)}function O(e=[]){return Array.from(e).map(e=>({id:`${e.name}-${e.size}-${e.lastModified}`,name:e.name,fileSize:h(e.size),progress:0,state:"process",file:e}))}function I(e,t){if(!e)return!1;const s=Array.from(e.__sfFileUploadItems||[]);if(!s.length)return!1;const n=Number(t);if(!Number.isInteger(n)||n<0||n>=s.length)return!1;const[i]=s.splice(n,1);return e.__sfFileUploadItems=s,T(e,s),e.dispatchEvent(new CustomEvent("sf-file-upload:remove",{bubbles:!0,detail:{item:i||null,index:n,items:s}})),!0}function R(e,t){if(!e)return!1;const s=Array.from(e.__sfFileUploadItems||[]);if(!s.length)return!1;const n=Number(t);if(!Number.isInteger(n)||n<0||n>=s.length)return!1;const i=s.map(e=>({...e})),o=i[n];o.state="process",o.progress=0,delete o.errorMessage,delete o.retryText;const r=Array.from(e.__sfFileUploadItems||[]);return e.__sfFileUploadItems=i,T(e,i),k(e,i,r),e.dispatchEvent(new CustomEvent("sf-file-upload:retry",{bubbles:!0,detail:{item:o,index:n,items:i}})),!0}function M(e,t){const s=String(e||"").split(",").map(e=>e.trim().toLowerCase()).filter(Boolean);if(!s.length)return!0;const n=String(t?.name||"").toLowerCase(),i=String(t?.type||"").toLowerCase();return s.some(e=>e.startsWith(".")?n.endsWith(e):e.endsWith("/*")?i.startsWith(e.slice(0,-1)):i===e)}function z(e,t,s="input"){e.dispatchEvent(new CustomEvent("sf-file-upload:select",{bubbles:!0,detail:{files:t,source:s,multiple:F(e)}}))}function D(e,t=[],s="input"){const n=O(t),i=Array.from(e.__sfFileUploadItems||[]);e.__sfFileUploadItems=n,T(e,n),k(e,n,i),n.forEach((t,i)=>{L(e,t,i,n,s)}),z(e,n,s)}function B(e){if((0,r.vl)(e,"sf-file-upload"),!e)return;const t=w(e),s=y(e);if("function"==typeof e.__sfFileUploadOnClick){if(e.__sfFileUploadBoundInput===t&&e.__sfFileUploadBoundFiles===s)return;j(e)}else"1"!==e.dataset[f]||e.__sfFileUploadItems||x(e)||(e.__sfFileUploadItems=[],e.classList.contains("has-files")&&!e.hasAttribute("data-target")&&T(e,[]),e.classList.remove("has-files","dragover"));A(e),e.hasAttribute("role")||e.setAttribute("role","button");const n=()=>{_(e)||(S(e,t),t.click())},i=t=>{if(_(e))return void t.preventDefault();const s=t.target;s instanceof Element&&(s.closest(".sf-upload-progress-repeat")||s.closest('input[type="file"]')||s.closest('[data-action="remove"]')||n())},o=t=>{t.target!==e||t.repeat||e.matches("button, input, a[href]")||_(e)||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),n())},a=t=>{if(_(e))return;const s=Array.from(t.target?.files||[]);s.length&&(D(e,s,"input"),t.target.value="")},l=t=>{Array.from(t.dataTransfer?.types||[]).includes("Files")&&(t.preventDefault(),_(e)?t.dataTransfer.dropEffect="none":(t.dataTransfer.dropEffect="copy",e.classList.add("dragover")))},d=t=>{e.contains(t.relatedTarget)||e.classList.remove("dragover")},c=t=>{e.classList.remove("dragover");const s=Array.from(t.dataTransfer?.files||[]);if(!s.length&&!Array.from(t.dataTransfer?.types||[]).includes("Files"))return;if(t.preventDefault(),_(e)||!s.length)return;const n=s.filter(t=>M(E(e),t)),i=s.filter(e=>!n.includes(e));if(i.length&&e.dispatchEvent(new CustomEvent("sf-file-upload:reject",{bubbles:!0,detail:{files:i,accept:E(e),source:"drop"}})),!n.length)return;const o=F(e)?n:n.slice(0,1);D(e,o,"drop"),e.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{files:o,source:"drop"}}))},u=t=>{const s=t.target;if(!(s instanceof Element))return;const n=s.closest('[data-action="remove"]'),i=s.closest('[data-action="retry"]');if(!n&&!i)return;if(_(e)||(n||i).disabled)return t.preventDefault(),void t.stopPropagation();const o=(n||i).closest(".sf-upload-progress");o&&(t.preventDefault(),t.stopPropagation(),n?I(e,o.dataset.index):R(e,o.dataset.index))};e.addEventListener("click",i),e.addEventListener("keydown",o),e.addEventListener("dragover",l),e.addEventListener("dragleave",d),e.addEventListener("drop",c),t.addEventListener("change",a),s?.addEventListener("click",u),e.__sfFileUploadOnClick=i,e.__sfFileUploadOnKeydown=o,e.__sfFileUploadOnDragOver=l,e.__sfFileUploadOnDragLeave=d,e.__sfFileUploadOnDrop=c,e.__sfFileUploadOnChange=a,e.__sfFileUploadOnFilesClick=u,e.__sfFileUploadBoundInput=t,e.__sfFileUploadBoundFiles=s;const p=new MutationObserver(()=>A(e));p.observe(e,{attributes:!0,attributeFilter:["disabled","class","accept","multiple","data-accept","data-multiple"]}),s&&p.observe(s,{childList:!0,subtree:!0,characterData:!0}),e.__sfFileUploadInteractionObserver=p,e.dataset[f]="1"}function j(e){if(!e)return;const t=e.__sfFileUploadBoundInput||v(e);e.__sfFileUploadInteractionObserver?.disconnect(),delete e.__sfFileUploadInteractionObserver,e.__sfFileUploadOnClick&&e.removeEventListener("click",e.__sfFileUploadOnClick),e.__sfFileUploadOnKeydown&&e.removeEventListener("keydown",e.__sfFileUploadOnKeydown),e.__sfFileUploadOnDragOver&&e.removeEventListener("dragover",e.__sfFileUploadOnDragOver),e.__sfFileUploadOnDragLeave&&e.removeEventListener("dragleave",e.__sfFileUploadOnDragLeave),e.__sfFileUploadOnDrop&&e.removeEventListener("drop",e.__sfFileUploadOnDrop),t&&e.__sfFileUploadOnChange&&t.removeEventListener("change",e.__sfFileUploadOnChange);const s=e.__sfFileUploadBoundFiles||y(e);s&&e.__sfFileUploadOnFilesClick&&s.removeEventListener("click",e.__sfFileUploadOnFilesClick),delete e.__sfFileUploadOnClick,delete e.__sfFileUploadOnKeydown,delete e.__sfFileUploadOnDragOver,delete e.__sfFileUploadOnDragLeave,delete e.__sfFileUploadOnDrop,delete e.__sfFileUploadOnChange,delete e.__sfFileUploadOnFilesClick,delete e.__sfFileUploadBoundInput,delete e.__sfFileUploadBoundFiles,delete e.dataset[f]}function q(e=document){e.querySelectorAll(u).forEach(P)}function P(e){e.isConnected&&!e.closest("sf-file-upload")&&B(e)}function W(e){const t=e instanceof HTMLElement?e.closest(u)||e:null;return t?Array.from(t.__sfFileUploadItems||[]):[]}function K(e,t=[]){const s=e instanceof HTMLElement?e.closest(u)||e:null;if(!s)return!1;const n=Array.from(s.__sfFileUploadItems||[]);return s.__sfFileUploadItems=Array.isArray(t)?t:[],T(s,s.__sfFileUploadItems),k(s,s.__sfFileUploadItems,n),!0}function G(e){return K(e,[])}class H extends i.y{static componentName="FileUpload";constructor(e){super(e);const{size:t="1",accept:s="",multiple:n=!1,disabled:i=!1,icon:o="cloud_upload",linkText:r,text:l,supportingText:d="",label:u=""}=this.params||{},f=m(t),h=document.createElement("div");h.className="sf-file-upload-wrap flex flex-col gap-1";const b=document.createElement("div");this.id&&(b.id=this.id),b.className=`sf-file-upload sf-file-upload--size-${f} flex flex-col items-cross-center cursor-pointer`;const g=this.attrs.class||this.attrs.className;g&&b.classList.add(...String(g).split(" ").filter(Boolean)),s&&(b.dataset.accept=s),b.dataset.multiple=p(n)?"true":"false",p(n)&&b.setAttribute("multiple",""),p(i)&&b.setAttribute("disabled",""),u&&b.setAttribute("aria-label",u),b.tabIndex=0;const _=document.createElement("div");_.className=`sf-featured-icon sf-featured-icon--size-${f} sf-featured-icon--soft sf-featured-icon--circle sf-featured-icon--neutral`;const v=document.createElement("i");v.className="sf-icon",v.textContent=o,_.append(v);const y=document.createElement("div");y.className="sf-file-upload-bottom flex flex-col items-cross-center";const x=document.createElement("div");x.className="sf-file-upload-block flex";const F=document.createElement("div");F.className="sf-file-upload-block-text";const E=document.createElement("span");if(E.className="sf-file-upload-link",E.textContent=r??(0,a.pageText)(c,"linkText",b,"sf-file-upload"),F.append(E,` ${l??(0,a.pageText)(c,"text",b,"sf-file-upload")}`),x.append(F),y.append(x),d){const e=document.createElement("span");e.className="sf-file-upload-text",e.textContent=d,y.append(e)}b.append(_,y);const w=document.createElement("div");w.className="sf-file-upload-files grid grid-col-1 gap-1 w-full",h.append(b,w),this.root=b,this.template=h}init(){B(this.root)}destroyInternal(){j(this.root)}}(0,o.A)("FileUpload",H),"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.FileUpload=window.SF.FileUpload||{},window.SF.FileUpload.getItems=W,window.SF.FileUpload.setItems=K,window.SF.FileUpload.clear=G,window.SF.FileUpload.removeItem=I),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>q(),{once:!0}):q();new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{e instanceof Element&&(e.matches?.(u)&&P(e),q(e))}),e.removedNodes.forEach(e=>{if(!(e instanceof Element)||e.isConnected)return;const t=[...e.querySelectorAll(u)];e.matches(u)&&t.push(e),t.forEach(e=>{e.isConnected||e.closest("sf-file-upload")||j(e)})})})}).observe(document.documentElement,{childList:!0,subtree:!0}),n()}catch(J){n(J)}})},"58661bec99a6"(e,t,s){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.d(t,["A",0,n])},d7f974466839(e,t,s){s.d(t,{y:()=>n});class n{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 s=e.match(/\(([^)]+)\)/g);s&&s.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 s=this.getUtilityMap();if(!s||!s[t])return;this.extractUtilityClasses(s[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(){}}},"4a441273c368"(e,t,s){s.a(e,async(e,t)=>{try{var n=s("c43efa1014a6"),i=s("fbe0570fcc69"),o=s("a0ca4643a85f"),r=s("98e26702f55a"),a=s("0d662e4d7d63"),l=e([n,i,o,a]);[n,i,o,a]=l.then?(await l)():l;var d=s.n(i);const c={en:{linkText:"Click to upload",text:"or drag and drop",retry:"Try again"},ru:{linkText:"Выберите файл",text:"или перетащите его сюда",retry:"Повторить"}};class u extends(d()){static get props(){return{templateName:{attribute:"template",default:"default"},size:{default:"1",values:r.cS},icon:{default:"upload_file"},linkText:{default:""},text:{default:"or drag and drop"},formats:{default:""},supportingText:{default:""},accept:{default:""},multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},ariaLabel:{default:""}}}constructor(){super(),this._items=[],this._boundRoot=null,this._onSelect=null,this._onRemove=null,this._onRetry=null}get componentName(){return"file-upload"}shouldClearLightDomBeforeFirstRender(){return super.shouldClearLightDomBeforeFirstRender()||"default"===this.templateName&&!!this.querySelector(':scope > .sf-file-upload[data-render-managed="1"]')}get templateName(){return this.getAttribute("template")||"default"}get size(){return(0,r.id)(this.getAttribute("size")||"1","sf-file-upload")}get icon(){return this.getAttribute("icon")||"upload_file"}get linkText(){return this.getAttribute("link-text")||(0,a.pageText)(c,"linkText",this)}get text(){return this.getAttribute("text")||(0,a.pageText)(c,"text",this)}get formats(){return this.getAttribute("formats")||(e=this.accept,String(e||"").split(",").map(e=>e.trim()).filter(Boolean).map(e=>e.replace(/^\./,"")).map(e=>e.includes("/")&&e.split("/").pop()||e).map(e=>e.toUpperCase()).join(", "))||"";var e}get supportingText(){return this.getAttribute("supporting-text")||this.formats}get accept(){return this.getAttribute("accept")||""}get multiple(){return this.getBooleanAttr("multiple",!1)}get disabled(){return this.getBooleanAttr("disabled",!1)}get ariaLabel(){return this.getAttribute("aria-label")||""}get items(){return Array.isArray(this._items)?this._items:[]}set items(e){this._items=Array.isArray(e)?e:[],this.syncRuntimeItems(),this.requestComponentUpdate("items")}templateContext(){const e=this.getPropsContext();return this.createTemplateContext({...e,linkText:this.getAttribute("link-text")||(0,a.pageText)(c,"linkText",this),text:this.getAttribute("text")||(0,a.pageText)(c,"text",this),retryText:(0,a.pageText)(c,"retry",this),component:this,formats:this.formats,supportingText:this.supportingText,items:this.items})}template(){return(0,o.y)(this.templateContext())}get state(){return{size:this.size,icon:this.icon,linkText:this.linkText,text:this.text,formats:this.formats,supportingText:this.supportingText,accept:this.accept,multiple:this.multiple,disabled:this.disabled,items:this.items}}getItems(){return this.items}onFileAdd(e,t){return"function"==typeof e&&this.addEventListener("sf-file-upload:file-add",e,t),this}onFileError(e,t){return"function"==typeof e&&this.addEventListener("sf-file-upload:file-error",e,t),this}onFileComplete(e,t){return"function"==typeof e&&this.addEventListener("sf-file-upload:file-complete",e,t),this}onFileRemove(e,t){return"function"==typeof e&&this.addEventListener("sf-file-upload:remove",e,t),this}onFileRetry(e,t){return"function"==typeof e&&this.addEventListener("sf-file-upload:retry",e,t),this}onComplete(e,t){return"function"==typeof e&&this.addEventListener("sf-file-upload:complete",e,t),this}setItems(e=[]){return this.items=e,this}clear(){return this.items=[],this}removeItem(e){const t=Array.from(this.items),s=Number(e);return!Number.isInteger(s)||s<0||s>=t.length||(t.splice(s,1),this.items=t),this}setState(e={}){if(!e||"object"!=typeof e)return this;const t={...e};return"items"in t&&(this._items=Array.isArray(t.items)?t.items:[],delete t.items),super.setState(t),this.syncRuntimeItems(),this.requestComponentUpdate("state"),this}beforeRender(){this.teardownRuntime()}afterRender(e){if("function"==typeof e)return super.afterRender(e);this._boundRoot=this.querySelector(".sf-file-upload"),this._boundRoot&&((0,n.pA)(this._boundRoot),this.syncRuntimeItems(),this._onSelect=()=>{this._items=Array.from(this._boundRoot?.__sfFileUploadItems||[]),this.requestComponentUpdate("items")},this._onRemove=()=>{this._items=Array.from(this._boundRoot?.__sfFileUploadItems||[]),this.requestComponentUpdate("items")},this._onRetry=()=>{this._items=Array.from(this._boundRoot?.__sfFileUploadItems||[]),this.requestComponentUpdate("items")},this._boundRoot.addEventListener("sf-file-upload:select",this._onSelect),this._boundRoot.addEventListener("sf-file-upload:remove",this._onRemove),this._boundRoot.addEventListener("sf-file-upload:retry",this._onRetry))}onDisconnected(){this.teardownRuntime()}syncRuntimeItems(){this._boundRoot&&(0,n.i)(this._boundRoot,this.items)}teardownRuntime(){this._boundRoot&&this._onSelect&&this._boundRoot.removeEventListener("sf-file-upload:select",this._onSelect),this._boundRoot&&this._onRemove&&this._boundRoot.removeEventListener("sf-file-upload:remove",this._onRemove),this._boundRoot&&this._onRetry&&this._boundRoot.removeEventListener("sf-file-upload:retry",this._onRetry),this._boundRoot&&((0,n.Wj)(this._boundRoot),this._boundRoot=null),this._onSelect=null,this._onRemove=null,this._onRetry=null}}u.define("sf-file-upload"),t()}catch(e){t(e)}})},a0ca4643a85f(e,t,s){s.a(e,async(e,n)=>{try{s.d(t,{y:()=>u});var i=s("ddf1cdb42ecc"),o=s("98e26702f55a"),r=e([i]),a=r.then?(await r)():r;i=a[0];function l(e){const t=String(e||"").toLowerCase();return["process","done","error"].includes(t)?t:"process"}function d(e){const t=Number(e);return Number.isFinite(t)?Math.max(0,Math.min(100,t)):0}function c(e,t,s,n){const o=l(e.state||e.status),r=d(e.progress??("done"===o?100:0)),a=e.icon||"cloud_upload",c=e.name||e.fileName||"File",u=e.fileSize||e.sizeText||"",f=e.errorMessage||e.retryText||n;return i.html`
2
2
  <div
3
3
  class="sf-upload-progress sf-upload-progress--size-${t} sf-upload-progress--${o} flex items-main-start items-cross-start"
4
4
  data-index=${String(s)}
@@ -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:()=>_});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 y(t,e=!1){return null==t||""===t?e:"boolean"==typeof t?t:["1","true","yes","on"].includes(String(t).toLowerCase())}function b(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=y(r,!0)),void 0!==s&&""!==s&&(a.placeholderChar=String(s)),a}async function $(t,e){const n=function(t,e){if(!y(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||b(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=b(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 _(t){if(!t||"1"!==t.dataset[p])return;delete t.__sfInputMaskRequest;const e=b(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 L(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:b="",value:w="",name:x="",leftIcon:S="",rightText:v="",hintIcon:$="",disabled:k=!1,readonly:_=!1,error:L=!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",y(I||L,!1)),this.template.dataset.mask=String(y(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),y(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=y(k,!1),B.readOnly=y(_,!1),B.required=y(r,!0),B.dataset.mask=String(y(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",y(I||L,!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=y(I||L,!1)&&E?E:b;if(U){const t=document.createElement("span");t.classList.add("sf-input-hint-text-wrap"),t.textContent=String(U),t.dataset.fieldMessage=y(I||L,!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(){_(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=b(n);if(!a)return!1;if(Object.prototype.hasOwnProperty.call(e,"disabled")&&(a.disabled=y(e.disabled)),Object.prototype.hasOwnProperty.call(e,"error")){const t=y(e.error);n.classList.toggle("error",t),a.classList.toggle("error",t)}if(Object.prototype.hasOwnProperty.call(e,"invalid")){const t=y(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",()=>L()):L();new MutationObserver(t=>{t.forEach(t=>{t.addedNodes.forEach(t=>{t instanceof Element&&(t.matches?.(c)&&k(t),L(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:""}}}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")||""}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:y,hasControlledValue:b,name:w,leftIcon:x,rightText:S,hintIcon:v,disabled:$,error:k,invalid:_,errorMessage:L,mask:I,rootClass:E,rootStyle:C,readonly:A,maskPattern:M,maskLazy:P,maskPlaceholderChar:q,maskOptions:O}=t,j=""===P?"":String(P),F=b?g:y,T=(0,s.h)(t.component,{prefix:"sf-input",required:o,invalid:_||k,hint:m,errorMessage:L}),N=["sf-input",T.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:()=>_});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 y(t,e=!1){return null==t||""===t?e:"boolean"==typeof t?t:["1","true","yes","on"].includes(String(t).toLowerCase())}function b(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=y(r,!0)),void 0!==s&&""!==s&&(a.placeholderChar=String(s)),a}async function $(t,e){const n=function(t,e){if(!y(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||b(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=b(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 _(t){if(!t||"1"!==t.dataset[p])return;delete t.__sfInputMaskRequest;const e=b(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 L(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:b="",value:w="",name:x="",leftIcon:S="",rightText:v="",hintIcon:$="",disabled:k=!1,readonly:_=!1,error:L=!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",y(I||L,!1)),this.template.dataset.mask=String(y(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),y(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=y(k,!1),B.readOnly=y(_,!1),B.required=y(r,!0),B.dataset.mask=String(y(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",y(I||L,!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=y(I||L,!1)&&E?E:b;if(U){const t=document.createElement("span");t.classList.add("sf-input-hint-text-wrap"),t.textContent=String(U),t.dataset.fieldMessage=y(I||L,!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(){_(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=b(n);if(!a)return!1;if(Object.prototype.hasOwnProperty.call(e,"disabled")&&(a.disabled=y(e.disabled)),Object.prototype.hasOwnProperty.call(e,"error")){const t=y(e.error);n.classList.toggle("error",t),a.classList.toggle("error",t)}if(Object.prototype.hasOwnProperty.call(e,"invalid")){const t=y(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",()=>L()):L();new MutationObserver(t=>{t.forEach(t=>{t.addedNodes.forEach(t=>{t instanceof Element&&(t.matches?.(c)&&k(t),L(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:""}}}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")||""}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:y,hasControlledValue:b,name:w,leftIcon:x,rightText:S,hintIcon:v,disabled:$,error:k,invalid:_,errorMessage:L,mask:I,rootClass:E,rootStyle:C,readonly:A,maskPattern:M,maskLazy:P,maskPlaceholderChar:q,maskOptions:O}=t,j=""===P?"":String(P),F=b?g:y,T=(0,s.h)(t.component,{prefix:"sf-input",required:o,invalid:_||k,hint:m,errorMessage:L}),N=["sf-input",T.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=${F}
@@ -1,17 +1,17 @@
1
- (()=>{"use strict";var e={"98e26702f55a"(e,t,a){function i(){const e=globalThis.SF=globalThis.SF||{};return e.__deprecationNotes instanceof Map||Object.defineProperty(e,"__deprecationNotes",{value:new Map,configurable:!0}),e.__deprecationNotes}if(a.d(t,{kA:()=>o}),"undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const e=globalThis.SF.deprecations||{};e.list=function(){return[...i().values()].map(e=>({...e}))},e.clear=function(){i().clear()},e.note=function({component:e="",kind:t="attribute",attribute:a="",from:s,to:r=null}={}){if(!s)return;const o=[e,t,a,s].join("|"),l=i(),n=l.get(o);if(n)n.count+=1;else if(l.set(o,{component:e,kind:t,attribute:a,from:s,to:r,count:1}),function(){const e=globalThis.document?.documentElement;return"warn"===e?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const i=e?`${e}: `:"",o="value"===t?`${a}="${s}"`:`${t} ${s}`;globalThis.console?.warn?.(`[Simai Framework] ${i}${o} is a legacy name${r?`; write ${r}`:""}. See contracts/changes/journal.json.`)}},globalThis.SF.deprecations=e}const s=Object.freeze(["1/2","1","2"]),r=Object.freeze({"1/3":"1/2",3:"2"});new Set;function o(e){const t=String(e??"").trim().toLowerCase();return s.includes(t)?t:Object.hasOwn(r,t)?r[t]:"1"}},e4b691e01e6b(e,t,a){a.a(e,async(e,t)=>{try{var i=a("fbe0570fcc69"),s=a("c22590307c6c"),r=a("98e26702f55a"),o=e([i,s]);[i,s]=o.then?(await o)():o;var l=a.n(i);function n(e){const t=e;return"1/3"===t||"1/2"===t?{item:t,checkbox:(0,r.kA)(t),avatarGroup:"1/2",colorTag:"1/2"}:{item:t,checkbox:(0,r.kA)(t),avatarGroup:t,colorTag:"1"}}class c extends(l()){static get props(){return{templateName:{attribute:"template",default:"default"},itemValue:{attribute:"value",default:""},kind:{default:"text",values:["text","icon","checkbox","avatar","color"],aliases:["type"]},size:{default:"1",values:["1/3","1/2","1","2","3"]},text:{default:""},icon:{default:"person"},checked:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},colorClass:{default:"bg-tertiary"},avatarImageUrl:{default:""},avatarTitle:{default:""},ariaLabel:{default:""}}}get componentName(){return"list-item"}get templateName(){return this.getAttribute("template")||"default"}get kind(){return this.getProp("kind")}get type(){return this.kind}get itemValue(){return this.getAttribute("value")||""}get size(){return this.getEnumAttr("size",["1/3","1/2","1","2","3"],"1")}get sizeGroup(){return n(this.size)}get text(){return this.getAttribute("text")||""}get icon(){return this.getAttribute("icon")||"person"}get checked(){return this.getBooleanAttr("checked",!1)}get selected(){return this.getBooleanAttr("selected",!1)}get disabled(){return this.getBooleanAttr("disabled",!1)}get colorClass(){return this.getAttribute("color-class")||"bg-tertiary"}get avatarImageUrl(){return this.getAttribute("avatar-image-url")||""}get avatarTitle(){return this.getAttribute("avatar-title")||this.text}get ariaLabel(){return this.getAttribute("aria-label")||""}templateContext(){const e=this.getPropsContext();return this.createTemplateContext({...e,component:this,sizeGroup:this.sizeGroup,avatarTitle:this.avatarTitle,type:this.type,value:this.itemValue,option:!1})}template(){return(0,s.Ws)(this.templateContext())}resolveUpdateMode(e=[]){return e.length>0&&e.every(e=>["text","aria-label","disabled","selected","checked"].includes(e))?"dom":"lit"}updateDom(e=[]){const t=this.querySelector(".sf-list-item"),a=this.querySelector(".sf-list-item-container, .sf-avatar-label-group-title, .sf-tag-container"),i=this.querySelector(".sf-checkbox input");return!!t&&(e.includes("text")&&a&&(a.textContent=this.text),e.includes("disabled")&&(t.classList.toggle("disabled",this.disabled),i&&(i.disabled=this.disabled)),e.includes("selected")&&t.classList.toggle("selected",this.selected),i&&(e.includes("checked")||e.includes("selected"))&&(i.checked=this.checked||this.selected),!0)}get value(){return{template:this.templateName,value:this.itemValue,type:this.type,size:this.size,text:this.text,icon:this.icon,checked:this.checked,selected:this.selected,disabled:this.disabled,colorClass:this.colorClass,avatarImageUrl:this.avatarImageUrl,avatarTitle:this.avatarTitle,ariaLabel:this.ariaLabel}}set value(e){if(!e||"object"!=typeof e)return;const{value:t,...a}=e;Object.prototype.hasOwnProperty.call(e,"value")&&this.setAttributeValue("value",t),this.setValueAttributes(a)}}c.define("sf-list-item"),t()}catch(d){t(d)}})},c22590307c6c(e,t,a){a.a(e,async(e,i)=>{try{a.d(t,{Ws:()=>l});var s=a("ddf1cdb42ecc"),r=(a("98e26702f55a"),e([s])),o=r.then?(await r)():r;s=o[0];function l(e){const t=!0===e.option,a=e.component?.hasSlotContent?.("text")?e.component.getSlotContent("text"):e.text,i=e.component?.hasSlotContent?.("leading")?e.component.getSlotContent("leading"):s.nothing,r=e.component?.hasSlotContent?.("trailing")?e.component.getSlotContent("trailing"):s.nothing,o=["sf-list-item","flex","items-cross-center",`sf-list-item--${e.kind??e.type}`,`sf-list-item--size-${e.size}`,t?"cursor-pointer":"",e.selected?"selected":"",e.disabled?"disabled":"",e.rootClass].filter(Boolean),l=["sf-list-item-wrap","flex","flex-1"];["icon","checkbox","avatar","color"].includes(e.type)&&l.push("flex","flex-row","flex-nowrap","items-center","gap-2"),"avatar"!==e.type&&"color"!==e.type||(l.splice(l.indexOf("gap-2"),1),l.push("justify-between","gap-2"));return s.html`
1
+ (()=>{"use strict";var e={"98e26702f55a"(e,t,a){function s(){const e=globalThis.SF=globalThis.SF||{};return e.__deprecationNotes instanceof Map||Object.defineProperty(e,"__deprecationNotes",{value:new Map,configurable:!0}),e.__deprecationNotes}if(a.d(t,{kA:()=>o}),"undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const e=globalThis.SF.deprecations||{};e.list=function(){return[...s().values()].map(e=>({...e}))},e.clear=function(){s().clear()},e.note=function({component:e="",kind:t="attribute",attribute:a="",from:i,to:r=null}={}){if(!i)return;const o=[e,t,a,i].join("|"),l=s(),n=l.get(o);if(n)n.count+=1;else if(l.set(o,{component:e,kind:t,attribute:a,from:i,to:r,count:1}),function(){const e=globalThis.document?.documentElement;return"warn"===e?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const s=e?`${e}: `:"",o="value"===t?`${a}="${i}"`:`${t} ${i}`;globalThis.console?.warn?.(`[SIMAI Framework] ${s}${o} is a legacy name${r?`; write ${r}`:""}. See contracts/changes/journal.json.`)}},globalThis.SF.deprecations=e}const i=Object.freeze(["1/2","1","2"]),r=Object.freeze({"1/3":"1/2",3:"2"});new Set;function o(e){const t=String(e??"").trim().toLowerCase();return i.includes(t)?t:Object.hasOwn(r,t)?r[t]:"1"}},e4b691e01e6b(e,t,a){a.a(e,async(e,t)=>{try{var s=a("fbe0570fcc69"),i=a("c22590307c6c"),r=a("98e26702f55a"),o=e([s,i]);[s,i]=o.then?(await o)():o;var l=a.n(s);function n(e){const t=e;return"1/3"===t||"1/2"===t?{item:t,checkbox:(0,r.kA)(t),avatarGroup:"1/2",colorTag:"1/2"}:{item:t,checkbox:(0,r.kA)(t),avatarGroup:t,colorTag:"1"}}class c extends(l()){static get props(){return{templateName:{attribute:"template",default:"default"},itemValue:{attribute:"value",default:""},kind:{default:"text",values:["text","icon","checkbox","avatar","color"],aliases:["type"]},size:{default:"1",values:["1/3","1/2","1","2","3"]},text:{default:""},icon:{default:"person"},checked:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},colorClass:{default:"bg-tertiary"},avatarImageUrl:{default:""},avatarTitle:{default:""},ariaLabel:{default:""}}}get componentName(){return"list-item"}get templateName(){return this.getAttribute("template")||"default"}get kind(){return this.getProp("kind")}get type(){return this.kind}get itemValue(){return this.getAttribute("value")||""}get size(){return this.getEnumAttr("size",["1/3","1/2","1","2","3"],"1")}get sizeGroup(){return n(this.size)}get text(){return this.getAttribute("text")||""}get icon(){return this.getAttribute("icon")||"person"}get checked(){return this.getBooleanAttr("checked",!1)}get selected(){return this.getBooleanAttr("selected",!1)}get disabled(){return this.getBooleanAttr("disabled",!1)}get colorClass(){return this.getAttribute("color-class")||"bg-tertiary"}get avatarImageUrl(){return this.getAttribute("avatar-image-url")||""}get avatarTitle(){return this.getAttribute("avatar-title")||this.text}get ariaLabel(){return this.getAttribute("aria-label")||""}templateContext(){const e=this.getPropsContext();return this.createTemplateContext({...e,component:this,sizeGroup:this.sizeGroup,avatarTitle:this.avatarTitle,type:this.type,value:this.itemValue,option:!1})}template(){return(0,i.Ws)(this.templateContext())}resolveUpdateMode(e=[]){return e.length>0&&e.every(e=>["text","aria-label","disabled","selected","checked"].includes(e))?"dom":"lit"}updateDom(e=[]){const t=this.querySelector(".sf-list-item"),a=this.querySelector(".sf-list-item-container, .sf-avatar-label-group-title, .sf-tag-container"),s=this.querySelector(".sf-checkbox input");return!!t&&(e.includes("text")&&a&&(a.textContent=this.text),e.includes("disabled")&&(t.classList.toggle("disabled",this.disabled),s&&(s.disabled=this.disabled)),e.includes("selected")&&t.classList.toggle("selected",this.selected),s&&(e.includes("checked")||e.includes("selected"))&&(s.checked=this.checked||this.selected),!0)}get value(){return{template:this.templateName,value:this.itemValue,type:this.type,size:this.size,text:this.text,icon:this.icon,checked:this.checked,selected:this.selected,disabled:this.disabled,colorClass:this.colorClass,avatarImageUrl:this.avatarImageUrl,avatarTitle:this.avatarTitle,ariaLabel:this.ariaLabel}}set value(e){if(!e||"object"!=typeof e)return;const{value:t,...a}=e;Object.prototype.hasOwnProperty.call(e,"value")&&this.setAttributeValue("value",t),this.setValueAttributes(a)}}c.define("sf-list-item"),t()}catch(d){t(d)}})},c22590307c6c(e,t,a){a.a(e,async(e,s)=>{try{a.d(t,{Ws:()=>l});var i=a("ddf1cdb42ecc"),r=(a("98e26702f55a"),e([i])),o=r.then?(await r)():r;i=o[0];function l(e){const t=!0===e.option,a=e.component?.hasSlotContent?.("text")?e.component.getSlotContent("text"):e.text,s=e.component?.hasSlotContent?.("leading")?e.component.getSlotContent("leading"):i.nothing,r=e.component?.hasSlotContent?.("trailing")?e.component.getSlotContent("trailing"):i.nothing,o=["sf-list-item","flex","items-cross-center",`sf-list-item--${e.kind??e.type}`,`sf-list-item--size-${e.size}`,t?"cursor-pointer":"",e.selected?"selected":"",e.disabled?"disabled":"",e.rootClass].filter(Boolean),l=["sf-list-item-wrap","flex","flex-1"];["icon","checkbox","avatar","color"].includes(e.type)&&l.push("flex","flex-row","flex-nowrap","items-center","gap-2"),"avatar"!==e.type&&"color"!==e.type||(l.splice(l.indexOf("gap-2"),1),l.push("justify-between","gap-2"));return i.html`
2
2
  <div
3
3
  class=${o.join(" ")}
4
- style=${e.rootStyle||s.nothing}
5
- role=${t?"option":s.nothing}
6
- tabindex=${t?"-1":s.nothing}
7
- data-value=${t&&e.value||s.nothing}
8
- aria-label=${t&&e.ariaLabel||s.nothing}
9
- title=${t&&e.ariaLabel||s.nothing}
10
- aria-disabled=${t&&e.disabled?"true":s.nothing}
11
- aria-selected=${t?e.selected?"true":"false":s.nothing}
4
+ style=${e.rootStyle||i.nothing}
5
+ role=${t?"option":i.nothing}
6
+ tabindex=${t?"-1":i.nothing}
7
+ data-value=${t&&e.value||i.nothing}
8
+ aria-label=${t&&e.ariaLabel||i.nothing}
9
+ title=${t&&e.ariaLabel||i.nothing}
10
+ aria-disabled=${t&&e.disabled?"true":i.nothing}
11
+ aria-selected=${t?e.selected?"true":"false":i.nothing}
12
12
  >
13
13
  <div class=${l.join(" ")}>
14
- ${(()=>{if(i!==s.nothing)return i;if("icon"===e.type)return s.html`<i class="sf-icon" aria-hidden="true">${e.icon}</i>`;if("checkbox"===e.type)return s.html`
14
+ ${(()=>{if(s!==i.nothing)return s;if("icon"===e.type)return i.html`<i class="sf-icon" aria-hidden="true">${e.icon}</i>`;if("checkbox"===e.type)return i.html`
15
15
  <label
16
16
  class="sf-checkbox sf-checkbox--size-${e.sizeGroup.checkbox} flex"
17
17
  aria-hidden="true"
@@ -26,14 +26,14 @@
26
26
  <span class="sf-icon" aria-hidden="true"></span>
27
27
  </span>
28
28
  </label>
29
- `;if("avatar"===e.type){const t=["sf-avatar","sf-avatar--size-"+("1/3"===e.sizeGroup.item||"1/2"===e.sizeGroup.item?"1/3":"1"===e.sizeGroup.item?"1/2":"2"===e.sizeGroup.item?"1":"2"),"bg-cover",e.disabled?"disabled":""].filter(Boolean);return s.html`
29
+ `;if("avatar"===e.type){const t=["sf-avatar","sf-avatar--size-"+("1/3"===e.sizeGroup.item||"1/2"===e.sizeGroup.item?"1/3":"1"===e.sizeGroup.item?"1/2":"2"===e.sizeGroup.item?"1":"2"),"bg-cover",e.disabled?"disabled":""].filter(Boolean);return i.html`
30
30
  <div
31
31
  class="sf-avatar-label-group sf-avatar-label-group--size-${e.sizeGroup.avatarGroup} flex items-cross-center"
32
32
  >
33
33
  <span
34
34
  class=${t.join(" ")}
35
35
  aria-hidden="true"
36
- style=${e.avatarImageUrl?`background-image: url(${e.avatarImageUrl});`:s.nothing}
36
+ style=${e.avatarImageUrl?`background-image: url(${e.avatarImageUrl});`:i.nothing}
37
37
  ></span>
38
38
  <div class="sf-avatar-label-group-container flex flex-col">
39
39
  <div class="sf-avatar-label-group-title">
@@ -41,12 +41,12 @@
41
41
  </div>
42
42
  </div>
43
43
  </div>
44
- `}if("color"===e.type){const t=["sf-tag","sf-tag--color",`sf-tag--size-${e.sizeGroup.colorTag}`,"flex","flex-row","flex-nowrap","items-center","flex-1",e.disabled?"disabled":""].filter(Boolean);return s.html`
44
+ `}if("color"===e.type){const t=["sf-tag","sf-tag--color",`sf-tag--size-${e.sizeGroup.colorTag}`,"flex","flex-row","flex-nowrap","items-center","flex-1",e.disabled?"disabled":""].filter(Boolean);return i.html`
45
45
  <div class=${t.join(" ")}>
46
46
  <span class="sf-tag-color-icon ${e.colorClass}" aria-hidden="true"></span>
47
47
  <span class="sf-tag-container">${a}</span>
48
48
  </div>
49
- `}return s.nothing})()} ${"color"===e.type||"avatar"===e.type?s.nothing:s.html`<div class="sf-list-item-container">${a}</div>`} ${r!==s.nothing?r:"avatar"===e.type||"color"===e.type?s.html`
49
+ `}return i.nothing})()} ${"color"===e.type||"avatar"===e.type?i.nothing:i.html`<div class="sf-list-item-container">${a}</div>`} ${r!==i.nothing?r:"avatar"===e.type||"color"===e.type?i.html`
50
50
  <label
51
51
  class="sf-checkbox sf-checkbox--size-${e.sizeGroup.checkbox} flex"
52
52
  aria-hidden="true"
@@ -61,7 +61,7 @@
61
61
  <span class="sf-icon" aria-hidden="true"></span>
62
62
  </span>
63
63
  </label>
64
- `:s.nothing}
64
+ `:i.nothing}
65
65
  </div>
66
66
  </div>
67
- `}i()}catch(n){i(n)}})},ddf1cdb42ecc(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit"):new Promise(e=>globalThis.addEventListener("sf-runtime-ready",()=>e(globalThis.SF.runtimeModule("lit")),{once:!0}))},fbe0570fcc69(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("smart-base"):new Promise(e=>globalThis.addEventListener("sf-runtime-ready",()=>e(globalThis.SF.runtimeModule("smart-base")),{once:!0}))}};const t={};function a(i){const s=t[i];if(void 0!==s)return s.exports;const r=t[i]={exports:{}};return e[i](r,r.exports,a),r.exports}(()=>{const e="function"==typeof Symbol,t=e?Symbol("webpack queues"):"__webpack_queues__",i=e?Symbol("webpack exports"):"__webpack_exports__",s=e?Symbol("webpack error"):"__webpack_error__",r=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};a.a=(e,a,o)=>{let l;o&&((l=[]).d=-1);const n=new Set,c=e.exports;let d,u,h;const p=new Promise((e,t)=>{h=t,u=e});p[i]=c,p[t]=e=>(l&&e(l),n.forEach(e),p.catch(e=>{})),e.exports=p;a(e=>{let a;d=(e=>e.map(e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){const a=[];a.d=0,e.then(e=>{o[i]=e,r(a)},e=>{o[s]=e,r(a)});const o={};return o[t]=e=>e(a),o}}const a={};return a[t]=e=>{},a[i]=e,a}))(e);const o=()=>d.map(e=>{if(e[s])throw e[s];return e[i]}),c=new Promise(e=>{a=()=>e(o),a.r=0;const i=e=>e!==l&&!n.has(e)&&(n.add(e),e&&!e.d&&(a.r++,e.push(a)));d.map(e=>e[t](i))});return a.r?c:o()},e=>(e?h(p[s]=e):u(c),r(l))),l?.d<0&&(l.d=0)}})(),a.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{if(Array.isArray(t))for(var i=0;i<t.length;){var s=t[i++],r=t[i++];a.o(e,s)?0===r&&i++:0===r?Object.defineProperty(e,s,{enumerable:!0,value:t[i++]}):Object.defineProperty(e,s,{enumerable:!0,get:r})}else for(var s in t)a.o(t,s)&&!a.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);a("e4b691e01e6b")})();
67
+ `}s()}catch(n){s(n)}})},ddf1cdb42ecc(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit"):new Promise(e=>globalThis.addEventListener("sf-runtime-ready",()=>e(globalThis.SF.runtimeModule("lit")),{once:!0}))},fbe0570fcc69(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("smart-base"):new Promise(e=>globalThis.addEventListener("sf-runtime-ready",()=>e(globalThis.SF.runtimeModule("smart-base")),{once:!0}))}};const t={};function a(s){const i=t[s];if(void 0!==i)return i.exports;const r=t[s]={exports:{}};return e[s](r,r.exports,a),r.exports}(()=>{const e="function"==typeof Symbol,t=e?Symbol("webpack queues"):"__webpack_queues__",s=e?Symbol("webpack exports"):"__webpack_exports__",i=e?Symbol("webpack error"):"__webpack_error__",r=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};a.a=(e,a,o)=>{let l;o&&((l=[]).d=-1);const n=new Set,c=e.exports;let d,u,h;const p=new Promise((e,t)=>{h=t,u=e});p[s]=c,p[t]=e=>(l&&e(l),n.forEach(e),p.catch(e=>{})),e.exports=p;a(e=>{let a;d=(e=>e.map(e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){const a=[];a.d=0,e.then(e=>{o[s]=e,r(a)},e=>{o[i]=e,r(a)});const o={};return o[t]=e=>e(a),o}}const a={};return a[t]=e=>{},a[s]=e,a}))(e);const o=()=>d.map(e=>{if(e[i])throw e[i];return e[s]}),c=new Promise(e=>{a=()=>e(o),a.r=0;const s=e=>e!==l&&!n.has(e)&&(n.add(e),e&&!e.d&&(a.r++,e.push(a)));d.map(e=>e[t](s))});return a.r?c:o()},e=>(e?h(p[i]=e):u(c),r(l))),l?.d<0&&(l.d=0)}})(),a.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{if(Array.isArray(t))for(var s=0;s<t.length;){var i=t[s++],r=t[s++];a.o(e,i)?0===r&&s++:0===r?Object.defineProperty(e,i,{enumerable:!0,value:t[s++]}):Object.defineProperty(e,i,{enumerable:!0,get:r})}else for(var i in t)a.o(t,i)&&!a.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);a("e4b691e01e6b")})();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schema_version": "1.0.0",
3
3
  "contract_id": "simai.framework.smart.modal",
4
- "public_name": "Simai Framework Modal",
4
+ "public_name": "SIMAI Framework Modal",
5
5
  "technical_tag": "sf-modal",
6
6
  "layer": "smart-component",
7
7
  "source": {
@@ -1,4 +1,4 @@
1
- (()=>{"use strict";var e={"98e26702f55a"(e,t,s){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 r({component:e="",kind:t="attribute",attribute:s="",from:r,to:n=null}={}){if(!r)return;const o=[e,t,s,r].join("|"),i=a(),l=i.get(o);if(l)l.count+=1;else if(i.set(o,{component:e,kind:t,attribute:s,from:r,to:n,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?`${s}="${r}"`:`${t} ${r}`;globalThis.console?.warn?.(`[Simai Framework] ${a}${o} is a legacy name${n?`; write ${n}`:""}. See contracts/changes/journal.json.`)}}if(s.d(t,{id:()=>l}),"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=r,globalThis.SF.deprecations=e}const n=Object.freeze(["1/2","1","2"]),o=Object.freeze({"1/3":"1/2",3:"2"}),i=new Set;function l(e,t="field",s="1"){const a=String(e??"").trim().toLowerCase();if(n.includes(a))return a;if(Object.hasOwn(o,a)){const e=o[a];r({component:t,kind:"value",attribute:"size",from:a,to:e});const s=`${t}:${a}`;return i.has(s)||"undefined"==typeof console||(i.add(s),console.warn(`[Simai Framework] ${t}: size ${a} is retired for form fields; rendering size ${e}.`)),e}return s}},c128ba4e79ce(e,t,s){s.d(t,{JT:()=>g});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 s=e.match(/\(([^)]+)\)/g);s&&s.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 s=this.getUtilityMap();if(!s||!s[t])return;this.extractUtilityClasses(s[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 r=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)},n=".sf-progress-scale",o="sfProgressScaleBound",i=["1/3","1/2","1","2","3"],l=["info","success","warning","error"];function c(e){const t=Number(e);return Number.isFinite(t)?Math.max(0,Math.min(100,t)):0}function u(e){const t=String(e||"").toLowerCase();return i.includes(t)?t:"1"}function d(e){const t=String(e||"").toLowerCase();return l.includes(t)?t:""}function f(e,t=!0){return null==e||""===e?t:"boolean"==typeof e?e:!["false","0","no","off"].includes(String(e).toLowerCase())}function h(e){if(!e)return!1;!function(e){let t=e.querySelector(".sf-progress-scale-container");t||(t=document.createElement("div"),t.className="sf-progress-scale-container grid grid-col-10 overflow-hidden",e.prepend(t)),t.setAttribute("aria-hidden","true");const s=[...t.querySelectorAll(".sf-progress-scale-block")];for(let e=s.length;e<10;e+=1){const e=document.createElement("div");e.className="sf-progress-scale-block",t.append(e)}s.slice(10).forEach(e=>e.remove())}(e);const t=c(e.dataset.value),s=function(e){return 10*Math.ceil(c(e)/10)}(t),a=u(e.dataset.size),r=d(e.dataset.tone),n=f(e.dataset.showText,!0),o=/(^|\s)sf-progress-scale--line-/.test(e.className);e.classList.add("sf-progress-scale","flex",o?"flex-row":"flex-col"),o&&e.classList.remove("flex-col"),function(e,t,s,a){for(let s=0;s<=100;s+=10)e.classList.toggle(`sf-progress-scale--${s}`,s===t);i.forEach(t=>{e.classList.toggle(`sf-progress-scale--size-${t}`,t===s)}),l.forEach(t=>{e.classList.toggle(`sf-progress-scale--${t}`,t===a)})}(e,s,a,r),e.dataset.value=String(t),e.dataset.size=a,e.dataset.tone=r,e.dataset.showText=String(n),e.setAttribute("role","progressbar"),e.setAttribute("aria-valuemin","0"),e.setAttribute("aria-valuemax","100"),e.setAttribute("aria-valuenow",String(t)),e.dataset.label&&e.setAttribute("aria-label",e.dataset.label),e.dataset.valueText?e.setAttribute("aria-valuetext",e.dataset.valueText):e.removeAttribute("aria-valuetext");const h=function(e){let t=e.querySelector(".sf-progress-scale-text, .sf-scale-text");return t||(t=document.createElement("div"),e.append(t)),t.classList.add("sf-progress-scale-text"),t}(e);return h.textContent=`${t}%`,h.hidden=!n,!0}function p(e){e&&"1"!==e.dataset[o]&&(h(e),e.dataset[o]="1")}function m(e=document){e.querySelectorAll(n).forEach(p)}function g(e,t={}){const s=e instanceof HTMLElement?e.closest(n)||e:null;if(!s)return!1;if(Object.prototype.hasOwnProperty.call(t,"value")&&(s.dataset.value=String(c(t.value))),Object.prototype.hasOwnProperty.call(t,"size")&&(s.dataset.size=u(t.size)),(Object.prototype.hasOwnProperty.call(t,"status")||Object.prototype.hasOwnProperty.call(t,"tone"))&&(s.dataset.tone=d(t.status??t.tone)),Object.prototype.hasOwnProperty.call(t,"showText")&&(s.dataset.showText=String(f(t.showText,!0))),Object.prototype.hasOwnProperty.call(t,"label")){const e=String(t.label||"").trim();e?(s.dataset.label=e,s.setAttribute("aria-label",e)):(delete s.dataset.label,s.removeAttribute("aria-label"))}if(Object.prototype.hasOwnProperty.call(t,"valueText")){const e=String(t.valueText||"").trim();e?s.dataset.valueText=e:delete s.dataset.valueText}return h(s)}r("ProgressScale",class extends a{static componentName="ProgressScale";html=null;constructor(e){super(e);const{size:t="1",value:s=0,status:a,tone:r="primary",showText:n=!0,label:o="",valueText:i=""}=this.params||{},l=document.createElement("div");l.className="sf-progress-scale flex flex-col",l.dataset.size=u(t),l.dataset.value=String(c(s)),l.dataset.tone=d(a??r),l.dataset.showText=String(f(n,!0)),String(o).trim()&&(l.dataset.label=String(o).trim()),String(i).trim()&&(l.dataset.valueText=String(i).trim()),this.template=l}init(){p(this.template)}destroyInternal(){var e;(e=this.template)&&"1"===e.dataset[o]&&delete e.dataset[o]}}),"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.ProgressScale=window.SF.ProgressScale||{},window.SF.ProgressScale.getState=function(e){const t=e instanceof HTMLElement?e.closest(n)||e:null;return t?{value:c(t.dataset.value),size:u(t.dataset.size),status:d(t.dataset.tone),tone:d(t.dataset.tone),showText:f(t.dataset.showText,!0),label:t.getAttribute("aria-label")||"",valueText:t.getAttribute("aria-valuetext")||""}:null},window.SF.ProgressScale.setState=g),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>m(),{once:!0}):m();new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{e instanceof Element&&(e.matches?.(n)&&p(e),m(e))})})}).observe(document.documentElement,{childList:!0,subtree:!0})},b9c4b63fce15(e,t,s){s.a(e,async(e,t)=>{try{var a=s("fbe0570fcc69"),r=s("98e26702f55a"),n=s("c128ba4e79ce"),o=s("f65a1c6fa30a"),i=e([a,o]);[a,o]=i.then?(await i)():i;var l=s.n(a);function c(e){const t=Number(e);return Number.isFinite(t)?Math.max(0,Math.min(100,t)):0}class u extends(l()){static get props(){return{templateName:{attribute:"template",default:"default"},size:{default:"1"},line:{default:""},value:{default:"0"},showText:{type:Boolean,default:!0},status:{default:"neutral",values:["neutral","info","success","warning","error"],aliases:["tone"],valueAliases:{neutral:["primary"]}},label:{default:""},valueText:{default:""}}}get templateName(){return this.getAttribute("template")||"default"}get value(){return this.getAttribute("value")||"0"}set value(e){null!=e?this.setAttribute("value",String(e)):this.removeAttribute("value")}get size(){return this.getAttribute("size")||"1"}get line(){const e=this.getAttribute("line")||"";return e?(0,r.id)(e,"sf-progress-scale line"):""}get showText(){return this.getBooleanAttr("show-text",!0)}get status(){return this.getProp("status")}get tone(){return this.status}get label(){return this.getAttribute("label")||""}get valueText(){return this.getAttribute("value-text")||""}set showText(e){null!=e&&""!==e?!0!==e?this.setAttribute("show-text",String(e)):this.setAttribute("show-text",""):this.removeAttribute("show-text")}templateContext(){const e=this.getPropsContext();return this.createTemplateContext({...e,component:this,value:c(e.value)})}template(){return(0,o.e)(this.templateContext())}get state(){return{size:this.size,line:this.line,value:c(this.value),showText:this.showText,status:this.status,tone:this.tone,label:this.label,valueText:this.valueText}}getProgress(){return c(this.value)}setProgress(e){return this.value=e,this}resolveUpdateMode(e=[]){const t=["value","show-text","tone","label","value-text"];return e.length>0&&e.every(e=>t.includes(e))?"dom":"lit"}updateDom(){const e=this.querySelector(".sf-progress-scale");return!!e&&(0,n.JT)(e,{value:this.value,showText:this.showText,tone:this.tone,label:this.label,valueText:this.valueText})}}u.define("sf-progress-scale"),t()}catch(d){t(d)}})},f65a1c6fa30a(e,t,s){s.a(e,async(e,a)=>{try{s.d(t,{e:()=>d});var r=s("ddf1cdb42ecc"),n=e([r]),o=n.then?(await n)():n;r=o[0];function i(e){const t=Number(e);return Number.isFinite(t)?Math.max(0,Math.min(100,t)):0}function l(e){const t=i(e);return 10*Math.ceil(t/10)}function c(e){const t=String(e||"").toLowerCase();return["1/3","1/2","1","2","3"].includes(t)?t:"1"}function u(e){const t=String(e||"").toLowerCase();return["neutral","info","success","warning","error"].includes(t)?t:"neutral"}function d(e){const t=c(e.size),s=i(e.value),a=l(s),n=u(e.status??e.tone),o=["sf-progress-scale",`sf-progress-scale--size-${t}`,`sf-progress-scale--${n}`,...e.line?[`sf-progress-scale--line-${e.line}`,"flex","flex-row","items-cross-center"]:["flex","flex-col"],e.rootClass].filter(Boolean);return a>0&&o.push(`sf-progress-scale--${a}`),r.html`
1
+ (()=>{"use strict";var e={"98e26702f55a"(e,t,s){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 r({component:e="",kind:t="attribute",attribute:s="",from:r,to:n=null}={}){if(!r)return;const o=[e,t,s,r].join("|"),i=a(),l=i.get(o);if(l)l.count+=1;else if(i.set(o,{component:e,kind:t,attribute:s,from:r,to:n,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?`${s}="${r}"`:`${t} ${r}`;globalThis.console?.warn?.(`[SIMAI Framework] ${a}${o} is a legacy name${n?`; write ${n}`:""}. See contracts/changes/journal.json.`)}}if(s.d(t,{id:()=>l}),"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=r,globalThis.SF.deprecations=e}const n=Object.freeze(["1/2","1","2"]),o=Object.freeze({"1/3":"1/2",3:"2"}),i=new Set;function l(e,t="field",s="1"){const a=String(e??"").trim().toLowerCase();if(n.includes(a))return a;if(Object.hasOwn(o,a)){const e=o[a];r({component:t,kind:"value",attribute:"size",from:a,to:e});const s=`${t}:${a}`;return i.has(s)||"undefined"==typeof console||(i.add(s),console.warn(`[SIMAI Framework] ${t}: size ${a} is retired for form fields; rendering size ${e}.`)),e}return s}},c128ba4e79ce(e,t,s){s.d(t,{JT:()=>g});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 s=e.match(/\(([^)]+)\)/g);s&&s.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 s=this.getUtilityMap();if(!s||!s[t])return;this.extractUtilityClasses(s[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 r=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)},n=".sf-progress-scale",o="sfProgressScaleBound",i=["1/3","1/2","1","2","3"],l=["info","success","warning","error"];function c(e){const t=Number(e);return Number.isFinite(t)?Math.max(0,Math.min(100,t)):0}function u(e){const t=String(e||"").toLowerCase();return i.includes(t)?t:"1"}function d(e){const t=String(e||"").toLowerCase();return l.includes(t)?t:""}function f(e,t=!0){return null==e||""===e?t:"boolean"==typeof e?e:!["false","0","no","off"].includes(String(e).toLowerCase())}function h(e){if(!e)return!1;!function(e){let t=e.querySelector(".sf-progress-scale-container");t||(t=document.createElement("div"),t.className="sf-progress-scale-container grid grid-col-10 overflow-hidden",e.prepend(t)),t.setAttribute("aria-hidden","true");const s=[...t.querySelectorAll(".sf-progress-scale-block")];for(let e=s.length;e<10;e+=1){const e=document.createElement("div");e.className="sf-progress-scale-block",t.append(e)}s.slice(10).forEach(e=>e.remove())}(e);const t=c(e.dataset.value),s=function(e){return 10*Math.ceil(c(e)/10)}(t),a=u(e.dataset.size),r=d(e.dataset.tone),n=f(e.dataset.showText,!0),o=/(^|\s)sf-progress-scale--line-/.test(e.className);e.classList.add("sf-progress-scale","flex",o?"flex-row":"flex-col"),o&&e.classList.remove("flex-col"),function(e,t,s,a){for(let s=0;s<=100;s+=10)e.classList.toggle(`sf-progress-scale--${s}`,s===t);i.forEach(t=>{e.classList.toggle(`sf-progress-scale--size-${t}`,t===s)}),l.forEach(t=>{e.classList.toggle(`sf-progress-scale--${t}`,t===a)})}(e,s,a,r),e.dataset.value=String(t),e.dataset.size=a,e.dataset.tone=r,e.dataset.showText=String(n),e.setAttribute("role","progressbar"),e.setAttribute("aria-valuemin","0"),e.setAttribute("aria-valuemax","100"),e.setAttribute("aria-valuenow",String(t)),e.dataset.label&&e.setAttribute("aria-label",e.dataset.label),e.dataset.valueText?e.setAttribute("aria-valuetext",e.dataset.valueText):e.removeAttribute("aria-valuetext");const h=function(e){let t=e.querySelector(".sf-progress-scale-text, .sf-scale-text");return t||(t=document.createElement("div"),e.append(t)),t.classList.add("sf-progress-scale-text"),t}(e);return h.textContent=`${t}%`,h.hidden=!n,!0}function p(e){e&&"1"!==e.dataset[o]&&(h(e),e.dataset[o]="1")}function m(e=document){e.querySelectorAll(n).forEach(p)}function g(e,t={}){const s=e instanceof HTMLElement?e.closest(n)||e:null;if(!s)return!1;if(Object.prototype.hasOwnProperty.call(t,"value")&&(s.dataset.value=String(c(t.value))),Object.prototype.hasOwnProperty.call(t,"size")&&(s.dataset.size=u(t.size)),(Object.prototype.hasOwnProperty.call(t,"status")||Object.prototype.hasOwnProperty.call(t,"tone"))&&(s.dataset.tone=d(t.status??t.tone)),Object.prototype.hasOwnProperty.call(t,"showText")&&(s.dataset.showText=String(f(t.showText,!0))),Object.prototype.hasOwnProperty.call(t,"label")){const e=String(t.label||"").trim();e?(s.dataset.label=e,s.setAttribute("aria-label",e)):(delete s.dataset.label,s.removeAttribute("aria-label"))}if(Object.prototype.hasOwnProperty.call(t,"valueText")){const e=String(t.valueText||"").trim();e?s.dataset.valueText=e:delete s.dataset.valueText}return h(s)}r("ProgressScale",class extends a{static componentName="ProgressScale";html=null;constructor(e){super(e);const{size:t="1",value:s=0,status:a,tone:r="primary",showText:n=!0,label:o="",valueText:i=""}=this.params||{},l=document.createElement("div");l.className="sf-progress-scale flex flex-col",l.dataset.size=u(t),l.dataset.value=String(c(s)),l.dataset.tone=d(a??r),l.dataset.showText=String(f(n,!0)),String(o).trim()&&(l.dataset.label=String(o).trim()),String(i).trim()&&(l.dataset.valueText=String(i).trim()),this.template=l}init(){p(this.template)}destroyInternal(){var e;(e=this.template)&&"1"===e.dataset[o]&&delete e.dataset[o]}}),"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.ProgressScale=window.SF.ProgressScale||{},window.SF.ProgressScale.getState=function(e){const t=e instanceof HTMLElement?e.closest(n)||e:null;return t?{value:c(t.dataset.value),size:u(t.dataset.size),status:d(t.dataset.tone),tone:d(t.dataset.tone),showText:f(t.dataset.showText,!0),label:t.getAttribute("aria-label")||"",valueText:t.getAttribute("aria-valuetext")||""}:null},window.SF.ProgressScale.setState=g),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>m(),{once:!0}):m();new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{e instanceof Element&&(e.matches?.(n)&&p(e),m(e))})})}).observe(document.documentElement,{childList:!0,subtree:!0})},b9c4b63fce15(e,t,s){s.a(e,async(e,t)=>{try{var a=s("fbe0570fcc69"),r=s("98e26702f55a"),n=s("c128ba4e79ce"),o=s("f65a1c6fa30a"),i=e([a,o]);[a,o]=i.then?(await i)():i;var l=s.n(a);function c(e){const t=Number(e);return Number.isFinite(t)?Math.max(0,Math.min(100,t)):0}class u extends(l()){static get props(){return{templateName:{attribute:"template",default:"default"},size:{default:"1"},line:{default:""},value:{default:"0"},showText:{type:Boolean,default:!0},status:{default:"neutral",values:["neutral","info","success","warning","error"],aliases:["tone"],valueAliases:{neutral:["primary"]}},label:{default:""},valueText:{default:""}}}get templateName(){return this.getAttribute("template")||"default"}get value(){return this.getAttribute("value")||"0"}set value(e){null!=e?this.setAttribute("value",String(e)):this.removeAttribute("value")}get size(){return this.getAttribute("size")||"1"}get line(){const e=this.getAttribute("line")||"";return e?(0,r.id)(e,"sf-progress-scale line"):""}get showText(){return this.getBooleanAttr("show-text",!0)}get status(){return this.getProp("status")}get tone(){return this.status}get label(){return this.getAttribute("label")||""}get valueText(){return this.getAttribute("value-text")||""}set showText(e){null!=e&&""!==e?!0!==e?this.setAttribute("show-text",String(e)):this.setAttribute("show-text",""):this.removeAttribute("show-text")}templateContext(){const e=this.getPropsContext();return this.createTemplateContext({...e,component:this,value:c(e.value)})}template(){return(0,o.e)(this.templateContext())}get state(){return{size:this.size,line:this.line,value:c(this.value),showText:this.showText,status:this.status,tone:this.tone,label:this.label,valueText:this.valueText}}getProgress(){return c(this.value)}setProgress(e){return this.value=e,this}resolveUpdateMode(e=[]){const t=["value","show-text","tone","label","value-text"];return e.length>0&&e.every(e=>t.includes(e))?"dom":"lit"}updateDom(){const e=this.querySelector(".sf-progress-scale");return!!e&&(0,n.JT)(e,{value:this.value,showText:this.showText,tone:this.tone,label:this.label,valueText:this.valueText})}}u.define("sf-progress-scale"),t()}catch(d){t(d)}})},f65a1c6fa30a(e,t,s){s.a(e,async(e,a)=>{try{s.d(t,{e:()=>d});var r=s("ddf1cdb42ecc"),n=e([r]),o=n.then?(await n)():n;r=o[0];function i(e){const t=Number(e);return Number.isFinite(t)?Math.max(0,Math.min(100,t)):0}function l(e){const t=i(e);return 10*Math.ceil(t/10)}function c(e){const t=String(e||"").toLowerCase();return["1/3","1/2","1","2","3"].includes(t)?t:"1"}function u(e){const t=String(e||"").toLowerCase();return["neutral","info","success","warning","error"].includes(t)?t:"neutral"}function d(e){const t=c(e.size),s=i(e.value),a=l(s),n=u(e.status??e.tone),o=["sf-progress-scale",`sf-progress-scale--size-${t}`,`sf-progress-scale--${n}`,...e.line?[`sf-progress-scale--line-${e.line}`,"flex","flex-row","items-cross-center"]:["flex","flex-col"],e.rootClass].filter(Boolean);return a>0&&o.push(`sf-progress-scale--${a}`),r.html`
2
2
  <div
3
3
  class=${o.join(" ")}
4
4
  style=${e.rootStyle||r.nothing}
@@ -1,4 +1,4 @@
1
- (()=>{"use strict";var e={"98e26702f55a"(e,t,n){function r(){const e=globalThis.SF=globalThis.SF||{};return e.__deprecationNotes instanceof Map||Object.defineProperty(e,"__deprecationNotes",{value:new Map,configurable:!0}),e.__deprecationNotes}function a({component:e="",kind:t="attribute",attribute:n="",from:a,to:o=null}={}){if(!a)return;const i=[e,t,n,a].join("|"),l=r(),s=l.get(i);if(s)s.count+=1;else if(l.set(i,{component:e,kind:t,attribute:n,from:a,to:o,count:1}),function(){const e=globalThis.document?.documentElement;return"warn"===e?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const r=e?`${e}: `:"",i="value"===t?`${n}="${a}"`:`${t} ${a}`;globalThis.console?.warn?.(`[Simai Framework] ${r}${i} is a legacy name${o?`; write ${o}`:""}. See contracts/changes/journal.json.`)}}if(n.d(t,{id:()=>s}),"undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const e=globalThis.SF.deprecations||{};e.list=function(){return[...r().values()].map(e=>({...e}))},e.clear=function(){r().clear()},e.note=a,globalThis.SF.deprecations=e}const o=Object.freeze(["1/2","1","2"]),i=Object.freeze({"1/3":"1/2",3:"2"}),l=new Set;function s(e,t="field",n="1"){const r=String(e??"").trim().toLowerCase();if(o.includes(r))return r;if(Object.hasOwn(i,r)){const e=i[r];a({component:t,kind:"value",attribute:"size",from:r,to:e});const n=`${t}:${r}`;return l.has(n)||"undefined"==typeof console||(l.add(n),console.warn(`[Simai Framework] ${t}: size ${r} is retired for form fields; rendering size ${e}.`)),e}return n}},b15eca80760b(e,t,n){n.a(e,async(e,t)=>{try{var r=n("fbe0570fcc69"),a=n("98e26702f55a"),o=n("fe7168bbc2ad"),i=e([r,o]);[r,o]=i.then?(await i)():i;var l=n.n(r);class s extends(l()){static get props(){return{templateName:{attribute:"template",default:"default"},size:{default:""},line:{default:""},appearance:{default:"card"},icon:{default:"arrow_forward"},label:{default:""},text:{default:""},href:{default:""},target:{default:"_self"},disabled:{type:Boolean,default:!1},ariaLabel:{default:""}}}get templateName(){return this.getAttribute("template")||"default"}get size(){const e=this.getAttribute("size")||"";return e?(0,a.id)(e,"sf-reference-link"):""}get line(){const e=this.getAttribute("line")||"";return e?(0,a.id)(e,"sf-reference-link line"):""}get appearance(){return"plain"===this.getAttribute("appearance")?"plain":"card"}get icon(){const e=this.getAttribute("icon");return null===e?"arrow_forward":e}get label(){return this.getAttribute("label")||""}get text(){return this.getAttribute("text")||""}get href(){return this.getAttribute("href")||""}get target(){return this.getAttribute("target")||"_self"}get disabled(){return this.getBooleanAttr("disabled",!1)}get ariaLabel(){return this.getAttribute("aria-label")||""}templateContext(){const e=this.getPropsContext();return this.createTemplateContext({...e,component:this,rootClass:this.getRootClass()})}template(){return(0,o.w)(this.templateContext())}handleRootClick=e=>{this.disabled&&(e.preventDefault(),e.stopPropagation(),"function"==typeof e.stopImmediatePropagation&&e.stopImmediatePropagation())};onClick(e,t){return"function"==typeof e&&this.addEventListener("click",e,t),this}}s.define("sf-reference-link"),t()}catch(e){t(e)}})},fe7168bbc2ad(e,t,n){n.a(e,async(e,r)=>{try{n.d(t,{w:()=>l});var a=n("ddf1cdb42ecc"),o=e([a]),i=o.then?(await o)():o;a=i[0];function l(e){const{component:t,appearance:n,icon:r,label:o,text:i,href:l,target:s,disabled:c,ariaLabel:f,rootClass:u,size:d,line:b}=e,p=["sf-reference-link",d?`sf-reference-link--size-${d}`:"",b?`sf-reference-link--line-${b}`:"","plain"===n?"sf-reference-link--plain":"","flex","items-cross-center",c?"disabled":"",u].filter(Boolean).join(" "),h=t?.hasSlotContent?.("label")?t.getSlotContent("label"):o,g=t?.hasSlotContent?.("text")?t.getSlotContent("text"):i,m=l&&!c?a.html`
1
+ (()=>{"use strict";var e={"98e26702f55a"(e,t,n){function r(){const e=globalThis.SF=globalThis.SF||{};return e.__deprecationNotes instanceof Map||Object.defineProperty(e,"__deprecationNotes",{value:new Map,configurable:!0}),e.__deprecationNotes}function a({component:e="",kind:t="attribute",attribute:n="",from:a,to:o=null}={}){if(!a)return;const i=[e,t,n,a].join("|"),l=r(),s=l.get(i);if(s)s.count+=1;else if(l.set(i,{component:e,kind:t,attribute:n,from:a,to:o,count:1}),function(){const e=globalThis.document?.documentElement;return"warn"===e?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const r=e?`${e}: `:"",i="value"===t?`${n}="${a}"`:`${t} ${a}`;globalThis.console?.warn?.(`[SIMAI Framework] ${r}${i} is a legacy name${o?`; write ${o}`:""}. See contracts/changes/journal.json.`)}}if(n.d(t,{id:()=>s}),"undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const e=globalThis.SF.deprecations||{};e.list=function(){return[...r().values()].map(e=>({...e}))},e.clear=function(){r().clear()},e.note=a,globalThis.SF.deprecations=e}const o=Object.freeze(["1/2","1","2"]),i=Object.freeze({"1/3":"1/2",3:"2"}),l=new Set;function s(e,t="field",n="1"){const r=String(e??"").trim().toLowerCase();if(o.includes(r))return r;if(Object.hasOwn(i,r)){const e=i[r];a({component:t,kind:"value",attribute:"size",from:r,to:e});const n=`${t}:${r}`;return l.has(n)||"undefined"==typeof console||(l.add(n),console.warn(`[SIMAI Framework] ${t}: size ${r} is retired for form fields; rendering size ${e}.`)),e}return n}},b15eca80760b(e,t,n){n.a(e,async(e,t)=>{try{var r=n("fbe0570fcc69"),a=n("98e26702f55a"),o=n("fe7168bbc2ad"),i=e([r,o]);[r,o]=i.then?(await i)():i;var l=n.n(r);class s extends(l()){static get props(){return{templateName:{attribute:"template",default:"default"},size:{default:""},line:{default:""},appearance:{default:"card"},icon:{default:"arrow_forward"},label:{default:""},text:{default:""},href:{default:""},target:{default:"_self"},disabled:{type:Boolean,default:!1},ariaLabel:{default:""}}}get templateName(){return this.getAttribute("template")||"default"}get size(){const e=this.getAttribute("size")||"";return e?(0,a.id)(e,"sf-reference-link"):""}get line(){const e=this.getAttribute("line")||"";return e?(0,a.id)(e,"sf-reference-link line"):""}get appearance(){return"plain"===this.getAttribute("appearance")?"plain":"card"}get icon(){const e=this.getAttribute("icon");return null===e?"arrow_forward":e}get label(){return this.getAttribute("label")||""}get text(){return this.getAttribute("text")||""}get href(){return this.getAttribute("href")||""}get target(){return this.getAttribute("target")||"_self"}get disabled(){return this.getBooleanAttr("disabled",!1)}get ariaLabel(){return this.getAttribute("aria-label")||""}templateContext(){const e=this.getPropsContext();return this.createTemplateContext({...e,component:this,rootClass:this.getRootClass()})}template(){return(0,o.w)(this.templateContext())}handleRootClick=e=>{this.disabled&&(e.preventDefault(),e.stopPropagation(),"function"==typeof e.stopImmediatePropagation&&e.stopImmediatePropagation())};onClick(e,t){return"function"==typeof e&&this.addEventListener("click",e,t),this}}s.define("sf-reference-link"),t()}catch(e){t(e)}})},fe7168bbc2ad(e,t,n){n.a(e,async(e,r)=>{try{n.d(t,{w:()=>l});var a=n("ddf1cdb42ecc"),o=e([a]),i=o.then?(await o)():o;a=i[0];function l(e){const{component:t,appearance:n,icon:r,label:o,text:i,href:l,target:s,disabled:c,ariaLabel:f,rootClass:u,size:d,line:b}=e,p=["sf-reference-link",d?`sf-reference-link--size-${d}`:"",b?`sf-reference-link--line-${b}`:"","plain"===n?"sf-reference-link--plain":"","flex","items-cross-center",c?"disabled":"",u].filter(Boolean).join(" "),h=t?.hasSlotContent?.("label")?t.getSlotContent("label"):o,g=t?.hasSlotContent?.("text")?t.getSlotContent("text"):i,m=l&&!c?a.html`
2
2
  <a class="sf-reference-link__link"
3
3
  href=${l}
4
4
  target=${s||a.nothing}
@@ -1,4 +1,4 @@
1
- (()=>{"use strict";var t={"98e26702f55a"(t,e,a){function n(){const t=globalThis.SF=globalThis.SF||{};return t.__deprecationNotes instanceof Map||Object.defineProperty(t,"__deprecationNotes",{value:new Map,configurable:!0}),t.__deprecationNotes}function s({component:t="",kind:e="attribute",attribute:a="",from:s,to:o=null}={}){if(!s)return;const i=[t,e,a,s].join("|"),r=n(),l=r.get(i);if(l)l.count+=1;else if(r.set(i,{component:t,kind:e,attribute:a,from:s,to:o,count:1}),function(){const t=globalThis.document?.documentElement;return"warn"===t?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const n=t?`${t}: `:"",i="value"===e?`${a}="${s}"`:`${e} ${s}`;globalThis.console?.warn?.(`[Simai Framework] ${n}${i} is a legacy name${o?`; write ${o}`:""}. See contracts/changes/journal.json.`)}}if(a.d(e,{id:()=>l}),"undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const t=globalThis.SF.deprecations||{};t.list=function(){return[...n().values()].map(t=>({...t}))},t.clear=function(){n().clear()},t.note=s,globalThis.SF.deprecations=t}const o=Object.freeze(["1/2","1","2"]),i=Object.freeze({"1/3":"1/2",3:"2"}),r=new Set;function l(t,e="field",a="1"){const n=String(t??"").trim().toLowerCase();if(o.includes(n))return n;if(Object.hasOwn(i,n)){const t=i[n];s({component:e,kind:"value",attribute:"size",from:n,to:t});const a=`${e}:${n}`;return r.has(a)||"undefined"==typeof console||(r.add(a),console.warn(`[Simai Framework] ${e}: size ${n} is retired for form fields; rendering size ${t}.`)),t}return a}},acce07732944(t,e,a){a.a(t,async(t,e)=>{try{var n=a("fbe0570fcc69"),s=a("98e26702f55a"),o=a("058e7e36258a"),i=a("0d662e4d7d63"),r=t([n,o,i]);[n,o,i]=r.then?(await r)():r;var l=a.n(n);const c={en:{remove:"Remove"},ru:{remove:"Удалить"}},u=["checkbox","icon","default","color","avatar"],d=["","info","success","warning","error"],h=t=>String(t??"").trim().toLowerCase();function p(t,e,a){const n=h(e);if(n)return"quantity"===n?"default":u.includes(n)?n:a;const s=h(t?.getAttribute?.("type"));return"quantity"===s?"default":u.includes(s)?s:a}function g(t,e,a){const n=h(e);if(n)return d.includes(n)?n:a;const s=h(t?.getAttribute?.("type"));return d.includes(s)&&""!==s?s:a}class f extends(l()){static get props(){return{templateName:{attribute:"template",default:"default"},kind:{default:"checkbox",values:u,parser:(t,e,a)=>p(a,t,e)},status:{default:"",values:d,parser:(t,e,a)=>g(a,t,e)},appearance:{default:"default",values:["default","surface","ghost"]},size:{default:"1/2",values:["1/3","1/2","1","2","3"]},spacing:{default:"normal",values:["compact","normal","comfortable","spacious"]},inline:{type:Boolean,default:!1},line:{default:""},text:{default:""},count:{default:""},icon:{default:""},colorClass:{default:""},avatarImageUrl:{default:""},avatarText:{default:""},rootClass:{default:""},avatarStatus:{default:""},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},closable:{type:Boolean,default:!1},interactive:{type:Boolean,default:!1},ariaLabel:{default:""},closeLabel:{default:""}}}get componentName(){return"tag"}get templateName(){return this.getAttribute("template")||"default"}get kind(){return this.getProp("kind")}get status(){return this.getProp("status")}get type(){return this.status||this.kind}get appearance(){return this.getEnumAttr("appearance",["default","surface","ghost"],"default")}get size(){const t=this.line;return t?{"1/2":"1/3",1:"1/2",2:"1"}[t]:this.getEnumAttr("size",["1/3","1/2","1","2","3"],"1/2")}get line(){const t=this.getAttribute("line")||"";return t?(0,s.id)(t,"sf-tag line"):""}get spacing(){return this.getEnumAttr("spacing",["compact","normal","comfortable","spacious"],"normal")}get inline(){return Boolean(this.line)||this.getBooleanAttr("inline",!1)}get text(){return this.getAttribute("text")||""}get count(){return this.getAttribute("count")||""}get icon(){return this.getAttribute("icon")||""}get colorClass(){return this.getAttribute("color-class")||""}get avatarImageUrl(){return this.getAttribute("avatar-image-url")||""}get avatarText(){return this.getAttribute("avatar-text")||""}get avatarStatus(){return this.getAttribute("avatar-status")||""}get rootClass(){return this.getRootClass()}get active(){return this.getBooleanAttr("active",!1)}get disabled(){return this.getBooleanAttr("disabled",!1)}get closable(){return"checkbox"===this.type?this.hasAttribute("closable")&&this.getBooleanAttr("closable",!0):this.hasAttribute("closable")?this.getBooleanAttr("closable",!0):["icon","color","avatar"].includes(this.type)}get interactive(){return"checkbox"!==this.type&&this.getBooleanAttr("interactive",!1)}get ariaLabel(){return this.getAttribute("aria-label")||""}get closeLabel(){return this.getAttribute("close-label")||(0,i.pageText)(c,"remove",this)}templateContext(){const t=this.getPropsContext();return this.createTemplateContext({...t,kind:this.kind,type:this.type,size:this.size,inline:this.inline,line:this.line,component:this,rootClass:this.rootClass,closable:this.closable,interactive:this.interactive,closeLabel:this.closeLabel})}onToggle(){if(this.disabled||"checkbox"!==this.type)return;const t=!this.active;this.toggleAttribute("active",t),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{active:t,component:this}}))}onClose(){!this.disabled&&this.closable&&this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0,detail:{component:this}}))}template(){return(0,o.t)(this.templateContext())}get value(){return{template:this.templateName,kind:this.kind,status:this.status,type:this.type,appearance:this.appearance,size:this.size,spacing:this.spacing,inline:this.inline,line:this.line,text:this.text,count:this.count,icon:this.icon,colorClass:this.colorClass,avatarImageUrl:this.avatarImageUrl,avatarText:this.avatarText,avatarStatus:this.avatarStatus,rootClass:this.rootClass,active:this.active,disabled:this.disabled,closable:this.closable,ariaLabel:this.ariaLabel,closeLabel:this.closeLabel}}set value(t){this.setValueAttributes(t)}}f.define("sf-tag"),e()}catch(b){e(b)}})},"058e7e36258a"(t,e,a){a.a(t,async(t,n)=>{try{a.d(e,{t:()=>b});var s=a("ddf1cdb42ecc"),o=t([s]),i=o.then?(await o)():o;s=i[0];const r=new Set(["1","2","3"]);function l(t){return t.component?.hasSlotContent?.("leading")?t.component.getSlotContent("leading"):s.html`<span class="sf-tag-check" aria-hidden="true"></span>`}function c(t){const e=t.icon||"sell";return t.component?.hasSlotContent?.("leading")?t.component.getSlotContent("leading"):s.html`<i class="sf-icon sf-tag-icon" aria-hidden="true">${e}</i>`}function u(t){const e=t.colorClass||"";return t.component?.hasSlotContent?.("leading")?t.component.getSlotContent("leading"):s.html`<span class=${["sf-tag-color-icon",e].filter(Boolean).join(" ")} aria-hidden="true"></span>`}function d(t){return t.component?.hasSlotContent?.("leading")?t.component.getSlotContent("leading"):s.html`
1
+ (()=>{"use strict";var t={"98e26702f55a"(t,e,a){function n(){const t=globalThis.SF=globalThis.SF||{};return t.__deprecationNotes instanceof Map||Object.defineProperty(t,"__deprecationNotes",{value:new Map,configurable:!0}),t.__deprecationNotes}function s({component:t="",kind:e="attribute",attribute:a="",from:s,to:o=null}={}){if(!s)return;const i=[t,e,a,s].join("|"),r=n(),l=r.get(i);if(l)l.count+=1;else if(r.set(i,{component:t,kind:e,attribute:a,from:s,to:o,count:1}),function(){const t=globalThis.document?.documentElement;return"warn"===t?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const n=t?`${t}: `:"",i="value"===e?`${a}="${s}"`:`${e} ${s}`;globalThis.console?.warn?.(`[SIMAI Framework] ${n}${i} is a legacy name${o?`; write ${o}`:""}. See contracts/changes/journal.json.`)}}if(a.d(e,{id:()=>l}),"undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const t=globalThis.SF.deprecations||{};t.list=function(){return[...n().values()].map(t=>({...t}))},t.clear=function(){n().clear()},t.note=s,globalThis.SF.deprecations=t}const o=Object.freeze(["1/2","1","2"]),i=Object.freeze({"1/3":"1/2",3:"2"}),r=new Set;function l(t,e="field",a="1"){const n=String(t??"").trim().toLowerCase();if(o.includes(n))return n;if(Object.hasOwn(i,n)){const t=i[n];s({component:e,kind:"value",attribute:"size",from:n,to:t});const a=`${e}:${n}`;return r.has(a)||"undefined"==typeof console||(r.add(a),console.warn(`[SIMAI Framework] ${e}: size ${n} is retired for form fields; rendering size ${t}.`)),t}return a}},acce07732944(t,e,a){a.a(t,async(t,e)=>{try{var n=a("fbe0570fcc69"),s=a("98e26702f55a"),o=a("058e7e36258a"),i=a("0d662e4d7d63"),r=t([n,o,i]);[n,o,i]=r.then?(await r)():r;var l=a.n(n);const c={en:{remove:"Remove"},ru:{remove:"Удалить"}},u=["checkbox","icon","default","color","avatar"],d=["","info","success","warning","error"],h=t=>String(t??"").trim().toLowerCase();function p(t,e,a){const n=h(e);if(n)return"quantity"===n?"default":u.includes(n)?n:a;const s=h(t?.getAttribute?.("type"));return"quantity"===s?"default":u.includes(s)?s:a}function g(t,e,a){const n=h(e);if(n)return d.includes(n)?n:a;const s=h(t?.getAttribute?.("type"));return d.includes(s)&&""!==s?s:a}class f extends(l()){static get props(){return{templateName:{attribute:"template",default:"default"},kind:{default:"checkbox",values:u,parser:(t,e,a)=>p(a,t,e)},status:{default:"",values:d,parser:(t,e,a)=>g(a,t,e)},appearance:{default:"default",values:["default","surface","ghost"]},size:{default:"1/2",values:["1/3","1/2","1","2","3"]},spacing:{default:"normal",values:["compact","normal","comfortable","spacious"]},inline:{type:Boolean,default:!1},line:{default:""},text:{default:""},count:{default:""},icon:{default:""},colorClass:{default:""},avatarImageUrl:{default:""},avatarText:{default:""},rootClass:{default:""},avatarStatus:{default:""},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},closable:{type:Boolean,default:!1},interactive:{type:Boolean,default:!1},ariaLabel:{default:""},closeLabel:{default:""}}}get componentName(){return"tag"}get templateName(){return this.getAttribute("template")||"default"}get kind(){return this.getProp("kind")}get status(){return this.getProp("status")}get type(){return this.status||this.kind}get appearance(){return this.getEnumAttr("appearance",["default","surface","ghost"],"default")}get size(){const t=this.line;return t?{"1/2":"1/3",1:"1/2",2:"1"}[t]:this.getEnumAttr("size",["1/3","1/2","1","2","3"],"1/2")}get line(){const t=this.getAttribute("line")||"";return t?(0,s.id)(t,"sf-tag line"):""}get spacing(){return this.getEnumAttr("spacing",["compact","normal","comfortable","spacious"],"normal")}get inline(){return Boolean(this.line)||this.getBooleanAttr("inline",!1)}get text(){return this.getAttribute("text")||""}get count(){return this.getAttribute("count")||""}get icon(){return this.getAttribute("icon")||""}get colorClass(){return this.getAttribute("color-class")||""}get avatarImageUrl(){return this.getAttribute("avatar-image-url")||""}get avatarText(){return this.getAttribute("avatar-text")||""}get avatarStatus(){return this.getAttribute("avatar-status")||""}get rootClass(){return this.getRootClass()}get active(){return this.getBooleanAttr("active",!1)}get disabled(){return this.getBooleanAttr("disabled",!1)}get closable(){return"checkbox"===this.type?this.hasAttribute("closable")&&this.getBooleanAttr("closable",!0):this.hasAttribute("closable")?this.getBooleanAttr("closable",!0):["icon","color","avatar"].includes(this.type)}get interactive(){return"checkbox"!==this.type&&this.getBooleanAttr("interactive",!1)}get ariaLabel(){return this.getAttribute("aria-label")||""}get closeLabel(){return this.getAttribute("close-label")||(0,i.pageText)(c,"remove",this)}templateContext(){const t=this.getPropsContext();return this.createTemplateContext({...t,kind:this.kind,type:this.type,size:this.size,inline:this.inline,line:this.line,component:this,rootClass:this.rootClass,closable:this.closable,interactive:this.interactive,closeLabel:this.closeLabel})}onToggle(){if(this.disabled||"checkbox"!==this.type)return;const t=!this.active;this.toggleAttribute("active",t),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{active:t,component:this}}))}onClose(){!this.disabled&&this.closable&&this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0,detail:{component:this}}))}template(){return(0,o.t)(this.templateContext())}get value(){return{template:this.templateName,kind:this.kind,status:this.status,type:this.type,appearance:this.appearance,size:this.size,spacing:this.spacing,inline:this.inline,line:this.line,text:this.text,count:this.count,icon:this.icon,colorClass:this.colorClass,avatarImageUrl:this.avatarImageUrl,avatarText:this.avatarText,avatarStatus:this.avatarStatus,rootClass:this.rootClass,active:this.active,disabled:this.disabled,closable:this.closable,ariaLabel:this.ariaLabel,closeLabel:this.closeLabel}}set value(t){this.setValueAttributes(t)}}f.define("sf-tag"),e()}catch(b){e(b)}})},"058e7e36258a"(t,e,a){a.a(t,async(t,n)=>{try{a.d(e,{t:()=>b});var s=a("ddf1cdb42ecc"),o=t([s]),i=o.then?(await o)():o;s=i[0];const r=new Set(["1","2","3"]);function l(t){return t.component?.hasSlotContent?.("leading")?t.component.getSlotContent("leading"):s.html`<span class="sf-tag-check" aria-hidden="true"></span>`}function c(t){const e=t.icon||"sell";return t.component?.hasSlotContent?.("leading")?t.component.getSlotContent("leading"):s.html`<i class="sf-icon sf-tag-icon" aria-hidden="true">${e}</i>`}function u(t){const e=t.colorClass||"";return t.component?.hasSlotContent?.("leading")?t.component.getSlotContent("leading"):s.html`<span class=${["sf-tag-color-icon",e].filter(Boolean).join(" ")} aria-hidden="true"></span>`}function d(t){return t.component?.hasSlotContent?.("leading")?t.component.getSlotContent("leading"):s.html`
2
2
  <span class="sf-dot sf-dot--size-${e=t.size,r.has(e)?"1/2":"1/3"}" aria-hidden="true">
3
3
  <div class="sf-dot-item"></div>
4
4
  </span>