hypnagaga/docs/assets/Framer.stories-CQT5D1Oy.js
github-actions[bot] 6874523868 docs
2024-08-28 08:09:11 +00:00

12 lines
30 KiB
JavaScript

import{S as ee,i as te,s as le,Q as rt,q as M,e as ne,o as E,c as B,f as c,g as Z,h as N,j as D,m as H,O as W,x as Ie,t as O,a as q,k as U,d as R,P as oe,J as De,v as $,y as Te,l as J,a4 as pe,X as be,Y as ot,z as We,A as Me,B as Ve,a2 as ae,L as Le,p as Oe,M as ue,a1 as qe,Z as P,T as ye,C as Y,U as he,r as Ee,u as ze,E as ut,D as Ce,K as dt,N as ft,W as ct}from"./index-C9aKRT5A.js";import{g as de,a as je}from"./spread-CgU5AtxT.js";import{b as mt,p as pt,w as bt,M as yt,T as ht,S as kt}from"./collect-stories-ceFdpR5E.js";import{F as se}from"./fa-DMEUqF6U.js";import{d as gt,e as Ne,c as _t}from"./index.es-C7Z4ZQcn.js";import{p as vt}from"./pym.v1-CD-t3sYy.js";import{u as wt}from"./index-DkGirDfU.js";import{e as ke}from"./each-D6YF6ztN.js";import"./_commonjsHelpers-BosuxZz1.js";import"./index-CROxjmim.js";const Ft=`An embed tool for development in the Graphics Kit.
\`\`\`svelte
<script>
import { Framer } from '@reuters-graphics/graphics-components';
const embeds = ['/embeds/my-chart/index.html'];
<\/script>
<Framer embeds="{embeds}" />
\`\`\`
`,K=mt(660);function St(e){let t,l,s,a=(e[7]||e[3])+"",n,i,d,f,u,b,F,g,w,h,y,S,k,_,A,V,v,I,o;return rt(e[21]),b=new se({props:{icon:gt,fw:!0}}),A=new se({props:{icon:Ne,fw:!0}}),{c(){t=M("div"),l=M("div"),s=M("div"),n=ne(a),i=ne("px"),f=E(),u=M("button"),B(b.$$.fragment),g=E(),w=M("div"),h=M("div"),y=E(),S=M("div"),k=E(),_=M("button"),B(A.$$.fragment),c(s,"class","label svelte-1pekarq"),c(s,"style",d=`opacity: ${e[5]||e[6]?1:0};`),c(u,"class","icon left svelte-1pekarq"),u.disabled=F=e[3]===e[1],c(h,"class","track svelte-1pekarq"),c(S,"class","handle svelte-1pekarq"),c(S,"tabindex","0"),c(S,"role","button"),Z(S,"left","calc("+e[8]*100+"% - 5px)"),c(w,"class","slider-container svelte-1pekarq"),c(_,"class","icon right svelte-1pekarq"),_.disabled=V=e[3]===e[2],c(l,"class","slider svelte-1pekarq"),c(t,"id","resizer"),c(t,"class","svelte-1pekarq")},m(m,T){N(m,t,T),D(t,l),D(l,s),D(s,n),D(s,i),D(l,f),D(l,u),H(b,u,null),D(l,g),D(l,w),D(w,h),D(w,y),D(w,S),e[22](w),D(l,k),D(l,_),H(A,_,null),v=!0,I||(o=[W(window,"mousemove",e[9]),W(window,"mouseup",e[12]),W(window,"keydown",e[10]),W(window,"resize",e[21]),W(u,"click",e[16]),W(u,"focus",e[13]),W(u,"mouseover",e[13]),W(u,"mouseleave",e[14]),W(S,"mousedown",e[11]),W(S,"focus",e[13]),W(S,"blur",e[14]),W(_,"click",e[15]),W(_,"focus",e[13]),W(_,"mouseover",e[13]),W(_,"mouseleave",e[14])],I=!0)},p(m,[T]){(!v||T&136)&&a!==(a=(m[7]||m[3])+"")&&Ie(n,a),(!v||T&96&&d!==(d=`opacity: ${m[5]||m[6]?1:0};`))&&c(s,"style",d),(!v||T&10&&F!==(F=m[3]===m[1]))&&(u.disabled=F),(!v||T&256)&&Z(S,"left","calc("+m[8]*100+"% - 5px)"),(!v||T&12&&V!==(V=m[3]===m[2]))&&(_.disabled=V)},i(m){v||(O(b.$$.fragment,m),O(A.$$.fragment,m),v=!0)},o(m){q(b.$$.fragment,m),q(A.$$.fragment,m),v=!1},d(m){m&&U(t),R(b),e[22](null),R(A),I=!1,oe(o)}}}const x=90;function At(e,t,l){let s,a,n,i,d;De(e,K,p=>l(3,d=p));let{breakpoints:f=[330,510,660,930,1200]}=t,{maxFrameWidth:u=1200}=t,{minFrameWidth:b=320}=t,F,g=1200,w=!1,h=!1;const y=p=>Math.ceil(p/5)*5,S=()=>Math.round(n*i+s);let k=null;const _=p=>{if(!w||!F)return;const{left:C}=F.getBoundingClientRect();l(8,i=Math.min(Math.max(0,p.pageX-C),x)/x),l(7,k=y(S()))},A=p=>{if(!h)return;const{keyCode:C}=p,Q=x/n;C===39?l(8,i=Math.min(1,i+Q/x)):C===37&&l(8,i=Math.max(0,i-Q/x)),K.set(S())},V=p=>{l(5,w=!0),_(p)},v=()=>{l(5,w=!1),l(7,k=null),K.set(y(S()))},I=()=>{l(6,h=!0)},o=()=>{l(6,h=!1)},m=()=>{const p=f.filter(C=>C<=a).filter(C=>C>d);p.length===0?K.set(a):K.set(p[0])},T=()=>{const p=f.filter(C=>C<d);p.length===0?K.set(s):K.set(p.slice(-1)[0])};function z(){l(0,g=window.innerWidth)}function j(p){$[p?"unshift":"push"](()=>{F=p,l(4,F)})}return e.$$set=p=>{"breakpoints"in p&&l(17,f=p.breakpoints),"maxFrameWidth"in p&&l(18,u=p.maxFrameWidth),"minFrameWidth"in p&&l(19,b=p.minFrameWidth)},e.$$.update=()=>{e.$$.dirty&524288&&l(1,s=b),e.$$.dirty&262145&&l(2,a=Math.min(g-70,u)),e.$$.dirty&6&&l(20,n=a-s),e.$$.dirty&12&&d>a&&K.set(a),e.$$.dirty&1048586&&l(8,i=(d-s)/n)},[g,s,a,d,F,w,h,k,i,_,A,V,v,I,o,m,T,f,u,b,n,z,j]}class Ue extends ee{constructor(t){super(),te(this,t,At,St,le,{breakpoints:17,maxFrameWidth:18,minFrameWidth:19})}}Ue.__docgen={version:3,name:"index.svelte",data:[{visibility:"public",description:null,keywords:[],name:"breakpoints",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"array",type:"array"}},{visibility:"public",description:null,keywords:[],name:"maxFrameWidth",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"number",type:"number"},defaultValue:1200},{visibility:"public",description:null,keywords:[],name:"minFrameWidth",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"number",type:"number"},defaultValue:320}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};const It=e=>{const t=e.map(n=>n.replace(/\?.+$/,"")).map(n=>n.replace(/index\.html$/,"")).map(n=>n.replace(/^http[s]*:\/\/[\w.]+\.com/,""));if(t.length===1)return[t[0].split("/").filter(n=>n).slice(-1)[0]];const l=t[0];let s=0;for(const n in l.split("/")){const i=l.split("/")[n];if(t.every(f=>f.split("/")[n]===i))s+=1;else break}if(s===l.split("/").length)return t;let a=0;for(const n in l.split("/").reverse()){const i=l.split("/").reverse()[n];if(t.every(f=>f.split("/").reverse()[n]===i))a+=1;else break}return t.map(n=>a>0?n.split("/").slice(s,a*-1).join("/"):n.split("/").slice(s).join("/"))},X={};X.simpleFilter=function(e,t){return t.filter(function(l){return X.test(e,l)})};X.test=function(e,t){return X.match(e,t)!==null};X.match=function(e,t,l){l=l||{};let s=0;const a=[],n=t.length;let i=0,d=0;const f=l.pre||"",u=l.post||"",b=l.caseSensitive&&t||t.toLowerCase();let F;e=l.caseSensitive&&e||e.toLowerCase();for(let g=0;g<n;g++)F=t[g],b[g]===e[s]?(F=f+F+u,s+=1,d+=1+d):d=0,i+=d,a[a.length]=F;return s===e.length?(i=b===e?1/0:i,{rendered:a.join(""),score:i}):null};X.filter=function(e,t,l){return!t||t.length===0?[]:typeof e!="string"?t:(l=l||{},t.reduce(function(s,a,n,i){let d=a;l.extract&&(d=l.extract(a));const f=X.match(e,d,l);return f!=null&&(s[s.length]={string:f.rendered,score:f.score,index:n,original:a}),s},[]).sort(function(s,a){const n=a.score-s.score;return n||s.index-a.index}))};const Dt=e=>({}),ge=e=>({});function Tt(e){let t;return{c(){t=ne(e[2])},m(l,s){N(l,t,s)},p(l,s){s&4&&Ie(t,l[2])},d(l){l&&U(t)}}}function Wt(e){let t,l,s,a,n,i,d,f,u,b,F;const g=e[10].label,w=Te(g,e,e[9],ge),h=w||Tt(e);let y=[{name:"search"},{type:"search"},{placeholder:"Search..."},{autocomplete:"off"},{spellcheck:"false"},e[6],{id:e[4]}],S={};for(let k=0;k<y.length;k+=1)S=J(S,y[k]);return{c(){t=M("form"),l=M("label"),h&&h.c(),n=E(),i=M("input"),c(l,"id",s=e[4]+"-label"),c(l,"for",e[4]),c(l,"style",a=e[3]&&"position: absolute;height: 1px;width: 1px;overflow: hidden;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);white-space: nowrap;"),pe(i,S),c(t,"data-svelte-search",""),c(t,"role",d=e[5]?null:"search"),c(t,"aria-labelledby",f=e[5]?null:e[4]),c(t,"action","")},m(k,_){N(k,t,_),D(t,l),h&&h.m(l,null),D(t,n),D(t,i),i.autofocus&&i.focus(),e[17](i),be(i,e[0]),u=!0,b||(F=[W(i,"input",e[18]),W(i,"input",e[12]),W(i,"change",e[13]),W(i,"focus",e[14]),W(i,"blur",e[15]),W(i,"keydown",e[16]),W(t,"submit",ot(e[11]))],b=!0)},p(k,[_]){w?w.p&&(!u||_&512)&&We(w,g,k,k[9],u?Ve(g,k[9],_,Dt):Me(k[9]),ge):h&&h.p&&(!u||_&4)&&h.p(k,u?_:-1),(!u||_&16&&s!==(s=k[4]+"-label"))&&c(l,"id",s),(!u||_&16)&&c(l,"for",k[4]),(!u||_&8&&a!==(a=k[3]&&"position: absolute;height: 1px;width: 1px;overflow: hidden;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);white-space: nowrap;"))&&c(l,"style",a),pe(i,S=de(y,[{name:"search"},{type:"search"},{placeholder:"Search..."},{autocomplete:"off"},{spellcheck:"false"},_&64&&k[6],(!u||_&16)&&{id:k[4]}])),_&1&&i.value!==k[0]&&be(i,k[0]),(!u||_&32&&d!==(d=k[5]?null:"search"))&&c(t,"role",d),(!u||_&48&&f!==(f=k[5]?null:k[4]))&&c(t,"aria-labelledby",f)},i(k){u||(O(h,k),u=!0)},o(k){q(h,k),u=!1},d(k){k&&U(t),h&&h.d(k),e[17](null),b=!1,oe(F)}}}function Mt(e,t,l){const s=["value","autofocus","debounce","label","hideLabel","id","ref","removeFormAriaAttributes"];let a=ae(t,s),{$$slots:n={},$$scope:i}=t,{value:d=""}=t,{autofocus:f=!1}=t,{debounce:u=0}=t,{label:b="Label"}=t,{hideLabel:F=!1}=t,{id:g="search"+Math.random().toString(36)}=t,{ref:w=null}=t,{removeFormAriaAttributes:h=!1}=t;const y=Le();let S=d,k,_=!1;function A(p){_||(_=!0,k=setTimeout(()=>{p(),_=!1},u))}Oe(()=>(f&&window.requestAnimationFrame(()=>w.focus()),()=>clearTimeout(k))),ue(()=>{d.length>0&&d!==S&&(u>0?A(()=>y("type",d)):y("type",d)),d.length===0&&S.length>0&&y("clear"),S=d});function V(p){P.call(this,e,p)}function v(p){P.call(this,e,p)}function I(p){P.call(this,e,p)}function o(p){P.call(this,e,p)}function m(p){P.call(this,e,p)}function T(p){P.call(this,e,p)}function z(p){$[p?"unshift":"push"](()=>{w=p,l(1,w)})}function j(){d=this.value,l(0,d)}return e.$$set=p=>{t=J(J({},t),qe(p)),l(6,a=ae(t,s)),"value"in p&&l(0,d=p.value),"autofocus"in p&&l(7,f=p.autofocus),"debounce"in p&&l(8,u=p.debounce),"label"in p&&l(2,b=p.label),"hideLabel"in p&&l(3,F=p.hideLabel),"id"in p&&l(4,g=p.id),"ref"in p&&l(1,w=p.ref),"removeFormAriaAttributes"in p&&l(5,h=p.removeFormAriaAttributes),"$$scope"in p&&l(9,i=p.$$scope)},[d,w,b,F,g,h,a,f,u,i,n,V,v,I,o,m,T,z,j]}class Pe extends ee{constructor(t){super(),te(this,t,Mt,Wt,le,{value:0,autofocus:7,debounce:8,label:2,hideLabel:3,id:4,ref:1,removeFormAriaAttributes:5})}}Pe.__docgen={version:3,name:"Search.svelte",data:[{keywords:[],visibility:"public",description:"Specify the input value",name:"value",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"",bind:[{source:"input",property:"value"}]},{keywords:[],visibility:"public",description:"Set to `true` to auto focus the input on mount",name:"autofocus",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1},{keywords:[],visibility:"public",description:"Specify the debounce value in milliseconds (ms)",name:"debounce",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"number",type:"number"},defaultValue:0},{keywords:[],visibility:"public",description:"Specify the input label text",name:"label",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"Label"},{keywords:[],visibility:"public",description:"Set to `true` to visually hide the label",name:"hideLabel",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1},{keywords:[],visibility:"public",description:"Specify an `id` for the `input`",name:"id",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{keywords:[{name:"type",description:"{HTMLInputElement}"}],visibility:"public",description:"Obtain a reference to the `input` element",name:"ref",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"HTMLInputElement",type:"HTMLInputElement"},defaultValue:null},{keywords:[],visibility:"public",description:'Set to `true` to omit the form `role="search"` attribute',name:"removeFormAriaAttributes",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1}],computed:[],methods:[],components:[],description:null,keywords:[],events:[{visibility:"public",description:null,keywords:[],name:"type"},{visibility:"public",description:null,keywords:[],name:"clear"},{keywords:[],visibility:"public",description:"",name:"submit",parent:"form",modificators:["preventDefault"],locations:null},{keywords:[],visibility:"public",description:"",name:"input",parent:"input",modificators:[],locations:null},{keywords:[],visibility:"public",description:"",name:"change",parent:"input",modificators:[],locations:null},{keywords:[],visibility:"public",description:"",name:"focus",parent:"input",modificators:[],locations:null},{keywords:[],visibility:"public",description:"",name:"blur",parent:"input",modificators:[],locations:null},{keywords:[],visibility:"public",description:"",name:"keydown",parent:"input",modificators:[],locations:null}],slots:[{keywords:[],visibility:"public",description:"",name:"label"}],refs:[]};function _e(e,t,l){const s=e.slice();return s[47]=t[l],s[49]=l,s}const Vt=e=>({result:e[0]&2,value:e[0]&1}),ve=e=>({result:e[47],index:e[49],value:e[0]});function we(e){let t,l,s=ke(e[1]),a=[];for(let i=0;i<s.length;i+=1)a[i]=Fe(_e(e,s,i));const n=i=>q(a[i],1,1,()=>{a[i]=null});return{c(){for(let i=0;i<a.length;i+=1)a[i].c();t=Ce()},m(i,d){for(let f=0;f<a.length;f+=1)a[f]&&a[f].m(i,d);N(i,t,d),l=!0},p(i,d){if(d[0]&16778759){s=ke(i[1]);let f;for(f=0;f<s.length;f+=1){const u=_e(i,s,f);a[f]?(a[f].p(u,d),O(a[f],1)):(a[f]=Fe(u),a[f].c(),O(a[f],1),a[f].m(t.parentNode,t))}for(Ee(),f=s.length;f<a.length;f+=1)n(f);ze()}},i(i){if(!l){for(let d=0;d<s.length;d+=1)O(a[d]);l=!0}},o(i){a=a.filter(Boolean);for(let d=0;d<a.length;d+=1)q(a[d]);l=!1},d(i){i&&U(t),dt(a,i)}}}function Lt(e){let t,l=e[47].string+"",s;return{c(){t=new ct(!1),s=Ce(),t.a=s},m(a,n){t.m(l,a,n),N(a,s,n)},p(a,n){n[0]&2&&l!==(l=a[47].string+"")&&t.p(l)},d(a){a&&(U(s),t.d())}}}function Fe(e){let t,l,s,a,n,i,d;const f=e[25].default,u=Te(f,e,e[24],ve),b=u||Lt(e);function F(){return e[38](e[47],e[49])}function g(...h){return e[39](e[47],e[49],...h)}function w(){return e[40](e[47],e[49])}return{c(){t=M("li"),b&&b.c(),l=E(),c(t,"role","option"),c(t,"id",s=e[2]+"-result-"+e[49]),c(t,"aria-selected",a=e[9]===e[49]),c(t,"class","svelte-1n7ww29"),Y(t,"selected",e[9]===e[49]),Y(t,"disabled",e[47].disabled)},m(h,y){N(h,t,y),b&&b.m(t,null),D(t,l),n=!0,i||(d=[W(t,"click",F),W(t,"keyup",g),W(t,"mouseenter",w)],i=!0)},p(h,y){e=h,u?u.p&&(!n||y[0]&16777219)&&We(u,f,e,e[24],n?Ve(f,e[24],y,Vt):Me(e[24]),ve):b&&b.p&&(!n||y[0]&2)&&b.p(e,n?y:[-1,-1]),(!n||y[0]&4&&s!==(s=e[2]+"-result-"+e[49]))&&c(t,"id",s),(!n||y[0]&512&&a!==(a=e[9]===e[49]))&&c(t,"aria-selected",a),(!n||y[0]&512)&&Y(t,"selected",e[9]===e[49]),(!n||y[0]&2)&&Y(t,"disabled",e[47].disabled)},i(h){n||(O(b,h),n=!0)},o(h){q(b,h),n=!1},d(h){h&&U(t),b&&b.d(h),i=!1,oe(d)}}}function Se(e){let t;return{c(){t=M("li"),t.textContent="No embeds found...",c(t,"class","no-results disabled svelte-1n7ww29")},m(l,s){N(l,t,s)},d(l){l&&U(t)}}}function Ot(e){let t,l,s,a,n,i,d,f,u,b,F,g,w,h,y,S;const k=[{id:e[2]},{removeFormAriaAttributes:!0},e[14],{"aria-autocomplete":"list"},{"aria-controls":e[2]+"-listbox"},{"aria-labelledby":e[2]+"-label"},{"aria-activedescendant":e[9]>=0&&!e[4]&&e[1].length>0?`${e[2]}-result-${e[9]}`:null}];function _(o){e[27](o)}function A(o){e[28](o)}let V={};for(let o=0;o<k.length;o+=1)V=J(V,k[o]);e[8]!==void 0&&(V.ref=e[8]),e[0]!==void 0&&(V.value=e[0]),l=new Pe({props:V}),$.push(()=>ye(l,"ref",_)),$.push(()=>ye(l,"value",A)),l.$on("type",e[29]),l.$on("input",e[30]),l.$on("change",e[31]),l.$on("focus",e[32]),l.$on("focus",e[33]),l.$on("clear",e[34]),l.$on("clear",e[12]),l.$on("blur",e[35]),l.$on("keydown",e[36]),l.$on("keydown",e[37]);let v=e[6]&&we(e),I=e[0].length>0&&e[1].length===0&&Se();return{c(){t=M("div"),B(l.$$.fragment),n=E(),i=M("ul"),v&&v.c(),d=E(),I&&I.c(),c(i,"role","listbox"),c(i,"aria-labelledby",f=e[2]+"-label"),c(i,"id",u=e[2]+"-listbox"),c(i,"class","svelte-1n7ww29"),Y(i,"svelte-typeahead-list",!0),c(t,"data-svelte-typeahead",""),c(t,"role","combobox"),c(t,"aria-haspopup","listbox"),c(t,"aria-owns",b=e[2]+"-listbox"),c(t,"aria-controls",F=e[2]+"-listbox"),c(t,"aria-expanded",g=e[6]||e[5]&&e[0].length>0&&e[1].length===0),c(t,"id",w=e[2]+"-typeahead"),c(t,"class","svelte-1n7ww29"),Y(t,"dropdown",e[1].length>0)},m(o,m){N(o,t,m),H(l,t,null),D(t,n),D(t,i),v&&v.m(i,null),D(i,d),I&&I.m(i,null),e[41](t),h=!0,y||(S=W(window,"click",e[26]),y=!0)},p(o,m){const T=m[0]&16918?de(k,[m[0]&4&&{id:o[2]},k[1],m[0]&16384&&je(o[14]),k[3],m[0]&4&&{"aria-controls":o[2]+"-listbox"},m[0]&4&&{"aria-labelledby":o[2]+"-label"},m[0]&534&&{"aria-activedescendant":o[9]>=0&&!o[4]&&o[1].length>0?`${o[2]}-result-${o[9]}`:null}]):{};!s&&m[0]&256&&(s=!0,T.ref=o[8],he(()=>s=!1)),!a&&m[0]&1&&(a=!0,T.value=o[0],he(()=>a=!1)),l.$set(T),o[6]?v?(v.p(o,m),m[0]&64&&O(v,1)):(v=we(o),v.c(),O(v,1),v.m(i,d)):v&&(Ee(),q(v,1,1,()=>{v=null}),ze()),o[0].length>0&&o[1].length===0?I||(I=Se(),I.c(),I.m(i,null)):I&&(I.d(1),I=null),(!h||m[0]&4&&f!==(f=o[2]+"-label"))&&c(i,"aria-labelledby",f),(!h||m[0]&4&&u!==(u=o[2]+"-listbox"))&&c(i,"id",u),(!h||m[0]&4&&b!==(b=o[2]+"-listbox"))&&c(t,"aria-owns",b),(!h||m[0]&4&&F!==(F=o[2]+"-listbox"))&&c(t,"aria-controls",F),(!h||m[0]&99&&g!==(g=o[6]||o[5]&&o[0].length>0&&o[1].length===0))&&c(t,"aria-expanded",g),(!h||m[0]&4&&w!==(w=o[2]+"-typeahead"))&&c(t,"id",w),(!h||m[0]&2)&&Y(t,"dropdown",o[1].length>0)},i(o){h||(O(l.$$.fragment,o),O(v),h=!0)},o(o){q(l.$$.fragment,o),q(v),h=!1},d(o){o&&U(t),R(l),v&&v.d(),I&&I.d(),e[41](null),y=!1,S()}}}function qt(e,t,l){let s,a,n;const i=["id","value","data","extract","disable","filter","autoselect","inputAfterSelect","results","focusAfterSelect","showDropdownOnFocus","limit"];let d=ae(t,i),{$$slots:f={},$$scope:u}=t;const b=ut(f);let{id:F="typeahead-"+Math.random().toString(36)}=t,{value:g=""}=t,{data:w=[]}=t,{extract:h=r=>r}=t,{disable:y=r=>!1}=t,{filter:S=r=>!1}=t,{autoselect:k=!0}=t,{inputAfterSelect:_="update"}=t,{results:A=[]}=t,{focusAfterSelect:V=!1}=t,{showDropdownOnFocus:v=!1}=t,{limit:I=1/0}=t;const o=Le();let m=null,T=null,z=!1,j=-1,p="",C=!1;ue(()=>{p!==a&&k&&l(9,j=Re()),p!==a&&!b["no-results"]&&l(4,z=A.length===0),p=a});async function Q(){const r=A[j];if(r.disabled)return;const L=h(r.original),G=g;_==="clear"&&l(0,g=""),_==="update"&&l(0,g=L),o("select",{selectedIndex:j,searched:G,selected:L,original:r.original,originalIndex:r.index}),await ft(),V&&T.focus(),ie()}function Re(){var G,me;let r=0,L=((G=A[r])==null?void 0:G.disabled)??!1;for(;L;)r===A.length?r=0:r+=1,L=((me=A[r])==null?void 0:me.disabled)??!1;return r}function re(r){let L=r===1&&j===A.length-1?0:j+r;L<0&&(L=A.length-1);let G=A[L].disabled;for(;G;)L===A.length?L=0:L+=r,G=A[L].disabled;l(9,j=L)}const ce=()=>l(4,z=!1),ie=()=>l(4,z=!0),Ge=({target:r})=>{!z&&!(m!=null&&m.contains(r))&&ie()};function Ke(r){T=r,l(8,T)}function Je(r){g=r,l(0,g)}function Xe(r){P.call(this,e,r)}function Qe(r){P.call(this,e,r)}function Ye(r){P.call(this,e,r)}function Ze(r){P.call(this,e,r)}const xe=()=>{ce(),v&&(l(6,n=!0),l(5,C=!0))};function $e(r){P.call(this,e,r)}function et(r){P.call(this,e,r)}function tt(r){P.call(this,e,r)}const lt=r=>{if(A.length!==0)switch(r.key){case"Enter":Q();break;case"ArrowDown":r.preventDefault(),re(1);break;case"ArrowUp":r.preventDefault(),re(-1);break;case"Escape":r.preventDefault(),l(0,g=""),T==null||T.focus(),ie();break}},it=(r,L)=>{r.disabled||(l(9,j=L),Q())},nt=(r,L,G)=>{G.key==="Enter"&&(r.disabled||(l(9,j=L),Q()))},at=(r,L)=>{r.disabled||l(9,j=L)};function st(r){$[r?"unshift":"push"](()=>{m=r,l(7,m)})}return e.$$set=r=>{t=J(J({},t),qe(r)),l(14,d=ae(t,i)),"id"in r&&l(2,F=r.id),"value"in r&&l(0,g=r.value),"data"in r&&l(15,w=r.data),"extract"in r&&l(16,h=r.extract),"disable"in r&&l(17,y=r.disable),"filter"in r&&l(18,S=r.filter),"autoselect"in r&&l(19,k=r.autoselect),"inputAfterSelect"in r&&l(20,_=r.inputAfterSelect),"results"in r&&l(1,A=r.results),"focusAfterSelect"in r&&l(21,V=r.focusAfterSelect),"showDropdownOnFocus"in r&&l(3,v=r.showDropdownOnFocus),"limit"in r&&l(22,I=r.limit),"$$scope"in r&&l(24,u=r.$$scope)},e.$$.update=()=>{e.$$.dirty[0]&65536&&l(23,s={pre:"<mark>",post:"</mark>",extract:h}),e.$$.dirty[0]&13074433&&l(1,A=g!==""?X.filter(g,w,s).filter(({score:r})=>r>0).slice(0,I).filter(r=>!S(r.original)).map(r=>({...r,disabled:y(r.original)})):w.map(r=>({string:h(r),original:r}))),e.$$.dirty[0]&65538&&(a=A.map(r=>h(r.original)).join("")),e.$$.dirty[0]&50&&l(6,n=!z&&A.length>0&&C),e.$$.dirty[0]&104&&v&&l(6,n=n&&C)},[g,A,F,v,z,C,n,m,T,j,Q,re,ce,ie,d,w,h,y,S,k,_,V,I,s,u,f,Ge,Ke,Je,Xe,Qe,Ye,Ze,xe,$e,et,tt,lt,it,nt,at,st]}class Be extends ee{constructor(t){super(),te(this,t,qt,Ot,le,{id:2,value:0,data:15,extract:16,disable:17,filter:18,autoselect:19,inputAfterSelect:20,results:1,focusAfterSelect:21,showDropdownOnFocus:3,limit:22},null,[-1,-1])}}Be.__docgen={version:3,name:"index.svelte",data:[{keywords:[{name:"typedef",description:"{Object} TItem"},{name:"property",description:"{number} index"},{name:"property",description:"{string} embed"}],visibility:"public",description:"@typedef {Object} TItem",name:"id",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"value",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:"",bind:[{source:"Search",property:"value"}]},{keywords:[{name:"type",description:"{TItem[]}"}],visibility:"public",description:"",name:"data",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"TItem[]",type:"TItem[]"}},{keywords:[{name:"type",description:"{(item: TItem) => any}"}],visibility:"public",description:"",name:"extract",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"(item: TItem) => any",type:"(item: TItem) => any"}},{keywords:[{name:"type",description:"{(item: TItem) => boolean}"}],visibility:"public",description:"",name:"disable",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"(item: TItem) => boolean",type:"(item: TItem) => boolean"}},{keywords:[{name:"type",description:"{(item: TItem) => boolean}"}],visibility:"public",description:"",name:"filter",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"(item: TItem) => boolean",type:"(item: TItem) => boolean"}},{keywords:[],visibility:"public",description:"Set to `false` to prevent the first result from being selected",name:"autoselect",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!0},{keywords:[{name:"type",description:'{"update" | "clear" | "keep"}'}],visibility:"public",description:"Set to `keep` to keep the search field unchanged after select, set to `clear` to auto-clear search field",name:"inputAfterSelect",kind:"let",static:!1,readonly:!1,type:{kind:"union",text:'"update" | "clear" | "keep"',type:[{kind:"type",text:'"update"',type:'"update"'},{kind:"type",text:'"clear"',type:'"clear"'},{kind:"type",text:'"keep"',type:'"keep"'}]},defaultValue:"update"},{keywords:[{name:"type",description:"{{ original: TItem; index: number; score: number; string: string; disabled?: boolean; }[]}"}],visibility:"public",description:"",name:"results",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"{ original: TItem; index: number; score: number; string: string; disabled?: boolean; }[]",type:"{ original: TItem; index: number; score: number; string: string; disabled?: boolean; }[]"}},{keywords:[],visibility:"public",description:"Set to `true` to re-focus the input after selecting a result",name:"focusAfterSelect",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1},{keywords:[],visibility:"public",description:"Set to `true` to only show results when the input is focused",name:"showDropdownOnFocus",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"boolean",type:"boolean"},defaultValue:!1},{keywords:[{name:"type",description:"{number}"}],visibility:"public",description:"Specify the maximum number of results to return",name:"limit",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"number",type:"number"}}],computed:[],methods:[],components:[],description:null,keywords:[],events:[{visibility:"public",description:null,keywords:[],name:"select"},{keywords:[],visibility:"public",description:"",name:"type",parent:"Search",modificators:[],locations:null},{keywords:[],visibility:"public",description:"",name:"input",parent:"Search",modificators:[],locations:null},{keywords:[],visibility:"public",description:"",name:"change",parent:"Search",modificators:[],locations:null},{keywords:[],visibility:"public",description:"",name:"focus",parent:"Search",modificators:[],locations:null},{keywords:[],visibility:"public",description:"",name:"clear",parent:"Search",modificators:[],locations:null},{keywords:[],visibility:"public",description:"",name:"blur",parent:"Search",modificators:[],locations:null},{keywords:[],visibility:"public",description:"",name:"keydown",parent:"Search",modificators:[],locations:null}],slots:[{keywords:[],visibility:"public",description:"",name:"default",params:[{name:"{result}",type:{kind:"type",text:"*",type:"any"}},{name:"{index}",type:{kind:"type",text:"*",type:"any"}},{name:"{value}",type:{kind:"type",text:"*",type:"any"}}],parameters:[{name:"{result}",type:{kind:"type",text:"*",type:"any"}},{name:"{index}",type:{kind:"type",text:"*",type:"any"}},{name:"{value}",type:{kind:"type",text:"*",type:"any"}}]}],refs:[]};function Et(e){let t,l,s,a,n,i,d,f,u,b,F,g,w,h,y,S,k,_,A,V,v,I;return f=new se({props:{icon:_t}}),b=new Be({props:{label:"Select an embed",value:e[6][e[0].indexOf(e[4])]||e[6][e[5]]||e[6][0],extract:e[8],data:e[0].map(Ae),placeholder:"Search",showDropdownOnFocus:!0}}),b.$on("select",e[9]),A=new se({props:{icon:Ne}}),v=new Ue({props:{breakpoints:e[1],minFrameWidth:e[2],maxFrameWidth:e[3]}}),{c(){t=M("div"),l=M("header"),l.innerHTML='<img src="https://graphics.thomsonreuters.com/style-assets/images/logos/reuters-graphics-logo/svg/graphics-logo-dark.svg" alt=""/>',s=E(),a=M("div"),n=M("div"),i=M("a"),d=ne("Live link "),B(f.$$.fragment),u=E(),B(b.$$.fragment),F=E(),g=M("div"),w=M("p"),w.textContent="Preview",h=E(),y=M("div"),S=E(),k=M("div"),_=M("a"),B(A.$$.fragment),V=E(),B(v.$$.fragment),c(l,"class","svelte-6lwy9l"),c(i,"rel","external"),c(i,"target","_blank"),c(i,"href",e[4]),c(i,"title",e[4]),c(i,"class","svelte-6lwy9l"),c(n,"class","embed-link svelte-6lwy9l"),c(a,"id","typeahead-container"),c(a,"class","svelte-6lwy9l"),c(w,"class","svelte-6lwy9l"),c(g,"id","preview-label"),Z(g,"width",e[7]+"px"),c(g,"class","svelte-6lwy9l"),c(y,"id","frame-parent"),Z(y,"width",e[7]+"px"),c(y,"class","svelte-6lwy9l"),c(t,"class","container"),c(_,"rel","external"),c(_,"href","./../"),c(_,"class","svelte-6lwy9l"),c(k,"id","home-link"),c(k,"class","svelte-6lwy9l")},m(o,m){N(o,t,m),D(t,l),D(t,s),D(t,a),D(a,n),D(n,i),D(i,d),H(f,i,null),D(a,u),H(b,a,null),D(t,F),D(t,g),D(g,w),D(t,h),D(t,y),N(o,S,m),N(o,k,m),D(k,_),H(A,_,null),N(o,V,m),H(v,o,m),I=!0},p(o,[m]){(!I||m&16)&&c(i,"href",o[4]),(!I||m&16)&&c(i,"title",o[4]);const T={};m&113&&(T.value=o[6][o[0].indexOf(o[4])]||o[6][o[5]]||o[6][0]),m&64&&(T.extract=o[8]),m&1&&(T.data=o[0].map(Ae)),b.$set(T),(!I||m&128)&&Z(g,"width",o[7]+"px"),(!I||m&128)&&Z(y,"width",o[7]+"px");const z={};m&2&&(z.breakpoints=o[1]),m&4&&(z.minFrameWidth=o[2]),m&8&&(z.maxFrameWidth=o[3]),v.$set(z)},i(o){I||(O(f.$$.fragment,o),O(b.$$.fragment,o),O(A.$$.fragment,o),O(v.$$.fragment,o),I=!0)},o(o){q(f.$$.fragment,o),q(b.$$.fragment,o),q(A.$$.fragment,o),q(v.$$.fragment,o),I=!1},d(o){o&&(U(t),U(S),U(k),U(V)),R(f),R(b),R(A),R(v,o)}}}const Ae=(e,t)=>({index:t,embed:e});function zt(e,t,l){let s,a;De(e,K,y=>l(7,a=y));let{embeds:n}=t,{breakpoints:i=[330,510,660,930,1200]}=t,{minFrameWidth:d=320}=t,{maxFrameWidth:f=1200}=t,b=(()=>{if(typeof window>"u")return n[0];const y=window.localStorage.getItem("framer-active-embed");return y&&n.indexOf(y)>-1?y:n[0]})(),F=n.indexOf(b);const g=y=>{const S=n.indexOf(y)>-1?y:n[F]||n[0];new vt.Parent("frame-parent",/^http/.test(S)?S:wt(window.location.origin,S,{trailingSlash:!0}))};Oe(()=>{g(b)}),ue(()=>{g(b)});const w=y=>s[y.index],h=({detail:y})=>{typeof window<"u"&&window.localStorage.setItem("framer-active-embed",y.original.embed),l(4,b=y.original.embed),l(5,F=y.original.index)};return e.$$set=y=>{"embeds"in y&&l(0,n=y.embeds),"breakpoints"in y&&l(1,i=y.breakpoints),"minFrameWidth"in y&&l(2,d=y.minFrameWidth),"maxFrameWidth"in y&&l(3,f=y.maxFrameWidth)},e.$$.update=()=>{e.$$.dirty&1&&l(6,s=It(n))},[n,i,d,f,b,F,s,a,w,h]}class fe extends ee{constructor(t){super(),te(this,t,zt,Et,le,{embeds:0,breakpoints:1,minFrameWidth:2,maxFrameWidth:3})}}fe.__docgen={version:3,name:"Framer.svelte",data:[{visibility:"public",description:null,keywords:[],name:"embeds",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}},{visibility:"public",description:null,keywords:[],name:"breakpoints",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"array",type:"array"}},{visibility:"public",description:null,keywords:[],name:"minFrameWidth",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"number",type:"number"},defaultValue:320},{visibility:"public",description:null,keywords:[],name:"maxFrameWidth",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"number",type:"number"},defaultValue:1200}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};function Ct(e){let t,l;const s=[e[0]];let a={};for(let n=0;n<s.length;n+=1)a=J(a,s[n]);return t=new fe({props:a}),{c(){B(t.$$.fragment)},m(n,i){H(t,n,i),l=!0},p(n,i){const d=i&1?de(s,[je(n[0])]):{};t.$set(d)},i(n){l||(O(t.$$.fragment,n),l=!0)},o(n){q(t.$$.fragment,n),l=!1},d(n){R(t,n)}}}function jt(e){let t,l,s,a,n,i;const d=[{title:"Components/Framer"},{component:fe},bt(Ft)];let f={};for(let u=0;u<d.length;u+=1)f=J(f,d[u]);return t=new yt({props:f}),s=new ht({props:{$$slots:{default:[Ct,({args:u})=>({0:u}),({args:u})=>u?1:0]},$$scope:{ctx:e}}}),n=new kt({props:{name:"Default",args:{embeds:["https://graphics.reuters.com/USA-CONGRESS/FUNDRAISING/zjvqkawjlvx/embeds/en/embed/?zzz"]}}}),{c(){B(t.$$.fragment),l=E(),B(s.$$.fragment),a=E(),B(n.$$.fragment)},m(u,b){H(t,u,b),N(u,l,b),H(s,u,b),N(u,a,b),H(n,u,b),i=!0},p(u,[b]){const F={};t.$set(F);const g={};b&3&&(g.$$scope={dirty:b,ctx:u}),s.$set(g)},i(u){i||(O(t.$$.fragment,u),O(s.$$.fragment,u),O(n.$$.fragment,u),i=!0)},o(u){q(t.$$.fragment,u),q(s.$$.fragment,u),q(n.$$.fragment,u),i=!1},d(u){u&&(U(l),U(a)),R(t,u),R(s,u),R(n,u)}}}class Nt extends ee{constructor(t){super(),te(this,t,null,jt,le,{})}}const He=pt(Nt,{meta:{title:"Components/Framer"},stories:{"tpl:default":{name:"default",template:!0,source:"<Framer {...args} />",hasArgs:!0},Default:{name:"Default",template:!1,source:"",hasArgs:!1}},allocatedIds:["default","Meta","Template","Story","componentDocs","Framer","withComponentDocs"]}),Yt=He.meta,Zt=["Default"],xt=He.stories.Default;export{xt as Default,Zt as __namedExportsOrder,Yt as default};