@simai-studio/ui 5.20261020.1056 → 5.20261020.1647

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.
@@ -1201,6 +1201,10 @@
1201
1201
  },
1202
1202
  {
1203
1203
  "name": "icon-buttons"
1204
+ },
1205
+ {
1206
+ "lazy": true,
1207
+ "name": "spinner"
1204
1208
  }
1205
1209
  ],
1206
1210
  "tags": [
@@ -3238,6 +3242,10 @@
3238
3242
  },
3239
3243
  {
3240
3244
  "name": "close"
3245
+ },
3246
+ {
3247
+ "lazy": true,
3248
+ "name": "spinner"
3241
3249
  }
3242
3250
  ],
3243
3251
  "type": "component"
@@ -1,4 +1,4 @@
1
- (()=>{"use strict";var e={"67eed2647f47"(e,t,n){n.d(t,{z:()=>i});const a=new WeakMap,s=new WeakSet;function i(e,t){const n=e.ownerDocument;s.has(n)||(n.addEventListener("reset",e=>{const t=e.target;if("FORM"!==t?.tagName)return;const n=Array.from(t.elements);setTimeout(()=>{if(!e.defaultPrevented)for(const e of n)if(e.isConnected&&e.form===t)for(const t of a.get(e)||[])t()},0)},!0),s.add(n));let i=a.get(e);return i||a.set(e,i=new Set),i.add(t),()=>i.delete(t)}},"50d2a204ba4c"(e,t,n){n.d(t,{le:()=>s});function a(e,t={}){const n=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.entries(t).forEach(([e,t])=>{null!=t&&""!==t&&n.setAttribute(e,String(t))}),n}function s({className:e="",overlay:t=!1}={}){const n=document.createElement("span");n.className=["sf-loader-container","sf-loader--infinite",e,e&&t?`${e}--overlay`:""].filter(Boolean).join(" "),n.dataset.sfSpinnerBound="1",n.dataset.infinite="true",n.setAttribute("aria-hidden","true");const s=document.createElement("span");return s.className="sf-loader--loading-indicator",s.append(function(){const e=12,t=a("svg",{class:"sf-loader-svg",viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false"}),n=a("circle",{class:"sf-loader-ring-filled",cx:e,cy:e,r:11,fill:"none",stroke:"currentColor","stroke-width":2,opacity:"0.3"}),s=a("circle",{class:"sf-loader-ring-accent",cx:e,cy:e,r:11,fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round",pathLength:100,"stroke-dasharray":"0 100",transform:"rotate(90 12 12)"});return t.append(n,s),t}()),n.append(s),n}},"18333410c461"(e,t,n){n.a(e,async(e,t)=>{try{var a=n("fbe0570fcc69"),s=n("2c8db2795ace"),i=n("2feae72af89f"),r=n("67eed2647f47"),o=n("0d662e4d7d63"),l=e([a,s,i,o]);[a,s,i,o]=l.then?(await l)():l;var u=n.n(a);const c={en:{group:"Theme",system:"System",light:"Light",dark:"Dark"},ru:{group:"Тема",system:"Как в системе",light:"Светлая",dark:"Тёмная"}},d=["system","light","dark"],h={system:"brightness_auto",light:"light_mode",dark:"dark_mode"};function f(){const e=globalThis.SF?.Loader?.themePreference;return d.includes(e)?e:"system"}function g(e=[]){if(Array.isArray(e))return e;const t=String(e||"").trim();if(!t)return[];if(t.startsWith("["))try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}return t.split("|").map(e=>{const[t,n,a=""]=e.split("::"),s=a.split(",").map(e=>e.trim()).filter(Boolean),i=s.find(e=>e.startsWith("icon="));return{value:t.trim(),label:(n||t).trim(),disabled:s.includes("disabled"),loading:s.includes("loading"),icon:i?i.slice(5):""}})}function b(e=[]){const t=new Set;return g(e).map((e,n)=>{const a="string"==typeof e?{value:e,label:e}:e;if(!a||"object"!=typeof a)return null;const s=String(a.value??a.id??n).trim();return!s||t.has(s)?null:(t.add(s),{id:String(a.id||s),value:s,label:String(a.label??a.text??s),icon:String(a.icon||""),ariaLabel:String(a.ariaLabel||a["aria-label"]||""),count:null===a.count||void 0===a.count?"":String(a.count).trim(),iconOnly:Boolean((a.iconOnly??a["icon-only"])&&a.icon),loading:Boolean(a.loading),disabled:Boolean(a.disabled||a.loading)})}).filter(Boolean)}class m extends(u()){static get props(){return{templateName:{attribute:"template",default:"default"},items:{type:Array,default:[],parser:g},value:{default:""},name:{default:""},themeSwitch:{attribute:"theme-switch",type:Boolean,default:!1},size:{default:"1",values:["1/3","1/2","1","2","3"]},spacing:{type:String,default:null},tightness:{default:"",values:["","low","high","highest"]},scheme:{default:"primary",values:["primary","secondary","on-surface"]},appearance:{default:"default",values:["default","segmented"]},plate:{default:"scheme",values:["scheme","raised"]},fullWidth:{attribute:"full-width",type:Boolean,default:!1},radius:{default:"",values:["","default","square","rounded"]},orientation:{default:"horizontal",values:["horizontal","vertical"]},disabled:{type:Boolean,default:!1},ariaLabel:{attribute:"aria-label",default:""},rootClass:{attribute:"root-class",default:""}}}constructor(){super(),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("sf-after-render",e=>{e.target!==this&&e.target.parentElement===this.querySelector(".sf-button-group")&&this.syncButtonSemantics()})}get themeSwitch(){return this.getBooleanAttr("theme-switch",!1)}get themeItems(){return d.map(e=>({value:e,label:(0,o.pageText)(c,e,this),icon:h[e],iconOnly:!0}))}get normalizedItems(){const e=b(this.themeSwitch?this.themeItems:this.getProp("items")),t=e.findIndex(e=>!e.disabled);return e.map((e,n)=>({...e,firstEnabled:n===t}))}get value(){return this.getAttribute("value")||""}set value(e){null!=e&&""!==e?this.setAttribute("value",String(e)):this.removeAttribute("value")}get disabled(){return this.getBooleanAttr("disabled",!1)}get name(){return this.getAttribute("name")||""}connectedCallback(){Object.prototype.hasOwnProperty.call(this,"_resetValue")||(this._resetValue=this.value),super.connectedCallback()}onConnected(){window.addEventListener("sf-theme-change",this.handleThemeChange),this.syncThemePreference()}onDisconnected(){window.removeEventListener("sf-theme-change",this.handleThemeChange),this._releaseReset?.(),this._releaseReset=null,this._resetInput=null,super.onDisconnected()}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),"theme-switch"===e&&t!==n&&this._isMounted&&this.syncThemePreference()}syncThemePreference(){if(!this.themeSwitch)return;const e=f();this.value!==e&&(this.value=e)}handleThemeChange=()=>this.syncThemePreference();templateContext(){return this.createTemplateContext({...this.getPropsContext(),ariaLabel:this.getAttribute("aria-label")||(this.themeSwitch?(0,o.pageText)(c,"group",this):""),...(0,i.resolveControlSpacing)({spacing:this.getAttribute("spacing"),tightness:this.getAttribute("tightness")}),component:this,items:this.normalizedItems,value:this.value,disabled:this.disabled})}template(){return(0,s.a)(this.templateContext())}emitValueChange(e){this.emitComponentEvent("button-group-change",e),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{component:this,...e}}))}select(e){const t=String(e??""),n=this.normalizedItems.find(e=>e.value===t);if(!n||n.disabled||this.disabled||t===this.value)return this;const a=this.value;return this.themeSwitch&&!0!==globalThis.SF?.Loader?.setTheme?.(t)||(this.value=t,this.emitValueChange({previous:a,value:t,item:n})),this}afterRender(){this.syncButtonSemantics(),this.bindReset()}bindReset(){const e=this.querySelector(":scope > .sf-button-group-input");this._resetInput!==e&&(this._releaseReset?.(),this._resetInput=e,this._releaseReset=e?(0,r.z)(e,()=>{this.themeSwitch||(this.value=this._resetValue)}):null)}syncButtonSemantics(){const e=this.querySelector(".sf-button-group");if(!e)return;const t=this.normalizedItems,n=this.disabled?[]:t.filter(e=>!e.disabled),a=n.find(e=>e.value===this.value)||n[0];e.querySelectorAll(":scope > sf-button, :scope > button").forEach((e,n)=>{const s=e.matches("button")?e:e.querySelector("button"),i=t[n];if(!s||!i)return;const r=i.value===this.value;s.setAttribute("role","radio"),s.setAttribute("aria-checked",r?"true":"false"),s.tabIndex=i===a?0:-1})}clear(){if(!this.value||this.disabled||this.themeSwitch)return this;const e=this.value;return this.value="",this.emitValueChange({previous:e,value:"",item:null}),this}focus(e){const t=this.querySelector('button[role="radio"][tabindex="0"]:not(:disabled)');return t?.focus?.(e),this}handleClick=e=>{const t=e.target?.closest?.("[data-sf-button-group-value]");t&&this.contains(t)&&this.select(t.getAttribute("data-sf-button-group-value"))};handleKeyDown=e=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key))return;const t=this.normalizedItems.filter(e=>!e.disabled);if(!t.length||this.disabled)return;const n=Math.max(0,t.findIndex(e=>e.value===this.value)),a="Home"===e.key?0:"End"===e.key?t.length-1:["ArrowLeft","ArrowUp"].includes(e.key)?(n-1+t.length)%t.length:(n+1)%t.length;e.preventDefault();const s=this.value;this.select(t[a].value),this.value!==s&&this.addEventListener("sf-after-render",()=>this.focus(),{once:!0})}}m.define("sf-button-group"),t()}catch(p){t(p)}})},"2c8db2795ace"(e,t,n){n.a(e,async(e,a)=>{try{n.d(t,{a:()=>d});var s=n("ddf1cdb42ecc"),i=n("50d2a204ba4c"),r=e([s]),o=r.then?(await r)():r;s=o[0];function l(e,t){return t<=1?"":0===e?"start":e===t-1?"end":"middle"}function u(e,t,n){const a=e.value===n.value,i=n.disabled||e.disabled;return s.html`
1
+ (()=>{"use strict";var e={"67eed2647f47"(e,t,n){n.d(t,{z:()=>i});const a=new WeakMap,s=new WeakSet;function i(e,t){const n=e.ownerDocument;s.has(n)||(n.addEventListener("reset",e=>{const t=e.target;if("FORM"!==t?.tagName)return;const n=Array.from(t.elements);setTimeout(()=>{if(!e.defaultPrevented)for(const e of n)if(e.isConnected&&e.form===t)for(const t of a.get(e)||[])t()},0)},!0),s.add(n));let i=a.get(e);return i||a.set(e,i=new Set),i.add(t),()=>i.delete(t)}},"50d2a204ba4c"(e,t,n){n.d(t,{le:()=>r});function a(e,t={}){const n=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.entries(t).forEach(([e,t])=>{null!=t&&""!==t&&n.setAttribute(e,String(t))}),n}const s=e=>Math.round(1e3*e)/1e3;function i(e={}){return function({width:e=24,height:t=24,stroke:n=2,dots:i=8,filled:r=3,dotRadius:o=null,direction:l="clockwise",pixel:u=!1}={}){const c=e/2,d=t/2,h=Math.min(e,t)/2,f=Math.max(1,h-n/2),m=a("svg",{class:"sf-loader-svg",viewBox:`0 0 ${e} ${t}`,width:u?e:null,height:u?t:null,"aria-hidden":"true",focusable:"false"}),g={cx:c,cy:d,r:s(f),fill:"none",stroke:"currentColor","stroke-width":n},b=a("circle",{class:"sf-loader-ring-filled",...g,opacity:"0.3"}),p=a("circle",{class:"sf-loader-ring-accent",...g,"stroke-linecap":"round",pathLength:100,"stroke-dasharray":"0 100",transform:`rotate(90 ${c} ${d})`}),v=a("g",{class:"sf-loader-comet",display:"none",transform:`rotate(-90 ${c} ${d})`});for(let e=0;e<10;e+=1){const t=9===e;v.append(a("circle",{class:"sf-loader-comet-segment"+(t?" sf-loader-comet-head":""),...g,"stroke-linecap":t?"round":"butt",pathLength:100,"stroke-dasharray":`${s(4)} ${s(96)}`,"stroke-dashoffset":s(-4*e),opacity:s(((e+1)/10)**1.6)}))}const y=Math.max(3,Math.min(32,Math.floor(Number(i)||8))),w=Math.max(1,Math.min(y,Math.floor(Number(r)||3))),S=Math.min(n,.7*Math.PI*(h-n)/y),$=null==o||""===o?S:Math.max(1,Math.min(Number(o)||S,h/4)),x=Math.max($,h-$),k=a("g",{class:"sf-loader-dots",display:"none",style:`--sf-loader-dot-count:${y}; --sf-loader-dot-filled:${w};`});for(let e=0;e<y;e+=1){const t=2*Math.PI/y*e-Math.PI/2,n="counterclockwise"===l?e:(y-e)%y;k.append(a("circle",{class:"sf-loader-dot"+(e<w?" sf-loader-dot--active":""),cx:s(c+x*Math.cos(t)),cy:s(d+x*Math.sin(t)),r:s($),fill:"currentColor",style:`--sf-loader-dot-index:${e}; --sf-loader-dot-step:${n};`}))}return m.append(b,p,v,k),m}({...e,width:24,height:24,stroke:2,dotRadius:null,pixel:!1})}function r({className:e="",overlay:t=!1}={}){const n=document.createElement("span");n.className=["sf-loader-container","sf-loader--infinite",e,e&&t?`${e}--overlay`:""].filter(Boolean).join(" "),n.dataset.sfSpinnerBound="1",n.dataset.infinite="true",n.setAttribute("aria-hidden","true");const a=document.createElement("span");return a.className="sf-loader--loading-indicator",a.append(i()),n.append(a),n}},"18333410c461"(e,t,n){n.a(e,async(e,t)=>{try{var a=n("fbe0570fcc69"),s=n("2c8db2795ace"),i=n("2feae72af89f"),r=n("67eed2647f47"),o=n("0d662e4d7d63"),l=e([a,s,i,o]);[a,s,i,o]=l.then?(await l)():l;var u=n.n(a);const c={en:{group:"Theme",system:"System",light:"Light",dark:"Dark"},ru:{group:"Тема",system:"Как в системе",light:"Светлая",dark:"Тёмная"}},d=["system","light","dark"],h={system:"brightness_auto",light:"light_mode",dark:"dark_mode"};function f(){const e=globalThis.SF?.Loader?.themePreference;return d.includes(e)?e:"system"}function m(e=[]){if(Array.isArray(e))return e;const t=String(e||"").trim();if(!t)return[];if(t.startsWith("["))try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}return t.split("|").map(e=>{const[t,n,a=""]=e.split("::"),s=a.split(",").map(e=>e.trim()).filter(Boolean),i=s.find(e=>e.startsWith("icon="));return{value:t.trim(),label:(n||t).trim(),disabled:s.includes("disabled"),loading:s.includes("loading"),icon:i?i.slice(5):""}})}function g(e=[]){const t=new Set;return m(e).map((e,n)=>{const a="string"==typeof e?{value:e,label:e}:e;if(!a||"object"!=typeof a)return null;const s=String(a.value??a.id??n).trim();return!s||t.has(s)?null:(t.add(s),{id:String(a.id||s),value:s,label:String(a.label??a.text??s),icon:String(a.icon||""),ariaLabel:String(a.ariaLabel||a["aria-label"]||""),count:null===a.count||void 0===a.count?"":String(a.count).trim(),iconOnly:Boolean((a.iconOnly??a["icon-only"])&&a.icon),loading:Boolean(a.loading),disabled:Boolean(a.disabled||a.loading)})}).filter(Boolean)}class b extends(u()){static get props(){return{templateName:{attribute:"template",default:"default"},items:{type:Array,default:[],parser:m},value:{default:""},name:{default:""},themeSwitch:{attribute:"theme-switch",type:Boolean,default:!1},size:{default:"1",values:["1/3","1/2","1","2","3"]},spacing:{type:String,default:null},tightness:{default:"",values:["","low","high","highest"]},scheme:{default:"primary",values:["primary","secondary","on-surface"]},appearance:{default:"default",values:["default","segmented"]},plate:{default:"scheme",values:["scheme","raised"]},fullWidth:{attribute:"full-width",type:Boolean,default:!1},radius:{default:"",values:["","default","square","rounded"]},orientation:{default:"horizontal",values:["horizontal","vertical"]},disabled:{type:Boolean,default:!1},ariaLabel:{attribute:"aria-label",default:""},rootClass:{attribute:"root-class",default:""}}}constructor(){super(),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("sf-after-render",e=>{e.target!==this&&e.target.parentElement===this.querySelector(".sf-button-group")&&this.syncButtonSemantics()})}get themeSwitch(){return this.getBooleanAttr("theme-switch",!1)}get themeItems(){return d.map(e=>({value:e,label:(0,o.pageText)(c,e,this),icon:h[e],iconOnly:!0}))}get normalizedItems(){const e=g(this.themeSwitch?this.themeItems:this.getProp("items")),t=e.findIndex(e=>!e.disabled);return e.map((e,n)=>({...e,firstEnabled:n===t}))}get value(){return this.getAttribute("value")||""}set value(e){null!=e&&""!==e?this.setAttribute("value",String(e)):this.removeAttribute("value")}get disabled(){return this.getBooleanAttr("disabled",!1)}get name(){return this.getAttribute("name")||""}connectedCallback(){Object.prototype.hasOwnProperty.call(this,"_resetValue")||(this._resetValue=this.value),super.connectedCallback()}onConnected(){window.addEventListener("sf-theme-change",this.handleThemeChange),this.syncThemePreference()}onDisconnected(){window.removeEventListener("sf-theme-change",this.handleThemeChange),this._releaseReset?.(),this._releaseReset=null,this._resetInput=null,super.onDisconnected()}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),"theme-switch"===e&&t!==n&&this._isMounted&&this.syncThemePreference()}syncThemePreference(){if(!this.themeSwitch)return;const e=f();this.value!==e&&(this.value=e)}handleThemeChange=()=>this.syncThemePreference();templateContext(){return this.createTemplateContext({...this.getPropsContext(),ariaLabel:this.getAttribute("aria-label")||(this.themeSwitch?(0,o.pageText)(c,"group",this):""),...(0,i.resolveControlSpacing)({spacing:this.getAttribute("spacing"),tightness:this.getAttribute("tightness")}),component:this,items:this.normalizedItems,value:this.value,disabled:this.disabled})}template(){return(0,s.a)(this.templateContext())}emitValueChange(e){this.emitComponentEvent("button-group-change",e),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{component:this,...e}}))}select(e){const t=String(e??""),n=this.normalizedItems.find(e=>e.value===t);if(!n||n.disabled||this.disabled||t===this.value)return this;const a=this.value;return this.themeSwitch&&!0!==globalThis.SF?.Loader?.setTheme?.(t)||(this.value=t,this.emitValueChange({previous:a,value:t,item:n})),this}afterRender(){this.syncButtonSemantics(),this.bindReset()}bindReset(){const e=this.querySelector(":scope > .sf-button-group-input");this._resetInput!==e&&(this._releaseReset?.(),this._resetInput=e,this._releaseReset=e?(0,r.z)(e,()=>{this.themeSwitch||(this.value=this._resetValue)}):null)}syncButtonSemantics(){const e=this.querySelector(".sf-button-group");if(!e)return;const t=this.normalizedItems,n=this.disabled?[]:t.filter(e=>!e.disabled),a=n.find(e=>e.value===this.value)||n[0];e.querySelectorAll(":scope > sf-button, :scope > button").forEach((e,n)=>{const s=e.matches("button")?e:e.querySelector("button"),i=t[n];if(!s||!i)return;const r=i.value===this.value;s.setAttribute("role","radio"),s.setAttribute("aria-checked",r?"true":"false"),s.tabIndex=i===a?0:-1})}clear(){if(!this.value||this.disabled||this.themeSwitch)return this;const e=this.value;return this.value="",this.emitValueChange({previous:e,value:"",item:null}),this}focus(e){const t=this.querySelector('button[role="radio"][tabindex="0"]:not(:disabled)');return t?.focus?.(e),this}handleClick=e=>{const t=e.target?.closest?.("[data-sf-button-group-value]");t&&this.contains(t)&&this.select(t.getAttribute("data-sf-button-group-value"))};handleKeyDown=e=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(e.key))return;const t=this.normalizedItems.filter(e=>!e.disabled);if(!t.length||this.disabled)return;const n=Math.max(0,t.findIndex(e=>e.value===this.value)),a="Home"===e.key?0:"End"===e.key?t.length-1:["ArrowLeft","ArrowUp"].includes(e.key)?(n-1+t.length)%t.length:(n+1)%t.length;e.preventDefault();const s=this.value;this.select(t[a].value),this.value!==s&&this.addEventListener("sf-after-render",()=>this.focus(),{once:!0})}}b.define("sf-button-group"),t()}catch(p){t(p)}})},"2c8db2795ace"(e,t,n){n.a(e,async(e,a)=>{try{n.d(t,{a:()=>d});var s=n("ddf1cdb42ecc"),i=n("50d2a204ba4c"),r=e([s]),o=r.then?(await r)():r;s=o[0];function l(e,t){return t<=1?"":0===e?"start":e===t-1?"end":"middle"}function u(e,t,n){const a=e.value===n.value,i=n.disabled||e.disabled;return s.html`
2
2
  <sf-button
3
3
  text=${e.label}
4
4
  icon=${e.icon||s.nothing}
@@ -1,18 +1,18 @@
1
- (()=>{"use strict";var t={"50d2a204ba4c"(t,e,n){n.d(e,{le:()=>s});function i(t,e={}){const n=document.createElementNS("http://www.w3.org/2000/svg",t);return Object.entries(e).forEach(([t,e])=>{null!=e&&""!==e&&n.setAttribute(t,String(e))}),n}function s({className:t="",overlay:e=!1}={}){const n=document.createElement("span");n.className=["sf-loader-container","sf-loader--infinite",t,t&&e?`${t}--overlay`:""].filter(Boolean).join(" "),n.dataset.sfSpinnerBound="1",n.dataset.infinite="true",n.setAttribute("aria-hidden","true");const s=document.createElement("span");return s.className="sf-loader--loading-indicator",s.append(function(){const t=12,e=i("svg",{class:"sf-loader-svg",viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false"}),n=i("circle",{class:"sf-loader-ring-filled",cx:t,cy:t,r:11,fill:"none",stroke:"currentColor","stroke-width":2,opacity:"0.3"}),s=i("circle",{class:"sf-loader-ring-accent",cx:t,cy:t,r:11,fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round",pathLength:100,"stroke-dasharray":"0 100",transform:"rotate(90 12 12)"});return e.append(n,s),e}()),n.append(s),n}},"06e8cd089f28"(t,e,n){function i(){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:n="",from:s,to:o=null}={}){if(!s)return;const r=[t,e,n,s].join("|"),a=i(),c=a.get(r);if(c)c.count+=1;else if(a.set(r,{component:t,kind:e,attribute:n,from:s,to:o,count:1}),function(){const t=globalThis.document?.documentElement;return"warn"===t?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const i=t?`${t}: `:"",r="value"===e?`${n}="${s}"`:`${e} ${s}`;globalThis.console?.warn?.(`[SIMAI Framework] ${i}${r} is a legacy name${o?`; write ${o}`:""}. See contracts/changes/journal.json.`)}}if(n.d(e,{YB:()=>s}),"undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const t=globalThis.SF.deprecations||{};t.list=function(){return[...i().values()].map(t=>({...t}))},t.clear=function(){i().clear()},t.note=s,globalThis.SF.deprecations=t}},c76f8895b630(t,e,n){n.a(t,async(t,e)=>{try{var i=n("fbe0570fcc69"),s=n("5168bdf4a1f9"),o=n("ddf1cdb42ecc"),r=n("2feae72af89f"),a=n("06e8cd089f28"),c=t([i,s,o,r]);[i,s,o,r]=c.then?(await c)():c;var l=n.n(i);const u=new Set(["template","size","appearance","type","scheme","status","text","icon","icon-start","icon-end","icon-left","icon-right","icon-position","text-position","spacing","tightness","radius","root-class","loading","segment","disabled","native-type","aria-label","class","style","id","slot"]);function d(t,e){t?.forwardHostAttributes(e,{exclude:u,transferDataAttributes:!0,storageKey:"__sfButtonForwardedDataAttributes",targetStorageKey:"__sfButtonAttributeKeys"})}const h=["default","tonal","outline","link","surface"],g={ghost:"link"},f={danger:"error",critical:"error"};class p extends(l()){constructor(){super(),this._attributeObserver=null}static get props(){return{templateName:{attribute:"template",default:"default"},size:{default:"1"},appearance:{default:"default",aliases:["type"]},scheme:{default:"primary"},status:{default:"",values:["","error"]},textPosition:{type:String,default:"center"},text:{default:""},segment:{default:""},icon:{default:""},iconStart:{type:String,default:null},iconEnd:{type:String,default:null},iconLeft:{default:""},iconRight:{default:""},iconPosition:{default:"start"},spacing:{type:String,default:null},tightness:{default:"",values:["","low","high","highest"]},radius:{default:"",values:["","default","square","rounded"]},rootClass:{default:""},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},nativeType:{default:"button"},ariaLabel:{default:""}}}get templateName(){return this.getAttribute("template")||"default"}get size(){return this.getAttribute("size")||"1"}get appearance(){const t=this.getAttribute("appearance")||this.getAttribute("type")||"default";return Object.hasOwn(g,t)?((0,a.YB)({component:this.localName,kind:"value",attribute:"appearance",from:t,to:g[t]}),g[t]):h.includes(t)?t:"default"}get type(){return this.appearance}get scheme(){return this.getAttribute("scheme")||"primary"}get status(){const t=this.getAttribute("status")||"";return f[t]?((0,a.YB)({component:this.localName,kind:"value",attribute:"status",from:t,to:f[t]}),f[t]):t}get text(){return this.getAttribute("text")||""}get icon(){return this.getAttribute("icon")||""}get iconLeft(){return this.hasAttribute("icon-left")&&(0,a.YB)({component:this.localName,kind:"attribute",from:"icon-left",to:"icon-start"}),this.getAttribute("icon-start")??this.getAttribute("icon-left")}get iconRight(){return this.hasAttribute("icon-right")&&(0,a.YB)({component:this.localName,kind:"attribute",from:"icon-right",to:"icon-end"}),this.getAttribute("icon-end")??this.getAttribute("icon-right")}get iconStart(){return this.iconLeft}get iconEnd(){return this.iconRight}get iconPosition(){return this.getAttribute("icon-position")||"start"}noteLegacyNames(){return this.hasAttribute("tightness")&&(0,a.YB)({component:this.localName,kind:"attribute",from:"tightness",to:"spacing"}),{}}get tightness(){return(0,r.resolveControlSpacing)({spacing:this.getAttribute("spacing"),tightness:this.getAttribute("tightness")}).tightness}get spacing(){return(0,r.resolveControlSpacing)({spacing:this.getAttribute("spacing"),tightness:this.getAttribute("tightness")}).spacing}get radius(){return this.getEnumAttr("radius",["default","square","rounded"],"")}get rootClass(){return this.getAttribute("root-class")||""}get loading(){return this.getBooleanAttr("loading",!1)}get disabled(){return this.getBooleanAttr("disabled",!1)}get nativeType(){return this.getAttribute("native-type")||"button"}get ariaLabel(){return this.getAttribute("aria-label")||""}templateContext(){const t=this.getPropsContext();return this.createTemplateContext({...t,iconLeft:t.iconStart??t.iconLeft,iconRight:t.iconEnd??t.iconRight,iconStart:this.iconStart,iconEnd:this.iconEnd,type:this.type,appearance:"ghost"===t.appearance?"link":t.appearance,status:this.status,...(0,r.resolveControlSpacing)({spacing:this.getAttribute("spacing"),tightness:this.getAttribute("tightness")}),...this.noteLegacyNames?.(),component:this})}template(){return(0,s.B)(this.templateContext())}resolveUpdateMode(){return"lit"}afterRender(){d(this,this.querySelector(".sf-button")),this._attributeObserver||(this._attributeObserver=this.observeForwardedHostAttributes(()=>this.querySelector(".sf-button"),{exclude:u,transferDataAttributes:!0,storageKey:"__sfButtonForwardedDataAttributes",targetStorageKey:"__sfButtonAttributeKeys"})._forwardHostAttributeObserver)}get value(){return{template:this.templateName,size:this.size,appearance:this.appearance,type:this.type,scheme:this.scheme,status:this.status,text:this.text,icon:this.icon,iconLeft:this.iconLeft,iconRight:this.iconRight,iconStart:this.iconStart,iconEnd:this.iconEnd,iconPosition:this.iconPosition,tightness:this.tightness,spacing:this.spacing,radius:this.radius,rootClass:this.rootClass,loading:this.loading,disabled:this.disabled,nativeType:this.nativeType,ariaLabel:this.ariaLabel}}onClick(t,e){return"function"==typeof t&&this.addEventListener("click",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}onMouseEnter(t,e){return"function"==typeof t&&this.addEventListener("mouseenter",t,e),this}onMouseLeave(t,e){return"function"==typeof t&&this.addEventListener("mouseleave",t,e),this}setDisabled(t=!0){return t?this.setAttribute("disabled",""):this.removeAttribute("disabled"),this}createIcon(t){return t?o.html`<sf-icon icon="${t}" root-class="pointer-event-none" weight="400" aria-hidden="true"></sf-icon>`:""}set value(t){this.setValueAttributes(t)}onDisconnected(){this.disconnectForwardedHostAttributes(),this._attributeObserver=null,super.onDisconnected?.()}}p.define("sf-button"),e()}catch(b){e(b)}})},"5168bdf4a1f9"(t,e,n){n.a(t,async(t,i)=>{try{n.d(e,{B:()=>c});var s=n("ddf1cdb42ecc"),o=n("50d2a204ba4c"),r=t([s]),a=r.then?(await r)():r;s=a[0];function c(t){const{size:e,appearance:n,type:i,scheme:r,status:a,text:c,icon:l,iconLeft:u,iconRight:d,iconPosition:h,spacing:g,radius:f,rootClass:p,textPosition:b,loading:m,disabled:y,nativeType:S,ariaLabel:v,segment:A}=t,w=String(h||"start").toLowerCase(),x=["right","end"].includes(w),_=t.iconStart??(u||(l&&!x?l:"")),T=t.iconEnd??(d||(l&&x?l:"")),$=t.component,C=$?.hasSlotContent?.("icon-start")?$.getSlotContent("icon-start"):$?.hasSlotContent?.("icon-left")?$.getSlotContent("icon-left"):$.createIcon(_),E=$?.hasSlotContent?.("icon-end")?$.getSlotContent("icon-end"):$?.hasSlotContent?.("icon-right")?$.getSlotContent("icon-right"):$.createIcon(T),L=$?.hasSlotContent?.("text")?$.getSlotContent("text"):c,k=!C&&!E;let F=C,B=E,N="";if(m){const t=t=>(0,o.le)({className:"sf-button-spinner",overlay:t});C?F=t(!1):E?B=t(!1):N=t(!0)}const P=["sf-button",`sf-button--size-${e}`,`sf-button--${n||i}`,`sf-button--${a||r}`,"flex","items-cross-center",A?`segment-${A}`:"",g&&"normal"!==g?`spacing-${g}`:"",f?`radius-${f}`:"",p,m?"loading sf-button-state-loading":""].filter(Boolean);return s.html`
1
+ (()=>{"use strict";var t={"50d2a204ba4c"(t,e,n){n.d(e,{le:()=>a});function i(t,e={}){const n=document.createElementNS("http://www.w3.org/2000/svg",t);return Object.entries(e).forEach(([t,e])=>{null!=e&&""!==e&&n.setAttribute(t,String(e))}),n}const o=t=>Math.round(1e3*t)/1e3;function s(t={}){return function({width:t=24,height:e=24,stroke:n=2,dots:s=8,filled:a=3,dotRadius:r=null,direction:l="clockwise",pixel:c=!1}={}){const u=t/2,d=e/2,h=Math.min(t,e)/2,f=Math.max(1,h-n/2),g=i("svg",{class:"sf-loader-svg",viewBox:`0 0 ${t} ${e}`,width:c?t:null,height:c?e:null,"aria-hidden":"true",focusable:"false"}),p={cx:u,cy:d,r:o(f),fill:"none",stroke:"currentColor","stroke-width":n},b=i("circle",{class:"sf-loader-ring-filled",...p,opacity:"0.3"}),m=i("circle",{class:"sf-loader-ring-accent",...p,"stroke-linecap":"round",pathLength:100,"stroke-dasharray":"0 100",transform:`rotate(90 ${u} ${d})`}),y=i("g",{class:"sf-loader-comet",display:"none",transform:`rotate(-90 ${u} ${d})`});for(let t=0;t<10;t+=1){const e=9===t;y.append(i("circle",{class:"sf-loader-comet-segment"+(e?" sf-loader-comet-head":""),...p,"stroke-linecap":e?"round":"butt",pathLength:100,"stroke-dasharray":`${o(4)} ${o(96)}`,"stroke-dashoffset":o(-4*t),opacity:o(((t+1)/10)**1.6)}))}const S=Math.max(3,Math.min(32,Math.floor(Number(s)||8))),v=Math.max(1,Math.min(S,Math.floor(Number(a)||3))),A=Math.min(n,.7*Math.PI*(h-n)/S),x=null==r||""===r?A:Math.max(1,Math.min(Number(r)||A,h/4)),w=Math.max(x,h-x),$=i("g",{class:"sf-loader-dots",display:"none",style:`--sf-loader-dot-count:${S}; --sf-loader-dot-filled:${v};`});for(let t=0;t<S;t+=1){const e=2*Math.PI/S*t-Math.PI/2,n="counterclockwise"===l?t:(S-t)%S;$.append(i("circle",{class:"sf-loader-dot"+(t<v?" sf-loader-dot--active":""),cx:o(u+w*Math.cos(e)),cy:o(d+w*Math.sin(e)),r:o(x),fill:"currentColor",style:`--sf-loader-dot-index:${t}; --sf-loader-dot-step:${n};`}))}return g.append(b,m,y,$),g}({...t,width:24,height:24,stroke:2,dotRadius:null,pixel:!1})}function a({className:t="",overlay:e=!1}={}){const n=document.createElement("span");n.className=["sf-loader-container","sf-loader--infinite",t,t&&e?`${t}--overlay`:""].filter(Boolean).join(" "),n.dataset.sfSpinnerBound="1",n.dataset.infinite="true",n.setAttribute("aria-hidden","true");const i=document.createElement("span");return i.className="sf-loader--loading-indicator",i.append(s()),n.append(i),n}},"06e8cd089f28"(t,e,n){function i(){const t=globalThis.SF=globalThis.SF||{};return t.__deprecationNotes instanceof Map||Object.defineProperty(t,"__deprecationNotes",{value:new Map,configurable:!0}),t.__deprecationNotes}function o({component:t="",kind:e="attribute",attribute:n="",from:o,to:s=null}={}){if(!o)return;const a=[t,e,n,o].join("|"),r=i(),l=r.get(a);if(l)l.count+=1;else if(r.set(a,{component:t,kind:e,attribute:n,from:o,to:s,count:1}),function(){const t=globalThis.document?.documentElement;return"warn"===t?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const i=t?`${t}: `:"",a="value"===e?`${n}="${o}"`:`${e} ${o}`;globalThis.console?.warn?.(`[SIMAI Framework] ${i}${a} is a legacy name${s?`; write ${s}`:""}. See contracts/changes/journal.json.`)}}if(n.d(e,{YB:()=>o}),"undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const t=globalThis.SF.deprecations||{};t.list=function(){return[...i().values()].map(t=>({...t}))},t.clear=function(){i().clear()},t.note=o,globalThis.SF.deprecations=t}},c76f8895b630(t,e,n){n.a(t,async(t,e)=>{try{var i=n("fbe0570fcc69"),o=n("5168bdf4a1f9"),s=n("ddf1cdb42ecc"),a=n("2feae72af89f"),r=n("06e8cd089f28"),l=t([i,o,s,a]);[i,o,s,a]=l.then?(await l)():l;var c=n.n(i);const u=new Set(["template","size","appearance","type","scheme","status","text","icon","icon-start","icon-end","icon-left","icon-right","icon-position","text-position","spacing","tightness","radius","root-class","loading","segment","disabled","native-type","aria-label","class","style","id","slot"]);function d(t,e){t?.forwardHostAttributes(e,{exclude:u,transferDataAttributes:!0,storageKey:"__sfButtonForwardedDataAttributes",targetStorageKey:"__sfButtonAttributeKeys"})}const h=["default","tonal","outline","link","surface"],f={ghost:"link"},g={danger:"error",critical:"error"};class p extends(c()){constructor(){super(),this._attributeObserver=null}static get props(){return{templateName:{attribute:"template",default:"default"},size:{default:"1"},appearance:{default:"default",aliases:["type"]},scheme:{default:"primary"},status:{default:"",values:["","error"]},textPosition:{type:String,default:"center"},text:{default:""},segment:{default:""},icon:{default:""},iconStart:{type:String,default:null},iconEnd:{type:String,default:null},iconLeft:{default:""},iconRight:{default:""},iconPosition:{default:"start"},spacing:{type:String,default:null},tightness:{default:"",values:["","low","high","highest"]},radius:{default:"",values:["","default","square","rounded"]},rootClass:{default:""},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},nativeType:{default:"button"},ariaLabel:{default:""}}}get templateName(){return this.getAttribute("template")||"default"}get size(){return this.getAttribute("size")||"1"}get appearance(){const t=this.getAttribute("appearance")||this.getAttribute("type")||"default";return Object.hasOwn(f,t)?((0,r.YB)({component:this.localName,kind:"value",attribute:"appearance",from:t,to:f[t]}),f[t]):h.includes(t)?t:"default"}get type(){return this.appearance}get scheme(){return this.getAttribute("scheme")||"primary"}get status(){const t=this.getAttribute("status")||"";return g[t]?((0,r.YB)({component:this.localName,kind:"value",attribute:"status",from:t,to:g[t]}),g[t]):t}get text(){return this.getAttribute("text")||""}get icon(){return this.getAttribute("icon")||""}get iconLeft(){return this.hasAttribute("icon-left")&&(0,r.YB)({component:this.localName,kind:"attribute",from:"icon-left",to:"icon-start"}),this.getAttribute("icon-start")??this.getAttribute("icon-left")}get iconRight(){return this.hasAttribute("icon-right")&&(0,r.YB)({component:this.localName,kind:"attribute",from:"icon-right",to:"icon-end"}),this.getAttribute("icon-end")??this.getAttribute("icon-right")}get iconStart(){return this.iconLeft}get iconEnd(){return this.iconRight}get iconPosition(){return this.getAttribute("icon-position")||"start"}noteLegacyNames(){return this.hasAttribute("tightness")&&(0,r.YB)({component:this.localName,kind:"attribute",from:"tightness",to:"spacing"}),{}}get tightness(){return(0,a.resolveControlSpacing)({spacing:this.getAttribute("spacing"),tightness:this.getAttribute("tightness")}).tightness}get spacing(){return(0,a.resolveControlSpacing)({spacing:this.getAttribute("spacing"),tightness:this.getAttribute("tightness")}).spacing}get radius(){return this.getEnumAttr("radius",["default","square","rounded"],"")}get rootClass(){return this.getAttribute("root-class")||""}get loading(){return this.getBooleanAttr("loading",!1)}get disabled(){return this.getBooleanAttr("disabled",!1)}get nativeType(){return this.getAttribute("native-type")||"button"}get ariaLabel(){return this.getAttribute("aria-label")||""}templateContext(){const t=this.getPropsContext();return this.createTemplateContext({...t,iconLeft:t.iconStart??t.iconLeft,iconRight:t.iconEnd??t.iconRight,iconStart:this.iconStart,iconEnd:this.iconEnd,type:this.type,appearance:"ghost"===t.appearance?"link":t.appearance,status:this.status,...(0,a.resolveControlSpacing)({spacing:this.getAttribute("spacing"),tightness:this.getAttribute("tightness")}),...this.noteLegacyNames?.(),component:this})}template(){return(0,o.B)(this.templateContext())}resolveUpdateMode(){return"lit"}afterRender(){d(this,this.querySelector(".sf-button")),this._attributeObserver||(this._attributeObserver=this.observeForwardedHostAttributes(()=>this.querySelector(".sf-button"),{exclude:u,transferDataAttributes:!0,storageKey:"__sfButtonForwardedDataAttributes",targetStorageKey:"__sfButtonAttributeKeys"})._forwardHostAttributeObserver)}get value(){return{template:this.templateName,size:this.size,appearance:this.appearance,type:this.type,scheme:this.scheme,status:this.status,text:this.text,icon:this.icon,iconLeft:this.iconLeft,iconRight:this.iconRight,iconStart:this.iconStart,iconEnd:this.iconEnd,iconPosition:this.iconPosition,tightness:this.tightness,spacing:this.spacing,radius:this.radius,rootClass:this.rootClass,loading:this.loading,disabled:this.disabled,nativeType:this.nativeType,ariaLabel:this.ariaLabel}}onClick(t,e){return"function"==typeof t&&this.addEventListener("click",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}onMouseEnter(t,e){return"function"==typeof t&&this.addEventListener("mouseenter",t,e),this}onMouseLeave(t,e){return"function"==typeof t&&this.addEventListener("mouseleave",t,e),this}setDisabled(t=!0){return t?this.setAttribute("disabled",""):this.removeAttribute("disabled"),this}createIcon(t){return t?s.html`<sf-icon icon="${t}" root-class="pointer-event-none" weight="400" aria-hidden="true"></sf-icon>`:""}set value(t){this.setValueAttributes(t)}onDisconnected(){this.disconnectForwardedHostAttributes(),this._attributeObserver=null,super.onDisconnected?.()}}p.define("sf-button"),e()}catch(b){e(b)}})},"5168bdf4a1f9"(t,e,n){n.a(t,async(t,i)=>{try{n.d(e,{B:()=>l});var o=n("ddf1cdb42ecc"),s=n("50d2a204ba4c"),a=t([o]),r=a.then?(await a)():a;o=r[0];function l(t){const{size:e,appearance:n,type:i,scheme:a,status:r,text:l,icon:c,iconLeft:u,iconRight:d,iconPosition:h,spacing:f,radius:g,rootClass:p,textPosition:b,loading:m,disabled:y,nativeType:S,ariaLabel:v,segment:A}=t,x=String(h||"start").toLowerCase(),w=["right","end"].includes(x),$=t.iconStart??(u||(c&&!w?c:"")),_=t.iconEnd??(d||(c&&w?c:"")),M=t.component,T=M?.hasSlotContent?.("icon-start")?M.getSlotContent("icon-start"):M?.hasSlotContent?.("icon-left")?M.getSlotContent("icon-left"):M.createIcon($),k=M?.hasSlotContent?.("icon-end")?M.getSlotContent("icon-end"):M?.hasSlotContent?.("icon-right")?M.getSlotContent("icon-right"):M.createIcon(_),L=M?.hasSlotContent?.("text")?M.getSlotContent("text"):l,C=!T&&!k;let E=T,F=k,B="";if(m){const t=t=>(0,s.le)({className:"sf-button-spinner",overlay:t});T?E=t(!1):k?F=t(!1):B=t(!0)}const N=["sf-button",`sf-button--size-${e}`,`sf-button--${n||i}`,`sf-button--${r||a}`,"flex","items-cross-center",A?`segment-${A}`:"",f&&"normal"!==f?`spacing-${f}`:"",g?`radius-${g}`:"",p,m?"loading sf-button-state-loading":""].filter(Boolean);return o.html`
2
2
  <button
3
3
  type=${S}
4
- class=${P.join(" ")}
5
- style=${t.rootStyle||s.nothing}
4
+ class=${N.join(" ")}
5
+ style=${t.rootStyle||o.nothing}
6
6
  ?disabled=${y||m}
7
- aria-label=${v||s.nothing}
8
- aria-busy=${m?"true":s.nothing}
7
+ aria-label=${v||o.nothing}
8
+ aria-busy=${m?"true":o.nothing}
9
9
  >
10
- ${N}
11
- ${F}
12
- ${L?s.html`<span
13
- class="sf-button-text-container text-${b} pointer-event-none${k?" flex-1":""}">
10
+ ${B}
11
+ ${E}
12
+ ${L?o.html`<span
13
+ class="sf-button-text-container text-${b} pointer-event-none${C?" flex-1":""}">
14
14
  ${L}
15
15
  </span>`:""}
16
- ${B}
16
+ ${F}
17
17
  </button>
18
- `}i()}catch(l){i(l)}})},"2feae72af89f"(t){t.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("control-spacing"):new Promise(t=>globalThis.addEventListener("sf-runtime-ready",()=>t(globalThis.SF.runtimeModule("control-spacing")),{once:!0}))},ddf1cdb42ecc(t){t.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit"):new Promise(t=>globalThis.addEventListener("sf-runtime-ready",()=>t(globalThis.SF.runtimeModule("lit")),{once:!0}))},fbe0570fcc69(t){t.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("smart-base"):new Promise(t=>globalThis.addEventListener("sf-runtime-ready",()=>t(globalThis.SF.runtimeModule("smart-base")),{once:!0}))}};const e={};function n(i){const s=e[i];if(void 0!==s)return s.exports;const o=e[i]={exports:{}};return t[i](o,o.exports,n),o.exports}(()=>{const t="function"==typeof Symbol,e=t?Symbol("webpack queues"):"__webpack_queues__",i=t?Symbol("webpack exports"):"__webpack_exports__",s=t?Symbol("webpack error"):"__webpack_error__",o=t=>{t?.d<1&&(t.d=1,t.forEach(t=>t.r--),t.forEach(t=>t.r--?t.r++:t()))};n.a=(t,n,r)=>{let a;r&&((a=[]).d=-1);const c=new Set,l=t.exports;let u,d,h;const g=new Promise((t,e)=>{h=e,d=t});g[i]=l,g[e]=t=>(a&&t(a),c.forEach(t),g.catch(t=>{})),t.exports=g;n(t=>{let n;u=(t=>t.map(t=>{if(null!==t&&"object"==typeof t){if(t[e])return t;if(t.then){const n=[];n.d=0,t.then(t=>{r[i]=t,o(n)},t=>{r[s]=t,o(n)});const r={};return r[e]=t=>t(n),r}}const n={};return n[e]=t=>{},n[i]=t,n}))(t);const r=()=>u.map(t=>{if(t[s])throw t[s];return t[i]}),l=new Promise(t=>{n=()=>t(r),n.r=0;const i=t=>t!==a&&!c.has(t)&&(c.add(t),t&&!t.d&&(n.r++,t.push(n)));u.map(t=>t[e](i))});return n.r?l:r()},t=>(t?h(g[s]=t):d(l),o(a))),a?.d<0&&(a.d=0)}})(),n.n=t=>{const e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{if(Array.isArray(e))for(var i=0;i<e.length;){var s=e[i++],o=e[i++];n.o(t,s)?0===o&&i++:0===o?Object.defineProperty(t,s,{enumerable:!0,value:e[i++]}):Object.defineProperty(t,s,{enumerable:!0,get:o})}else for(var s in e)n.o(e,s)&&!n.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);n("c76f8895b630")})();
18
+ `}i()}catch(c){i(c)}})},"2feae72af89f"(t){t.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("control-spacing"):new Promise(t=>globalThis.addEventListener("sf-runtime-ready",()=>t(globalThis.SF.runtimeModule("control-spacing")),{once:!0}))},ddf1cdb42ecc(t){t.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit"):new Promise(t=>globalThis.addEventListener("sf-runtime-ready",()=>t(globalThis.SF.runtimeModule("lit")),{once:!0}))},fbe0570fcc69(t){t.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("smart-base"):new Promise(t=>globalThis.addEventListener("sf-runtime-ready",()=>t(globalThis.SF.runtimeModule("smart-base")),{once:!0}))}};const e={};function n(i){const o=e[i];if(void 0!==o)return o.exports;const s=e[i]={exports:{}};return t[i](s,s.exports,n),s.exports}(()=>{const t="function"==typeof Symbol,e=t?Symbol("webpack queues"):"__webpack_queues__",i=t?Symbol("webpack exports"):"__webpack_exports__",o=t?Symbol("webpack error"):"__webpack_error__",s=t=>{t?.d<1&&(t.d=1,t.forEach(t=>t.r--),t.forEach(t=>t.r--?t.r++:t()))};n.a=(t,n,a)=>{let r;a&&((r=[]).d=-1);const l=new Set,c=t.exports;let u,d,h;const f=new Promise((t,e)=>{h=e,d=t});f[i]=c,f[e]=t=>(r&&t(r),l.forEach(t),f.catch(t=>{})),t.exports=f;n(t=>{let n;u=(t=>t.map(t=>{if(null!==t&&"object"==typeof t){if(t[e])return t;if(t.then){const n=[];n.d=0,t.then(t=>{a[i]=t,s(n)},t=>{a[o]=t,s(n)});const a={};return a[e]=t=>t(n),a}}const n={};return n[e]=t=>{},n[i]=t,n}))(t);const a=()=>u.map(t=>{if(t[o])throw t[o];return t[i]}),c=new Promise(t=>{n=()=>t(a),n.r=0;const i=t=>t!==r&&!l.has(t)&&(l.add(t),t&&!t.d&&(n.r++,t.push(n)));u.map(t=>t[e](i))});return n.r?c:a()},t=>(t?h(f[o]=t):d(c),s(r))),r?.d<0&&(r.d=0)}})(),n.n=t=>{const e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{if(Array.isArray(e))for(var i=0;i<e.length;){var o=e[i++],s=e[i++];n.o(t,o)?0===s&&i++:0===s?Object.defineProperty(t,o,{enumerable:!0,value:e[i++]}):Object.defineProperty(t,o,{enumerable:!0,get:s})}else for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);n("c76f8895b630")})();
@@ -245,7 +245,7 @@
245
245
  "loading": {
246
246
  "type": "boolean",
247
247
  "default": false,
248
- "description": "Loading state: the spinner at the icon's size in place of the start icon (else the end icon); without an icon it lies over the label, which keeps its place, so the width does not change. Sets aria-busy and disables the native button."
248
+ "description": "Loading state: the spinner at the icon's size in place of the start icon (else the end icon); without an icon it lies over the label, which keeps its place, so the width does not change. The spinner takes the page's look (data-sf-spinner). Sets aria-busy and disables the native button."
249
249
  },
250
250
  "disabled": {
251
251
  "type": "boolean",
@@ -1,14 +1,14 @@
1
- (()=>{"use strict";var t={"50d2a204ba4c"(t,e,s){s.d(e,{le:()=>r});function n(t,e={}){const s=document.createElementNS("http://www.w3.org/2000/svg",t);return Object.entries(e).forEach(([t,e])=>{null!=e&&""!==e&&s.setAttribute(t,String(e))}),s}function r({className:t="",overlay:e=!1}={}){const s=document.createElement("span");s.className=["sf-loader-container","sf-loader--infinite",t,t&&e?`${t}--overlay`:""].filter(Boolean).join(" "),s.dataset.sfSpinnerBound="1",s.dataset.infinite="true",s.setAttribute("aria-hidden","true");const r=document.createElement("span");return r.className="sf-loader--loading-indicator",r.append(function(){const t=12,e=n("svg",{class:"sf-loader-svg",viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false"}),s=n("circle",{class:"sf-loader-ring-filled",cx:t,cy:t,r:11,fill:"none",stroke:"currentColor","stroke-width":2,opacity:"0.3"}),r=n("circle",{class:"sf-loader-ring-accent",cx:t,cy:t,r:11,fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round",pathLength:100,"stroke-dasharray":"0 100",transform:"rotate(90 12 12)"});return e.append(s,r),e}()),s.append(r),s}},"2557e7cf84cc"(t,e,s){s.a(t,async(t,e)=>{try{var n=s("fbe0570fcc69"),r=s("7a7da66f4cf1"),i=s("2feae72af89f"),a=t([n,r,i]);[n,r,i]=a.then?(await a)():a;var o=s.n(n);const l=new Set(["template","kind","variant","size","appearance","type","scheme","status","icon","filled","spacing","tightness","radius","segment","root-class","loading","disabled","native-type","aria-label","class","style","id","slot"]);function u(t,e){t?.forwardHostAttributes(e,{exclude:l,transferDataAttributes:!0,storageKey:"__sfIconButtonForwardedDataAttributes",targetStorageKey:"__sfIconButtonAttributeKeys"})}const c=["default","tonal","outline","link","surface","ghost"];class d extends(o()){constructor(){super(),this._attributeObserver=null}static get props(){return{templateName:{attribute:"template",default:"default"},kind:{default:"icon",values:["icon","close"],aliases:["variant"]},size:{default:"1"},appearance:{default:"default",aliases:["type"]},scheme:{default:"primary"},status:{default:"",values:["","error"]},segment:{default:""},icon:{default:"add"},filled:{type:Boolean,default:!1},spacing:{type:String,default:null},tightness:{default:"",values:["","low","high","highest"]},radius:{default:"",values:["","default","square","rounded"]},rootClass:{default:""},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},nativeType:{default:"button"},ariaLabel:{default:""}}}get templateName(){return this.getAttribute("template")||"default"}get size(){return this.getAttribute("size")||"1"}get kind(){return this.getProp("kind")}get variant(){return this.kind}get appearance(){const t=this.getAttribute("appearance")||this.getAttribute("type")||"default";return c.includes(t)?t:"default"}get type(){return this.appearance}get scheme(){return this.getAttribute("scheme")||"primary"}get status(){return this.getAttribute("status")||""}get icon(){return this.getAttribute("icon")||"add"}get segment(){return this.getEnumAttr("segment",["start","middle","end"],"")}get filled(){return this.getBooleanAttr("filled",!1)}get tightness(){return(0,i.resolveControlSpacing)({spacing:this.getAttribute("spacing"),tightness:this.getAttribute("tightness")}).tightness}get spacing(){return(0,i.resolveControlSpacing)({spacing:this.getAttribute("spacing"),tightness:this.getAttribute("tightness")}).spacing}get radius(){return this.getEnumAttr("radius",["default","square","rounded"],"")}get rootClass(){return this.getAttribute("root-class")||""}get loading(){return this.getBooleanAttr("loading",!1)}get disabled(){return this.getBooleanAttr("disabled",!1)}get nativeType(){return this.getAttribute("native-type")||"button"}get ariaLabel(){return this.getAttribute("aria-label")||""}templateContext(){const t=this.getPropsContext();return this.createTemplateContext({...t,type:this.type,variant:this.variant,...(0,i.resolveControlSpacing)({spacing:this.getAttribute("spacing"),tightness:this.getAttribute("tightness")}),component:this})}template(){return(0,r.y)(this.templateContext())}resolveUpdateMode(t=[]){const e=["disabled","aria-label","icon"];return t.length>0&&t.every(t=>e.includes(t))?"dom":"lit"}updateDom(t=[]){const e=this.querySelector(".sf-icon-button");if(!e)return!1;if(t.includes("disabled")&&(e.disabled=this.disabled||this.loading),t.includes("aria-label")&&(this.ariaLabel?e.setAttribute("aria-label",this.ariaLabel):e.removeAttribute("aria-label")),t.includes("icon")){const t=e.querySelector(".sf-icon");t&&(t.textContent=this.icon)}return u(this,e),!0}afterRender(){u(this,this.querySelector(".sf-icon-button")),this._attributeObserver||(this._attributeObserver=this.observeForwardedHostAttributes(()=>this.querySelector(".sf-icon-button"),{exclude:l,transferDataAttributes:!0,storageKey:"__sfIconButtonForwardedDataAttributes",targetStorageKey:"__sfIconButtonAttributeKeys"})._forwardHostAttributeObserver)}get value(){return{template:this.templateName,size:this.size,variant:this.variant,appearance:this.appearance,type:this.type,scheme:this.scheme,status:this.status,icon:this.icon,segment:this.segment,filled:this.filled,tightness:this.tightness,spacing:this.spacing,radius:this.radius,rootClass:this.rootClass,loading:this.loading,disabled:this.disabled,nativeType:this.nativeType,ariaLabel:this.ariaLabel}}setButtonAttributes(t={}){return this.setState({buttonAttributes:t}),this}onClick(t,e){return"function"==typeof t&&this.addEventListener("click",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}onMouseEnter(t,e){return"function"==typeof t&&this.addEventListener("mouseenter",t,e),this}onMouseLeave(t,e){return"function"==typeof t&&this.addEventListener("mouseleave",t,e),this}setDisabled(t=!0){return t?this.setAttribute("disabled",""):this.removeAttribute("disabled"),this}set value(t){this.setValueAttributes(t)}onDisconnected(){this.disconnectForwardedHostAttributes(),this._attributeObserver=null,super.onDisconnected?.()}}d.define("sf-icon-button"),e()}catch(h){e(h)}})},"7a7da66f4cf1"(t,e,s){s.a(t,async(t,n)=>{try{s.d(e,{y:()=>u});var r=s("ddf1cdb42ecc"),i=s("50d2a204ba4c"),a=t([r]),o=a.then?(await a)():a;r=o[0];const l=new Set(["1/3","1/2","1","2","3"]);function u(t){const{size:e,appearance:s,type:n,scheme:a,status:o,icon:u,segment:c,tightness:d,kind:h,variant:f,radius:g,filled:b,rootClass:p,loading:m,disabled:y,nativeType:v,ariaLabel:A}=t,S=["sf-icon-button",l.has(e||"1")?`sf-icon-button--size-${e||"1"}`:"",`sf-icon-button--${h??f??"icon"}`,`sf-icon-button--${s||n||"default"}`,"flex","items-cross-center",c?`segment-${c}`:"",`sf-icon-button--${o||a||"primary"}`,d?`tightness-${d}`:"",g?`radius-${g}`:"",p,m?"loading sf-icon-button-state-loading":""].filter(Boolean),w=m?(0,i.le)({className:"sf-icon-button-spinner"}):t.component?.hasSlotContent?.("icon")?t.component.getSlotContent("icon"):"close"===(h??f)?r.html`
2
- <sf-close root-class="pointer-event-none" size="${e||"1"}"></sf-close>`:r.html`
3
- <sf-icon filled="${b}" root-class="pointer-event-none" icon="${u}" weight="400" aria-hidden="true"></sf-icon>`;return r.html`
1
+ (()=>{"use strict";var t={"50d2a204ba4c"(t,e,s){s.d(e,{le:()=>i});function a(t,e={}){const s=document.createElementNS("http://www.w3.org/2000/svg",t);return Object.entries(e).forEach(([t,e])=>{null!=e&&""!==e&&s.setAttribute(t,String(e))}),s}const n=t=>Math.round(1e3*t)/1e3;function r(t={}){return function({width:t=24,height:e=24,stroke:s=2,dots:r=8,filled:i=3,dotRadius:o=null,direction:l="clockwise",pixel:u=!1}={}){const c=t/2,d=e/2,h=Math.min(t,e)/2,f=Math.max(1,h-s/2),g=a("svg",{class:"sf-loader-svg",viewBox:`0 0 ${t} ${e}`,width:u?t:null,height:u?e:null,"aria-hidden":"true",focusable:"false"}),p={cx:c,cy:d,r:n(f),fill:"none",stroke:"currentColor","stroke-width":s},b=a("circle",{class:"sf-loader-ring-filled",...p,opacity:"0.3"}),m=a("circle",{class:"sf-loader-ring-accent",...p,"stroke-linecap":"round",pathLength:100,"stroke-dasharray":"0 100",transform:`rotate(90 ${c} ${d})`}),y=a("g",{class:"sf-loader-comet",display:"none",transform:`rotate(-90 ${c} ${d})`});for(let t=0;t<10;t+=1){const e=9===t;y.append(a("circle",{class:"sf-loader-comet-segment"+(e?" sf-loader-comet-head":""),...p,"stroke-linecap":e?"round":"butt",pathLength:100,"stroke-dasharray":`${n(4)} ${n(96)}`,"stroke-dashoffset":n(-4*t),opacity:n(((t+1)/10)**1.6)}))}const v=Math.max(3,Math.min(32,Math.floor(Number(r)||8))),A=Math.max(1,Math.min(v,Math.floor(Number(i)||3))),w=Math.min(s,.7*Math.PI*(h-s)/v),S=null==o||""===o?w:Math.max(1,Math.min(Number(o)||w,h/4)),x=Math.max(S,h-S),M=a("g",{class:"sf-loader-dots",display:"none",style:`--sf-loader-dot-count:${v}; --sf-loader-dot-filled:${A};`});for(let t=0;t<v;t+=1){const e=2*Math.PI/v*t-Math.PI/2,s="counterclockwise"===l?t:(v-t)%v;M.append(a("circle",{class:"sf-loader-dot"+(t<A?" sf-loader-dot--active":""),cx:n(c+x*Math.cos(e)),cy:n(d+x*Math.sin(e)),r:n(S),fill:"currentColor",style:`--sf-loader-dot-index:${t}; --sf-loader-dot-step:${s};`}))}return g.append(b,m,y,M),g}({...t,width:24,height:24,stroke:2,dotRadius:null,pixel:!1})}function i({className:t="",overlay:e=!1}={}){const s=document.createElement("span");s.className=["sf-loader-container","sf-loader--infinite",t,t&&e?`${t}--overlay`:""].filter(Boolean).join(" "),s.dataset.sfSpinnerBound="1",s.dataset.infinite="true",s.setAttribute("aria-hidden","true");const a=document.createElement("span");return a.className="sf-loader--loading-indicator",a.append(r()),s.append(a),s}},"2557e7cf84cc"(t,e,s){s.a(t,async(t,e)=>{try{var a=s("fbe0570fcc69"),n=s("7a7da66f4cf1"),r=s("2feae72af89f"),i=t([a,n,r]);[a,n,r]=i.then?(await i)():i;var o=s.n(a);const l=new Set(["template","kind","variant","size","appearance","type","scheme","status","icon","filled","spacing","tightness","radius","segment","root-class","loading","disabled","native-type","aria-label","class","style","id","slot"]);function u(t,e){t?.forwardHostAttributes(e,{exclude:l,transferDataAttributes:!0,storageKey:"__sfIconButtonForwardedDataAttributes",targetStorageKey:"__sfIconButtonAttributeKeys"})}const c=["default","tonal","outline","link","surface","ghost"];class d extends(o()){constructor(){super(),this._attributeObserver=null}static get props(){return{templateName:{attribute:"template",default:"default"},kind:{default:"icon",values:["icon","close"],aliases:["variant"]},size:{default:"1"},appearance:{default:"default",aliases:["type"]},scheme:{default:"primary"},status:{default:"",values:["","error"]},segment:{default:""},icon:{default:"add"},filled:{type:Boolean,default:!1},spacing:{type:String,default:null},tightness:{default:"",values:["","low","high","highest"]},radius:{default:"",values:["","default","square","rounded"]},rootClass:{default:""},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},nativeType:{default:"button"},ariaLabel:{default:""}}}get templateName(){return this.getAttribute("template")||"default"}get size(){return this.getAttribute("size")||"1"}get kind(){return this.getProp("kind")}get variant(){return this.kind}get appearance(){const t=this.getAttribute("appearance")||this.getAttribute("type")||"default";return c.includes(t)?t:"default"}get type(){return this.appearance}get scheme(){return this.getAttribute("scheme")||"primary"}get status(){return this.getAttribute("status")||""}get icon(){return this.getAttribute("icon")||"add"}get segment(){return this.getEnumAttr("segment",["start","middle","end"],"")}get filled(){return this.getBooleanAttr("filled",!1)}get tightness(){return(0,r.resolveControlSpacing)({spacing:this.getAttribute("spacing"),tightness:this.getAttribute("tightness")}).tightness}get spacing(){return(0,r.resolveControlSpacing)({spacing:this.getAttribute("spacing"),tightness:this.getAttribute("tightness")}).spacing}get radius(){return this.getEnumAttr("radius",["default","square","rounded"],"")}get rootClass(){return this.getAttribute("root-class")||""}get loading(){return this.getBooleanAttr("loading",!1)}get disabled(){return this.getBooleanAttr("disabled",!1)}get nativeType(){return this.getAttribute("native-type")||"button"}get ariaLabel(){return this.getAttribute("aria-label")||""}templateContext(){const t=this.getPropsContext();return this.createTemplateContext({...t,type:this.type,variant:this.variant,...(0,r.resolveControlSpacing)({spacing:this.getAttribute("spacing"),tightness:this.getAttribute("tightness")}),component:this})}template(){return(0,n.y)(this.templateContext())}resolveUpdateMode(t=[]){const e=["disabled","aria-label","icon"];return t.length>0&&t.every(t=>e.includes(t))?"dom":"lit"}updateDom(t=[]){const e=this.querySelector(".sf-icon-button");if(!e)return!1;if(t.includes("disabled")&&(e.disabled=this.disabled||this.loading),t.includes("aria-label")&&(this.ariaLabel?e.setAttribute("aria-label",this.ariaLabel):e.removeAttribute("aria-label")),t.includes("icon")){const t=e.querySelector(".sf-icon");t&&(t.textContent=this.icon)}return u(this,e),!0}afterRender(){u(this,this.querySelector(".sf-icon-button")),this._attributeObserver||(this._attributeObserver=this.observeForwardedHostAttributes(()=>this.querySelector(".sf-icon-button"),{exclude:l,transferDataAttributes:!0,storageKey:"__sfIconButtonForwardedDataAttributes",targetStorageKey:"__sfIconButtonAttributeKeys"})._forwardHostAttributeObserver)}get value(){return{template:this.templateName,size:this.size,variant:this.variant,appearance:this.appearance,type:this.type,scheme:this.scheme,status:this.status,icon:this.icon,segment:this.segment,filled:this.filled,tightness:this.tightness,spacing:this.spacing,radius:this.radius,rootClass:this.rootClass,loading:this.loading,disabled:this.disabled,nativeType:this.nativeType,ariaLabel:this.ariaLabel}}setButtonAttributes(t={}){return this.setState({buttonAttributes:t}),this}onClick(t,e){return"function"==typeof t&&this.addEventListener("click",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}onMouseEnter(t,e){return"function"==typeof t&&this.addEventListener("mouseenter",t,e),this}onMouseLeave(t,e){return"function"==typeof t&&this.addEventListener("mouseleave",t,e),this}setDisabled(t=!0){return t?this.setAttribute("disabled",""):this.removeAttribute("disabled"),this}set value(t){this.setValueAttributes(t)}onDisconnected(){this.disconnectForwardedHostAttributes(),this._attributeObserver=null,super.onDisconnected?.()}}d.define("sf-icon-button"),e()}catch(h){e(h)}})},"7a7da66f4cf1"(t,e,s){s.a(t,async(t,a)=>{try{s.d(e,{y:()=>u});var n=s("ddf1cdb42ecc"),r=s("50d2a204ba4c"),i=t([n]),o=i.then?(await i)():i;n=o[0];const l=new Set(["1/3","1/2","1","2","3"]);function u(t){const{size:e,appearance:s,type:a,scheme:i,status:o,icon:u,segment:c,tightness:d,kind:h,variant:f,radius:g,filled:p,rootClass:b,loading:m,disabled:y,nativeType:v,ariaLabel:A}=t,w=["sf-icon-button",l.has(e||"1")?`sf-icon-button--size-${e||"1"}`:"",`sf-icon-button--${h??f??"icon"}`,`sf-icon-button--${s||a||"default"}`,"flex","items-cross-center",c?`segment-${c}`:"",`sf-icon-button--${o||i||"primary"}`,d?`tightness-${d}`:"",g?`radius-${g}`:"",b,m?"loading sf-icon-button-state-loading":""].filter(Boolean),S=m?(0,r.le)({className:"sf-icon-button-spinner"}):t.component?.hasSlotContent?.("icon")?t.component.getSlotContent("icon"):"close"===(h??f)?n.html`
2
+ <sf-close root-class="pointer-event-none" size="${e||"1"}"></sf-close>`:n.html`
3
+ <sf-icon filled="${p}" root-class="pointer-event-none" icon="${u}" weight="400" aria-hidden="true"></sf-icon>`;return n.html`
4
4
  <button
5
5
  type=${v}
6
- class=${S.join(" ")}
7
- style=${t.rootStyle||r.nothing}
6
+ class=${w.join(" ")}
7
+ style=${t.rootStyle||n.nothing}
8
8
  ?disabled=${y||m}
9
- aria-label=${A||r.nothing}
10
- aria-busy=${m?"true":r.nothing}
9
+ aria-label=${A||n.nothing}
10
+ aria-busy=${m?"true":n.nothing}
11
11
  >
12
- ${w}
12
+ ${S}
13
13
  </button>
14
- `}n()}catch(c){n(c)}})},"2feae72af89f"(t){t.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("control-spacing"):new Promise(t=>globalThis.addEventListener("sf-runtime-ready",()=>t(globalThis.SF.runtimeModule("control-spacing")),{once:!0}))},ddf1cdb42ecc(t){t.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit"):new Promise(t=>globalThis.addEventListener("sf-runtime-ready",()=>t(globalThis.SF.runtimeModule("lit")),{once:!0}))},fbe0570fcc69(t){t.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("smart-base"):new Promise(t=>globalThis.addEventListener("sf-runtime-ready",()=>t(globalThis.SF.runtimeModule("smart-base")),{once:!0}))}};const e={};function s(n){const r=e[n];if(void 0!==r)return r.exports;const i=e[n]={exports:{}};return t[n](i,i.exports,s),i.exports}(()=>{const t="function"==typeof Symbol,e=t?Symbol("webpack queues"):"__webpack_queues__",n=t?Symbol("webpack exports"):"__webpack_exports__",r=t?Symbol("webpack error"):"__webpack_error__",i=t=>{t?.d<1&&(t.d=1,t.forEach(t=>t.r--),t.forEach(t=>t.r--?t.r++:t()))};s.a=(t,s,a)=>{let o;a&&((o=[]).d=-1);const l=new Set,u=t.exports;let c,d,h;const f=new Promise((t,e)=>{h=e,d=t});f[n]=u,f[e]=t=>(o&&t(o),l.forEach(t),f.catch(t=>{})),t.exports=f;s(t=>{let s;c=(t=>t.map(t=>{if(null!==t&&"object"==typeof t){if(t[e])return t;if(t.then){const s=[];s.d=0,t.then(t=>{a[n]=t,i(s)},t=>{a[r]=t,i(s)});const a={};return a[e]=t=>t(s),a}}const s={};return s[e]=t=>{},s[n]=t,s}))(t);const a=()=>c.map(t=>{if(t[r])throw t[r];return t[n]}),u=new Promise(t=>{s=()=>t(a),s.r=0;const n=t=>t!==o&&!l.has(t)&&(l.add(t),t&&!t.d&&(s.r++,t.push(s)));c.map(t=>t[e](n))});return s.r?u:a()},t=>(t?h(f[r]=t):d(u),i(o))),o?.d<0&&(o.d=0)}})(),s.n=t=>{const e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{if(Array.isArray(e))for(var n=0;n<e.length;){var r=e[n++],i=e[n++];s.o(t,r)?0===i&&n++:0===i?Object.defineProperty(t,r,{enumerable:!0,value:e[n++]}):Object.defineProperty(t,r,{enumerable:!0,get:i})}else for(var r in e)s.o(e,r)&&!s.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);s("2557e7cf84cc")})();
14
+ `}a()}catch(c){a(c)}})},"2feae72af89f"(t){t.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("control-spacing"):new Promise(t=>globalThis.addEventListener("sf-runtime-ready",()=>t(globalThis.SF.runtimeModule("control-spacing")),{once:!0}))},ddf1cdb42ecc(t){t.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit"):new Promise(t=>globalThis.addEventListener("sf-runtime-ready",()=>t(globalThis.SF.runtimeModule("lit")),{once:!0}))},fbe0570fcc69(t){t.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("smart-base"):new Promise(t=>globalThis.addEventListener("sf-runtime-ready",()=>t(globalThis.SF.runtimeModule("smart-base")),{once:!0}))}};const e={};function s(a){const n=e[a];if(void 0!==n)return n.exports;const r=e[a]={exports:{}};return t[a](r,r.exports,s),r.exports}(()=>{const t="function"==typeof Symbol,e=t?Symbol("webpack queues"):"__webpack_queues__",a=t?Symbol("webpack exports"):"__webpack_exports__",n=t?Symbol("webpack error"):"__webpack_error__",r=t=>{t?.d<1&&(t.d=1,t.forEach(t=>t.r--),t.forEach(t=>t.r--?t.r++:t()))};s.a=(t,s,i)=>{let o;i&&((o=[]).d=-1);const l=new Set,u=t.exports;let c,d,h;const f=new Promise((t,e)=>{h=e,d=t});f[a]=u,f[e]=t=>(o&&t(o),l.forEach(t),f.catch(t=>{})),t.exports=f;s(t=>{let s;c=(t=>t.map(t=>{if(null!==t&&"object"==typeof t){if(t[e])return t;if(t.then){const s=[];s.d=0,t.then(t=>{i[a]=t,r(s)},t=>{i[n]=t,r(s)});const i={};return i[e]=t=>t(s),i}}const s={};return s[e]=t=>{},s[a]=t,s}))(t);const i=()=>c.map(t=>{if(t[n])throw t[n];return t[a]}),u=new Promise(t=>{s=()=>t(i),s.r=0;const a=t=>t!==o&&!l.has(t)&&(l.add(t),t&&!t.d&&(s.r++,t.push(s)));c.map(t=>t[e](a))});return s.r?u:i()},t=>(t?h(f[n]=t):d(u),r(o))),o?.d<0&&(o.d=0)}})(),s.n=t=>{const e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{if(Array.isArray(e))for(var a=0;a<e.length;){var n=e[a++],r=e[a++];s.o(t,n)?0===r&&a++:0===r?Object.defineProperty(t,n,{enumerable:!0,value:e[a++]}):Object.defineProperty(t,n,{enumerable:!0,get:r})}else for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);s("2557e7cf84cc")})();
@@ -152,7 +152,7 @@
152
152
  "loading": {
153
153
  "type": "boolean",
154
154
  "default": false,
155
- "description": "Loading state: the spinner in place of the icon, at the icon's size. Sets aria-busy and disables the native button."
155
+ "description": "Loading state: the spinner in place of the icon, at the icon's size, in the page's look (data-sf-spinner). Sets aria-busy and disables the native button."
156
156
  },
157
157
  "disabled": {
158
158
  "type": "boolean",
@@ -1,4 +1,4 @@
1
- (()=>{"use strict";var e={"3f3a6e2680d5"(e,t,o){function i(e,t=!1){if(!e)return()=>{};const o=new Set,i=()=>{for(const t of e.children)t.hasAttribute("inert")||(t.setAttribute("inert",""),o.add(t))};t&&e.focus({preventScroll:!0}),i();const s=new e.ownerDocument.defaultView.MutationObserver(i);return s.observe(e,{childList:!0}),()=>{s.disconnect();for(const e of o)""===e.getAttribute("inert")&&e.removeAttribute("inert");o.clear()}}o.d(t,{e:()=>i})},c8d66dd2c299(e,t,o){o.d(t,{Zg:()=>l,ro:()=>n});const i=["a[href]","area[href]","button","input","select","textarea","iframe","summary","audio[controls]","video[controls]","[contenteditable]","[tabindex]"].join(","),s=Symbol.for("simai.modal.focus-guards");function n(e){const t=e?.getModalRoot?.()||e?.template,o=t?.querySelector?.("[data-sf-modal-panel]"),i=document[s];if(i&&i.panel===o&&i.before.isConnected&&i.after.isConnected)return;if(i?.before.remove(),i?.after.remove(),delete document[s],!o?.parentNode)return;const n={panel:o,relaying:!1};for(const e of["before","after"]){const i=o.ownerDocument.createElement("span");i.tabIndex=0,i.className="sf-modal-focus-guard",i.setAttribute("aria-hidden","true"),i.addEventListener("focus",()=>{if(n.relaying||!o.isConnected||t.inert||"true"===t.getAttribute("aria-hidden"))return;const i="before"===e,s=r(o,i),a=i?s.at(-1):s[0];a&&"IFRAME"!==a.tagName?a.focus({preventScroll:!0}):o.focus({preventScroll:!0})}),n[e]=i}o.before(n.before),o.after(n.after),document[s]=n}function a(e,t){return"INPUT"===e?.tagName&&"INPUT"===t?.tagName&&"radio"===e.type&&"radio"===t.type&&!!e.name&&e.name===t.name&&e.form===t.form&&e.getRootNode()===t.getRootNode()}function r(e,t=!1){const o=e.ownerDocument.defaultView,s=Array.from(e.querySelectorAll(i)).filter(e=>e.tabIndex>=0&&!e.matches(":disabled")&&!e.closest("[inert]")&&e.getClientRects().length>0&&"visible"===o.getComputedStyle(e).visibility).sort((e,t)=>(e.tabIndex||1/0)-(t.tabIndex||1/0));return s.filter(e=>{if(!a(e,e))return!0;const o=s.filter(t=>a(e,t)),i=o.find(e=>e.checked);return e===(i||o.at(t?-1:0))})}function l(e,t){if(!e)return;const o=r(e,t.shiftKey),i=e.ownerDocument.activeElement;if(!o.length)return t.preventDefault(),void e.focus();const n=o[0],l=o[o.length-1],d=t.shiftKey?n:l;if(!e.contains(i)||i===e||i===d||a(i,d)){const o=t.shiftKey?l:n,i=e.ownerDocument[s];if("IFRAME"===o.tagName&&i?.panel===e){i.relaying=!0;try{(t.shiftKey?i.after:i.before).focus({preventScroll:!0})}finally{i.relaying=!1}return}t.preventDefault(),o.focus()}}},"201fd0b17b8b"(e,t,o){o.d(t,{Gp:()=>s,ju:()=>n});const i=e=>{const t=Number.parseFloat(e);return Number.isFinite(t)?t*(e.trim().endsWith("ms")?1:1e3):0};function s(e,t=window){let o=!1,i=null,s=null;const n=()=>{o||(o=!0,null!==i&&(t.cancelAnimationFrame(i),i=null),null!==s&&(t.clearTimeout(s),s=null),e())};return i=t.requestAnimationFrame(n),s=t.setTimeout(n,50),"function"==typeof t.queueMicrotask&&t.queueMicrotask(n),()=>{o=!0,null!==i&&t.cancelAnimationFrame(i),null!==s&&t.clearTimeout(s)}}function n(e,t,o=window){let n=null,a=!1;const r=s(()=>{if(a)return;const s=e(),r=s?.querySelectorAll("[data-sf-modal-panel], [data-sf-modal-overlay]")||[],l=Math.max(0,...Array.from(r,e=>{const t=o.getComputedStyle(e);return"none"===t.display?0:function(e){const t=e.transitionProperty.split(",").map(e=>e.trim()),o=e.transitionDuration.split(",").map(i),s=e.transitionDelay.split(",").map(i);return Math.max(0,...t.map((e,t)=>["all","opacity","transform","-webkit-transform"].includes(e)?Math.max(0,o[t%o.length])+s[t%s.length]:0))}(t)}));n=o.setTimeout(()=>{a||t()},l)},o);return()=>{a=!0,r(),null!==n&&o.clearTimeout(n)}}},ed3ae3576d0a(e,t,o){function i(e=!0){const t=document.documentElement,o=document.body;if(!t||!o)return null;const i=Math.max(0,window.innerWidth-t.clientWidth),s=parseFloat(window.getComputedStyle(o).paddingInlineEnd)||0,n={docEl:t,body:o,htmlLocked:t.classList.contains("overflow-hidden"),bodyLocked:o.classList.contains("overflow-hidden"),bodyPaddingInlineEnd:o.style.getPropertyValue("padding-inline-end"),paddingPriority:o.style.getPropertyPriority("padding-inline-end"),appliedPadding:null};return t.classList.add("overflow-hidden"),o.classList.add("overflow-hidden"),e&&i>0&&(o.style.setProperty("padding-inline-end",`${s+i}px`,n.paddingPriority),n.appliedPadding=o.style.getPropertyValue("padding-inline-end")),n}function s(e){if(!e)return;const{docEl:t,body:o}=e;e.htmlLocked||t.classList.remove("overflow-hidden"),e.bodyLocked||o.classList.remove("overflow-hidden"),null!==e.appliedPadding&&o.style.getPropertyValue("padding-inline-end")===e.appliedPadding&&o.style.getPropertyPriority("padding-inline-end")===e.paddingPriority&&(e.bodyPaddingInlineEnd?o.style.setProperty("padding-inline-end",e.bodyPaddingInlineEnd,e.paddingPriority):o.style.removeProperty("padding-inline-end"))}o.d(t,{i:()=>i,l:()=>s})},"93025a68d8ab"(e,t,o){o.d(t,{BK:()=>p,M$:()=>m,Rm:()=>u,ZT:()=>c,fI:()=>r,k8:()=>h,oN:()=>a,rI:()=>l});var i=o("c8d66dd2c299");const s=Symbol.for("simai.modal.document-stack");function n(){return document[s]||Object.defineProperty(document,s,{value:{items:[],lockOwner:null},configurable:!0}),document[s]}function a(){return n().items.at(-1)||null}function r(e){return n().items.indexOf(e)}function l(){n().items.forEach((e,t)=>e.applyStackPosition(t)),(0,i.ro)(a())}const d=e=>!e.inContainer;function h(e,t){const o=n();o.items.includes(e)||(d(e)&&!o.lockOwner&&(o.lockOwner=t,t.lockPage(e.preserveScrollGap)),o.items.push(e),l())}function c(e){const t=n(),o=t.items.indexOf(e);o<0||(t.items.splice(o,1),t.lockOwner&&!t.items.some(d)&&(t.lockOwner.unlockPage(),t.lockOwner=null),l())}function u(e){const t=n(),o=t.items.indexOf(e);o<0||(t.items.splice(o,1),t.items.push(e),l())}function m(e){const t=[];for(let o=e?.parentElement;o;o=o.parentElement)o.matches('main, section, article, [role="main"], [role="region"]')&&t.push(o);return t}function f(e,t=!1){if(!e?.isConnected||"function"!=typeof e.focus||e.matches(":disabled")||e.closest('[inert], [hidden], [aria-hidden="true"]')||!e.getClientRects().length||"visible"!==e.ownerDocument.defaultView.getComputedStyle(e).visibility)return!1;const o=t&&!e.hasAttribute("tabindex");let i;const s=()=>{i?.disconnect(),e.removeEventListener("blur",s),o&&"-1"===e.getAttribute("tabindex")&&e.removeAttribute("tabindex")};o&&(e.setAttribute("tabindex","-1"),e.addEventListener("blur",s,{once:!0}),i=new e.ownerDocument.defaultView.MutationObserver(()=>{e.isConnected||s()}),i.observe(e.ownerDocument.documentElement,{childList:!0,subtree:!0}));let n=!1;try{return e.focus({preventScroll:!0}),n=e.ownerDocument.activeElement===e,n}catch{return!1}finally{o&&!n&&s()}}function p(e,t,o=[]){if(!e)return;const i=a(),s=i?.getModalRoot?.()||i?.template;if((!i||s?.contains(t))&&f(t))return;if(i)return void i.focusFirst();const n=new Set([...o,...document.querySelectorAll('main, [role="main"]'),document.body]);for(const e of n)if(f(e,!0))return}},f98b7a216869(e,t,o){o.a(e,async(e,t)=>{try{var i=o("ddf1cdb42ecc"),s=o("7b69af8ef2e5"),n=o("fbe0570fcc69"),a=o("0d662e4d7d63"),r=o("e45eac6c719d"),l=o("c8d66dd2c299"),d=o("3f3a6e2680d5"),h=o("201fd0b17b8b"),c=o("ed3ae3576d0a"),u=o("93025a68d8ab"),m=e([i,s,n,a,r]);[i,s,n,a,r]=m.then?(await m)():m;var f=o.n(n);const p="[data-sf-overlay-container], [data-sf-drawer-container]",g={en:{close:"Close",minimize:"Minimize",title:"Dialog"},ru:{close:"Закрыть",minimize:"Свернуть",title:"Окно"}};let b=0;function y(e){return["none","small","medium","large"].includes(String(e||"").trim().toLowerCase())}class v extends(f()){static registry=new Map;static globalBound=!1;static stack=[];static openCount=0;static lockState=null;static baseZIndex=9e3;static defaultTrueAttributes=new Set(["overlay","show-close","show-footer","close-on-esc","close-on-overlay","preserve-scroll-gap","preload"]);static getTopModal(){return(0,u.oN)()}static isTopModal(e){return v.getTopModal()===e}static getStackIndex(e){return(0,u.fI)(e)}static addToStack(e){e&&"inline"!==e.display&&(v.stack=v.stack.filter(t=>t!==e),v.stack.push(e),v.openCount=v.stack.length,e.hiddenState||(0,u.k8)(e,v))}static removeFromStack(e){e&&"inline"!==e.display&&(v.stack=v.stack.filter(t=>t!==e),v.openCount=v.stack.length,(0,u.ZT)(e))}static bringToFront(e){e&&"inline"!==e.display&&v.stack.includes(e)&&(v.stack=v.stack.filter(t=>t!==e),v.stack.push(e),(0,u.Rm)(e))}static updateStackStyles(){(0,u.rI)()}static get props(){return{templateName:{attribute:"template",default:"default"},modalId:{default:""},title:{default:""},ariaLabel:{attribute:"aria-label",default:""},text:{default:""},open:{type:Boolean,default:!1},autoload:{type:Boolean,default:!1},unclose:{type:Boolean,default:!1},hide:{type:Boolean,default:!1},hideModifier:{default:""},minimized:{type:Boolean,default:!1},overlay:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},showFooter:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},closeOnOverlay:{type:Boolean,default:!0},preserveScrollGap:{type:Boolean,default:!0},position:{default:"center",values:["center","left","right","inline-start","inline-end","top","bottom"]},mode:{default:"inline",values:["inline","ajax","iframe"]},display:{default:"modal",values:["modal","inline"]},src:{default:""},rootClass:{default:""},preload:{type:Boolean,default:!0},fullscreen:{type:Boolean,default:!1},width:{default:""},height:{default:""},blur:{default:""},blurType:{default:"medium",values:["none","small","medium","large"]},overlayPreset:{default:"default",values:["default","focus"]},overlayClass:{default:""},closeClass:{default:""},surfaceClass:{default:""},surfacePadding:{default:""},panelClass:{default:""},headerClass:{default:""},bodyClass:{default:""},contentClass:{default:""},footerClass:{default:""}}}constructor(){super(),this._modalId="",this._syncingOpenAttribute=!1,this._portalRoot=null,this._renderTarget=null,this._hostClearedForPortal=!1,this._slotEventHandlers=new Map,this._slotEventId=0,this._readyDetail=null,this._hasEmittedReady=!1,this._hasAutoloaded=!1,this._isOpen=!1,this._isHidden=!1,this._modalState="closed",this._animatePanel=!1,this._stackIndex=-1,this._closeTimer=null,this._closeTransitionAbort=null,this._lastActive=null,this._fetchController=null,this._remoteHtml="",this._remoteError="",this._isLoadingRemote=!1,this._remoteLoaded=!1,this.onKeyDown=this.onKeyDown.bind(this),this.handleOverlayClick=this.handleOverlayClick.bind(this),this.handleCloseClick=this.handleCloseClick.bind(this),this.handleHideClick=this.handleHideClick.bind(this)}connectedCallback(){this._modalId||(this._modalId=this.getAttribute("modal-id")||this.id||"sf-modal-"+ ++b),super.connectedCallback(),v.registry.set(this.modalId,this),v.bindGlobalEvents()}captureSlotTemplates(){const e=!this._slotTemplatesCaptured;if(super.captureSlotTemplates(),!e)return;const t=Array.from(this.childNodes).filter(e=>e.nodeType===Node.ELEMENT_NODE?"template"!==e.tagName.toLowerCase():e.nodeType===Node.TEXT_NODE&&""!==e.textContent.trim());t.length&&(this._liveSlotNodes.has("content")||this._liveSlotNodes.set("content",[]),this._liveSlotNodes.get("content").push(...t),t.forEach(e=>e.remove()))}disconnectedCallback(){this.teardownModal(),v.registry.delete(this.modalId),super.disconnectedCallback()}get templateName(){return this.getAttribute("template")||"default"}get modalId(){return this.getAttribute("modal-id")||this._modalId||this.id||""}get title(){return this.getAttribute("title")||(0,a.pageText)(g,"title",this)}get ariaLabel(){return this.getAttribute("aria-label")||""}get text(){return this.getAttribute("text")||""}get openState(){return this._isOpen||this.hasAttribute("open")||"inline"===this.display&&!this._inlineClosed}get autoload(){return this.getBooleanAttr("autoload",!1)}get unclose(){return this.getBooleanAttr("unclose",!1)}get hideButton(){return this.getBooleanAttr("hide",!1)}get hideModifier(){return this.getAttribute("hide-modifier")||""}get hiddenState(){return"inline"!==this.display&&(this._isHidden||this.hasAttribute("minimized"))}get overlay(){return this.getBooleanAttr("overlay",!0)}get closeOnEsc(){return this.getBooleanAttr("close-on-esc",!0)}get showClose(){return this.getBooleanAttr("show-close",!0)&&!this.unclose}get showHeader(){return this.getBooleanAttr("show-header",!0)}get showFooter(){return this.getBooleanAttr("show-footer",!0)}get closeOnOverlay(){return this.getBooleanAttr("close-on-overlay",!0)}get preserveScrollGap(){return this.getBooleanAttr("preserve-scroll-gap",!0)}get position(){return this.getEnumAttr("position",["center","left","right","inline-start","inline-end","top","bottom"],"center")}get mode(){return this.getEnumAttr("mode",["inline","ajax","iframe"],"inline")}get display(){return this.getEnumAttr("display",["modal","inline"],"modal")}get src(){return this.getAttribute("src")||""}get preload(){return this.getBooleanAttr("preload",!0)}get fullscreen(){return this.getBooleanAttr("fullscreen",!1)}get width(){return this.getAttribute("width")||""}get height(){return this.getAttribute("height")||""}get blur(){return y(this.getAttribute("blur"))||this.getBooleanAttr("blur",!1)}get blurType(){const e=this.getAttribute("blur"),t=this.getAttribute("blur-type")||(y(e)?e:"medium");return this.normalizeEnum(t,["none","small","medium","large"],"medium")}get hasCustomBlurType(){return this.hasAttribute("blur-type")||y(this.getAttribute("blur"))}get overlayPreset(){return this.normalizeEnum(this.getAttribute("overlay-preset")||"default",["default","focus"],"default")}get headerClass(){return this.getAttribute("header-class")||""}get overlayClass(){return this.getAttribute("overlay-class")||""}get closeClass(){return this.getAttribute("close-class")||""}get surfaceClass(){return this.getAttribute("surface-class")||""}get surfacePadding(){return this.getAttribute("surface-padding")||""}get panelClass(){return this.getAttribute("panel-class")||""}get bodyClass(){return this.getAttribute("body-class")||""}get contentClass(){return this.getAttribute("content-class")||""}get footerClass(){return this.getAttribute("footer-class")||""}get modalRoot(){return this._renderTarget?.querySelector?.(".sf-modal")||null}get state(){return{modalId:this.modalId,title:this.title,ariaLabel:this.ariaLabel,text:this.text,open:this.openState,autoload:this.autoload,unclose:this.unclose,hide:this.hideButton,hideModifier:this.hideModifier,minimized:this.hiddenState,overlay:this.overlay,showHeader:this.showHeader,showClose:this.showClose,showFooter:this.showFooter,closeOnEsc:this.closeOnEsc,closeOnOverlay:this.closeOnOverlay,preserveScrollGap:this.preserveScrollGap,position:this.position,mode:this.mode,display:this.display,src:this.src,preload:this.preload,fullscreen:this.fullscreen,width:this.width,height:this.height,blur:this.blur,blurType:this.blurType,overlayPreset:this.overlayPreset,overlayClass:this.overlayClass,closeClass:this.closeClass,surfaceClass:this.surfaceClass,surfacePadding:this.surfacePadding,panelClass:this.panelClass,headerClass:this.headerClass,bodyClass:this.bodyClass,contentClass:this.contentClass,footerClass:this.footerClass,lifecycle:this.renderModalState,remote:{error:this._remoteError,status:this._isLoadingRemote?"loading":this._remoteError?"error":this._remoteLoaded?"success":"idle"},stackIndex:this._stackIndex}}get renderOpenState(){return this.openState||"closing"===this._modalState}get renderModalState(){return"inline"===this.display?this.openState?"open":"closed":this.renderOpenState&&"closed"===this._modalState?"open":this._modalState}get modalZIndex(){return"inline"===this.display||this._stackIndex<0?"":v.baseZIndex+2*this._stackIndex}get remoteContent(){return"iframe"===this.mode&&this.src?i.html`
1
+ (()=>{"use strict";var e={"3f3a6e2680d5"(e,t,o){function i(e,t=!1){if(!e)return()=>{};const o=new Set,i=()=>{for(const t of e.children)t.hasAttribute("inert")||(t.setAttribute("inert",""),o.add(t))};t&&e.focus({preventScroll:!0}),i();const s=new e.ownerDocument.defaultView.MutationObserver(i);return s.observe(e,{childList:!0}),()=>{s.disconnect();for(const e of o)""===e.getAttribute("inert")&&e.removeAttribute("inert");o.clear()}}o.d(t,{e:()=>i})},c8d66dd2c299(e,t,o){o.d(t,{Zg:()=>l,ro:()=>n});const i=["a[href]","area[href]","button","input","select","textarea","iframe","summary","audio[controls]","video[controls]","[contenteditable]","[tabindex]"].join(","),s=Symbol.for("simai.modal.focus-guards");function n(e){const t=e?.getModalRoot?.()||e?.template,o=t?.querySelector?.("[data-sf-modal-panel]"),i=document[s];if(i&&i.panel===o&&i.before.isConnected&&i.after.isConnected)return;if(i?.before.remove(),i?.after.remove(),delete document[s],!o?.parentNode)return;const n={panel:o,relaying:!1};for(const e of["before","after"]){const i=o.ownerDocument.createElement("span");i.tabIndex=0,i.className="sf-modal-focus-guard",i.setAttribute("aria-hidden","true"),i.addEventListener("focus",()=>{if(n.relaying||!o.isConnected||t.inert||"true"===t.getAttribute("aria-hidden"))return;const i="before"===e,s=r(o,i),a=i?s.at(-1):s[0];a&&"IFRAME"!==a.tagName?a.focus({preventScroll:!0}):o.focus({preventScroll:!0})}),n[e]=i}o.before(n.before),o.after(n.after),document[s]=n}function a(e,t){return"INPUT"===e?.tagName&&"INPUT"===t?.tagName&&"radio"===e.type&&"radio"===t.type&&!!e.name&&e.name===t.name&&e.form===t.form&&e.getRootNode()===t.getRootNode()}function r(e,t=!1){const o=e.ownerDocument.defaultView,s=Array.from(e.querySelectorAll(i)).filter(e=>e.tabIndex>=0&&!e.matches(":disabled")&&!e.closest("[inert]")&&e.getClientRects().length>0&&"visible"===o.getComputedStyle(e).visibility).sort((e,t)=>(e.tabIndex||1/0)-(t.tabIndex||1/0));return s.filter(e=>{if(!a(e,e))return!0;const o=s.filter(t=>a(e,t)),i=o.find(e=>e.checked);return e===(i||o.at(t?-1:0))})}function l(e,t){if(!e)return;const o=r(e,t.shiftKey),i=e.ownerDocument.activeElement;if(!o.length)return t.preventDefault(),void e.focus();const n=o[0],l=o[o.length-1],d=t.shiftKey?n:l;if(!e.contains(i)||i===e||i===d||a(i,d)){const o=t.shiftKey?l:n,i=e.ownerDocument[s];if("IFRAME"===o.tagName&&i?.panel===e){i.relaying=!0;try{(t.shiftKey?i.after:i.before).focus({preventScroll:!0})}finally{i.relaying=!1}return}t.preventDefault(),o.focus()}}},"201fd0b17b8b"(e,t,o){o.d(t,{Gp:()=>s,ju:()=>n});const i=e=>{const t=Number.parseFloat(e);return Number.isFinite(t)?t*(e.trim().endsWith("ms")?1:1e3):0};function s(e,t=window){let o=!1,i=null,s=null;const n=()=>{o||(o=!0,null!==i&&(t.cancelAnimationFrame(i),i=null),null!==s&&(t.clearTimeout(s),s=null),e())};return i=t.requestAnimationFrame(n),s=t.setTimeout(n,50),"function"==typeof t.queueMicrotask&&t.queueMicrotask(n),()=>{o=!0,null!==i&&t.cancelAnimationFrame(i),null!==s&&t.clearTimeout(s)}}function n(e,t,o=window){let n=null,a=!1;const r=s(()=>{if(a)return;const s=e(),r=s?.querySelectorAll("[data-sf-modal-panel], [data-sf-modal-overlay]")||[],l=Math.max(0,...Array.from(r,e=>{const t=o.getComputedStyle(e);return"none"===t.display?0:function(e){const t=e.transitionProperty.split(",").map(e=>e.trim()),o=e.transitionDuration.split(",").map(i),s=e.transitionDelay.split(",").map(i);return Math.max(0,...t.map((e,t)=>["all","opacity","transform","-webkit-transform"].includes(e)?Math.max(0,o[t%o.length])+s[t%s.length]:0))}(t)}));n=o.setTimeout(()=>{a||t()},l)},o);return()=>{a=!0,r(),null!==n&&o.clearTimeout(n)}}},ed3ae3576d0a(e,t,o){function i(e=!0){const t=document.documentElement,o=document.body;if(!t||!o)return null;const i=Math.max(0,window.innerWidth-t.clientWidth),s=parseFloat(window.getComputedStyle(o).paddingInlineEnd)||0,n={docEl:t,body:o,htmlLocked:t.classList.contains("overflow-hidden"),bodyLocked:o.classList.contains("overflow-hidden"),bodyPaddingInlineEnd:o.style.getPropertyValue("padding-inline-end"),paddingPriority:o.style.getPropertyPriority("padding-inline-end"),appliedPadding:null};return t.classList.add("overflow-hidden"),o.classList.add("overflow-hidden"),e&&i>0&&(o.style.setProperty("padding-inline-end",`${s+i}px`,n.paddingPriority),n.appliedPadding=o.style.getPropertyValue("padding-inline-end")),n}function s(e){if(!e)return;const{docEl:t,body:o}=e;e.htmlLocked||t.classList.remove("overflow-hidden"),e.bodyLocked||o.classList.remove("overflow-hidden"),null!==e.appliedPadding&&o.style.getPropertyValue("padding-inline-end")===e.appliedPadding&&o.style.getPropertyPriority("padding-inline-end")===e.paddingPriority&&(e.bodyPaddingInlineEnd?o.style.setProperty("padding-inline-end",e.bodyPaddingInlineEnd,e.paddingPriority):o.style.removeProperty("padding-inline-end"))}o.d(t,{i:()=>i,l:()=>s})},"93025a68d8ab"(e,t,o){o.d(t,{BK:()=>p,M$:()=>m,Rm:()=>u,ZT:()=>c,fI:()=>r,k8:()=>h,oN:()=>a,rI:()=>l});var i=o("c8d66dd2c299");const s=Symbol.for("simai.modal.document-stack");function n(){return document[s]||Object.defineProperty(document,s,{value:{items:[],lockOwner:null},configurable:!0}),document[s]}function a(){return n().items.at(-1)||null}function r(e){return n().items.indexOf(e)}function l(){n().items.forEach((e,t)=>e.applyStackPosition(t)),(0,i.ro)(a())}const d=e=>!e.inContainer;function h(e,t){const o=n();o.items.includes(e)||(d(e)&&!o.lockOwner&&(o.lockOwner=t,t.lockPage(e.preserveScrollGap)),o.items.push(e),l())}function c(e){const t=n(),o=t.items.indexOf(e);o<0||(t.items.splice(o,1),t.lockOwner&&!t.items.some(d)&&(t.lockOwner.unlockPage(),t.lockOwner=null),l())}function u(e){const t=n(),o=t.items.indexOf(e);o<0||(t.items.splice(o,1),t.items.push(e),l())}function m(e){const t=[];for(let o=e?.parentElement;o;o=o.parentElement)o.matches('main, section, article, [role="main"], [role="region"]')&&t.push(o);return t}function f(e,t=!1){if(!e?.isConnected||"function"!=typeof e.focus||e.matches(":disabled")||e.closest('[inert], [hidden], [aria-hidden="true"]')||!e.getClientRects().length||"visible"!==e.ownerDocument.defaultView.getComputedStyle(e).visibility)return!1;const o=t&&!e.hasAttribute("tabindex");let i;const s=()=>{i?.disconnect(),e.removeEventListener("blur",s),o&&"-1"===e.getAttribute("tabindex")&&e.removeAttribute("tabindex")};o&&(e.setAttribute("tabindex","-1"),e.addEventListener("blur",s,{once:!0}),i=new e.ownerDocument.defaultView.MutationObserver(()=>{e.isConnected||s()}),i.observe(e.ownerDocument.documentElement,{childList:!0,subtree:!0}));let n=!1;try{return e.focus({preventScroll:!0}),n=e.ownerDocument.activeElement===e,n}catch{return!1}finally{o&&!n&&s()}}function p(e,t,o=[]){if(!e)return;const i=a(),s=i?.getModalRoot?.()||i?.template;if((!i||s?.contains(t))&&f(t))return;if(i)return void i.focusFirst();const n=new Set([...o,...document.querySelectorAll('main, [role="main"]'),document.body]);for(const e of n)if(f(e,!0))return}},"50d2a204ba4c"(e,t,o){o.d(t,{le:()=>a});function i(e,t={}){const o=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.entries(t).forEach(([e,t])=>{null!=t&&""!==t&&o.setAttribute(e,String(t))}),o}const s=e=>Math.round(1e3*e)/1e3;function n(e={}){return function({width:e=24,height:t=24,stroke:o=2,dots:n=8,filled:a=3,dotRadius:r=null,direction:l="clockwise",pixel:d=!1}={}){const h=e/2,c=t/2,u=Math.min(e,t)/2,m=Math.max(1,u-o/2),f=i("svg",{class:"sf-loader-svg",viewBox:`0 0 ${e} ${t}`,width:d?e:null,height:d?t:null,"aria-hidden":"true",focusable:"false"}),p={cx:h,cy:c,r:s(m),fill:"none",stroke:"currentColor","stroke-width":o},g=i("circle",{class:"sf-loader-ring-filled",...p,opacity:"0.3"}),b=i("circle",{class:"sf-loader-ring-accent",...p,"stroke-linecap":"round",pathLength:100,"stroke-dasharray":"0 100",transform:`rotate(90 ${h} ${c})`}),y=i("g",{class:"sf-loader-comet",display:"none",transform:`rotate(-90 ${h} ${c})`});for(let e=0;e<10;e+=1){const t=9===e;y.append(i("circle",{class:"sf-loader-comet-segment"+(t?" sf-loader-comet-head":""),...p,"stroke-linecap":t?"round":"butt",pathLength:100,"stroke-dasharray":`${s(4)} ${s(96)}`,"stroke-dashoffset":s(-4*e),opacity:s(((e+1)/10)**1.6)}))}const v=Math.max(3,Math.min(32,Math.floor(Number(n)||8))),C=Math.max(1,Math.min(v,Math.floor(Number(a)||3))),_=Math.min(o,.7*Math.PI*(u-o)/v),w=null==r||""===r?_:Math.max(1,Math.min(Number(r)||_,u/4)),S=Math.max(w,u-w),A=i("g",{class:"sf-loader-dots",display:"none",style:`--sf-loader-dot-count:${v}; --sf-loader-dot-filled:${C};`});for(let e=0;e<v;e+=1){const t=2*Math.PI/v*e-Math.PI/2,o="counterclockwise"===l?e:(v-e)%v;A.append(i("circle",{class:"sf-loader-dot"+(e<C?" sf-loader-dot--active":""),cx:s(h+S*Math.cos(t)),cy:s(c+S*Math.sin(t)),r:s(w),fill:"currentColor",style:`--sf-loader-dot-index:${e}; --sf-loader-dot-step:${o};`}))}return f.append(g,b,y,A),f}({...e,width:24,height:24,stroke:2,dotRadius:null,pixel:!1})}function a({className:e="",overlay:t=!1}={}){const o=document.createElement("span");o.className=["sf-loader-container","sf-loader--infinite",e,e&&t?`${e}--overlay`:""].filter(Boolean).join(" "),o.dataset.sfSpinnerBound="1",o.dataset.infinite="true",o.setAttribute("aria-hidden","true");const i=document.createElement("span");return i.className="sf-loader--loading-indicator",i.append(n()),o.append(i),o}},f98b7a216869(e,t,o){o.a(e,async(e,t)=>{try{var i=o("ddf1cdb42ecc"),s=o("7b69af8ef2e5"),n=o("fbe0570fcc69"),a=o("0d662e4d7d63"),r=o("e45eac6c719d"),l=o("c8d66dd2c299"),d=o("3f3a6e2680d5"),h=o("201fd0b17b8b"),c=o("ed3ae3576d0a"),u=o("50d2a204ba4c"),m=o("93025a68d8ab"),f=e([i,s,n,a,r]);[i,s,n,a,r]=f.then?(await f)():f;var p=o.n(n);const g="[data-sf-overlay-container], [data-sf-drawer-container]",b={en:{close:"Close",minimize:"Minimize",title:"Dialog"},ru:{close:"Закрыть",minimize:"Свернуть",title:"Окно"}};let y=0;function v(e){return["none","small","medium","large"].includes(String(e||"").trim().toLowerCase())}class C extends(p()){static registry=new Map;static globalBound=!1;static stack=[];static openCount=0;static lockState=null;static baseZIndex=9e3;static defaultTrueAttributes=new Set(["overlay","show-close","show-footer","close-on-esc","close-on-overlay","preserve-scroll-gap","preload"]);static getTopModal(){return(0,m.oN)()}static isTopModal(e){return C.getTopModal()===e}static getStackIndex(e){return(0,m.fI)(e)}static addToStack(e){e&&"inline"!==e.display&&(C.stack=C.stack.filter(t=>t!==e),C.stack.push(e),C.openCount=C.stack.length,e.hiddenState||(0,m.k8)(e,C))}static removeFromStack(e){e&&"inline"!==e.display&&(C.stack=C.stack.filter(t=>t!==e),C.openCount=C.stack.length,(0,m.ZT)(e))}static bringToFront(e){e&&"inline"!==e.display&&C.stack.includes(e)&&(C.stack=C.stack.filter(t=>t!==e),C.stack.push(e),(0,m.Rm)(e))}static updateStackStyles(){(0,m.rI)()}static get props(){return{templateName:{attribute:"template",default:"default"},modalId:{default:""},title:{default:""},ariaLabel:{attribute:"aria-label",default:""},text:{default:""},open:{type:Boolean,default:!1},autoload:{type:Boolean,default:!1},unclose:{type:Boolean,default:!1},hide:{type:Boolean,default:!1},hideModifier:{default:""},minimized:{type:Boolean,default:!1},overlay:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},showFooter:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},closeOnOverlay:{type:Boolean,default:!0},preserveScrollGap:{type:Boolean,default:!0},position:{default:"center",values:["center","left","right","inline-start","inline-end","top","bottom"]},mode:{default:"inline",values:["inline","ajax","iframe"]},display:{default:"modal",values:["modal","inline"]},src:{default:""},rootClass:{default:""},preload:{type:Boolean,default:!0},fullscreen:{type:Boolean,default:!1},width:{default:""},height:{default:""},blur:{default:""},blurType:{default:"medium",values:["none","small","medium","large"]},overlayPreset:{default:"default",values:["default","focus"]},overlayClass:{default:""},closeClass:{default:""},surfaceClass:{default:""},surfacePadding:{default:""},panelClass:{default:""},headerClass:{default:""},bodyClass:{default:""},contentClass:{default:""},footerClass:{default:""}}}constructor(){super(),this._modalId="",this._syncingOpenAttribute=!1,this._portalRoot=null,this._renderTarget=null,this._hostClearedForPortal=!1,this._slotEventHandlers=new Map,this._slotEventId=0,this._readyDetail=null,this._hasEmittedReady=!1,this._hasAutoloaded=!1,this._isOpen=!1,this._isHidden=!1,this._modalState="closed",this._animatePanel=!1,this._stackIndex=-1,this._closeTimer=null,this._closeTransitionAbort=null,this._lastActive=null,this._fetchController=null,this._remoteHtml="",this._remoteError="",this._isLoadingRemote=!1,this._remoteLoaded=!1,this.onKeyDown=this.onKeyDown.bind(this),this.handleOverlayClick=this.handleOverlayClick.bind(this),this.handleCloseClick=this.handleCloseClick.bind(this),this.handleHideClick=this.handleHideClick.bind(this)}connectedCallback(){this._modalId||(this._modalId=this.getAttribute("modal-id")||this.id||"sf-modal-"+ ++y),super.connectedCallback(),C.registry.set(this.modalId,this),C.bindGlobalEvents()}captureSlotTemplates(){const e=!this._slotTemplatesCaptured;if(super.captureSlotTemplates(),!e)return;const t=Array.from(this.childNodes).filter(e=>e.nodeType===Node.ELEMENT_NODE?"template"!==e.tagName.toLowerCase():e.nodeType===Node.TEXT_NODE&&""!==e.textContent.trim());t.length&&(this._liveSlotNodes.has("content")||this._liveSlotNodes.set("content",[]),this._liveSlotNodes.get("content").push(...t),t.forEach(e=>e.remove()))}disconnectedCallback(){this.teardownModal(),C.registry.delete(this.modalId),super.disconnectedCallback()}get templateName(){return this.getAttribute("template")||"default"}get modalId(){return this.getAttribute("modal-id")||this._modalId||this.id||""}get title(){return this.getAttribute("title")||(0,a.pageText)(b,"title",this)}get ariaLabel(){return this.getAttribute("aria-label")||""}get text(){return this.getAttribute("text")||""}get openState(){return this._isOpen||this.hasAttribute("open")||"inline"===this.display&&!this._inlineClosed}get autoload(){return this.getBooleanAttr("autoload",!1)}get unclose(){return this.getBooleanAttr("unclose",!1)}get hideButton(){return this.getBooleanAttr("hide",!1)}get hideModifier(){return this.getAttribute("hide-modifier")||""}get hiddenState(){return"inline"!==this.display&&(this._isHidden||this.hasAttribute("minimized"))}get overlay(){return this.getBooleanAttr("overlay",!0)}get closeOnEsc(){return this.getBooleanAttr("close-on-esc",!0)}get showClose(){return this.getBooleanAttr("show-close",!0)&&!this.unclose}get showHeader(){return this.getBooleanAttr("show-header",!0)}get showFooter(){return this.getBooleanAttr("show-footer",!0)}get closeOnOverlay(){return this.getBooleanAttr("close-on-overlay",!0)}get preserveScrollGap(){return this.getBooleanAttr("preserve-scroll-gap",!0)}get position(){return this.getEnumAttr("position",["center","left","right","inline-start","inline-end","top","bottom"],"center")}get mode(){return this.getEnumAttr("mode",["inline","ajax","iframe"],"inline")}get display(){return this.getEnumAttr("display",["modal","inline"],"modal")}get src(){return this.getAttribute("src")||""}get preload(){return this.getBooleanAttr("preload",!0)}get fullscreen(){return this.getBooleanAttr("fullscreen",!1)}get width(){return this.getAttribute("width")||""}get height(){return this.getAttribute("height")||""}get blur(){return v(this.getAttribute("blur"))||this.getBooleanAttr("blur",!1)}get blurType(){const e=this.getAttribute("blur"),t=this.getAttribute("blur-type")||(v(e)?e:"medium");return this.normalizeEnum(t,["none","small","medium","large"],"medium")}get hasCustomBlurType(){return this.hasAttribute("blur-type")||v(this.getAttribute("blur"))}get overlayPreset(){return this.normalizeEnum(this.getAttribute("overlay-preset")||"default",["default","focus"],"default")}get headerClass(){return this.getAttribute("header-class")||""}get overlayClass(){return this.getAttribute("overlay-class")||""}get closeClass(){return this.getAttribute("close-class")||""}get surfaceClass(){return this.getAttribute("surface-class")||""}get surfacePadding(){return this.getAttribute("surface-padding")||""}get panelClass(){return this.getAttribute("panel-class")||""}get bodyClass(){return this.getAttribute("body-class")||""}get contentClass(){return this.getAttribute("content-class")||""}get footerClass(){return this.getAttribute("footer-class")||""}get modalRoot(){return this._renderTarget?.querySelector?.(".sf-modal")||null}get state(){return{modalId:this.modalId,title:this.title,ariaLabel:this.ariaLabel,text:this.text,open:this.openState,autoload:this.autoload,unclose:this.unclose,hide:this.hideButton,hideModifier:this.hideModifier,minimized:this.hiddenState,overlay:this.overlay,showHeader:this.showHeader,showClose:this.showClose,showFooter:this.showFooter,closeOnEsc:this.closeOnEsc,closeOnOverlay:this.closeOnOverlay,preserveScrollGap:this.preserveScrollGap,position:this.position,mode:this.mode,display:this.display,src:this.src,preload:this.preload,fullscreen:this.fullscreen,width:this.width,height:this.height,blur:this.blur,blurType:this.blurType,overlayPreset:this.overlayPreset,overlayClass:this.overlayClass,closeClass:this.closeClass,surfaceClass:this.surfaceClass,surfacePadding:this.surfacePadding,panelClass:this.panelClass,headerClass:this.headerClass,bodyClass:this.bodyClass,contentClass:this.contentClass,footerClass:this.footerClass,lifecycle:this.renderModalState,remote:{error:this._remoteError,status:this._isLoadingRemote?"loading":this._remoteError?"error":this._remoteLoaded?"success":"idle"},stackIndex:this._stackIndex}}get renderOpenState(){return this.openState||"closing"===this._modalState}get renderModalState(){return"inline"===this.display?this.openState?"open":"closed":this.renderOpenState&&"closed"===this._modalState?"open":this._modalState}get modalZIndex(){return"inline"===this.display||this._stackIndex<0?"":C.baseZIndex+2*this._stackIndex}get remoteContent(){return"iframe"===this.mode&&this.src?i.html`
2
2
  <iframe
3
3
  class="sf-modal-iframe w-full border-0 radius-surface"
4
4
  src=${this.src}
@@ -25,12 +25,10 @@
25
25
  class="sf-modal-loading flex flex-col gap-2 items-cross-center content-main-center p-4"
26
26
  data-sf-modal-state="loading"
27
27
  >
28
- <div
29
- class="sf-modal-spinner animate-spin border-2 border-t-transparent border-outline-variant rounded-full w-8 h-8"
30
- ></div>
28
+ ${this._loadingSpinnerNode()}
31
29
  <p class="m-0 text-2 color-on-surface-variant">Loading...</p>
32
30
  </div>
33
- `:i.nothing}templateContext(){this._slotEventHandlers.clear(),this._slotEventId=0;const e=this.getPropsContext();return this.createTemplateContext({...e,component:this,closeText:(0,a.pageText)(g,"close",this),minimizeText:(0,a.pageText)(g,"minimize",this),title:this.title,modalId:this.modalId,open:this.renderOpenState,modalState:this.renderModalState,animate:this._animatePanel&&"inline"!==this.display,modalZIndex:this.modalZIndex,hide:this.hideButton,minimized:this.hiddenState,showClose:this.showClose,blur:this.blur,blurType:this.blurType,hasCustomBlurType:this.hasCustomBlurType,hasHeaderContent:this.hasSlotContent("header"),hasContentContent:this.hasSlotContent("content"),hasFooterContent:this.hasSlotContent("footer"),headerContent:(0,s.unsafeHTML)(this.getSlotHtml("header")),contentContent:(0,s.unsafeHTML)(this.getSlotHtml("content")),footerContent:(0,s.unsafeHTML)(this.getSlotHtml("footer")),remoteContent:this.remoteContent,onCloseClick:this.handleCloseClick,onHideClick:this.handleHideClick})}getSlotHtml(e){return[...this._liveSlotNodes.get(e)||[],...this._slotTemplates.get(e)||[]].map(e=>{if(e instanceof HTMLElement){const t=e.cloneNode(!0);return this.copyRuntimeData(e,t),this.assignSlotEventIds(t),this.cleanNestedSmartComponentRender(t),t.outerHTML}return e.textContent||""}).join("")}assignSlotEventIds(e){[e,...Array.from(e.querySelectorAll?.("*")||[])].forEach(e=>{if(!e.__sfCreateEventHandlers?.length)return;const t="sf-modal-slot-event-"+ ++this._slotEventId;e.setAttribute("data-sf-runtime-event-id",t),this._slotEventHandlers.set(t,e.__sfCreateEventHandlers.slice())})}cleanNestedSmartComponentRender(e){[e,...Array.from(e.querySelectorAll?.("*")||[])].forEach(e=>{(e.tagName?.toLowerCase?.()||"").startsWith("sf-")&&Array.from(e.childNodes).forEach(e=>{e instanceof HTMLElement&&(e.hasAttribute("slot")||"slot"===e.tagName.toLowerCase()||e.tagName.toLowerCase().startsWith("sf-"))||e.remove()})})}template(){return(0,r.Q)(this.templateContext())}async renderComponent(e=[]){const t=++this._renderToken;if(!this._isMounted)return;this.beforeRender(e),this.emitComponentEvent("before-render",{changedAttributes:e}),this.runExternalHook("beforeRender",{changedAttributes:e,root:this});const o=await this.resolveTemplateResult(e);this._isMounted&&t===this._renderToken&&((0,i.render)(o,this.resolveRenderTarget()),this.afterRender(e),this.runExternalHook("afterRender",{changedAttributes:e,root:this}),this.emitComponentEvent("after-render",{changedAttributes:e}))}resolveRenderTarget(){return"inline"===this.display?(this.clearPortal(),this._hostClearedForPortal=!1,this._renderTarget=this,this):(this._hostClearedForPortal||((0,i.render)(i.nothing,this),this._hostClearedForPortal=!0),this._portalRoot||(this._portalRoot=this.resolvePortalRoot()),this.dedupePortalRoots(),this._renderTarget=this._portalRoot,this._portalRoot)}get overlayHome(){return this.closest(p)||document.body}get inContainer(){return this.overlayHome!==document.body}resolvePortalRoot(){const e=this.overlayHome,t=e.querySelector(`[data-sf-modal-portal="${this.modalId}"]`);if(t)return t;const o=document.createElement("div");return o.setAttribute("data-sf-modal-portal",this.modalId),e.append(o),o}dedupePortalRoots(){Array.from(document.querySelectorAll(`[data-sf-modal-portal="${this.modalId}"]`)).forEach(e=>{e!==this._portalRoot&&((0,i.render)(i.nothing,e),e.remove())}),this._portalRoot.isConnected||(this._portalRoot.setAttribute("data-sf-modal-portal",this.modalId),this.overlayHome.append(this._portalRoot))}applyStackPosition(e=v.getStackIndex(this)){this._stackIndex=e;const t=this.getModalRoot();return t&&"inline"!==this.display?e<0?(t.style.removeProperty("z-index"),t.style.removeProperty("--sf-modal-stack-index"),this):(t.style.setProperty("--sf-modal-stack-index",String(e)),t.style.zIndex=String(this.modalZIndex),this):this}open(e={}){const{animate:t=!0}="boolean"==typeof e?{animate:e}:e,o="closing"===this._modalState;return(this._isOpen||"inline"===this.display&&this.openState)&&!o?(this.cancelCloseTransition(),v.bringToFront(this),this):this.emitBeforeOpen()?(o||(this._lastActive=document.activeElement,this._focusReturnAncestors=(0,u.M$)(this._lastActive)),o&&(this.cancelCloseTransition(),this._releaseClosingContent?.(),this._releaseClosingContent=null),this._isOpen=!0,this._inlineClosed=!1,this._animatePanel=Boolean(t),this._modalState=t&&"inline"!==this.display?"opening":"open",this.syncOpenAttribute(!0),"inline"===this.display||o?"inline"!==this.display&&v.bringToFront(this):v.addToStack(this),this.requestComponentUpdate("open"),(0,h.Gp)(()=>{if(!this._isOpen||"closing"===this._modalState)return;this._modalState="open";const e=new Promise(e=>{const t=o=>{o.detail?.changedAttributes?.includes("open-state")&&(this.removeEventListener("sf-updated",t),e())};this.addEventListener("sf-updated",t)});this.requestComponentUpdate("open-state"),e.then(()=>{this._isOpen&&"open"===this._modalState&&(this.focusFirst(),this.emitAfterOpen(),this.loadRemoteContentIfNeeded())})}),this):this}close(){if(!this.openState||"closing"===this._modalState)return this;if(!this.emitBeforeClose())return this;if("inline"===this.display)return this.finishClose(),this;this._modalState="closing",this._isOpen=!1,this.requestComponentUpdate("close");const e=this.getModalRoot()?.querySelector("[data-sf-modal-panel]");return this._releaseClosingContent=(0,d.e)(e,v.isTopModal(this)),this._closeTransitionAbort=(0,h.ju)(()=>this.getModalRoot(),()=>this.finishClose()),this}hide(){return!this.openState||"inline"===this.display||this.hiddenState?this:this.emitBeforeHide()?(this._isHidden=!0,this.setAttribute("minimized",""),this.requestComponentUpdate("hide"),this.emitAfterHide(),this):this}show(){return this.openState&&"inline"!==this.display&&this.hiddenState&&this.emitBeforeShow()?(this._isHidden=!1,this.removeAttribute("minimized"),this.requestComponentUpdate("show"),this.emitAfterShow(),this):this}syncMinimizedLayer(){if(!this._isMounted||!this.openState||"inline"===this.display||"closed"===this._modalState||"closing"===this._modalState)return;const e=this.getModalRoot();if(this.hiddenState){const t=v.isTopModal(this);(0,u.ZT)(this),this.applyStackPosition(),(0,u.BK)(t,this._lastActive,this._focusReturnAncestors),e&&(e.inert=!0,e.setAttribute("aria-hidden","true"))}else e&&(e.inert=!1,e.setAttribute("aria-hidden","false")),(0,u.k8)(this,v),v.bringToFront(this),requestAnimationFrame(()=>this.focusFirst())}toggle(){return this.openState?this.close():this.open()}finishClose(){if("inline"!==this.display&&"closing"!==this._modalState)return this;const e=v.isTopModal(this);this.cancelCloseTransition(),this._isOpen=!1,"inline"===this.display&&(this._inlineClosed=!0),this._isHidden=!1,this._modalState="closed",this.removeAttribute("minimized"),this.syncOpenAttribute(!1);const t=this.getModalRoot();return t&&(t.inert=!0,t.setAttribute("aria-hidden","true")),this._releaseClosingContent?.(),this._releaseClosingContent=null,"inline"!==this.display&&v.removeFromStack(this),"inline"!==this.display&&(0,u.BK)(e,this._lastActive,this._focusReturnAncestors),this.requestComponentUpdate("after-close"),this.emitAfterClose(),this}cancelCloseTransition(){this._closeTimer&&(clearTimeout(this._closeTimer),this._closeTimer=null),this._closeTransitionAbort&&(this._closeTransitionAbort(),this._closeTransitionAbort=null)}setSrc(e){return this.setAttribute("src",e||""),this.resetRemoteContent(),this.loadRemoteContentIfNeeded(),this}reloadContent(){return this.resetRemoteContent(),this.loadRemoteContentIfNeeded(!0),this}getModalRoot(){return this.modalRoot}afterRender(){this.bindRenderedEvents(),this.bindSlotEventHandlers(),"closing"===this._modalState&&(this._releaseClosingContent?.(),this._releaseClosingContent=(0,d.e)(this.getModalRoot()?.querySelector("[data-sf-modal-panel]"),v.isTopModal(this))),this._readyDetail={component:this,modal:this,modalId:this.modalId,root:this.getModalRoot()},this._hasEmittedReady?this.dispatchEvent(new CustomEvent("modal:update",{bubbles:!0,composed:!0,detail:this._readyDetail})):(this._hasEmittedReady=!0,this.dispatchEvent(new CustomEvent("modal:ready",{bubbles:!0,composed:!0,detail:this._readyDetail}))),this.hasAttribute("open")&&!this._isOpen&&"closing"!==this._modalState&&(this._isOpen=!0,this._modalState="open","inline"!==this.display&&v.addToStack(this),this.focusFirst(),this.loadRemoteContentIfNeeded()),this.applyStackPosition(),(0,u.rI)(),!this.autoload||this.openState||this._hasAutoloaded||(this._hasAutoloaded=!0,requestAnimationFrame(()=>this.open({animate:!1})))}bindRenderedEvents(){const e=this.getModalRoot();e&&(e.removeEventListener("click",this.handleOverlayClick),e.addEventListener("click",this.handleOverlayClick),document.removeEventListener("keydown",this.onKeyDown),document.addEventListener("keydown",this.onKeyDown))}bindSlotEventHandlers(){const e=this.getModalRoot();e&&this._slotEventHandlers.size&&this._slotEventHandlers.forEach((t,o)=>{const i=e.querySelector(`[data-sf-runtime-event-id="${o}"]`);i&&t.forEach(({eventName:e,handler:t})=>{i.addEventListener(e,t)})})}handleOverlayClick(e){e.target===this.getModalRoot()?.querySelector("[data-sf-modal-overlay]")&&this.closeOnOverlay&&!this.unclose&&this.close()}handleCloseClick(e){e.preventDefault(),this.unclose||this.close()}handleHideClick(e){e.preventDefault(),this.hide()}onKeyDown(e){if((this.openState||"closing"===this._modalState)&&"inline"!==this.display&&v.isTopModal(this)&&!this.hiddenState)return"Escape"!==e.key||!this.closeOnEsc||this.unclose||"closing"===this._modalState||e.defaultPrevented||document.documentElement?.dataset?.sfPopoverOpen?void("Tab"===e.key&&this.trapFocus(e)):(e.preventDefault(),e.stopImmediatePropagation(),void this.close())}trapFocus(e){if(!v.isTopModal(this))return;if(this.hiddenState)return;const t=this.getModalRoot()?.querySelector("[data-sf-modal-panel]");(0,l.Zg)(t,e)}focusFirst(){if("inline"===this.display)return;if("inline"!==this.display&&!v.isTopModal(this))return;if(this.hiddenState)return;const e=this.getModalRoot()?.querySelector("[data-sf-modal-panel]");e&&e.focus()}resetRemoteContent(){this._remoteHtml="",this._remoteError="",this._remoteLoaded=!1,this._isLoadingRemote=!1,this.abortRemoteContent()}abortRemoteContent(){this._fetchController&&(this._fetchController.abort(),this._fetchController=null)}loadRemoteContentIfNeeded(e=!1){if(this.src&&("ajax"===this.mode||"iframe"===this.mode)&&(this.preload||this.openState||e))return"iframe"===this.mode?(this._remoteLoaded=!0,void this.requestComponentUpdate("remote-content")):void(this._remoteLoaded&&!e||this.loadAjaxContent())}async loadAjaxContent(){this.abortRemoteContent(),this._isLoadingRemote=!0,this._remoteError="";let e=!1;this.requestComponentUpdate("remote-loading"),this.emitContentEvent("modal:before-content-upload"),this._fetchController=new AbortController;try{if(this.src.startsWith("#")){const e=document.querySelector(this.src);if(!e)throw new Error(`Element not found: ${this.src}`);this._remoteHtml=e.innerHTML}else{const e=await fetch(this.src,{signal:this._fetchController.signal});if(!e.ok)throw new Error(`HTTP ${e.status}: ${e.statusText}`);this._remoteHtml=await e.text()}this._remoteLoaded=!0}catch(t){"AbortError"===t.name?e=!0:this._remoteError=t.message||"Failed to load content"}finally{this._fetchController=null,this._isLoadingRemote=!1,this.requestComponentUpdate("remote-content"),e||this.emitContentEvent("modal:after-content-upload")}}handleIframeLoad=()=>{this._remoteLoaded=!0,this.emitContentEvent("modal:after-content-upload")};handleIframeError=()=>{this._remoteError="Failed to load iframe content",this.requestComponentUpdate("remote-content")};emitContentEvent(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:{component:this,modal:this,modalId:this.modalId,src:this.src,remote:this.state.remote}}))}emitModalEvent(e,{cancelable:t=!1,detail:o={}}={}){const i=new CustomEvent(e,{bubbles:!0,composed:!0,cancelable:t,detail:{component:this,modal:this,modalId:this.modalId,root:this.getModalRoot(),...o}});return this.dispatchEvent(i),!i.defaultPrevented}emitBeforeOpen(){return this.emitModalEvent("modal:before-open",{cancelable:!0,detail:{phase:"before-open"}})}emitAfterOpen(){this.emitModalEvent("modal:after-open",{detail:{phase:"after-open"}})}emitBeforeClose(){return this.emitModalEvent("modal:before-close",{cancelable:!0,detail:{phase:"before-close"}})}emitAfterClose(){this.emitModalEvent("modal:after-close",{detail:{phase:"after-close"}})}emitBeforeHide(){return this.emitModalEvent("modal:before-hide",{cancelable:!0,detail:{phase:"before-hide"}})}emitAfterHide(){this.emitModalEvent("modal:after-hide",{detail:{phase:"after-hide"}})}emitBeforeShow(){return this.emitModalEvent("modal:before-show",{cancelable:!0,detail:{phase:"before-show"}})}emitAfterShow(){this.emitModalEvent("modal:after-show",{detail:{phase:"after-show"}})}syncOpenAttribute(e){this._syncingOpenAttribute=!0,e?this.setAttribute("open",""):this.removeAttribute("open"),this._syncingOpenAttribute=!1}attributeChangedCallback(e,t,o){if(!this._syncingOpenAttribute||"open"!==e){if("open"===e&&t!==o)return this._isMounted?void(null===o?(this.close(),this.requestComponentUpdate("open-attribute")):this.open()):void super.attributeChangedCallback(e,t,o);["src","mode","preload"].includes(e)&&t!==o&&this.resetRemoteContent(),"minimized"===e&&t!==o&&(this._isHidden=null!==o,this.syncMinimizedLayer()),super.attributeChangedCallback(e,t,o)}}teardownModal(){const e=v.isTopModal(this);this.abortRemoteContent(),this.cancelCloseTransition(),document.removeEventListener("keydown",this.onKeyDown),"inline"!==this.display&&v.removeFromStack(this),this._isOpen=!1,this._modalState="closed",this.clearPortal(),this._releaseClosingContent?.(),this._releaseClosingContent=null,(0,u.BK)(e,this._lastActive,this._focusReturnAncestors)}clearPortal(){this._portalRoot&&((0,i.render)(i.nothing,this._portalRoot),this._portalRoot.remove(),this._portalRoot=null)}ownModalHandler(e){return t=>{t.detail?.modal===this&&e.call(this,t)}}onBeforeOpen(e,t){return"function"==typeof e&&this.addEventListener("modal:before-open",this.ownModalHandler(e),t),this}onAfterOpen(e,t){return"function"==typeof e&&this.addEventListener("modal:after-open",this.ownModalHandler(e),t),this}onBeforeClose(e,t){return"function"==typeof e&&this.addEventListener("modal:before-close",this.ownModalHandler(e),t),this}onAfterClose(e,t){return"function"==typeof e&&this.addEventListener("modal:after-close",this.ownModalHandler(e),t),this}onBeforeHide(e,t){return"function"==typeof e&&this.addEventListener("modal:before-hide",this.ownModalHandler(e),t),this}onAfterHide(e,t){return"function"==typeof e&&this.addEventListener("modal:after-hide",this.ownModalHandler(e),t),this}onBeforeShow(e,t){return"function"==typeof e&&this.addEventListener("modal:before-show",this.ownModalHandler(e),t),this}onAfterShow(e,t){return"function"==typeof e&&this.addEventListener("modal:after-show",this.ownModalHandler(e),t),this}onModalReady(e,t){return"function"!=typeof e?this:this._readyDetail?(e(new CustomEvent("modal:ready",{detail:this._readyDetail})),this):(this.addEventListener("modal:ready",this.ownModalHandler(e),t),this)}onModalUpdate(e,t){return"function"==typeof e&&this.addEventListener("modal:update",this.ownModalHandler(e),t),this}static bindGlobalEvents(){v.globalBound||"undefined"==typeof document||(document.addEventListener("click",e=>{const t=e.target.closest("[data-sf-modal-open]");if(t)return void v.registry.get(t.getAttribute("data-sf-modal-open"))?.open();const o=e.target.closest("[data-sf-modal-show]");if(o)return void v.registry.get(o.getAttribute("data-sf-modal-show"))?.show();const i=e.target.closest("[data-sf-modal-hide]");if(i)return void v.registry.get(i.getAttribute("data-sf-modal-hide"))?.hide();const s=e.target.closest("[data-sf-modal-close]");if(!s)return;const n=s.getAttribute("data-sf-modal-close")||s.closest(".sf-modal")?.getAttribute("data-sf-modal-id");v.registry.get(n)?.close()}),v.globalBound=!0)}static lockPage(e=!0){v.lockState||(v.lockState=(0,c.i)(e))}static unlockPage(){(0,c.l)(v.lockState),v.lockState=null}}v.define("sf-modal"),t()}catch(C){t(C)}})},e45eac6c719d(e,t,o){o.a(e,async(e,i)=>{try{o.d(t,{Q:()=>d});var s=o("ddf1cdb42ecc"),n=e([s]),a=n.then?(await n)():n;s=a[0];function r(...e){return e.filter(Boolean).join(" ").trim()}function l(e){const t=e.blur?`backdrop-blur-${e.blurType}`:"focus"===e.overlayPreset?"backdrop-blur-small":"";return r(`sf-modal-overlay--${e.overlayPreset}`,t)}function d(e){const t="inline"===e.display,o=Boolean(e.src)&&("ajax"===e.mode||"iframe"===e.mode),i=!1!==e.showHeader,n=e.hasHeaderContent,a=`${e.modalId}-title`,d=e.ariaLabel||(n||!i?e.title:""),h=e.hasContentContent,c=e.hasFooterContent&&e.showFooter,u=[e.width?`--sf-modal-width:${e.width}`:"",e.height?`--sf-modal-height:${e.height}`:""].filter(Boolean).join(";"),m=[e.surfacePadding?`--sf-modal-surface-padding:${e.surfacePadding}`:""].filter(Boolean).join(";"),f=[e.modalZIndex?`z-index:${e.modalZIndex}`:""].filter(Boolean).join(";");return s.html`
31
+ `:i.nothing}_loadingSpinnerNode(){return this._loadingSpinner||(this._loadingSpinner=(0,u.le)({className:"sf-modal-spinner"})),this._loadingSpinner}templateContext(){this._slotEventHandlers.clear(),this._slotEventId=0;const e=this.getPropsContext();return this.createTemplateContext({...e,component:this,closeText:(0,a.pageText)(b,"close",this),minimizeText:(0,a.pageText)(b,"minimize",this),title:this.title,modalId:this.modalId,open:this.renderOpenState,modalState:this.renderModalState,animate:this._animatePanel&&"inline"!==this.display,modalZIndex:this.modalZIndex,hide:this.hideButton,minimized:this.hiddenState,showClose:this.showClose,blur:this.blur,blurType:this.blurType,hasCustomBlurType:this.hasCustomBlurType,hasHeaderContent:this.hasSlotContent("header"),hasContentContent:this.hasSlotContent("content"),hasFooterContent:this.hasSlotContent("footer"),headerContent:(0,s.unsafeHTML)(this.getSlotHtml("header")),contentContent:(0,s.unsafeHTML)(this.getSlotHtml("content")),footerContent:(0,s.unsafeHTML)(this.getSlotHtml("footer")),remoteContent:this.remoteContent,onCloseClick:this.handleCloseClick,onHideClick:this.handleHideClick})}getSlotHtml(e){return[...this._liveSlotNodes.get(e)||[],...this._slotTemplates.get(e)||[]].map(e=>{if(e instanceof HTMLElement){const t=e.cloneNode(!0);return this.copyRuntimeData(e,t),this.assignSlotEventIds(t),this.cleanNestedSmartComponentRender(t),t.outerHTML}return e.textContent||""}).join("")}assignSlotEventIds(e){[e,...Array.from(e.querySelectorAll?.("*")||[])].forEach(e=>{if(!e.__sfCreateEventHandlers?.length)return;const t="sf-modal-slot-event-"+ ++this._slotEventId;e.setAttribute("data-sf-runtime-event-id",t),this._slotEventHandlers.set(t,e.__sfCreateEventHandlers.slice())})}cleanNestedSmartComponentRender(e){[e,...Array.from(e.querySelectorAll?.("*")||[])].forEach(e=>{(e.tagName?.toLowerCase?.()||"").startsWith("sf-")&&Array.from(e.childNodes).forEach(e=>{e instanceof HTMLElement&&(e.hasAttribute("slot")||"slot"===e.tagName.toLowerCase()||e.tagName.toLowerCase().startsWith("sf-"))||e.remove()})})}template(){return(0,r.Q)(this.templateContext())}async renderComponent(e=[]){const t=++this._renderToken;if(!this._isMounted)return;this.beforeRender(e),this.emitComponentEvent("before-render",{changedAttributes:e}),this.runExternalHook("beforeRender",{changedAttributes:e,root:this});const o=await this.resolveTemplateResult(e);this._isMounted&&t===this._renderToken&&((0,i.render)(o,this.resolveRenderTarget()),this.afterRender(e),this.runExternalHook("afterRender",{changedAttributes:e,root:this}),this.emitComponentEvent("after-render",{changedAttributes:e}))}resolveRenderTarget(){return"inline"===this.display?(this.clearPortal(),this._hostClearedForPortal=!1,this._renderTarget=this,this):(this._hostClearedForPortal||((0,i.render)(i.nothing,this),this._hostClearedForPortal=!0),this._portalRoot||(this._portalRoot=this.resolvePortalRoot()),this.dedupePortalRoots(),this._renderTarget=this._portalRoot,this._portalRoot)}get overlayHome(){return this.closest(g)||document.body}get inContainer(){return this.overlayHome!==document.body}resolvePortalRoot(){const e=this.overlayHome,t=e.querySelector(`[data-sf-modal-portal="${this.modalId}"]`);if(t)return t;const o=document.createElement("div");return o.setAttribute("data-sf-modal-portal",this.modalId),e.append(o),o}dedupePortalRoots(){Array.from(document.querySelectorAll(`[data-sf-modal-portal="${this.modalId}"]`)).forEach(e=>{e!==this._portalRoot&&((0,i.render)(i.nothing,e),e.remove())}),this._portalRoot.isConnected||(this._portalRoot.setAttribute("data-sf-modal-portal",this.modalId),this.overlayHome.append(this._portalRoot))}applyStackPosition(e=C.getStackIndex(this)){this._stackIndex=e;const t=this.getModalRoot();return t&&"inline"!==this.display?e<0?(t.style.removeProperty("z-index"),t.style.removeProperty("--sf-modal-stack-index"),this):(t.style.setProperty("--sf-modal-stack-index",String(e)),t.style.zIndex=String(this.modalZIndex),this):this}open(e={}){const{animate:t=!0}="boolean"==typeof e?{animate:e}:e,o="closing"===this._modalState;return(this._isOpen||"inline"===this.display&&this.openState)&&!o?(this.cancelCloseTransition(),C.bringToFront(this),this):this.emitBeforeOpen()?(o||(this._lastActive=document.activeElement,this._focusReturnAncestors=(0,m.M$)(this._lastActive)),o&&(this.cancelCloseTransition(),this._releaseClosingContent?.(),this._releaseClosingContent=null),this._isOpen=!0,this._inlineClosed=!1,this._animatePanel=Boolean(t),this._modalState=t&&"inline"!==this.display?"opening":"open",this.syncOpenAttribute(!0),"inline"===this.display||o?"inline"!==this.display&&C.bringToFront(this):C.addToStack(this),this.requestComponentUpdate("open"),(0,h.Gp)(()=>{if(!this._isOpen||"closing"===this._modalState)return;this._modalState="open";const e=new Promise(e=>{const t=o=>{o.detail?.changedAttributes?.includes("open-state")&&(this.removeEventListener("sf-updated",t),e())};this.addEventListener("sf-updated",t)});this.requestComponentUpdate("open-state"),e.then(()=>{this._isOpen&&"open"===this._modalState&&(this.focusFirst(),this.emitAfterOpen(),this.loadRemoteContentIfNeeded())})}),this):this}close(){if(!this.openState||"closing"===this._modalState)return this;if(!this.emitBeforeClose())return this;if("inline"===this.display)return this.finishClose(),this;this._modalState="closing",this._isOpen=!1,this.requestComponentUpdate("close");const e=this.getModalRoot()?.querySelector("[data-sf-modal-panel]");return this._releaseClosingContent=(0,d.e)(e,C.isTopModal(this)),this._closeTransitionAbort=(0,h.ju)(()=>this.getModalRoot(),()=>this.finishClose()),this}hide(){return!this.openState||"inline"===this.display||this.hiddenState?this:this.emitBeforeHide()?(this._isHidden=!0,this.setAttribute("minimized",""),this.requestComponentUpdate("hide"),this.emitAfterHide(),this):this}show(){return this.openState&&"inline"!==this.display&&this.hiddenState&&this.emitBeforeShow()?(this._isHidden=!1,this.removeAttribute("minimized"),this.requestComponentUpdate("show"),this.emitAfterShow(),this):this}syncMinimizedLayer(){if(!this._isMounted||!this.openState||"inline"===this.display||"closed"===this._modalState||"closing"===this._modalState)return;const e=this.getModalRoot();if(this.hiddenState){const t=C.isTopModal(this);(0,m.ZT)(this),this.applyStackPosition(),(0,m.BK)(t,this._lastActive,this._focusReturnAncestors),e&&(e.inert=!0,e.setAttribute("aria-hidden","true"))}else e&&(e.inert=!1,e.setAttribute("aria-hidden","false")),(0,m.k8)(this,C),C.bringToFront(this),requestAnimationFrame(()=>this.focusFirst())}toggle(){return this.openState?this.close():this.open()}finishClose(){if("inline"!==this.display&&"closing"!==this._modalState)return this;const e=C.isTopModal(this);this.cancelCloseTransition(),this._isOpen=!1,"inline"===this.display&&(this._inlineClosed=!0),this._isHidden=!1,this._modalState="closed",this.removeAttribute("minimized"),this.syncOpenAttribute(!1);const t=this.getModalRoot();return t&&(t.inert=!0,t.setAttribute("aria-hidden","true")),this._releaseClosingContent?.(),this._releaseClosingContent=null,"inline"!==this.display&&C.removeFromStack(this),"inline"!==this.display&&(0,m.BK)(e,this._lastActive,this._focusReturnAncestors),this.requestComponentUpdate("after-close"),this.emitAfterClose(),this}cancelCloseTransition(){this._closeTimer&&(clearTimeout(this._closeTimer),this._closeTimer=null),this._closeTransitionAbort&&(this._closeTransitionAbort(),this._closeTransitionAbort=null)}setSrc(e){return this.setAttribute("src",e||""),this.resetRemoteContent(),this.loadRemoteContentIfNeeded(),this}reloadContent(){return this.resetRemoteContent(),this.loadRemoteContentIfNeeded(!0),this}getModalRoot(){return this.modalRoot}afterRender(){this.bindRenderedEvents(),this.bindSlotEventHandlers(),"closing"===this._modalState&&(this._releaseClosingContent?.(),this._releaseClosingContent=(0,d.e)(this.getModalRoot()?.querySelector("[data-sf-modal-panel]"),C.isTopModal(this))),this._readyDetail={component:this,modal:this,modalId:this.modalId,root:this.getModalRoot()},this._hasEmittedReady?this.dispatchEvent(new CustomEvent("modal:update",{bubbles:!0,composed:!0,detail:this._readyDetail})):(this._hasEmittedReady=!0,this.dispatchEvent(new CustomEvent("modal:ready",{bubbles:!0,composed:!0,detail:this._readyDetail}))),this.hasAttribute("open")&&!this._isOpen&&"closing"!==this._modalState&&(this._isOpen=!0,this._modalState="open","inline"!==this.display&&C.addToStack(this),this.focusFirst(),this.loadRemoteContentIfNeeded()),this.applyStackPosition(),(0,m.rI)(),!this.autoload||this.openState||this._hasAutoloaded||(this._hasAutoloaded=!0,requestAnimationFrame(()=>this.open({animate:!1})))}bindRenderedEvents(){const e=this.getModalRoot();e&&(e.removeEventListener("click",this.handleOverlayClick),e.addEventListener("click",this.handleOverlayClick),document.removeEventListener("keydown",this.onKeyDown),document.addEventListener("keydown",this.onKeyDown))}bindSlotEventHandlers(){const e=this.getModalRoot();e&&this._slotEventHandlers.size&&this._slotEventHandlers.forEach((t,o)=>{const i=e.querySelector(`[data-sf-runtime-event-id="${o}"]`);i&&t.forEach(({eventName:e,handler:t})=>{i.addEventListener(e,t)})})}handleOverlayClick(e){e.target===this.getModalRoot()?.querySelector("[data-sf-modal-overlay]")&&this.closeOnOverlay&&!this.unclose&&this.close()}handleCloseClick(e){e.preventDefault(),this.unclose||this.close()}handleHideClick(e){e.preventDefault(),this.hide()}onKeyDown(e){if((this.openState||"closing"===this._modalState)&&"inline"!==this.display&&C.isTopModal(this)&&!this.hiddenState)return"Escape"!==e.key||!this.closeOnEsc||this.unclose||"closing"===this._modalState||e.defaultPrevented||document.documentElement?.dataset?.sfPopoverOpen?void("Tab"===e.key&&this.trapFocus(e)):(e.preventDefault(),e.stopImmediatePropagation(),void this.close())}trapFocus(e){if(!C.isTopModal(this))return;if(this.hiddenState)return;const t=this.getModalRoot()?.querySelector("[data-sf-modal-panel]");(0,l.Zg)(t,e)}focusFirst(){if("inline"===this.display)return;if("inline"!==this.display&&!C.isTopModal(this))return;if(this.hiddenState)return;const e=this.getModalRoot()?.querySelector("[data-sf-modal-panel]");e&&e.focus()}resetRemoteContent(){this._remoteHtml="",this._remoteError="",this._remoteLoaded=!1,this._isLoadingRemote=!1,this.abortRemoteContent()}abortRemoteContent(){this._fetchController&&(this._fetchController.abort(),this._fetchController=null)}loadRemoteContentIfNeeded(e=!1){if(this.src&&("ajax"===this.mode||"iframe"===this.mode)&&(this.preload||this.openState||e))return"iframe"===this.mode?(this._remoteLoaded=!0,void this.requestComponentUpdate("remote-content")):void(this._remoteLoaded&&!e||this.loadAjaxContent())}async loadAjaxContent(){this.abortRemoteContent(),this._isLoadingRemote=!0,this._remoteError="";let e=!1;this.requestComponentUpdate("remote-loading"),this.emitContentEvent("modal:before-content-upload"),this._fetchController=new AbortController;try{if(this.src.startsWith("#")){const e=document.querySelector(this.src);if(!e)throw new Error(`Element not found: ${this.src}`);this._remoteHtml=e.innerHTML}else{const e=await fetch(this.src,{signal:this._fetchController.signal});if(!e.ok)throw new Error(`HTTP ${e.status}: ${e.statusText}`);this._remoteHtml=await e.text()}this._remoteLoaded=!0}catch(t){"AbortError"===t.name?e=!0:this._remoteError=t.message||"Failed to load content"}finally{this._fetchController=null,this._isLoadingRemote=!1,this.requestComponentUpdate("remote-content"),e||this.emitContentEvent("modal:after-content-upload")}}handleIframeLoad=()=>{this._remoteLoaded=!0,this.emitContentEvent("modal:after-content-upload")};handleIframeError=()=>{this._remoteError="Failed to load iframe content",this.requestComponentUpdate("remote-content")};emitContentEvent(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:{component:this,modal:this,modalId:this.modalId,src:this.src,remote:this.state.remote}}))}emitModalEvent(e,{cancelable:t=!1,detail:o={}}={}){const i=new CustomEvent(e,{bubbles:!0,composed:!0,cancelable:t,detail:{component:this,modal:this,modalId:this.modalId,root:this.getModalRoot(),...o}});return this.dispatchEvent(i),!i.defaultPrevented}emitBeforeOpen(){return this.emitModalEvent("modal:before-open",{cancelable:!0,detail:{phase:"before-open"}})}emitAfterOpen(){this.emitModalEvent("modal:after-open",{detail:{phase:"after-open"}})}emitBeforeClose(){return this.emitModalEvent("modal:before-close",{cancelable:!0,detail:{phase:"before-close"}})}emitAfterClose(){this.emitModalEvent("modal:after-close",{detail:{phase:"after-close"}})}emitBeforeHide(){return this.emitModalEvent("modal:before-hide",{cancelable:!0,detail:{phase:"before-hide"}})}emitAfterHide(){this.emitModalEvent("modal:after-hide",{detail:{phase:"after-hide"}})}emitBeforeShow(){return this.emitModalEvent("modal:before-show",{cancelable:!0,detail:{phase:"before-show"}})}emitAfterShow(){this.emitModalEvent("modal:after-show",{detail:{phase:"after-show"}})}syncOpenAttribute(e){this._syncingOpenAttribute=!0,e?this.setAttribute("open",""):this.removeAttribute("open"),this._syncingOpenAttribute=!1}attributeChangedCallback(e,t,o){if(!this._syncingOpenAttribute||"open"!==e){if("open"===e&&t!==o)return this._isMounted?void(null===o?(this.close(),this.requestComponentUpdate("open-attribute")):this.open()):void super.attributeChangedCallback(e,t,o);["src","mode","preload"].includes(e)&&t!==o&&this.resetRemoteContent(),"minimized"===e&&t!==o&&(this._isHidden=null!==o,this.syncMinimizedLayer()),super.attributeChangedCallback(e,t,o)}}teardownModal(){const e=C.isTopModal(this);this.abortRemoteContent(),this.cancelCloseTransition(),document.removeEventListener("keydown",this.onKeyDown),"inline"!==this.display&&C.removeFromStack(this),this._isOpen=!1,this._modalState="closed",this.clearPortal(),this._releaseClosingContent?.(),this._releaseClosingContent=null,(0,m.BK)(e,this._lastActive,this._focusReturnAncestors)}clearPortal(){this._portalRoot&&((0,i.render)(i.nothing,this._portalRoot),this._portalRoot.remove(),this._portalRoot=null)}ownModalHandler(e){return t=>{t.detail?.modal===this&&e.call(this,t)}}onBeforeOpen(e,t){return"function"==typeof e&&this.addEventListener("modal:before-open",this.ownModalHandler(e),t),this}onAfterOpen(e,t){return"function"==typeof e&&this.addEventListener("modal:after-open",this.ownModalHandler(e),t),this}onBeforeClose(e,t){return"function"==typeof e&&this.addEventListener("modal:before-close",this.ownModalHandler(e),t),this}onAfterClose(e,t){return"function"==typeof e&&this.addEventListener("modal:after-close",this.ownModalHandler(e),t),this}onBeforeHide(e,t){return"function"==typeof e&&this.addEventListener("modal:before-hide",this.ownModalHandler(e),t),this}onAfterHide(e,t){return"function"==typeof e&&this.addEventListener("modal:after-hide",this.ownModalHandler(e),t),this}onBeforeShow(e,t){return"function"==typeof e&&this.addEventListener("modal:before-show",this.ownModalHandler(e),t),this}onAfterShow(e,t){return"function"==typeof e&&this.addEventListener("modal:after-show",this.ownModalHandler(e),t),this}onModalReady(e,t){return"function"!=typeof e?this:this._readyDetail?(e(new CustomEvent("modal:ready",{detail:this._readyDetail})),this):(this.addEventListener("modal:ready",this.ownModalHandler(e),t),this)}onModalUpdate(e,t){return"function"==typeof e&&this.addEventListener("modal:update",this.ownModalHandler(e),t),this}static bindGlobalEvents(){C.globalBound||"undefined"==typeof document||(document.addEventListener("click",e=>{const t=e.target.closest("[data-sf-modal-open]");if(t)return void C.registry.get(t.getAttribute("data-sf-modal-open"))?.open();const o=e.target.closest("[data-sf-modal-show]");if(o)return void C.registry.get(o.getAttribute("data-sf-modal-show"))?.show();const i=e.target.closest("[data-sf-modal-hide]");if(i)return void C.registry.get(i.getAttribute("data-sf-modal-hide"))?.hide();const s=e.target.closest("[data-sf-modal-close]");if(!s)return;const n=s.getAttribute("data-sf-modal-close")||s.closest(".sf-modal")?.getAttribute("data-sf-modal-id");C.registry.get(n)?.close()}),C.globalBound=!0)}static lockPage(e=!0){C.lockState||(C.lockState=(0,c.i)(e))}static unlockPage(){(0,c.l)(C.lockState),C.lockState=null}}C.define("sf-modal"),t()}catch(_){t(_)}})},e45eac6c719d(e,t,o){o.a(e,async(e,i)=>{try{o.d(t,{Q:()=>d});var s=o("ddf1cdb42ecc"),n=e([s]),a=n.then?(await n)():n;s=a[0];function r(...e){return e.filter(Boolean).join(" ").trim()}function l(e){const t=e.blur?`backdrop-blur-${e.blurType}`:"focus"===e.overlayPreset?"backdrop-blur-small":"";return r(`sf-modal-overlay--${e.overlayPreset}`,t)}function d(e){const t="inline"===e.display,o=Boolean(e.src)&&("ajax"===e.mode||"iframe"===e.mode),i=!1!==e.showHeader,n=e.hasHeaderContent,a=`${e.modalId}-title`,d=e.ariaLabel||(n||!i?e.title:""),h=e.hasContentContent,c=e.hasFooterContent&&e.showFooter,u=[e.width?`--sf-modal-width:${e.width}`:"",e.height?`--sf-modal-height:${e.height}`:""].filter(Boolean).join(";"),m=[e.surfacePadding?`--sf-modal-surface-padding:${e.surfacePadding}`:""].filter(Boolean).join(";"),f=[e.modalZIndex?`z-index:${e.modalZIndex}`:""].filter(Boolean).join(";");return s.html`
34
32
  <div
35
33
  id=${e.modalId}
36
34
  class=${r("sf-modal",`sf-modal--position-${e.position}`,`sf-modal--positon-${e.position}`,t?"sf-modal--inline inline-block w-full":"fixed top-0 inline-start-0 w-full h-full z-9 p-3 items-cross-center content-main-center",e.open?"flex":"hidden",!t&&e.animate&&"animate",e.rootClass)}
@@ -21,7 +21,9 @@
21
21
  ],
22
22
  "exported_parts": [],
23
23
  "composition": {
24
- "uses": [],
24
+ "uses": [
25
+ "component.spinner"
26
+ ],
25
27
  "public_parts": []
26
28
  },
27
29
  "inputs": {
@@ -1028,7 +1030,7 @@
1028
1030
  "source_artifacts": [
1029
1031
  {
1030
1032
  "path": "src/smart/modal/index.js",
1031
- "sha256": "c03ae74338e728490601f8c67923ef8f21f0846d92e51c59cff0c9f5732fbaa1"
1033
+ "sha256": "2aa3f439ec0ffdedaa8d53bc65125445f7607a335ba7fd676720195aa03c7e2f"
1032
1034
  }
1033
1035
  ],
1034
1036
  "generated_runtime": [