etudes 8.1.0 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/FlatSVG.d.ts +6 -6
- package/build/etudes.js +1 -1
- package/build/etudes.umd.cjs +1 -1
- package/package.json +1 -1
|
@@ -2,16 +2,16 @@ import { HTMLAttributes } from 'react';
|
|
|
2
2
|
export type FlatSVGProps = HTMLAttributes<HTMLDivElement> & {
|
|
3
3
|
/**
|
|
4
4
|
* Specifies how the SVG should be resized:
|
|
5
|
+
* - `preserve`: Default: the SVG size attributes are unchanged.
|
|
5
6
|
* - `none`: The SVG size attributes are stripped.
|
|
6
|
-
* - `preserve`: The SVG size attributes are unchanged.
|
|
7
7
|
* - `fill`: The SVG will fill the container, i.e. `width="100%"` and
|
|
8
8
|
* `height="100%"`.
|
|
9
|
-
* - `height`:
|
|
9
|
+
* - `height`: The SVG will maintain its aspect ratio and fill the height of
|
|
10
10
|
* the container, i.e. `width="auto"` and `height="100%"`.
|
|
11
11
|
* - `width`: The SVG will maintain its aspect ratio and fill the width of the
|
|
12
12
|
* container, i.e. `width="100%"` and `height="auto"`.
|
|
13
13
|
*/
|
|
14
|
-
fillMode?: '
|
|
14
|
+
fillMode?: 'preserve' | 'none' | 'fill' | 'height' | 'width';
|
|
15
15
|
/**
|
|
16
16
|
* The SVG string markup, i.e. "<svg>...</svg>".
|
|
17
17
|
*/
|
|
@@ -57,16 +57,16 @@ export type FlatSVGProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
57
57
|
export declare const FlatSVG: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
58
58
|
/**
|
|
59
59
|
* Specifies how the SVG should be resized:
|
|
60
|
+
* - `preserve`: Default: the SVG size attributes are unchanged.
|
|
60
61
|
* - `none`: The SVG size attributes are stripped.
|
|
61
|
-
* - `preserve`: The SVG size attributes are unchanged.
|
|
62
62
|
* - `fill`: The SVG will fill the container, i.e. `width="100%"` and
|
|
63
63
|
* `height="100%"`.
|
|
64
|
-
* - `height`:
|
|
64
|
+
* - `height`: The SVG will maintain its aspect ratio and fill the height of
|
|
65
65
|
* the container, i.e. `width="auto"` and `height="100%"`.
|
|
66
66
|
* - `width`: The SVG will maintain its aspect ratio and fill the width of the
|
|
67
67
|
* container, i.e. `width="100%"` and `height="auto"`.
|
|
68
68
|
*/
|
|
69
|
-
fillMode?: "
|
|
69
|
+
fillMode?: "preserve" | "none" | "fill" | "height" | "width";
|
|
70
70
|
/**
|
|
71
71
|
* The SVG string markup, i.e. "<svg>...</svg>".
|
|
72
72
|
*/
|
package/build/etudes.js
CHANGED
|
@@ -6093,7 +6093,7 @@ function pa(r) {
|
|
|
6093
6093
|
return r.startsWith(this.options.attributeNamePrefix) && r !== this.options.textNodeName ? r.substr(this.attrPrefixLen) : !1;
|
|
6094
6094
|
}
|
|
6095
6095
|
const oc = /* @__PURE__ */ Pe(({
|
|
6096
|
-
fillMode: r = "
|
|
6096
|
+
fillMode: r = "preserve",
|
|
6097
6097
|
svg: n,
|
|
6098
6098
|
shouldStripClasses: s = !0,
|
|
6099
6099
|
shouldStripExtraneousAttributes: c = !0,
|
package/build/etudes.umd.cjs
CHANGED
|
@@ -34,4 +34,4 @@ Check the top-level render call using <`+w+">."),oe}var j=N,Y=Symbol.for("react.
|
|
|
34
34
|
`);const n=new Nt("!xml");let s=n,c="",l="";for(let f=0;f<r.length;f++)if(r[f]==="<")if(r[f+1]==="/"){const p=dt(r,">",f,"Closing Tag is not closed.");let m=r.substring(f+2,p).trim();if(this.options.removeNSPrefix){const P=m.indexOf(":");P!==-1&&(m=m.substr(P+1))}this.options.transformTagName&&(m=this.options.transformTagName(m)),s&&(c=this.saveTextToParentTag(c,s,l));const E=l.substring(l.lastIndexOf(".")+1);if(m&&this.options.unpairedTags.indexOf(m)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${m}>`);let x=0;E&&this.options.unpairedTags.indexOf(E)!==-1?(x=l.lastIndexOf(".",l.lastIndexOf(".")-1),this.tagsNodeStack.pop()):x=l.lastIndexOf("."),l=l.substring(0,x),s=this.tagsNodeStack.pop(),c="",f=p}else if(r[f+1]==="?"){let p=yn(r,f,!1,"?>");if(!p)throw new Error("Pi Tag is not closed.");if(c=this.saveTextToParentTag(c,s,l),!(this.options.ignoreDeclaration&&p.tagName==="?xml"||this.options.ignorePiTags)){const m=new Nt(p.tagName);m.add(this.options.textNodeName,""),p.tagName!==p.tagExp&&p.attrExpPresent&&(m[":@"]=this.buildAttributesMap(p.tagExp,l,p.tagName)),this.addChild(s,m,l)}f=p.closeIndex+1}else if(r.substr(f+1,3)==="!--"){const p=dt(r,"-->",f+4,"Comment is not closed.");if(this.options.commentPropName){const m=r.substring(f+4,p-2);c=this.saveTextToParentTag(c,s,l),s.add(this.options.commentPropName,[{[this.options.textNodeName]:m}])}f=p}else if(r.substr(f+1,2)==="!D"){const p=Ri(r,f);this.docTypeEntities=p.entities,f=p.i}else if(r.substr(f+1,2)==="!["){const p=dt(r,"]]>",f,"CDATA is not closed.")-2,m=r.substring(f+9,p);c=this.saveTextToParentTag(c,s,l);let E=this.parseTextData(m,s.tagname,l,!0,!1,!0,!0);E==null&&(E=""),this.options.cdataPropName?s.add(this.options.cdataPropName,[{[this.options.textNodeName]:m}]):s.add(this.options.textNodeName,E),f=p+2}else{let p=yn(r,f,this.options.removeNSPrefix),m=p.tagName;const E=p.rawTagName;let x=p.tagExp,P=p.attrExpPresent,C=p.closeIndex;this.options.transformTagName&&(m=this.options.transformTagName(m)),s&&c&&s.tagname!=="!xml"&&(c=this.saveTextToParentTag(c,s,l,!1));const A=s;if(A&&this.options.unpairedTags.indexOf(A.tagname)!==-1&&(s=this.tagsNodeStack.pop(),l=l.substring(0,l.lastIndexOf("."))),m!==n.tagname&&(l+=l?"."+m:m),this.isItStopNode(this.options.stopNodes,l,m)){let I="";if(x.length>0&&x.lastIndexOf("/")===x.length-1)m[m.length-1]==="/"?(m=m.substr(0,m.length-1),l=l.substr(0,l.length-1),x=m):x=x.substr(0,x.length-1),f=p.closeIndex;else if(this.options.unpairedTags.indexOf(m)!==-1)f=p.closeIndex;else{const G=this.readStopNodeData(r,E,C+1);if(!G)throw new Error(`Unexpected end of ${E}`);f=G.i,I=G.tagContent}const U=new Nt(m);m!==x&&P&&(U[":@"]=this.buildAttributesMap(x,l,m)),I&&(I=this.parseTextData(I,m,l,!0,P,!0,!0)),l=l.substr(0,l.lastIndexOf(".")),U.add(this.options.textNodeName,I),this.addChild(s,U,l)}else{if(x.length>0&&x.lastIndexOf("/")===x.length-1){m[m.length-1]==="/"?(m=m.substr(0,m.length-1),l=l.substr(0,l.length-1),x=m):x=x.substr(0,x.length-1),this.options.transformTagName&&(m=this.options.transformTagName(m));const I=new Nt(m);m!==x&&P&&(I[":@"]=this.buildAttributesMap(x,l,m)),this.addChild(s,I,l),l=l.substr(0,l.lastIndexOf("."))}else{const I=new Nt(m);this.tagsNodeStack.push(s),m!==x&&P&&(I[":@"]=this.buildAttributesMap(x,l,m)),this.addChild(s,I,l),s=I}c="",f=C}}else c+=r[f];return n.child};function Qi(r,n,s){const c=this.options.updateTag(n.tagname,s,n[":@"]);c===!1||(typeof c=="string"&&(n.tagname=c),r.addChild(n))}const $i=function(r){if(this.options.processEntities){for(let n in this.docTypeEntities){const s=this.docTypeEntities[n];r=r.replace(s.regx,s.val)}for(let n in this.lastEntities){const s=this.lastEntities[n];r=r.replace(s.regex,s.val)}if(this.options.htmlEntities)for(let n in this.htmlEntities){const s=this.htmlEntities[n];r=r.replace(s.regex,s.val)}r=r.replace(this.ampEntity.regex,this.ampEntity.val)}return r};function qi(r,n,s,c){return r&&(c===void 0&&(c=n.child.length===0),r=this.parseTextData(r,n.tagname,s,!1,n[":@"]?Object.keys(n[":@"]).length!==0:!1,c),r!==void 0&&r!==""&&n.add(this.options.textNodeName,r),r=""),r}function es(r,n,s){const c="*."+s;for(const l in r){const f=r[l];if(c===f||n===f)return!0}return!1}function ts(r,n,s=">"){let c,l="";for(let f=n;f<r.length;f++){let g=r[f];if(c)g===c&&(c="");else if(g==='"'||g==="'")c=g;else if(g===s[0])if(s[1]){if(r[f+1]===s[1])return{data:l,index:f}}else return{data:l,index:f};else g===" "&&(g=" ");l+=g}}function dt(r,n,s,c){const l=r.indexOf(n,s);if(l===-1)throw new Error(c);return l+n.length-1}function yn(r,n,s,c=">"){const l=ts(r,n+1,c);if(!l)return;let f=l.data;const g=l.index,p=f.search(/\s/);let m=f,E=!0;p!==-1&&(m=f.substring(0,p),f=f.substring(p+1).trimStart());const x=m;if(s){const P=m.indexOf(":");P!==-1&&(m=m.substr(P+1),E=m!==l.data.substr(P+1))}return{tagName:m,tagExp:f,closeIndex:g,attrExpPresent:E,rawTagName:x}}function ns(r,n,s){const c=s;let l=1;for(;s<r.length;s++)if(r[s]==="<")if(r[s+1]==="/"){const f=dt(r,">",s,`${n} is not closed`);if(r.substring(s+2,f).trim()===n&&(l--,l===0))return{tagContent:r.substring(c,s),i:f};s=f}else if(r[s+1]==="?")s=dt(r,"?>",s+1,"StopNode is not closed.");else if(r.substr(s+1,3)==="!--")s=dt(r,"-->",s+3,"StopNode is not closed.");else if(r.substr(s+1,2)==="![")s=dt(r,"]]>",s,"StopNode is not closed.")-2;else{const f=yn(r,s,">");f&&((f&&f.tagName)===n&&f.tagExp[f.tagExp.length-1]!=="/"&&l++,s=f.closeIndex)}}function bn(r,n,s){if(n&&typeof r=="string"){const c=r.trim();return c==="true"?!0:c==="false"?!1:Hi(r,s)}else return mi(r)?r:""}function rs(r,n){return Ar(r,n)}function Ar(r,n,s){let c;const l={};for(let f=0;f<r.length;f++){const g=r[f],p=os(g);let m="";if(s===void 0?m=p:m=s+"."+p,p===n.textNodeName)c===void 0?c=g[p]:c+=""+g[p];else{if(p===void 0)continue;if(g[p]){let E=Ar(g[p],n,m);const x=ss(E,n);g[":@"]?is(E,g[":@"],m,n):Object.keys(E).length===1&&E[n.textNodeName]!==void 0&&!n.alwaysCreateTextNode?E=E[n.textNodeName]:Object.keys(E).length===0&&(n.alwaysCreateTextNode?E[n.textNodeName]="":E=""),l[p]!==void 0&&l.hasOwnProperty(p)?(Array.isArray(l[p])||(l[p]=[l[p]]),l[p].push(E)):n.isArray(p,m,x)?l[p]=[E]:l[p]=E}}}return typeof c=="string"?c.length>0&&(l[n.textNodeName]=c):c!==void 0&&(l[n.textNodeName]=c),l}function os(r){const n=Object.keys(r);for(let s=0;s<n.length;s++){const c=n[s];if(c!==":@")return c}}function is(r,n,s,c){if(n){const l=Object.keys(n),f=l.length;for(let g=0;g<f;g++){const p=l[g];c.isArray(p,s+"."+p,!0,!0)?r[p]=[n[p]]:r[p]=n[p]}}}function ss(r,n){const{textNodeName:s}=n,c=Object.keys(r).length;return!!(c===0||c===1&&(r[s]||typeof r[s]=="boolean"||r[s]===0))}class as{constructor(n){this.externalEntities={},this.options=Ci(n)}parse(n,s){if(typeof n!="string")if(n.toString)n=n.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(s){s===!0&&(s={});const f=bi(n,s);if(f!==!0)throw Error(`${f.err.msg}:${f.err.line}:${f.err.col}`)}const c=new Di(this.options);c.addExternalEntities(this.externalEntities);const l=c.parseXml(n);return this.options.preserveOrder||l===void 0?l:rs(l,this.options)}addEntity(n,s){if(s.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(n.indexOf("&")!==-1||n.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(s==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[n]=s}}const cs=`
|
|
35
35
|
`;function ls(r,n){let s="";return n.format&&n.indentBy.length>0&&(s=cs),Mr(r,n,"",s)}function Mr(r,n,s,c){let l="",f=!1;for(let g=0;g<r.length;g++){const p=r[g],m=us(p);if(m===void 0)continue;let E="";if(s.length===0?E=m:E=`${s}.${m}`,m===n.textNodeName){let I=p[m];fs(E,n)||(I=n.tagValueProcessor(m,I),I=jr(I,n)),f&&(l+=c),l+=I,f=!1;continue}else if(m===n.cdataPropName){f&&(l+=c),l+=`<![CDATA[${p[m][0][n.textNodeName]}]]>`,f=!1;continue}else if(m===n.commentPropName){l+=c+`<!--${p[m][0][n.textNodeName]}-->`,f=!0;continue}else if(m[0]==="?"){const I=Ir(p[":@"],n),U=m==="?xml"?"":c;let G=p[m][0][n.textNodeName];G=G.length!==0?" "+G:"",l+=U+`<${m}${G}${I}?>`,f=!0;continue}let x=c;x!==""&&(x+=n.indentBy);const P=Ir(p[":@"],n),C=c+`<${m}${P}`,A=Mr(p[m],n,E,x);n.unpairedTags.indexOf(m)!==-1?n.suppressUnpairedNode?l+=C+">":l+=C+"/>":(!A||A.length===0)&&n.suppressEmptyNode?l+=C+"/>":A&&A.endsWith(">")?l+=C+`>${A}${c}</${m}>`:(l+=C+">",A&&c!==""&&(A.includes("/>")||A.includes("</"))?l+=c+n.indentBy+A+c:l+=A,l+=`</${m}>`),f=!0}return l}function us(r){const n=Object.keys(r);for(let s=0;s<n.length;s++){const c=n[s];if(r.hasOwnProperty(c)&&c!==":@")return c}}function Ir(r,n){let s="";if(r&&!n.ignoreAttributes)for(let c in r){if(!r.hasOwnProperty(c))continue;let l=n.attributeValueProcessor(c,r[c]);l=jr(l,n),l===!0&&n.suppressBooleanAttributes?s+=` ${c.substr(n.attributeNamePrefix.length)}`:s+=` ${c.substr(n.attributeNamePrefix.length)}="${l}"`}return s}function fs(r,n){r=r.substr(0,r.length-n.textNodeName.length-1);let s=r.substr(r.lastIndexOf(".")+1);for(let c in n.stopNodes)if(n.stopNodes[c]===r||n.stopNodes[c]==="*."+s)return!0;return!1}function jr(r,n){if(r&&r.length>0&&n.processEntities)for(let s=0;s<n.entities.length;s++){const c=n.entities[s];r=r.replace(c.regex,c.val)}return r}const ds={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(r,n){return n},attributeValueProcessor:function(r,n){return n},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function at(r){this.options=Object.assign({},ds,r),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=Rr(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=gs),this.processTextOrObjNode=hs,this.options.format?(this.indentate=ps,this.tagEndChar=`>
|
|
36
36
|
`,this.newLine=`
|
|
37
|
-
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}at.prototype.build=function(r){return this.options.preserveOrder?ls(r,this.options):(Array.isArray(r)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(r={[this.options.arrayNodeName]:r}),this.j2x(r,0,[]).val)},at.prototype.j2x=function(r,n,s){let c="",l="";const f=s.join(".");for(let g in r)if(Object.prototype.hasOwnProperty.call(r,g))if(typeof r[g]>"u")this.isAttribute(g)&&(l+="");else if(r[g]===null)this.isAttribute(g)||g===this.options.cdataPropName?l+="":g[0]==="?"?l+=this.indentate(n)+"<"+g+"?"+this.tagEndChar:l+=this.indentate(n)+"<"+g+"/"+this.tagEndChar;else if(r[g]instanceof Date)l+=this.buildTextValNode(r[g],g,"",n);else if(typeof r[g]!="object"){const p=this.isAttribute(g);if(p&&!this.ignoreAttributesFn(p,f))c+=this.buildAttrPairStr(p,""+r[g]);else if(!p)if(g===this.options.textNodeName){let m=this.options.tagValueProcessor(g,""+r[g]);l+=this.replaceEntitiesValue(m)}else l+=this.buildTextValNode(r[g],g,"",n)}else if(Array.isArray(r[g])){const p=r[g].length;let m="",E="";for(let x=0;x<p;x++){const P=r[g][x];if(!(typeof P>"u"))if(P===null)g[0]==="?"?l+=this.indentate(n)+"<"+g+"?"+this.tagEndChar:l+=this.indentate(n)+"<"+g+"/"+this.tagEndChar;else if(typeof P=="object")if(this.options.oneListGroup){const C=this.j2x(P,n+1,s.concat(g));m+=C.val,this.options.attributesGroupName&&P.hasOwnProperty(this.options.attributesGroupName)&&(E+=C.attrStr)}else m+=this.processTextOrObjNode(P,g,n,s);else if(this.options.oneListGroup){let C=this.options.tagValueProcessor(g,P);C=this.replaceEntitiesValue(C),m+=C}else m+=this.buildTextValNode(P,g,"",n)}this.options.oneListGroup&&(m=this.buildObjectNode(m,g,E,n)),l+=m}else if(this.options.attributesGroupName&&g===this.options.attributesGroupName){const p=Object.keys(r[g]),m=p.length;for(let E=0;E<m;E++)c+=this.buildAttrPairStr(p[E],""+r[g][p[E]])}else l+=this.processTextOrObjNode(r[g],g,n,s);return{attrStr:c,val:l}},at.prototype.buildAttrPairStr=function(r,n){return n=this.options.attributeValueProcessor(r,""+n),n=this.replaceEntitiesValue(n),this.options.suppressBooleanAttributes&&n==="true"?" "+r:" "+r+'="'+n+'"'};function hs(r,n,s,c){const l=this.j2x(r,s+1,c.concat(n));return r[this.options.textNodeName]!==void 0&&Object.keys(r).length===1?this.buildTextValNode(r[this.options.textNodeName],n,l.attrStr,s):this.buildObjectNode(l.val,n,l.attrStr,s)}at.prototype.buildObjectNode=function(r,n,s,c){if(r==="")return n[0]==="?"?this.indentate(c)+"<"+n+s+"?"+this.tagEndChar:this.indentate(c)+"<"+n+s+this.closeTag(n)+this.tagEndChar;{let l="</"+n+this.tagEndChar,f="";return n[0]==="?"&&(f="?",l=""),(s||s==="")&&r.indexOf("<")===-1?this.indentate(c)+"<"+n+s+f+">"+r+l:this.options.commentPropName!==!1&&n===this.options.commentPropName&&f.length===0?this.indentate(c)+`<!--${r}-->`+this.newLine:this.indentate(c)+"<"+n+s+f+this.tagEndChar+r+this.indentate(c)+l}},at.prototype.closeTag=function(r){let n="";return this.options.unpairedTags.indexOf(r)!==-1?this.options.suppressUnpairedNode||(n="/"):this.options.suppressEmptyNode?n="/":n=`></${r}`,n},at.prototype.buildTextValNode=function(r,n,s,c){if(this.options.cdataPropName!==!1&&n===this.options.cdataPropName)return this.indentate(c)+`<![CDATA[${r}]]>`+this.newLine;if(this.options.commentPropName!==!1&&n===this.options.commentPropName)return this.indentate(c)+`<!--${r}-->`+this.newLine;if(n[0]==="?")return this.indentate(c)+"<"+n+s+"?"+this.tagEndChar;{let l=this.options.tagValueProcessor(n,r);return l=this.replaceEntitiesValue(l),l===""?this.indentate(c)+"<"+n+s+this.closeTag(n)+this.tagEndChar:this.indentate(c)+"<"+n+s+">"+l+"</"+n+this.tagEndChar}},at.prototype.replaceEntitiesValue=function(r){if(r&&r.length>0&&this.options.processEntities)for(let n=0;n<this.options.entities.length;n++){const s=this.options.entities[n];r=r.replace(s.regex,s.val)}return r};function ps(r){return this.options.indentBy.repeat(r)}function gs(r){return r.startsWith(this.options.attributeNamePrefix)&&r!==this.options.textNodeName?r.substr(this.attrPrefixLen):!1}const vs=N.forwardRef(({fillMode:r="height",svg:n,shouldStripClasses:s=!0,shouldStripExtraneousAttributes:c=!0,shouldStripIds:l=!0,shouldStripPosition:f=!0,shouldStripStyles:g=!0,whitelistedAttributes:p=["viewBox"],...m},E)=>{const x="@_",P=()=>{const C=new as({attributeNamePrefix:x,ignoreAttributes:!1,ignoreDeclaration:!0,ignorePiTags:!0,removeNSPrefix:!0,trimValues:!0,updateTag:(U,G,K)=>{if(g&&U.toLowerCase()==="style")return!1;const W=Object.keys(K);for(const j of W)U.toLowerCase()==="svg"&&(f&&j.toLowerCase()===`${x}x`&&delete K[j],f&&j.toLowerCase()===`${x}y`&&delete K[j],r!=="preserve"&&(j.toLowerCase()===`${x}width`&&delete K[j],j.toLowerCase()===`${x}height`&&delete K[j])),l&&j.toLowerCase()===`${x}id`&&delete K[j],s&&j.toLowerCase()===`${x}class`&&delete K[j],g&&j.toLowerCase()===`${x}style`&&delete K[j];if(U.toLowerCase()==="svg")switch(r){case"fill":K[`${x}width`]="100%",K[`${x}height`]="100%";break;case"width":K[`${x}width`]="100%",K[`${x}height`]="auto";break;case"height":K[`${x}width`]="auto",K[`${x}height`]="100%";break}return U}}),A=new at({attributeNamePrefix:x,format:!0,ignoreAttributes:!1}),I=C.parse(n);return A.build(I)};return k.jsx("figure",{...m,ref:E,dangerouslySetInnerHTML:{__html:P()},role:"img"})}),_r="base-",ms=N.forwardRef(({alignSections:r=!1,children:n,className:s,horizontalSpacing:c=0,isReversed:l=!1,orientation:f="vertical",sections:g=3,verticalSpacing:p=0,...m},E)=>{const x=N.useRef(null),[P,C]=N.useState(NaN),[A,I]=N.useState(NaN),[U,G]=N.useState(NaN),[K,W]=N.useState(NaN),j=()=>le.from(x.current)?.width??0,Y=()=>le.from(x.current)?.height??0,ee=()=>{const se=x.current;if(!se)return;const ae=se.children,D=g;if(D<=0)throw new Error("You must specifiy a minimum of 1 section(s) (a.k.a. row(s) for horizontal orientation, column(s) for vertical orientation) for a MasonryGrid instance");if(f==="vertical"){const te=[...new Array(D)].map(()=>0);for(const z of Array.from(ae)){if(!(z instanceof HTMLElement))continue;const R=Lr(z,g),[B,J]=zr(te,R);z.role="gridcell",z.style.position="absolute",z.style.width=`calc(${100/D*R}% - ${c*(D-1)/D*R}px + ${c*(R-1)}px)`,z.style.height="",z.style.left=`calc(${100/D*B}% - ${c*(D-1)/D*B}px + ${c*B}px)`,z.style.top=`${J+(J===0?0:p)}px`;for(let re=0;re<R;re++)te[B+re]=J+(J===0?0:p)+(le.from(z)?.height??0);if(r&&B+R===D){const re=kt(te);for(let Z=0;Z<D;Z++)te[Z]=re}}const Q=j(),L=kt(te,D);if(C(Q),I(L),isNaN(L)||(se.style.height=`${L}px`),l)for(const z of Array.from(ae))z instanceof HTMLElement&&(z.style.left=`calc(${Q}px - ${z.style.left} - ${z.getBoundingClientRect().width}px)`)}else{const te=[...new Array(D)].map(()=>0);for(const z of Array.from(ae)){if(!(z instanceof HTMLElement))continue;const R=Lr(z,g),[B,J]=zr(te,R);z.style.position="absolute",z.style.width="",z.style.height=`calc(${100/D*R}% - ${p*(D-1)/D*R}px + ${p*(R-1)}px)`,z.style.top=`calc(${100/D*B}% - ${p*(D-1)/D*B}px + ${p*B}px)`,z.style.left=`${J+(J===0?0:c)}px`;for(let re=0;re<R;re++)te[B+re]=J+(J===0?0:c)+(le.from(z)?.width??0);if(r&&B+R===D){const re=kt(te);for(let Z=0;Z<D;Z++)te[Z]=re}}const Q=Y(),L=kt(te,D);if(I(Q),C(L),isNaN(L)||(se.style.width=`${L}px`),l)for(const z of Array.from(ae))z instanceof HTMLElement&&(z.style.top=`calc(${Q}px - ${z.style.top} - ${z.getBoundingClientRect().height}px)`)}};Vt(x,{onResize:se=>{const ae=le.from(se)?.size??Ae.make(),D=j(),te=Y();(P!==D||A!==te||ae.width!==U||ae.height!==K)&&(ee(),G(ae.width),W(ae.height))}},[r,c,l,g,p,f]),N.useEffect(()=>{const se=ws(x.current?.innerHTML);if(se.length===0)return ee();const ae=se.length;for(let D=0;D<ae;D++){const te=se[D],Q=new Image;Q.src=te,Q.onload=()=>ee()}},[n]);const H=ys({orientation:f}),T=bs({orientation:f,minHeight:A,minWidth:P});return k.jsx("div",{...m,ref:E,className:he(s,H.root),role:"grid",children:k.jsx("div",{ref:x,style:T.body,children:n})})});function ys({orientation:r="horizontal"}){return{root:he(r)}}function bs({orientation:r="horizontal",minHeight:n=NaN,minWidth:s=NaN}){return{body:{height:r==="horizontal"?"100%":"auto",minHeight:r==="vertical"&&!isNaN(n)?`${n}px`:"",minWidth:r==="horizontal"&&!isNaN(s)?`${s}px`:"",padding:"0",width:r==="horizontal"?"auto":"100%"}}}function zr(r,n){const s=r.length;let c=NaN,l=1/0;for(let f=0;f<s;f++){const g=r[f],p=g<l,m=f+n<=s;let E=!0;for(let x=1;x<n;x++)r[f+x]>g&&(E=!1);p&&m&&E&&(c=f,l=g)}return isNaN(c)?[0,kt(r,n)]:[c,l]}function kt(r,n){let s=r;return n!=null&&!isNaN(n)&&(s=s.slice(0,Math.max(1,Math.min(n,r.length)))),s.reduce((c,l,f)=>l>c?l:c,0)}function Lr(r,n){const s=r.classList;for(const c of Array.from(s))if(c.startsWith(_r)){const l=parseFloat(c.replace(_r,""));if(!isNaN(l))return Math.min(Math.max(l,1),n)}return 1}function ws(r){if(!r)return[];const n=/<img.*?src=(["'])(.*?)\1/g,s=/<img.*?src=(["'])(.*?)\1/,c=n.exec(r)??[],l=[];for(const f of c){const g=s.exec(f)?.[2];g&&l.push(g)}return l}const xs=N.forwardRef(({index:r=0,isDisabled:n=!1,options:s,onChange:c,...l},f)=>{const g=s.length-1,p=s[r],m=typeof p=="string"?p:p?.label,E=()=>{if(n)return;const x=r<g?r+1:0,P=s[x],C=typeof P=="string"?P:P?.value;c?.(C,x)};return k.jsx("button",{...l,ref:f,"aria-disabled":n,"aria-label":m,disabled:n,onClick:E,children:m})}),Fr=N.forwardRef(({angle:r=0,speed:n=1,src:s,zeroAnchor:c=0,onAngleChange:l,onPositionChange:f,onDragStart:g,onDragEnd:p,onLoadImageStart:m,onLoadImageComplete:E,onLoadImageError:x,onImageSizeChange:P,...C},A)=>{const I=(se,ae,D)=>se-ae*n,U=N.useRef(null),G=st(U),K=an({src:s},{onLoadStart:m,onLoadComplete:E,onLoadError:x}),[W,j]=N.useState(r),{isDragging:[Y],value:[ee,H]}=mt(U,{initialValue:0,transform:I,onDragStart:g,onDragEnd:p});N.useEffect(()=>{if(Y||!K)return;const se=Ss(r,K,G.size,c);se!==ee&&H(se),r!==W&&j(r)},[r,K,G.width,G.height,c]),N.useEffect(()=>{if(!Y||!K)return;const se=Ts(ee,K,G.size,c);W!==se&&j(se)},[ee,K,G.width,G.height,c]),N.useEffect(()=>{l?.(W,Y),f?.(W/360,Y)},[W]),N.useEffect(()=>{P?.(K)},[K?.width,K?.height]);const T=Es({src:s,displacement:ee});return k.jsx("div",{...C,ref:A,"aria-valuenow":W,role:"slider",children:k.jsx("div",{ref:U,style:T.body})})});function Es({src:r="",displacement:n=NaN}){return{body:{backgroundImage:`url(${r})`,backgroundPositionX:`${-n}px`,backgroundRepeat:"repeat",backgroundSize:"auto 100%",height:"100%",touchAction:"none",width:"100%"}}}function Br(r,n){const{width:s,height:c}=r,{height:l}=n;if(c<=0)return Ae.make();const g=l/c*s;return new Ae([g,l])}function Ss(r,n,s,c){const{width:l}=Br(n,s),{width:f}=s,g=f*c;return r/360*l-g}function Ts(r,n,s,c){const{width:l}=Br(n,s),{width:f}=s,g=f*c;let p=(r+g)%l/l*360;for(;p<0;)p+=360;return p}const Ns=N.forwardRef(({className:r,style:n,angle:s=0,autoDimension:c="width",children:l,fov:f,speed:g=1,src:p,viewportSize:m,zeroAnchor:E=0,onAngleChange:x,onDragEnd:P,onDragStart:C,onLoadImageComplete:A,onLoadImageError:I,onLoadImageStart:U,onImageSizeChange:G,onPositionChange:K,...W},j)=>{const Y=()=>{if(!te)return 0;const{width:xe,height:Se}=te;return Se===0?0:xe/Se},ee=()=>{const xe=Math.min(360,Math.max(0,f??(m?m.width/(m.height*R)*360:0)));return D.width*(xe/360)},H=()=>D.width<=0?E:((D.width-B)*.5+E*B)/D.width,T=()=>{z(!0),C?.()},se=()=>{z(!1),P?.()},ae=N.useRef(null),D=st(ae),[te,Q]=N.useState(),[L,z]=N.useState(!1),R=Y(),B=ee(),J=H(),re=Ge(l,{track:Yt,reticle:wn,indicator:xn}),Z=ks({autoDimension:c,panoramaRect:D,aspectRatio:R,reticleWidth:B});return k.jsxs("div",{...W,ref:j,className:he(r,{dragging:L}),style:fe(n,Z.root),children:[k.jsx(Fr,{ref:ae,angle:s,speed:g,src:p,style:Z.panorama,zeroAnchor:J,onAngleChange:x,onDragEnd:se,onDragStart:T,onImageSizeChange:Q,onLoadImageComplete:A,onLoadImageError:I,onLoadImageStart:U,onPositionChange:K}),k.jsx("div",{style:Z.body,children:k.jsxs("div",{style:Z.controls,children:[Pe(re.track??k.jsx(Yt,{}),{className:he({dragging:L}),style:fe(Z.track)}),Pe(re.reticle??k.jsx(wn,{}),{className:he({dragging:L}),style:fe(Z.reticle)}),Pe(re.track??k.jsx(Yt,{}),{className:he({dragging:L}),style:fe(Z.track)})]})}),Pe(re.indicator??k.jsx(xn,{}),{className:he({dragging:L}),style:fe(Z.indicator)})]})}),Yt=N.forwardRef(({...r},n)=>k.jsx("div",{...r,ref:n})),wn=N.forwardRef(({...r},n)=>k.jsx("div",{...r,ref:n})),xn=N.forwardRef(({...r},n)=>k.jsx("div",{...r,ref:n}));function ks({autoDimension:r="width",panoramaRect:n=le.make(),aspectRatio:s=0,reticleWidth:c=0}){return{root:{...r==="width"?{width:`${n.height*s}px`}:{height:`${n.width/s}px`}},body:{height:"100%",left:"0",overflow:"hidden",pointerEvents:"none",position:"absolute",top:"0",width:"100%"},panorama:{height:"100%",width:"100%"},controls:{alignItems:"center",display:"flex",height:"100%",justifyContent:"flex-start",left:"0",overflow:"visible",position:"absolute",top:"0",width:"100%"},track:{flex:"1 0 auto"},reticle:{width:`${c}px`},indicator:{width:`${c}px`}}}const Ps=N.forwardRef(({children:r,className:n,decimalPlaces:s=2,knobHeight:c=28,knobPadding:l=0,knobWidth:f=40,max:g,min:p,orientation:m="vertical",range:E,steps:x=-1,onRangeChange:P,...C},A)=>{const I=de=>(de-p)/(g-p),U=de=>de/(m==="horizontal"?H.width:H.height),G=de=>de*(g-p)+p,K=de=>G(U(de)),W=de=>de*(m==="horizontal"?H.width:H.height),j=de=>W(I(de)),Y=de=>{const Ee=Z.length;let ve=0,Te=1/0;for(let X=0;X<Ee;X++){const Me=Z[X],Ce=Math.abs(de-Me);Ce<Te&&(Te=Ce,ve=X)}return Z[ve]},ee=N.useRef(null),H=st(ee),T=N.useRef(null),se=N.useRef(null),[ae,D]=N.useState(E??[p,g]),{isDragging:[te],isReleasing:[Q],value:[L,z]}=mt(T,{initialValue:E?.[0]??p,transform:(de,Ee,ve)=>{const Te=m==="horizontal"?Ee:ve,X=j(p),Me=j(ae[1]),Ce=j(de)+Te;return K(Math.max(X,Math.min(Me,Ce)))}},[p,m,H.size.width,H.size.height,ae[1]]),{isDragging:[R],isReleasing:[B],value:[J,re]}=mt(se,{initialValue:E?.[1]??g,transform:(de,Ee,ve)=>{const Te=m==="horizontal"?Ee:ve,X=j(ae[0]),Me=j(g),Ce=j(de)+Te;return K(Math.max(X,Math.min(Me,Ce)))}},[g,m,H.size.width,H.size.height,ae[0]]),Z=[p,...[...Array(x)].map((de,Ee)=>p+(Ee+1)*(g-p)/(1+x)),g],[xe,Se]=ae.map(j),Be=Se-xe;N.useEffect(()=>{ae[0]!==L&&(D([L,ae[1]]),P?.(ae))},[L]),N.useEffect(()=>{ae[1]!==J&&(D([ae[0],J]),P?.(ae))},[J]),N.useEffect(()=>{te||R||et(E,ae)||(D(E??[p,g]),z(E?.[0]??p),re(E?.[1]??g))},[E?.[0],E?.[1]]),N.useEffect(()=>{x<0||z(Y(L))},[Q]),N.useEffect(()=>{x<0||!B||re(Y(J))},[B]);const ce=Ge(r,{gutter:En,highlight:Sn,knob:Xt,label:Vr}),q=Os({orientation:m,highlightLength:Be,start:xe,knobPadding:l,knobWidth:f,knobHeight:c});return k.jsx("div",{...C,ref:A,"aria-valuemax":g,"aria-valuemin":p,className:he(n,m),role:"slider",children:k.jsxs("div",{ref:ee,style:q.body,children:[Pe(ce.gutter??k.jsx(En,{}),{style:fe(q.gutter)}),Pe(ce.highlight??k.jsx(Sn,{}),{style:fe(q.highlight)}),Pe(ce.knob??k.jsx(Xt,{style:fe({transitionProperty:Q?"opacity, transform":"opacity"})}),{ref:T,disabled:et([L,J],[g,g]),className:he({dragging:te,releasing:Q}),style:fe(q.knob,{pointerEvents:et([L,J],[p,p])?"none":"auto"},m==="horizontal"?{marginTop:`${-c/2+H.height/2}px`,marginLeft:`${xe-f/2}px`}:{marginTop:`${xe-c/2}px`,marginLeft:`${-f/2+H.width/2}px`})},k.jsx("div",{style:q.knobHitbox}),ce.label&&Pe(ce.label,{className:he({dragging:te||R,releasing:Q||B}),style:fe(q.label)},Number(L.toFixed(s)).toLocaleString())),Pe(ce.knob??k.jsx(Xt,{style:fe({transitionProperty:B?"opacity, transform":"opacity"})}),{ref:se,disabled:et([L,J],[g,g]),className:he({dragging:R,releasing:R}),style:fe(q.knob,{pointerEvents:et([L,J],[g,g])?"none":"auto"},m==="horizontal"?{marginTop:`${-c/2+H.height/2}px`,marginLeft:`${Se-f/2}px`}:{marginTop:`${Se-c/2}px`,marginLeft:`${-f/2+H.width/2}px`})},k.jsx("div",{style:q.knobHitbox}),ce.label&&Pe(ce.label,{className:he({dragging:R,releasing:B}),style:fe(q.label)},Number(J.toFixed(s)).toLocaleString()))]})})}),En=N.forwardRef(({...r},n)=>k.jsx("div",{...r,ref:n})),Vr=N.forwardRef(({...r},n)=>k.jsx("div",{...r,ref:n})),Sn=N.forwardRef(({...r},n)=>k.jsx("div",{...r,ref:n})),Xt=N.forwardRef(({...r},n)=>k.jsx("div",{...r,ref:n}));function Os({orientation:r="horizontal",knobWidth:n=0,knobHeight:s=0,highlightLength:c=0,start:l=0,knobPadding:f=0}){return{body:{height:"100%",width:"100%"},gutter:{display:"block",top:"0",left:"0",position:"absolute",width:"100%",height:"100%"},highlight:{height:"100%",left:"0",position:"absolute",top:"0",...r==="horizontal"?{width:`${c}px`,transform:`translate3d(${l}px, 0, 0)`}:{height:`${c}px`,transform:`translate3d(0, ${l}px, 0)`}},knob:{bottom:"0",left:"0",margin:"auto",position:"absolute",right:"0",width:`${n}px`,height:`${s}px`,top:"0",touchAction:"none",zIndex:"1"},knobHitbox:{background:"transparent",height:`calc(100% + ${f*2}px)`,left:`-${f}px`,padding:`${f}px`,position:"absolute",top:`-${f}px`,width:`calc(100% + ${f*2}px)`},label:{pointerEvents:"none",position:"relative",userSelect:"none"}}}const Cs=N.forwardRef(({children:r,className:n,isDeselectable:s=!1,isDisabled:c=!1,isSelected:l=!1,label:f,onDeselect:g,onSelect:p,onToggle:m,...E},x)=>{const P=()=>{if(!c)if(l){if(!s)return;m?.(l),g?.()}else m?.(l),p?.()};return k.jsx("button",{...E,ref:x,"aria-disabled":c,"aria-label":f,"aria-selected":l,className:he(n,{active:l,disabled:c||l&&!s}),disabled:c||l&&!s,onClick:P,children:r??f})}),Rs=N.forwardRef(({children:r,className:n,isInverted:s=!1,isTrackInteractive:c=!0,knobHeight:l=30,knobWidth:f=30,onlyDispatchesOnDragEnd:g=!1,orientation:p="vertical",position:m=0,trackPadding:E=0,labelProvider:x,onDragEnd:P,onDragStart:C,onPositionChange:A,...I},U)=>{const G=(z,R,B)=>{const J=le.from(W.current)??le.make(),re=s?1-z:z,Z=re*J.width+R,xe=re*J.height+B,Se=p==="vertical"?Math.max(0,Math.min(1,xe/J.height)):Math.max(0,Math.min(1,Z/J.width));return s?1-Se:Se},K=z=>{if(!c)return;const R=le.from(W.current)??le.make(),B=le.fromViewport();switch(p){case"horizontal":{const J=(z.clientX+B.left-R.left)/R.width,re=s?1-J:J;T(re);break}case"vertical":{const J=(z.clientY+B.top-R.top)/R.height,re=s?1-J:J;T(re);break}}},W=N.useRef(null),j=N.useRef(null),{isDragging:[Y],isReleasing:[ee],value:[H,T]}=mt(j,{initialValue:m,transform:G,onDragStart:C,onDragEnd:P},[s,p]),se=s?1-H:H,ae=s?H===0:H===1,D=s?H===1:H===0;N.useEffect(()=>{Y||m===H||T(m)},[m]),N.useEffect(()=>{Y&&g||A?.(H,Y)},[H]),N.useEffect(()=>{Y||!g||A?.(H,!0)},[Y]);const te=Ge(r,{knob:Tn,label:Nn,track:Dt}),Q=As({orientation:p,isAtEnd:ae,isAtStart:D,isDragging:Y,isReleasing:ee}),L=Ms({orientation:p,isDragging:Y,naturalPosition:se,knobHeight:l,knobWidth:f,isTrackInteractive:c});return k.jsx("div",{...I,ref:U,"aria-orientation":p,"aria-valuenow":H,className:he(n,Q.root),role:"slider",children:k.jsxs("div",{ref:W,style:L.body,children:[Pe(te.track??k.jsx(Dt,{}),{className:he("start",Q.track),style:fe(L.track,p==="vertical"?{height:`calc(${se*100}% - ${E<=0?0:l*.5}px - ${E}px)`,top:"0"}:{left:"0",width:`calc(${se*100}% - ${E<=0?0:f*.5}px - ${E}px)`}),onClick:K},k.jsx("div",{style:L.trackHitbox})),Pe(te.track??k.jsx(Dt,{}),{className:he("end",Q.track),style:fe(L.track,p==="vertical"?{bottom:"0",height:`calc(${(1-se)*100}% - ${E<=0?0:l*.5}px - ${E}px)`}:{right:"0",width:`calc(${(1-se)*100}% - ${E<=0?0:f*.5}px - ${E}px)`}),onClick:K},k.jsx("div",{style:L.trackHitbox})),k.jsx("button",{ref:j,style:L.knobContainer,children:Pe(te.knob??k.jsx(Tn,{}),{className:he(Q.knob),style:fe(L.knob)},x&&Pe(te.label??k.jsx(Nn,{}),{className:he(Q.label),style:fe(L.label)},x(H)))})]})})}),Dt=({...r})=>k.jsx("div",{...r}),Tn=({...r})=>k.jsx("div",{...r}),Nn=({...r})=>k.jsx("div",{...r});function As({orientation:r="vertical",isAtEnd:n=!1,isAtStart:s=!1,isDragging:c=!1,isReleasing:l=!1}){return{root:he(r,{"at-end":n,"at-start":s,dragging:c,releasing:l}),track:he(r,{"at-end":n,"at-start":s,dragging:c,releasing:l}),knob:he(r,{"at-end":n,"at-start":s,dragging:c,releasing:l}),label:he(r,{"at-end":n,"at-start":s,dragging:c,releasing:l})}}function Ms({orientation:r="vertical",isDragging:n=!1,naturalPosition:s=0,knobHeight:c=0,knobWidth:l=0,isTrackInteractive:f=!0}){return{body:{height:"100%",width:"100%"},knobContainer:{background:"none",border:"none",outline:"none",position:"absolute",transform:"translate3d(-50%, -50%, 0)",zIndex:"1",...r==="vertical"?{left:"50%",top:`${s*100}%`,transition:n===!1?"top 100ms ease-out":"none"}:{left:`${s*100}%`,top:"50%",transition:n===!1?"left 100ms ease-out":"none"}},knob:{height:`${c}px`,touchAction:"none",width:`${l}px`},label:{pointerEvents:"none",userSelect:"none"},track:{cursor:f?"pointer":"auto",pointerEvents:f?"auto":"none",position:"absolute",...r==="vertical"?{left:"0",margin:"0 auto",right:"0",width:"100%"}:{bottom:"0",height:"100%",margin:"auto 0",top:"0"}},trackHitbox:{height:"100%",minHeight:"20px",minWidth:"20px",position:"absolute",transform:r==="horizontal"?"translate3d(0, -50%, 0)":"translate3d(-50%, 0, 0)",width:"100%"}}}const Is=N.forwardRef(({children:r,className:n,index:s=0,isInverted:c=!1,isTrackInteractive:l=!0,knobHeight:f=30,knobWidth:g=30,labelProvider:p,onlyDispatchesOnDragEnd:m=!1,orientation:E="vertical",steps:x=js(10),trackPadding:P=0,onDragEnd:C,onDragStart:A,onIndexChange:I,onPositionChange:U,...G},K)=>{const W=(re,Z,xe)=>{const Se=le.from(Y.current)??le.make(),Be=c?1-re:re,ce=Be*Se.width+Z,q=Be*Se.height+xe,de=E==="vertical"?Math.max(0,Math.min(1,q/Se.height)):Math.max(0,Math.min(1,ce/Se.width));return c?1-de:de},j=re=>{if(!l)return;const Z=le.from(Y.current)??le.make();switch(E){case"horizontal":{const xe=(re.clientX-Z.left)/Z.width,Se=c?1-xe:xe;te(Se);break}case"vertical":{const xe=(re.clientY-Z.top)/Z.height,Se=c?1-xe:xe;te(Se);break}}},Y=N.useRef(null),ee=N.useRef(null),[H,T]=N.useState(s),{isDragging:[se],isReleasing:[ae],value:[D,te]}=mt(ee,{initialValue:Ut(s,x),transform:W,onDragStart:A,onDragEnd:C},[c,E]),Q=c?1-D:D,L=c?D===0:D===1,z=c?D===1:D===0,R=Ge(r,{knob:kn,label:Pn,track:Wt}),B=_s({orientation:E,isAtEnd:L,isAtStart:z,isDragging:se,isReleasing:ae}),J=zs({orientation:E,naturalPosition:Q,isDragging:se,knobHeight:f,knobWidth:g,isTrackInteractive:l});return N.useEffect(()=>{if(se)return;const re=Ut(s,x);D!==re&&te(re),s!==H&&T(s)},[s]),N.useEffect(()=>{if(se&&m)return;U?.(D,se);const re=On(D,x);H!==re&&T(re)},[D]),N.useEffect(()=>{I?.(H,se)},[H]),N.useEffect(()=>{if(se)return;const re=On(D,x),Z=Ut(re,x);(Z!==D||m)&&(te(Z),U?.(Z,!0))},[se]),k.jsx("div",{...G,ref:K,"aria-valuenow":H,className:he(n,B.root),role:"slider",children:k.jsxs("div",{ref:Y,style:J.body,children:[Pe(R.track??k.jsx(Wt,{}),{className:he("start",B.track),style:fe(J.track,E==="vertical"?{height:`calc(${Q*100}% - ${P<=0?0:f*.5}px - ${P}px)`,top:"0"}:{left:"0",width:`calc(${Q*100}% - ${P<=0?0:g*.5}px - ${P}px)`}),onClick:j},k.jsx("div",{style:J.trackHitbox})),Pe(R.track??k.jsx(Wt,{}),{className:he("end",B.track),style:fe(J.track,E==="vertical"?{bottom:"0",height:`calc(${(1-Q)*100}% - ${P<=0?0:f*.5}px - ${P}px)`}:{right:"0",width:`calc(${(1-Q)*100}% - ${P<=0?0:g*.5}px - ${P}px)`}),onClick:j},k.jsx("div",{style:J.trackHitbox})),k.jsx("button",{ref:ee,style:J.knobContainer,children:Pe(R.knob??k.jsx(kn,{}),{className:he(B.knob),style:fe(J.knob)},x&&p&&Pe(R.label??k.jsx(Pn,{}),{className:he(B.label),style:fe(J.label)},p(D,On(D,x))))})]})})}),Wt=({...r})=>k.jsx("div",{...r}),kn=({...r})=>k.jsx("div",{...r}),Pn=({...r})=>k.jsx("div",{...r});function js(r){if(Math.round(r)!==r)throw new Error("`length` value must be an integer");const n=1/(r-1);return Array(r).fill(null).map((s,c)=>n*c)}function On(r,n){let s=-1,c=NaN;for(let l=0,f=n.length;l<f;l++){const g=Ut(l,n);if(isNaN(g))continue;const p=Math.abs(r-g);(isNaN(c)||p<c)&&(c=p,s=l)}return s}function Ut(r,n){return r>=n.length?NaN:n[r]}function _s({orientation:r="vertical",isAtEnd:n=!1,isAtStart:s=!1,isDragging:c=!1,isReleasing:l=!1}){return{root:he(r,{"at-end":n,"at-start":s,dragging:c,releasing:l}),track:he(r,{"at-end":n,"at-start":s,dragging:c,releasing:l}),knob:he(r,{"at-end":n,"at-start":s,dragging:c,releasing:l}),label:he(r,{"at-end":n,"at-start":s,dragging:c,releasing:l})}}function zs({orientation:r="vertical",naturalPosition:n=0,isDragging:s=!1,knobHeight:c=0,knobWidth:l=0,isTrackInteractive:f=!1}){return{body:{height:"100%",width:"100%"},knobContainer:{background:"none",border:"none",outline:"none",position:"absolute",transform:"translate3d(-50%, -50%, 0)",zIndex:"1",...r==="vertical"?{left:"50%",top:`${n*100}%`,transition:s===!1?"top 100ms ease-out":"none"}:{left:`${n*100}%`,top:"50%",transition:s===!1?"left 100ms ease-out":"none"}},knob:{height:`${c}px`,touchAction:"none",width:`${l}px`},label:{pointerEvents:"none",userSelect:"none"},track:{cursor:f?"pointer":"auto",pointerEvents:f?"auto":"none",position:"absolute",...r==="vertical"?{left:"0",margin:"0 auto",right:"0",width:"100%"}:{bottom:"0",height:"100%",margin:"auto 0",top:"0"}},trackHitbox:{height:"100%",minHeight:"20px",minWidth:"20px",position:"absolute",transform:r==="horizontal"?"translate3d(0, -50%, 0)":"translate3d(-50%, 0, 0)",width:"100%"}}}const Ls=N.forwardRef(({children:r,isEnabled:n=!0,threshold:s=.5,onSwipeDown:c,onSwipeLeft:l,onSwipeRight:f,onSwipeUp:g,...p},m)=>{const[E,x]=N.useState(void 0),[P,C]=N.useState(void 0),[A,I]=N.useState(NaN),U=(j,Y)=>{if(isNaN(j)||isNaN(Y))return W();x(be.make(j,Y))},G=(j,Y)=>{const ee=E;if(ee===void 0)return;const H=ee.x!==j||ee.y!==Y,T=!isNaN(A);H&&(T||I(Date.now()),C(be.make(j,Y)))},K=()=>{const j=A,Y=E,ee=P;if(isNaN(j)||Y===void 0||ee===void 0)return;const H=Date.now()-j,T=ee.x-Y.x,se=ee.y-Y.y,ae=T/H,D=se/H;n&&(Math.abs(ae)>=s&&Math.abs(ae)>Math.abs(D)?ae>0?f?.():l?.():Math.abs(D)>=s&&Math.abs(D)>Math.abs(ae)&&(D>0?c?.():g?.())),W()},W=()=>{x(void 0),C(void 0),I(NaN)};return k.jsx("div",{...p,ref:m,onMouseDown:j=>U(j.clientX,j.clientY),onMouseLeave:()=>W(),onMouseMove:j=>G(j.clientX,j.clientY),onMouseUp:()=>K(),onTouchEnd:()=>K(),onTouchMove:j=>G(j.targetTouches[0].clientX,j.targetTouches[0].clientY),onTouchStart:j=>U(j.targetTouches[0].clientX,j.targetTouches[0].clientY),children:r})});function Fs({children:r,className:n,style:s,alignment:c,arrowHeight:l=6,arrowWidth:f=12,gap:g=4,hint:p,maxWidth:m=200,threshold:E=100}){const x=()=>{const G=document.createElement("span");G.className=he(n),G.innerHTML=p,G.role="tooltip";const K=c??(A.current?Vs(A.current,E):"tl"),W=Bs(G),j=Xs({alignment:K,arrowSize:Ae.make(f,l),gap:g,maxDialogWidth:m,fullDialogWidth:W.width,targetWidth:U.width}),Y=fe(s,j.dialog);Object.keys(Y).forEach(H=>G.style[H]=Y[H]);const ee=document.createElement("span");return Object.keys(j.arrow).forEach(H=>ee.style[H]=j.arrow[H]),G.appendChild(ee),G},P=()=>{I.current&&(I.current.style.opacity="1",I.current.ariaHidden="false")},C=()=>{I.current&&(I.current.style.opacity="0",I.current.ariaHidden="true")},A=N.useRef(null),I=N.useRef(void 0),U=st(A);return N.useEffect(()=>{const G=x();return A.current?.appendChild(G),I.current=G,()=>{A.current?.removeChild(G),I.current=void 0}},[c,l,f,n,g,p,m,s,A.current,E]),k.jsx(tr,{ref:A,onMouseEnter:P,onMouseLeave:C,children:r})}function Bs(r){const n=r.cloneNode(!1);n.innerHTML=r.innerHTML,n.style.visibility="hidden",n.style.whiteSpace="pre",document.body.appendChild(n);const s=n.getBoundingClientRect();return document.body.removeChild(n),Ae.make(s.width,s.height)}function Vs(r,n){const s=le.fromViewport(),c=le.intersecting(r);if(c){const l=c.left-s.left<n,f=s.right-c.right<n,g=c.top-s.top<n,p=s.bottom-c.bottom<n;if(l&&g)return"br";if(l&&p)return"tr";if(f&&g)return"bl";if(f&&p)return"tl";if(l)return"cr";if(f)return"cl";if(p)return"tc"}return"tc"}function Hs({alignment:r,arrowSize:n,fullDialogWidth:s,gap:c,maxDialogWidth:l,targetWidth:f}){const g=Math.min(s,l),p=f>g;switch(r){case"tl":return{bottom:`calc(100% + ${n.height}px + ${c}px)`,right:p?"":"0",left:p?"50%":"",transform:`translate(${g>f?"0":"-50%"}, 0)`};case"tc":return{bottom:`calc(100% + ${n.height}px + ${c}px)`,left:"50%",transform:"translateX(-50%)"};case"tr":return{bottom:`calc(100% + ${n.height}px + ${c}px)`,left:p?"50%":"0",transform:`translate(${g>f?"0":"-50%"}, 0)`};case"cl":return{top:"50%",right:`calc(100% + ${n.height+c}px)`,transform:"translate(0, -50%)"};case"cr":return{top:"50%",left:`calc(100% + ${n.height+c}px)`,transform:"translate(0, -50%)"};case"bl":return{left:p?"50%":"",right:p?"":"0",top:`calc(100% + ${n.height}px + ${c}px)`,transform:`translate(${g>f?"0":"-50%"}, 0)`};case"bc":return{left:"50%",top:`calc(100% + ${n.height}px + ${c}px)`,transform:"translateX(-50%)"};case"br":return{left:p?"50%":"0",top:`calc(100% + ${n.height}px + ${c}px)`,transform:`translate(${g>f?"0":"-50%"}, 0)`};default:throw Error(`Invalid alignment: ${r}`)}}function Ys({alignment:r,arrowSize:n,fullDialogWidth:s,gap:c,maxDialogWidth:l,targetWidth:f}){const g=Math.min(s,l),p=f>g;switch(r){case"tl":return{bottom:0,clipPath:"polygon(50% 100%,100% 0,0 0)",height:`${n.height}px`,left:p?"50%":"",right:p?"":`${f-n.width/2-f/2}px`,transform:`translate(${p?"-50%":"0"}, 100%)`,width:`${n.width}px`};case"tc":return{bottom:0,clipPath:"polygon(50% 100%,100% 0,0 0)",height:`${n.height}px`,left:"50%",transform:"translate(-50%, 100%)",width:`${n.width}px`};case"tr":return{bottom:0,clipPath:"polygon(50% 100%,100% 0,0 0)",height:`${n.height}px`,left:p?"50%":`${f-n.width/2-f/2}px`,transform:`translate(${p?"-50%":"0"}, 100%)`,width:`${n.width}px`};case"cl":return{clipPath:"polygon(0 0,100% 50%,0 100%)",height:`${n.width}px`,right:"0",top:"50%",transform:"translate(100%, -50%)",width:`${n.height}px`};case"cr":return{clipPath:"polygon(100% 0,0 50%,100% 100%)",height:`${n.width}px`,left:"0",top:"50%",transform:"translate(-100%, -50%)",width:`${n.height}px`};case"bl":return{clipPath:"polygon(50% 0,100% 100%,0 100%)",height:`${n.height}px`,left:p?"50%":"",right:p?"":`${f-n.width/2-f/2}px`,top:"0",transform:`translate(${p?"-50%":"0"}, -100%)`,width:`${n.width}px`};case"bc":return{clipPath:"polygon(50% 0,100% 100%,0 100%)",height:`${n.height}px`,left:"50%",top:"0",transform:"translate(-50%, -100%)",width:`${n.width}px`};case"br":return{clipPath:"polygon(50% 0,100% 100%,0 100%)",height:`${n.height}px`,left:p?"50%":`${f-n.width/2-f/2}px`,top:"0",transform:`translate(${p?"-50%":"0"}, -100%)`,width:`${n.width}px`};default:throw Error(`Invalid alignment: ${r}`)}}function Xs({alignment:r,arrowSize:n,fullDialogWidth:s,gap:c,maxDialogWidth:l,targetWidth:f}){return{dialog:{boxSizing:"border-box",height:"auto",margin:"0",opacity:"0",pointerEvents:"none",position:"absolute",userSelect:"none",whiteSpace:s>l?"normal":"pre",width:s>l?`${l}px`:"",...Hs({alignment:r,arrowSize:n,fullDialogWidth:s,gap:c,maxDialogWidth:l,targetWidth:f})},arrow:{background:"inherit",position:"absolute",...Ys({alignment:r,arrowSize:n,fullDialogWidth:s,gap:c,maxDialogWidth:l,targetWidth:f})}}}const Cn=N.createContext(void 0);function Ds({children:r}){const[n,s]=N.useState({minPos:be.make(),maxPos:be.make(),pos:be.make(),step:be.make()});return N.useEffect(()=>{const c=()=>{const l=le.fromViewport(),f=l.clone({x:0,y:0}),g=le.from(window,{overflow:!0});if(!g)return;const p=f.clone({x:g.width-l.width,y:g.height-l.height}),m=be.make(l.left/p.left,l.top/p.top);s({minPos:be.make(f.left,f.top),maxPos:be.make(p.left,p.top),pos:be.make(l.left,l.top),step:m})};return window.addEventListener("scroll",c),window.addEventListener("resize",c),window.addEventListener("orientationchange",c),c(),()=>{window.removeEventListener("scroll",c),window.removeEventListener("resize",c),window.removeEventListener("orientationchange",c)}},[]),k.jsx(Cn.Provider,{value:n,children:r})}function Ws(r){const n=N.useContext(Cn);if(!n)throw Error("Cannot fetch the current scroll position context, is the corresponding provider instated?");if(!r)return{pos:n.pos,step:n.step};const s=r.current,c=le.fromViewport(),l=le.from(s);if(!c||!l)return{pos:be.make(),step:be.make()};const f=c.right-l.left,g=c.bottom-l.top,p=f/l.width,m=g/l.height;return{pos:be.make(f,g),step:be.make(p,m)}}F.Accordion=_o,F.AccordionCollapseIcon=or,F.AccordionExpandIcon=rr,F.AccordionHeader=sn,F.Burger=ir,F.BurgerBar=Ft,F.BurgerButton=Fo,F.BurgerButtonBar=Bo,F.Button=Ho,F.Carousel=ti,F.Collection=on,F.Conditional=Ro,F.Counter=ii,F.CounterAddButton=un,F.CounterSubtractButton=fn,F.CounterTextField=ln,F.CoverImage=si,F.CoverImageContent=mr,F.CoverImageViewport=vr,F.CoverVideo=ai,F.CoverVideoContent=wr,F.CoverVideoViewport=br,F.Dial=ci,F.DialKnob=gn,F.DialTrack=pn,F.Dropdown=fi,F.DropdownCollapseIcon=Sr,F.DropdownExpandIcon=Er,F.DropdownToggle=vn,F.Each=zt,F.ExtractChild=tr,F.ExtractChildren=Io,F.FlatSVG=vs,F.Image=gr,F.MasonryGrid=ms,F.OptionButton=xs,F.Panorama=Fr,F.PanoramaSlider=Ns,F.PanoramaSliderIndicator=xn,F.PanoramaSliderReticle=wn,F.PanoramaSliderTrack=Yt,F.RangeSlider=Ps,F.RangeSliderGutter=En,F.RangeSliderHighlight=Sn,F.RangeSliderKnob=Xt,F.RangeSliderLabel=Vr,F.Repeat=rn,F.ScrollPositionContext=Cn,F.ScrollPositionProvider=Ds,F.SelectableButton=Cs,F.Slider=Rs,F.SliderKnob=Tn,F.SliderLabel=Nn,F.SliderTrack=Dt,F.StepwiseSlider=Is,F.StepwiseSliderKnob=kn,F.StepwiseSliderLabel=Pn,F.StepwiseSliderTrack=Wt,F.SwipeRegion=Ls,F.TextField=pr,F.Video=yr,F.WithTooltip=Fs,F.asClassNameDict=Ao,F.asComponentDict=Ge,F.asStyleDict=Mo,F.cloneStyledElement=Pe,F.styles=fe,F.useClickOutsideEffect=Xo,F.useDragEffect=sr,F.useDragValueEffect=mt,F.useImageSize=an,F.useInterval=Ko,F.useLoadImageEffect=lr,F.useLoadVideoMetadataEffect=ur,F.useMounted=Jo,F.usePrevious=cn,F.useRect=st,F.useResizeEffect=Vt,F.useScrollPosition=Ws,F.useScrollPositionEffect=Zo,F.useSearchParamState=Qo,F.useSize=$o,F.useTimeout=fr,F.useVideoSize=dr,F.useViewportSize=ei,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})});
|
|
37
|
+
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}at.prototype.build=function(r){return this.options.preserveOrder?ls(r,this.options):(Array.isArray(r)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(r={[this.options.arrayNodeName]:r}),this.j2x(r,0,[]).val)},at.prototype.j2x=function(r,n,s){let c="",l="";const f=s.join(".");for(let g in r)if(Object.prototype.hasOwnProperty.call(r,g))if(typeof r[g]>"u")this.isAttribute(g)&&(l+="");else if(r[g]===null)this.isAttribute(g)||g===this.options.cdataPropName?l+="":g[0]==="?"?l+=this.indentate(n)+"<"+g+"?"+this.tagEndChar:l+=this.indentate(n)+"<"+g+"/"+this.tagEndChar;else if(r[g]instanceof Date)l+=this.buildTextValNode(r[g],g,"",n);else if(typeof r[g]!="object"){const p=this.isAttribute(g);if(p&&!this.ignoreAttributesFn(p,f))c+=this.buildAttrPairStr(p,""+r[g]);else if(!p)if(g===this.options.textNodeName){let m=this.options.tagValueProcessor(g,""+r[g]);l+=this.replaceEntitiesValue(m)}else l+=this.buildTextValNode(r[g],g,"",n)}else if(Array.isArray(r[g])){const p=r[g].length;let m="",E="";for(let x=0;x<p;x++){const P=r[g][x];if(!(typeof P>"u"))if(P===null)g[0]==="?"?l+=this.indentate(n)+"<"+g+"?"+this.tagEndChar:l+=this.indentate(n)+"<"+g+"/"+this.tagEndChar;else if(typeof P=="object")if(this.options.oneListGroup){const C=this.j2x(P,n+1,s.concat(g));m+=C.val,this.options.attributesGroupName&&P.hasOwnProperty(this.options.attributesGroupName)&&(E+=C.attrStr)}else m+=this.processTextOrObjNode(P,g,n,s);else if(this.options.oneListGroup){let C=this.options.tagValueProcessor(g,P);C=this.replaceEntitiesValue(C),m+=C}else m+=this.buildTextValNode(P,g,"",n)}this.options.oneListGroup&&(m=this.buildObjectNode(m,g,E,n)),l+=m}else if(this.options.attributesGroupName&&g===this.options.attributesGroupName){const p=Object.keys(r[g]),m=p.length;for(let E=0;E<m;E++)c+=this.buildAttrPairStr(p[E],""+r[g][p[E]])}else l+=this.processTextOrObjNode(r[g],g,n,s);return{attrStr:c,val:l}},at.prototype.buildAttrPairStr=function(r,n){return n=this.options.attributeValueProcessor(r,""+n),n=this.replaceEntitiesValue(n),this.options.suppressBooleanAttributes&&n==="true"?" "+r:" "+r+'="'+n+'"'};function hs(r,n,s,c){const l=this.j2x(r,s+1,c.concat(n));return r[this.options.textNodeName]!==void 0&&Object.keys(r).length===1?this.buildTextValNode(r[this.options.textNodeName],n,l.attrStr,s):this.buildObjectNode(l.val,n,l.attrStr,s)}at.prototype.buildObjectNode=function(r,n,s,c){if(r==="")return n[0]==="?"?this.indentate(c)+"<"+n+s+"?"+this.tagEndChar:this.indentate(c)+"<"+n+s+this.closeTag(n)+this.tagEndChar;{let l="</"+n+this.tagEndChar,f="";return n[0]==="?"&&(f="?",l=""),(s||s==="")&&r.indexOf("<")===-1?this.indentate(c)+"<"+n+s+f+">"+r+l:this.options.commentPropName!==!1&&n===this.options.commentPropName&&f.length===0?this.indentate(c)+`<!--${r}-->`+this.newLine:this.indentate(c)+"<"+n+s+f+this.tagEndChar+r+this.indentate(c)+l}},at.prototype.closeTag=function(r){let n="";return this.options.unpairedTags.indexOf(r)!==-1?this.options.suppressUnpairedNode||(n="/"):this.options.suppressEmptyNode?n="/":n=`></${r}`,n},at.prototype.buildTextValNode=function(r,n,s,c){if(this.options.cdataPropName!==!1&&n===this.options.cdataPropName)return this.indentate(c)+`<![CDATA[${r}]]>`+this.newLine;if(this.options.commentPropName!==!1&&n===this.options.commentPropName)return this.indentate(c)+`<!--${r}-->`+this.newLine;if(n[0]==="?")return this.indentate(c)+"<"+n+s+"?"+this.tagEndChar;{let l=this.options.tagValueProcessor(n,r);return l=this.replaceEntitiesValue(l),l===""?this.indentate(c)+"<"+n+s+this.closeTag(n)+this.tagEndChar:this.indentate(c)+"<"+n+s+">"+l+"</"+n+this.tagEndChar}},at.prototype.replaceEntitiesValue=function(r){if(r&&r.length>0&&this.options.processEntities)for(let n=0;n<this.options.entities.length;n++){const s=this.options.entities[n];r=r.replace(s.regex,s.val)}return r};function ps(r){return this.options.indentBy.repeat(r)}function gs(r){return r.startsWith(this.options.attributeNamePrefix)&&r!==this.options.textNodeName?r.substr(this.attrPrefixLen):!1}const vs=N.forwardRef(({fillMode:r="preserve",svg:n,shouldStripClasses:s=!0,shouldStripExtraneousAttributes:c=!0,shouldStripIds:l=!0,shouldStripPosition:f=!0,shouldStripStyles:g=!0,whitelistedAttributes:p=["viewBox"],...m},E)=>{const x="@_",P=()=>{const C=new as({attributeNamePrefix:x,ignoreAttributes:!1,ignoreDeclaration:!0,ignorePiTags:!0,removeNSPrefix:!0,trimValues:!0,updateTag:(U,G,K)=>{if(g&&U.toLowerCase()==="style")return!1;const W=Object.keys(K);for(const j of W)U.toLowerCase()==="svg"&&(f&&j.toLowerCase()===`${x}x`&&delete K[j],f&&j.toLowerCase()===`${x}y`&&delete K[j],r!=="preserve"&&(j.toLowerCase()===`${x}width`&&delete K[j],j.toLowerCase()===`${x}height`&&delete K[j])),l&&j.toLowerCase()===`${x}id`&&delete K[j],s&&j.toLowerCase()===`${x}class`&&delete K[j],g&&j.toLowerCase()===`${x}style`&&delete K[j];if(U.toLowerCase()==="svg")switch(r){case"fill":K[`${x}width`]="100%",K[`${x}height`]="100%";break;case"width":K[`${x}width`]="100%",K[`${x}height`]="auto";break;case"height":K[`${x}width`]="auto",K[`${x}height`]="100%";break}return U}}),A=new at({attributeNamePrefix:x,format:!0,ignoreAttributes:!1}),I=C.parse(n);return A.build(I)};return k.jsx("figure",{...m,ref:E,dangerouslySetInnerHTML:{__html:P()},role:"img"})}),_r="base-",ms=N.forwardRef(({alignSections:r=!1,children:n,className:s,horizontalSpacing:c=0,isReversed:l=!1,orientation:f="vertical",sections:g=3,verticalSpacing:p=0,...m},E)=>{const x=N.useRef(null),[P,C]=N.useState(NaN),[A,I]=N.useState(NaN),[U,G]=N.useState(NaN),[K,W]=N.useState(NaN),j=()=>le.from(x.current)?.width??0,Y=()=>le.from(x.current)?.height??0,ee=()=>{const se=x.current;if(!se)return;const ae=se.children,D=g;if(D<=0)throw new Error("You must specifiy a minimum of 1 section(s) (a.k.a. row(s) for horizontal orientation, column(s) for vertical orientation) for a MasonryGrid instance");if(f==="vertical"){const te=[...new Array(D)].map(()=>0);for(const z of Array.from(ae)){if(!(z instanceof HTMLElement))continue;const R=Lr(z,g),[B,J]=zr(te,R);z.role="gridcell",z.style.position="absolute",z.style.width=`calc(${100/D*R}% - ${c*(D-1)/D*R}px + ${c*(R-1)}px)`,z.style.height="",z.style.left=`calc(${100/D*B}% - ${c*(D-1)/D*B}px + ${c*B}px)`,z.style.top=`${J+(J===0?0:p)}px`;for(let re=0;re<R;re++)te[B+re]=J+(J===0?0:p)+(le.from(z)?.height??0);if(r&&B+R===D){const re=kt(te);for(let Z=0;Z<D;Z++)te[Z]=re}}const Q=j(),L=kt(te,D);if(C(Q),I(L),isNaN(L)||(se.style.height=`${L}px`),l)for(const z of Array.from(ae))z instanceof HTMLElement&&(z.style.left=`calc(${Q}px - ${z.style.left} - ${z.getBoundingClientRect().width}px)`)}else{const te=[...new Array(D)].map(()=>0);for(const z of Array.from(ae)){if(!(z instanceof HTMLElement))continue;const R=Lr(z,g),[B,J]=zr(te,R);z.style.position="absolute",z.style.width="",z.style.height=`calc(${100/D*R}% - ${p*(D-1)/D*R}px + ${p*(R-1)}px)`,z.style.top=`calc(${100/D*B}% - ${p*(D-1)/D*B}px + ${p*B}px)`,z.style.left=`${J+(J===0?0:c)}px`;for(let re=0;re<R;re++)te[B+re]=J+(J===0?0:c)+(le.from(z)?.width??0);if(r&&B+R===D){const re=kt(te);for(let Z=0;Z<D;Z++)te[Z]=re}}const Q=Y(),L=kt(te,D);if(I(Q),C(L),isNaN(L)||(se.style.width=`${L}px`),l)for(const z of Array.from(ae))z instanceof HTMLElement&&(z.style.top=`calc(${Q}px - ${z.style.top} - ${z.getBoundingClientRect().height}px)`)}};Vt(x,{onResize:se=>{const ae=le.from(se)?.size??Ae.make(),D=j(),te=Y();(P!==D||A!==te||ae.width!==U||ae.height!==K)&&(ee(),G(ae.width),W(ae.height))}},[r,c,l,g,p,f]),N.useEffect(()=>{const se=ws(x.current?.innerHTML);if(se.length===0)return ee();const ae=se.length;for(let D=0;D<ae;D++){const te=se[D],Q=new Image;Q.src=te,Q.onload=()=>ee()}},[n]);const H=ys({orientation:f}),T=bs({orientation:f,minHeight:A,minWidth:P});return k.jsx("div",{...m,ref:E,className:he(s,H.root),role:"grid",children:k.jsx("div",{ref:x,style:T.body,children:n})})});function ys({orientation:r="horizontal"}){return{root:he(r)}}function bs({orientation:r="horizontal",minHeight:n=NaN,minWidth:s=NaN}){return{body:{height:r==="horizontal"?"100%":"auto",minHeight:r==="vertical"&&!isNaN(n)?`${n}px`:"",minWidth:r==="horizontal"&&!isNaN(s)?`${s}px`:"",padding:"0",width:r==="horizontal"?"auto":"100%"}}}function zr(r,n){const s=r.length;let c=NaN,l=1/0;for(let f=0;f<s;f++){const g=r[f],p=g<l,m=f+n<=s;let E=!0;for(let x=1;x<n;x++)r[f+x]>g&&(E=!1);p&&m&&E&&(c=f,l=g)}return isNaN(c)?[0,kt(r,n)]:[c,l]}function kt(r,n){let s=r;return n!=null&&!isNaN(n)&&(s=s.slice(0,Math.max(1,Math.min(n,r.length)))),s.reduce((c,l,f)=>l>c?l:c,0)}function Lr(r,n){const s=r.classList;for(const c of Array.from(s))if(c.startsWith(_r)){const l=parseFloat(c.replace(_r,""));if(!isNaN(l))return Math.min(Math.max(l,1),n)}return 1}function ws(r){if(!r)return[];const n=/<img.*?src=(["'])(.*?)\1/g,s=/<img.*?src=(["'])(.*?)\1/,c=n.exec(r)??[],l=[];for(const f of c){const g=s.exec(f)?.[2];g&&l.push(g)}return l}const xs=N.forwardRef(({index:r=0,isDisabled:n=!1,options:s,onChange:c,...l},f)=>{const g=s.length-1,p=s[r],m=typeof p=="string"?p:p?.label,E=()=>{if(n)return;const x=r<g?r+1:0,P=s[x],C=typeof P=="string"?P:P?.value;c?.(C,x)};return k.jsx("button",{...l,ref:f,"aria-disabled":n,"aria-label":m,disabled:n,onClick:E,children:m})}),Fr=N.forwardRef(({angle:r=0,speed:n=1,src:s,zeroAnchor:c=0,onAngleChange:l,onPositionChange:f,onDragStart:g,onDragEnd:p,onLoadImageStart:m,onLoadImageComplete:E,onLoadImageError:x,onImageSizeChange:P,...C},A)=>{const I=(se,ae,D)=>se-ae*n,U=N.useRef(null),G=st(U),K=an({src:s},{onLoadStart:m,onLoadComplete:E,onLoadError:x}),[W,j]=N.useState(r),{isDragging:[Y],value:[ee,H]}=mt(U,{initialValue:0,transform:I,onDragStart:g,onDragEnd:p});N.useEffect(()=>{if(Y||!K)return;const se=Ss(r,K,G.size,c);se!==ee&&H(se),r!==W&&j(r)},[r,K,G.width,G.height,c]),N.useEffect(()=>{if(!Y||!K)return;const se=Ts(ee,K,G.size,c);W!==se&&j(se)},[ee,K,G.width,G.height,c]),N.useEffect(()=>{l?.(W,Y),f?.(W/360,Y)},[W]),N.useEffect(()=>{P?.(K)},[K?.width,K?.height]);const T=Es({src:s,displacement:ee});return k.jsx("div",{...C,ref:A,"aria-valuenow":W,role:"slider",children:k.jsx("div",{ref:U,style:T.body})})});function Es({src:r="",displacement:n=NaN}){return{body:{backgroundImage:`url(${r})`,backgroundPositionX:`${-n}px`,backgroundRepeat:"repeat",backgroundSize:"auto 100%",height:"100%",touchAction:"none",width:"100%"}}}function Br(r,n){const{width:s,height:c}=r,{height:l}=n;if(c<=0)return Ae.make();const g=l/c*s;return new Ae([g,l])}function Ss(r,n,s,c){const{width:l}=Br(n,s),{width:f}=s,g=f*c;return r/360*l-g}function Ts(r,n,s,c){const{width:l}=Br(n,s),{width:f}=s,g=f*c;let p=(r+g)%l/l*360;for(;p<0;)p+=360;return p}const Ns=N.forwardRef(({className:r,style:n,angle:s=0,autoDimension:c="width",children:l,fov:f,speed:g=1,src:p,viewportSize:m,zeroAnchor:E=0,onAngleChange:x,onDragEnd:P,onDragStart:C,onLoadImageComplete:A,onLoadImageError:I,onLoadImageStart:U,onImageSizeChange:G,onPositionChange:K,...W},j)=>{const Y=()=>{if(!te)return 0;const{width:xe,height:Se}=te;return Se===0?0:xe/Se},ee=()=>{const xe=Math.min(360,Math.max(0,f??(m?m.width/(m.height*R)*360:0)));return D.width*(xe/360)},H=()=>D.width<=0?E:((D.width-B)*.5+E*B)/D.width,T=()=>{z(!0),C?.()},se=()=>{z(!1),P?.()},ae=N.useRef(null),D=st(ae),[te,Q]=N.useState(),[L,z]=N.useState(!1),R=Y(),B=ee(),J=H(),re=Ge(l,{track:Yt,reticle:wn,indicator:xn}),Z=ks({autoDimension:c,panoramaRect:D,aspectRatio:R,reticleWidth:B});return k.jsxs("div",{...W,ref:j,className:he(r,{dragging:L}),style:fe(n,Z.root),children:[k.jsx(Fr,{ref:ae,angle:s,speed:g,src:p,style:Z.panorama,zeroAnchor:J,onAngleChange:x,onDragEnd:se,onDragStart:T,onImageSizeChange:Q,onLoadImageComplete:A,onLoadImageError:I,onLoadImageStart:U,onPositionChange:K}),k.jsx("div",{style:Z.body,children:k.jsxs("div",{style:Z.controls,children:[Pe(re.track??k.jsx(Yt,{}),{className:he({dragging:L}),style:fe(Z.track)}),Pe(re.reticle??k.jsx(wn,{}),{className:he({dragging:L}),style:fe(Z.reticle)}),Pe(re.track??k.jsx(Yt,{}),{className:he({dragging:L}),style:fe(Z.track)})]})}),Pe(re.indicator??k.jsx(xn,{}),{className:he({dragging:L}),style:fe(Z.indicator)})]})}),Yt=N.forwardRef(({...r},n)=>k.jsx("div",{...r,ref:n})),wn=N.forwardRef(({...r},n)=>k.jsx("div",{...r,ref:n})),xn=N.forwardRef(({...r},n)=>k.jsx("div",{...r,ref:n}));function ks({autoDimension:r="width",panoramaRect:n=le.make(),aspectRatio:s=0,reticleWidth:c=0}){return{root:{...r==="width"?{width:`${n.height*s}px`}:{height:`${n.width/s}px`}},body:{height:"100%",left:"0",overflow:"hidden",pointerEvents:"none",position:"absolute",top:"0",width:"100%"},panorama:{height:"100%",width:"100%"},controls:{alignItems:"center",display:"flex",height:"100%",justifyContent:"flex-start",left:"0",overflow:"visible",position:"absolute",top:"0",width:"100%"},track:{flex:"1 0 auto"},reticle:{width:`${c}px`},indicator:{width:`${c}px`}}}const Ps=N.forwardRef(({children:r,className:n,decimalPlaces:s=2,knobHeight:c=28,knobPadding:l=0,knobWidth:f=40,max:g,min:p,orientation:m="vertical",range:E,steps:x=-1,onRangeChange:P,...C},A)=>{const I=de=>(de-p)/(g-p),U=de=>de/(m==="horizontal"?H.width:H.height),G=de=>de*(g-p)+p,K=de=>G(U(de)),W=de=>de*(m==="horizontal"?H.width:H.height),j=de=>W(I(de)),Y=de=>{const Ee=Z.length;let ve=0,Te=1/0;for(let X=0;X<Ee;X++){const Me=Z[X],Ce=Math.abs(de-Me);Ce<Te&&(Te=Ce,ve=X)}return Z[ve]},ee=N.useRef(null),H=st(ee),T=N.useRef(null),se=N.useRef(null),[ae,D]=N.useState(E??[p,g]),{isDragging:[te],isReleasing:[Q],value:[L,z]}=mt(T,{initialValue:E?.[0]??p,transform:(de,Ee,ve)=>{const Te=m==="horizontal"?Ee:ve,X=j(p),Me=j(ae[1]),Ce=j(de)+Te;return K(Math.max(X,Math.min(Me,Ce)))}},[p,m,H.size.width,H.size.height,ae[1]]),{isDragging:[R],isReleasing:[B],value:[J,re]}=mt(se,{initialValue:E?.[1]??g,transform:(de,Ee,ve)=>{const Te=m==="horizontal"?Ee:ve,X=j(ae[0]),Me=j(g),Ce=j(de)+Te;return K(Math.max(X,Math.min(Me,Ce)))}},[g,m,H.size.width,H.size.height,ae[0]]),Z=[p,...[...Array(x)].map((de,Ee)=>p+(Ee+1)*(g-p)/(1+x)),g],[xe,Se]=ae.map(j),Be=Se-xe;N.useEffect(()=>{ae[0]!==L&&(D([L,ae[1]]),P?.(ae))},[L]),N.useEffect(()=>{ae[1]!==J&&(D([ae[0],J]),P?.(ae))},[J]),N.useEffect(()=>{te||R||et(E,ae)||(D(E??[p,g]),z(E?.[0]??p),re(E?.[1]??g))},[E?.[0],E?.[1]]),N.useEffect(()=>{x<0||z(Y(L))},[Q]),N.useEffect(()=>{x<0||!B||re(Y(J))},[B]);const ce=Ge(r,{gutter:En,highlight:Sn,knob:Xt,label:Vr}),q=Os({orientation:m,highlightLength:Be,start:xe,knobPadding:l,knobWidth:f,knobHeight:c});return k.jsx("div",{...C,ref:A,"aria-valuemax":g,"aria-valuemin":p,className:he(n,m),role:"slider",children:k.jsxs("div",{ref:ee,style:q.body,children:[Pe(ce.gutter??k.jsx(En,{}),{style:fe(q.gutter)}),Pe(ce.highlight??k.jsx(Sn,{}),{style:fe(q.highlight)}),Pe(ce.knob??k.jsx(Xt,{style:fe({transitionProperty:Q?"opacity, transform":"opacity"})}),{ref:T,disabled:et([L,J],[g,g]),className:he({dragging:te,releasing:Q}),style:fe(q.knob,{pointerEvents:et([L,J],[p,p])?"none":"auto"},m==="horizontal"?{marginTop:`${-c/2+H.height/2}px`,marginLeft:`${xe-f/2}px`}:{marginTop:`${xe-c/2}px`,marginLeft:`${-f/2+H.width/2}px`})},k.jsx("div",{style:q.knobHitbox}),ce.label&&Pe(ce.label,{className:he({dragging:te||R,releasing:Q||B}),style:fe(q.label)},Number(L.toFixed(s)).toLocaleString())),Pe(ce.knob??k.jsx(Xt,{style:fe({transitionProperty:B?"opacity, transform":"opacity"})}),{ref:se,disabled:et([L,J],[g,g]),className:he({dragging:R,releasing:R}),style:fe(q.knob,{pointerEvents:et([L,J],[g,g])?"none":"auto"},m==="horizontal"?{marginTop:`${-c/2+H.height/2}px`,marginLeft:`${Se-f/2}px`}:{marginTop:`${Se-c/2}px`,marginLeft:`${-f/2+H.width/2}px`})},k.jsx("div",{style:q.knobHitbox}),ce.label&&Pe(ce.label,{className:he({dragging:R,releasing:B}),style:fe(q.label)},Number(J.toFixed(s)).toLocaleString()))]})})}),En=N.forwardRef(({...r},n)=>k.jsx("div",{...r,ref:n})),Vr=N.forwardRef(({...r},n)=>k.jsx("div",{...r,ref:n})),Sn=N.forwardRef(({...r},n)=>k.jsx("div",{...r,ref:n})),Xt=N.forwardRef(({...r},n)=>k.jsx("div",{...r,ref:n}));function Os({orientation:r="horizontal",knobWidth:n=0,knobHeight:s=0,highlightLength:c=0,start:l=0,knobPadding:f=0}){return{body:{height:"100%",width:"100%"},gutter:{display:"block",top:"0",left:"0",position:"absolute",width:"100%",height:"100%"},highlight:{height:"100%",left:"0",position:"absolute",top:"0",...r==="horizontal"?{width:`${c}px`,transform:`translate3d(${l}px, 0, 0)`}:{height:`${c}px`,transform:`translate3d(0, ${l}px, 0)`}},knob:{bottom:"0",left:"0",margin:"auto",position:"absolute",right:"0",width:`${n}px`,height:`${s}px`,top:"0",touchAction:"none",zIndex:"1"},knobHitbox:{background:"transparent",height:`calc(100% + ${f*2}px)`,left:`-${f}px`,padding:`${f}px`,position:"absolute",top:`-${f}px`,width:`calc(100% + ${f*2}px)`},label:{pointerEvents:"none",position:"relative",userSelect:"none"}}}const Cs=N.forwardRef(({children:r,className:n,isDeselectable:s=!1,isDisabled:c=!1,isSelected:l=!1,label:f,onDeselect:g,onSelect:p,onToggle:m,...E},x)=>{const P=()=>{if(!c)if(l){if(!s)return;m?.(l),g?.()}else m?.(l),p?.()};return k.jsx("button",{...E,ref:x,"aria-disabled":c,"aria-label":f,"aria-selected":l,className:he(n,{active:l,disabled:c||l&&!s}),disabled:c||l&&!s,onClick:P,children:r??f})}),Rs=N.forwardRef(({children:r,className:n,isInverted:s=!1,isTrackInteractive:c=!0,knobHeight:l=30,knobWidth:f=30,onlyDispatchesOnDragEnd:g=!1,orientation:p="vertical",position:m=0,trackPadding:E=0,labelProvider:x,onDragEnd:P,onDragStart:C,onPositionChange:A,...I},U)=>{const G=(z,R,B)=>{const J=le.from(W.current)??le.make(),re=s?1-z:z,Z=re*J.width+R,xe=re*J.height+B,Se=p==="vertical"?Math.max(0,Math.min(1,xe/J.height)):Math.max(0,Math.min(1,Z/J.width));return s?1-Se:Se},K=z=>{if(!c)return;const R=le.from(W.current)??le.make(),B=le.fromViewport();switch(p){case"horizontal":{const J=(z.clientX+B.left-R.left)/R.width,re=s?1-J:J;T(re);break}case"vertical":{const J=(z.clientY+B.top-R.top)/R.height,re=s?1-J:J;T(re);break}}},W=N.useRef(null),j=N.useRef(null),{isDragging:[Y],isReleasing:[ee],value:[H,T]}=mt(j,{initialValue:m,transform:G,onDragStart:C,onDragEnd:P},[s,p]),se=s?1-H:H,ae=s?H===0:H===1,D=s?H===1:H===0;N.useEffect(()=>{Y||m===H||T(m)},[m]),N.useEffect(()=>{Y&&g||A?.(H,Y)},[H]),N.useEffect(()=>{Y||!g||A?.(H,!0)},[Y]);const te=Ge(r,{knob:Tn,label:Nn,track:Dt}),Q=As({orientation:p,isAtEnd:ae,isAtStart:D,isDragging:Y,isReleasing:ee}),L=Ms({orientation:p,isDragging:Y,naturalPosition:se,knobHeight:l,knobWidth:f,isTrackInteractive:c});return k.jsx("div",{...I,ref:U,"aria-orientation":p,"aria-valuenow":H,className:he(n,Q.root),role:"slider",children:k.jsxs("div",{ref:W,style:L.body,children:[Pe(te.track??k.jsx(Dt,{}),{className:he("start",Q.track),style:fe(L.track,p==="vertical"?{height:`calc(${se*100}% - ${E<=0?0:l*.5}px - ${E}px)`,top:"0"}:{left:"0",width:`calc(${se*100}% - ${E<=0?0:f*.5}px - ${E}px)`}),onClick:K},k.jsx("div",{style:L.trackHitbox})),Pe(te.track??k.jsx(Dt,{}),{className:he("end",Q.track),style:fe(L.track,p==="vertical"?{bottom:"0",height:`calc(${(1-se)*100}% - ${E<=0?0:l*.5}px - ${E}px)`}:{right:"0",width:`calc(${(1-se)*100}% - ${E<=0?0:f*.5}px - ${E}px)`}),onClick:K},k.jsx("div",{style:L.trackHitbox})),k.jsx("button",{ref:j,style:L.knobContainer,children:Pe(te.knob??k.jsx(Tn,{}),{className:he(Q.knob),style:fe(L.knob)},x&&Pe(te.label??k.jsx(Nn,{}),{className:he(Q.label),style:fe(L.label)},x(H)))})]})})}),Dt=({...r})=>k.jsx("div",{...r}),Tn=({...r})=>k.jsx("div",{...r}),Nn=({...r})=>k.jsx("div",{...r});function As({orientation:r="vertical",isAtEnd:n=!1,isAtStart:s=!1,isDragging:c=!1,isReleasing:l=!1}){return{root:he(r,{"at-end":n,"at-start":s,dragging:c,releasing:l}),track:he(r,{"at-end":n,"at-start":s,dragging:c,releasing:l}),knob:he(r,{"at-end":n,"at-start":s,dragging:c,releasing:l}),label:he(r,{"at-end":n,"at-start":s,dragging:c,releasing:l})}}function Ms({orientation:r="vertical",isDragging:n=!1,naturalPosition:s=0,knobHeight:c=0,knobWidth:l=0,isTrackInteractive:f=!0}){return{body:{height:"100%",width:"100%"},knobContainer:{background:"none",border:"none",outline:"none",position:"absolute",transform:"translate3d(-50%, -50%, 0)",zIndex:"1",...r==="vertical"?{left:"50%",top:`${s*100}%`,transition:n===!1?"top 100ms ease-out":"none"}:{left:`${s*100}%`,top:"50%",transition:n===!1?"left 100ms ease-out":"none"}},knob:{height:`${c}px`,touchAction:"none",width:`${l}px`},label:{pointerEvents:"none",userSelect:"none"},track:{cursor:f?"pointer":"auto",pointerEvents:f?"auto":"none",position:"absolute",...r==="vertical"?{left:"0",margin:"0 auto",right:"0",width:"100%"}:{bottom:"0",height:"100%",margin:"auto 0",top:"0"}},trackHitbox:{height:"100%",minHeight:"20px",minWidth:"20px",position:"absolute",transform:r==="horizontal"?"translate3d(0, -50%, 0)":"translate3d(-50%, 0, 0)",width:"100%"}}}const Is=N.forwardRef(({children:r,className:n,index:s=0,isInverted:c=!1,isTrackInteractive:l=!0,knobHeight:f=30,knobWidth:g=30,labelProvider:p,onlyDispatchesOnDragEnd:m=!1,orientation:E="vertical",steps:x=js(10),trackPadding:P=0,onDragEnd:C,onDragStart:A,onIndexChange:I,onPositionChange:U,...G},K)=>{const W=(re,Z,xe)=>{const Se=le.from(Y.current)??le.make(),Be=c?1-re:re,ce=Be*Se.width+Z,q=Be*Se.height+xe,de=E==="vertical"?Math.max(0,Math.min(1,q/Se.height)):Math.max(0,Math.min(1,ce/Se.width));return c?1-de:de},j=re=>{if(!l)return;const Z=le.from(Y.current)??le.make();switch(E){case"horizontal":{const xe=(re.clientX-Z.left)/Z.width,Se=c?1-xe:xe;te(Se);break}case"vertical":{const xe=(re.clientY-Z.top)/Z.height,Se=c?1-xe:xe;te(Se);break}}},Y=N.useRef(null),ee=N.useRef(null),[H,T]=N.useState(s),{isDragging:[se],isReleasing:[ae],value:[D,te]}=mt(ee,{initialValue:Ut(s,x),transform:W,onDragStart:A,onDragEnd:C},[c,E]),Q=c?1-D:D,L=c?D===0:D===1,z=c?D===1:D===0,R=Ge(r,{knob:kn,label:Pn,track:Wt}),B=_s({orientation:E,isAtEnd:L,isAtStart:z,isDragging:se,isReleasing:ae}),J=zs({orientation:E,naturalPosition:Q,isDragging:se,knobHeight:f,knobWidth:g,isTrackInteractive:l});return N.useEffect(()=>{if(se)return;const re=Ut(s,x);D!==re&&te(re),s!==H&&T(s)},[s]),N.useEffect(()=>{if(se&&m)return;U?.(D,se);const re=On(D,x);H!==re&&T(re)},[D]),N.useEffect(()=>{I?.(H,se)},[H]),N.useEffect(()=>{if(se)return;const re=On(D,x),Z=Ut(re,x);(Z!==D||m)&&(te(Z),U?.(Z,!0))},[se]),k.jsx("div",{...G,ref:K,"aria-valuenow":H,className:he(n,B.root),role:"slider",children:k.jsxs("div",{ref:Y,style:J.body,children:[Pe(R.track??k.jsx(Wt,{}),{className:he("start",B.track),style:fe(J.track,E==="vertical"?{height:`calc(${Q*100}% - ${P<=0?0:f*.5}px - ${P}px)`,top:"0"}:{left:"0",width:`calc(${Q*100}% - ${P<=0?0:g*.5}px - ${P}px)`}),onClick:j},k.jsx("div",{style:J.trackHitbox})),Pe(R.track??k.jsx(Wt,{}),{className:he("end",B.track),style:fe(J.track,E==="vertical"?{bottom:"0",height:`calc(${(1-Q)*100}% - ${P<=0?0:f*.5}px - ${P}px)`}:{right:"0",width:`calc(${(1-Q)*100}% - ${P<=0?0:g*.5}px - ${P}px)`}),onClick:j},k.jsx("div",{style:J.trackHitbox})),k.jsx("button",{ref:ee,style:J.knobContainer,children:Pe(R.knob??k.jsx(kn,{}),{className:he(B.knob),style:fe(J.knob)},x&&p&&Pe(R.label??k.jsx(Pn,{}),{className:he(B.label),style:fe(J.label)},p(D,On(D,x))))})]})})}),Wt=({...r})=>k.jsx("div",{...r}),kn=({...r})=>k.jsx("div",{...r}),Pn=({...r})=>k.jsx("div",{...r});function js(r){if(Math.round(r)!==r)throw new Error("`length` value must be an integer");const n=1/(r-1);return Array(r).fill(null).map((s,c)=>n*c)}function On(r,n){let s=-1,c=NaN;for(let l=0,f=n.length;l<f;l++){const g=Ut(l,n);if(isNaN(g))continue;const p=Math.abs(r-g);(isNaN(c)||p<c)&&(c=p,s=l)}return s}function Ut(r,n){return r>=n.length?NaN:n[r]}function _s({orientation:r="vertical",isAtEnd:n=!1,isAtStart:s=!1,isDragging:c=!1,isReleasing:l=!1}){return{root:he(r,{"at-end":n,"at-start":s,dragging:c,releasing:l}),track:he(r,{"at-end":n,"at-start":s,dragging:c,releasing:l}),knob:he(r,{"at-end":n,"at-start":s,dragging:c,releasing:l}),label:he(r,{"at-end":n,"at-start":s,dragging:c,releasing:l})}}function zs({orientation:r="vertical",naturalPosition:n=0,isDragging:s=!1,knobHeight:c=0,knobWidth:l=0,isTrackInteractive:f=!1}){return{body:{height:"100%",width:"100%"},knobContainer:{background:"none",border:"none",outline:"none",position:"absolute",transform:"translate3d(-50%, -50%, 0)",zIndex:"1",...r==="vertical"?{left:"50%",top:`${n*100}%`,transition:s===!1?"top 100ms ease-out":"none"}:{left:`${n*100}%`,top:"50%",transition:s===!1?"left 100ms ease-out":"none"}},knob:{height:`${c}px`,touchAction:"none",width:`${l}px`},label:{pointerEvents:"none",userSelect:"none"},track:{cursor:f?"pointer":"auto",pointerEvents:f?"auto":"none",position:"absolute",...r==="vertical"?{left:"0",margin:"0 auto",right:"0",width:"100%"}:{bottom:"0",height:"100%",margin:"auto 0",top:"0"}},trackHitbox:{height:"100%",minHeight:"20px",minWidth:"20px",position:"absolute",transform:r==="horizontal"?"translate3d(0, -50%, 0)":"translate3d(-50%, 0, 0)",width:"100%"}}}const Ls=N.forwardRef(({children:r,isEnabled:n=!0,threshold:s=.5,onSwipeDown:c,onSwipeLeft:l,onSwipeRight:f,onSwipeUp:g,...p},m)=>{const[E,x]=N.useState(void 0),[P,C]=N.useState(void 0),[A,I]=N.useState(NaN),U=(j,Y)=>{if(isNaN(j)||isNaN(Y))return W();x(be.make(j,Y))},G=(j,Y)=>{const ee=E;if(ee===void 0)return;const H=ee.x!==j||ee.y!==Y,T=!isNaN(A);H&&(T||I(Date.now()),C(be.make(j,Y)))},K=()=>{const j=A,Y=E,ee=P;if(isNaN(j)||Y===void 0||ee===void 0)return;const H=Date.now()-j,T=ee.x-Y.x,se=ee.y-Y.y,ae=T/H,D=se/H;n&&(Math.abs(ae)>=s&&Math.abs(ae)>Math.abs(D)?ae>0?f?.():l?.():Math.abs(D)>=s&&Math.abs(D)>Math.abs(ae)&&(D>0?c?.():g?.())),W()},W=()=>{x(void 0),C(void 0),I(NaN)};return k.jsx("div",{...p,ref:m,onMouseDown:j=>U(j.clientX,j.clientY),onMouseLeave:()=>W(),onMouseMove:j=>G(j.clientX,j.clientY),onMouseUp:()=>K(),onTouchEnd:()=>K(),onTouchMove:j=>G(j.targetTouches[0].clientX,j.targetTouches[0].clientY),onTouchStart:j=>U(j.targetTouches[0].clientX,j.targetTouches[0].clientY),children:r})});function Fs({children:r,className:n,style:s,alignment:c,arrowHeight:l=6,arrowWidth:f=12,gap:g=4,hint:p,maxWidth:m=200,threshold:E=100}){const x=()=>{const G=document.createElement("span");G.className=he(n),G.innerHTML=p,G.role="tooltip";const K=c??(A.current?Vs(A.current,E):"tl"),W=Bs(G),j=Xs({alignment:K,arrowSize:Ae.make(f,l),gap:g,maxDialogWidth:m,fullDialogWidth:W.width,targetWidth:U.width}),Y=fe(s,j.dialog);Object.keys(Y).forEach(H=>G.style[H]=Y[H]);const ee=document.createElement("span");return Object.keys(j.arrow).forEach(H=>ee.style[H]=j.arrow[H]),G.appendChild(ee),G},P=()=>{I.current&&(I.current.style.opacity="1",I.current.ariaHidden="false")},C=()=>{I.current&&(I.current.style.opacity="0",I.current.ariaHidden="true")},A=N.useRef(null),I=N.useRef(void 0),U=st(A);return N.useEffect(()=>{const G=x();return A.current?.appendChild(G),I.current=G,()=>{A.current?.removeChild(G),I.current=void 0}},[c,l,f,n,g,p,m,s,A.current,E]),k.jsx(tr,{ref:A,onMouseEnter:P,onMouseLeave:C,children:r})}function Bs(r){const n=r.cloneNode(!1);n.innerHTML=r.innerHTML,n.style.visibility="hidden",n.style.whiteSpace="pre",document.body.appendChild(n);const s=n.getBoundingClientRect();return document.body.removeChild(n),Ae.make(s.width,s.height)}function Vs(r,n){const s=le.fromViewport(),c=le.intersecting(r);if(c){const l=c.left-s.left<n,f=s.right-c.right<n,g=c.top-s.top<n,p=s.bottom-c.bottom<n;if(l&&g)return"br";if(l&&p)return"tr";if(f&&g)return"bl";if(f&&p)return"tl";if(l)return"cr";if(f)return"cl";if(p)return"tc"}return"tc"}function Hs({alignment:r,arrowSize:n,fullDialogWidth:s,gap:c,maxDialogWidth:l,targetWidth:f}){const g=Math.min(s,l),p=f>g;switch(r){case"tl":return{bottom:`calc(100% + ${n.height}px + ${c}px)`,right:p?"":"0",left:p?"50%":"",transform:`translate(${g>f?"0":"-50%"}, 0)`};case"tc":return{bottom:`calc(100% + ${n.height}px + ${c}px)`,left:"50%",transform:"translateX(-50%)"};case"tr":return{bottom:`calc(100% + ${n.height}px + ${c}px)`,left:p?"50%":"0",transform:`translate(${g>f?"0":"-50%"}, 0)`};case"cl":return{top:"50%",right:`calc(100% + ${n.height+c}px)`,transform:"translate(0, -50%)"};case"cr":return{top:"50%",left:`calc(100% + ${n.height+c}px)`,transform:"translate(0, -50%)"};case"bl":return{left:p?"50%":"",right:p?"":"0",top:`calc(100% + ${n.height}px + ${c}px)`,transform:`translate(${g>f?"0":"-50%"}, 0)`};case"bc":return{left:"50%",top:`calc(100% + ${n.height}px + ${c}px)`,transform:"translateX(-50%)"};case"br":return{left:p?"50%":"0",top:`calc(100% + ${n.height}px + ${c}px)`,transform:`translate(${g>f?"0":"-50%"}, 0)`};default:throw Error(`Invalid alignment: ${r}`)}}function Ys({alignment:r,arrowSize:n,fullDialogWidth:s,gap:c,maxDialogWidth:l,targetWidth:f}){const g=Math.min(s,l),p=f>g;switch(r){case"tl":return{bottom:0,clipPath:"polygon(50% 100%,100% 0,0 0)",height:`${n.height}px`,left:p?"50%":"",right:p?"":`${f-n.width/2-f/2}px`,transform:`translate(${p?"-50%":"0"}, 100%)`,width:`${n.width}px`};case"tc":return{bottom:0,clipPath:"polygon(50% 100%,100% 0,0 0)",height:`${n.height}px`,left:"50%",transform:"translate(-50%, 100%)",width:`${n.width}px`};case"tr":return{bottom:0,clipPath:"polygon(50% 100%,100% 0,0 0)",height:`${n.height}px`,left:p?"50%":`${f-n.width/2-f/2}px`,transform:`translate(${p?"-50%":"0"}, 100%)`,width:`${n.width}px`};case"cl":return{clipPath:"polygon(0 0,100% 50%,0 100%)",height:`${n.width}px`,right:"0",top:"50%",transform:"translate(100%, -50%)",width:`${n.height}px`};case"cr":return{clipPath:"polygon(100% 0,0 50%,100% 100%)",height:`${n.width}px`,left:"0",top:"50%",transform:"translate(-100%, -50%)",width:`${n.height}px`};case"bl":return{clipPath:"polygon(50% 0,100% 100%,0 100%)",height:`${n.height}px`,left:p?"50%":"",right:p?"":`${f-n.width/2-f/2}px`,top:"0",transform:`translate(${p?"-50%":"0"}, -100%)`,width:`${n.width}px`};case"bc":return{clipPath:"polygon(50% 0,100% 100%,0 100%)",height:`${n.height}px`,left:"50%",top:"0",transform:"translate(-50%, -100%)",width:`${n.width}px`};case"br":return{clipPath:"polygon(50% 0,100% 100%,0 100%)",height:`${n.height}px`,left:p?"50%":`${f-n.width/2-f/2}px`,top:"0",transform:`translate(${p?"-50%":"0"}, -100%)`,width:`${n.width}px`};default:throw Error(`Invalid alignment: ${r}`)}}function Xs({alignment:r,arrowSize:n,fullDialogWidth:s,gap:c,maxDialogWidth:l,targetWidth:f}){return{dialog:{boxSizing:"border-box",height:"auto",margin:"0",opacity:"0",pointerEvents:"none",position:"absolute",userSelect:"none",whiteSpace:s>l?"normal":"pre",width:s>l?`${l}px`:"",...Hs({alignment:r,arrowSize:n,fullDialogWidth:s,gap:c,maxDialogWidth:l,targetWidth:f})},arrow:{background:"inherit",position:"absolute",...Ys({alignment:r,arrowSize:n,fullDialogWidth:s,gap:c,maxDialogWidth:l,targetWidth:f})}}}const Cn=N.createContext(void 0);function Ds({children:r}){const[n,s]=N.useState({minPos:be.make(),maxPos:be.make(),pos:be.make(),step:be.make()});return N.useEffect(()=>{const c=()=>{const l=le.fromViewport(),f=l.clone({x:0,y:0}),g=le.from(window,{overflow:!0});if(!g)return;const p=f.clone({x:g.width-l.width,y:g.height-l.height}),m=be.make(l.left/p.left,l.top/p.top);s({minPos:be.make(f.left,f.top),maxPos:be.make(p.left,p.top),pos:be.make(l.left,l.top),step:m})};return window.addEventListener("scroll",c),window.addEventListener("resize",c),window.addEventListener("orientationchange",c),c(),()=>{window.removeEventListener("scroll",c),window.removeEventListener("resize",c),window.removeEventListener("orientationchange",c)}},[]),k.jsx(Cn.Provider,{value:n,children:r})}function Ws(r){const n=N.useContext(Cn);if(!n)throw Error("Cannot fetch the current scroll position context, is the corresponding provider instated?");if(!r)return{pos:n.pos,step:n.step};const s=r.current,c=le.fromViewport(),l=le.from(s);if(!c||!l)return{pos:be.make(),step:be.make()};const f=c.right-l.left,g=c.bottom-l.top,p=f/l.width,m=g/l.height;return{pos:be.make(f,g),step:be.make(p,m)}}F.Accordion=_o,F.AccordionCollapseIcon=or,F.AccordionExpandIcon=rr,F.AccordionHeader=sn,F.Burger=ir,F.BurgerBar=Ft,F.BurgerButton=Fo,F.BurgerButtonBar=Bo,F.Button=Ho,F.Carousel=ti,F.Collection=on,F.Conditional=Ro,F.Counter=ii,F.CounterAddButton=un,F.CounterSubtractButton=fn,F.CounterTextField=ln,F.CoverImage=si,F.CoverImageContent=mr,F.CoverImageViewport=vr,F.CoverVideo=ai,F.CoverVideoContent=wr,F.CoverVideoViewport=br,F.Dial=ci,F.DialKnob=gn,F.DialTrack=pn,F.Dropdown=fi,F.DropdownCollapseIcon=Sr,F.DropdownExpandIcon=Er,F.DropdownToggle=vn,F.Each=zt,F.ExtractChild=tr,F.ExtractChildren=Io,F.FlatSVG=vs,F.Image=gr,F.MasonryGrid=ms,F.OptionButton=xs,F.Panorama=Fr,F.PanoramaSlider=Ns,F.PanoramaSliderIndicator=xn,F.PanoramaSliderReticle=wn,F.PanoramaSliderTrack=Yt,F.RangeSlider=Ps,F.RangeSliderGutter=En,F.RangeSliderHighlight=Sn,F.RangeSliderKnob=Xt,F.RangeSliderLabel=Vr,F.Repeat=rn,F.ScrollPositionContext=Cn,F.ScrollPositionProvider=Ds,F.SelectableButton=Cs,F.Slider=Rs,F.SliderKnob=Tn,F.SliderLabel=Nn,F.SliderTrack=Dt,F.StepwiseSlider=Is,F.StepwiseSliderKnob=kn,F.StepwiseSliderLabel=Pn,F.StepwiseSliderTrack=Wt,F.SwipeRegion=Ls,F.TextField=pr,F.Video=yr,F.WithTooltip=Fs,F.asClassNameDict=Ao,F.asComponentDict=Ge,F.asStyleDict=Mo,F.cloneStyledElement=Pe,F.styles=fe,F.useClickOutsideEffect=Xo,F.useDragEffect=sr,F.useDragValueEffect=mt,F.useImageSize=an,F.useInterval=Ko,F.useLoadImageEffect=lr,F.useLoadVideoMetadataEffect=ur,F.useMounted=Jo,F.usePrevious=cn,F.useRect=st,F.useResizeEffect=Vt,F.useScrollPosition=Ws,F.useScrollPositionEffect=Zo,F.useSearchParamState=Qo,F.useSize=$o,F.useTimeout=fr,F.useVideoSize=dr,F.useViewportSize=ei,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})});
|